@glassanalytics/cli 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@ var __export = (target, all) => {
5
5
  };
6
6
 
7
7
  // <define:__GLASS_ASSETS__>
8
- var define_GLASS_ASSETS_default = { sdk: '"use strict";(()=>{var M=Object.defineProperty;var _=(i,e,t)=>e in i?M(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var a=(i,e,t)=>_(i,typeof e!="symbol"?e+"":e,t);function x(i){let e=new Uint8Array(i);return crypto.getRandomValues(e),e}function T(i){let e="";for(let t of i)e+=t.toString(16).padStart(2,"0");return e}function p(i=Date.now()){let e=x(16),t=i;for(let n=5;n>=0;n--)e[n]=t&255,t=Math.floor(t/256);e[6]=e[6]&15|112,e[8]=e[8]&63|128;let s=T(e);return`${s.slice(0,8)}-${s.slice(8,12)}-${s.slice(12,16)}-${s.slice(16,20)}-${s.slice(20)}`}var w="0.1.0";var I=\'a, button, [role="button"], input[type="submit"], input[type="button"], [data-glass-event]\';function R(i){let e=location.href,t=()=>{location.href!==e&&(i.pageleave(),e=location.href,i.pageview())},s=history.pushState,n=history.replaceState;return history.pushState=function(...r){s.apply(this,r),queueMicrotask(t)},history.replaceState=function(...r){n.apply(this,r),queueMicrotask(t)},addEventListener("popstate",t),i.pageview(),()=>{history.pushState=s,history.replaceState=n,removeEventListener("popstate",t)}}function j(i){return i instanceof HTMLInputElement?i.value&&i.type!=="password"?i.value.slice(0,60):"":(i.textContent??"").replace(/\\s+/g," ").trim().slice(0,60)}function E(i){let e=t=>{let s=t.target instanceof Element?t.target.closest(I):null;if(!s||s.closest("[data-glass-no-capture]"))return;let n=s.getAttribute("data-glass-event");if(n){let o={};for(let l of Array.from(s.attributes))l.name.startsWith("data-glass-prop-")&&(o[l.name.slice(16).replace(/-/g,"_")]=l.value);i.capture(n,o);return}let r={tag:s.tagName.toLowerCase(),text:j(s)};s.id&&(r.id=s.id),s instanceof HTMLAnchorElement&&s.href&&(r.href=s.href.split("?")[0],r.outbound=s.host!==location.host),i.capture("$click",r)};return addEventListener("click",e,{capture:!0}),()=>removeEventListener("click",e,{capture:!0})}function k(i,e){let t=0,s=new Set,n=(l,c,v,m={})=>{let S=`${l}:${c}`;t>=10||s.has(S)||(s.add(S),t++,i.capture("$exception",{type:l,message:c.slice(0,500),stack:v?.slice(0,2e3),...m}),e())},r=l=>{let c=l.error instanceof Error?l.error:null;n(c?.name??"Error",c?.message??l.message??"Unknown error",c?.stack,{source:l.filename,line:l.lineno,column:l.colno})},o=l=>{let c=l.reason;c instanceof Error?n(c.name,c.message,c.stack,{unhandled_rejection:!0}):n("UnhandledRejection",String(c),void 0,{unhandled_rejection:!0})};return addEventListener("error",r),addEventListener("unhandledrejection",o),()=>{removeEventListener("error",r),removeEventListener("unhandledrejection",o)}}var A=30*6e4,h=class{constructor(e,t){a(this,"memory",new Map);a(this,"project");a(this,"persistence");this.project=e,this.persistence=t}setPersistence(e){e==="cookieless"&&this.clear(),this.persistence=e}get cookieless(){return this.persistence==="cookieless"}key(e){return`glass:${this.project}:${e}`}get(e){if(!this.cookieless)try{return localStorage.getItem(this.key(e))}catch{}return this.memory.get(e)??null}set(e,t){if(t===null?this.memory.delete(e):this.memory.set(e,t),!this.cookieless)try{t===null?localStorage.removeItem(this.key(e)):localStorage.setItem(this.key(e),t)}catch{}}clear(){for(let e of["id","user","session","flags"])this.set(e,null);this.memory.clear()}distinctId(){if(this.cookieless)return null;let e=this.get("id");return e||(e=p(),this.set("id",e)),e}userId(){return this.get("user")}setUserId(e){this.set("user",e)}session(e=!0){let t=Date.now(),s=null;try{s=JSON.parse(this.get("session")??"null")}catch{s=null}let n=!s||t-s.last>A;return(!s||n)&&(s={id:p(t),last:t}),e&&(s.last=t),this.set("session",JSON.stringify(s)),{...s,isNew:n}}setReplayDecision(e){let t=this.session(!1);this.set("session",JSON.stringify({id:t.id,last:t.last,replay:e}))}};var d=class{constructor(e,t,s,n){a(this,"queue",[]);a(this,"timer",null);a(this,"endpoint");a(this,"project");a(this,"lib");a(this,"intervalMs");this.endpoint=e,this.project=t,this.lib=s,this.intervalMs=n}push(e){this.queue.push(e),this.queue.length>500&&this.queue.splice(0,this.queue.length-500),this.queue.length>=20?this.flush():this.schedule()}schedule(){this.timer||(this.timer=setTimeout(()=>{this.timer=null,this.flush()},this.intervalMs))}body(e){let t={project:this.project,sent_at:Date.now(),lib:this.lib,events:e};return JSON.stringify(t)}async flush(){for(this.timer&&(clearTimeout(this.timer),this.timer=null);this.queue.length>0;){let e=this.queue.splice(0,20);try{let t=await fetch(this.endpoint,{method:"POST",body:this.body(e),headers:{"Content-Type":"text/plain"},keepalive:!0});if(t.status>=500)throw new Error(`HTTP ${t.status}`)}catch{this.queue.unshift(...e),this.schedule();return}}}beacon(){if(this.queue.length===0)return;let e=this.queue.splice(0,this.queue.length),t=this.body(e);typeof navigator<"u"&&typeof navigator.sendBeacon=="function"&&navigator.sendBeacon(this.endpoint,new Blob([t],{type:"text/plain"}))||fetch(this.endpoint,{method:"POST",body:t,keepalive:!0,headers:{"Content-Type":"text/plain"}}).catch(()=>{})}};function P(i){let e={},t=[],s=(r,o,l={})=>{try{let c=new PerformanceObserver(v=>{for(let m of v.getEntries())o(m)});c.observe({type:r,buffered:!0,...l}),t.push(c)}catch{}};s("largest-contentful-paint",r=>{e.LCP=r.startTime}),s("layout-shift",r=>{let o=r;o.hadRecentInput||(e.CLS=(e.CLS??0)+o.value)}),s("event",r=>{let o=r;o.interactionId&&(e.INP=Math.max(e.INP??0,o.duration))},{durationThreshold:16}),s("paint",r=>{r.name==="first-contentful-paint"&&(e.FCP=r.startTime)});try{let r=performance.getEntriesByType("navigation")[0];r&&r.responseStart>0&&(e.TTFB=r.responseStart)}catch{}let n=!1;return()=>{if(!n){n=!0;for(let r of t)r.disconnect();for(let[r,o]of Object.entries(e))typeof o=="number"&&Number.isFinite(o)&&i(r,r==="CLS"?Math.round(o*1e3)/1e3:Math.round(o))}}}var g=class{constructor(){a(this,"version",w);a(this,"options",null);a(this,"host","");a(this,"store",null);a(this,"transport",null);a(this,"flagValues",{});a(this,"flagsLoaded",!1);a(this,"flagListeners",new Set);a(this,"exposed",new Set);a(this,"replay",null);a(this,"replayMode",null);a(this,"replaySession",null);a(this,"teardown",[]);a(this,"pageStart",Date.now())}init(e){if(this.options)return this;if(!e?.host||!e?.project)return console.warn("[glass] init() needs { host, project }"),this;if(typeof window>"u")return this;this.options=e,this.host=new URL(e.host.replace(/\\/+$/,""),location.href).href.replace(/\\/+$/,""),this.store=new h(e.project,e.persistence??"localStorage"),this.transport=new d(`${this.host}/e`,e.project,`web/${w}`,e.flushIntervalMs??5e3);try{this.flagValues=JSON.parse(this.store.get("flags")??"{}")}catch{this.flagValues={}}e.flags!==!1&&this.reloadFlags();let t=e.autocapture===!1?{pageviews:!1,clicks:!1,errors:!1,webVitals:!1}:e.autocapture===!0||!e.autocapture?{}:e.autocapture,s={pageview:()=>{this.pageStart=Date.now(),this.capture("$pageview")},pageleave:()=>this.capture("$pageleave",{duration_ms:Date.now()-this.pageStart}),capture:(o,l)=>this.capture(o,l)},n=null;if(t.webVitals!==!1&&(n=P((o,l)=>this.capture("$web_vitals",{metric:o,value:l}))),t.pageviews!==!1&&this.teardown.push(R(s)),t.clicks!==!1&&this.teardown.push(E(s)),t.errors!==!1){let o=()=>{this.replay?.noteError(),this.replay?.flushBuffer(),this.replayMode==="buffer"&&(this.replayMode="record")};this.teardown.push(k(s,o))}let r=()=>{document.visibilityState==="hidden"&&(n?.(),n=null,t.pageviews!==!1&&s.pageleave(),this.transport?.beacon())};return addEventListener("visibilitychange",r),addEventListener("pagehide",r),this.teardown.push(()=>{removeEventListener("visibilitychange",r),removeEventListener("pagehide",r)}),this.maybeStartReplay(),this}capture(e,t={}){let s=this.store;if(!s||!this.transport)return;let n=s.session();n.isNew&&this.replay&&this.restartReplay();let r={id:p(),event:e,ts:Date.now(),distinct_id:s.distinctId(),user_id:s.userId(),session_id:s.cookieless?null:n.id,url:location.href,referrer:document.referrer||null,title:document.title,props:t};Object.keys(this.flagValues).length>0&&(r.flags={...this.flagValues});let o=this.options?.beforeSend?this.options.beforeSend(r):r;o&&(this.options?.debug&&console.debug("[glass]",o.event,o),this.transport.push(o))}identify(e,t={}){!this.store||!e||(this.store.setUserId(String(e)),this.capture("$identify",{$set:t}),this.reloadFlags())}setPersonProperties(e,t=!1){this.capture("$set",t?{$set_once:e}:{$set:e})}reset(){this.store&&(this.replay?.stop(),this.replay=null,this.store.clear(),this.flagValues={},this.exposed.clear(),this.reloadFlags())}flag(e){let t=this.flagValues[e]??null;return t!==null&&!this.exposed.has(e)&&(this.exposed.add(e),this.capture("$exposure",{flag:e,variant:t})),t}isEnabled(e){return this.flag(e)!==null}flags(){return{...this.flagValues}}onFlags(e){return this.flagListeners.add(e),this.flagsLoaded&&e(this.flags()),()=>this.flagListeners.delete(e)}async reloadFlags(){if(!(!this.store||!this.options))try{let e=await fetch(`${this.host}/f`,{method:"POST",headers:{"Content-Type":"text/plain"},body:JSON.stringify({project:this.options.project,distinct_id:this.store.distinctId(),user_id:this.store.userId()})});if(!e.ok)return;let t=await e.json();this.flagValues=t.flags??{},this.store.set("flags",JSON.stringify(this.flagValues))}catch{}finally{this.flagsLoaded=!0;for(let e of this.flagListeners)e(this.flags())}}consent(e){this.store&&(this.store.setPersistence(e?"localStorage":"cookieless"),e?this.maybeStartReplay():(this.replay?.stop(),this.replay=null))}async startReplay(){if(this.store?.setReplayDecision("record"),this.replay&&this.replayMode==="buffer"){this.replay.flushBuffer(),this.replayMode="record";return}this.replay||await this.loadReplay("record")}stopReplay(){this.store?.setReplayDecision("off"),this.replay?.stop(),this.replay=null}distinctId(){return this.store?.distinctId()??null}sessionId(){return this.store&&!this.store.cookieless?this.store.session(!1).id:null}flush(){return this.transport?.flush()??Promise.resolve()}shutdown(){for(let e of this.teardown.splice(0))e();this.replay?.stop(),this.replay=null,this.transport?.beacon(),this.options=null}async maybeStartReplay(){let e=this.options?.replay;if(!e||!this.store||this.store.cookieless||this.replay)return;let s=this.store.session(!1).replay;s||(s=Math.random()<(e.sampleRate??0)?"record":Math.random()<(e.onErrorSampleRate??0)?"buffer":"off",this.store.setReplayDecision(s)),s!=="off"&&await this.loadReplay(s)}async restartReplay(){this.replay?.stop(),this.replay=null,await this.maybeStartReplay()}async loadReplay(e){if(!this.store||!this.options)return;let t=await O(this.host);if(!t||!this.store||!this.options)return;let s=this.options.replay||{},n=this.store.session(!1);this.replaySession=n.id,this.replayMode=e,this.replay=t.startReplay({host:this.host,project:this.options.project,sessionId:this.replaySession,distinctId:this.store.distinctId(),userId:this.store.userId(),mode:e,maskAllText:s.maskAllText??!1,blockSelector:s.blockSelector??"[data-glass-block]"})}},f=null;function O(i){return window.__glassReplay?Promise.resolve(window.__glassReplay):(f??(f=new Promise(e=>{let t=document.createElement("script");t.src=`${i}/replay.js`,t.async=!0,t.onload=()=>e(window.__glassReplay??null),t.onerror=()=>{f=null,e(null)},document.head.appendChild(t)})),f)}var L=window,$=L.glass?.q??[],y=new g;L.glass=y;var b=document.currentScript,u=b?.dataset;if(b&&u?.project){let i=u.host??new URL(b.src,location.href).href.replace(/\\/s\\.js(\\?.*)?$/,""),e=Number(u.replaySampleRate??0),t=Number(u.replayOnErrorSampleRate??0);y.init({host:i,project:u.project,persistence:u.persistence==="cookieless"?"cookieless":"localStorage",autocapture:u.autocapture!=="false",replay:e>0||t>0?{sampleRate:e,onErrorSampleRate:t}:!1,debug:u.debug==="true"})}for(let[i,...e]of $){let t=y[i];typeof t=="function"&&t.apply(y,e)}})();\n', replay: '"use strict";(()=>{var En=Object.defineProperty,xn=(e,t,s)=>t in e?En(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,I=(e,t,s)=>xn(e,typeof t!="symbol"?t+"":t,s),ls,Rn=Object.defineProperty,Mn=(e,t,s)=>t in e?Rn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,us=(e,t,s)=>Mn(e,typeof t!="symbol"?t+"":t,s),J=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(J||{}),cs={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},hs={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Fe={},Ar={},fs=0,Nn=()=>!!globalThis.Zone;function jr(e){if(Fe[e])return Fe[e];let t=globalThis[e],s=t.prototype,a=e in cs?cs[e]:void 0,r=!!(a&&a.every(m=>{var l,d;return!!((d=(l=Object.getOwnPropertyDescriptor(s,m))==null?void 0:l.get)!=null&&d.toString().includes("[native code]"))})),c=e in hs?hs[e]:void 0,f=!!(c&&c.every(m=>{var l;return typeof s[m]=="function"&&((l=s[m])==null?void 0:l.toString().includes("[native code]"))}));if(r&&f&&!Nn())return Fe[e]=t.prototype,t.prototype;try{let m=document.createElement("iframe");m.style.display="none",document.body.appendChild(m);let l=m.contentWindow;if(!l)return t.prototype;let d=l[e].prototype;if(!d)return m.remove(),s;let i=navigator.userAgent;return i.includes("Safari")&&!i.includes("Chrome")?(m.classList.add("rr-block"),m.setAttribute("__rrwebUntaintedMutationObserver",""),Ar[e]=()=>m.remove()):m.remove(),Fe[e]=d}catch{return s}}var xt={};function oe(e,t,s){var a,r;let c=(a=xt[e])==null?void 0:a[s];if(c)return c.call(t);let f=jr(e),m=(r=Object.getOwnPropertyDescriptor(f,s))==null?void 0:r.get;return m?((xt[e]||(xt[e]={}))[s]=m,m.call(t)):t[s]}var Rt={};function Ti(e,t,s){let a=`${e}.${String(s)}`;if(Rt[a])return Rt[a].bind(t);let c=jr(e)[s];return typeof c!="function"?t[s]:(Rt[a]=c,c.bind(t))}function On(e){return oe("Node",e,"ownerDocument")}function In(e){return oe("Node",e,"childNodes")}function An(e){return oe("Node",e,"parentNode")}function Dn(e){return oe("Node",e,"parentElement")}function Tn(e){return oe("Node",e,"textContent")}function _n(e){return oe("Node",e,"firstChild")}function Pn(e){return oe("Node",e,"lastChild")}function kn(e){return oe("Node",e,"nextSibling")}function Ln(e){return oe("Node",e,"previousSibling")}function Fn(e,t){return Ti("Node",e,"contains")(t)}function Un(e){return Ti("Node",e,"getRootNode")()}function $n(e){return!e||!("host"in e)?null:oe("ShadowRoot",e,"host")}function Bn(e){return e.styleSheets}function Wn(e){return!e||!("shadowRoot"in e)?null:oe("Element",e,"shadowRoot")}function zn(e,t){return oe("Element",e,"querySelector")(t)}function qn(e,t){return oe("Element",e,"querySelectorAll")(t)}function Vn(){let e=jr("MutationObserver");fs++;let t=!1;return[e.constructor,()=>{if(t||(t=!0,--fs!==0))return;let s=Ar.MutationObserver;if(s)try{s()}finally{delete Fe.MutationObserver,delete Ar.MutationObserver}}]}var _i=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(_i=()=>new Date().getTime());function jn(e,t,s){try{if(!(t in e))return()=>{};let a=e[t],r=s(a);return typeof r=="function"&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:a}})),e[t]=r,()=>{e[t]=a}}catch{return()=>{}}}var X={ownerDocument:On,childNodes:In,parentNode:An,parentElement:Dn,textContent:Tn,firstChild:_n,lastChild:Pn,nextSibling:kn,previousSibling:Ln,contains:Fn,getRootNode:Un,host:$n,styleSheets:Bn,shadowRoot:Wn,querySelector:zn,querySelectorAll:qn,nowTimestamp:_i,mutationObserverCtor:Vn,patch:jn};function Pi(e){return e.nodeType===e.ELEMENT_NODE}function $e(e){let t=e&&"host"in e&&"mode"in e&&X.host(e)||null;return!!(t&&"shadowRoot"in t&&X.shadowRoot(t)===e)}function Be(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Gn(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\\sbackground-clip:\\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function Hn(e){let{cssText:t}=e;if(t.split(\'"\').length<3)return t;let s=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?s.push("layer"):e.layerName&&s.push(`layer(${e.layerName})`),e.supportsText&&s.push(`supports(${e.supportsText})`),e.media.length&&s.push(e.media.mediaText),s.join(" ")+";"}function Dr(e){try{let t=e.rules||e.cssRules;if(!t)return null;let s=e.href;!s&&e.ownerNode&&(s=e.ownerNode.baseURI);let a=Array.from(t,r=>ki(r,s)).join("");return Gn(a)}catch{return null}}function ki(e,t){if(Jn(e)){let s;try{s=Dr(e.styleSheet)||Hn(e)}catch{s=e.cssText}return e.styleSheet.href?ot(s,e.styleSheet.href):s}else{let s=e.cssText;return Xn(e)&&e.selectorText.includes(":")&&(s=Yn(s)),t?ot(s,t):s}}function Yn(e){let t=/(\\[(?:[\\w-]+)[^\\\\])(:(?:[\\w-]+)\\])/gm;return e.replace(t,"$1\\\\$2")}function Jn(e){return"styleSheet"in e}function Xn(e){return"selectorText"in e}var st=class{constructor(){us(this,"idNodeMap",new Map),us(this,"nodeMetaMap",new WeakMap)}getId(t){var s;return t?((s=this.getMeta(t))==null?void 0:s.id)??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){let s=this.getId(t);this.idNodeMap.delete(s),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r));let a=X.shadowRoot(t);a&&this.removeNodeFromMap(a)}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,s){let a=s.id;this.idNodeMap.set(a,t),this.nodeMetaMap.set(t,s)}replace(t,s){let a=this.getNode(t);if(a){let r=this.nodeMetaMap.get(a);r&&this.nodeMetaMap.set(s,r)}this.idNodeMap.set(t,s)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Qn(){return new st}function it({element:e,maskInputOptions:t,tagName:s,type:a,value:r,maskInputFn:c}){let f=r||"",m=a&&Ce(a);return(t[s.toLowerCase()]||m&&t[m])&&(c?f=c(f,e):f="*".repeat(f.length)),f}function Ce(e){return e.toLowerCase()}var ds="__rrweb_original__";function Zn(e){let t=e.getContext("2d");if(!t)return!0;let s=50;for(let a=0;a<e.width;a+=s)for(let r=0;r<e.height;r+=s){let c=t.getImageData,f=ds in c?c[ds]:c;if(new Uint32Array(f.call(t,a,r,Math.min(s,e.width-a),Math.min(s,e.height-r)).data.buffer).some(l=>l!==0))return!1}return!0}function nt(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ce(t):null}function Li(e,t){let s;try{s=new URL(e,t??window.location.href)}catch{return null}let a=/\\.([0-9a-z]+)(?:$)/i,r=s.pathname.match(a);return r?.[1]??null}function Kn(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var eo=/url\\((?:(\')([^\']*)\'|(")(.*?)"|([^)]*))\\)/gm,to=/^(?:[a-z+]+:)?\\/\\//i,ro=/^www\\..*/i,so=/^(data:)([^,]*),(.*)/i;function ot(e,t){return(e||"").replace(eo,(s,a,r,c,f,m)=>{let l=r||f||m,d=a||c||"";if(!l)return s;if(to.test(l)||ro.test(l))return`url(${d}${l}${d})`;if(so.test(l))return`url(${d}${l}${d})`;if(l[0]==="/")return`url(${d}${Kn(t)+l}${d})`;let i=l.split("#")[0],h=l.substring(i.length),o=t.split("#")[0].split("/"),n=i.split("/");o.pop();for(let p of n)p!=="."&&(p===".."?o.pop():o.push(p));return`url(${d}${o.join("/")}${h}${d})`})}var Fi="(?:/\\\\*[^*]*\\\\*/)|[\\\\s;]",io=new RegExp(`${Fi}|\\\\b(0)px?`,"g"),no=new RegExp(Fi,"g");function Ye(e,t=!1){return t?e.replace(no,""):e.replace(io,"$1")}function oo(e,t,s=!1){let a=Array.from(t.childNodes),r=[],c=0;if(a.length>1&&e&&typeof e=="string"){let f=Ye(e,s),m=f.length/e.length;for(let l=1;l<a.length;l++)if(a[l].textContent&&typeof a[l].textContent=="string"){let d=Ye(a[l].textContent,s),i=100,h=3;for(;h<d.length&&(d[h].match(/[a-zA-Z0-9]/)||d.indexOf(d.substring(0,h),1)!==-1);h++);for(;h<d.length;h++){let o=d.substring(0,h),n=f.split(o),p=-1;if(n.length===2)p=n[0].length;else if(n.length>2&&n[0]===""&&a[l-1].textContent!=="")p=f.indexOf(o,1);else if(n.length===1){if(o=o.substring(0,o.length-1),n=f.split(o),n.length<=1)return r.push(e),r;h=i+1}else h===d.length-1&&(p=f.indexOf(o));if(n.length>=2&&h>i){let u=a[l-1].textContent;if(u&&typeof u=="string"){let g=Ye(u).length;p=f.indexOf(o,g)}p===-1&&(p=n[0].length)}if(p!==-1){let u=Math.floor(p/m);for(;u>0&&u<e.length;){if(c+=1,c>50*a.length)return r.push(e),r;let g=Ye(e.substring(0,u),s);if(g.length===p){r.push(e.substring(0,u)),e=e.substring(u),f=f.substring(p);break}else g.length<p?u+=Math.max(1,Math.floor((p-g.length)/m)):u-=Math.max(1,Math.floor((g.length-p)*m))}break}}}}return r.push(e),r}function ao(e,t){return oo(e,t).join("/* rr_split */")}var lo=1,uo=new RegExp("[^a-z0-9-_:]"),at=-2;function Ui(){return lo++}function co(e){if(e instanceof HTMLFormElement)return"form";let t=Ce(e.tagName);return uo.test(t)?"div":t}var Ne,ps,ho=/^[^ \\t\\n\\r\\u000c]+/,fo=/^[, \\t\\n\\r\\u000c]+/;function po(e,t){if(t.trim()==="")return t;let s=0;function a(c){let f,m=c.exec(t.substring(s));return m?(f=m[0],s+=f.length,f):""}let r=[];for(;a(fo),!(s>=t.length);){let c=a(ho);if(c.slice(-1)===",")c=Ae(e,c.substring(0,c.length-1)),r.push(c);else{let f="";c=Ae(e,c);let m=!1;for(;;){let l=t.charAt(s);if(l===""){r.push((c+f).trim());break}else if(m)l===")"&&(m=!1);else if(l===","){s+=1,r.push((c+f).trim());break}else l==="("&&(m=!0);f+=l,s+=1}}}return r.join(", ")}var ms=new WeakMap;function Ae(e,t){return!t||t.trim()===""?t:Gr(e,t)}function mo(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Gr(e,t){let s=ms.get(e);if(s||(s=e.createElement("a"),ms.set(e,s)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return s.setAttribute("href",t),s.href}function $i(e,t,s,a){return a&&(s==="src"||s==="href"&&!(t==="use"&&a[0]==="#")||s==="xlink:href"&&a[0]!=="#"||s==="background"&&["table","td","th"].includes(t)?Ae(e,a):s==="srcset"?po(e,a):s==="style"?ot(a,Gr(e)):t==="object"&&s==="data"?Ae(e,a):a)}function Bi(e,t,s){return["video","audio"].includes(e)&&Ce(t)==="autoplay"}function go(e,t,s){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let a=e.classList.length;a--;){let r=e.classList[a];if(t.test(r))return!0}if(s)return e.matches(s)}catch{}return!1}function lt(e,t,s){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return s?lt(X.parentNode(e),t,s):!1;for(let a=e.classList.length;a--;){let r=e.classList[a];if(t.test(r))return!0}return s?lt(X.parentNode(e),t,s):!1}function Wi(e,t,s,a){let r;if(Pi(e)){if(r=e,!X.childNodes(r).length)return!1}else{if(X.parentElement(e)===null)return!1;r=X.parentElement(e)}try{if(typeof t=="string"){if(a){if(r.closest(`.${t}`))return!0}else if(r.classList.contains(t))return!0}else if(lt(r,t,a))return!0;if(s){if(a){if(r.closest(s))return!0}else if(r.matches(s))return!0}}catch{}return!1}function yo(e,t,s){let a=e.contentWindow;if(!a)return;let r=!1,c;try{c=a.document.readyState}catch{return}if(c!=="complete"){let m=setTimeout(()=>{r||(t(),r=!0)},s);e.addEventListener("load",()=>{clearTimeout(m),r=!0,t()});return}let f="about:blank";if(a.location.href!==f||e.src===f||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function wo(e,t,s){let a=!1,r;try{r=e.sheet}catch{return}if(r)return;let c=setTimeout(()=>{a||(t(),a=!0)},s);e.addEventListener("load",()=>{clearTimeout(c),a=!0,t()})}function bo(e,t){let{doc:s,mirror:a,blockClass:r,blockSelector:c,needsMask:f,inlineStylesheet:m,maskInputOptions:l={},maskTextFn:d,maskInputFn:i,dataURLOptions:h={},inlineImages:o,recordCanvas:n,keepIframeSrcFn:p,newlyAddedElement:u=!1,cssCaptured:g=!1}=t,S=vo(s,a);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:J.Document,childNodes:[],compatMode:e.compatMode}:{type:J.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:J.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return Co(e,{doc:s,blockClass:r,blockSelector:c,inlineStylesheet:m,maskInputOptions:l,maskInputFn:i,dataURLOptions:h,inlineImages:o,recordCanvas:n,keepIframeSrcFn:p,newlyAddedElement:u,rootId:S});case e.TEXT_NODE:return So(e,{doc:s,needsMask:f,maskTextFn:d,rootId:S,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:J.CDATA,textContent:"",rootId:S};case e.COMMENT_NODE:return{type:J.Comment,textContent:X.textContent(e)||"",rootId:S};default:return!1}}function vo(e,t){if(!t.hasNode(e))return;let s=t.getId(e);return s===1?void 0:s}function So(e,t){let{needsMask:s,maskTextFn:a,rootId:r,cssCaptured:c}=t,f=X.parentNode(e),m=f&&f.tagName,l="",d=m==="STYLE"?!0:void 0,i=m==="SCRIPT"?!0:void 0;return i?l="SCRIPT_PLACEHOLDER":c||(l=X.textContent(e),d&&l&&(l=ot(l,Gr(t.doc)))),!d&&!i&&l&&s&&(l=a?a(l,X.parentElement(e)):l.replace(/[\\S]/g,"*")),{type:J.Text,textContent:l||"",rootId:r}}function Co(e,t){let{doc:s,blockClass:a,blockSelector:r,inlineStylesheet:c,maskInputOptions:f={},maskInputFn:m,dataURLOptions:l={},inlineImages:d,recordCanvas:i,keepIframeSrcFn:h,newlyAddedElement:o=!1,rootId:n}=t,p=go(e,a,r),u=co(e),g={},S=e.attributes.length;for(let b=0;b<S;b++){let C=e.attributes[b];Bi(u,C.name,C.value)||(g[C.name]=$i(s,u,Ce(C.name),C.value))}if(u==="link"&&c){let b=Array.from(s.styleSheets).find(y=>y.href===e.href),C=null;b&&(C=Dr(b)),C&&(delete g.rel,delete g.href,g._cssText=C)}if(u==="style"&&e.sheet){let b=Dr(e.sheet);b&&(e.childNodes.length>1&&(b=ao(b,e)),g._cssText=b)}if(["input","textarea","select"].includes(u)){let b=e.value,C=e.checked;g.type!=="radio"&&g.type!=="checkbox"&&g.type!=="submit"&&g.type!=="button"&&b?g.value=it({element:e,type:nt(e),tagName:u,value:b,maskInputOptions:f,maskInputFn:m}):C&&(g.checked=C)}if(u==="option"&&(e.selected&&!f.select?g.selected=!0:delete g.selected),u==="dialog"&&e.open&&(g.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),u==="canvas"&&i){if(e.__context==="2d")Zn(e)||(g.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){let b=e.toDataURL(l.type,l.quality),C=s.createElement("canvas");C.width=e.width,C.height=e.height;let y=C.toDataURL(l.type,l.quality);b!==y&&(g.rr_dataURL=b)}}if(u==="img"&&d){Ne||(Ne=s.createElement("canvas"),ps=Ne.getContext("2d"));let b=e,C=b.currentSrc||b.getAttribute("src")||"<unknown-src>",y=b.crossOrigin,w=()=>{b.removeEventListener("load",w);try{Ne.width=b.naturalWidth,Ne.height=b.naturalHeight,ps.drawImage(b,0,0),g.rr_dataURL=Ne.toDataURL(l.type,l.quality)}catch(E){if(b.crossOrigin!=="anonymous"){b.crossOrigin="anonymous",b.complete&&b.naturalWidth!==0?w():b.addEventListener("load",w);return}else console.warn(`Cannot inline img src=${C}! Error: ${E}`)}b.crossOrigin==="anonymous"&&(y?g.crossOrigin=y:b.removeAttribute("crossorigin"))};b.complete&&b.naturalWidth!==0?w():b.addEventListener("load",w)}if(["audio","video"].includes(u)){let b=g;b.rr_mediaState=e.paused?"paused":"played",b.rr_mediaCurrentTime=e.currentTime,b.rr_mediaPlaybackRate=e.playbackRate,b.rr_mediaMuted=e.muted,b.rr_mediaLoop=e.loop,b.rr_mediaVolume=e.volume}if(o||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop)),p){let{width:b,height:C}=e.getBoundingClientRect();g={class:g.class,rr_width:`${b}px`,rr_height:`${C}px`}}u==="iframe"&&!h(g.src)&&(e.contentDocument||(g.rr_src=g.src),delete g.src);let v;try{customElements.get(u)&&(v=!0)}catch{}return{type:J.Element,tagName:u,attributes:g,childNodes:[],isSVG:mo(e)||void 0,needBlock:p,rootId:n,isCustom:v}}function z(e){return e==null?"":e.toLowerCase()}function zi(e){return e===!0||e==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:e==="all",headMetaDescKeywords:e==="all",headTitleMutations:e==="all"}:e||{}}function Eo(e,t){if(t.comment&&e.type===J.Comment)return!0;if(e.type===J.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Li(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(z(e.attributes.name).match(/^msapplication-tile(image|color)$/)||z(e.attributes.name)==="application-name"||z(e.attributes.rel)==="icon"||z(e.attributes.rel)==="apple-touch-icon"||z(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&z(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(z(e.attributes.property).match(/^(og|twitter|fb):/)||z(e.attributes.name).match(/^(og|twitter):/)||z(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(z(e.attributes.name)==="robots"||z(e.attributes.name)==="googlebot"||z(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(z(e.attributes.name)==="author"||z(e.attributes.name)==="generator"||z(e.attributes.name)==="framework"||z(e.attributes.name)==="publisher"||z(e.attributes.name)==="progid"||z(e.attributes.property).match(/^article:/)||z(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(z(e.attributes.name)==="google-site-verification"||z(e.attributes.name)==="yandex-verification"||z(e.attributes.name)==="csrf-token"||z(e.attributes.name)==="p:domain_verify"||z(e.attributes.name)==="verify-v1"||z(e.attributes.name)==="verification"||z(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function De(e,t){let{doc:s,mirror:a,blockClass:r,blockSelector:c,maskTextClass:f,maskTextSelector:m,skipChild:l=!1,inlineStylesheet:d=!0,maskInputOptions:i={},maskTextFn:h,maskInputFn:o,slimDOMOptions:n,dataURLOptions:p={},inlineImages:u=!1,recordCanvas:g=!1,onSerialize:S,onIframeLoad:v,iframeLoadTimeout:b=5e3,onStylesheetLoad:C,stylesheetLoadTimeout:y=5e3,keepIframeSrcFn:w=()=>!1,newlyAddedElement:E=!1,cssCaptured:R=!1}=t,{needsMask:O}=t,{preserveWhiteSpace:M=!0}=t;O||(O=Wi(e,f,m,O===void 0));let P=bo(e,{doc:s,mirror:a,blockClass:r,blockSelector:c,needsMask:O,inlineStylesheet:d,maskInputOptions:i,maskTextFn:h,maskInputFn:o,dataURLOptions:p,inlineImages:u,recordCanvas:g,keepIframeSrcFn:w,newlyAddedElement:E,cssCaptured:R});if(!P)return console.warn(e,"not serialized"),null;let A;a.hasNode(e)?A=a.getId(e):Eo(P,n)||!M&&P.type===J.Text&&!P.textContent.replace(/^\\s+|\\s+$/gm,"").length?A=at:A=Ui();let x=Object.assign(P,{id:A});if(a.add(e,x),A===at)return null;S&&S(e);let fe=!l;if(x.type===J.Element){fe=fe&&!x.needBlock,delete x.needBlock;let $=X.shadowRoot(e);$&&Be($)&&(x.isShadowHost=!0)}if((x.type===J.Document||x.type===J.Element)&&fe){n.headWhitespace&&x.type===J.Element&&x.tagName==="head"&&(M=!1);let $={doc:s,mirror:a,blockClass:r,blockSelector:c,needsMask:O,maskTextClass:f,maskTextSelector:m,skipChild:l,inlineStylesheet:d,maskInputOptions:i,maskTextFn:h,maskInputFn:o,slimDOMOptions:n,dataURLOptions:p,inlineImages:u,recordCanvas:g,preserveWhiteSpace:M,onSerialize:S,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:C,stylesheetLoadTimeout:y,keepIframeSrcFn:w,cssCaptured:!1};if(!(x.type===J.Element&&x.tagName==="textarea"&&x.attributes.value!==void 0)){x.type===J.Element&&x.attributes._cssText!==void 0&&typeof x.attributes._cssText=="string"&&($.cssCaptured=!0);for(let G of Array.from(X.childNodes(e))){let Z=De(G,$);Z&&x.childNodes.push(Z)}}let U=null;if(Pi(e)&&(U=X.shadowRoot(e)))for(let G of Array.from(X.childNodes(U))){let Z=De(G,$);Z&&(Be(U)&&(Z.isShadow=!0),x.childNodes.push(Z))}}let ie=X.parentNode(e);return ie&&$e(ie)&&Be(ie)&&(x.isShadow=!0),x.type===J.Element&&x.tagName==="iframe"&&yo(e,()=>{let $=e.contentDocument;if($&&v){let U=De($,{doc:$,mirror:a,blockClass:r,blockSelector:c,needsMask:O,maskTextClass:f,maskTextSelector:m,skipChild:!1,inlineStylesheet:d,maskInputOptions:i,maskTextFn:h,maskInputFn:o,slimDOMOptions:n,dataURLOptions:p,inlineImages:u,recordCanvas:g,preserveWhiteSpace:M,onSerialize:S,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:C,stylesheetLoadTimeout:y,keepIframeSrcFn:w});U&&v(e,U)}},b),x.type===J.Element&&x.tagName==="link"&&typeof x.attributes.rel=="string"&&(x.attributes.rel==="stylesheet"||x.attributes.rel==="preload"&&typeof x.attributes.href=="string"&&Li(x.attributes.href)==="css")&&wo(e,()=>{if(C){let $=De(e,{doc:s,mirror:a,blockClass:r,blockSelector:c,needsMask:O,maskTextClass:f,maskTextSelector:m,skipChild:!1,inlineStylesheet:d,maskInputOptions:i,maskTextFn:h,maskInputFn:o,slimDOMOptions:n,dataURLOptions:p,inlineImages:u,recordCanvas:g,preserveWhiteSpace:M,onSerialize:S,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:C,stylesheetLoadTimeout:y,keepIframeSrcFn:w});$&&C(e,$)}},y),x}function xo(e,t){let{mirror:s=new st,blockClass:a="rr-block",blockSelector:r=null,maskTextClass:c="rr-mask",maskTextSelector:f=null,inlineStylesheet:m=!0,inlineImages:l=!1,recordCanvas:d=!1,maskAllInputs:i=!1,maskTextFn:h,maskInputFn:o,slimDOM:n=!1,dataURLOptions:p,preserveWhiteSpace:u,onSerialize:g,onIframeLoad:S,iframeLoadTimeout:v,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:y=()=>!1}=t,w=i===!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}:i===!1?{password:!0}:i,E=zi(n);return De(e,{doc:e,mirror:s,blockClass:a,blockSelector:r,maskTextClass:c,maskTextSelector:f,skipChild:!1,inlineStylesheet:m,maskInputOptions:w,maskTextFn:h,maskInputFn:o,slimDOMOptions:E,dataURLOptions:p,inlineImages:l,recordCanvas:d,preserveWhiteSpace:u,onSerialize:g,onIframeLoad:S,iframeLoadTimeout:v,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:y,newlyAddedElement:!1})}var Ro=/(max|min)-device-(width|height)/,Za=new RegExp(Ro.source,"g");function Mo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function No(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var s=function a(){return this instanceof a?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(s,a,r.get?r:{enumerable:!0,get:function(){return e[a]}})}),s}var Je={exports:{}},gs;function Oo(){if(gs)return Je.exports;gs=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return Je.exports=t(),Je.exports.createColors=t,Je.exports}var Io={},Ao=Object.freeze(Object.defineProperty({__proto__:null,default:Io},Symbol.toStringTag,{value:"Module"})),de=No(Ao),Mt,ys;function Hr(){if(ys)return Mt;ys=1;let e=Oo(),t=de;class s extends Error{constructor(r,c,f,m,l,d){super(r),this.name="CssSyntaxError",this.reason=r,l&&(this.file=l),m&&(this.source=m),d&&(this.plugin=d),typeof c<"u"&&typeof f<"u"&&(typeof c=="number"?(this.line=c,this.column=f):(this.line=c.line,this.column=c.column,this.endLine=f.line,this.endColumn=f.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,s)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(r){if(!this.source)return"";let c=this.source;r==null&&(r=e.isColorSupported),t&&r&&(c=t(c));let f=c.split(/\\r?\\n/),m=Math.max(this.line-3,0),l=Math.min(this.line+2,f.length),d=String(l).length,i,h;if(r){let{bold:o,gray:n,red:p}=e.createColors(!0);i=u=>o(p(u)),h=u=>n(u)}else i=h=o=>o;return f.slice(m,l).map((o,n)=>{let p=m+1+n,u=" "+(" "+p).slice(-d)+" | ";if(p===this.line){let g=h(u.replace(/\\d/g," "))+o.slice(0,this.column-1).replace(/[^\\t]/g," ");return i(">")+h(u)+o+`\n `+g+i("^")}return" "+h(u)+o}).join(`\n`)}toString(){let r=this.showSourceCode();return r&&(r=`\n\n`+r+`\n`),this.name+": "+this.message+r}}return Mt=s,s.default=s,Mt}var Xe={},ws;function Yr(){return ws||(ws=1,Xe.isClean=Symbol("isClean"),Xe.my=Symbol("my")),Xe}var Nt,bs;function qi(){if(bs)return Nt;bs=1;let e={after:`\n`,beforeClose:`\n`,beforeComment:`\n`,beforeDecl:`\n`,beforeOpen:" ",beforeRule:`\n`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function t(a){return a[0].toUpperCase()+a.slice(1)}class s{constructor(r){this.builder=r}atrule(r,c){let f="@"+r.name,m=r.params?this.rawValue(r,"params"):"";if(typeof r.raws.afterName<"u"?f+=r.raws.afterName:m&&(f+=" "),r.nodes)this.block(r,f+m);else{let l=(r.raws.between||"")+(c?";":"");this.builder(f+m+l,r)}}beforeAfter(r,c){let f;r.type==="decl"?f=this.raw(r,null,"beforeDecl"):r.type==="comment"?f=this.raw(r,null,"beforeComment"):c==="before"?f=this.raw(r,null,"beforeRule"):f=this.raw(r,null,"beforeClose");let m=r.parent,l=0;for(;m&&m.type!=="root";)l+=1,m=m.parent;if(f.includes(`\n`)){let d=this.raw(r,null,"indent");if(d.length)for(let i=0;i<l;i++)f+=d}return f}block(r,c){let f=this.raw(r,"between","beforeOpen");this.builder(c+f+"{",r,"start");let m;r.nodes&&r.nodes.length?(this.body(r),m=this.raw(r,"after")):m=this.raw(r,"after","emptyBody"),m&&this.builder(m),this.builder("}",r,"end")}body(r){let c=r.nodes.length-1;for(;c>0&&r.nodes[c].type==="comment";)c-=1;let f=this.raw(r,"semicolon");for(let m=0;m<r.nodes.length;m++){let l=r.nodes[m],d=this.raw(l,"before");d&&this.builder(d),this.stringify(l,c!==m||f)}}comment(r){let c=this.raw(r,"left","commentLeft"),f=this.raw(r,"right","commentRight");this.builder("/*"+c+r.text+f+"*/",r)}decl(r,c){let f=this.raw(r,"between","colon"),m=r.prop+f+this.rawValue(r,"value");r.important&&(m+=r.raws.important||" !important"),c&&(m+=";"),this.builder(m,r)}document(r){this.body(r)}raw(r,c,f){let m;if(f||(f=c),c&&(m=r.raws[c],typeof m<"u"))return m;let l=r.parent;if(f==="before"&&(!l||l.type==="root"&&l.first===r||l&&l.type==="document"))return"";if(!l)return e[f];let d=r.root();if(d.rawCache||(d.rawCache={}),typeof d.rawCache[f]<"u")return d.rawCache[f];if(f==="before"||f==="after")return this.beforeAfter(r,f);{let i="raw"+t(f);this[i]?m=this[i](d,r):d.walk(h=>{if(m=h.raws[c],typeof m<"u")return!1})}return typeof m>"u"&&(m=e[f]),d.rawCache[f]=m,m}rawBeforeClose(r){let c;return r.walk(f=>{if(f.nodes&&f.nodes.length>0&&typeof f.raws.after<"u")return c=f.raws.after,c.includes(`\n`)&&(c=c.replace(/[^\\n]+$/,"")),!1}),c&&(c=c.replace(/\\S/g,"")),c}rawBeforeComment(r,c){let f;return r.walkComments(m=>{if(typeof m.raws.before<"u")return f=m.raws.before,f.includes(`\n`)&&(f=f.replace(/[^\\n]+$/,"")),!1}),typeof f>"u"?f=this.raw(c,null,"beforeDecl"):f&&(f=f.replace(/\\S/g,"")),f}rawBeforeDecl(r,c){let f;return r.walkDecls(m=>{if(typeof m.raws.before<"u")return f=m.raws.before,f.includes(`\n`)&&(f=f.replace(/[^\\n]+$/,"")),!1}),typeof f>"u"?f=this.raw(c,null,"beforeRule"):f&&(f=f.replace(/\\S/g,"")),f}rawBeforeOpen(r){let c;return r.walk(f=>{if(f.type!=="decl"&&(c=f.raws.between,typeof c<"u"))return!1}),c}rawBeforeRule(r){let c;return r.walk(f=>{if(f.nodes&&(f.parent!==r||r.first!==f)&&typeof f.raws.before<"u")return c=f.raws.before,c.includes(`\n`)&&(c=c.replace(/[^\\n]+$/,"")),!1}),c&&(c=c.replace(/\\S/g,"")),c}rawColon(r){let c;return r.walkDecls(f=>{if(typeof f.raws.between<"u")return c=f.raws.between.replace(/[^\\s:]/g,""),!1}),c}rawEmptyBody(r){let c;return r.walk(f=>{if(f.nodes&&f.nodes.length===0&&(c=f.raws.after,typeof c<"u"))return!1}),c}rawIndent(r){if(r.raws.indent)return r.raws.indent;let c;return r.walk(f=>{let m=f.parent;if(m&&m!==r&&m.parent&&m.parent===r&&typeof f.raws.before<"u"){let l=f.raws.before.split(`\n`);return c=l[l.length-1],c=c.replace(/\\S/g,""),!1}}),c}rawSemicolon(r){let c;return r.walk(f=>{if(f.nodes&&f.nodes.length&&f.last.type==="decl"&&(c=f.raws.semicolon,typeof c<"u"))return!1}),c}rawValue(r,c){let f=r[c],m=r.raws[c];return m&&m.value===f?m.raw:f}root(r){this.body(r),r.raws.after&&this.builder(r.raws.after)}rule(r){this.block(r,this.rawValue(r,"selector")),r.raws.ownSemicolon&&this.builder(r.raws.ownSemicolon,r,"end")}stringify(r,c){if(!this[r.type])throw new Error("Unknown AST node type "+r.type+". Maybe you need to change PostCSS stringifier.");this[r.type](r,c)}}return Nt=s,s.default=s,Nt}var Ot,vs;function ht(){if(vs)return Ot;vs=1;let e=qi();function t(s,a){new e(a).stringify(s)}return Ot=t,t.default=t,Ot}var It,Ss;function ft(){if(Ss)return It;Ss=1;let{isClean:e,my:t}=Yr(),s=Hr(),a=qi(),r=ht();function c(m,l){let d=new m.constructor;for(let i in m){if(!Object.prototype.hasOwnProperty.call(m,i)||i==="proxyCache")continue;let h=m[i],o=typeof h;i==="parent"&&o==="object"?l&&(d[i]=l):i==="source"?d[i]=h:Array.isArray(h)?d[i]=h.map(n=>c(n,d)):(o==="object"&&h!==null&&(h=c(h)),d[i]=h)}return d}class f{constructor(l={}){this.raws={},this[e]=!1,this[t]=!0;for(let d in l)if(d==="nodes"){this.nodes=[];for(let i of l[d])typeof i.clone=="function"?this.append(i.clone()):this.append(i)}else this[d]=l[d]}addToError(l){if(l.postcssNode=this,l.stack&&this.source&&/\\n\\s{4}at /.test(l.stack)){let d=this.source;l.stack=l.stack.replace(/\\n\\s{4}at /,`$&${d.input.from}:${d.start.line}:${d.start.column}$&`)}return l}after(l){return this.parent.insertAfter(this,l),this}assign(l={}){for(let d in l)this[d]=l[d];return this}before(l){return this.parent.insertBefore(this,l),this}cleanRaws(l){delete this.raws.before,delete this.raws.after,l||delete this.raws.between}clone(l={}){let d=c(this);for(let i in l)d[i]=l[i];return d}cloneAfter(l={}){let d=this.clone(l);return this.parent.insertAfter(this,d),d}cloneBefore(l={}){let d=this.clone(l);return this.parent.insertBefore(this,d),d}error(l,d={}){if(this.source){let{end:i,start:h}=this.rangeBy(d);return this.source.input.error(l,{column:h.column,line:h.line},{column:i.column,line:i.line},d)}return new s(l)}getProxyProcessor(){return{get(l,d){return d==="proxyOf"?l:d==="root"?()=>l.root().toProxy():l[d]},set(l,d,i){return l[d]===i||(l[d]=i,(d==="prop"||d==="value"||d==="name"||d==="params"||d==="important"||d==="text")&&l.markDirty()),!0}}}markDirty(){if(this[e]){this[e]=!1;let l=this;for(;l=l.parent;)l[e]=!1}}next(){if(!this.parent)return;let l=this.parent.index(this);return this.parent.nodes[l+1]}positionBy(l,d){let i=this.source.start;if(l.index)i=this.positionInside(l.index,d);else if(l.word){d=this.toString();let h=d.indexOf(l.word);h!==-1&&(i=this.positionInside(h,d))}return i}positionInside(l,d){let i=d||this.toString(),h=this.source.start.column,o=this.source.start.line;for(let n=0;n<l;n++)i[n]===`\n`?(h=1,o+=1):h+=1;return{column:h,line:o}}prev(){if(!this.parent)return;let l=this.parent.index(this);return this.parent.nodes[l-1]}rangeBy(l){let d={column:this.source.start.column,line:this.source.start.line},i=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:d.column+1,line:d.line};if(l.word){let h=this.toString(),o=h.indexOf(l.word);o!==-1&&(d=this.positionInside(o,h),i=this.positionInside(o+l.word.length,h))}else l.start?d={column:l.start.column,line:l.start.line}:l.index&&(d=this.positionInside(l.index)),l.end?i={column:l.end.column,line:l.end.line}:typeof l.endIndex=="number"?i=this.positionInside(l.endIndex):l.index&&(i=this.positionInside(l.index+1));return(i.line<d.line||i.line===d.line&&i.column<=d.column)&&(i={column:d.column+1,line:d.line}),{end:i,start:d}}raw(l,d){return new a().raw(this,l,d)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...l){if(this.parent){let d=this,i=!1;for(let h of l)h===this?i=!0:i?(this.parent.insertAfter(d,h),d=h):this.parent.insertBefore(d,h);i||this.remove()}return this}root(){let l=this;for(;l.parent&&l.parent.type!=="document";)l=l.parent;return l}toJSON(l,d){let i={},h=d==null;d=d||new Map;let o=0;for(let n in this){if(!Object.prototype.hasOwnProperty.call(this,n)||n==="parent"||n==="proxyCache")continue;let p=this[n];if(Array.isArray(p))i[n]=p.map(u=>typeof u=="object"&&u.toJSON?u.toJSON(null,d):u);else if(typeof p=="object"&&p.toJSON)i[n]=p.toJSON(null,d);else if(n==="source"){let u=d.get(p.input);u==null&&(u=o,d.set(p.input,o),o++),i[n]={end:p.end,inputId:u,start:p.start}}else i[n]=p}return h&&(i.inputs=[...d.keys()].map(n=>n.toJSON())),i}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(l=r){l.stringify&&(l=l.stringify);let d="";return l(this,i=>{d+=i}),d}warn(l,d,i){let h={node:this};for(let o in i)h[o]=i[o];return l.warn(d,h)}get proxyOf(){return this}}return It=f,f.default=f,It}var At,Cs;function dt(){if(Cs)return At;Cs=1;let e=ft();class t extends e{constructor(a){a&&typeof a.value<"u"&&typeof a.value!="string"&&(a={...a,value:String(a.value)}),super(a),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}}return At=t,t.default=t,At}var Dt,Es;function Do(){if(Es)return Dt;Es=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return Dt={nanoid:(a=21)=>{let r="",c=a;for(;c--;)r+=e[Math.random()*64|0];return r},customAlphabet:(a,r=21)=>(c=r)=>{let f="",m=c;for(;m--;)f+=a[Math.random()*a.length|0];return f}},Dt}var Tt,xs;function Vi(){if(xs)return Tt;xs=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=de,{existsSync:s,readFileSync:a}=de,{dirname:r,join:c}=de;function f(l){return Buffer?Buffer.from(l,"base64").toString():window.atob(l)}class m{constructor(d,i){if(i.map===!1)return;this.loadAnnotation(d),this.inline=this.startWith(this.annotation,"data:");let h=i.map?i.map.prev:void 0,o=this.loadMap(i.from,h);!this.mapFile&&i.from&&(this.mapFile=i.from),this.mapFile&&(this.root=r(this.mapFile)),o&&(this.text=o)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(d){let i=/^data:application\\/json;charset=utf-?8;base64,/,h=/^data:application\\/json;base64,/,o=/^data:application\\/json;charset=utf-?8,/,n=/^data:application\\/json,/;if(o.test(d)||n.test(d))return decodeURIComponent(d.substr(RegExp.lastMatch.length));if(i.test(d)||h.test(d))return f(d.substr(RegExp.lastMatch.length));let p=d.match(/data:application\\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+p)}getAnnotationURL(d){return d.replace(/^\\/\\*\\s*# sourceMappingURL=/,"").trim()}isMap(d){return typeof d!="object"?!1:typeof d.mappings=="string"||typeof d._mappings=="string"||Array.isArray(d.sections)}loadAnnotation(d){let i=d.match(/\\/\\*\\s*# sourceMappingURL=/gm);if(!i)return;let h=d.lastIndexOf(i.pop()),o=d.indexOf("*/",h);h>-1&&o>-1&&(this.annotation=this.getAnnotationURL(d.substring(h,o)))}loadFile(d){if(this.root=r(d),s(d))return this.mapFile=d,a(d,"utf-8").toString().trim()}loadMap(d,i){if(i===!1)return!1;if(i){if(typeof i=="string")return i;if(typeof i=="function"){let h=i(d);if(h){let o=this.loadFile(h);if(!o)throw new Error("Unable to load previous source map: "+h.toString());return o}}else{if(i instanceof e)return t.fromSourceMap(i).toString();if(i instanceof t)return i.toString();if(this.isMap(i))return JSON.stringify(i);throw new Error("Unsupported previous source map format: "+i.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let h=this.annotation;return d&&(h=c(r(d),h)),this.loadFile(h)}}}startWith(d,i){return d?d.substr(0,i.length)===i:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Tt=m,m.default=m,Tt}var _t,Rs;function pt(){if(Rs)return _t;Rs=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=de,{fileURLToPath:s,pathToFileURL:a}=de,{isAbsolute:r,resolve:c}=de,{nanoid:f}=Do(),m=de,l=Hr(),d=Vi(),i=Symbol("fromOffsetCache"),h=!!(e&&t),o=!!(c&&r);class n{constructor(u,g={}){if(u===null||typeof u>"u"||typeof u=="object"&&!u.toString)throw new Error(`PostCSS received ${u} instead of CSS string`);if(this.css=u.toString(),this.css[0]==="\\uFEFF"||this.css[0]==="\\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,g.from&&(!o||/^\\w+:\\/\\//.test(g.from)||r(g.from)?this.file=g.from:this.file=c(g.from)),o&&h){let S=new d(this.css,g);if(S.text){this.map=S;let v=S.consumer().file;!this.file&&v&&(this.file=this.mapResolve(v))}}this.file||(this.id="<input css "+f(6)+">"),this.map&&(this.map.file=this.from)}error(u,g,S,v={}){let b,C,y;if(g&&typeof g=="object"){let E=g,R=S;if(typeof E.offset=="number"){let O=this.fromOffset(E.offset);g=O.line,S=O.col}else g=E.line,S=E.column;if(typeof R.offset=="number"){let O=this.fromOffset(R.offset);C=O.line,y=O.col}else C=R.line,y=R.column}else if(!S){let E=this.fromOffset(g);g=E.line,S=E.col}let w=this.origin(g,S,C,y);return w?b=new l(u,w.endLine===void 0?w.line:{column:w.column,line:w.line},w.endLine===void 0?w.column:{column:w.endColumn,line:w.endLine},w.source,w.file,v.plugin):b=new l(u,C===void 0?g:{column:S,line:g},C===void 0?S:{column:y,line:C},this.css,this.file,v.plugin),b.input={column:S,endColumn:y,endLine:C,line:g,source:this.css},this.file&&(a&&(b.input.url=a(this.file).toString()),b.input.file=this.file),b}fromOffset(u){let g,S;if(this[i])S=this[i];else{let b=this.css.split(`\n`);S=new Array(b.length);let C=0;for(let y=0,w=b.length;y<w;y++)S[y]=C,C+=b[y].length+1;this[i]=S}g=S[S.length-1];let v=0;if(u>=g)v=S.length-1;else{let b=S.length-2,C;for(;v<b;)if(C=v+(b-v>>1),u<S[C])b=C-1;else if(u>=S[C+1])v=C+1;else{v=C;break}}return{col:u-S[v]+1,line:v+1}}mapResolve(u){return/^\\w+:\\/\\//.test(u)?u:c(this.map.consumer().sourceRoot||this.map.root||".",u)}origin(u,g,S,v){if(!this.map)return!1;let b=this.map.consumer(),C=b.originalPositionFor({column:g,line:u});if(!C.source)return!1;let y;typeof S=="number"&&(y=b.originalPositionFor({column:v,line:S}));let w;r(C.source)?w=a(C.source):w=new URL(C.source,this.map.consumer().sourceRoot||a(this.map.mapFile));let E={column:C.column,endColumn:y&&y.column,endLine:y&&y.line,line:C.line,url:w.toString()};if(w.protocol==="file:")if(s)E.file=s(w);else throw new Error("file: protocol is not available in this PostCSS build");let R=b.sourceContentFor(C.source);return R&&(E.source=R),E}toJSON(){let u={};for(let g of["hasBOM","css","file","id"])this[g]!=null&&(u[g]=this[g]);return this.map&&(u.map={...this.map},u.map.consumerCache&&(u.map.consumerCache=void 0)),u}get from(){return this.file||this.id}}return _t=n,n.default=n,m&&m.registerInput&&m.registerInput(n),_t}var Pt,Ms;function ji(){if(Ms)return Pt;Ms=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=de,{dirname:s,relative:a,resolve:r,sep:c}=de,{pathToFileURL:f}=de,m=pt(),l=!!(e&&t),d=!!(s&&r&&a&&c);class i{constructor(o,n,p,u){this.stringify=o,this.mapOpts=p.map||{},this.root=n,this.opts=p,this.css=u,this.originalCSS=u,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let o;this.isInline()?o="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?o=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?o=this.mapOpts.annotation(this.opts.to,this.root):o=this.outputFile()+".map";let n=`\n`;this.css.includes(`\\r\n`)&&(n=`\\r\n`),this.css+=n+"/*# sourceMappingURL="+o+" */"}applyPrevMaps(){for(let o of this.previous()){let n=this.toUrl(this.path(o.file)),p=o.root||s(o.file),u;this.mapOpts.sourcesContent===!1?(u=new e(o.text),u.sourcesContent&&(u.sourcesContent=null)):u=o.consumer(),this.map.applySourceMap(u,n,this.toUrl(this.path(p)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let o;for(let n=this.root.nodes.length-1;n>=0;n--)o=this.root.nodes[n],o.type==="comment"&&o.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(n)}else this.css&&(this.css=this.css.replace(/\\n*?\\/\\*#[\\S\\s]*?\\*\\/$/gm,""))}generate(){if(this.clearAnnotation(),d&&l&&this.isMap())return this.generateMap();{let o="";return this.stringify(this.root,n=>{o+=n}),[o]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let o=this.previous()[0].consumer();o.file=this.outputFile(),this.map=t.fromSourceMap(o,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<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 t({file:this.outputFile(),ignoreInvalidMapping:!0});let o=1,n=1,p="<no source>",u={generated:{column:0,line:0},original:{column:0,line:0},source:""},g,S;this.stringify(this.root,(v,b,C)=>{if(this.css+=v,b&&C!=="end"&&(u.generated.line=o,u.generated.column=n-1,b.source&&b.source.start?(u.source=this.sourcePath(b),u.original.line=b.source.start.line,u.original.column=b.source.start.column-1,this.map.addMapping(u)):(u.source=p,u.original.line=1,u.original.column=0,this.map.addMapping(u))),g=v.match(/\\n/g),g?(o+=g.length,S=v.lastIndexOf(`\n`),n=v.length-S):n+=v.length,b&&C!=="start"){let y=b.parent||{raws:{}};(!(b.type==="decl"||b.type==="atrule"&&!b.nodes)||b!==y.last||y.raws.semicolon)&&(b.source&&b.source.end?(u.source=this.sourcePath(b),u.original.line=b.source.end.line,u.original.column=b.source.end.column-1,u.generated.line=o,u.generated.column=n-2,this.map.addMapping(u)):(u.source=p,u.original.line=1,u.original.column=0,u.generated.line=o,u.generated.column=n-1,this.map.addMapping(u)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(o=>o.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let o=this.mapOpts.annotation;return typeof o<"u"&&o!==!0?!1:this.previous().length?this.previous().some(n=>n.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(o=>o.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(o){if(this.mapOpts.absolute||o.charCodeAt(0)===60||/^\\w+:\\/\\//.test(o))return o;let n=this.memoizedPaths.get(o);if(n)return n;let p=this.opts.to?s(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(p=s(r(p,this.mapOpts.annotation)));let u=a(p,o);return this.memoizedPaths.set(o,u),u}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(o=>{if(o.source&&o.source.input.map){let n=o.source.input.map;this.previousMaps.includes(n)||this.previousMaps.push(n)}});else{let o=new m(this.originalCSS,this.opts);o.map&&this.previousMaps.push(o.map)}return this.previousMaps}setSourcesContent(){let o={};if(this.root)this.root.walk(n=>{if(n.source){let p=n.source.input.from;if(p&&!o[p]){o[p]=!0;let u=this.usesFileUrls?this.toFileUrl(p):this.toUrl(this.path(p));this.map.setSourceContent(u,n.source.input.css)}}});else if(this.css){let n=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(n,this.css)}}sourcePath(o){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(o.source.input.from):this.toUrl(this.path(o.source.input.from))}toBase64(o){return Buffer?Buffer.from(o).toString("base64"):window.btoa(unescape(encodeURIComponent(o)))}toFileUrl(o){let n=this.memoizedFileURLs.get(o);if(n)return n;if(f){let p=f(o).toString();return this.memoizedFileURLs.set(o,p),p}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(o){let n=this.memoizedURLs.get(o);if(n)return n;c==="\\\\"&&(o=o.replace(/\\\\/g,"/"));let p=encodeURI(o).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(o,p),p}}return Pt=i,Pt}var kt,Ns;function mt(){if(Ns)return kt;Ns=1;let e=ft();class t extends e{constructor(a){super(a),this.type="comment"}}return kt=t,t.default=t,kt}var Lt,Os;function xe(){if(Os)return Lt;Os=1;let{isClean:e,my:t}=Yr(),s=dt(),a=mt(),r=ft(),c,f,m,l;function d(o){return o.map(n=>(n.nodes&&(n.nodes=d(n.nodes)),delete n.source,n))}function i(o){if(o[e]=!1,o.proxyOf.nodes)for(let n of o.proxyOf.nodes)i(n)}class h extends r{append(...n){for(let p of n){let u=this.normalize(p,this.last);for(let g of u)this.proxyOf.nodes.push(g)}return this.markDirty(),this}cleanRaws(n){if(super.cleanRaws(n),this.nodes)for(let p of this.nodes)p.cleanRaws(n)}each(n){if(!this.proxyOf.nodes)return;let p=this.getIterator(),u,g;for(;this.indexes[p]<this.proxyOf.nodes.length&&(u=this.indexes[p],g=n(this.proxyOf.nodes[u],u),g!==!1);)this.indexes[p]+=1;return delete this.indexes[p],g}every(n){return this.nodes.every(n)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let n=this.lastEach;return this.indexes[n]=0,n}getProxyProcessor(){return{get(n,p){return p==="proxyOf"?n:n[p]?p==="each"||typeof p=="string"&&p.startsWith("walk")?(...u)=>n[p](...u.map(g=>typeof g=="function"?(S,v)=>g(S.toProxy(),v):g)):p==="every"||p==="some"?u=>n[p]((g,...S)=>u(g.toProxy(),...S)):p==="root"?()=>n.root().toProxy():p==="nodes"?n.nodes.map(u=>u.toProxy()):p==="first"||p==="last"?n[p].toProxy():n[p]:n[p]},set(n,p,u){return n[p]===u||(n[p]=u,(p==="name"||p==="params"||p==="selector")&&n.markDirty()),!0}}}index(n){return typeof n=="number"?n:(n.proxyOf&&(n=n.proxyOf),this.proxyOf.nodes.indexOf(n))}insertAfter(n,p){let u=this.index(n),g=this.normalize(p,this.proxyOf.nodes[u]).reverse();u=this.index(n);for(let v of g)this.proxyOf.nodes.splice(u+1,0,v);let S;for(let v in this.indexes)S=this.indexes[v],u<S&&(this.indexes[v]=S+g.length);return this.markDirty(),this}insertBefore(n,p){let u=this.index(n),g=u===0?"prepend":!1,S=this.normalize(p,this.proxyOf.nodes[u],g).reverse();u=this.index(n);for(let b of S)this.proxyOf.nodes.splice(u,0,b);let v;for(let b in this.indexes)v=this.indexes[b],u<=v&&(this.indexes[b]=v+S.length);return this.markDirty(),this}normalize(n,p){if(typeof n=="string")n=d(c(n).nodes);else if(typeof n>"u")n=[];else if(Array.isArray(n)){n=n.slice(0);for(let g of n)g.parent&&g.parent.removeChild(g,"ignore")}else if(n.type==="root"&&this.type!=="document"){n=n.nodes.slice(0);for(let g of n)g.parent&&g.parent.removeChild(g,"ignore")}else if(n.type)n=[n];else if(n.prop){if(typeof n.value>"u")throw new Error("Value field is missed in node creation");typeof n.value!="string"&&(n.value=String(n.value)),n=[new s(n)]}else if(n.selector)n=[new f(n)];else if(n.name)n=[new m(n)];else if(n.text)n=[new a(n)];else throw new Error("Unknown node type in node creation");return n.map(g=>(g[t]||h.rebuild(g),g=g.proxyOf,g.parent&&g.parent.removeChild(g),g[e]&&i(g),typeof g.raws.before>"u"&&p&&typeof p.raws.before<"u"&&(g.raws.before=p.raws.before.replace(/\\S/g,"")),g.parent=this.proxyOf,g))}prepend(...n){n=n.reverse();for(let p of n){let u=this.normalize(p,this.first,"prepend").reverse();for(let g of u)this.proxyOf.nodes.unshift(g);for(let g in this.indexes)this.indexes[g]=this.indexes[g]+u.length}return this.markDirty(),this}push(n){return n.parent=this,this.proxyOf.nodes.push(n),this}removeAll(){for(let n of this.proxyOf.nodes)n.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(n){n=this.index(n),this.proxyOf.nodes[n].parent=void 0,this.proxyOf.nodes.splice(n,1);let p;for(let u in this.indexes)p=this.indexes[u],p>=n&&(this.indexes[u]=p-1);return this.markDirty(),this}replaceValues(n,p,u){return u||(u=p,p={}),this.walkDecls(g=>{p.props&&!p.props.includes(g.prop)||p.fast&&!g.value.includes(p.fast)||(g.value=g.value.replace(n,u))}),this.markDirty(),this}some(n){return this.nodes.some(n)}walk(n){return this.each((p,u)=>{let g;try{g=n(p,u)}catch(S){throw p.addToError(S)}return g!==!1&&p.walk&&(g=p.walk(n)),g})}walkAtRules(n,p){return p?n instanceof RegExp?this.walk((u,g)=>{if(u.type==="atrule"&&n.test(u.name))return p(u,g)}):this.walk((u,g)=>{if(u.type==="atrule"&&u.name===n)return p(u,g)}):(p=n,this.walk((u,g)=>{if(u.type==="atrule")return p(u,g)}))}walkComments(n){return this.walk((p,u)=>{if(p.type==="comment")return n(p,u)})}walkDecls(n,p){return p?n instanceof RegExp?this.walk((u,g)=>{if(u.type==="decl"&&n.test(u.prop))return p(u,g)}):this.walk((u,g)=>{if(u.type==="decl"&&u.prop===n)return p(u,g)}):(p=n,this.walk((u,g)=>{if(u.type==="decl")return p(u,g)}))}walkRules(n,p){return p?n instanceof RegExp?this.walk((u,g)=>{if(u.type==="rule"&&n.test(u.selector))return p(u,g)}):this.walk((u,g)=>{if(u.type==="rule"&&u.selector===n)return p(u,g)}):(p=n,this.walk((u,g)=>{if(u.type==="rule")return p(u,g)}))}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]}}return h.registerParse=o=>{c=o},h.registerRule=o=>{f=o},h.registerAtRule=o=>{m=o},h.registerRoot=o=>{l=o},Lt=h,h.default=h,h.rebuild=o=>{o.type==="atrule"?Object.setPrototypeOf(o,m.prototype):o.type==="rule"?Object.setPrototypeOf(o,f.prototype):o.type==="decl"?Object.setPrototypeOf(o,s.prototype):o.type==="comment"?Object.setPrototypeOf(o,a.prototype):o.type==="root"&&Object.setPrototypeOf(o,l.prototype),o[t]=!0,o.nodes&&o.nodes.forEach(n=>{h.rebuild(n)})},Lt}var Ft,Is;function Jr(){if(Is)return Ft;Is=1;let e=xe(),t,s;class a extends e{constructor(c){super({type:"document",...c}),this.nodes||(this.nodes=[])}toResult(c={}){return new t(new s,this,c).stringify()}}return a.registerLazyResult=r=>{t=r},a.registerProcessor=r=>{s=r},Ft=a,a.default=a,Ft}var Ut,As;function Gi(){if(As)return Ut;As=1;let e={};return Ut=function(s){e[s]||(e[s]=!0,typeof console<"u"&&console.warn&&console.warn(s))},Ut}var $t,Ds;function Hi(){if(Ds)return $t;Ds=1;class e{constructor(s,a={}){if(this.type="warning",this.text=s,a.node&&a.node.source){let r=a.node.rangeBy(a);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in a)this[r]=a[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}}return $t=e,e.default=e,$t}var Bt,Ts;function Xr(){if(Ts)return Bt;Ts=1;let e=Hi();class t{constructor(a,r,c){this.processor=a,this.messages=[],this.root=r,this.opts=c,this.css=void 0,this.map=void 0}toString(){return this.css}warn(a,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let c=new e(a,r);return this.messages.push(c),c}warnings(){return this.messages.filter(a=>a.type==="warning")}get content(){return this.css}}return Bt=t,t.default=t,Bt}var Wt,_s;function To(){if(_s)return Wt;_s=1;let e=39,t=34,s=92,a=47,r=10,c=32,f=12,m=9,l=13,d=91,i=93,h=40,o=41,n=123,p=125,u=59,g=42,S=58,v=64,b=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/g,C=/[\\t\\n\\f\\r !"#\'():;@[\\\\\\]{}]|\\/(?=\\*)/g,y=/.[\\r\\n"\'(/\\\\]/,w=/[\\da-f]/i;return Wt=function(R,O={}){let M=R.css.valueOf(),P=O.ignoreErrors,A,x,fe,ie,$,U,G,Z,H,B,be=M.length,N=0,me=[],le=[];function ke(){return N}function K(D){throw R.error("Unclosed "+D,N)}function ne(){return le.length===0&&N>=be}function Ee(D){if(le.length)return le.pop();if(N>=be)return;let Y=D?D.ignoreUnclosed:!1;switch(A=M.charCodeAt(N),A){case r:case c:case m:case l:case f:{x=N;do x+=1,A=M.charCodeAt(x);while(A===c||A===r||A===m||A===l||A===f);B=["space",M.slice(N,x)],N=x-1;break}case d:case i:case n:case p:case S:case u:case o:{let _=String.fromCharCode(A);B=[_,_,N];break}case h:{if(Z=me.length?me.pop()[1]:"",H=M.charCodeAt(N+1),Z==="url"&&H!==e&&H!==t&&H!==c&&H!==r&&H!==m&&H!==f&&H!==l){x=N;do{if(U=!1,x=M.indexOf(")",x+1),x===-1)if(P||Y){x=N;break}else K("bracket");for(G=x;M.charCodeAt(G-1)===s;)G-=1,U=!U}while(U);B=["brackets",M.slice(N,x+1),N,x],N=x}else x=M.indexOf(")",N+1),ie=M.slice(N,x+1),x===-1||y.test(ie)?B=["(","(",N]:(B=["brackets",ie,N,x],N=x);break}case e:case t:{fe=A===e?"\'":\'"\',x=N;do{if(U=!1,x=M.indexOf(fe,x+1),x===-1)if(P||Y){x=N+1;break}else K("string");for(G=x;M.charCodeAt(G-1)===s;)G-=1,U=!U}while(U);B=["string",M.slice(N,x+1),N,x],N=x;break}case v:{b.lastIndex=N+1,b.test(M),b.lastIndex===0?x=M.length-1:x=b.lastIndex-2,B=["at-word",M.slice(N,x+1),N,x],N=x;break}case s:{for(x=N,$=!0;M.charCodeAt(x+1)===s;)x+=1,$=!$;if(A=M.charCodeAt(x+1),$&&A!==a&&A!==c&&A!==r&&A!==m&&A!==l&&A!==f&&(x+=1,w.test(M.charAt(x)))){for(;w.test(M.charAt(x+1));)x+=1;M.charCodeAt(x+1)===c&&(x+=1)}B=["word",M.slice(N,x+1),N,x],N=x;break}default:{A===a&&M.charCodeAt(N+1)===g?(x=M.indexOf("*/",N+2)+1,x===0&&(P||Y?x=M.length:K("comment")),B=["comment",M.slice(N,x+1),N,x],N=x):(C.lastIndex=N+1,C.test(M),C.lastIndex===0?x=M.length-1:x=C.lastIndex-2,B=["word",M.slice(N,x+1),N,x],me.push(B),N=x);break}}return N++,B}function ge(D){le.push(D)}return{back:ge,endOfFile:ne,nextToken:Ee,position:ke}},Wt}var zt,Ps;function Qr(){if(Ps)return zt;Ps=1;let e=xe();class t extends e{constructor(a){super(a),this.type="atrule"}append(...a){return this.proxyOf.nodes||(this.nodes=[]),super.append(...a)}prepend(...a){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...a)}}return zt=t,t.default=t,e.registerAtRule(t),zt}var qt,ks;function je(){if(ks)return qt;ks=1;let e=xe(),t,s;class a extends e{constructor(c){super(c),this.type="root",this.nodes||(this.nodes=[])}normalize(c,f,m){let l=super.normalize(c);if(f){if(m==="prepend")this.nodes.length>1?f.raws.before=this.nodes[1].raws.before:delete f.raws.before;else if(this.first!==f)for(let d of l)d.raws.before=f.raws.before}return l}removeChild(c,f){let m=this.index(c);return!f&&m===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[m].raws.before),super.removeChild(c)}toResult(c={}){return new t(new s,this,c).stringify()}}return a.registerLazyResult=r=>{t=r},a.registerProcessor=r=>{s=r},qt=a,a.default=a,e.registerRoot(a),qt}var Vt,Ls;function Yi(){if(Ls)return Vt;Ls=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let s=[" ",`\n`," "];return e.split(t,s)},split(t,s,a){let r=[],c="",f=!1,m=0,l=!1,d="",i=!1;for(let h of t)i?i=!1:h==="\\\\"?i=!0:l?h===d&&(l=!1):h===\'"\'||h==="\'"?(l=!0,d=h):h==="("?m+=1:h===")"?m>0&&(m-=1):m===0&&s.includes(h)&&(f=!0),f?(c!==""&&r.push(c.trim()),c="",f=!1):c+=h;return(a||c!=="")&&r.push(c.trim()),r}};return Vt=e,e.default=e,Vt}var jt,Fs;function Zr(){if(Fs)return jt;Fs=1;let e=xe(),t=Yi();class s extends e{constructor(r){super(r),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(r){let c=this.selector?this.selector.match(/,\\s*/):null,f=c?c[0]:","+this.raw("between","beforeOpen");this.selector=r.join(f)}}return jt=s,s.default=s,e.registerRule(s),jt}var Gt,Us;function _o(){if(Us)return Gt;Us=1;let e=dt(),t=To(),s=mt(),a=Qr(),r=je(),c=Zr(),f={empty:!0,space:!0};function m(d){for(let i=d.length-1;i>=0;i--){let h=d[i],o=h[3]||h[2];if(o)return o}}class l{constructor(i){this.input=i,this.root=new r,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:i,start:{column:1,line:1,offset:0}}}atrule(i){let h=new a;h.name=i[1].slice(1),h.name===""&&this.unnamedAtrule(h,i),this.init(h,i[2]);let o,n,p,u=!1,g=!1,S=[],v=[];for(;!this.tokenizer.endOfFile();){if(i=this.tokenizer.nextToken(),o=i[0],o==="("||o==="["?v.push(o==="("?")":"]"):o==="{"&&v.length>0?v.push("}"):o===v[v.length-1]&&v.pop(),v.length===0)if(o===";"){h.source.end=this.getPosition(i[2]),h.source.end.offset++,this.semicolon=!0;break}else if(o==="{"){g=!0;break}else if(o==="}"){if(S.length>0){for(p=S.length-1,n=S[p];n&&n[0]==="space";)n=S[--p];n&&(h.source.end=this.getPosition(n[3]||n[2]),h.source.end.offset++)}this.end(i);break}else S.push(i);else S.push(i);if(this.tokenizer.endOfFile()){u=!0;break}}h.raws.between=this.spacesAndCommentsFromEnd(S),S.length?(h.raws.afterName=this.spacesAndCommentsFromStart(S),this.raw(h,"params",S),u&&(i=S[S.length-1],h.source.end=this.getPosition(i[3]||i[2]),h.source.end.offset++,this.spaces=h.raws.between,h.raws.between="")):(h.raws.afterName="",h.params=""),g&&(h.nodes=[],this.current=h)}checkMissedSemicolon(i){let h=this.colon(i);if(h===!1)return;let o=0,n;for(let p=h-1;p>=0&&(n=i[p],!(n[0]!=="space"&&(o+=1,o===2)));p--);throw this.input.error("Missed semicolon",n[0]==="word"?n[3]+1:n[2])}colon(i){let h=0,o,n,p;for(let[u,g]of i.entries()){if(o=g,n=o[0],n==="("&&(h+=1),n===")"&&(h-=1),h===0&&n===":")if(!p)this.doubleColon(o);else{if(p[0]==="word"&&p[1]==="progid")continue;return u}p=o}return!1}comment(i){let h=new s;this.init(h,i[2]),h.source.end=this.getPosition(i[3]||i[2]),h.source.end.offset++;let o=i[1].slice(2,-2);if(/^\\s*$/.test(o))h.text="",h.raws.left=o,h.raws.right="";else{let n=o.match(/^(\\s*)([^]*\\S)(\\s*)$/);h.text=n[2],h.raws.left=n[1],h.raws.right=n[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(i,h){let o=new e;this.init(o,i[0][2]);let n=i[i.length-1];for(n[0]===";"&&(this.semicolon=!0,i.pop()),o.source.end=this.getPosition(n[3]||n[2]||m(i)),o.source.end.offset++;i[0][0]!=="word";)i.length===1&&this.unknownWord(i),o.raws.before+=i.shift()[1];for(o.source.start=this.getPosition(i[0][2]),o.prop="";i.length;){let v=i[0][0];if(v===":"||v==="space"||v==="comment")break;o.prop+=i.shift()[1]}o.raws.between="";let p;for(;i.length;)if(p=i.shift(),p[0]===":"){o.raws.between+=p[1];break}else p[0]==="word"&&/\\w/.test(p[1])&&this.unknownWord([p]),o.raws.between+=p[1];(o.prop[0]==="_"||o.prop[0]==="*")&&(o.raws.before+=o.prop[0],o.prop=o.prop.slice(1));let u=[],g;for(;i.length&&(g=i[0][0],!(g!=="space"&&g!=="comment"));)u.push(i.shift());this.precheckMissedSemicolon(i);for(let v=i.length-1;v>=0;v--){if(p=i[v],p[1].toLowerCase()==="!important"){o.important=!0;let b=this.stringFrom(i,v);b=this.spacesFromEnd(i)+b,b!==" !important"&&(o.raws.important=b);break}else if(p[1].toLowerCase()==="important"){let b=i.slice(0),C="";for(let y=v;y>0;y--){let w=b[y][0];if(C.trim().indexOf("!")===0&&w!=="space")break;C=b.pop()[1]+C}C.trim().indexOf("!")===0&&(o.important=!0,o.raws.important=C,i=b)}if(p[0]!=="space"&&p[0]!=="comment")break}i.some(v=>v[0]!=="space"&&v[0]!=="comment")&&(o.raws.between+=u.map(v=>v[1]).join(""),u=[]),this.raw(o,"value",u.concat(i),h),o.value.includes(":")&&!h&&this.checkMissedSemicolon(i)}doubleColon(i){throw this.input.error("Double colon",{offset:i[2]},{offset:i[2]+i[1].length})}emptyRule(i){let h=new c;this.init(h,i[2]),h.selector="",h.raws.between="",this.current=h}end(i){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(i[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(i)}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(i){if(this.spaces+=i[1],this.current.nodes){let h=this.current.nodes[this.current.nodes.length-1];h&&h.type==="rule"&&!h.raws.ownSemicolon&&(h.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(i){let h=this.input.fromOffset(i);return{column:h.col,line:h.line,offset:i}}init(i,h){this.current.push(i),i.source={input:this.input,start:this.getPosition(h)},i.raws.before=this.spaces,this.spaces="",i.type!=="comment"&&(this.semicolon=!1)}other(i){let h=!1,o=null,n=!1,p=null,u=[],g=i[1].startsWith("--"),S=[],v=i;for(;v;){if(o=v[0],S.push(v),o==="("||o==="[")p||(p=v),u.push(o==="("?")":"]");else if(g&&n&&o==="{")p||(p=v),u.push("}");else if(u.length===0)if(o===";")if(n){this.decl(S,g);return}else break;else if(o==="{"){this.rule(S);return}else if(o==="}"){this.tokenizer.back(S.pop()),h=!0;break}else o===":"&&(n=!0);else o===u[u.length-1]&&(u.pop(),u.length===0&&(p=null));v=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(h=!0),u.length>0&&this.unclosedBracket(p),h&&n){if(!g)for(;S.length&&(v=S[S.length-1][0],!(v!=="space"&&v!=="comment"));)this.tokenizer.back(S.pop());this.decl(S,g)}else this.unknownWord(S)}parse(){let i;for(;!this.tokenizer.endOfFile();)switch(i=this.tokenizer.nextToken(),i[0]){case"space":this.spaces+=i[1];break;case";":this.freeSemicolon(i);break;case"}":this.end(i);break;case"comment":this.comment(i);break;case"at-word":this.atrule(i);break;case"{":this.emptyRule(i);break;default:this.other(i);break}this.endFile()}precheckMissedSemicolon(){}raw(i,h,o,n){let p,u,g=o.length,S="",v=!0,b,C;for(let y=0;y<g;y+=1)p=o[y],u=p[0],u==="space"&&y===g-1&&!n?v=!1:u==="comment"?(C=o[y-1]?o[y-1][0]:"empty",b=o[y+1]?o[y+1][0]:"empty",!f[C]&&!f[b]?S.slice(-1)===","?v=!1:S+=p[1]:v=!1):S+=p[1];if(!v){let y=o.reduce((w,E)=>w+E[1],"");i.raws[h]={raw:y,value:S}}i[h]=S}rule(i){i.pop();let h=new c;this.init(h,i[0][2]),h.raws.between=this.spacesAndCommentsFromEnd(i),this.raw(h,"selector",i),this.current=h}spacesAndCommentsFromEnd(i){let h,o="";for(;i.length&&(h=i[i.length-1][0],!(h!=="space"&&h!=="comment"));)o=i.pop()[1]+o;return o}spacesAndCommentsFromStart(i){let h,o="";for(;i.length&&(h=i[0][0],!(h!=="space"&&h!=="comment"));)o+=i.shift()[1];return o}spacesFromEnd(i){let h,o="";for(;i.length&&(h=i[i.length-1][0],h==="space");)o=i.pop()[1]+o;return o}stringFrom(i,h){let o="";for(let n=h;n<i.length;n++)o+=i[n][1];return i.splice(h,i.length-h),o}unclosedBlock(){let i=this.current.source.start;throw this.input.error("Unclosed block",i.line,i.column)}unclosedBracket(i){throw this.input.error("Unclosed bracket",{offset:i[2]},{offset:i[2]+1})}unexpectedClose(i){throw this.input.error("Unexpected }",{offset:i[2]},{offset:i[2]+1})}unknownWord(i){throw this.input.error("Unknown word",{offset:i[0][2]},{offset:i[0][2]+i[0][1].length})}unnamedAtrule(i,h){throw this.input.error("At-rule without name",{offset:h[2]},{offset:h[2]+h[1].length})}}return Gt=l,Gt}var Ht,$s;function Kr(){if($s)return Ht;$s=1;let e=xe(),t=_o(),s=pt();function a(r,c){let f=new s(r,c),m=new t(f);try{m.parse()}catch(l){throw l}return m.root}return Ht=a,a.default=a,e.registerParse(a),Ht}var Yt,Bs;function Ji(){if(Bs)return Yt;Bs=1;let{isClean:e,my:t}=Yr(),s=ji(),a=ht(),r=xe(),c=Jr(),f=Gi(),m=Xr(),l=Kr(),d=je(),i={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={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},o={Once:!0,postcssPlugin:!0,prepare:!0},n=0;function p(C){return typeof C=="object"&&typeof C.then=="function"}function u(C){let y=!1,w=i[C.type];return C.type==="decl"?y=C.prop.toLowerCase():C.type==="atrule"&&(y=C.name.toLowerCase()),y&&C.append?[w,w+"-"+y,n,w+"Exit",w+"Exit-"+y]:y?[w,w+"-"+y,w+"Exit",w+"Exit-"+y]:C.append?[w,n,w+"Exit"]:[w,w+"Exit"]}function g(C){let y;return C.type==="document"?y=["Document",n,"DocumentExit"]:C.type==="root"?y=["Root",n,"RootExit"]:y=u(C),{eventIndex:0,events:y,iterator:0,node:C,visitorIndex:0,visitors:[]}}function S(C){return C[e]=!1,C.nodes&&C.nodes.forEach(y=>S(y)),C}let v={};class b{constructor(y,w,E){this.stringified=!1,this.processed=!1;let R;if(typeof w=="object"&&w!==null&&(w.type==="root"||w.type==="document"))R=S(w);else if(w instanceof b||w instanceof m)R=S(w.root),w.map&&(typeof E.map>"u"&&(E.map={}),E.map.inline||(E.map.inline=!1),E.map.prev=w.map);else{let O=l;E.syntax&&(O=E.syntax.parse),E.parser&&(O=E.parser),O.parse&&(O=O.parse);try{R=O(w,E)}catch(M){this.processed=!0,this.error=M}R&&!R[t]&&r.rebuild(R)}this.result=new m(y,R,E),this.helpers={...v,postcss:v,result:this.result},this.plugins=this.processor.plugins.map(O=>typeof O=="object"&&O.prepare?{...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(y){return this.async().catch(y)}finally(y){return this.async().then(y,y)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(y,w){let E=this.result.lastPlugin;try{w&&w.addToError(y),this.error=y,y.name==="CssSyntaxError"&&!y.plugin?(y.plugin=E.postcssPlugin,y.setMessage()):E.postcssVersion}catch(R){console&&console.error&&console.error(R)}return y}prepareVisitors(){this.listeners={};let y=(w,E,R)=>{this.listeners[E]||(this.listeners[E]=[]),this.listeners[E].push([w,R])};for(let w of this.plugins)if(typeof w=="object")for(let E in w){if(!h[E]&&/^[A-Z]/.test(E))throw new Error(`Unknown event ${E} in ${w.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!o[E])if(typeof w[E]=="object")for(let R in w[E])R==="*"?y(w,E,w[E][R]):y(w,E+"-"+R.toLowerCase(),w[E][R]);else typeof w[E]=="function"&&y(w,E,w[E])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let y=0;y<this.plugins.length;y++){let w=this.plugins[y],E=this.runOnRoot(w);if(p(E))try{await E}catch(R){throw this.handleError(R)}}if(this.prepareVisitors(),this.hasListener){let y=this.result.root;for(;!y[e];){y[e]=!0;let w=[g(y)];for(;w.length>0;){let E=this.visitTick(w);if(p(E))try{await E}catch(R){let O=w[w.length-1].node;throw this.handleError(R,O)}}}if(this.listeners.OnceExit)for(let[w,E]of this.listeners.OnceExit){this.result.lastPlugin=w;try{if(y.type==="document"){let R=y.nodes.map(O=>E(O,this.helpers));await Promise.all(R)}else await E(y,this.helpers)}catch(R){throw this.handleError(R)}}}return this.processed=!0,this.stringify()}runOnRoot(y){this.result.lastPlugin=y;try{if(typeof y=="object"&&y.Once){if(this.result.root.type==="document"){let w=this.result.root.nodes.map(E=>y.Once(E,this.helpers));return p(w[0])?Promise.all(w):w}return y.Once(this.result.root,this.helpers)}else if(typeof y=="function")return y(this.result.root,this.result)}catch(w){throw this.handleError(w)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let y=this.result.opts,w=a;y.syntax&&(w=y.syntax.stringify),y.stringifier&&(w=y.stringifier),w.stringify&&(w=w.stringify);let R=new s(w,this.result.root,this.result.opts).generate();return this.result.css=R[0],this.result.map=R[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 y of this.plugins){let w=this.runOnRoot(y);if(p(w))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let y=this.result.root;for(;!y[e];)y[e]=!0,this.walkSync(y);if(this.listeners.OnceExit)if(y.type==="document")for(let w of y.nodes)this.visitSync(this.listeners.OnceExit,w);else this.visitSync(this.listeners.OnceExit,y)}return this.result}then(y,w){return this.async().then(y,w)}toString(){return this.css}visitSync(y,w){for(let[E,R]of y){this.result.lastPlugin=E;let O;try{O=R(w,this.helpers)}catch(M){throw this.handleError(M,w.proxyOf)}if(w.type!=="root"&&w.type!=="document"&&!w.parent)return!0;if(p(O))throw this.getAsyncError()}}visitTick(y){let w=y[y.length-1],{node:E,visitors:R}=w;if(E.type!=="root"&&E.type!=="document"&&!E.parent){y.pop();return}if(R.length>0&&w.visitorIndex<R.length){let[M,P]=R[w.visitorIndex];w.visitorIndex+=1,w.visitorIndex===R.length&&(w.visitors=[],w.visitorIndex=0),this.result.lastPlugin=M;try{return P(E.toProxy(),this.helpers)}catch(A){throw this.handleError(A,E)}}if(w.iterator!==0){let M=w.iterator,P;for(;P=E.nodes[E.indexes[M]];)if(E.indexes[M]+=1,!P[e]){P[e]=!0,y.push(g(P));return}w.iterator=0,delete E.indexes[M]}let O=w.events;for(;w.eventIndex<O.length;){let M=O[w.eventIndex];if(w.eventIndex+=1,M===n){E.nodes&&E.nodes.length&&(E[e]=!0,w.iterator=E.getIterator());return}else if(this.listeners[M]){w.visitors=this.listeners[M];return}}y.pop()}walkSync(y){y[e]=!0;let w=u(y);for(let E of w)if(E===n)y.nodes&&y.each(R=>{R[e]||this.walkSync(R)});else{let R=this.listeners[E];if(R&&this.visitSync(R,y.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return b.registerPostcss=C=>{v=C},Yt=b,b.default=b,d.registerLazyResult(b),c.registerLazyResult(b),Yt}var Jt,Ws;function Po(){if(Ws)return Jt;Ws=1;let e=ji(),t=ht(),s=Gi(),a=Kr(),r=Xr();class c{constructor(m,l,d){l=l.toString(),this.stringified=!1,this._processor=m,this._css=l,this._opts=d,this._map=void 0;let i,h=t;this.result=new r(this._processor,i,this._opts),this.result.css=l;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let n=new e(h,i,this._opts,l);if(n.isMap()){let[p,u]=n.generate();p&&(this.result.css=p),u&&(this.result.map=u)}else n.clearAnnotation(),this.result.css=n.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(m){return this.async().catch(m)}finally(m){return this.async().then(m,m)}sync(){if(this.error)throw this.error;return this.result}then(m,l){return this.async().then(m,l)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let m,l=a;try{m=l(this._css,this._opts)}catch(d){this.error=d}if(this.error)throw this.error;return this._root=m,m}get[Symbol.toStringTag](){return"NoWorkResult"}}return Jt=c,c.default=c,Jt}var Xt,zs;function ko(){if(zs)return Xt;zs=1;let e=Po(),t=Ji(),s=Jr(),a=je();class r{constructor(f=[]){this.version="8.4.38",this.plugins=this.normalize(f)}normalize(f){let m=[];for(let l of f)if(l.postcss===!0?l=l():l.postcss&&(l=l.postcss),typeof l=="object"&&Array.isArray(l.plugins))m=m.concat(l.plugins);else if(typeof l=="object"&&l.postcssPlugin)m.push(l);else if(typeof l=="function")m.push(l);else if(!(typeof l=="object"&&(l.parse||l.stringify)))throw new Error(l+" is not a PostCSS plugin");return m}process(f,m={}){return!this.plugins.length&&!m.parser&&!m.stringifier&&!m.syntax?new e(this,f,m):new t(this,f,m)}use(f){return this.plugins=this.plugins.concat(this.normalize([f])),this}}return Xt=r,r.default=r,a.registerProcessor(r),s.registerProcessor(r),Xt}var Qt,qs;function Lo(){if(qs)return Qt;qs=1;let e=dt(),t=Vi(),s=mt(),a=Qr(),r=pt(),c=je(),f=Zr();function m(l,d){if(Array.isArray(l))return l.map(o=>m(o));let{inputs:i,...h}=l;if(i){d=[];for(let o of i){let n={...o,__proto__:r.prototype};n.map&&(n.map={...n.map,__proto__:t.prototype}),d.push(n)}}if(h.nodes&&(h.nodes=l.nodes.map(o=>m(o,d))),h.source){let{inputId:o,...n}=h.source;h.source=n,o!=null&&(h.source.input=d[o])}if(h.type==="root")return new c(h);if(h.type==="decl")return new e(h);if(h.type==="rule")return new f(h);if(h.type==="comment")return new s(h);if(h.type==="atrule")return new a(h);throw new Error("Unknown node type: "+l.type)}return Qt=m,m.default=m,Qt}var Zt,Vs;function Fo(){if(Vs)return Zt;Vs=1;let e=Hr(),t=dt(),s=Ji(),a=xe(),r=ko(),c=ht(),f=Lo(),m=Jr(),l=Hi(),d=mt(),i=Qr(),h=Xr(),o=pt(),n=Kr(),p=Yi(),u=Zr(),g=je(),S=ft();function v(...b){return b.length===1&&Array.isArray(b[0])&&(b=b[0]),new r(b)}return v.plugin=function(C,y){let w=!1;function E(...O){console&&console.warn&&!w&&(w=!0,console.warn(C+`: postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(C+`: \\u91CC\\u9762 postcss.plugin \\u88AB\\u5F03\\u7528. \\u8FC1\\u79FB\\u6307\\u5357:\nhttps://www.w3ctech.com/topic/2226`));let M=y(...O);return M.postcssPlugin=C,M.postcssVersion=new r().version,M}let R;return Object.defineProperty(E,"postcss",{get(){return R||(R=E()),R}}),E.process=function(O,M,P){return v([E(P)]).process(O,M)},E},v.stringify=c,v.parse=n,v.fromJSON=f,v.list=p,v.comment=b=>new d(b),v.atRule=b=>new i(b),v.decl=b=>new t(b),v.rule=b=>new u(b),v.root=b=>new g(b),v.document=b=>new m(b),v.CssSyntaxError=e,v.Declaration=t,v.Container=a,v.Processor=r,v.Document=m,v.Comment=d,v.Warning=l,v.AtRule=i,v.Result=h,v.Input=o,v.Rule=u,v.Root=g,v.Node=S,s.registerPostcss(v),Zt=v,v.default=v,Zt}var Uo=Fo(),q=Mo(Uo);q.stringify;q.fromJSON;q.plugin;q.parse;q.list;q.document;q.comment;q.atRule;q.rule;q.decl;q.root;q.CssSyntaxError;q.Declaration;q.Container;q.Processor;q.Document;q.Comment;q.Warning;q.AtRule;q.Result;q.Input;q.Rule;q.Root;q.Node;var $o=Object.defineProperty,Bo=(e,t,s)=>t in e?$o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,ce=(e,t,s)=>Bo(e,typeof t!="symbol"?t+"":t,s);var Wo=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Wo=()=>new Date().getTime());function zo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function qo(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var s=function a(){return this instanceof a?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(s,a,r.get?r:{enumerable:!0,get:function(){return e[a]}})}),s}var Qe={exports:{}},js;function Vo(){if(js)return Qe.exports;js=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return Qe.exports=t(),Qe.exports.createColors=t,Qe.exports}var jo={},Go=Object.freeze(Object.defineProperty({__proto__:null,default:jo},Symbol.toStringTag,{value:"Module"})),pe=qo(Go),Kt,Gs;function es(){if(Gs)return Kt;Gs=1;let e=Vo(),t=pe;class s extends Error{constructor(r,c,f,m,l,d){super(r),this.name="CssSyntaxError",this.reason=r,l&&(this.file=l),m&&(this.source=m),d&&(this.plugin=d),typeof c<"u"&&typeof f<"u"&&(typeof c=="number"?(this.line=c,this.column=f):(this.line=c.line,this.column=c.column,this.endLine=f.line,this.endColumn=f.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,s)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(r){if(!this.source)return"";let c=this.source;r==null&&(r=e.isColorSupported),t&&r&&(c=t(c));let f=c.split(/\\r?\\n/),m=Math.max(this.line-3,0),l=Math.min(this.line+2,f.length),d=String(l).length,i,h;if(r){let{bold:o,gray:n,red:p}=e.createColors(!0);i=u=>o(p(u)),h=u=>n(u)}else i=h=o=>o;return f.slice(m,l).map((o,n)=>{let p=m+1+n,u=" "+(" "+p).slice(-d)+" | ";if(p===this.line){let g=h(u.replace(/\\d/g," "))+o.slice(0,this.column-1).replace(/[^\\t]/g," ");return i(">")+h(u)+o+`\n `+g+i("^")}return" "+h(u)+o}).join(`\n`)}toString(){let r=this.showSourceCode();return r&&(r=`\n\n`+r+`\n`),this.name+": "+this.message+r}}return Kt=s,s.default=s,Kt}var Ze={},Hs;function ts(){return Hs||(Hs=1,Ze.isClean=Symbol("isClean"),Ze.my=Symbol("my")),Ze}var er,Ys;function Xi(){if(Ys)return er;Ys=1;let e={after:`\n`,beforeClose:`\n`,beforeComment:`\n`,beforeDecl:`\n`,beforeOpen:" ",beforeRule:`\n`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function t(a){return a[0].toUpperCase()+a.slice(1)}class s{constructor(r){this.builder=r}atrule(r,c){let f="@"+r.name,m=r.params?this.rawValue(r,"params"):"";if(typeof r.raws.afterName<"u"?f+=r.raws.afterName:m&&(f+=" "),r.nodes)this.block(r,f+m);else{let l=(r.raws.between||"")+(c?";":"");this.builder(f+m+l,r)}}beforeAfter(r,c){let f;r.type==="decl"?f=this.raw(r,null,"beforeDecl"):r.type==="comment"?f=this.raw(r,null,"beforeComment"):c==="before"?f=this.raw(r,null,"beforeRule"):f=this.raw(r,null,"beforeClose");let m=r.parent,l=0;for(;m&&m.type!=="root";)l+=1,m=m.parent;if(f.includes(`\n`)){let d=this.raw(r,null,"indent");if(d.length)for(let i=0;i<l;i++)f+=d}return f}block(r,c){let f=this.raw(r,"between","beforeOpen");this.builder(c+f+"{",r,"start");let m;r.nodes&&r.nodes.length?(this.body(r),m=this.raw(r,"after")):m=this.raw(r,"after","emptyBody"),m&&this.builder(m),this.builder("}",r,"end")}body(r){let c=r.nodes.length-1;for(;c>0&&r.nodes[c].type==="comment";)c-=1;let f=this.raw(r,"semicolon");for(let m=0;m<r.nodes.length;m++){let l=r.nodes[m],d=this.raw(l,"before");d&&this.builder(d),this.stringify(l,c!==m||f)}}comment(r){let c=this.raw(r,"left","commentLeft"),f=this.raw(r,"right","commentRight");this.builder("/*"+c+r.text+f+"*/",r)}decl(r,c){let f=this.raw(r,"between","colon"),m=r.prop+f+this.rawValue(r,"value");r.important&&(m+=r.raws.important||" !important"),c&&(m+=";"),this.builder(m,r)}document(r){this.body(r)}raw(r,c,f){let m;if(f||(f=c),c&&(m=r.raws[c],typeof m<"u"))return m;let l=r.parent;if(f==="before"&&(!l||l.type==="root"&&l.first===r||l&&l.type==="document"))return"";if(!l)return e[f];let d=r.root();if(d.rawCache||(d.rawCache={}),typeof d.rawCache[f]<"u")return d.rawCache[f];if(f==="before"||f==="after")return this.beforeAfter(r,f);{let i="raw"+t(f);this[i]?m=this[i](d,r):d.walk(h=>{if(m=h.raws[c],typeof m<"u")return!1})}return typeof m>"u"&&(m=e[f]),d.rawCache[f]=m,m}rawBeforeClose(r){let c;return r.walk(f=>{if(f.nodes&&f.nodes.length>0&&typeof f.raws.after<"u")return c=f.raws.after,c.includes(`\n`)&&(c=c.replace(/[^\\n]+$/,"")),!1}),c&&(c=c.replace(/\\S/g,"")),c}rawBeforeComment(r,c){let f;return r.walkComments(m=>{if(typeof m.raws.before<"u")return f=m.raws.before,f.includes(`\n`)&&(f=f.replace(/[^\\n]+$/,"")),!1}),typeof f>"u"?f=this.raw(c,null,"beforeDecl"):f&&(f=f.replace(/\\S/g,"")),f}rawBeforeDecl(r,c){let f;return r.walkDecls(m=>{if(typeof m.raws.before<"u")return f=m.raws.before,f.includes(`\n`)&&(f=f.replace(/[^\\n]+$/,"")),!1}),typeof f>"u"?f=this.raw(c,null,"beforeRule"):f&&(f=f.replace(/\\S/g,"")),f}rawBeforeOpen(r){let c;return r.walk(f=>{if(f.type!=="decl"&&(c=f.raws.between,typeof c<"u"))return!1}),c}rawBeforeRule(r){let c;return r.walk(f=>{if(f.nodes&&(f.parent!==r||r.first!==f)&&typeof f.raws.before<"u")return c=f.raws.before,c.includes(`\n`)&&(c=c.replace(/[^\\n]+$/,"")),!1}),c&&(c=c.replace(/\\S/g,"")),c}rawColon(r){let c;return r.walkDecls(f=>{if(typeof f.raws.between<"u")return c=f.raws.between.replace(/[^\\s:]/g,""),!1}),c}rawEmptyBody(r){let c;return r.walk(f=>{if(f.nodes&&f.nodes.length===0&&(c=f.raws.after,typeof c<"u"))return!1}),c}rawIndent(r){if(r.raws.indent)return r.raws.indent;let c;return r.walk(f=>{let m=f.parent;if(m&&m!==r&&m.parent&&m.parent===r&&typeof f.raws.before<"u"){let l=f.raws.before.split(`\n`);return c=l[l.length-1],c=c.replace(/\\S/g,""),!1}}),c}rawSemicolon(r){let c;return r.walk(f=>{if(f.nodes&&f.nodes.length&&f.last.type==="decl"&&(c=f.raws.semicolon,typeof c<"u"))return!1}),c}rawValue(r,c){let f=r[c],m=r.raws[c];return m&&m.value===f?m.raw:f}root(r){this.body(r),r.raws.after&&this.builder(r.raws.after)}rule(r){this.block(r,this.rawValue(r,"selector")),r.raws.ownSemicolon&&this.builder(r.raws.ownSemicolon,r,"end")}stringify(r,c){if(!this[r.type])throw new Error("Unknown AST node type "+r.type+". Maybe you need to change PostCSS stringifier.");this[r.type](r,c)}}return er=s,s.default=s,er}var tr,Js;function gt(){if(Js)return tr;Js=1;let e=Xi();function t(s,a){new e(a).stringify(s)}return tr=t,t.default=t,tr}var rr,Xs;function yt(){if(Xs)return rr;Xs=1;let{isClean:e,my:t}=ts(),s=es(),a=Xi(),r=gt();function c(m,l){let d=new m.constructor;for(let i in m){if(!Object.prototype.hasOwnProperty.call(m,i)||i==="proxyCache")continue;let h=m[i],o=typeof h;i==="parent"&&o==="object"?l&&(d[i]=l):i==="source"?d[i]=h:Array.isArray(h)?d[i]=h.map(n=>c(n,d)):(o==="object"&&h!==null&&(h=c(h)),d[i]=h)}return d}class f{constructor(l={}){this.raws={},this[e]=!1,this[t]=!0;for(let d in l)if(d==="nodes"){this.nodes=[];for(let i of l[d])typeof i.clone=="function"?this.append(i.clone()):this.append(i)}else this[d]=l[d]}addToError(l){if(l.postcssNode=this,l.stack&&this.source&&/\\n\\s{4}at /.test(l.stack)){let d=this.source;l.stack=l.stack.replace(/\\n\\s{4}at /,`$&${d.input.from}:${d.start.line}:${d.start.column}$&`)}return l}after(l){return this.parent.insertAfter(this,l),this}assign(l={}){for(let d in l)this[d]=l[d];return this}before(l){return this.parent.insertBefore(this,l),this}cleanRaws(l){delete this.raws.before,delete this.raws.after,l||delete this.raws.between}clone(l={}){let d=c(this);for(let i in l)d[i]=l[i];return d}cloneAfter(l={}){let d=this.clone(l);return this.parent.insertAfter(this,d),d}cloneBefore(l={}){let d=this.clone(l);return this.parent.insertBefore(this,d),d}error(l,d={}){if(this.source){let{end:i,start:h}=this.rangeBy(d);return this.source.input.error(l,{column:h.column,line:h.line},{column:i.column,line:i.line},d)}return new s(l)}getProxyProcessor(){return{get(l,d){return d==="proxyOf"?l:d==="root"?()=>l.root().toProxy():l[d]},set(l,d,i){return l[d]===i||(l[d]=i,(d==="prop"||d==="value"||d==="name"||d==="params"||d==="important"||d==="text")&&l.markDirty()),!0}}}markDirty(){if(this[e]){this[e]=!1;let l=this;for(;l=l.parent;)l[e]=!1}}next(){if(!this.parent)return;let l=this.parent.index(this);return this.parent.nodes[l+1]}positionBy(l,d){let i=this.source.start;if(l.index)i=this.positionInside(l.index,d);else if(l.word){d=this.toString();let h=d.indexOf(l.word);h!==-1&&(i=this.positionInside(h,d))}return i}positionInside(l,d){let i=d||this.toString(),h=this.source.start.column,o=this.source.start.line;for(let n=0;n<l;n++)i[n]===`\n`?(h=1,o+=1):h+=1;return{column:h,line:o}}prev(){if(!this.parent)return;let l=this.parent.index(this);return this.parent.nodes[l-1]}rangeBy(l){let d={column:this.source.start.column,line:this.source.start.line},i=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:d.column+1,line:d.line};if(l.word){let h=this.toString(),o=h.indexOf(l.word);o!==-1&&(d=this.positionInside(o,h),i=this.positionInside(o+l.word.length,h))}else l.start?d={column:l.start.column,line:l.start.line}:l.index&&(d=this.positionInside(l.index)),l.end?i={column:l.end.column,line:l.end.line}:typeof l.endIndex=="number"?i=this.positionInside(l.endIndex):l.index&&(i=this.positionInside(l.index+1));return(i.line<d.line||i.line===d.line&&i.column<=d.column)&&(i={column:d.column+1,line:d.line}),{end:i,start:d}}raw(l,d){return new a().raw(this,l,d)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...l){if(this.parent){let d=this,i=!1;for(let h of l)h===this?i=!0:i?(this.parent.insertAfter(d,h),d=h):this.parent.insertBefore(d,h);i||this.remove()}return this}root(){let l=this;for(;l.parent&&l.parent.type!=="document";)l=l.parent;return l}toJSON(l,d){let i={},h=d==null;d=d||new Map;let o=0;for(let n in this){if(!Object.prototype.hasOwnProperty.call(this,n)||n==="parent"||n==="proxyCache")continue;let p=this[n];if(Array.isArray(p))i[n]=p.map(u=>typeof u=="object"&&u.toJSON?u.toJSON(null,d):u);else if(typeof p=="object"&&p.toJSON)i[n]=p.toJSON(null,d);else if(n==="source"){let u=d.get(p.input);u==null&&(u=o,d.set(p.input,o),o++),i[n]={end:p.end,inputId:u,start:p.start}}else i[n]=p}return h&&(i.inputs=[...d.keys()].map(n=>n.toJSON())),i}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(l=r){l.stringify&&(l=l.stringify);let d="";return l(this,i=>{d+=i}),d}warn(l,d,i){let h={node:this};for(let o in i)h[o]=i[o];return l.warn(d,h)}get proxyOf(){return this}}return rr=f,f.default=f,rr}var sr,Qs;function wt(){if(Qs)return sr;Qs=1;let e=yt();class t extends e{constructor(a){a&&typeof a.value<"u"&&typeof a.value!="string"&&(a={...a,value:String(a.value)}),super(a),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}}return sr=t,t.default=t,sr}var ir,Zs;function Ho(){if(Zs)return ir;Zs=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return ir={nanoid:(a=21)=>{let r="",c=a;for(;c--;)r+=e[Math.random()*64|0];return r},customAlphabet:(a,r=21)=>(c=r)=>{let f="",m=c;for(;m--;)f+=a[Math.random()*a.length|0];return f}},ir}var nr,Ks;function Qi(){if(Ks)return nr;Ks=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=pe,{existsSync:s,readFileSync:a}=pe,{dirname:r,join:c}=pe;function f(l){return Buffer?Buffer.from(l,"base64").toString():window.atob(l)}class m{constructor(d,i){if(i.map===!1)return;this.loadAnnotation(d),this.inline=this.startWith(this.annotation,"data:");let h=i.map?i.map.prev:void 0,o=this.loadMap(i.from,h);!this.mapFile&&i.from&&(this.mapFile=i.from),this.mapFile&&(this.root=r(this.mapFile)),o&&(this.text=o)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(d){let i=/^data:application\\/json;charset=utf-?8;base64,/,h=/^data:application\\/json;base64,/,o=/^data:application\\/json;charset=utf-?8,/,n=/^data:application\\/json,/;if(o.test(d)||n.test(d))return decodeURIComponent(d.substr(RegExp.lastMatch.length));if(i.test(d)||h.test(d))return f(d.substr(RegExp.lastMatch.length));let p=d.match(/data:application\\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+p)}getAnnotationURL(d){return d.replace(/^\\/\\*\\s*# sourceMappingURL=/,"").trim()}isMap(d){return typeof d!="object"?!1:typeof d.mappings=="string"||typeof d._mappings=="string"||Array.isArray(d.sections)}loadAnnotation(d){let i=d.match(/\\/\\*\\s*# sourceMappingURL=/gm);if(!i)return;let h=d.lastIndexOf(i.pop()),o=d.indexOf("*/",h);h>-1&&o>-1&&(this.annotation=this.getAnnotationURL(d.substring(h,o)))}loadFile(d){if(this.root=r(d),s(d))return this.mapFile=d,a(d,"utf-8").toString().trim()}loadMap(d,i){if(i===!1)return!1;if(i){if(typeof i=="string")return i;if(typeof i=="function"){let h=i(d);if(h){let o=this.loadFile(h);if(!o)throw new Error("Unable to load previous source map: "+h.toString());return o}}else{if(i instanceof e)return t.fromSourceMap(i).toString();if(i instanceof t)return i.toString();if(this.isMap(i))return JSON.stringify(i);throw new Error("Unsupported previous source map format: "+i.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let h=this.annotation;return d&&(h=c(r(d),h)),this.loadFile(h)}}}startWith(d,i){return d?d.substr(0,i.length)===i:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return nr=m,m.default=m,nr}var or,ei;function bt(){if(ei)return or;ei=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=pe,{fileURLToPath:s,pathToFileURL:a}=pe,{isAbsolute:r,resolve:c}=pe,{nanoid:f}=Ho(),m=pe,l=es(),d=Qi(),i=Symbol("fromOffsetCache"),h=!!(e&&t),o=!!(c&&r);class n{constructor(u,g={}){if(u===null||typeof u>"u"||typeof u=="object"&&!u.toString)throw new Error(`PostCSS received ${u} instead of CSS string`);if(this.css=u.toString(),this.css[0]==="\\uFEFF"||this.css[0]==="\\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,g.from&&(!o||/^\\w+:\\/\\//.test(g.from)||r(g.from)?this.file=g.from:this.file=c(g.from)),o&&h){let S=new d(this.css,g);if(S.text){this.map=S;let v=S.consumer().file;!this.file&&v&&(this.file=this.mapResolve(v))}}this.file||(this.id="<input css "+f(6)+">"),this.map&&(this.map.file=this.from)}error(u,g,S,v={}){let b,C,y;if(g&&typeof g=="object"){let E=g,R=S;if(typeof E.offset=="number"){let O=this.fromOffset(E.offset);g=O.line,S=O.col}else g=E.line,S=E.column;if(typeof R.offset=="number"){let O=this.fromOffset(R.offset);C=O.line,y=O.col}else C=R.line,y=R.column}else if(!S){let E=this.fromOffset(g);g=E.line,S=E.col}let w=this.origin(g,S,C,y);return w?b=new l(u,w.endLine===void 0?w.line:{column:w.column,line:w.line},w.endLine===void 0?w.column:{column:w.endColumn,line:w.endLine},w.source,w.file,v.plugin):b=new l(u,C===void 0?g:{column:S,line:g},C===void 0?S:{column:y,line:C},this.css,this.file,v.plugin),b.input={column:S,endColumn:y,endLine:C,line:g,source:this.css},this.file&&(a&&(b.input.url=a(this.file).toString()),b.input.file=this.file),b}fromOffset(u){let g,S;if(this[i])S=this[i];else{let b=this.css.split(`\n`);S=new Array(b.length);let C=0;for(let y=0,w=b.length;y<w;y++)S[y]=C,C+=b[y].length+1;this[i]=S}g=S[S.length-1];let v=0;if(u>=g)v=S.length-1;else{let b=S.length-2,C;for(;v<b;)if(C=v+(b-v>>1),u<S[C])b=C-1;else if(u>=S[C+1])v=C+1;else{v=C;break}}return{col:u-S[v]+1,line:v+1}}mapResolve(u){return/^\\w+:\\/\\//.test(u)?u:c(this.map.consumer().sourceRoot||this.map.root||".",u)}origin(u,g,S,v){if(!this.map)return!1;let b=this.map.consumer(),C=b.originalPositionFor({column:g,line:u});if(!C.source)return!1;let y;typeof S=="number"&&(y=b.originalPositionFor({column:v,line:S}));let w;r(C.source)?w=a(C.source):w=new URL(C.source,this.map.consumer().sourceRoot||a(this.map.mapFile));let E={column:C.column,endColumn:y&&y.column,endLine:y&&y.line,line:C.line,url:w.toString()};if(w.protocol==="file:")if(s)E.file=s(w);else throw new Error("file: protocol is not available in this PostCSS build");let R=b.sourceContentFor(C.source);return R&&(E.source=R),E}toJSON(){let u={};for(let g of["hasBOM","css","file","id"])this[g]!=null&&(u[g]=this[g]);return this.map&&(u.map={...this.map},u.map.consumerCache&&(u.map.consumerCache=void 0)),u}get from(){return this.file||this.id}}return or=n,n.default=n,m&&m.registerInput&&m.registerInput(n),or}var ar,ti;function Zi(){if(ti)return ar;ti=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=pe,{dirname:s,relative:a,resolve:r,sep:c}=pe,{pathToFileURL:f}=pe,m=bt(),l=!!(e&&t),d=!!(s&&r&&a&&c);class i{constructor(o,n,p,u){this.stringify=o,this.mapOpts=p.map||{},this.root=n,this.opts=p,this.css=u,this.originalCSS=u,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let o;this.isInline()?o="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?o=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?o=this.mapOpts.annotation(this.opts.to,this.root):o=this.outputFile()+".map";let n=`\n`;this.css.includes(`\\r\n`)&&(n=`\\r\n`),this.css+=n+"/*# sourceMappingURL="+o+" */"}applyPrevMaps(){for(let o of this.previous()){let n=this.toUrl(this.path(o.file)),p=o.root||s(o.file),u;this.mapOpts.sourcesContent===!1?(u=new e(o.text),u.sourcesContent&&(u.sourcesContent=null)):u=o.consumer(),this.map.applySourceMap(u,n,this.toUrl(this.path(p)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let o;for(let n=this.root.nodes.length-1;n>=0;n--)o=this.root.nodes[n],o.type==="comment"&&o.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(n)}else this.css&&(this.css=this.css.replace(/\\n*?\\/\\*#[\\S\\s]*?\\*\\/$/gm,""))}generate(){if(this.clearAnnotation(),d&&l&&this.isMap())return this.generateMap();{let o="";return this.stringify(this.root,n=>{o+=n}),[o]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let o=this.previous()[0].consumer();o.file=this.outputFile(),this.map=t.fromSourceMap(o,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<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 t({file:this.outputFile(),ignoreInvalidMapping:!0});let o=1,n=1,p="<no source>",u={generated:{column:0,line:0},original:{column:0,line:0},source:""},g,S;this.stringify(this.root,(v,b,C)=>{if(this.css+=v,b&&C!=="end"&&(u.generated.line=o,u.generated.column=n-1,b.source&&b.source.start?(u.source=this.sourcePath(b),u.original.line=b.source.start.line,u.original.column=b.source.start.column-1,this.map.addMapping(u)):(u.source=p,u.original.line=1,u.original.column=0,this.map.addMapping(u))),g=v.match(/\\n/g),g?(o+=g.length,S=v.lastIndexOf(`\n`),n=v.length-S):n+=v.length,b&&C!=="start"){let y=b.parent||{raws:{}};(!(b.type==="decl"||b.type==="atrule"&&!b.nodes)||b!==y.last||y.raws.semicolon)&&(b.source&&b.source.end?(u.source=this.sourcePath(b),u.original.line=b.source.end.line,u.original.column=b.source.end.column-1,u.generated.line=o,u.generated.column=n-2,this.map.addMapping(u)):(u.source=p,u.original.line=1,u.original.column=0,u.generated.line=o,u.generated.column=n-1,this.map.addMapping(u)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(o=>o.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let o=this.mapOpts.annotation;return typeof o<"u"&&o!==!0?!1:this.previous().length?this.previous().some(n=>n.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(o=>o.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(o){if(this.mapOpts.absolute||o.charCodeAt(0)===60||/^\\w+:\\/\\//.test(o))return o;let n=this.memoizedPaths.get(o);if(n)return n;let p=this.opts.to?s(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(p=s(r(p,this.mapOpts.annotation)));let u=a(p,o);return this.memoizedPaths.set(o,u),u}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(o=>{if(o.source&&o.source.input.map){let n=o.source.input.map;this.previousMaps.includes(n)||this.previousMaps.push(n)}});else{let o=new m(this.originalCSS,this.opts);o.map&&this.previousMaps.push(o.map)}return this.previousMaps}setSourcesContent(){let o={};if(this.root)this.root.walk(n=>{if(n.source){let p=n.source.input.from;if(p&&!o[p]){o[p]=!0;let u=this.usesFileUrls?this.toFileUrl(p):this.toUrl(this.path(p));this.map.setSourceContent(u,n.source.input.css)}}});else if(this.css){let n=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(n,this.css)}}sourcePath(o){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(o.source.input.from):this.toUrl(this.path(o.source.input.from))}toBase64(o){return Buffer?Buffer.from(o).toString("base64"):window.btoa(unescape(encodeURIComponent(o)))}toFileUrl(o){let n=this.memoizedFileURLs.get(o);if(n)return n;if(f){let p=f(o).toString();return this.memoizedFileURLs.set(o,p),p}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(o){let n=this.memoizedURLs.get(o);if(n)return n;c==="\\\\"&&(o=o.replace(/\\\\/g,"/"));let p=encodeURI(o).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(o,p),p}}return ar=i,ar}var lr,ri;function vt(){if(ri)return lr;ri=1;let e=yt();class t extends e{constructor(a){super(a),this.type="comment"}}return lr=t,t.default=t,lr}var ur,si;function Re(){if(si)return ur;si=1;let{isClean:e,my:t}=ts(),s=wt(),a=vt(),r=yt(),c,f,m,l;function d(o){return o.map(n=>(n.nodes&&(n.nodes=d(n.nodes)),delete n.source,n))}function i(o){if(o[e]=!1,o.proxyOf.nodes)for(let n of o.proxyOf.nodes)i(n)}class h extends r{append(...n){for(let p of n){let u=this.normalize(p,this.last);for(let g of u)this.proxyOf.nodes.push(g)}return this.markDirty(),this}cleanRaws(n){if(super.cleanRaws(n),this.nodes)for(let p of this.nodes)p.cleanRaws(n)}each(n){if(!this.proxyOf.nodes)return;let p=this.getIterator(),u,g;for(;this.indexes[p]<this.proxyOf.nodes.length&&(u=this.indexes[p],g=n(this.proxyOf.nodes[u],u),g!==!1);)this.indexes[p]+=1;return delete this.indexes[p],g}every(n){return this.nodes.every(n)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let n=this.lastEach;return this.indexes[n]=0,n}getProxyProcessor(){return{get(n,p){return p==="proxyOf"?n:n[p]?p==="each"||typeof p=="string"&&p.startsWith("walk")?(...u)=>n[p](...u.map(g=>typeof g=="function"?(S,v)=>g(S.toProxy(),v):g)):p==="every"||p==="some"?u=>n[p]((g,...S)=>u(g.toProxy(),...S)):p==="root"?()=>n.root().toProxy():p==="nodes"?n.nodes.map(u=>u.toProxy()):p==="first"||p==="last"?n[p].toProxy():n[p]:n[p]},set(n,p,u){return n[p]===u||(n[p]=u,(p==="name"||p==="params"||p==="selector")&&n.markDirty()),!0}}}index(n){return typeof n=="number"?n:(n.proxyOf&&(n=n.proxyOf),this.proxyOf.nodes.indexOf(n))}insertAfter(n,p){let u=this.index(n),g=this.normalize(p,this.proxyOf.nodes[u]).reverse();u=this.index(n);for(let v of g)this.proxyOf.nodes.splice(u+1,0,v);let S;for(let v in this.indexes)S=this.indexes[v],u<S&&(this.indexes[v]=S+g.length);return this.markDirty(),this}insertBefore(n,p){let u=this.index(n),g=u===0?"prepend":!1,S=this.normalize(p,this.proxyOf.nodes[u],g).reverse();u=this.index(n);for(let b of S)this.proxyOf.nodes.splice(u,0,b);let v;for(let b in this.indexes)v=this.indexes[b],u<=v&&(this.indexes[b]=v+S.length);return this.markDirty(),this}normalize(n,p){if(typeof n=="string")n=d(c(n).nodes);else if(typeof n>"u")n=[];else if(Array.isArray(n)){n=n.slice(0);for(let g of n)g.parent&&g.parent.removeChild(g,"ignore")}else if(n.type==="root"&&this.type!=="document"){n=n.nodes.slice(0);for(let g of n)g.parent&&g.parent.removeChild(g,"ignore")}else if(n.type)n=[n];else if(n.prop){if(typeof n.value>"u")throw new Error("Value field is missed in node creation");typeof n.value!="string"&&(n.value=String(n.value)),n=[new s(n)]}else if(n.selector)n=[new f(n)];else if(n.name)n=[new m(n)];else if(n.text)n=[new a(n)];else throw new Error("Unknown node type in node creation");return n.map(g=>(g[t]||h.rebuild(g),g=g.proxyOf,g.parent&&g.parent.removeChild(g),g[e]&&i(g),typeof g.raws.before>"u"&&p&&typeof p.raws.before<"u"&&(g.raws.before=p.raws.before.replace(/\\S/g,"")),g.parent=this.proxyOf,g))}prepend(...n){n=n.reverse();for(let p of n){let u=this.normalize(p,this.first,"prepend").reverse();for(let g of u)this.proxyOf.nodes.unshift(g);for(let g in this.indexes)this.indexes[g]=this.indexes[g]+u.length}return this.markDirty(),this}push(n){return n.parent=this,this.proxyOf.nodes.push(n),this}removeAll(){for(let n of this.proxyOf.nodes)n.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(n){n=this.index(n),this.proxyOf.nodes[n].parent=void 0,this.proxyOf.nodes.splice(n,1);let p;for(let u in this.indexes)p=this.indexes[u],p>=n&&(this.indexes[u]=p-1);return this.markDirty(),this}replaceValues(n,p,u){return u||(u=p,p={}),this.walkDecls(g=>{p.props&&!p.props.includes(g.prop)||p.fast&&!g.value.includes(p.fast)||(g.value=g.value.replace(n,u))}),this.markDirty(),this}some(n){return this.nodes.some(n)}walk(n){return this.each((p,u)=>{let g;try{g=n(p,u)}catch(S){throw p.addToError(S)}return g!==!1&&p.walk&&(g=p.walk(n)),g})}walkAtRules(n,p){return p?n instanceof RegExp?this.walk((u,g)=>{if(u.type==="atrule"&&n.test(u.name))return p(u,g)}):this.walk((u,g)=>{if(u.type==="atrule"&&u.name===n)return p(u,g)}):(p=n,this.walk((u,g)=>{if(u.type==="atrule")return p(u,g)}))}walkComments(n){return this.walk((p,u)=>{if(p.type==="comment")return n(p,u)})}walkDecls(n,p){return p?n instanceof RegExp?this.walk((u,g)=>{if(u.type==="decl"&&n.test(u.prop))return p(u,g)}):this.walk((u,g)=>{if(u.type==="decl"&&u.prop===n)return p(u,g)}):(p=n,this.walk((u,g)=>{if(u.type==="decl")return p(u,g)}))}walkRules(n,p){return p?n instanceof RegExp?this.walk((u,g)=>{if(u.type==="rule"&&n.test(u.selector))return p(u,g)}):this.walk((u,g)=>{if(u.type==="rule"&&u.selector===n)return p(u,g)}):(p=n,this.walk((u,g)=>{if(u.type==="rule")return p(u,g)}))}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]}}return h.registerParse=o=>{c=o},h.registerRule=o=>{f=o},h.registerAtRule=o=>{m=o},h.registerRoot=o=>{l=o},ur=h,h.default=h,h.rebuild=o=>{o.type==="atrule"?Object.setPrototypeOf(o,m.prototype):o.type==="rule"?Object.setPrototypeOf(o,f.prototype):o.type==="decl"?Object.setPrototypeOf(o,s.prototype):o.type==="comment"?Object.setPrototypeOf(o,a.prototype):o.type==="root"&&Object.setPrototypeOf(o,l.prototype),o[t]=!0,o.nodes&&o.nodes.forEach(n=>{h.rebuild(n)})},ur}var cr,ii;function rs(){if(ii)return cr;ii=1;let e=Re(),t,s;class a extends e{constructor(c){super({type:"document",...c}),this.nodes||(this.nodes=[])}toResult(c={}){return new t(new s,this,c).stringify()}}return a.registerLazyResult=r=>{t=r},a.registerProcessor=r=>{s=r},cr=a,a.default=a,cr}var hr,ni;function Ki(){if(ni)return hr;ni=1;let e={};return hr=function(s){e[s]||(e[s]=!0,typeof console<"u"&&console.warn&&console.warn(s))},hr}var fr,oi;function en(){if(oi)return fr;oi=1;class e{constructor(s,a={}){if(this.type="warning",this.text=s,a.node&&a.node.source){let r=a.node.rangeBy(a);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in a)this[r]=a[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}}return fr=e,e.default=e,fr}var dr,ai;function ss(){if(ai)return dr;ai=1;let e=en();class t{constructor(a,r,c){this.processor=a,this.messages=[],this.root=r,this.opts=c,this.css=void 0,this.map=void 0}toString(){return this.css}warn(a,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let c=new e(a,r);return this.messages.push(c),c}warnings(){return this.messages.filter(a=>a.type==="warning")}get content(){return this.css}}return dr=t,t.default=t,dr}var pr,li;function Yo(){if(li)return pr;li=1;let e=39,t=34,s=92,a=47,r=10,c=32,f=12,m=9,l=13,d=91,i=93,h=40,o=41,n=123,p=125,u=59,g=42,S=58,v=64,b=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/g,C=/[\\t\\n\\f\\r !"#\'():;@[\\\\\\]{}]|\\/(?=\\*)/g,y=/.[\\r\\n"\'(/\\\\]/,w=/[\\da-f]/i;return pr=function(R,O={}){let M=R.css.valueOf(),P=O.ignoreErrors,A,x,fe,ie,$,U,G,Z,H,B,be=M.length,N=0,me=[],le=[];function ke(){return N}function K(D){throw R.error("Unclosed "+D,N)}function ne(){return le.length===0&&N>=be}function Ee(D){if(le.length)return le.pop();if(N>=be)return;let Y=D?D.ignoreUnclosed:!1;switch(A=M.charCodeAt(N),A){case r:case c:case m:case l:case f:{x=N;do x+=1,A=M.charCodeAt(x);while(A===c||A===r||A===m||A===l||A===f);B=["space",M.slice(N,x)],N=x-1;break}case d:case i:case n:case p:case S:case u:case o:{let _=String.fromCharCode(A);B=[_,_,N];break}case h:{if(Z=me.length?me.pop()[1]:"",H=M.charCodeAt(N+1),Z==="url"&&H!==e&&H!==t&&H!==c&&H!==r&&H!==m&&H!==f&&H!==l){x=N;do{if(U=!1,x=M.indexOf(")",x+1),x===-1)if(P||Y){x=N;break}else K("bracket");for(G=x;M.charCodeAt(G-1)===s;)G-=1,U=!U}while(U);B=["brackets",M.slice(N,x+1),N,x],N=x}else x=M.indexOf(")",N+1),ie=M.slice(N,x+1),x===-1||y.test(ie)?B=["(","(",N]:(B=["brackets",ie,N,x],N=x);break}case e:case t:{fe=A===e?"\'":\'"\',x=N;do{if(U=!1,x=M.indexOf(fe,x+1),x===-1)if(P||Y){x=N+1;break}else K("string");for(G=x;M.charCodeAt(G-1)===s;)G-=1,U=!U}while(U);B=["string",M.slice(N,x+1),N,x],N=x;break}case v:{b.lastIndex=N+1,b.test(M),b.lastIndex===0?x=M.length-1:x=b.lastIndex-2,B=["at-word",M.slice(N,x+1),N,x],N=x;break}case s:{for(x=N,$=!0;M.charCodeAt(x+1)===s;)x+=1,$=!$;if(A=M.charCodeAt(x+1),$&&A!==a&&A!==c&&A!==r&&A!==m&&A!==l&&A!==f&&(x+=1,w.test(M.charAt(x)))){for(;w.test(M.charAt(x+1));)x+=1;M.charCodeAt(x+1)===c&&(x+=1)}B=["word",M.slice(N,x+1),N,x],N=x;break}default:{A===a&&M.charCodeAt(N+1)===g?(x=M.indexOf("*/",N+2)+1,x===0&&(P||Y?x=M.length:K("comment")),B=["comment",M.slice(N,x+1),N,x],N=x):(C.lastIndex=N+1,C.test(M),C.lastIndex===0?x=M.length-1:x=C.lastIndex-2,B=["word",M.slice(N,x+1),N,x],me.push(B),N=x);break}}return N++,B}function ge(D){le.push(D)}return{back:ge,endOfFile:ne,nextToken:Ee,position:ke}},pr}var mr,ui;function is(){if(ui)return mr;ui=1;let e=Re();class t extends e{constructor(a){super(a),this.type="atrule"}append(...a){return this.proxyOf.nodes||(this.nodes=[]),super.append(...a)}prepend(...a){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...a)}}return mr=t,t.default=t,e.registerAtRule(t),mr}var gr,ci;function Ge(){if(ci)return gr;ci=1;let e=Re(),t,s;class a extends e{constructor(c){super(c),this.type="root",this.nodes||(this.nodes=[])}normalize(c,f,m){let l=super.normalize(c);if(f){if(m==="prepend")this.nodes.length>1?f.raws.before=this.nodes[1].raws.before:delete f.raws.before;else if(this.first!==f)for(let d of l)d.raws.before=f.raws.before}return l}removeChild(c,f){let m=this.index(c);return!f&&m===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[m].raws.before),super.removeChild(c)}toResult(c={}){return new t(new s,this,c).stringify()}}return a.registerLazyResult=r=>{t=r},a.registerProcessor=r=>{s=r},gr=a,a.default=a,e.registerRoot(a),gr}var yr,hi;function tn(){if(hi)return yr;hi=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let s=[" ",`\n`," "];return e.split(t,s)},split(t,s,a){let r=[],c="",f=!1,m=0,l=!1,d="",i=!1;for(let h of t)i?i=!1:h==="\\\\"?i=!0:l?h===d&&(l=!1):h===\'"\'||h==="\'"?(l=!0,d=h):h==="("?m+=1:h===")"?m>0&&(m-=1):m===0&&s.includes(h)&&(f=!0),f?(c!==""&&r.push(c.trim()),c="",f=!1):c+=h;return(a||c!=="")&&r.push(c.trim()),r}};return yr=e,e.default=e,yr}var wr,fi;function ns(){if(fi)return wr;fi=1;let e=Re(),t=tn();class s extends e{constructor(r){super(r),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(r){let c=this.selector?this.selector.match(/,\\s*/):null,f=c?c[0]:","+this.raw("between","beforeOpen");this.selector=r.join(f)}}return wr=s,s.default=s,e.registerRule(s),wr}var br,di;function Jo(){if(di)return br;di=1;let e=wt(),t=Yo(),s=vt(),a=is(),r=Ge(),c=ns(),f={empty:!0,space:!0};function m(d){for(let i=d.length-1;i>=0;i--){let h=d[i],o=h[3]||h[2];if(o)return o}}class l{constructor(i){this.input=i,this.root=new r,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:i,start:{column:1,line:1,offset:0}}}atrule(i){let h=new a;h.name=i[1].slice(1),h.name===""&&this.unnamedAtrule(h,i),this.init(h,i[2]);let o,n,p,u=!1,g=!1,S=[],v=[];for(;!this.tokenizer.endOfFile();){if(i=this.tokenizer.nextToken(),o=i[0],o==="("||o==="["?v.push(o==="("?")":"]"):o==="{"&&v.length>0?v.push("}"):o===v[v.length-1]&&v.pop(),v.length===0)if(o===";"){h.source.end=this.getPosition(i[2]),h.source.end.offset++,this.semicolon=!0;break}else if(o==="{"){g=!0;break}else if(o==="}"){if(S.length>0){for(p=S.length-1,n=S[p];n&&n[0]==="space";)n=S[--p];n&&(h.source.end=this.getPosition(n[3]||n[2]),h.source.end.offset++)}this.end(i);break}else S.push(i);else S.push(i);if(this.tokenizer.endOfFile()){u=!0;break}}h.raws.between=this.spacesAndCommentsFromEnd(S),S.length?(h.raws.afterName=this.spacesAndCommentsFromStart(S),this.raw(h,"params",S),u&&(i=S[S.length-1],h.source.end=this.getPosition(i[3]||i[2]),h.source.end.offset++,this.spaces=h.raws.between,h.raws.between="")):(h.raws.afterName="",h.params=""),g&&(h.nodes=[],this.current=h)}checkMissedSemicolon(i){let h=this.colon(i);if(h===!1)return;let o=0,n;for(let p=h-1;p>=0&&(n=i[p],!(n[0]!=="space"&&(o+=1,o===2)));p--);throw this.input.error("Missed semicolon",n[0]==="word"?n[3]+1:n[2])}colon(i){let h=0,o,n,p;for(let[u,g]of i.entries()){if(o=g,n=o[0],n==="("&&(h+=1),n===")"&&(h-=1),h===0&&n===":")if(!p)this.doubleColon(o);else{if(p[0]==="word"&&p[1]==="progid")continue;return u}p=o}return!1}comment(i){let h=new s;this.init(h,i[2]),h.source.end=this.getPosition(i[3]||i[2]),h.source.end.offset++;let o=i[1].slice(2,-2);if(/^\\s*$/.test(o))h.text="",h.raws.left=o,h.raws.right="";else{let n=o.match(/^(\\s*)([^]*\\S)(\\s*)$/);h.text=n[2],h.raws.left=n[1],h.raws.right=n[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(i,h){let o=new e;this.init(o,i[0][2]);let n=i[i.length-1];for(n[0]===";"&&(this.semicolon=!0,i.pop()),o.source.end=this.getPosition(n[3]||n[2]||m(i)),o.source.end.offset++;i[0][0]!=="word";)i.length===1&&this.unknownWord(i),o.raws.before+=i.shift()[1];for(o.source.start=this.getPosition(i[0][2]),o.prop="";i.length;){let v=i[0][0];if(v===":"||v==="space"||v==="comment")break;o.prop+=i.shift()[1]}o.raws.between="";let p;for(;i.length;)if(p=i.shift(),p[0]===":"){o.raws.between+=p[1];break}else p[0]==="word"&&/\\w/.test(p[1])&&this.unknownWord([p]),o.raws.between+=p[1];(o.prop[0]==="_"||o.prop[0]==="*")&&(o.raws.before+=o.prop[0],o.prop=o.prop.slice(1));let u=[],g;for(;i.length&&(g=i[0][0],!(g!=="space"&&g!=="comment"));)u.push(i.shift());this.precheckMissedSemicolon(i);for(let v=i.length-1;v>=0;v--){if(p=i[v],p[1].toLowerCase()==="!important"){o.important=!0;let b=this.stringFrom(i,v);b=this.spacesFromEnd(i)+b,b!==" !important"&&(o.raws.important=b);break}else if(p[1].toLowerCase()==="important"){let b=i.slice(0),C="";for(let y=v;y>0;y--){let w=b[y][0];if(C.trim().indexOf("!")===0&&w!=="space")break;C=b.pop()[1]+C}C.trim().indexOf("!")===0&&(o.important=!0,o.raws.important=C,i=b)}if(p[0]!=="space"&&p[0]!=="comment")break}i.some(v=>v[0]!=="space"&&v[0]!=="comment")&&(o.raws.between+=u.map(v=>v[1]).join(""),u=[]),this.raw(o,"value",u.concat(i),h),o.value.includes(":")&&!h&&this.checkMissedSemicolon(i)}doubleColon(i){throw this.input.error("Double colon",{offset:i[2]},{offset:i[2]+i[1].length})}emptyRule(i){let h=new c;this.init(h,i[2]),h.selector="",h.raws.between="",this.current=h}end(i){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(i[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(i)}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(i){if(this.spaces+=i[1],this.current.nodes){let h=this.current.nodes[this.current.nodes.length-1];h&&h.type==="rule"&&!h.raws.ownSemicolon&&(h.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(i){let h=this.input.fromOffset(i);return{column:h.col,line:h.line,offset:i}}init(i,h){this.current.push(i),i.source={input:this.input,start:this.getPosition(h)},i.raws.before=this.spaces,this.spaces="",i.type!=="comment"&&(this.semicolon=!1)}other(i){let h=!1,o=null,n=!1,p=null,u=[],g=i[1].startsWith("--"),S=[],v=i;for(;v;){if(o=v[0],S.push(v),o==="("||o==="[")p||(p=v),u.push(o==="("?")":"]");else if(g&&n&&o==="{")p||(p=v),u.push("}");else if(u.length===0)if(o===";")if(n){this.decl(S,g);return}else break;else if(o==="{"){this.rule(S);return}else if(o==="}"){this.tokenizer.back(S.pop()),h=!0;break}else o===":"&&(n=!0);else o===u[u.length-1]&&(u.pop(),u.length===0&&(p=null));v=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(h=!0),u.length>0&&this.unclosedBracket(p),h&&n){if(!g)for(;S.length&&(v=S[S.length-1][0],!(v!=="space"&&v!=="comment"));)this.tokenizer.back(S.pop());this.decl(S,g)}else this.unknownWord(S)}parse(){let i;for(;!this.tokenizer.endOfFile();)switch(i=this.tokenizer.nextToken(),i[0]){case"space":this.spaces+=i[1];break;case";":this.freeSemicolon(i);break;case"}":this.end(i);break;case"comment":this.comment(i);break;case"at-word":this.atrule(i);break;case"{":this.emptyRule(i);break;default:this.other(i);break}this.endFile()}precheckMissedSemicolon(){}raw(i,h,o,n){let p,u,g=o.length,S="",v=!0,b,C;for(let y=0;y<g;y+=1)p=o[y],u=p[0],u==="space"&&y===g-1&&!n?v=!1:u==="comment"?(C=o[y-1]?o[y-1][0]:"empty",b=o[y+1]?o[y+1][0]:"empty",!f[C]&&!f[b]?S.slice(-1)===","?v=!1:S+=p[1]:v=!1):S+=p[1];if(!v){let y=o.reduce((w,E)=>w+E[1],"");i.raws[h]={raw:y,value:S}}i[h]=S}rule(i){i.pop();let h=new c;this.init(h,i[0][2]),h.raws.between=this.spacesAndCommentsFromEnd(i),this.raw(h,"selector",i),this.current=h}spacesAndCommentsFromEnd(i){let h,o="";for(;i.length&&(h=i[i.length-1][0],!(h!=="space"&&h!=="comment"));)o=i.pop()[1]+o;return o}spacesAndCommentsFromStart(i){let h,o="";for(;i.length&&(h=i[0][0],!(h!=="space"&&h!=="comment"));)o+=i.shift()[1];return o}spacesFromEnd(i){let h,o="";for(;i.length&&(h=i[i.length-1][0],h==="space");)o=i.pop()[1]+o;return o}stringFrom(i,h){let o="";for(let n=h;n<i.length;n++)o+=i[n][1];return i.splice(h,i.length-h),o}unclosedBlock(){let i=this.current.source.start;throw this.input.error("Unclosed block",i.line,i.column)}unclosedBracket(i){throw this.input.error("Unclosed bracket",{offset:i[2]},{offset:i[2]+1})}unexpectedClose(i){throw this.input.error("Unexpected }",{offset:i[2]},{offset:i[2]+1})}unknownWord(i){throw this.input.error("Unknown word",{offset:i[0][2]},{offset:i[0][2]+i[0][1].length})}unnamedAtrule(i,h){throw this.input.error("At-rule without name",{offset:h[2]},{offset:h[2]+h[1].length})}}return br=l,br}var vr,pi;function os(){if(pi)return vr;pi=1;let e=Re(),t=Jo(),s=bt();function a(r,c){let f=new s(r,c),m=new t(f);try{m.parse()}catch(l){throw l}return m.root}return vr=a,a.default=a,e.registerParse(a),vr}var Sr,mi;function rn(){if(mi)return Sr;mi=1;let{isClean:e,my:t}=ts(),s=Zi(),a=gt(),r=Re(),c=rs(),f=Ki(),m=ss(),l=os(),d=Ge(),i={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={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},o={Once:!0,postcssPlugin:!0,prepare:!0},n=0;function p(C){return typeof C=="object"&&typeof C.then=="function"}function u(C){let y=!1,w=i[C.type];return C.type==="decl"?y=C.prop.toLowerCase():C.type==="atrule"&&(y=C.name.toLowerCase()),y&&C.append?[w,w+"-"+y,n,w+"Exit",w+"Exit-"+y]:y?[w,w+"-"+y,w+"Exit",w+"Exit-"+y]:C.append?[w,n,w+"Exit"]:[w,w+"Exit"]}function g(C){let y;return C.type==="document"?y=["Document",n,"DocumentExit"]:C.type==="root"?y=["Root",n,"RootExit"]:y=u(C),{eventIndex:0,events:y,iterator:0,node:C,visitorIndex:0,visitors:[]}}function S(C){return C[e]=!1,C.nodes&&C.nodes.forEach(y=>S(y)),C}let v={};class b{constructor(y,w,E){this.stringified=!1,this.processed=!1;let R;if(typeof w=="object"&&w!==null&&(w.type==="root"||w.type==="document"))R=S(w);else if(w instanceof b||w instanceof m)R=S(w.root),w.map&&(typeof E.map>"u"&&(E.map={}),E.map.inline||(E.map.inline=!1),E.map.prev=w.map);else{let O=l;E.syntax&&(O=E.syntax.parse),E.parser&&(O=E.parser),O.parse&&(O=O.parse);try{R=O(w,E)}catch(M){this.processed=!0,this.error=M}R&&!R[t]&&r.rebuild(R)}this.result=new m(y,R,E),this.helpers={...v,postcss:v,result:this.result},this.plugins=this.processor.plugins.map(O=>typeof O=="object"&&O.prepare?{...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(y){return this.async().catch(y)}finally(y){return this.async().then(y,y)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(y,w){let E=this.result.lastPlugin;try{w&&w.addToError(y),this.error=y,y.name==="CssSyntaxError"&&!y.plugin?(y.plugin=E.postcssPlugin,y.setMessage()):E.postcssVersion}catch(R){console&&console.error&&console.error(R)}return y}prepareVisitors(){this.listeners={};let y=(w,E,R)=>{this.listeners[E]||(this.listeners[E]=[]),this.listeners[E].push([w,R])};for(let w of this.plugins)if(typeof w=="object")for(let E in w){if(!h[E]&&/^[A-Z]/.test(E))throw new Error(`Unknown event ${E} in ${w.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!o[E])if(typeof w[E]=="object")for(let R in w[E])R==="*"?y(w,E,w[E][R]):y(w,E+"-"+R.toLowerCase(),w[E][R]);else typeof w[E]=="function"&&y(w,E,w[E])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let y=0;y<this.plugins.length;y++){let w=this.plugins[y],E=this.runOnRoot(w);if(p(E))try{await E}catch(R){throw this.handleError(R)}}if(this.prepareVisitors(),this.hasListener){let y=this.result.root;for(;!y[e];){y[e]=!0;let w=[g(y)];for(;w.length>0;){let E=this.visitTick(w);if(p(E))try{await E}catch(R){let O=w[w.length-1].node;throw this.handleError(R,O)}}}if(this.listeners.OnceExit)for(let[w,E]of this.listeners.OnceExit){this.result.lastPlugin=w;try{if(y.type==="document"){let R=y.nodes.map(O=>E(O,this.helpers));await Promise.all(R)}else await E(y,this.helpers)}catch(R){throw this.handleError(R)}}}return this.processed=!0,this.stringify()}runOnRoot(y){this.result.lastPlugin=y;try{if(typeof y=="object"&&y.Once){if(this.result.root.type==="document"){let w=this.result.root.nodes.map(E=>y.Once(E,this.helpers));return p(w[0])?Promise.all(w):w}return y.Once(this.result.root,this.helpers)}else if(typeof y=="function")return y(this.result.root,this.result)}catch(w){throw this.handleError(w)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let y=this.result.opts,w=a;y.syntax&&(w=y.syntax.stringify),y.stringifier&&(w=y.stringifier),w.stringify&&(w=w.stringify);let R=new s(w,this.result.root,this.result.opts).generate();return this.result.css=R[0],this.result.map=R[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 y of this.plugins){let w=this.runOnRoot(y);if(p(w))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let y=this.result.root;for(;!y[e];)y[e]=!0,this.walkSync(y);if(this.listeners.OnceExit)if(y.type==="document")for(let w of y.nodes)this.visitSync(this.listeners.OnceExit,w);else this.visitSync(this.listeners.OnceExit,y)}return this.result}then(y,w){return this.async().then(y,w)}toString(){return this.css}visitSync(y,w){for(let[E,R]of y){this.result.lastPlugin=E;let O;try{O=R(w,this.helpers)}catch(M){throw this.handleError(M,w.proxyOf)}if(w.type!=="root"&&w.type!=="document"&&!w.parent)return!0;if(p(O))throw this.getAsyncError()}}visitTick(y){let w=y[y.length-1],{node:E,visitors:R}=w;if(E.type!=="root"&&E.type!=="document"&&!E.parent){y.pop();return}if(R.length>0&&w.visitorIndex<R.length){let[M,P]=R[w.visitorIndex];w.visitorIndex+=1,w.visitorIndex===R.length&&(w.visitors=[],w.visitorIndex=0),this.result.lastPlugin=M;try{return P(E.toProxy(),this.helpers)}catch(A){throw this.handleError(A,E)}}if(w.iterator!==0){let M=w.iterator,P;for(;P=E.nodes[E.indexes[M]];)if(E.indexes[M]+=1,!P[e]){P[e]=!0,y.push(g(P));return}w.iterator=0,delete E.indexes[M]}let O=w.events;for(;w.eventIndex<O.length;){let M=O[w.eventIndex];if(w.eventIndex+=1,M===n){E.nodes&&E.nodes.length&&(E[e]=!0,w.iterator=E.getIterator());return}else if(this.listeners[M]){w.visitors=this.listeners[M];return}}y.pop()}walkSync(y){y[e]=!0;let w=u(y);for(let E of w)if(E===n)y.nodes&&y.each(R=>{R[e]||this.walkSync(R)});else{let R=this.listeners[E];if(R&&this.visitSync(R,y.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return b.registerPostcss=C=>{v=C},Sr=b,b.default=b,d.registerLazyResult(b),c.registerLazyResult(b),Sr}var Cr,gi;function Xo(){if(gi)return Cr;gi=1;let e=Zi(),t=gt(),s=Ki(),a=os(),r=ss();class c{constructor(m,l,d){l=l.toString(),this.stringified=!1,this._processor=m,this._css=l,this._opts=d,this._map=void 0;let i,h=t;this.result=new r(this._processor,i,this._opts),this.result.css=l;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let n=new e(h,i,this._opts,l);if(n.isMap()){let[p,u]=n.generate();p&&(this.result.css=p),u&&(this.result.map=u)}else n.clearAnnotation(),this.result.css=n.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(m){return this.async().catch(m)}finally(m){return this.async().then(m,m)}sync(){if(this.error)throw this.error;return this.result}then(m,l){return this.async().then(m,l)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let m,l=a;try{m=l(this._css,this._opts)}catch(d){this.error=d}if(this.error)throw this.error;return this._root=m,m}get[Symbol.toStringTag](){return"NoWorkResult"}}return Cr=c,c.default=c,Cr}var Er,yi;function Qo(){if(yi)return Er;yi=1;let e=Xo(),t=rn(),s=rs(),a=Ge();class r{constructor(f=[]){this.version="8.4.38",this.plugins=this.normalize(f)}normalize(f){let m=[];for(let l of f)if(l.postcss===!0?l=l():l.postcss&&(l=l.postcss),typeof l=="object"&&Array.isArray(l.plugins))m=m.concat(l.plugins);else if(typeof l=="object"&&l.postcssPlugin)m.push(l);else if(typeof l=="function")m.push(l);else if(!(typeof l=="object"&&(l.parse||l.stringify)))throw new Error(l+" is not a PostCSS plugin");return m}process(f,m={}){return!this.plugins.length&&!m.parser&&!m.stringifier&&!m.syntax?new e(this,f,m):new t(this,f,m)}use(f){return this.plugins=this.plugins.concat(this.normalize([f])),this}}return Er=r,r.default=r,a.registerProcessor(r),s.registerProcessor(r),Er}var xr,wi;function Zo(){if(wi)return xr;wi=1;let e=wt(),t=Qi(),s=vt(),a=is(),r=bt(),c=Ge(),f=ns();function m(l,d){if(Array.isArray(l))return l.map(o=>m(o));let{inputs:i,...h}=l;if(i){d=[];for(let o of i){let n={...o,__proto__:r.prototype};n.map&&(n.map={...n.map,__proto__:t.prototype}),d.push(n)}}if(h.nodes&&(h.nodes=l.nodes.map(o=>m(o,d))),h.source){let{inputId:o,...n}=h.source;h.source=n,o!=null&&(h.source.input=d[o])}if(h.type==="root")return new c(h);if(h.type==="decl")return new e(h);if(h.type==="rule")return new f(h);if(h.type==="comment")return new s(h);if(h.type==="atrule")return new a(h);throw new Error("Unknown node type: "+l.type)}return xr=m,m.default=m,xr}var Rr,bi;function Ko(){if(bi)return Rr;bi=1;let e=es(),t=wt(),s=rn(),a=Re(),r=Qo(),c=gt(),f=Zo(),m=rs(),l=en(),d=vt(),i=is(),h=ss(),o=bt(),n=os(),p=tn(),u=ns(),g=Ge(),S=yt();function v(...b){return b.length===1&&Array.isArray(b[0])&&(b=b[0]),new r(b)}return v.plugin=function(C,y){let w=!1;function E(...O){console&&console.warn&&!w&&(w=!0,console.warn(C+`: postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(C+`: \\u91CC\\u9762 postcss.plugin \\u88AB\\u5F03\\u7528. \\u8FC1\\u79FB\\u6307\\u5357:\nhttps://www.w3ctech.com/topic/2226`));let M=y(...O);return M.postcssPlugin=C,M.postcssVersion=new r().version,M}let R;return Object.defineProperty(E,"postcss",{get(){return R||(R=E()),R}}),E.process=function(O,M,P){return v([E(P)]).process(O,M)},E},v.stringify=c,v.parse=n,v.fromJSON=f,v.list=p,v.comment=b=>new d(b),v.atRule=b=>new i(b),v.decl=b=>new t(b),v.rule=b=>new u(b),v.root=b=>new g(b),v.document=b=>new m(b),v.CssSyntaxError=e,v.Declaration=t,v.Container=a,v.Processor=r,v.Document=m,v.Comment=d,v.Warning=l,v.AtRule=i,v.Result=h,v.Input=o,v.Rule=u,v.Root=g,v.Node=S,s.registerPostcss(v),Rr=v,v.default=v,Rr}var ea=Ko(),V=zo(ea);V.stringify;V.fromJSON;V.plugin;V.parse;V.list;V.document;V.comment;V.atRule;V.rule;V.decl;V.root;V.CssSyntaxError;V.Declaration;V.Container;V.Processor;V.Document;V.Comment;V.Warning;V.AtRule;V.Result;V.Input;V.Rule;V.Root;V.Node;var Tr=class e{constructor(...t){ce(this,"parentElement",null),ce(this,"parentNode",null),ce(this,"ownerDocument"),ce(this,"firstChild",null),ce(this,"lastChild",null),ce(this,"previousSibling",null),ce(this,"nextSibling",null),ce(this,"ELEMENT_NODE",1),ce(this,"TEXT_NODE",3),ce(this,"nodeType"),ce(this,"nodeName"),ce(this,"RRNodeType")}get childNodes(){let t=[],s=this.firstChild;for(;s;)t.push(s),s=s.nextSibling;return t}contains(t){if(t instanceof e){if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0}else return!1;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute \'appendChild\' on \'RRNode\': This RRNode type does not support this method.")}insertBefore(t,s){throw new Error("RRDomException: Failed to execute \'insertBefore\' on \'RRNode\': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute \'removeChild\' on \'RRNode\': This RRNode type does not support this method.")}toString(){return"RRNode"}};var vi={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Si={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ue={},_r={},Ci=0,ta=()=>!!globalThis.Zone;function as(e){if(Ue[e])return Ue[e];let t=globalThis[e],s=t.prototype,a=e in vi?vi[e]:void 0,r=!!(a&&a.every(m=>{var l,d;return!!((d=(l=Object.getOwnPropertyDescriptor(s,m))==null?void 0:l.get)!=null&&d.toString().includes("[native code]"))})),c=e in Si?Si[e]:void 0,f=!!(c&&c.every(m=>{var l;return typeof s[m]=="function"&&((l=s[m])==null?void 0:l.toString().includes("[native code]"))}));if(r&&f&&!ta())return Ue[e]=t.prototype,t.prototype;try{let m=document.createElement("iframe");m.style.display="none",document.body.appendChild(m);let l=m.contentWindow;if(!l)return t.prototype;let d=l[e].prototype;if(!d)return m.remove(),s;let i=navigator.userAgent;return i.includes("Safari")&&!i.includes("Chrome")?(m.classList.add("rr-block"),m.setAttribute("__rrwebUntaintedMutationObserver",""),_r[e]=()=>m.remove()):m.remove(),Ue[e]=d}catch{return s}}var Mr={};function ae(e,t,s){var a,r;let c=(a=Mr[e])==null?void 0:a[s];if(c)return c.call(t);let f=as(e),m=(r=Object.getOwnPropertyDescriptor(f,s))==null?void 0:r.get;return m?((Mr[e]||(Mr[e]={}))[s]=m,m.call(t)):t[s]}var Nr={};function sn(e,t,s){let a=`${e}.${String(s)}`;if(Nr[a])return Nr[a].bind(t);let c=as(e)[s];return typeof c!="function"?t[s]:(Nr[a]=c,c.bind(t))}function ra(e){return ae("Node",e,"ownerDocument")}function sa(e){return ae("Node",e,"childNodes")}function ia(e){return ae("Node",e,"parentNode")}function na(e){return ae("Node",e,"parentElement")}function oa(e){return ae("Node",e,"textContent")}function aa(e){return ae("Node",e,"firstChild")}function la(e){return ae("Node",e,"lastChild")}function ua(e){return ae("Node",e,"nextSibling")}function ca(e){return ae("Node",e,"previousSibling")}function ha(e,t){return sn("Node",e,"contains")(t)}function fa(e){return sn("Node",e,"getRootNode")()}function da(e){return!e||!("host"in e)?null:ae("ShadowRoot",e,"host")}function pa(e){return e.styleSheets}function ma(e){return!e||!("shadowRoot"in e)?null:ae("Element",e,"shadowRoot")}function ga(e,t){return ae("Element",e,"querySelector")(t)}function ya(e,t){return ae("Element",e,"querySelectorAll")(t)}function nn(){let e=as("MutationObserver");Ci++;let t=!1;return[e.constructor,()=>{if(t||(t=!0,--Ci!==0))return;let s=_r.MutationObserver;if(s)try{s()}finally{delete Ue.MutationObserver,delete _r.MutationObserver}}]}var ze=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(ze=()=>new Date().getTime());function Me(e,t,s){try{if(!(t in e))return()=>{};let a=e[t],r=s(a);return typeof r=="function"&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:a}})),e[t]=r,()=>{e[t]=a}}catch{return()=>{}}}var T={ownerDocument:ra,childNodes:sa,parentNode:ia,parentElement:na,textContent:oa,firstChild:aa,lastChild:la,nextSibling:ua,previousSibling:ca,contains:ha,getRootNode:fa,host:da,styleSheets:pa,shadowRoot:ma,querySelector:ga,querySelectorAll:ya,nowTimestamp:ze,mutationObserverCtor:nn,patch:Me};function Q(e,t,s=document){let a={capture:!0,passive:!0};return s.addEventListener(e,t,a),()=>s.removeEventListener(e,t,a)}var Oe=`Please stop import mirror directly. Instead of that,\\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\\r\nor you can use record.mirror to access the mirror instance during recording.`,Ei={map:{},getId(){return console.error(Oe),-1},getNode(){return console.error(Oe),null},removeNodeFromMap(){console.error(Oe)},has(){return console.error(Oe),!1},reset(){console.error(Oe)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Ei=new Proxy(Ei,{get(e,t,s){return t==="map"&&console.error(Oe),Reflect.get(e,t,s)}}));function qe(e,t,s={}){let a=null,r=0;return function(...c){let f=Date.now();!r&&s.leading===!1&&(r=f);let m=t-(f-r),l=this;m<=0||m>t?(a&&(clearTimeout(a),a=null),r=f,e.apply(l,c)):!a&&s.trailing!==!1&&(a=setTimeout(()=>{r=s.leading===!1?0:Date.now(),a=null,e.apply(l,c)},m))}}function St(e,t,s,a,r=window){let c=r.Object.getOwnPropertyDescriptor(e,t);return r.Object.defineProperty(e,t,a?s:{set(f){setTimeout(()=>{s.set.call(this,f)},0),c&&c.set&&c.set.call(this,f)}}),()=>St(e,t,c||{},!0)}function on(e){var t,s,a,r;let c=e.document;return{left:c.scrollingElement?c.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:c.documentElement.scrollLeft||c?.body&&((t=T.parentElement(c.body))==null?void 0:t.scrollLeft)||((s=c?.body)==null?void 0:s.scrollLeft)||0,top:c.scrollingElement?c.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:c?.documentElement.scrollTop||c?.body&&((a=T.parentElement(c.body))==null?void 0:a.scrollTop)||((r=c?.body)==null?void 0:r.scrollTop)||0}}function an(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ln(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function un(e){return e?e.nodeType===e.ELEMENT_NODE?e:T.parentElement(e):null}function ee(e,t,s,a){if(!e)return!1;let r=un(e);if(!r)return!1;try{if(typeof t=="string"){if(r.classList.contains(t)||a&&r.closest("."+t)!==null)return!0}else if(lt(r,t,a))return!0}catch{}return!!(s&&(r.matches(s)||a&&r.closest(s)!==null))}function wa(e,t){return t.getId(e)!==-1}function Or(e,t,s){return e.tagName==="TITLE"&&s.headTitleMutations?!0:t.getId(e)===at}function cn(e,t){if($e(e))return!1;let s=t.getId(e);if(!t.has(s))return!0;let a=T.parentNode(e);return a&&a.nodeType===e.DOCUMENT_NODE?!1:a?cn(a,t):!0}function Pr(e){return!!e.changedTouches}function ba(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function hn(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function fn(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function kr(e){return e?e instanceof Tr&&"shadowRoot"in e?!!e.shadowRoot:!!T.shadowRoot(e):!1}var Lr=class{constructor(){I(this,"id",1),I(this,"styleIDMap",new WeakMap),I(this,"idStyleMap",new Map)}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,s){if(this.has(t))return this.getId(t);let a;return s===void 0?a=this.id++:a=s,this.styleIDMap.set(t,a),this.idStyleMap.set(a,t),a}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function dn(e){var t;let s=null;return"getRootNode"in e&&((t=T.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&T.host(T.getRootNode(e))&&(s=T.host(T.getRootNode(e))),s}function va(e){let t=e,s;for(;s=dn(t);)t=s;return t}function Sa(e){let t=T.ownerDocument(e);if(!t)return!1;let s=va(e);return T.contains(t,s)}function Fr(e){let t=T.ownerDocument(e);return t?T.contains(t,e)||Sa(e):!1}var k=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e[e.Asset=7]="Asset",e[e.Annotation=8]="Annotation",e))(k||{}),L=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(L||{}),se=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(se||{}),we=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(we||{}),Pe=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Pe||{}),Ie=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(Ie||{});var pn=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(pn||{}),xi=(e,t)=>`${e}@${t}`,Ur=class{constructor(){I(this,"frozen",!1),I(this,"locked",!1),I(this,"texts",[]),I(this,"attributes",[]),I(this,"attributeMap",new WeakMap),I(this,"removes",[]),I(this,"mapRemoves",[]),I(this,"movedMap",{}),I(this,"addedSet",new Set),I(this,"movedSet",new Set),I(this,"droppedSet",new Set),I(this,"removesSubTreeCache",new Set),I(this,"mutationCb"),I(this,"blockClass"),I(this,"blockSelector"),I(this,"maskTextClass"),I(this,"maskTextSelector"),I(this,"inlineStylesheet"),I(this,"maskInputOptions"),I(this,"maskTextFn"),I(this,"maskInputFn"),I(this,"keepIframeSrcFn"),I(this,"recordCanvas"),I(this,"inlineImages"),I(this,"slimDOMOptions"),I(this,"dataURLOptions"),I(this,"doc"),I(this,"mirror"),I(this,"iframeManager"),I(this,"stylesheetManager"),I(this,"shadowDomManager"),I(this,"processedNodeManager"),I(this,"unattachedDoc"),I(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),I(this,"emit",()=>{if(this.frozen||this.locked)return;let t=[],s=new Set;for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let o of this.movedSet){let n=T.parentNode(o);this.removesSubTreeCache.has(n)&&!this.movedSet.has(n)||this.addedSet.add(o)}let a=null,r=null,c=-1,f=null,m=!1,l=new Set,d=this.addedSet.values(),i=d.next();for(;this.addedSet.size;){if(a!==null&&this.addedSet.has(T.previousSibling(a)))f=a,a=T.previousSibling(a);else{for(this.addedSet.has(i.value)||(i=d.next()),a=i.value;;){if(r=T.parentNode(a),this.addedSet.has(r)){a=r;continue}break}if(l.has(r))r=null;else if(r){if(Fr(r)?(m=Ri(this.droppedSet,r)||this.removesSubTreeCache.has(r),m&&Ri(this.movedSet,a)&&(m=!1)):m=!0,this.addedSet.has(T.lastChild(r)))a=T.lastChild(r),f=null;else for(;;){if(f=T.nextSibling(a),this.addedSet.has(f)){a=f;continue}break}if(c=$e(r)?this.mirror.getId(dn(a)):this.mirror.getId(r),c===-1&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let u=T.host(r);c=this.mirror.getId(u)}}}if(this.addedSet.delete(a),!r||c===-1){l.add(a);continue}else if(m){this.droppedSet.add(a);continue}let o=!1;if(a.nodeType===Node.TEXT_NODE){let u=r.tagName;if(u==="TEXTAREA")continue;u==="STYLE"&&s.has(c)&&(o=!0)}let n=f?this.mirror.getId(f):null;for(;n===at;)f=f&&T.nextSibling(f),n=f&&this.mirror.getId(f);if(n===-1){console.warn("Couldn\'t record new node. Couldn\'t find mirror id for nextSibling:",f),a=null;continue}let p=De(a,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:u=>{hn(u,this.mirror)&&this.iframeManager.addIframe(u),fn(u,this.mirror)&&this.stylesheetManager.trackLinkElement(u),kr(a)&&this.shadowDomManager.addShadowRoot(T.shadowRoot(a),this.doc)},onIframeLoad:(u,g)=>{this.iframeManager.attachIframe(u,g),this.shadowDomManager.observeAttachShadow(u)},onStylesheetLoad:(u,g)=>{this.stylesheetManager.attachLinkElement(u,g)},cssCaptured:o});p&&(t.push({parentId:c,nextId:n,node:p}),s.add(p.id))}let h={texts:this.texts.map(o=>{let n=o.node,p=T.parentNode(n);return p&&p.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(p),{id:this.mirror.getId(n),value:o.value}}).filter(o=>!s.has(o.id)).filter(o=>this.mirror.has(o.id)),attributes:this.attributes.map(o=>{let{attributes:n}=o;if(typeof n.style=="string"){let p=JSON.stringify(o.styleDiff),u=JSON.stringify(o._unchangedStyles);p.length<n.style.length&&(p+u).split("var(").length===n.style.split("var(").length&&(n.style=o.styleDiff)}return{id:this.mirror.getId(o.node),attributes:n}}).filter(o=>!s.has(o.id)).filter(o=>this.mirror.has(o.id)),removes:this.removes,adds:t};!h.texts.length&&!h.attributes.length&&!h.removes.length&&!h.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(h))}),I(this,"genTextAreaValueMutation",t=>{let s=this.attributeMap.get(t);s||(s={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(t,s));let a=Array.from(T.childNodes(t),r=>T.textContent(r)||"").join("");s.attributes.value=it({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:nt(t),value:a,maskInputFn:this.maskInputFn})}),I(this,"processMutation",t=>{if(!Or(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{let s=T.textContent(t.target);!ee(t.target,this.blockClass,this.blockSelector,!1)&&s!==t.oldValue&&this.texts.push({value:Wi(t.target,this.maskTextClass,this.maskTextSelector,!0)&&s?this.maskTextFn?this.maskTextFn(s,un(t.target)):s.replace(/[\\S]/g,"*"):s,node:t.target});break}case"attributes":{let s=t.target,a=Ce(s.tagName),r=t.attributeName,c=t.target.getAttribute(r);if(r==="value"){let m=nt(s);c=it({element:s,maskInputOptions:this.maskInputOptions,tagName:s.tagName,type:m,value:c,maskInputFn:this.maskInputFn})}if(ee(t.target,this.blockClass,this.blockSelector,!1)||c===t.oldValue)return;let f=this.attributeMap.get(t.target);if(a==="iframe"&&r==="src"&&!this.keepIframeSrcFn(c))if(!s.contentDocument)r="rr_src";else return;if(f||(f={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(f),this.attributeMap.set(t.target,f)),r==="type"&&a==="input"&&(t.oldValue||"").toLowerCase()==="password"&&s.setAttribute("data-rr-is-password","true"),!Bi(a,r))if(f.attributes[r]=$i(this.doc,a,Ce(r),c),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let m=this.unattachedDoc.createElement("span");t.oldValue&&m.setAttribute("style",t.oldValue);for(let l of Array.from(s.style)){let d=s.style.getPropertyValue(l),i=s.style.getPropertyPriority(l);d!==m.style.getPropertyValue(l)||i!==m.style.getPropertyPriority(l)?i===""?f.styleDiff[l]=d:f.styleDiff[l]=[d,i]:f._unchangedStyles[l]=[d,i]}for(let l of Array.from(m.style))s.style.getPropertyValue(l)===""&&(f.styleDiff[l]=!1)}else r==="open"&&s.tagName==="DIALOG"&&(s.matches("dialog:modal")?f.attributes.rr_open_mode="modal":f.attributes.rr_open_mode="non-modal");break}case"childList":{if(ee(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(s=>this.genAdds(s,t.target)),t.removedNodes.forEach(s=>{Fr(s)||this.shadowDomManager.removeShadowRootsIn(s);let a=this.mirror.getId(s),r=$e(t.target)?this.mirror.getId(T.host(t.target)):this.mirror.getId(t.target);ee(t.target,this.blockClass,this.blockSelector,!1)||Or(s,this.mirror,this.slimDOMOptions)||!wa(s,this.mirror)||(this.addedSet.has(s)?($r(this.addedSet,s),this.droppedSet.add(s)):this.addedSet.has(t.target)&&a===-1||cn(t.target,this.mirror)||(this.movedSet.has(s)&&this.movedMap[xi(a,r)]?$r(this.movedSet,s):(this.removes.push({parentId:r,id:a,isShadow:$e(t.target)&&Be(t.target)?!0:void 0}),Ca(s,this.removesSubTreeCache))),this.mapRemoves.push(s))});break}}}),I(this,"genAdds",(t,s)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Or(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let a=null;s&&this.mirror.hasNode(s)&&(a=this.mirror.getId(s)),a&&a!==-1&&(this.movedMap[xi(this.mirror.getId(t),a)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);ee(t,this.blockClass,this.blockSelector,!1)||(T.childNodes(t).forEach(a=>this.genAdds(a)),kr(t)&&T.childNodes(T.shadowRoot(t)).forEach(a=>{this.processedNodeManager.add(a,this),this.genAdds(a,t)}))}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","processedNodeManager"].forEach(s=>{this[s]=t[s]})}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1,this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0}unlock(){this.locked=!1,this.emit()}};function $r(e,t){e.delete(t),T.childNodes(t).forEach(s=>$r(e,s))}function Ca(e,t){let s=[e];for(;s.length;){let a=s.pop();t.has(a)||(t.add(a),T.childNodes(a).forEach(r=>s.push(r)))}}function Ri(e,t){return e.size===0?!1:mn(e,t)}function mn(e,t){if(e.has(t))return!0;let s=T.parentNode(t);return s?mn(e,s):!1}var We;function Ea(e){We=e}function xa(){We=void 0}var F=e=>We?(...s)=>{try{return e(...s)}catch(a){if(We&&We(a)===!0)return;throw a}}:e,_e=new Set;function He(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function gn(e,t){let s=new Ur;_e.add(s),s.init(e);let[a,r]=nn(),c=new a(F(s.processMutations.bind(s)));return c.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),()=>{c.disconnect(),_e.delete(s),r()}}function Ra({mousemoveCb:e,sampling:t,doc:s,mirror:a}){if(t.mousemove===!1)return()=>{};let r=typeof t.mousemove=="number"?t.mousemove:50,c=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,f=[],m,l=qe(F(h=>{let o=Date.now()-m;e(f.map(n=>(n.timeOffset-=o,n)),h),f=[],m=null}),c),d=F(qe(F(h=>{let o=He(h),{clientX:n,clientY:p}=Pr(h)?h.changedTouches[0]:h;m||(m=ze()),f.push({x:n,y:p,id:a.getId(o),timeOffset:ze()-m}),l(typeof DragEvent<"u"&&h instanceof DragEvent?L.Drag:h instanceof MouseEvent?L.MouseMove:L.TouchMove)}),r,{trailing:!1})),i=[Q("mousemove",d,s),Q("touchmove",d,s),Q("drag",d,s)];return F(()=>{i.forEach(h=>h())})}function Ma({mouseInteractionCb:e,doc:t,mirror:s,blockClass:a,blockSelector:r,sampling:c}){if(c.mouseInteraction===!1)return()=>{};let f=c.mouseInteraction===!0||c.mouseInteraction===void 0?{}:c.mouseInteraction,m=[],l=null,d=i=>h=>{let o=He(h);if(ee(o,a,r,!0))return;let n=null,p=i;if("pointerType"in h){switch(h.pointerType){case"mouse":n=we.Mouse;break;case"touch":n=we.Touch;break;case"pen":n=we.Pen;break}n===we.Touch?se[i]===se.MouseDown?p="TouchStart":se[i]===se.MouseUp&&(p="TouchEnd"):we.Pen}else Pr(h)&&(n=we.Touch);n!==null?(l=n,(p.startsWith("Touch")&&n===we.Touch||p.startsWith("Mouse")&&n===we.Mouse)&&(n=null)):se[i]===se.Click&&(n=l,l=null);let u=Pr(h)?h.changedTouches[0]:h;if(!u)return;let g=s.getId(o),{clientX:S,clientY:v}=u;F(e)({type:se[p],id:g,x:S,y:v,...n!==null&&{pointerType:n}})};return Object.keys(se).filter(i=>Number.isNaN(Number(i))&&!i.endsWith("_Departed")&&f[i]!==!1).forEach(i=>{let h=Ce(i),o=d(i);if(window.PointerEvent)switch(se[i]){case se.MouseDown:case se.MouseUp:h=h.replace("mouse","pointer");break;case se.TouchStart:case se.TouchEnd:return}m.push(Q(h,o,t))}),F(()=>{m.forEach(i=>i())})}function yn({scrollCb:e,doc:t,mirror:s,blockClass:a,blockSelector:r,sampling:c}){let f=F(qe(F(m=>{let l=He(m);if(!l||ee(l,a,r,!0))return;let d=s.getId(l);if(l===t&&t.defaultView){let i=on(t.defaultView);e({id:d,x:i.left,y:i.top})}else e({id:d,x:l.scrollLeft,y:l.scrollTop})}),c.scroll||100));return Q("scroll",f,t)}function Na({viewportResizeCb:e},{win:t}){let s=-1,a=-1,r=F(qe(F(()=>{let c=an(),f=ln();(s!==c||a!==f)&&(e({width:Number(f),height:Number(c)}),s=c,a=f)}),200));return Q("resize",r,t)}var Oa=["INPUT","TEXTAREA","SELECT"],Mi=new WeakMap;function Ia({inputCb:e,doc:t,mirror:s,blockClass:a,blockSelector:r,ignoreClass:c,ignoreSelector:f,maskInputOptions:m,maskInputFn:l,sampling:d,userTriggeredOnInput:i}){function h(v){let b=He(v),C=v.isTrusted,y=b&&b.tagName;if(b&&y==="OPTION"&&(b=T.parentElement(b)),!b||!y||Oa.indexOf(y)<0||ee(b,a,r,!0)||b.classList.contains(c)||f&&b.matches(f))return;let w=b.value,E=!1,R=nt(b)||"";R==="radio"||R==="checkbox"?E=b.checked:(m[y.toLowerCase()]||m[R])&&(w=it({element:b,maskInputOptions:m,tagName:y,type:R,value:w,maskInputFn:l})),o(b,i?{text:w,isChecked:E,userTriggered:C}:{text:w,isChecked:E});let O=b.name;R==="radio"&&O&&E&&t.querySelectorAll(`input[type="radio"][name="${O}"]`).forEach(M=>{if(M!==b){let P=M.value;o(M,i?{text:P,isChecked:!E,userTriggered:!1}:{text:P,isChecked:!E})}})}function o(v,b){let C=Mi.get(v);if(!C||C.text!==b.text||C.isChecked!==b.isChecked){Mi.set(v,b);let y=s.getId(v);F(e)({...b,id:y})}}let p=(d.input==="last"?["change"]:["input","change"]).map(v=>Q(v,F(h),t)),u=t.defaultView;if(!u)return()=>{p.forEach(v=>v())};let g=u.Object.getOwnPropertyDescriptor(u.HTMLInputElement.prototype,"value"),S=[[u.HTMLInputElement.prototype,"value"],[u.HTMLInputElement.prototype,"checked"],[u.HTMLSelectElement.prototype,"value"],[u.HTMLTextAreaElement.prototype,"value"],[u.HTMLSelectElement.prototype,"selectedIndex"],[u.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&p.push(...S.map(v=>St(v[0],v[1],{set(){F(h)({target:this,isTrusted:!1})}},!1,u))),F(()=>{p.forEach(v=>v())})}function ut(e){let t=[];function s(a,r){if(Ke("CSSGroupingRule")&&a.parentRule instanceof CSSGroupingRule||Ke("CSSMediaRule")&&a.parentRule instanceof CSSMediaRule||Ke("CSSSupportsRule")&&a.parentRule instanceof CSSSupportsRule||Ke("CSSConditionRule")&&a.parentRule instanceof CSSConditionRule){let f=Array.from(a.parentRule.cssRules).indexOf(a);return r.unshift(f),s(a.parentRule,r)}else if(a.parentStyleSheet){let f=Array.from(a.parentStyleSheet.cssRules).indexOf(a);r.unshift(f)}return r}return s(e,t)}function Se(e,t,s){let a,r;return e?(e.ownerNode?a=t.getId(e.ownerNode):r=s.getId(e),{styleId:r,id:a}):{}}function Aa({styleSheetRuleCb:e,mirror:t,stylesheetManager:s},{win:a}){if(!a.CSSStyleSheet||!a.CSSStyleSheet.prototype)return()=>{};let r=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=new Proxy(r,{apply:F((i,h,o)=>{let[n,p]=o,{id:u,styleId:g}=Se(h,t,s.styleMirror);return(u&&u!==-1||g&&g!==-1)&&e({id:u,styleId:g,adds:[{rule:n,index:p}]}),i.apply(h,o)})}),a.CSSStyleSheet.prototype.addRule=function(i,h,o=this.cssRules.length){let n=`${i} { ${h} }`;return a.CSSStyleSheet.prototype.insertRule.apply(this,[n,o])};let c=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=new Proxy(c,{apply:F((i,h,o)=>{let[n]=o,{id:p,styleId:u}=Se(h,t,s.styleMirror);return(p&&p!==-1||u&&u!==-1)&&e({id:p,styleId:u,removes:[{index:n}]}),i.apply(h,o)})}),a.CSSStyleSheet.prototype.removeRule=function(i){return a.CSSStyleSheet.prototype.deleteRule.apply(this,[i])};let f;a.CSSStyleSheet.prototype.replace&&(f=a.CSSStyleSheet.prototype.replace,a.CSSStyleSheet.prototype.replace=new Proxy(f,{apply:F((i,h,o)=>{let[n]=o,{id:p,styleId:u}=Se(h,t,s.styleMirror);return(p&&p!==-1||u&&u!==-1)&&e({id:p,styleId:u,replace:n}),i.apply(h,o)})}));let m;a.CSSStyleSheet.prototype.replaceSync&&(m=a.CSSStyleSheet.prototype.replaceSync,a.CSSStyleSheet.prototype.replaceSync=new Proxy(m,{apply:F((i,h,o)=>{let[n]=o,{id:p,styleId:u}=Se(h,t,s.styleMirror);return(p&&p!==-1||u&&u!==-1)&&e({id:p,styleId:u,replaceSync:n}),i.apply(h,o)})}));let l={};et("CSSGroupingRule")?l.CSSGroupingRule=a.CSSGroupingRule:(et("CSSMediaRule")&&(l.CSSMediaRule=a.CSSMediaRule),et("CSSConditionRule")&&(l.CSSConditionRule=a.CSSConditionRule),et("CSSSupportsRule")&&(l.CSSSupportsRule=a.CSSSupportsRule));let d={};return Object.entries(l).forEach(([i,h])=>{d[i]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(d[i].insertRule,{apply:F((o,n,p)=>{let[u,g]=p,{id:S,styleId:v}=Se(n.parentStyleSheet,t,s.styleMirror);return(S&&S!==-1||v&&v!==-1)&&e({id:S,styleId:v,adds:[{rule:u,index:[...ut(n),g||0]}]}),o.apply(n,p)})}),h.prototype.deleteRule=new Proxy(d[i].deleteRule,{apply:F((o,n,p)=>{let[u]=p,{id:g,styleId:S}=Se(n.parentStyleSheet,t,s.styleMirror);return(g&&g!==-1||S&&S!==-1)&&e({id:g,styleId:S,removes:[{index:[...ut(n),u]}]}),o.apply(n,p)})})}),F(()=>{a.CSSStyleSheet.prototype.insertRule=r,a.CSSStyleSheet.prototype.deleteRule=c,f&&(a.CSSStyleSheet.prototype.replace=f),m&&(a.CSSStyleSheet.prototype.replaceSync=m),Object.entries(l).forEach(([i,h])=>{h.prototype.insertRule=d[i].insertRule,h.prototype.deleteRule=d[i].deleteRule})})}function wn({mirror:e,stylesheetManager:t},s){var a,r,c;let f=null;s.nodeName==="#document"?f=e.getId(s):f=e.getId(T.host(s));let m=s.nodeName==="#document"?(a=s.defaultView)==null?void 0:a.Document:(c=(r=s.ownerDocument)==null?void 0:r.defaultView)==null?void 0:c.ShadowRoot,l=m?.prototype?Object.getOwnPropertyDescriptor(m?.prototype,"adoptedStyleSheets"):void 0;return f===null||f===-1||!m||!l?()=>{}:(Object.defineProperty(s,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var d;return(d=l.get)==null?void 0:d.call(this)},set(d){var i;let h=(i=l.set)==null?void 0:i.call(this,d);if(f!==null&&f!==-1)try{t.adoptStyleSheets(d,f)}catch{}return h}}),F(()=>{Object.defineProperty(s,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function Da({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:s,stylesheetManager:a},{win:r}){let c=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=new Proxy(c,{apply:F((m,l,d)=>{var i;let[h,o,n]=d;if(s.has(h))return c.apply(l,[h,o,n]);let{id:p,styleId:u}=Se((i=l.parentRule)==null?void 0:i.parentStyleSheet,t,a.styleMirror);return(p&&p!==-1||u&&u!==-1)&&e({id:p,styleId:u,set:{property:h,value:o,priority:n},index:ut(l.parentRule)}),m.apply(l,d)})});let f=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=new Proxy(f,{apply:F((m,l,d)=>{var i;let[h]=d;if(s.has(h))return f.apply(l,[h]);let{id:o,styleId:n}=Se((i=l.parentRule)==null?void 0:i.parentStyleSheet,t,a.styleMirror);return(o&&o!==-1||n&&n!==-1)&&e({id:o,styleId:n,remove:{property:h},index:ut(l.parentRule)}),m.apply(l,d)})}),F(()=>{r.CSSStyleDeclaration.prototype.setProperty=c,r.CSSStyleDeclaration.prototype.removeProperty=f})}function Ta({mediaInteractionCb:e,blockClass:t,blockSelector:s,mirror:a,sampling:r,doc:c}){let f=F(l=>qe(F(d=>{let i=He(d);if(!i||ee(i,t,s,!0))return;let{currentTime:h,volume:o,muted:n,playbackRate:p,loop:u}=i;e({type:l,id:a.getId(i),currentTime:h,volume:o,muted:n,playbackRate:p,loop:u})}),r.media||500)),m=[Q("play",f(Ie.Play),c),Q("pause",f(Ie.Pause),c),Q("seeked",f(Ie.Seeked),c),Q("volumechange",f(Ie.VolumeChange),c),Q("ratechange",f(Ie.RateChange),c)];return F(()=>{m.forEach(l=>l())})}function _a({fontCb:e,doc:t}){let s=t.defaultView;if(!s)return()=>{};let a=[],r=new WeakMap,c=s.FontFace;s.FontFace=function(l,d,i){let h=new c(l,d,i);return r.set(h,{family:l,buffer:typeof d!="string",descriptors:i,fontSource:typeof d=="string"?d:JSON.stringify(Array.from(new Uint8Array(d)))}),h};let f=Me(t.fonts,"add",function(m){return function(l){return setTimeout(F(()=>{let d=r.get(l);d&&(e(d),r.delete(l))}),0),m.apply(this,[l])}});return a.push(()=>{s.FontFace=c}),a.push(f),F(()=>{a.forEach(m=>m())})}function Pa(e){let{doc:t,mirror:s,blockClass:a,blockSelector:r,selectionCb:c}=e,f=!0,m=F(()=>{let l=t.getSelection();if(!l||f&&l?.isCollapsed)return;f=l.isCollapsed||!1;let d=[],i=l.rangeCount||0;for(let h=0;h<i;h++){let o=l.getRangeAt(h),{startContainer:n,startOffset:p,endContainer:u,endOffset:g}=o;ee(n,a,r,!0)||ee(u,a,r,!0)||d.push({start:s.getId(n),startOffset:p,end:s.getId(u),endOffset:g})}c({ranges:d})});return m(),Q("selectionchange",m)}function ka({doc:e,customElementCb:t}){let s=e.defaultView;return!s||!s.customElements?()=>{}:Me(s.customElements,"define",function(r){return function(c,f,m){try{t({define:{name:c}})}catch{console.warn(`Custom element callback failed for ${c}`)}return r.apply(this,[c,f,m])}})}function La(e,t){let{mutationCb:s,mousemoveCb:a,mouseInteractionCb:r,scrollCb:c,viewportResizeCb:f,inputCb:m,mediaInteractionCb:l,styleSheetRuleCb:d,styleDeclarationCb:i,canvasMutationCb:h,fontCb:o,selectionCb:n,customElementCb:p}=e;e.mutationCb=(...u)=>{t.mutation&&t.mutation(...u),s(...u)},e.mousemoveCb=(...u)=>{t.mousemove&&t.mousemove(...u),a(...u)},e.mouseInteractionCb=(...u)=>{t.mouseInteraction&&t.mouseInteraction(...u),r(...u)},e.scrollCb=(...u)=>{t.scroll&&t.scroll(...u),c(...u)},e.viewportResizeCb=(...u)=>{t.viewportResize&&t.viewportResize(...u),f(...u)},e.inputCb=(...u)=>{t.input&&t.input(...u),m(...u)},e.mediaInteractionCb=(...u)=>{t.mediaInteaction&&t.mediaInteaction(...u),l(...u)},e.styleSheetRuleCb=(...u)=>{t.styleSheetRule&&t.styleSheetRule(...u),d(...u)},e.styleDeclarationCb=(...u)=>{t.styleDeclaration&&t.styleDeclaration(...u),i(...u)},e.canvasMutationCb=(...u)=>{t.canvasMutation&&t.canvasMutation(...u),h(...u)},e.fontCb=(...u)=>{t.font&&t.font(...u),o(...u)},e.selectionCb=(...u)=>{t.selection&&t.selection(...u),n(...u)},e.customElementCb=(...u)=>{t.customElement&&t.customElement(...u),p(...u)}}function Fa(e,t={}){let s=e.doc.defaultView;if(!s)return()=>{};La(e,t);let a;e.recordDOM&&(a=gn(e,e.doc));let r=Ra(e),c=Ma(e),f=yn(e),m=Na(e,{win:s}),l=Ia(e),d=Ta(e),i=()=>{},h=()=>{},o=()=>{},n=()=>{};e.recordDOM&&(i=Aa(e,{win:s}),h=wn(e,e.doc),o=Da(e,{win:s}),e.collectFonts&&(n=_a(e)));let p=Pa(e),u=ka(e),g=[];for(let S of e.plugins)g.push(S.observer(S.callback,s,S.options));return F(()=>{a?.(),r(),c(),f(),m(),l(),d(),i(),h(),o(),n(),p(),u(),g.forEach(S=>S())})}function Ke(e){return typeof window[e]<"u"}function et(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var ct=class{constructor(t){I(this,"iframeIdToRemoteIdMap",new WeakMap),I(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,s,a,r){let c=a||this.getIdToRemoteIdMap(t),f=r||this.getRemoteIdToIdMap(t),m=c.get(s);return m||(m=this.generateIdFn(),c.set(s,m),f.set(m,s)),m}getIds(t,s){let a=this.getIdToRemoteIdMap(t),r=this.getRemoteIdToIdMap(t);return s.map(c=>this.getId(t,c,a,r))}getRemoteId(t,s,a){let r=a||this.getRemoteIdToIdMap(t);if(typeof s!="number")return s;let c=r.get(s);return c||-1}getRemoteIds(t,s){let a=this.getRemoteIdToIdMap(t);return s.map(r=>this.getRemoteId(t,r,a))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let s=this.iframeIdToRemoteIdMap.get(t);return s||(s=new Map,this.iframeIdToRemoteIdMap.set(t,s)),s}getRemoteIdToIdMap(t){let s=this.iframeRemoteIdToIdMap.get(t);return s||(s=new Map,this.iframeRemoteIdToIdMap.set(t,s)),s}},Br=class{constructor(t){I(this,"iframes",new WeakMap),I(this,"crossOriginIframeMap",new WeakMap),I(this,"crossOriginIframeMirror",new ct(Ui)),I(this,"crossOriginIframeStyleMirror"),I(this,"crossOriginIframeRootIdMap",new WeakMap),I(this,"mirror"),I(this,"mutationCb"),I(this,"wrappedEmit"),I(this,"loadListener"),I(this,"unloadListener"),I(this,"attachedWindows",new Map),I(this,"messageHandler",s=>this.handleMessage(s)),I(this,"stylesheetManager"),I(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ct(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}addUnloadListener(t){this.unloadListener=t}attachIframe(t,s){var a;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:s}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.watchIframeWindow(t),(a=this.loadListener)==null||a.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}destroy(){window.removeEventListener("message",this.messageHandler),this.attachedWindows.forEach(t=>t())}watchIframeWindow(t){let s=t.contentWindow;if(!s||this.attachedWindows.has(s))return;let a=[],r=()=>{this.attachedWindows.delete(s),a.forEach(c=>{try{c()}catch{}})};this.attachedWindows.set(s,r),this.recordCrossOriginIframes&&a.push(Q("message",this.messageHandler,s)),a.push(Q("pagehide",c=>{var f;if(c.persisted)return;let m=s.document;r(),(f=this.unloadListener)==null||f.call(this,m)},s))}handleMessage(t){let s=t;if(s.data.type!=="rrweb"||s.origin!==s.data.origin||!t.source)return;let r=this.crossOriginIframeMap.get(t.source);if(!r)return;let c=this.transformCrossOriginEvent(r,s.data.event);c&&this.wrappedEmit(c,s.data.isCheckout)}transformCrossOriginEvent(t,s){var a;switch(s.type){case k.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(s.data.node,t);let r=s.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(s.data.node,r),{timestamp:s.timestamp,type:k.IncrementalSnapshot,data:{source:L.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:s.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case k.Meta:case k.Load:case k.DomContentLoaded:return!1;case k.Annotation:case k.Plugin:return s;case k.Custom:return this.replaceIds(s.data.payload,t,["id","parentId","previousId","nextId"]),s;case k.IncrementalSnapshot:switch(s.data.source){case L.Mutation:return s.data.adds.forEach(r=>{this.replaceIds(r,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,t);let c=this.crossOriginIframeRootIdMap.get(t);c&&this.patchRootIdOnNode(r.node,c)}),s.data.removes.forEach(r=>{this.replaceIds(r,t,["parentId","id"])}),s.data.attributes.forEach(r=>{this.replaceIds(r,t,["id"])}),s.data.texts.forEach(r=>{this.replaceIds(r,t,["id"])}),s;case L.Drag:case L.TouchMove:case L.MouseMove:return s.data.positions.forEach(r=>{this.replaceIds(r,t,["id"])}),s;case L.ViewportResize:return!1;case L.MediaInteraction:case L.MouseInteraction:case L.Scroll:case L.CanvasMutation:case L.Input:return this.replaceIds(s.data,t,["id"]),s;case L.StyleSheetRule:case L.StyleDeclaration:return this.replaceIds(s.data,t,["id"]),this.replaceStyleIds(s.data,t,["styleId"]),s;case L.Font:return s;case L.Selection:return s.data.ranges.forEach(r=>{this.replaceIds(r,t,["start","end"])}),s;case L.AdoptedStyleSheet:return this.replaceIds(s.data,t,["id"]),this.replaceStyleIds(s.data,t,["styleIds"]),(a=s.data.styles)==null||a.forEach(r=>{this.replaceStyleIds(r,t,["styleId"])}),s}}return!1}replace(t,s,a,r){for(let c of r)!Array.isArray(s[c])&&typeof s[c]!="number"||(Array.isArray(s[c])?s[c]=t.getIds(a,s[c]):s[c]=t.getId(a,s[c]));return s}replaceIds(t,s,a){return this.replace(this.crossOriginIframeMirror,t,s,a)}replaceStyleIds(t,s,a){return this.replace(this.crossOriginIframeStyleMirror,t,s,a)}replaceIdOnNode(t,s){this.replaceIds(t,s,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(a=>{this.replaceIdOnNode(a,s)})}patchRootIdOnNode(t,s){t.type!==pn.Document&&!t.rootId&&(t.rootId=s),"childNodes"in t&&t.childNodes.forEach(a=>{this.patchRootIdOnNode(a,s)})}},Wr=class{constructor(t){I(this,"shadowDoms",new Map),I(this,"mutationCb"),I(this,"scrollCb"),I(this,"bypassOptions"),I(this,"mirror"),I(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,s){if(!Be(t)||this.shadowDoms.has(t))return;let a=[];this.shadowDoms.set(t,a);let r=gn({...this.bypassOptions,doc:s,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);a.push(r),a.push(yn({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),setTimeout(()=>{this.shadowDoms.get(t)===a&&(t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(T.host(t))),a.push(wn({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)))},0)}removeShadowRootsIn(t){if(this.shadowDoms.size===0)return;let s=T.shadowRoot(t);s&&(this.shadowDoms.has(s)&&this.removeShadowRoot(s),this.removeShadowRootsIn(s)),T.childNodes(t).forEach(a=>this.removeShadowRootsIn(a))}removeShadowRoot(t){let s=this.shadowDoms.get(t);this.shadowDoms.delete(t),s?.forEach(Ir)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,s){let a=this;this.restoreHandlers.push(Me(t.prototype,"attachShadow",function(r){return function(c){let f=r.call(this,c),m=T.shadowRoot(this);return m&&Fr(this)&&a.addShadowRoot(m,s),f}}))}reset(){this.restoreHandlers.forEach(Ir),this.restoreHandlers=[];let t=this.shadowDoms;this.shadowDoms=new Map,t.forEach(s=>s.forEach(Ir))}};function Ir(e){try{e()}catch{}}var Te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ua=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(Le=0;Le<Te.length;Le++)Ua[Te.charCodeAt(Le)]=Le;var Le,$a=function(e){var t=new Uint8Array(e),s,a=t.length,r="";for(s=0;s<a;s+=3)r+=Te[t[s]>>2],r+=Te[(t[s]&3)<<4|t[s+1]>>4],r+=Te[(t[s+1]&15)<<2|t[s+2]>>6],r+=Te[t[s+2]&63];return a%3===2?r=r.substring(0,r.length-1)+"=":a%3===1&&(r=r.substring(0,r.length-2)+"=="),r};var Ni=new Map;function Ba(e,t){let s=Ni.get(e);return s||(s=new Map,Ni.set(e,s)),s.has(t)||s.set(t,[]),s.get(t)}var bn=(e,t,s)=>{if(!e||!(Sn(e,t)||typeof e=="object"))return;let a=e.constructor.name,r=Ba(s,a),c=r.indexOf(e);return c===-1&&(c=r.length,r.push(e)),c};function tt(e,t,s){if(e instanceof Array)return e.map(a=>tt(a,t,s));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){let a=e.constructor.name,r=$a(e);return{rr_type:a,base64:r}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[tt(e.buffer,t,s),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let a=e.constructor.name,{src:r}=e;return{rr_type:a,src:r}}else if(e instanceof HTMLCanvasElement){let a="HTMLImageElement",r=e.toDataURL();return{rr_type:a,src:r}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[tt(e.data,t,s),e.width,e.height]};if(Sn(e,t)||typeof e=="object"){let a=e.constructor.name,r=bn(e,t,s);return{rr_type:a,index:r}}}}return e}var vn=(e,t,s)=>e.map(a=>tt(a,t,s)),Sn=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(r=>typeof t[r]=="function").find(r=>e instanceof t[r]);function Wa(e,t,s,a){let r=[],c=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let f of c)try{if(typeof t.CanvasRenderingContext2D.prototype[f]!="function")continue;let m=Me(t.CanvasRenderingContext2D.prototype,f,function(l){return function(...d){return ee(this.canvas,s,a,!0)||setTimeout(()=>{let i=vn(d,t,this);e(this.canvas,{type:Pe["2D"],property:f,args:i})},0),l.apply(this,d)}});r.push(m)}catch{let m=St(t.CanvasRenderingContext2D.prototype,f,{set(l){e(this.canvas,{type:Pe["2D"],property:f,args:[l],setter:!0})}});r.push(m)}return()=>{r.forEach(f=>f())}}function za(e){return e==="experimental-webgl"?"webgl":e}function Oi(e,t,s,a){let r=[];try{let c=Me(e.HTMLCanvasElement.prototype,"getContext",function(f){return function(m,...l){if(!ee(this,t,s,!0)){let d=za(m);if("__context"in this||(this.__context=d),a&&["webgl","webgl2"].includes(d))if(l[0]&&typeof l[0]=="object"){let i=l[0];i.preserveDrawingBuffer||(i.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return f.apply(this,[m,...l])}});r.push(c)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(c=>c())}}function Ii(e,t,s,a,r,c){let f=[],m=Object.getOwnPropertyNames(e);for(let l of m)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof e[l]!="function")continue;let d=Me(e,l,function(i){return function(...h){let o=i.apply(this,h);if(bn(o,c,this),"tagName"in this.canvas&&!ee(this.canvas,a,r,!0)){let n=vn(h,c,this),p={type:t,property:l,args:n};s(this.canvas,p)}return o}});f.push(d)}catch{let d=St(e,l,{set(i){s(this.canvas,{type:t,property:l,args:[i],setter:!0})}});f.push(d)}return f}function qa(e,t,s,a){let r=[];return typeof t.WebGLRenderingContext<"u"&&r.push(...Ii(t.WebGLRenderingContext.prototype,Pe.WebGL,e,s,a,t)),typeof t.WebGL2RenderingContext<"u"&&r.push(...Ii(t.WebGL2RenderingContext.prototype,Pe.WebGL2,e,s,a,t)),()=>{r.forEach(c=>c())}}var Cn=`(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = \\`\\${width}-\\${height}\\`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n`,Ai=typeof self<"u"&&self.Blob&&new Blob([Cn],{type:"text/javascript;charset=utf-8"});function Va(e){let t;try{if(t=Ai&&(self.URL||self.webkitURL).createObjectURL(Ai),!t)throw"";let s=new Worker(t,{name:e?.name});return s.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),s}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Cn),{name:e?.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var zr=class{constructor(t){I(this,"pendingCanvasMutations",new Map),I(this,"rafStamps",{latestId:0,invokeId:null}),I(this,"mirror"),I(this,"mutationCb"),I(this,"resetObservers"),I(this,"frozen",!1),I(this,"locked",!1),I(this,"processMutation",(l,d)=>{(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(d)});let{sampling:s="all",win:a,blockClass:r,blockSelector:c,recordCanvas:f,dataURLOptions:m}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,f&&s==="all"&&this.initCanvasMutationObserver(a,r,c),f&&typeof s=="number"&&this.initCanvasFPSObserver(s,a,r,c,{dataURLOptions:m})}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(t,s,a,r,c){let f=Oi(s,a,r,!0),m=new Map,l=new Va;l.onmessage=p=>{let{id:u}=p.data;if(m.set(u,!1),!("base64"in p.data))return;let{base64:g,type:S,width:v,height:b}=p.data;this.mutationCb({id:u,type:Pe["2D"],commands:[{property:"clearRect",args:[0,0,v,b]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:g}],type:S}]},0,0]}]})};let d=1e3/t,i=0,h,o=()=>{let p=[];return s.document.querySelectorAll("canvas").forEach(u=>{ee(u,a,r,!0)||p.push(u)}),p},n=p=>{if(i&&p-i<d){h=requestAnimationFrame(n);return}i=p,o().forEach(async u=>{var g;let S=this.mirror.getId(u);if(m.get(S)||u.width===0||u.height===0)return;if(m.set(S,!0),["webgl","webgl2"].includes(u.__context)){let b=u.getContext(u.__context);((g=b?.getContextAttributes())==null?void 0:g.preserveDrawingBuffer)===!1&&b.clear(b.COLOR_BUFFER_BIT)}let v=await createImageBitmap(u);l.postMessage({id:S,bitmap:v,width:u.width,height:u.height,dataURLOptions:c.dataURLOptions},[v])}),h=requestAnimationFrame(n)};h=requestAnimationFrame(n),this.resetObservers=()=>{f(),cancelAnimationFrame(h)}}initCanvasMutationObserver(t,s,a){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let r=Oi(t,s,a,!1),c=Wa(this.processMutation.bind(this),t,s,a),f=qa(this.processMutation.bind(this),t,s,a);this.resetObservers=()=>{r(),c(),f()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=s=>{this.rafStamps.latestId=s,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,s)=>{let a=this.mirror.getId(s);this.flushPendingCanvasMutationFor(s,a)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,s){if(this.frozen||this.locked)return;let a=this.pendingCanvasMutations.get(t);if(!a||s===-1)return;let r=a.map(f=>{let{type:m,...l}=f;return l}),{type:c}=a[0];this.mutationCb({id:s,type:c,commands:r}),this.pendingCanvasMutations.delete(t)}},qr=class{constructor(t){I(this,"trackedLinkElements",new WeakSet),I(this,"mutationCb"),I(this,"adoptedStyleSheetCb"),I(this,"styleMirror",new Lr),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,s){"_cssText"in s.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:s.id,attributes:s.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,s){if(t.length===0)return;let a={id:s,styleIds:[]},r=[];for(let c of t){let f;this.styleMirror.has(c)?f=this.styleMirror.getId(c):(f=this.styleMirror.add(c),r.push({styleId:f,rules:Array.from(c.rules||CSSRule,(m,l)=>({rule:ki(m,c.href),index:l}))})),a.styleIds.push(f)}r.length>0&&(a.styles=r),this.adoptedStyleSheetCb(a)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}},Vr=class{constructor(){I(this,"nodeMap",new WeakMap),I(this,"active",!1)}inOtherBuffer(t,s){let a=this.nodeMap.get(t);return a&&Array.from(a).some(r=>r!==s)}add(t,s){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(s))}destroy(){}},j,rt,ve,Ve=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((ls=e.contentWindow)==null?void 0:ls.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var he=Qn();function ye(e={}){let{emit:t,checkoutEveryNms:s,checkoutEveryNth:a,blockClass:r="rr-block",blockSelector:c=null,ignoreClass:f="rr-ignore",ignoreSelector:m=null,maskTextClass:l="rr-mask",maskTextSelector:d=null,inlineStylesheet:i=!0,maskAllInputs:h,maskInputOptions:o,slimDOMOptions:n,maskInputFn:p,maskTextFn:u,hooks:g,packFn:S,sampling:v={},dataURLOptions:b={},mousemoveWait:C,recordDOM:y=!0,recordCanvas:w=!1,recordCrossOriginIframes:E=!1,recordAfter:R=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:O=!1,collectFonts:M=!1,inlineImages:P=!1,plugins:A,keepIframeSrcFn:x=()=>!1,ignoreCSSAttributes:fe=new Set([]),errorHandler:ie}=e;Ea(ie);let $=E?window.parent===window:!0,U=!1;if(!$)try{window.parent.document&&(U=!1)}catch{U=!0}if($&&!t)throw new Error("emit function is required");if(!$&&!U)return()=>{};C!==void 0&&v.mousemove===void 0&&(v.mousemove=C),he.reset();let G=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}:o!==void 0?o:{password:!0},Z=zi(n);ba();let H,B=0,be=D=>{for(let Y of A||[])Y.eventProcessor&&(D=Y.eventProcessor(D));return S&&!U&&(D=S(D)),D};j=(D,Y)=>{let _=D;if(_.timestamp=ze(),_.type!==k.FullSnapshot&&!(_.type===k.IncrementalSnapshot&&_.data.source===L.Mutation)){ve.unfreeze();for(let te of _e)if(te.isFrozen())te.unfreeze();else break}if($)t?.(be(_),Y);else if(U){let te={type:"rrweb",event:be(_),origin:window.location.origin,isCheckout:Y};window.parent.postMessage(te,"*")}if(_.type===k.FullSnapshot)H=_,B=0;else if(_.type===k.IncrementalSnapshot){if(_.data.source===L.Mutation&&_.data.isAttachIframe)return;B++;let te=a&&B>=a,ue=s&&_.timestamp-H.timestamp>s;(te||ue)&&rt(!0)}};let N=D=>{j({type:k.IncrementalSnapshot,data:{source:L.Mutation,...D}})},me=D=>j({type:k.IncrementalSnapshot,data:{source:L.Scroll,...D}}),le=D=>j({type:k.IncrementalSnapshot,data:{source:L.CanvasMutation,...D}}),ke=D=>j({type:k.IncrementalSnapshot,data:{source:L.AdoptedStyleSheet,...D}}),K=new qr({mutationCb:N,adoptedStyleSheetCb:ke}),ne=new Br({mirror:he,mutationCb:N,stylesheetManager:K,recordCrossOriginIframes:E,wrappedEmit:j});for(let D of A||[])D.getMirror&&D.getMirror({nodeMirror:he,crossOriginIframeMirror:ne.crossOriginIframeMirror,crossOriginIframeStyleMirror:ne.crossOriginIframeStyleMirror});let Ee=new Vr;ve=new zr({recordCanvas:w,mutationCb:le,win:window,blockClass:r,blockSelector:c,mirror:he,sampling:v.canvas,dataURLOptions:b});let ge=new Wr({mutationCb:N,scrollCb:me,bypassOptions:{blockClass:r,blockSelector:c,maskTextClass:l,maskTextSelector:d,inlineStylesheet:i,maskInputOptions:G,dataURLOptions:b,maskTextFn:u,maskInputFn:p,recordCanvas:w,inlineImages:P,sampling:v,slimDOMOptions:Z,iframeManager:ne,stylesheetManager:K,canvasManager:ve,keepIframeSrcFn:x,processedNodeManager:Ee},mirror:he});rt=(D=!1)=>{if(!y)return;j({type:k.Meta,data:{href:window.location.href,width:ln(),height:an()}},D),K.reset(),ge.init(),ve.lock(),_e.forEach(_=>_.lock());let Y=xo(document,{mirror:he,blockClass:r,blockSelector:c,maskTextClass:l,maskTextSelector:d,inlineStylesheet:i,maskAllInputs:G,maskTextFn:u,maskInputFn:p,slimDOM:Z,dataURLOptions:b,recordCanvas:w,inlineImages:P,onSerialize:_=>{hn(_,he)&&ne.addIframe(_),fn(_,he)&&K.trackLinkElement(_),kr(_)&&ge.addShadowRoot(T.shadowRoot(_),document)},onIframeLoad:(_,te)=>{ne.attachIframe(_,te),ge.observeAttachShadow(_)},onStylesheetLoad:(_,te)=>{K.attachLinkElement(_,te)},keepIframeSrcFn:x});if(!Y)return console.warn("Failed to snapshot the document");j({type:k.FullSnapshot,data:{node:Y,initialOffset:on(window)}},D),ve.unlock(),_e.forEach(_=>_.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&K.adoptStyleSheets(document.adoptedStyleSheets,he.getId(document))};try{let D=[],Y=ue=>{var re;return F(Fa)({mutationCb:N,mousemoveCb:(W,Et)=>j({type:k.IncrementalSnapshot,data:{source:Et,positions:W}}),mouseInteractionCb:W=>j({type:k.IncrementalSnapshot,data:{source:L.MouseInteraction,...W}}),scrollCb:me,viewportResizeCb:W=>j({type:k.IncrementalSnapshot,data:{source:L.ViewportResize,...W}}),inputCb:W=>j({type:k.IncrementalSnapshot,data:{source:L.Input,...W}}),mediaInteractionCb:W=>j({type:k.IncrementalSnapshot,data:{source:L.MediaInteraction,...W}}),styleSheetRuleCb:W=>j({type:k.IncrementalSnapshot,data:{source:L.StyleSheetRule,...W}}),styleDeclarationCb:W=>j({type:k.IncrementalSnapshot,data:{source:L.StyleDeclaration,...W}}),canvasMutationCb:le,fontCb:W=>j({type:k.IncrementalSnapshot,data:{source:L.Font,...W}}),selectionCb:W=>{j({type:k.IncrementalSnapshot,data:{source:L.Selection,...W}})},customElementCb:W=>{j({type:k.IncrementalSnapshot,data:{source:L.CustomElement,...W}})},blockClass:r,ignoreClass:f,ignoreSelector:m,maskTextClass:l,maskTextSelector:d,maskInputOptions:G,inlineStylesheet:i,sampling:v,recordDOM:y,recordCanvas:w,inlineImages:P,userTriggeredOnInput:O,collectFonts:M,doc:ue,maskInputFn:p,maskTextFn:u,keepIframeSrcFn:x,blockSelector:c,slimDOMOptions:Z,dataURLOptions:b,mirror:he,iframeManager:ne,stylesheetManager:K,shadowDomManager:ge,processedNodeManager:Ee,canvasManager:ve,ignoreCSSAttributes:fe,plugins:((re=A?.filter(W=>W.observer))==null?void 0:re.map(W=>({observer:W.observer,options:W.options,callback:Et=>j({type:k.Plugin,data:{plugin:W.name,payload:Et}})})))||[]},g)},_=new Map;ne.addLoadListener(ue=>{try{let re=ue.contentDocument;if(_.has(re))return;_.set(re,Y(re))}catch(re){console.warn(re)}}),ne.addUnloadListener(ue=>{let re=_.get(ue);re&&(_.delete(ue),re(),ge.removeShadowRootsIn(ue),he.removeNodeFromMap(ue))});let te=()=>{rt(),D.push(Y(document)),Ve=!0};return["interactive","complete"].includes(document.readyState)?te():(D.push(Q("DOMContentLoaded",()=>{j({type:k.DomContentLoaded,data:{}}),R==="DOMContentLoaded"&&te()})),D.push(Q("load",()=>{j({type:k.Load,data:{}}),R==="load"&&te()},window))),()=>{[...D,..._.values()].forEach(ue=>{try{ue()}catch(re){String(re).toLowerCase().includes("cross-origin")||console.warn(re)}}),_.clear(),ne.destroy(),Ee.destroy(),ge.reset(),ve.reset(),Ve=!1,xa()}}catch(D){console.warn(D)}}ye.addCustomEvent=(e,t)=>{if(!Ve)throw new Error("please add custom event after start recording");j({type:k.Custom,data:{tag:e,payload:t}})};ye.addAnnotation=e=>{if(!Ve)throw new Error("please add annotation after recording started");j({type:k.Annotation,data:e})};ye.freezePage=()=>{ve.freeze(),_e.forEach(e=>e.freeze())};ye.takeFullSnapshot=e=>{if(!Ve)throw new Error("please take full snapshot after start recording");rt(e)};ye.mirror=he;var Di;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Di||(Di={}));var Ka=5*1e3;var{addCustomEvent:el,addAnnotation:tl}=ye,{freezePage:rl}=ye,{takeFullSnapshot:sl}=ye;var ja=1e4,Ct=48e3,Ga=1e3,Ha=3e4,Ya=2,Ja=e=>e.type===3&&e.data?.source===2&&e.data?.type===2;function Xa(e){let t=e.mode,s=Math.random().toString(36).slice(2,10),a=0,r=[],c=0,f=0,m=0,l=0,d=0,i=0,h,o=[[]];function n(C){let y=JSON.stringify(C);r.length===0&&(f=C.timestamp),m=C.timestamp,r.push(y),c+=y.length,Ja(C)&&l++}function p(){if(h!==void 0)return;let C=i+Ga-Date.now();C<=0?u(!1):h=setTimeout(()=>{u(!1)},C)}async function u(C){if(h!==void 0&&clearTimeout(h),h=void 0,r.length===0)return;let y=`[${r.join(",")}]`,w=new URLSearchParams({project:e.project,session:e.sessionId,seq:String(a++),page:s,start:String(f),end:String(m),clicks:String(l),errors:String(d),href:location.href.split("?")[0].slice(0,500)});e.distinctId&&w.set("d",e.distinctId),e.userId&&w.set("u",e.userId),r=[],c=0,l=0,d=0,i=Date.now();let E=O=>`${e.host}/r?${w}&enc=${O}`,R={"Content-Type":"text/plain"};try{if(C&&y.length<=Ct&&navigator.sendBeacon?.(E("json"),new Blob([y],{type:"text/plain"})))return;if(typeof CompressionStream>"u"){await fetch(E("json"),{method:"POST",body:y,headers:R,keepalive:y.length<=Ct});return}let O=await new Response(new Blob([y]).stream().pipeThrough(new CompressionStream("gzip"))).blob();await fetch(E("gzip"),{method:"POST",body:new Blob([O],{type:"text/plain"}),keepalive:O.size<=Ct})}catch{}}function g(C,y){if(t==="buffer"){y&&(o.push([]),o.length>2&&o.shift()),o[o.length-1].push(C);return}n(C),C.type===Ya?u(!1):c>Ct&&p()}let S=()=>{document.visibilityState==="hidden"&&u(!0)},v=ye({emit:g,checkoutEveryNms:t==="buffer"?Ha:void 0,maskAllInputs:!0,maskTextSelector:e.maskAllText?"*":void 0,blockSelector:e.blockSelector,recordCanvas:!1,collectFonts:!1,sampling:{mousemove:50,scroll:150,input:"last"}}),b=setInterval(()=>{u(!1)},ja);return addEventListener("visibilitychange",S),addEventListener("pagehide",S),{stop(){v?.(),clearInterval(b),removeEventListener("visibilitychange",S),removeEventListener("pagehide",S),u(!0)},flushBuffer(){if(t==="buffer"){t="record";for(let C of o.flat())n(C);o=[[]],u(!1)}},noteError(){d++}}}var Qa={startReplay:Xa};window.__glassReplay=Qa;})();\n', dashboardJs: 'var fl=document.querySelector(\'meta[name="glass-base"]\')?.content??"",Ht={base:fl};function $r(e){try{return localStorage.getItem(`glass:${e}`)}catch{return null}}function Fr(e,t){try{t===null?localStorage.removeItem(`glass:${e}`):localStorage.setItem(`glass:${e}`,t)}catch{}}var ee={get key(){return $r("key")},set key(e){Fr("key",e)},get showSql(){return $r("show-sql")==="1"},set showSql(e){Fr("show-sql",e?"1":null),document.documentElement.classList.toggle("show-sql",e)},get project(){return $r("project")},set project(e){Fr("project",e)}};function Ae(){let e=location.hash.replace(/^#\\/?/,""),[t="",r=""]=e.split("?"),[s="web",...n]=t.split("/").filter(Boolean).map(decodeURIComponent);return{page:s,rest:n,params:new URLSearchParams(r)}}function de(e,t={},r=!0){let s=Ae().params,n=new URLSearchParams;if(r)for(let o of["project","from","to"])s.get(o)&&n.set(o,s.get(o));for(let[o,l]of Object.entries(t))l==null||l===""?n.delete(o):n.set(o,l);let i=n.toString();location.hash=`#/${e}${i?`?${i}`:""}`}function fe(e,t={}){let r=Ae().params,s=new URLSearchParams;for(let i of["project","from","to"])r.get(i)&&s.set(i,r.get(i));for(let[i,o]of Object.entries(t))o&&s.set(i,o);let n=s.toString();return`#/${e}${n?`?${n}`:""}`}function ie(){let e=Ae().params;return{project:e.get("project")??ee.project??void 0,from:e.get("from")??"-30d",to:e.get("to")??void 0}}var St=class extends Error{status;hint;constructor(t,r,s){super(r),this.status=t,this.hint=s}};async function wt(e,t,r,s){let n=new URL(`${Ht.base}${t}`,location.origin);for(let[l,u]of Object.entries(s??{}))u!=null&&u!==""&&n.searchParams.set(l,String(u));let i=await fetch(n,{method:e,headers:{Authorization:`Bearer ${ee.key??""}`,...r===void 0?{}:{"Content-Type":"application/json"}},body:r===void 0?void 0:JSON.stringify(r)}),o=await i.json().catch(()=>({}));if(!i.ok)throw i.status===401&&window.dispatchEvent(new CustomEvent("glass:unauthorized")),new St(i.status,o.error??`Request failed (${i.status})`,o.hint);return o}var W={get:(e,t)=>wt("GET",e,void 0,t),post:(e,t={},r)=>wt("POST",e,t,r),put:(e,t)=>wt("PUT",e,t),patch:(e,t)=>wt("PATCH",e,t),delete:(e,t)=>wt("DELETE",e,void 0,t)};function xt(e,t){if(!(t==null||t===!1)){if(Array.isArray(t)){for(let r of t)xt(e,r);return}e.appendChild(typeof t=="object"?t:document.createTextNode(String(t)))}}function ml(e,t){for(let[r,s]of Object.entries(t))s==null||s===!1||(r.startsWith("on")&&typeof s=="function"?e.addEventListener(r.slice(2),s):r==="value"&&"value"in e?e.value=String(s):r==="checked"&&e instanceof HTMLInputElement?e.checked=!!s:e.setAttribute(r,s===!0?"":String(s)))}var gl=e=>!!e&&typeof e=="object"&&!(e instanceof Node)&&!Array.isArray(e);function S(e,t,...r){let s=document.createElement(e);return gl(t)?ml(s,t):xt(s,t),xt(s,r),s}var yl="http://www.w3.org/2000/svg";function ze(e,t={},...r){let s=document.createElementNS(yl,e);for(let[n,i]of Object.entries(t))i!=null&&s.setAttribute(n,String(i));return xt(s,r),s}function J(e,...t){e.replaceChildren(),xt(e,t)}function G(e,t,r={}){return S("section",{class:`panel ${r.class??""}`},S("header",{class:"panel-head"},S("h2",{},e),r.actions?S("div",{class:"panel-actions"},r.actions):null),S("div",{class:"panel-body"},t),r.sql?.length?bl(r.sql):null)}function bl(e){return S("div",{class:"sql-pane"},S("div",{class:"sql-pane-head"},S("span",{},e.length===1?"Query":`${e.length} queries`),ye(e.join(`;\n\n`),"Copy SQL")),...e.map(t=>S("pre",{class:"sql"},S("code",{},t.trim()))))}function ye(e,t="Copy"){let r=S("button",{class:"ghost small",type:"button"},t);return r.addEventListener("click",async()=>{try{await navigator.clipboard.writeText(typeof e=="function"?e():e),r.textContent="Copied"}catch{r.textContent="Copy failed"}setTimeout(()=>{r.textContent=t},1500)}),r}function Ct(e="Loading"){return S("div",{class:"state loading",role:"status"},e)}function te(e,t){return S("div",{class:"state empty"},S("p",{},e),t??null)}function Te(e){let t=e instanceof Error?e.message:String(e),r=e instanceof St?e.hint:void 0;return S("div",{class:"state error",role:"alert"},S("p",{},t),r?S("p",{class:"hint"},r):null)}function le(e,t){let r=S("div",{class:"later"},Ct(t));return e().then(s=>J(r,s),s=>J(r,Te(s))),r}function re(e,t,r){return S("div",{class:"page-head"},S("div",{},S("h1",{},e),t?S("p",{class:"muted"},t):null),r?S("div",{class:"page-actions"},r):null)}function he(e,t,r={}){let s=new Set(r.numeric??[]);return S("div",{class:"table-wrap"},S("table",{class:r.class??""},S("thead",{},S("tr",{},e.map((n,i)=>S("th",{class:s.has(i)?"num":""},n)))),S("tbody",{},t.map(n=>S("tr",{},n.map((i,o)=>S("td",{class:s.has(o)?"num":""},i)))))))}function Gt(e,t,r){return S("div",{class:"tabs",role:"tablist"},e.map(s=>S("button",{type:"button",role:"tab","aria-selected":String(s.value===t),class:s.value===t?"tab active":"tab",onclick:()=>r(s.value)},s.label)))}function Le(e,t="ok"){let r=S("div",{class:`toast ${t}`,role:"status"},e);document.body.appendChild(r),setTimeout(()=>r.remove(),3200)}function ae(e){if(!Number.isFinite(e))return"\\u2013";let t=Math.abs(e);return t>=1e6?`${(e/1e6).toFixed(t>=1e7?0:1)}M`:t>=1e4?`${(e/1e3).toFixed(t>=1e5?0:1)}k`:Math.round(e).toLocaleString("en-US")}function Xn(e,t=2){return Number.isFinite(e)?e.toFixed(t):"\\u2013"}function pe(e,t=1){return Number.isFinite(e)?`${(e*100).toFixed(t)}%`:"\\u2013"}function Et(e){if(!Number.isFinite(e)||e<=0)return"0s";let t=Math.round(e);if(t<60)return`${t}s`;let r=Math.floor(t/60);return r<60?`${r}m ${t%60}s`:`${Math.floor(r/60)}h ${r%60}m`}function Kn(e,t){if(!t)return null;let r=(e-t)/t;return Math.abs(r)<.005?{text:"0%",direction:"flat"}:{text:`${r>0?"+":"\\u2212"}${Math.abs(r*100).toFixed(0)}%`,direction:r>0?"up":"down"}}var Ur=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Yt(e,t){let r=new Date(e);return t==="hour"?`${String(r.getUTCHours()).padStart(2,"0")}:00`:t==="month"?`${Ur[r.getUTCMonth()]} ${r.getUTCFullYear()}`:`${r.getUTCDate()} ${Ur[r.getUTCMonth()]}`}function Pe(e){let t=new Date(e);return`${t.getDate()} ${Ur[t.getMonth()]} ${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}function Rt(e){let t=(Date.now()-new Date(e).getTime())/1e3;return t<60?"just now":t<3600?`${Math.floor(t/60)} min ago`:t<86400?`${Math.floor(t/3600)} h ago`:`${Math.floor(t/86400)} d ago`}function vl(e){let t=ie().project;return[le(async()=>{let r=await W.get(`/api/events/${encodeURIComponent(e)}`,{project:t}),s=S("input",{type:"text",value:r.description,placeholder:"What does this event mean?"}),n=S("input",{type:"text",value:r.owner,placeholder:"team or person"}),i=new Map(r.properties.map(l=>[l.name,S("input",{type:"text",value:l.description,placeholder:"meaning","aria-label":`Description of ${l.name}`})])),o=S("form",{class:"stack"},S("label",{class:"field"},S("span",{},"Description"),s),S("label",{class:"field"},S("span",{},"Owner"),n),S("div",{class:"form-actions"},S("button",{type:"submit",class:"primary"},"Save description")));return o.addEventListener("submit",async l=>{l.preventDefault();try{await W.put(`/api/events/${encodeURIComponent(e)}`,{project:t,description:s.value,owner:n.value,properties:Object.fromEntries([...i].map(([u,c])=>[u,c.value]).filter(([,u])=>u))}),Le("Saved")}catch(u){Le(u instanceof Error?u.message:String(u),"error")}}),[re(r.event,r.summary,ye(`glass.capture(\'${r.event}\', {})`,"Copy capture code")),S("div",{class:"grid-2"},G("Definition",o),G("Explore",S("ul",{class:"plain"},S("li",{},S("a",{href:fe("insights/trends",{spec:JSON.stringify({series:[{event:r.event}],interval:"day"})})},"Trend over time")),S("li",{},S("a",{href:fe("insights/retention",{spec:JSON.stringify({cohortEvent:{event:r.event},returnEvent:{event:r.event},period:"week",periods:8})})},"Retention of people who did it"))))),G("Properties",r.properties.length?he(["Property","Type","Present on","Examples","Meaning"],r.properties.map(l=>[S("code",{},l.name),l.types.join(", "),pe(l.coverage,0),S("span",{class:"muted"},l.examples.join(", ")),i.get(l.name)]),{numeric:[2]}):te("No properties sent with this event."),{sql:r.sql})]})]}function Zn(e){if(e.rest[0])return vl(e.rest[0]);let t=ie().project;return[re("Events","Everything tracked in the last 30 days. Describe custom events so people and agents know what they mean."),le(async()=>{let r=await W.get("/api/events",{project:t});return r.events.length===0?te("No events yet."):[r.undocumented.length?S("p",{class:"notice"},`${r.undocumented.length} custom event${r.undocumented.length===1?" has":"s have"} no description yet.`):null,he(["Event","Count","Last seen","Description"],r.events.map(s=>[S("a",{href:fe(`events/${encodeURIComponent(s.event)}`)},S("code",{},s.event)),ae(s.count),Rt(s.lastSeen),s.system?S("span",{class:"muted"},"Built in"):s.description||S("span",{class:"muted"},"No description")]),{numeric:[1]})]})]}function ei(e){let t=ie().project,r=e.params.get("query")??`SELECT event, COUNT(*) AS n\nFROM events\nWHERE project = \'${t??"default"}\'\n AND ts_ms >= ${Date.now()-7*864e5}\nGROUP BY event\nORDER BY n DESC`,s=S("textarea",{class:"sql-editor",rows:10,spellcheck:!1,"aria-label":"SQL query"},r),n=S("div",{}),i=async()=>{J(n,Ct("Running"));try{let o=await W.post("/api/sql",{project:t,query:s.value});J(n,G("Rows",o.rows.length?he(o.columns,o.rows.map(l=>o.columns.map(u=>l[u]===null?S("span",{class:"muted"},"null"):String(l[u])))):te("The query returned no rows."),{actions:S("span",{class:"muted"},o.summary)})),de("sql",{query:s.value})}catch(o){J(n,Te(o))}};return s.addEventListener("keydown",o=>{o.key==="Enter"&&(o.metaKey||o.ctrlKey)&&i()}),[re("SQL","One read-only SELECT against your events. Timestamps are epoch milliseconds in ts_ms."),G("Query",[s,S("div",{class:"form-actions"},S("button",{type:"button",class:"primary",onclick:()=>{i()}},"Run"),S("span",{class:"muted small"},"Ctrl or \\u2318 + Enter"))]),n]}function wl(){let e=S("input",{type:"text",required:!0,placeholder:"pricing-page-v2"}),t=S("input",{type:"text",required:!0,placeholder:"signup_completed"}),r=S("input",{type:"text",placeholder:"Showing annual pricing first increases signups"}),s=S("div",{}),n=S("form",{class:"stack"},S("label",{class:"field"},S("span",{},"Key (also the flag key)"),e),S("label",{class:"field"},S("span",{},"Goal event"),t),S("label",{class:"field"},S("span",{},"Hypothesis"),r),s,S("div",{class:"form-actions"},S("button",{type:"submit",class:"primary"},"Create experiment")));return n.addEventListener("submit",async i=>{i.preventDefault();try{await W.post("/api/experiments",{project:ie().project,key:e.value,goal:{event:t.value},hypothesis:r.value||void 0}),Le("Experiment created"),de(`experiments/${encodeURIComponent(e.value)}`)}catch(o){J(s,Te(o))}}),n}function Sl(e){return S("div",{},S("p",{class:"summary"},e.summary),e.srm.mismatch?S("p",{class:"state error"},`Sample ratio mismatch (p = ${e.srm.pValue.toExponential(1)}). Exposure tracking or assignment is broken.`):null,he(["Variant","Exposed","Converted","Rate","95% interval","Chance to beat control","Lift (95% interval)"],e.variants.map(t=>[S("strong",{},t.variant),ae(t.exposures),ae(t.conversions),pe(t.conversionRate),`${pe(t.rateInterval[0])} to ${pe(t.rateInterval[1])}`,t.vsControl?S("span",{class:t.vsControl.probabilityToBeatControl>=.95?"good":""},pe(t.vsControl.probabilityToBeatControl,0)):"control",t.vsControl?`${pe(t.vsControl.expectedLift,0)} (${pe(t.vsControl.liftInterval[0],0)} to ${pe(t.vsControl.liftInterval[1],0)})`:""]),{numeric:[1,2,3]}),e.excludedMultipleVariants?S("p",{class:"muted"},`${ae(e.excludedMultipleVariants)} people saw more than one variant and are excluded.`):null)}function xl(e){let t=ie().project;return[le(async()=>{let r=await W.get(`/api/experiments/${encodeURIComponent(e)}`,{project:t}),s=r.experiment,n=async(o,l)=>{try{await W.post(`/api/experiments/${encodeURIComponent(e)}/${o}`,{project:t,variant:l}),Le(o==="ship"?`Shipped ${l}`:o==="start"?"Experiment started":"Experiment stopped"),de(`experiments/${encodeURIComponent(e)}`,{t:String(Date.now())})}catch(u){Le(u instanceof Error?u.message:String(u),"error")}},i=[s.status==="draft"||s.status==="stopped"?S("button",{type:"button",class:"primary",onclick:()=>n("start")},s.status==="draft"?"Start experiment":"Restart"):null,s.status==="running"?S("button",{type:"button",class:"ghost",onclick:()=>n("stop")},"Stop"):null,s.status!=="shipped"?r.results.variants.map(o=>S("button",{type:"button",class:"ghost",onclick:()=>n("ship",o.variant)},`Ship ${o.variant}`)):null];return[re(s.key,s.hypothesis||`Goal: ${s.goal.event}`,ye(`if (glass.flag(\'${s.flag}\') === \'test\') {\n // show the new variant\n}`,"Copy code")),S("p",{class:"muted"},S("span",{class:`badge ${s.status==="running"?"good":""}`},s.status)," Flag ",S("a",{href:fe(`flags/${encodeURIComponent(s.flag)}`)},s.flag),`, goal ${s.goal.event}`,s.startedAt?`, started ${Pe(s.startedAt)}`:"",s.shippedVariant?`, shipped ${s.shippedVariant}`:"","."),S("div",{class:"page-actions"},i),G("Results",Sl(r.results),{sql:r.results.sql})]})]}function ti(e){let t=ie().project,r=e.rest[0];return r==="new"?[re("New experiment"),G("Experiment",wl())]:r?xl(r):[re("Experiments","A/B tests on top of flags. Results update as exposures and conversions arrive.",S("a",{class:"button primary",href:fe("experiments/new")},"New experiment")),le(async()=>{let{experiments:s}=await W.get("/api/experiments",{project:t});return s.length===0?te("No experiments yet. Create one here, or ask your agent to use create_experiment."):he(["Experiment","Status","Goal","Started"],s.map(n=>[S("a",{href:fe(`experiments/${encodeURIComponent(n.key)}`)},n.key),S("span",{class:`badge ${n.status==="running"?"good":""}`},n.status),n.goal.event,n.startedAt?Pe(n.startedAt):"not started"]))})]}function ri(e){let t=ie().project,r=S("input",{type:"text",value:e?.key??"",required:!0,pattern:"[A-Za-z0-9][A-Za-z0-9_.-]*",disabled:!!e,placeholder:"new-checkout"}),s=S("input",{type:"text",value:e?.description??"",placeholder:"What this flag controls"}),n=S("input",{type:"checkbox",checked:e?.enabled??!0}),i=S("input",{type:"range",min:0,max:100,step:1,value:e?.rollout??100}),o=S("output",{},`${e?.rollout??100}%`);i.addEventListener("input",()=>{o.textContent=`${i.value}%`});let l=S("input",{type:"text",value:(e?.variants??[]).map(p=>`${p.key}:${p.weight}`).join(", "),placeholder:"control:50, test:50 (leave empty for on/off)"}),u=S("textarea",{rows:5,spellcheck:!1,placeholder:\'[{"conditions":[{"property":"person.plan","value":"pro"}],"rollout":100}]\'},e?.rules?.length?JSON.stringify(e.rules,null,2):""),c=S("div",{}),a=S("form",{class:"stack"},S("label",{class:"field"},S("span",{},"Key"),r),S("label",{class:"field"},S("span",{},"Description"),s),S("label",{class:"switch"},n,"Enabled"),S("label",{class:"field"},S("span",{},"Rollout"),S("div",{class:"range"},i,o)),S("label",{class:"field"},S("span",{},"Variants"),l),S("label",{class:"field"},S("span",{},"Targeting rules (JSON, first match wins)"),u),c,S("div",{class:"form-actions"},S("button",{type:"submit",class:"primary"},e?"Save changes":"Create flag")));return a.addEventListener("submit",async p=>{p.preventDefault();try{let d=l.value.trim()?l.value.split(",").map(m=>{let[f,g]=m.trim().split(":");return{key:f.trim(),weight:Number(g??1)}}):[],h={project:t,description:s.value||void 0,enabled:n.checked,rollout:Number(i.value),variants:d.length?d:void 0,rules:u.value.trim()?JSON.parse(u.value):[]};await W.put(`/api/flags/${encodeURIComponent(r.value)}`,h),Le(e?"Flag saved":"Flag created"),de("flags")}catch(d){J(c,Te(d))}}),a}function si(e){let t=ie().project,r=e.rest[0];return r==="new"?[re("New flag"),G("Definition",ri(null))]:r?[re(r,\'Read it in code with glass.flag(key): "on", a variant key, or null.\',ye(`glass.flag(\'${r}\')`,"Copy code")),le(async()=>{let{flag:s}=await W.get(`/api/flags/${encodeURIComponent(r)}`,{project:t});return G("Definition",ri(s))})]:[re("Flags","Feature flags, evaluated in your Worker. Assignment is stable per device.",S("a",{class:"button primary",href:fe("flags/new")},"New flag")),le(async()=>{let{flags:s}=await W.get("/api/flags",{project:t});return s.length===0?te("No flags yet. Create one here, or ask your agent to use the save_flag tool."):he(["Flag","Status","Rollout","Variants","Rules"],s.map(n=>[S("a",{href:fe(`flags/${encodeURIComponent(n.key)}`)},n.key),S("span",{class:`badge ${n.enabled?"good":""}`},n.enabled?"On":"Off"),`${n.rollout}%`,(n.variants??[]).map(i=>i.key).join(", ")||"on/off",String(n.rules?.length??0)]),{numeric:[2,4]})})]}var ot=["var(--glass-green)","var(--glass-cobalt)","var(--glass-amber)","var(--glass-ruby)","var(--smoke)","var(--glass-teal)"];function Cl(e){if(e<=0)return 1;let t=10**Math.floor(Math.log10(e)),r=e/t;return Math.max(r<=1?1:r<=2?2:r<=5?5:10,t<1?1:0)*t}function El(e){let t=Math.max(1,Cl(e/4)),r=[0];for(;r[r.length-1]<e;)r.push(r[r.length-1]+t);return r.length<2&&r.push(t),r}function Jt(e,t,r,s={}){let i=s.height??220,o={top:12,right:12,bottom:26,left:44},l=760-o.left-o.right,u=i-o.top-o.bottom,c=El(Math.max(0,...t.flatMap(w=>w.values))),a=c[c.length-1],p=w=>o.left+(e.length<=1?l/2:w/(e.length-1)*l),d=w=>o.top+u-w/a*u,h=c.map(w=>ze("g",{},ze("line",{x1:o.left,x2:760-o.right,y1:d(w),y2:d(w),class:"grid"}),ze("text",{x:o.left-8,y:d(w)+4,class:"axis","text-anchor":"end"},ae(w)))),m=Math.max(1,Math.ceil(e.length/8)),f=e.map((w,E)=>E%m===0?ze("text",{x:p(E),y:i-6,class:"axis","text-anchor":"middle"},Yt(w,r)):null),g=t.map((w,E)=>{let M=ot[E%ot.length],k=w.values.map((P,A)=>`${A?"L":"M"}${p(A).toFixed(1)},${d(P).toFixed(1)}`).join(" "),N=E===0&&t.length===1?ze("path",{d:`${k} L${p(w.values.length-1)},${d(0)} L${p(0)},${d(0)} Z`,fill:M,class:"area"}):null;return ze("g",{},N,ze("path",{d:k,stroke:M,class:"line"}))}),b=ze("line",{y1:o.top,y2:o.top+u,class:"cursor",visibility:"hidden"}),v=ze("svg",{viewBox:`0 0 760 ${i}`,class:"chart",role:"img","aria-label":t.map(w=>w.label).join(", ")},...h,...f,...g,b),y=S("div",{class:"readout",hidden:!0}),C=t.length>1?S("ul",{class:"legend"},t.map((w,E)=>S("li",{},S("span",{class:"swatch",style:`background:${ot[E%ot.length]}`}),w.label))):null,x=S("div",{class:"chart-wrap"},v,y,C);return v.addEventListener("mousemove",w=>{let E=w,M=v.getBoundingClientRect(),k=(E.clientX-M.left)/M.width*760,N=Math.max(0,Math.min(e.length-1,Math.round((k-o.left)/l*(e.length-1))));b.setAttribute("x1",String(p(N))),b.setAttribute("x2",String(p(N))),b.setAttribute("visibility","visible"),y.hidden=!1,y.replaceChildren(S("strong",{},Yt(e[N]??0,r)),...t.map((P,A)=>S("span",{},S("span",{class:"swatch",style:`background:${ot[A%ot.length]}`}),`${P.label} ${ae(P.values[N]??0)}`))),y.style.left=`${p(N)/760*100}%`}),v.addEventListener("mouseleave",()=>{b.setAttribute("visibility","hidden"),y.hidden=!0}),x}function ni(e,t){let r=Math.max(1,...e.map(s=>s.value));return S("div",{class:"bar-list"},S("div",{class:"bar-head"},S("span",{},t[0]),S("span",{class:"num"},t[1]),t[2]?S("span",{class:"num"},t[2]):null),e.map(s=>S("div",{class:"bar-row",title:s.label},S("span",{class:"bar-fill",style:`width:${s.value/r*100}%`}),s.href?S("a",{class:"bar-label",href:s.href},s.label):S("span",{class:"bar-label"},s.label),S("span",{class:"num"},ae(s.value)),s.secondary!==void 0?S("span",{class:"num muted"},ae(s.secondary)):null)))}function ii(e){let t=Math.max(1,e[0]?.count??1);return S("ol",{class:"funnel"},e.map((r,s)=>S("li",{},S("div",{class:"funnel-label"},S("span",{class:"step-name"},r.label),S("span",{class:"num"},`${ae(r.count)} (${pe(r.conversionFromStart)})`)),S("div",{class:"funnel-track"},S("div",{class:"funnel-bar",style:`width:${r.count/t*100}%`})),s>0?S("div",{class:"funnel-drop muted"},`${pe(r.conversionFromPrevious)} of the previous step`,r.avgSecondsFromPrevious!==null?`, after ${Math.round(r.avgSecondsFromPrevious)}s on average`:""):null)))}function oi(e,t,r){let s=t.length,n=(i,o)=>S("td",{class:"num heat",style:`--heat:${Math.round(i*100)}`,title:`${ae(o)} people`},pe(i,0));return S("div",{class:"table-wrap"},S("table",{class:"retention"},S("thead",{},S("tr",{},S("th",{},"Cohort"),S("th",{class:"num"},"People"),Array.from({length:s},(i,o)=>S("th",{class:"num"},`${r[0].toUpperCase()}${o}`)))),S("tbody",{},S("tr",{class:"average"},S("td",{},"Average"),S("td",{},""),t.map(i=>n(i,0))),e.map(i=>S("tr",{},S("td",{},Yt(i.start,r==="month"?"month":"day")),S("td",{class:"num"},ae(i.size)),i.rates.map((o,l)=>n(o,i.counts[l]??0)))))))}var ai={trends:{series:[{event:"$pageview",math:"total"}],interval:"day"},funnel:{steps:[{event:"$pageview"},{event:""}],window:"7d"},retention:{cohortEvent:{event:"$pageview"},returnEvent:{event:"$pageview"},period:"week",periods:8}},li=null;function Rl(e){return li??=W.get("/api/events",{project:e}).then(t=>t.events.map(r=>r.event)).catch(()=>[]),li}function Qt(e,t,r){let s=S("input",{type:"text",value:e,list:"glass-events",placeholder:"event name","aria-label":r,required:!0});return s.addEventListener("input",()=>t(s.value)),s}function Mt(e,t,r,s){let n=S("input",{type:"text",value:e??"",placeholder:t,"aria-label":s});return n.addEventListener("input",()=>r(n.value)),n}function Br(e,t,r,s){let n=S("select",{"aria-label":s},t.map(([i,o])=>S("option",{value:i,selected:i===e},o)));return n.addEventListener("change",()=>r(n.value)),n}function _e(e,t){return S("label",{class:"field"},S("span",{},e),t)}function Ml(e,t,r){if(e==="trends"){let i=t.series;return S("div",{class:"form-row"},i.map((o,l)=>S("div",{class:"series-row"},_e(`Event ${i.length>1?l+1:""}`,Qt(o.event,u=>o.event=u,"Event")),_e("Measure",Br(o.math??"total",[["total","Total count"],["unique_persons","Unique people"],["unique_sessions","Unique sessions"],["sum","Sum of property"],["avg","Average of property"]],u=>{o.math=u,r()},"Measure")),o.math==="sum"||o.math==="avg"?_e("Property",Mt(o.property,"amount",u=>o.property=u,"Property")):null,i.length>1?S("button",{type:"button",class:"ghost small",onclick:()=>{i.splice(l,1),r()}},"Remove"):null)),S("button",{type:"button",class:"ghost small",onclick:()=>{i.push({event:"",math:"total"}),r()}},"Add series"),_e("Interval",Br(String(t.interval??"day"),[["hour","Hour"],["day","Day"],["week","Week"],["month","Month"]],o=>t.interval=o,"Interval")),_e("Break down by",Mt(t.breakdown,"browser, utm_source, person.plan",o=>t.breakdown=o||void 0,"Breakdown")))}if(e==="funnel"){let i=t.steps;return S("div",{class:"form-row"},S("ol",{class:"steps-editor"},i.map((o,l)=>S("li",{},Qt(o.event,u=>o.event=u,`Step ${l+1}`),i.length>2?S("button",{type:"button",class:"ghost small",onclick:()=>{i.splice(l,1),r()}},"Remove"):null))),S("button",{type:"button",class:"ghost small",onclick:()=>{i.push({event:""}),r()}},"Add step"),_e("Within",Mt(String(t.window??"7d"),"7d",o=>t.window=o,"Conversion window")),_e("Break down by",Mt(t.breakdown,"utm_source",o=>t.breakdown=o||void 0,"Breakdown")))}let s=t.cohortEvent,n=t.returnEvent;return S("div",{class:"form-row"},_e("First did",Qt(s.event,i=>s.event=i,"Cohort event")),_e("Came back and did",Qt(n.event,i=>n.event=i,"Return event")),_e("Period",Br(String(t.period??"week"),[["day","Day"],["week","Week"],["month","Month"]],i=>t.period=i,"Period")),_e("Periods",Mt(String(t.periods??8),"8",i=>t.periods=Number(i)||8,"Number of periods")))}function Nl(e,t){if(e==="trends"){let s=t;return S("div",{},Jt(s.buckets,s.series.map(n=>({label:n.label,values:n.values})),s.interval),he(["Series","Total"],s.series.map(n=>[n.label,ae(n.total)]),{numeric:[1]}))}if(e==="funnel"){let s=t;return s.steps[0]?.count?S("div",{},ii(s.steps),s.breakdowns?he(["Value",...s.steps.map(n=>n.label),"Conversion"],s.breakdowns.map(n=>[n.value,...n.steps.map(i=>ae(i.count)),pe(n.steps[n.steps.length-1].conversionFromStart)]),{numeric:s.steps.map((n,i)=>i+1).concat(s.steps.length+1)}):null):te("No one did the first step in this period.")}let r=t;return r.cohorts.length?oi(r.cohorts,r.average,r.period):te("No one in any cohort for this period.")}function ui(e){let t=["trends","funnel","retention"].includes(e.rest[0]??"")?e.rest[0]:"trends",r;try{r=e.params.get("spec")?JSON.parse(e.params.get("spec")):structuredClone(ai[t])}catch{r=structuredClone(ai[t])}let s=ie(),n=S("form",{class:"builder"}),i=S("div",{class:"insight-output"}),o=S("datalist",{id:"glass-events"});Rl(s.project).then(p=>J(o,p.map(d=>S("option",{value:d}))));let l=()=>({kind:t,...r,from:r.from??s.from,to:r.to??s.to,project:s.project}),u=()=>J(n,Ml(t,r,u),S("div",{class:"form-actions"},S("button",{type:"submit",class:"primary"},"Run query"))),c=async()=>{J(i,Ct("Running query"));try{let p=l(),d=await W.post("/api/query",p),{kind:h,project:m,...f}=p,g=`Using the Glass MCP tool query_${t}, run ${JSON.stringify(f)} and explain what it shows.`;J(i,G("Result",[S("p",{class:"summary"},d.summary),Nl(t,d)],{sql:d.sql,actions:[ye(g,"Copy as agent prompt"),ye(()=>location.href,"Copy link")]})),history.replaceState(null,"",`#/insights/${t}?${new URLSearchParams({...Object.fromEntries(e.params),spec:JSON.stringify(r)})}`)}catch(p){J(i,Te(p))}};return n.addEventListener("submit",p=>{p.preventDefault(),c()}),u(),(t==="funnel"?r.steps.every(p=>p.event):!0)?c():J(i,te("Pick the events for each step, then run the query.")),[re("Insights","Trends, funnels and retention over any event."),Gt([{value:"trends",label:"Trends"},{value:"funnel",label:"Funnel"},{value:"retention",label:"Retention"}],t,p=>de(`insights/${p}`,{spec:null})),o,n,i]}var ci=e=>Object.entries(e).slice(0,3).map(([t,r])=>`${t}: ${typeof r=="object"?JSON.stringify(r):String(r)}`).join(", ");function Ol(e){let t=e.params.get("q")??"",r=S("input",{type:"search",value:t,placeholder:"Search by id or property value","aria-label":"Search people"}),s=S("form",{class:"search",role:"search"},r,S("button",{type:"submit",class:"ghost"},"Search"));return s.addEventListener("submit",n=>{n.preventDefault(),de("users",{q:r.value})}),[re("People","Everyone you have identified with glass.identify(), most recently active first."),s,le(async()=>{let n=await W.get("/api/persons",{project:ie().project,query:t,limit:100});return n.persons.length===0?te(t?`No one matches "${t}".`:"No identified people yet. Call glass.identify(userId) after login to see users here."):he(["Person","Properties","Last seen"],n.persons.map(i=>[S("a",{href:fe(`users/${encodeURIComponent(i.id)}`)},i.id),S("span",{class:"muted"},ci(i.properties)),Rt(i.lastSeen)]))})]}function Il(e){return[le(async()=>{let t=await W.get(`/api/persons/${encodeURIComponent(e)}`,{project:ie().project});return[re(t.id,t.summary,ye(t.id,"Copy id")),S("div",{class:"grid-2"},G("Properties",Object.keys(t.properties).length?S("dl",{class:"props"},Object.entries(t.properties).map(([r,s])=>[S("dt",{},r),S("dd",{},typeof s=="object"?JSON.stringify(s):String(s))])):te(t.identified?"No properties set.":"Anonymous device: identify() has not been called.")),G("Devices and sessions",S("div",{},S("p",{class:"muted"},`First seen ${t.firstSeen?Pe(t.firstSeen):"never"}, last seen ${t.lastSeen?Rt(t.lastSeen):"never"}.`),t.devices.length?S("p",{},`${t.devices.length} linked device${t.devices.length===1?"":"s"}.`):null,t.replays.length?S("ul",{class:"plain"},t.replays.map(r=>S("li",{},S("a",{href:fe(`replays/${r.session}`)},Pe(r.started)),r.errors?S("span",{class:"badge bad"},`${r.errors} errors`):null))):S("p",{class:"muted"},"No recorded sessions.")))),G("Recent events",t.recentEvents.length?he(["Time","Event","Page","Properties"],t.recentEvents.map(r=>[Pe(r.time),S("code",{},r.event),r.path,S("span",{class:"muted"},ci(r.properties))])):te("No events in the last 90 days."),{sql:t.sql})]})]}function di(e){return e.rest[0]?Il(e.rest[0]):Ol(e)}var kl=Object.defineProperty,Tl=(e,t,r)=>t in e?kl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,O=(e,t,r)=>Tl(e,typeof t!="symbol"?t+"":t,r),hi,Dl=Object.defineProperty,Al=(e,t,r)=>t in e?Dl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pi=(e,t,r)=>Al(e,typeof t!="symbol"?t+"":t,r),B=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(B||{}),fi={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},mi={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ot={},Xs={},gi=0,Ll=()=>!!globalThis.Zone;function Rn(e){if(Ot[e])return Ot[e];let t=globalThis[e],r=t.prototype,s=e in fi?fi[e]:void 0,n=!!(s&&s.every(l=>{var u,c;return!!((c=(u=Object.getOwnPropertyDescriptor(r,l))==null?void 0:u.get)!=null&&c.toString().includes("[native code]"))})),i=e in mi?mi[e]:void 0,o=!!(i&&i.every(l=>{var u;return typeof r[l]=="function"&&((u=r[l])==null?void 0:u.toString().includes("[native code]"))}));if(n&&o&&!Ll())return Ot[e]=t.prototype,t.prototype;try{let l=document.createElement("iframe");l.style.display="none",document.body.appendChild(l);let u=l.contentWindow;if(!u)return t.prototype;let c=u[e].prototype;if(!c)return l.remove(),r;let a=navigator.userAgent;return a.includes("Safari")&&!a.includes("Chrome")?(l.classList.add("rr-block"),l.setAttribute("__rrwebUntaintedMutationObserver",""),Xs[e]=()=>l.remove()):l.remove(),Ot[e]=c}catch{return r}}var jr={};function Me(e,t,r){var s,n;let i=(s=jr[e])==null?void 0:s[r];if(i)return i.call(t);let o=Rn(e),l=(n=Object.getOwnPropertyDescriptor(o,r))==null?void 0:n.get;return l?((jr[e]||(jr[e]={}))[r]=l,l.call(t)):t[r]}var zr={};function ra(e,t,r){let s=`${e}.${String(r)}`;if(zr[s])return zr[s].bind(t);let i=Rn(e)[r];return typeof i!="function"?t[r]:(zr[s]=i,i.bind(t))}function Pl(e){return Me("Node",e,"ownerDocument")}function _l(e){return Me("Node",e,"childNodes")}function $l(e){return Me("Node",e,"parentNode")}function Fl(e){return Me("Node",e,"parentElement")}function Ul(e){return Me("Node",e,"textContent")}function Bl(e){return Me("Node",e,"firstChild")}function jl(e){return Me("Node",e,"lastChild")}function zl(e){return Me("Node",e,"nextSibling")}function Wl(e){return Me("Node",e,"previousSibling")}function ql(e,t){return ra("Node",e,"contains")(t)}function Vl(e){return ra("Node",e,"getRootNode")()}function Hl(e){return!e||!("host"in e)?null:Me("ShadowRoot",e,"host")}function Gl(e){return e.styleSheets}function Yl(e){return!e||!("shadowRoot"in e)?null:Me("Element",e,"shadowRoot")}function Jl(e,t){return Me("Element",e,"querySelector")(t)}function Ql(e,t){return Me("Element",e,"querySelectorAll")(t)}function Xl(){let e=Rn("MutationObserver");gi++;let t=!1;return[e.constructor,()=>{if(t||(t=!0,--gi!==0))return;let r=Xs.MutationObserver;if(r)try{r()}finally{delete Ot.MutationObserver,delete Xs.MutationObserver}}]}var sa=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(sa=()=>new Date().getTime());function Kl(e,t,r){try{if(!(t in e))return()=>{};let s=e[t],n=r(s);return typeof n=="function"&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:s}})),e[t]=n,()=>{e[t]=s}}catch{return()=>{}}}var me={ownerDocument:Pl,childNodes:_l,parentNode:$l,parentElement:Fl,textContent:Ul,firstChild:Bl,lastChild:jl,nextSibling:zl,previousSibling:Wl,contains:ql,getRootNode:Vl,host:Hl,styleSheets:Gl,shadowRoot:Yl,querySelector:Jl,querySelectorAll:Ql,nowTimestamp:sa,mutationObserverCtor:Xl,patch:Kl};function Mn(e){return e.nodeType===e.ELEMENT_NODE}function At(e){let t=e&&"host"in e&&"mode"in e&&me.host(e)||null;return!!(t&&"shadowRoot"in t&&me.shadowRoot(t)===e)}function Lt(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Zl(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\\sbackground-clip:\\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function eu(e){let{cssText:t}=e;if(t.split(\'"\').length<3)return t;let r=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function Ks(e){try{let t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);let s=Array.from(t,n=>na(n,r)).join("");return Zl(s)}catch{return null}}function na(e,t){if(ru(e)){let r;try{r=Ks(e.styleSheet)||eu(e)}catch{r=e.cssText}return e.styleSheet.href?ur(r,e.styleSheet.href):r}else{let r=e.cssText;return su(e)&&e.selectorText.includes(":")&&(r=tu(r)),t?ur(r,t):r}}function tu(e){let t=/(\\[(?:[\\w-]+)[^\\\\])(:(?:[\\w-]+)\\])/gm;return e.replace(t,"$1\\\\$2")}function ru(e){return"styleSheet"in e}function su(e){return"selectorText"in e}var Ft=class{constructor(){pi(this,"idNodeMap",new Map),pi(this,"nodeMetaMap",new WeakMap)}getId(t){var r;return t?((r=this.getMeta(t))==null?void 0:r.id)??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){let r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n));let s=me.shadowRoot(t);s&&this.removeNodeFromMap(s)}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let s=r.id;this.idNodeMap.set(s,t),this.nodeMetaMap.set(t,r)}replace(t,r){let s=this.getNode(t);if(s){let n=this.nodeMetaMap.get(s);n&&this.nodeMetaMap.set(r,n)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function ia(){return new Ft}function ar({element:e,maskInputOptions:t,tagName:r,type:s,value:n,maskInputFn:i}){let o=n||"",l=s&&He(s);return(t[r.toLowerCase()]||l&&t[l])&&(i?o=i(o,e):o="*".repeat(o.length)),o}function He(e){return e.toLowerCase()}var yi="__rrweb_original__";function nu(e){let t=e.getContext("2d");if(!t)return!0;let r=50;for(let s=0;s<e.width;s+=r)for(let n=0;n<e.height;n+=r){let i=t.getImageData,o=yi in i?i[yi]:i;if(new Uint32Array(o.call(t,s,n,Math.min(r,e.width-s),Math.min(r,e.height-n)).data.buffer).some(u=>u!==0))return!1}return!0}function iu(e,t){return!e||!t||e.type!==t.type?!1:e.type===B.Document?e.compatMode===t.compatMode:e.type===B.DocumentType?e.name===t.name&&e.publicId===t.publicId&&e.systemId===t.systemId:e.type===B.Comment||e.type===B.Text||e.type===B.CDATA?e.textContent===t.textContent:e.type===B.Element?e.tagName===t.tagName&&JSON.stringify(e.attributes)===JSON.stringify(t.attributes)&&e.isSVG===t.isSVG&&e.needBlock===t.needBlock:!1}function lr(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?He(t):null}function Nn(e,t){let r;try{r=new URL(e,t??window.location.href)}catch{return null}let s=/\\.([0-9a-z]+)(?:$)/i,n=r.pathname.match(s);return n?.[1]??null}function ou(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var au=/url\\((?:(\')([^\']*)\'|(")(.*?)"|([^)]*))\\)/gm,lu=/^(?:[a-z+]+:)?\\/\\//i,uu=/^www\\..*/i,cu=/^(data:)([^,]*),(.*)/i;function ur(e,t){return(e||"").replace(au,(r,s,n,i,o,l)=>{let u=n||o||l,c=s||i||"";if(!u)return r;if(lu.test(u)||uu.test(u))return`url(${c}${u}${c})`;if(cu.test(u))return`url(${c}${u}${c})`;if(u[0]==="/")return`url(${c}${ou(t)+u}${c})`;let a=u.split("#")[0],p=u.substring(a.length),d=t.split("#")[0].split("/"),h=a.split("/");d.pop();for(let m of h)m!=="."&&(m===".."?d.pop():d.push(m));return`url(${c}${d.join("/")}${p}${c})`})}var oa="(?:/\\\\*[^*]*\\\\*/)|[\\\\s;]",du=new RegExp(`${oa}|\\\\b(0)px?`,"g"),hu=new RegExp(oa,"g");function Xt(e,t=!1){return t?e.replace(hu,""):e.replace(du,"$1")}function pu(e,t,r=!1){let s=Array.from(t.childNodes),n=[],i=0;if(s.length>1&&e&&typeof e=="string"){let o=Xt(e,r),l=o.length/e.length;for(let u=1;u<s.length;u++)if(s[u].textContent&&typeof s[u].textContent=="string"){let c=Xt(s[u].textContent,r),a=100,p=3;for(;p<c.length&&(c[p].match(/[a-zA-Z0-9]/)||c.indexOf(c.substring(0,p),1)!==-1);p++);for(;p<c.length;p++){let d=c.substring(0,p),h=o.split(d),m=-1;if(h.length===2)m=h[0].length;else if(h.length>2&&h[0]===""&&s[u-1].textContent!=="")m=o.indexOf(d,1);else if(h.length===1){if(d=d.substring(0,d.length-1),h=o.split(d),h.length<=1)return n.push(e),n;p=a+1}else p===c.length-1&&(m=o.indexOf(d));if(h.length>=2&&p>a){let f=s[u-1].textContent;if(f&&typeof f=="string"){let g=Xt(f).length;m=o.indexOf(d,g)}m===-1&&(m=h[0].length)}if(m!==-1){let f=Math.floor(m/l);for(;f>0&&f<e.length;){if(i+=1,i>50*s.length)return n.push(e),n;let g=Xt(e.substring(0,f),r);if(g.length===m){n.push(e.substring(0,f)),e=e.substring(f),o=o.substring(m);break}else g.length<m?f+=Math.max(1,Math.floor((m-g.length)/l)):f-=Math.max(1,Math.floor((g.length-m)*l))}break}}}}return n.push(e),n}function fu(e,t){return pu(e,t).join("/* rr_split */")}var mu=1,gu=new RegExp("[^a-z0-9-_:]"),cr=-2;function aa(){return mu++}function yu(e){if(e instanceof HTMLFormElement)return"form";let t=He(e.tagName);return gu.test(t)?"div":t}var at,bi,bu=/^[^ \\t\\n\\r\\u000c]+/,vu=/^[, \\t\\n\\r\\u000c]+/;function wu(e,t){if(t.trim()==="")return t;let r=0;function s(i){let o,l=i.exec(t.substring(r));return l?(o=l[0],r+=o.length,o):""}let n=[];for(;s(vu),!(r>=t.length);){let i=s(bu);if(i.slice(-1)===",")i=dt(e,i.substring(0,i.length-1)),n.push(i);else{let o="";i=dt(e,i);let l=!1;for(;;){let u=t.charAt(r);if(u===""){n.push((i+o).trim());break}else if(l)u===")"&&(l=!1);else if(u===","){r+=1,n.push((i+o).trim());break}else u==="("&&(l=!0);o+=u,r+=1}}}return n.join(", ")}var vi=new WeakMap;function dt(e,t){return!t||t.trim()===""?t:On(e,t)}function Su(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function On(e,t){let r=vi.get(e);if(r||(r=e.createElement("a"),vi.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function la(e,t,r,s){return s&&(r==="src"||r==="href"&&!(t==="use"&&s[0]==="#")||r==="xlink:href"&&s[0]!=="#"||r==="background"&&["table","td","th"].includes(t)?dt(e,s):r==="srcset"?wu(e,s):r==="style"?ur(s,On(e)):t==="object"&&r==="data"?dt(e,s):s)}function ua(e,t,r){return["video","audio"].includes(e)&&He(t)==="autoplay"}function xu(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let s=e.classList.length;s--;){let n=e.classList[s];if(t.test(n))return!0}if(r)return e.matches(r)}catch{}return!1}function dr(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?dr(me.parentNode(e),t,r):!1;for(let s=e.classList.length;s--;){let n=e.classList[s];if(t.test(n))return!0}return r?dr(me.parentNode(e),t,r):!1}function ca(e,t,r,s){let n;if(Mn(e)){if(n=e,!me.childNodes(n).length)return!1}else{if(me.parentElement(e)===null)return!1;n=me.parentElement(e)}try{if(typeof t=="string"){if(s){if(n.closest(`.${t}`))return!0}else if(n.classList.contains(t))return!0}else if(dr(n,t,s))return!0;if(r){if(s){if(n.closest(r))return!0}else if(n.matches(r))return!0}}catch{}return!1}function Cu(e,t,r){let s=e.contentWindow;if(!s)return;let n=!1,i;try{i=s.document.readyState}catch{return}if(i!=="complete"){let l=setTimeout(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{clearTimeout(l),n=!0,t()});return}let o="about:blank";if(s.location.href!==o||e.src===o||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function Eu(e,t,r){let s=!1,n;try{n=e.sheet}catch{return}if(n)return;let i=setTimeout(()=>{s||(t(),s=!0)},r);e.addEventListener("load",()=>{clearTimeout(i),s=!0,t()})}function Ru(e,t){let{doc:r,mirror:s,blockClass:n,blockSelector:i,needsMask:o,inlineStylesheet:l,maskInputOptions:u={},maskTextFn:c,maskInputFn:a,dataURLOptions:p={},inlineImages:d,recordCanvas:h,keepIframeSrcFn:m,newlyAddedElement:f=!1,cssCaptured:g=!1}=t,b=Mu(r,s);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:B.Document,childNodes:[],compatMode:e.compatMode}:{type:B.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:B.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:b};case e.ELEMENT_NODE:return Ou(e,{doc:r,blockClass:n,blockSelector:i,inlineStylesheet:l,maskInputOptions:u,maskInputFn:a,dataURLOptions:p,inlineImages:d,recordCanvas:h,keepIframeSrcFn:m,newlyAddedElement:f,rootId:b});case e.TEXT_NODE:return Nu(e,{doc:r,needsMask:o,maskTextFn:c,rootId:b,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:B.CDATA,textContent:"",rootId:b};case e.COMMENT_NODE:return{type:B.Comment,textContent:me.textContent(e)||"",rootId:b};default:return!1}}function Mu(e,t){if(!t.hasNode(e))return;let r=t.getId(e);return r===1?void 0:r}function Nu(e,t){let{needsMask:r,maskTextFn:s,rootId:n,cssCaptured:i}=t,o=me.parentNode(e),l=o&&o.tagName,u="",c=l==="STYLE"?!0:void 0,a=l==="SCRIPT"?!0:void 0;return a?u="SCRIPT_PLACEHOLDER":i||(u=me.textContent(e),c&&u&&(u=ur(u,On(t.doc)))),!c&&!a&&u&&r&&(u=s?s(u,me.parentElement(e)):u.replace(/[\\S]/g,"*")),{type:B.Text,textContent:u||"",rootId:n}}function Ou(e,t){let{doc:r,blockClass:s,blockSelector:n,inlineStylesheet:i,maskInputOptions:o={},maskInputFn:l,dataURLOptions:u={},inlineImages:c,recordCanvas:a,keepIframeSrcFn:p,newlyAddedElement:d=!1,rootId:h}=t,m=xu(e,s,n),f=yu(e),g={},b=e.attributes.length;for(let y=0;y<b;y++){let C=e.attributes[y];ua(f,C.name,C.value)||(g[C.name]=la(r,f,He(C.name),C.value))}if(f==="link"&&i){let y=Array.from(r.styleSheets).find(x=>x.href===e.href),C=null;y&&(C=Ks(y)),C&&(delete g.rel,delete g.href,g._cssText=C)}if(f==="style"&&e.sheet){let y=Ks(e.sheet);y&&(e.childNodes.length>1&&(y=fu(y,e)),g._cssText=y)}if(["input","textarea","select"].includes(f)){let y=e.value,C=e.checked;g.type!=="radio"&&g.type!=="checkbox"&&g.type!=="submit"&&g.type!=="button"&&y?g.value=ar({element:e,type:lr(e),tagName:f,value:y,maskInputOptions:o,maskInputFn:l}):C&&(g.checked=C)}if(f==="option"&&(e.selected&&!o.select?g.selected=!0:delete g.selected),f==="dialog"&&e.open&&(g.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),f==="canvas"&&a){if(e.__context==="2d")nu(e)||(g.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){let y=e.toDataURL(u.type,u.quality),C=r.createElement("canvas");C.width=e.width,C.height=e.height;let x=C.toDataURL(u.type,u.quality);y!==x&&(g.rr_dataURL=y)}}if(f==="img"&&c){at||(at=r.createElement("canvas"),bi=at.getContext("2d"));let y=e,C=y.currentSrc||y.getAttribute("src")||"<unknown-src>",x=y.crossOrigin,w=()=>{y.removeEventListener("load",w);try{at.width=y.naturalWidth,at.height=y.naturalHeight,bi.drawImage(y,0,0),g.rr_dataURL=at.toDataURL(u.type,u.quality)}catch(E){if(y.crossOrigin!=="anonymous"){y.crossOrigin="anonymous",y.complete&&y.naturalWidth!==0?w():y.addEventListener("load",w);return}else console.warn(`Cannot inline img src=${C}! Error: ${E}`)}y.crossOrigin==="anonymous"&&(x?g.crossOrigin=x:y.removeAttribute("crossorigin"))};y.complete&&y.naturalWidth!==0?w():y.addEventListener("load",w)}if(["audio","video"].includes(f)){let y=g;y.rr_mediaState=e.paused?"paused":"played",y.rr_mediaCurrentTime=e.currentTime,y.rr_mediaPlaybackRate=e.playbackRate,y.rr_mediaMuted=e.muted,y.rr_mediaLoop=e.loop,y.rr_mediaVolume=e.volume}if(d||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop)),m){let{width:y,height:C}=e.getBoundingClientRect();g={class:g.class,rr_width:`${y}px`,rr_height:`${C}px`}}f==="iframe"&&!p(g.src)&&(e.contentDocument||(g.rr_src=g.src),delete g.src);let v;try{customElements.get(f)&&(v=!0)}catch{}return{type:B.Element,tagName:f,attributes:g,childNodes:[],isSVG:Su(e)||void 0,needBlock:m,rootId:h,isCustom:v}}function X(e){return e==null?"":e.toLowerCase()}function da(e){return e===!0||e==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:e==="all",headMetaDescKeywords:e==="all",headTitleMutations:e==="all"}:e||{}}function Iu(e,t){if(t.comment&&e.type===B.Comment)return!0;if(e.type===B.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Nn(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(X(e.attributes.name).match(/^msapplication-tile(image|color)$/)||X(e.attributes.name)==="application-name"||X(e.attributes.rel)==="icon"||X(e.attributes.rel)==="apple-touch-icon"||X(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&X(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(X(e.attributes.property).match(/^(og|twitter|fb):/)||X(e.attributes.name).match(/^(og|twitter):/)||X(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(X(e.attributes.name)==="robots"||X(e.attributes.name)==="googlebot"||X(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(X(e.attributes.name)==="author"||X(e.attributes.name)==="generator"||X(e.attributes.name)==="framework"||X(e.attributes.name)==="publisher"||X(e.attributes.name)==="progid"||X(e.attributes.property).match(/^article:/)||X(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(X(e.attributes.name)==="google-site-verification"||X(e.attributes.name)==="yandex-verification"||X(e.attributes.name)==="csrf-token"||X(e.attributes.name)==="p:domain_verify"||X(e.attributes.name)==="verify-v1"||X(e.attributes.name)==="verification"||X(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function ht(e,t){let{doc:r,mirror:s,blockClass:n,blockSelector:i,maskTextClass:o,maskTextSelector:l,skipChild:u=!1,inlineStylesheet:c=!0,maskInputOptions:a={},maskTextFn:p,maskInputFn:d,slimDOMOptions:h,dataURLOptions:m={},inlineImages:f=!1,recordCanvas:g=!1,onSerialize:b,onIframeLoad:v,iframeLoadTimeout:y=5e3,onStylesheetLoad:C,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:w=()=>!1,newlyAddedElement:E=!1,cssCaptured:M=!1}=t,{needsMask:k}=t,{preserveWhiteSpace:N=!0}=t;k||(k=ca(e,o,l,k===void 0));let P=Ru(e,{doc:r,mirror:s,blockClass:n,blockSelector:i,needsMask:k,inlineStylesheet:c,maskInputOptions:a,maskTextFn:p,maskInputFn:d,dataURLOptions:m,inlineImages:f,recordCanvas:g,keepIframeSrcFn:w,newlyAddedElement:E,cssCaptured:M});if(!P)return console.warn(e,"not serialized"),null;let A;s.hasNode(e)?A=s.getId(e):Iu(P,h)||!N&&P.type===B.Text&&!P.textContent.replace(/^\\s+|\\s+$/gm,"").length?A=cr:A=aa();let R=Object.assign(P,{id:A});if(s.add(e,R),A===cr)return null;b&&b(e);let Ce=!u;if(R.type===B.Element){Ce=Ce&&!R.needBlock,delete R.needBlock;let V=me.shadowRoot(e);V&&Lt(V)&&(R.isShadowHost=!0)}if((R.type===B.Document||R.type===B.Element)&&Ce){h.headWhitespace&&R.type===B.Element&&R.tagName==="head"&&(N=!1);let V={doc:r,mirror:s,blockClass:n,blockSelector:i,needsMask:k,maskTextClass:o,maskTextSelector:l,skipChild:u,inlineStylesheet:c,maskInputOptions:a,maskTextFn:p,maskInputFn:d,slimDOMOptions:h,dataURLOptions:m,inlineImages:f,recordCanvas:g,preserveWhiteSpace:N,onSerialize:b,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:C,stylesheetLoadTimeout:x,keepIframeSrcFn:w,cssCaptured:!1};if(!(R.type===B.Element&&R.tagName==="textarea"&&R.attributes.value!==void 0)){R.type===B.Element&&R.attributes._cssText!==void 0&&typeof R.attributes._cssText=="string"&&(V.cssCaptured=!0);for(let K of Array.from(me.childNodes(e))){let ue=ht(K,V);ue&&R.childNodes.push(ue)}}let _=null;if(Mn(e)&&(_=me.shadowRoot(e)))for(let K of Array.from(me.childNodes(_))){let ue=ht(K,V);ue&&(Lt(_)&&(ue.isShadow=!0),R.childNodes.push(ue))}}let be=me.parentNode(e);return be&&At(be)&&Lt(be)&&(R.isShadow=!0),R.type===B.Element&&R.tagName==="iframe"&&Cu(e,()=>{let V=e.contentDocument;if(V&&v){let _=ht(V,{doc:V,mirror:s,blockClass:n,blockSelector:i,needsMask:k,maskTextClass:o,maskTextSelector:l,skipChild:!1,inlineStylesheet:c,maskInputOptions:a,maskTextFn:p,maskInputFn:d,slimDOMOptions:h,dataURLOptions:m,inlineImages:f,recordCanvas:g,preserveWhiteSpace:N,onSerialize:b,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:C,stylesheetLoadTimeout:x,keepIframeSrcFn:w});_&&v(e,_)}},y),R.type===B.Element&&R.tagName==="link"&&typeof R.attributes.rel=="string"&&(R.attributes.rel==="stylesheet"||R.attributes.rel==="preload"&&typeof R.attributes.href=="string"&&Nn(R.attributes.href)==="css")&&Eu(e,()=>{if(C){let V=ht(e,{doc:r,mirror:s,blockClass:n,blockSelector:i,needsMask:k,maskTextClass:o,maskTextSelector:l,skipChild:!1,inlineStylesheet:c,maskInputOptions:a,maskTextFn:p,maskInputFn:d,slimDOMOptions:h,dataURLOptions:m,inlineImages:f,recordCanvas:g,preserveWhiteSpace:N,onSerialize:b,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:C,stylesheetLoadTimeout:x,keepIframeSrcFn:w});V&&C(e,V)}},x),R}function ku(e,t){let{mirror:r=new Ft,blockClass:s="rr-block",blockSelector:n=null,maskTextClass:i="rr-mask",maskTextSelector:o=null,inlineStylesheet:l=!0,inlineImages:u=!1,recordCanvas:c=!1,maskAllInputs:a=!1,maskTextFn:p,maskInputFn:d,slimDOM:h=!1,dataURLOptions:m,preserveWhiteSpace:f,onSerialize:g,onIframeLoad:b,iframeLoadTimeout:v,onStylesheetLoad:y,stylesheetLoadTimeout:C,keepIframeSrcFn:x=()=>!1}=t,w=a===!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}:a===!1?{password:!0}:a,E=da(h);return ht(e,{doc:e,mirror:r,blockClass:s,blockSelector:n,maskTextClass:i,maskTextSelector:o,skipChild:!1,inlineStylesheet:l,maskInputOptions:w,maskTextFn:p,maskInputFn:d,slimDOMOptions:E,dataURLOptions:m,inlineImages:u,recordCanvas:c,preserveWhiteSpace:f,onSerialize:g,onIframeLoad:b,iframeLoadTimeout:v,onStylesheetLoad:y,stylesheetLoadTimeout:C,keepIframeSrcFn:x,newlyAddedElement:!1})}var Tu=/(max|min)-device-(width|height)/,wi=new RegExp(Tu.source,"g"),Du={postcssPlugin:"postcss-custom-selectors",prepare(){return{postcssPlugin:"postcss-custom-selectors",AtRule:function(e){e.params.match(wi)&&(e.params=e.params.replace(wi,"$1-$2"))}}}},Au={postcssPlugin:"postcss-hover-classes",prepare:function(){let e=[];return{Rule:function(t){e.indexOf(t)===-1&&(e.push(t),t.selectors.forEach(function(r){r.includes(":hover")&&(t.selector+=`,\n`+r.replace(/:hover/g,".\\\\:hover"))}))}}}};function Lu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Pu(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function s(){return this instanceof s?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(s){var n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(r,s,n.get?n:{enumerable:!0,get:function(){return e[s]}})}),r}var Kt={exports:{}},Si;function _u(){if(Si)return Kt.exports;Si=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return Kt.exports=t(),Kt.exports.createColors=t,Kt.exports}var $u={},Fu=Object.freeze(Object.defineProperty({__proto__:null,default:$u},Symbol.toStringTag,{value:"Module"})),$e=Pu(Fu),Wr,xi;function In(){if(xi)return Wr;xi=1;let e=_u(),t=$e;class r extends Error{constructor(n,i,o,l,u,c){super(n),this.name="CssSyntaxError",this.reason=n,u&&(this.file=u),l&&(this.source=l),c&&(this.plugin=c),typeof i<"u"&&typeof o<"u"&&(typeof i=="number"?(this.line=i,this.column=o):(this.line=i.line,this.column=i.column,this.endLine=o.line,this.endColumn=o.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(n){if(!this.source)return"";let i=this.source;n==null&&(n=e.isColorSupported),t&&n&&(i=t(i));let o=i.split(/\\r?\\n/),l=Math.max(this.line-3,0),u=Math.min(this.line+2,o.length),c=String(u).length,a,p;if(n){let{bold:d,gray:h,red:m}=e.createColors(!0);a=f=>d(m(f)),p=f=>h(f)}else a=p=d=>d;return o.slice(l,u).map((d,h)=>{let m=l+1+h,f=" "+(" "+m).slice(-c)+" | ";if(m===this.line){let g=p(f.replace(/\\d/g," "))+d.slice(0,this.column-1).replace(/[^\\t]/g," ");return a(">")+p(f)+d+`\n `+g+a("^")}return" "+p(f)+d}).join(`\n`)}toString(){let n=this.showSourceCode();return n&&(n=`\n\n`+n+`\n`),this.name+": "+this.message+n}}return Wr=r,r.default=r,Wr}var Zt={},Ci;function kn(){return Ci||(Ci=1,Zt.isClean=Symbol("isClean"),Zt.my=Symbol("my")),Zt}var qr,Ei;function ha(){if(Ei)return qr;Ei=1;let e={after:`\n`,beforeClose:`\n`,beforeComment:`\n`,beforeDecl:`\n`,beforeOpen:" ",beforeRule:`\n`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function t(s){return s[0].toUpperCase()+s.slice(1)}class r{constructor(n){this.builder=n}atrule(n,i){let o="@"+n.name,l=n.params?this.rawValue(n,"params"):"";if(typeof n.raws.afterName<"u"?o+=n.raws.afterName:l&&(o+=" "),n.nodes)this.block(n,o+l);else{let u=(n.raws.between||"")+(i?";":"");this.builder(o+l+u,n)}}beforeAfter(n,i){let o;n.type==="decl"?o=this.raw(n,null,"beforeDecl"):n.type==="comment"?o=this.raw(n,null,"beforeComment"):i==="before"?o=this.raw(n,null,"beforeRule"):o=this.raw(n,null,"beforeClose");let l=n.parent,u=0;for(;l&&l.type!=="root";)u+=1,l=l.parent;if(o.includes(`\n`)){let c=this.raw(n,null,"indent");if(c.length)for(let a=0;a<u;a++)o+=c}return o}block(n,i){let o=this.raw(n,"between","beforeOpen");this.builder(i+o+"{",n,"start");let l;n.nodes&&n.nodes.length?(this.body(n),l=this.raw(n,"after")):l=this.raw(n,"after","emptyBody"),l&&this.builder(l),this.builder("}",n,"end")}body(n){let i=n.nodes.length-1;for(;i>0&&n.nodes[i].type==="comment";)i-=1;let o=this.raw(n,"semicolon");for(let l=0;l<n.nodes.length;l++){let u=n.nodes[l],c=this.raw(u,"before");c&&this.builder(c),this.stringify(u,i!==l||o)}}comment(n){let i=this.raw(n,"left","commentLeft"),o=this.raw(n,"right","commentRight");this.builder("/*"+i+n.text+o+"*/",n)}decl(n,i){let o=this.raw(n,"between","colon"),l=n.prop+o+this.rawValue(n,"value");n.important&&(l+=n.raws.important||" !important"),i&&(l+=";"),this.builder(l,n)}document(n){this.body(n)}raw(n,i,o){let l;if(o||(o=i),i&&(l=n.raws[i],typeof l<"u"))return l;let u=n.parent;if(o==="before"&&(!u||u.type==="root"&&u.first===n||u&&u.type==="document"))return"";if(!u)return e[o];let c=n.root();if(c.rawCache||(c.rawCache={}),typeof c.rawCache[o]<"u")return c.rawCache[o];if(o==="before"||o==="after")return this.beforeAfter(n,o);{let a="raw"+t(o);this[a]?l=this[a](c,n):c.walk(p=>{if(l=p.raws[i],typeof l<"u")return!1})}return typeof l>"u"&&(l=e[o]),c.rawCache[o]=l,l}rawBeforeClose(n){let i;return n.walk(o=>{if(o.nodes&&o.nodes.length>0&&typeof o.raws.after<"u")return i=o.raws.after,i.includes(`\n`)&&(i=i.replace(/[^\\n]+$/,"")),!1}),i&&(i=i.replace(/\\S/g,"")),i}rawBeforeComment(n,i){let o;return n.walkComments(l=>{if(typeof l.raws.before<"u")return o=l.raws.before,o.includes(`\n`)&&(o=o.replace(/[^\\n]+$/,"")),!1}),typeof o>"u"?o=this.raw(i,null,"beforeDecl"):o&&(o=o.replace(/\\S/g,"")),o}rawBeforeDecl(n,i){let o;return n.walkDecls(l=>{if(typeof l.raws.before<"u")return o=l.raws.before,o.includes(`\n`)&&(o=o.replace(/[^\\n]+$/,"")),!1}),typeof o>"u"?o=this.raw(i,null,"beforeRule"):o&&(o=o.replace(/\\S/g,"")),o}rawBeforeOpen(n){let i;return n.walk(o=>{if(o.type!=="decl"&&(i=o.raws.between,typeof i<"u"))return!1}),i}rawBeforeRule(n){let i;return n.walk(o=>{if(o.nodes&&(o.parent!==n||n.first!==o)&&typeof o.raws.before<"u")return i=o.raws.before,i.includes(`\n`)&&(i=i.replace(/[^\\n]+$/,"")),!1}),i&&(i=i.replace(/\\S/g,"")),i}rawColon(n){let i;return n.walkDecls(o=>{if(typeof o.raws.between<"u")return i=o.raws.between.replace(/[^\\s:]/g,""),!1}),i}rawEmptyBody(n){let i;return n.walk(o=>{if(o.nodes&&o.nodes.length===0&&(i=o.raws.after,typeof i<"u"))return!1}),i}rawIndent(n){if(n.raws.indent)return n.raws.indent;let i;return n.walk(o=>{let l=o.parent;if(l&&l!==n&&l.parent&&l.parent===n&&typeof o.raws.before<"u"){let u=o.raws.before.split(`\n`);return i=u[u.length-1],i=i.replace(/\\S/g,""),!1}}),i}rawSemicolon(n){let i;return n.walk(o=>{if(o.nodes&&o.nodes.length&&o.last.type==="decl"&&(i=o.raws.semicolon,typeof i<"u"))return!1}),i}rawValue(n,i){let o=n[i],l=n.raws[i];return l&&l.value===o?l.raw:o}root(n){this.body(n),n.raws.after&&this.builder(n.raws.after)}rule(n){this.block(n,this.rawValue(n,"selector")),n.raws.ownSemicolon&&this.builder(n.raws.ownSemicolon,n,"end")}stringify(n,i){if(!this[n.type])throw new Error("Unknown AST node type "+n.type+". Maybe you need to change PostCSS stringifier.");this[n.type](n,i)}}return qr=r,r.default=r,qr}var Vr,Ri;function Cr(){if(Ri)return Vr;Ri=1;let e=ha();function t(r,s){new e(s).stringify(r)}return Vr=t,t.default=t,Vr}var Hr,Mi;function Er(){if(Mi)return Hr;Mi=1;let{isClean:e,my:t}=kn(),r=In(),s=ha(),n=Cr();function i(l,u){let c=new l.constructor;for(let a in l){if(!Object.prototype.hasOwnProperty.call(l,a)||a==="proxyCache")continue;let p=l[a],d=typeof p;a==="parent"&&d==="object"?u&&(c[a]=u):a==="source"?c[a]=p:Array.isArray(p)?c[a]=p.map(h=>i(h,c)):(d==="object"&&p!==null&&(p=i(p)),c[a]=p)}return c}class o{constructor(u={}){this.raws={},this[e]=!1,this[t]=!0;for(let c in u)if(c==="nodes"){this.nodes=[];for(let a of u[c])typeof a.clone=="function"?this.append(a.clone()):this.append(a)}else this[c]=u[c]}addToError(u){if(u.postcssNode=this,u.stack&&this.source&&/\\n\\s{4}at /.test(u.stack)){let c=this.source;u.stack=u.stack.replace(/\\n\\s{4}at /,`$&${c.input.from}:${c.start.line}:${c.start.column}$&`)}return u}after(u){return this.parent.insertAfter(this,u),this}assign(u={}){for(let c in u)this[c]=u[c];return this}before(u){return this.parent.insertBefore(this,u),this}cleanRaws(u){delete this.raws.before,delete this.raws.after,u||delete this.raws.between}clone(u={}){let c=i(this);for(let a in u)c[a]=u[a];return c}cloneAfter(u={}){let c=this.clone(u);return this.parent.insertAfter(this,c),c}cloneBefore(u={}){let c=this.clone(u);return this.parent.insertBefore(this,c),c}error(u,c={}){if(this.source){let{end:a,start:p}=this.rangeBy(c);return this.source.input.error(u,{column:p.column,line:p.line},{column:a.column,line:a.line},c)}return new r(u)}getProxyProcessor(){return{get(u,c){return c==="proxyOf"?u:c==="root"?()=>u.root().toProxy():u[c]},set(u,c,a){return u[c]===a||(u[c]=a,(c==="prop"||c==="value"||c==="name"||c==="params"||c==="important"||c==="text")&&u.markDirty()),!0}}}markDirty(){if(this[e]){this[e]=!1;let u=this;for(;u=u.parent;)u[e]=!1}}next(){if(!this.parent)return;let u=this.parent.index(this);return this.parent.nodes[u+1]}positionBy(u,c){let a=this.source.start;if(u.index)a=this.positionInside(u.index,c);else if(u.word){c=this.toString();let p=c.indexOf(u.word);p!==-1&&(a=this.positionInside(p,c))}return a}positionInside(u,c){let a=c||this.toString(),p=this.source.start.column,d=this.source.start.line;for(let h=0;h<u;h++)a[h]===`\n`?(p=1,d+=1):p+=1;return{column:p,line:d}}prev(){if(!this.parent)return;let u=this.parent.index(this);return this.parent.nodes[u-1]}rangeBy(u){let c={column:this.source.start.column,line:this.source.start.line},a=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:c.column+1,line:c.line};if(u.word){let p=this.toString(),d=p.indexOf(u.word);d!==-1&&(c=this.positionInside(d,p),a=this.positionInside(d+u.word.length,p))}else u.start?c={column:u.start.column,line:u.start.line}:u.index&&(c=this.positionInside(u.index)),u.end?a={column:u.end.column,line:u.end.line}:typeof u.endIndex=="number"?a=this.positionInside(u.endIndex):u.index&&(a=this.positionInside(u.index+1));return(a.line<c.line||a.line===c.line&&a.column<=c.column)&&(a={column:c.column+1,line:c.line}),{end:a,start:c}}raw(u,c){return new s().raw(this,u,c)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...u){if(this.parent){let c=this,a=!1;for(let p of u)p===this?a=!0:a?(this.parent.insertAfter(c,p),c=p):this.parent.insertBefore(c,p);a||this.remove()}return this}root(){let u=this;for(;u.parent&&u.parent.type!=="document";)u=u.parent;return u}toJSON(u,c){let a={},p=c==null;c=c||new Map;let d=0;for(let h in this){if(!Object.prototype.hasOwnProperty.call(this,h)||h==="parent"||h==="proxyCache")continue;let m=this[h];if(Array.isArray(m))a[h]=m.map(f=>typeof f=="object"&&f.toJSON?f.toJSON(null,c):f);else if(typeof m=="object"&&m.toJSON)a[h]=m.toJSON(null,c);else if(h==="source"){let f=c.get(m.input);f==null&&(f=d,c.set(m.input,d),d++),a[h]={end:m.end,inputId:f,start:m.start}}else a[h]=m}return p&&(a.inputs=[...c.keys()].map(h=>h.toJSON())),a}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(u=n){u.stringify&&(u=u.stringify);let c="";return u(this,a=>{c+=a}),c}warn(u,c,a){let p={node:this};for(let d in a)p[d]=a[d];return u.warn(c,p)}get proxyOf(){return this}}return Hr=o,o.default=o,Hr}var Gr,Ni;function Rr(){if(Ni)return Gr;Ni=1;let e=Er();class t extends e{constructor(s){s&&typeof s.value<"u"&&typeof s.value!="string"&&(s={...s,value:String(s.value)}),super(s),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}}return Gr=t,t.default=t,Gr}var Yr,Oi;function Uu(){if(Oi)return Yr;Oi=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return Yr={nanoid:(s=21)=>{let n="",i=s;for(;i--;)n+=e[Math.random()*64|0];return n},customAlphabet:(s,n=21)=>(i=n)=>{let o="",l=i;for(;l--;)o+=s[Math.random()*s.length|0];return o}},Yr}var Jr,Ii;function pa(){if(Ii)return Jr;Ii=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=$e,{existsSync:r,readFileSync:s}=$e,{dirname:n,join:i}=$e;function o(u){return Buffer?Buffer.from(u,"base64").toString():window.atob(u)}class l{constructor(c,a){if(a.map===!1)return;this.loadAnnotation(c),this.inline=this.startWith(this.annotation,"data:");let p=a.map?a.map.prev:void 0,d=this.loadMap(a.from,p);!this.mapFile&&a.from&&(this.mapFile=a.from),this.mapFile&&(this.root=n(this.mapFile)),d&&(this.text=d)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(c){let a=/^data:application\\/json;charset=utf-?8;base64,/,p=/^data:application\\/json;base64,/,d=/^data:application\\/json;charset=utf-?8,/,h=/^data:application\\/json,/;if(d.test(c)||h.test(c))return decodeURIComponent(c.substr(RegExp.lastMatch.length));if(a.test(c)||p.test(c))return o(c.substr(RegExp.lastMatch.length));let m=c.match(/data:application\\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+m)}getAnnotationURL(c){return c.replace(/^\\/\\*\\s*# sourceMappingURL=/,"").trim()}isMap(c){return typeof c!="object"?!1:typeof c.mappings=="string"||typeof c._mappings=="string"||Array.isArray(c.sections)}loadAnnotation(c){let a=c.match(/\\/\\*\\s*# sourceMappingURL=/gm);if(!a)return;let p=c.lastIndexOf(a.pop()),d=c.indexOf("*/",p);p>-1&&d>-1&&(this.annotation=this.getAnnotationURL(c.substring(p,d)))}loadFile(c){if(this.root=n(c),r(c))return this.mapFile=c,s(c,"utf-8").toString().trim()}loadMap(c,a){if(a===!1)return!1;if(a){if(typeof a=="string")return a;if(typeof a=="function"){let p=a(c);if(p){let d=this.loadFile(p);if(!d)throw new Error("Unable to load previous source map: "+p.toString());return d}}else{if(a instanceof e)return t.fromSourceMap(a).toString();if(a instanceof t)return a.toString();if(this.isMap(a))return JSON.stringify(a);throw new Error("Unsupported previous source map format: "+a.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let p=this.annotation;return c&&(p=i(n(c),p)),this.loadFile(p)}}}startWith(c,a){return c?c.substr(0,a.length)===a:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Jr=l,l.default=l,Jr}var Qr,ki;function Mr(){if(ki)return Qr;ki=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=$e,{fileURLToPath:r,pathToFileURL:s}=$e,{isAbsolute:n,resolve:i}=$e,{nanoid:o}=Uu(),l=$e,u=In(),c=pa(),a=Symbol("fromOffsetCache"),p=!!(e&&t),d=!!(i&&n);class h{constructor(f,g={}){if(f===null||typeof f>"u"||typeof f=="object"&&!f.toString)throw new Error(`PostCSS received ${f} instead of CSS string`);if(this.css=f.toString(),this.css[0]==="\\uFEFF"||this.css[0]==="\\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,g.from&&(!d||/^\\w+:\\/\\//.test(g.from)||n(g.from)?this.file=g.from:this.file=i(g.from)),d&&p){let b=new c(this.css,g);if(b.text){this.map=b;let v=b.consumer().file;!this.file&&v&&(this.file=this.mapResolve(v))}}this.file||(this.id="<input css "+o(6)+">"),this.map&&(this.map.file=this.from)}error(f,g,b,v={}){let y,C,x;if(g&&typeof g=="object"){let E=g,M=b;if(typeof E.offset=="number"){let k=this.fromOffset(E.offset);g=k.line,b=k.col}else g=E.line,b=E.column;if(typeof M.offset=="number"){let k=this.fromOffset(M.offset);C=k.line,x=k.col}else C=M.line,x=M.column}else if(!b){let E=this.fromOffset(g);g=E.line,b=E.col}let w=this.origin(g,b,C,x);return w?y=new u(f,w.endLine===void 0?w.line:{column:w.column,line:w.line},w.endLine===void 0?w.column:{column:w.endColumn,line:w.endLine},w.source,w.file,v.plugin):y=new u(f,C===void 0?g:{column:b,line:g},C===void 0?b:{column:x,line:C},this.css,this.file,v.plugin),y.input={column:b,endColumn:x,endLine:C,line:g,source:this.css},this.file&&(s&&(y.input.url=s(this.file).toString()),y.input.file=this.file),y}fromOffset(f){let g,b;if(this[a])b=this[a];else{let y=this.css.split(`\n`);b=new Array(y.length);let C=0;for(let x=0,w=y.length;x<w;x++)b[x]=C,C+=y[x].length+1;this[a]=b}g=b[b.length-1];let v=0;if(f>=g)v=b.length-1;else{let y=b.length-2,C;for(;v<y;)if(C=v+(y-v>>1),f<b[C])y=C-1;else if(f>=b[C+1])v=C+1;else{v=C;break}}return{col:f-b[v]+1,line:v+1}}mapResolve(f){return/^\\w+:\\/\\//.test(f)?f:i(this.map.consumer().sourceRoot||this.map.root||".",f)}origin(f,g,b,v){if(!this.map)return!1;let y=this.map.consumer(),C=y.originalPositionFor({column:g,line:f});if(!C.source)return!1;let x;typeof b=="number"&&(x=y.originalPositionFor({column:v,line:b}));let w;n(C.source)?w=s(C.source):w=new URL(C.source,this.map.consumer().sourceRoot||s(this.map.mapFile));let E={column:C.column,endColumn:x&&x.column,endLine:x&&x.line,line:C.line,url:w.toString()};if(w.protocol==="file:")if(r)E.file=r(w);else throw new Error("file: protocol is not available in this PostCSS build");let M=y.sourceContentFor(C.source);return M&&(E.source=M),E}toJSON(){let f={};for(let g of["hasBOM","css","file","id"])this[g]!=null&&(f[g]=this[g]);return this.map&&(f.map={...this.map},f.map.consumerCache&&(f.map.consumerCache=void 0)),f}get from(){return this.file||this.id}}return Qr=h,h.default=h,l&&l.registerInput&&l.registerInput(h),Qr}var Xr,Ti;function fa(){if(Ti)return Xr;Ti=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=$e,{dirname:r,relative:s,resolve:n,sep:i}=$e,{pathToFileURL:o}=$e,l=Mr(),u=!!(e&&t),c=!!(r&&n&&s&&i);class a{constructor(d,h,m,f){this.stringify=d,this.mapOpts=m.map||{},this.root=h,this.opts=m,this.css=f,this.originalCSS=f,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let d;this.isInline()?d="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?d=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?d=this.mapOpts.annotation(this.opts.to,this.root):d=this.outputFile()+".map";let h=`\n`;this.css.includes(`\\r\n`)&&(h=`\\r\n`),this.css+=h+"/*# sourceMappingURL="+d+" */"}applyPrevMaps(){for(let d of this.previous()){let h=this.toUrl(this.path(d.file)),m=d.root||r(d.file),f;this.mapOpts.sourcesContent===!1?(f=new e(d.text),f.sourcesContent&&(f.sourcesContent=null)):f=d.consumer(),this.map.applySourceMap(f,h,this.toUrl(this.path(m)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let d;for(let h=this.root.nodes.length-1;h>=0;h--)d=this.root.nodes[h],d.type==="comment"&&d.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(h)}else this.css&&(this.css=this.css.replace(/\\n*?\\/\\*#[\\S\\s]*?\\*\\/$/gm,""))}generate(){if(this.clearAnnotation(),c&&u&&this.isMap())return this.generateMap();{let d="";return this.stringify(this.root,h=>{d+=h}),[d]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let d=this.previous()[0].consumer();d.file=this.outputFile(),this.map=t.fromSourceMap(d,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<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 t({file:this.outputFile(),ignoreInvalidMapping:!0});let d=1,h=1,m="<no source>",f={generated:{column:0,line:0},original:{column:0,line:0},source:""},g,b;this.stringify(this.root,(v,y,C)=>{if(this.css+=v,y&&C!=="end"&&(f.generated.line=d,f.generated.column=h-1,y.source&&y.source.start?(f.source=this.sourcePath(y),f.original.line=y.source.start.line,f.original.column=y.source.start.column-1,this.map.addMapping(f)):(f.source=m,f.original.line=1,f.original.column=0,this.map.addMapping(f))),g=v.match(/\\n/g),g?(d+=g.length,b=v.lastIndexOf(`\n`),h=v.length-b):h+=v.length,y&&C!=="start"){let x=y.parent||{raws:{}};(!(y.type==="decl"||y.type==="atrule"&&!y.nodes)||y!==x.last||x.raws.semicolon)&&(y.source&&y.source.end?(f.source=this.sourcePath(y),f.original.line=y.source.end.line,f.original.column=y.source.end.column-1,f.generated.line=d,f.generated.column=h-2,this.map.addMapping(f)):(f.source=m,f.original.line=1,f.original.column=0,f.generated.line=d,f.generated.column=h-1,this.map.addMapping(f)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(d=>d.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let d=this.mapOpts.annotation;return typeof d<"u"&&d!==!0?!1:this.previous().length?this.previous().some(h=>h.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(d=>d.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(d){if(this.mapOpts.absolute||d.charCodeAt(0)===60||/^\\w+:\\/\\//.test(d))return d;let h=this.memoizedPaths.get(d);if(h)return h;let m=this.opts.to?r(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(m=r(n(m,this.mapOpts.annotation)));let f=s(m,d);return this.memoizedPaths.set(d,f),f}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(d=>{if(d.source&&d.source.input.map){let h=d.source.input.map;this.previousMaps.includes(h)||this.previousMaps.push(h)}});else{let d=new l(this.originalCSS,this.opts);d.map&&this.previousMaps.push(d.map)}return this.previousMaps}setSourcesContent(){let d={};if(this.root)this.root.walk(h=>{if(h.source){let m=h.source.input.from;if(m&&!d[m]){d[m]=!0;let f=this.usesFileUrls?this.toFileUrl(m):this.toUrl(this.path(m));this.map.setSourceContent(f,h.source.input.css)}}});else if(this.css){let h=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(h,this.css)}}sourcePath(d){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(d.source.input.from):this.toUrl(this.path(d.source.input.from))}toBase64(d){return Buffer?Buffer.from(d).toString("base64"):window.btoa(unescape(encodeURIComponent(d)))}toFileUrl(d){let h=this.memoizedFileURLs.get(d);if(h)return h;if(o){let m=o(d).toString();return this.memoizedFileURLs.set(d,m),m}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(d){let h=this.memoizedURLs.get(d);if(h)return h;i==="\\\\"&&(d=d.replace(/\\\\/g,"/"));let m=encodeURI(d).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(d,m),m}}return Xr=a,Xr}var Kr,Di;function Nr(){if(Di)return Kr;Di=1;let e=Er();class t extends e{constructor(s){super(s),this.type="comment"}}return Kr=t,t.default=t,Kr}var Zr,Ai;function rt(){if(Ai)return Zr;Ai=1;let{isClean:e,my:t}=kn(),r=Rr(),s=Nr(),n=Er(),i,o,l,u;function c(d){return d.map(h=>(h.nodes&&(h.nodes=c(h.nodes)),delete h.source,h))}function a(d){if(d[e]=!1,d.proxyOf.nodes)for(let h of d.proxyOf.nodes)a(h)}class p extends n{append(...h){for(let m of h){let f=this.normalize(m,this.last);for(let g of f)this.proxyOf.nodes.push(g)}return this.markDirty(),this}cleanRaws(h){if(super.cleanRaws(h),this.nodes)for(let m of this.nodes)m.cleanRaws(h)}each(h){if(!this.proxyOf.nodes)return;let m=this.getIterator(),f,g;for(;this.indexes[m]<this.proxyOf.nodes.length&&(f=this.indexes[m],g=h(this.proxyOf.nodes[f],f),g!==!1);)this.indexes[m]+=1;return delete this.indexes[m],g}every(h){return this.nodes.every(h)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let h=this.lastEach;return this.indexes[h]=0,h}getProxyProcessor(){return{get(h,m){return m==="proxyOf"?h:h[m]?m==="each"||typeof m=="string"&&m.startsWith("walk")?(...f)=>h[m](...f.map(g=>typeof g=="function"?(b,v)=>g(b.toProxy(),v):g)):m==="every"||m==="some"?f=>h[m]((g,...b)=>f(g.toProxy(),...b)):m==="root"?()=>h.root().toProxy():m==="nodes"?h.nodes.map(f=>f.toProxy()):m==="first"||m==="last"?h[m].toProxy():h[m]:h[m]},set(h,m,f){return h[m]===f||(h[m]=f,(m==="name"||m==="params"||m==="selector")&&h.markDirty()),!0}}}index(h){return typeof h=="number"?h:(h.proxyOf&&(h=h.proxyOf),this.proxyOf.nodes.indexOf(h))}insertAfter(h,m){let f=this.index(h),g=this.normalize(m,this.proxyOf.nodes[f]).reverse();f=this.index(h);for(let v of g)this.proxyOf.nodes.splice(f+1,0,v);let b;for(let v in this.indexes)b=this.indexes[v],f<b&&(this.indexes[v]=b+g.length);return this.markDirty(),this}insertBefore(h,m){let f=this.index(h),g=f===0?"prepend":!1,b=this.normalize(m,this.proxyOf.nodes[f],g).reverse();f=this.index(h);for(let y of b)this.proxyOf.nodes.splice(f,0,y);let v;for(let y in this.indexes)v=this.indexes[y],f<=v&&(this.indexes[y]=v+b.length);return this.markDirty(),this}normalize(h,m){if(typeof h=="string")h=c(i(h).nodes);else if(typeof h>"u")h=[];else if(Array.isArray(h)){h=h.slice(0);for(let g of h)g.parent&&g.parent.removeChild(g,"ignore")}else if(h.type==="root"&&this.type!=="document"){h=h.nodes.slice(0);for(let g of h)g.parent&&g.parent.removeChild(g,"ignore")}else if(h.type)h=[h];else if(h.prop){if(typeof h.value>"u")throw new Error("Value field is missed in node creation");typeof h.value!="string"&&(h.value=String(h.value)),h=[new r(h)]}else if(h.selector)h=[new o(h)];else if(h.name)h=[new l(h)];else if(h.text)h=[new s(h)];else throw new Error("Unknown node type in node creation");return h.map(g=>(g[t]||p.rebuild(g),g=g.proxyOf,g.parent&&g.parent.removeChild(g),g[e]&&a(g),typeof g.raws.before>"u"&&m&&typeof m.raws.before<"u"&&(g.raws.before=m.raws.before.replace(/\\S/g,"")),g.parent=this.proxyOf,g))}prepend(...h){h=h.reverse();for(let m of h){let f=this.normalize(m,this.first,"prepend").reverse();for(let g of f)this.proxyOf.nodes.unshift(g);for(let g in this.indexes)this.indexes[g]=this.indexes[g]+f.length}return this.markDirty(),this}push(h){return h.parent=this,this.proxyOf.nodes.push(h),this}removeAll(){for(let h of this.proxyOf.nodes)h.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(h){h=this.index(h),this.proxyOf.nodes[h].parent=void 0,this.proxyOf.nodes.splice(h,1);let m;for(let f in this.indexes)m=this.indexes[f],m>=h&&(this.indexes[f]=m-1);return this.markDirty(),this}replaceValues(h,m,f){return f||(f=m,m={}),this.walkDecls(g=>{m.props&&!m.props.includes(g.prop)||m.fast&&!g.value.includes(m.fast)||(g.value=g.value.replace(h,f))}),this.markDirty(),this}some(h){return this.nodes.some(h)}walk(h){return this.each((m,f)=>{let g;try{g=h(m,f)}catch(b){throw m.addToError(b)}return g!==!1&&m.walk&&(g=m.walk(h)),g})}walkAtRules(h,m){return m?h instanceof RegExp?this.walk((f,g)=>{if(f.type==="atrule"&&h.test(f.name))return m(f,g)}):this.walk((f,g)=>{if(f.type==="atrule"&&f.name===h)return m(f,g)}):(m=h,this.walk((f,g)=>{if(f.type==="atrule")return m(f,g)}))}walkComments(h){return this.walk((m,f)=>{if(m.type==="comment")return h(m,f)})}walkDecls(h,m){return m?h instanceof RegExp?this.walk((f,g)=>{if(f.type==="decl"&&h.test(f.prop))return m(f,g)}):this.walk((f,g)=>{if(f.type==="decl"&&f.prop===h)return m(f,g)}):(m=h,this.walk((f,g)=>{if(f.type==="decl")return m(f,g)}))}walkRules(h,m){return m?h instanceof RegExp?this.walk((f,g)=>{if(f.type==="rule"&&h.test(f.selector))return m(f,g)}):this.walk((f,g)=>{if(f.type==="rule"&&f.selector===h)return m(f,g)}):(m=h,this.walk((f,g)=>{if(f.type==="rule")return m(f,g)}))}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]}}return p.registerParse=d=>{i=d},p.registerRule=d=>{o=d},p.registerAtRule=d=>{l=d},p.registerRoot=d=>{u=d},Zr=p,p.default=p,p.rebuild=d=>{d.type==="atrule"?Object.setPrototypeOf(d,l.prototype):d.type==="rule"?Object.setPrototypeOf(d,o.prototype):d.type==="decl"?Object.setPrototypeOf(d,r.prototype):d.type==="comment"?Object.setPrototypeOf(d,s.prototype):d.type==="root"&&Object.setPrototypeOf(d,u.prototype),d[t]=!0,d.nodes&&d.nodes.forEach(h=>{p.rebuild(h)})},Zr}var es,Li;function Tn(){if(Li)return es;Li=1;let e=rt(),t,r;class s extends e{constructor(i){super({type:"document",...i}),this.nodes||(this.nodes=[])}toResult(i={}){return new t(new r,this,i).stringify()}}return s.registerLazyResult=n=>{t=n},s.registerProcessor=n=>{r=n},es=s,s.default=s,es}var ts,Pi;function ma(){if(Pi)return ts;Pi=1;let e={};return ts=function(r){e[r]||(e[r]=!0,typeof console<"u"&&console.warn&&console.warn(r))},ts}var rs,_i;function ga(){if(_i)return rs;_i=1;class e{constructor(r,s={}){if(this.type="warning",this.text=r,s.node&&s.node.source){let n=s.node.rangeBy(s);this.line=n.start.line,this.column=n.start.column,this.endLine=n.end.line,this.endColumn=n.end.column}for(let n in s)this[n]=s[n]}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}}return rs=e,e.default=e,rs}var ss,$i;function Dn(){if($i)return ss;$i=1;let e=ga();class t{constructor(s,n,i){this.processor=s,this.messages=[],this.root=n,this.opts=i,this.css=void 0,this.map=void 0}toString(){return this.css}warn(s,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let i=new e(s,n);return this.messages.push(i),i}warnings(){return this.messages.filter(s=>s.type==="warning")}get content(){return this.css}}return ss=t,t.default=t,ss}var ns,Fi;function Bu(){if(Fi)return ns;Fi=1;let e=39,t=34,r=92,s=47,n=10,i=32,o=12,l=9,u=13,c=91,a=93,p=40,d=41,h=123,m=125,f=59,g=42,b=58,v=64,y=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/g,C=/[\\t\\n\\f\\r !"#\'():;@[\\\\\\]{}]|\\/(?=\\*)/g,x=/.[\\r\\n"\'(/\\\\]/,w=/[\\da-f]/i;return ns=function(M,k={}){let N=M.css.valueOf(),P=k.ignoreErrors,A,R,Ce,be,V,_,K,ue,ne,Y,Ye=N.length,I=0,Be=[],Ie=[];function vt(){return I}function ve($){throw M.error("Unclosed "+$,I)}function Ee(){return Ie.length===0&&I>=Ye}function et($){if(Ie.length)return Ie.pop();if(I>=Ye)return;let ce=$?$.ignoreUnclosed:!1;switch(A=N.charCodeAt(I),A){case n:case i:case l:case u:case o:{R=I;do R+=1,A=N.charCodeAt(R);while(A===i||A===n||A===l||A===u||A===o);Y=["space",N.slice(I,R)],I=R-1;break}case c:case a:case h:case m:case b:case f:case d:{let U=String.fromCharCode(A);Y=[U,U,I];break}case p:{if(ue=Be.length?Be.pop()[1]:"",ne=N.charCodeAt(I+1),ue==="url"&&ne!==e&&ne!==t&&ne!==i&&ne!==n&&ne!==l&&ne!==o&&ne!==u){R=I;do{if(_=!1,R=N.indexOf(")",R+1),R===-1)if(P||ce){R=I;break}else ve("bracket");for(K=R;N.charCodeAt(K-1)===r;)K-=1,_=!_}while(_);Y=["brackets",N.slice(I,R+1),I,R],I=R}else R=N.indexOf(")",I+1),be=N.slice(I,R+1),R===-1||x.test(be)?Y=["(","(",I]:(Y=["brackets",be,I,R],I=R);break}case e:case t:{Ce=A===e?"\'":\'"\',R=I;do{if(_=!1,R=N.indexOf(Ce,R+1),R===-1)if(P||ce){R=I+1;break}else ve("string");for(K=R;N.charCodeAt(K-1)===r;)K-=1,_=!_}while(_);Y=["string",N.slice(I,R+1),I,R],I=R;break}case v:{y.lastIndex=I+1,y.test(N),y.lastIndex===0?R=N.length-1:R=y.lastIndex-2,Y=["at-word",N.slice(I,R+1),I,R],I=R;break}case r:{for(R=I,V=!0;N.charCodeAt(R+1)===r;)R+=1,V=!V;if(A=N.charCodeAt(R+1),V&&A!==s&&A!==i&&A!==n&&A!==l&&A!==u&&A!==o&&(R+=1,w.test(N.charAt(R)))){for(;w.test(N.charAt(R+1));)R+=1;N.charCodeAt(R+1)===i&&(R+=1)}Y=["word",N.slice(I,R+1),I,R],I=R;break}default:{A===s&&N.charCodeAt(I+1)===g?(R=N.indexOf("*/",I+2)+1,R===0&&(P||ce?R=N.length:ve("comment")),Y=["comment",N.slice(I,R+1),I,R],I=R):(C.lastIndex=I+1,C.test(N),C.lastIndex===0?R=N.length-1:R=C.lastIndex-2,Y=["word",N.slice(I,R+1),I,R],Be.push(Y),I=R);break}}return I++,Y}function je($){Ie.push($)}return{back:je,endOfFile:Ee,nextToken:et,position:vt}},ns}var is,Ui;function An(){if(Ui)return is;Ui=1;let e=rt();class t extends e{constructor(s){super(s),this.type="atrule"}append(...s){return this.proxyOf.nodes||(this.nodes=[]),super.append(...s)}prepend(...s){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...s)}}return is=t,t.default=t,e.registerAtRule(t),is}var os,Bi;function zt(){if(Bi)return os;Bi=1;let e=rt(),t,r;class s extends e{constructor(i){super(i),this.type="root",this.nodes||(this.nodes=[])}normalize(i,o,l){let u=super.normalize(i);if(o){if(l==="prepend")this.nodes.length>1?o.raws.before=this.nodes[1].raws.before:delete o.raws.before;else if(this.first!==o)for(let c of u)c.raws.before=o.raws.before}return u}removeChild(i,o){let l=this.index(i);return!o&&l===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[l].raws.before),super.removeChild(i)}toResult(i={}){return new t(new r,this,i).stringify()}}return s.registerLazyResult=n=>{t=n},s.registerProcessor=n=>{r=n},os=s,s.default=s,e.registerRoot(s),os}var as,ji;function ya(){if(ji)return as;ji=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let r=[" ",`\n`," "];return e.split(t,r)},split(t,r,s){let n=[],i="",o=!1,l=0,u=!1,c="",a=!1;for(let p of t)a?a=!1:p==="\\\\"?a=!0:u?p===c&&(u=!1):p===\'"\'||p==="\'"?(u=!0,c=p):p==="("?l+=1:p===")"?l>0&&(l-=1):l===0&&r.includes(p)&&(o=!0),o?(i!==""&&n.push(i.trim()),i="",o=!1):i+=p;return(s||i!=="")&&n.push(i.trim()),n}};return as=e,e.default=e,as}var ls,zi;function Ln(){if(zi)return ls;zi=1;let e=rt(),t=ya();class r extends e{constructor(n){super(n),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(n){let i=this.selector?this.selector.match(/,\\s*/):null,o=i?i[0]:","+this.raw("between","beforeOpen");this.selector=n.join(o)}}return ls=r,r.default=r,e.registerRule(r),ls}var us,Wi;function ju(){if(Wi)return us;Wi=1;let e=Rr(),t=Bu(),r=Nr(),s=An(),n=zt(),i=Ln(),o={empty:!0,space:!0};function l(c){for(let a=c.length-1;a>=0;a--){let p=c[a],d=p[3]||p[2];if(d)return d}}class u{constructor(a){this.input=a,this.root=new n,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:a,start:{column:1,line:1,offset:0}}}atrule(a){let p=new s;p.name=a[1].slice(1),p.name===""&&this.unnamedAtrule(p,a),this.init(p,a[2]);let d,h,m,f=!1,g=!1,b=[],v=[];for(;!this.tokenizer.endOfFile();){if(a=this.tokenizer.nextToken(),d=a[0],d==="("||d==="["?v.push(d==="("?")":"]"):d==="{"&&v.length>0?v.push("}"):d===v[v.length-1]&&v.pop(),v.length===0)if(d===";"){p.source.end=this.getPosition(a[2]),p.source.end.offset++,this.semicolon=!0;break}else if(d==="{"){g=!0;break}else if(d==="}"){if(b.length>0){for(m=b.length-1,h=b[m];h&&h[0]==="space";)h=b[--m];h&&(p.source.end=this.getPosition(h[3]||h[2]),p.source.end.offset++)}this.end(a);break}else b.push(a);else b.push(a);if(this.tokenizer.endOfFile()){f=!0;break}}p.raws.between=this.spacesAndCommentsFromEnd(b),b.length?(p.raws.afterName=this.spacesAndCommentsFromStart(b),this.raw(p,"params",b),f&&(a=b[b.length-1],p.source.end=this.getPosition(a[3]||a[2]),p.source.end.offset++,this.spaces=p.raws.between,p.raws.between="")):(p.raws.afterName="",p.params=""),g&&(p.nodes=[],this.current=p)}checkMissedSemicolon(a){let p=this.colon(a);if(p===!1)return;let d=0,h;for(let m=p-1;m>=0&&(h=a[m],!(h[0]!=="space"&&(d+=1,d===2)));m--);throw this.input.error("Missed semicolon",h[0]==="word"?h[3]+1:h[2])}colon(a){let p=0,d,h,m;for(let[f,g]of a.entries()){if(d=g,h=d[0],h==="("&&(p+=1),h===")"&&(p-=1),p===0&&h===":")if(!m)this.doubleColon(d);else{if(m[0]==="word"&&m[1]==="progid")continue;return f}m=d}return!1}comment(a){let p=new r;this.init(p,a[2]),p.source.end=this.getPosition(a[3]||a[2]),p.source.end.offset++;let d=a[1].slice(2,-2);if(/^\\s*$/.test(d))p.text="",p.raws.left=d,p.raws.right="";else{let h=d.match(/^(\\s*)([^]*\\S)(\\s*)$/);p.text=h[2],p.raws.left=h[1],p.raws.right=h[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(a,p){let d=new e;this.init(d,a[0][2]);let h=a[a.length-1];for(h[0]===";"&&(this.semicolon=!0,a.pop()),d.source.end=this.getPosition(h[3]||h[2]||l(a)),d.source.end.offset++;a[0][0]!=="word";)a.length===1&&this.unknownWord(a),d.raws.before+=a.shift()[1];for(d.source.start=this.getPosition(a[0][2]),d.prop="";a.length;){let v=a[0][0];if(v===":"||v==="space"||v==="comment")break;d.prop+=a.shift()[1]}d.raws.between="";let m;for(;a.length;)if(m=a.shift(),m[0]===":"){d.raws.between+=m[1];break}else m[0]==="word"&&/\\w/.test(m[1])&&this.unknownWord([m]),d.raws.between+=m[1];(d.prop[0]==="_"||d.prop[0]==="*")&&(d.raws.before+=d.prop[0],d.prop=d.prop.slice(1));let f=[],g;for(;a.length&&(g=a[0][0],!(g!=="space"&&g!=="comment"));)f.push(a.shift());this.precheckMissedSemicolon(a);for(let v=a.length-1;v>=0;v--){if(m=a[v],m[1].toLowerCase()==="!important"){d.important=!0;let y=this.stringFrom(a,v);y=this.spacesFromEnd(a)+y,y!==" !important"&&(d.raws.important=y);break}else if(m[1].toLowerCase()==="important"){let y=a.slice(0),C="";for(let x=v;x>0;x--){let w=y[x][0];if(C.trim().indexOf("!")===0&&w!=="space")break;C=y.pop()[1]+C}C.trim().indexOf("!")===0&&(d.important=!0,d.raws.important=C,a=y)}if(m[0]!=="space"&&m[0]!=="comment")break}a.some(v=>v[0]!=="space"&&v[0]!=="comment")&&(d.raws.between+=f.map(v=>v[1]).join(""),f=[]),this.raw(d,"value",f.concat(a),p),d.value.includes(":")&&!p&&this.checkMissedSemicolon(a)}doubleColon(a){throw this.input.error("Double colon",{offset:a[2]},{offset:a[2]+a[1].length})}emptyRule(a){let p=new i;this.init(p,a[2]),p.selector="",p.raws.between="",this.current=p}end(a){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(a[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(a)}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(a){if(this.spaces+=a[1],this.current.nodes){let p=this.current.nodes[this.current.nodes.length-1];p&&p.type==="rule"&&!p.raws.ownSemicolon&&(p.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(a){let p=this.input.fromOffset(a);return{column:p.col,line:p.line,offset:a}}init(a,p){this.current.push(a),a.source={input:this.input,start:this.getPosition(p)},a.raws.before=this.spaces,this.spaces="",a.type!=="comment"&&(this.semicolon=!1)}other(a){let p=!1,d=null,h=!1,m=null,f=[],g=a[1].startsWith("--"),b=[],v=a;for(;v;){if(d=v[0],b.push(v),d==="("||d==="[")m||(m=v),f.push(d==="("?")":"]");else if(g&&h&&d==="{")m||(m=v),f.push("}");else if(f.length===0)if(d===";")if(h){this.decl(b,g);return}else break;else if(d==="{"){this.rule(b);return}else if(d==="}"){this.tokenizer.back(b.pop()),p=!0;break}else d===":"&&(h=!0);else d===f[f.length-1]&&(f.pop(),f.length===0&&(m=null));v=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(p=!0),f.length>0&&this.unclosedBracket(m),p&&h){if(!g)for(;b.length&&(v=b[b.length-1][0],!(v!=="space"&&v!=="comment"));)this.tokenizer.back(b.pop());this.decl(b,g)}else this.unknownWord(b)}parse(){let a;for(;!this.tokenizer.endOfFile();)switch(a=this.tokenizer.nextToken(),a[0]){case"space":this.spaces+=a[1];break;case";":this.freeSemicolon(a);break;case"}":this.end(a);break;case"comment":this.comment(a);break;case"at-word":this.atrule(a);break;case"{":this.emptyRule(a);break;default:this.other(a);break}this.endFile()}precheckMissedSemicolon(){}raw(a,p,d,h){let m,f,g=d.length,b="",v=!0,y,C;for(let x=0;x<g;x+=1)m=d[x],f=m[0],f==="space"&&x===g-1&&!h?v=!1:f==="comment"?(C=d[x-1]?d[x-1][0]:"empty",y=d[x+1]?d[x+1][0]:"empty",!o[C]&&!o[y]?b.slice(-1)===","?v=!1:b+=m[1]:v=!1):b+=m[1];if(!v){let x=d.reduce((w,E)=>w+E[1],"");a.raws[p]={raw:x,value:b}}a[p]=b}rule(a){a.pop();let p=new i;this.init(p,a[0][2]),p.raws.between=this.spacesAndCommentsFromEnd(a),this.raw(p,"selector",a),this.current=p}spacesAndCommentsFromEnd(a){let p,d="";for(;a.length&&(p=a[a.length-1][0],!(p!=="space"&&p!=="comment"));)d=a.pop()[1]+d;return d}spacesAndCommentsFromStart(a){let p,d="";for(;a.length&&(p=a[0][0],!(p!=="space"&&p!=="comment"));)d+=a.shift()[1];return d}spacesFromEnd(a){let p,d="";for(;a.length&&(p=a[a.length-1][0],p==="space");)d=a.pop()[1]+d;return d}stringFrom(a,p){let d="";for(let h=p;h<a.length;h++)d+=a[h][1];return a.splice(p,a.length-p),d}unclosedBlock(){let a=this.current.source.start;throw this.input.error("Unclosed block",a.line,a.column)}unclosedBracket(a){throw this.input.error("Unclosed bracket",{offset:a[2]},{offset:a[2]+1})}unexpectedClose(a){throw this.input.error("Unexpected }",{offset:a[2]},{offset:a[2]+1})}unknownWord(a){throw this.input.error("Unknown word",{offset:a[0][2]},{offset:a[0][2]+a[0][1].length})}unnamedAtrule(a,p){throw this.input.error("At-rule without name",{offset:p[2]},{offset:p[2]+p[1].length})}}return us=u,us}var cs,qi;function Pn(){if(qi)return cs;qi=1;let e=rt(),t=ju(),r=Mr();function s(n,i){let o=new r(n,i),l=new t(o);try{l.parse()}catch(u){throw u}return l.root}return cs=s,s.default=s,e.registerParse(s),cs}var ds,Vi;function ba(){if(Vi)return ds;Vi=1;let{isClean:e,my:t}=kn(),r=fa(),s=Cr(),n=rt(),i=Tn(),o=ma(),l=Dn(),u=Pn(),c=zt(),a={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},p={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},d={Once:!0,postcssPlugin:!0,prepare:!0},h=0;function m(C){return typeof C=="object"&&typeof C.then=="function"}function f(C){let x=!1,w=a[C.type];return C.type==="decl"?x=C.prop.toLowerCase():C.type==="atrule"&&(x=C.name.toLowerCase()),x&&C.append?[w,w+"-"+x,h,w+"Exit",w+"Exit-"+x]:x?[w,w+"-"+x,w+"Exit",w+"Exit-"+x]:C.append?[w,h,w+"Exit"]:[w,w+"Exit"]}function g(C){let x;return C.type==="document"?x=["Document",h,"DocumentExit"]:C.type==="root"?x=["Root",h,"RootExit"]:x=f(C),{eventIndex:0,events:x,iterator:0,node:C,visitorIndex:0,visitors:[]}}function b(C){return C[e]=!1,C.nodes&&C.nodes.forEach(x=>b(x)),C}let v={};class y{constructor(x,w,E){this.stringified=!1,this.processed=!1;let M;if(typeof w=="object"&&w!==null&&(w.type==="root"||w.type==="document"))M=b(w);else if(w instanceof y||w instanceof l)M=b(w.root),w.map&&(typeof E.map>"u"&&(E.map={}),E.map.inline||(E.map.inline=!1),E.map.prev=w.map);else{let k=u;E.syntax&&(k=E.syntax.parse),E.parser&&(k=E.parser),k.parse&&(k=k.parse);try{M=k(w,E)}catch(N){this.processed=!0,this.error=N}M&&!M[t]&&n.rebuild(M)}this.result=new l(x,M,E),this.helpers={...v,postcss:v,result:this.result},this.plugins=this.processor.plugins.map(k=>typeof k=="object"&&k.prepare?{...k,...k.prepare(this.result)}:k)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(x){return this.async().catch(x)}finally(x){return this.async().then(x,x)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(x,w){let E=this.result.lastPlugin;try{w&&w.addToError(x),this.error=x,x.name==="CssSyntaxError"&&!x.plugin?(x.plugin=E.postcssPlugin,x.setMessage()):E.postcssVersion}catch(M){console&&console.error&&console.error(M)}return x}prepareVisitors(){this.listeners={};let x=(w,E,M)=>{this.listeners[E]||(this.listeners[E]=[]),this.listeners[E].push([w,M])};for(let w of this.plugins)if(typeof w=="object")for(let E in w){if(!p[E]&&/^[A-Z]/.test(E))throw new Error(`Unknown event ${E} in ${w.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[E])if(typeof w[E]=="object")for(let M in w[E])M==="*"?x(w,E,w[E][M]):x(w,E+"-"+M.toLowerCase(),w[E][M]);else typeof w[E]=="function"&&x(w,E,w[E])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let x=0;x<this.plugins.length;x++){let w=this.plugins[x],E=this.runOnRoot(w);if(m(E))try{await E}catch(M){throw this.handleError(M)}}if(this.prepareVisitors(),this.hasListener){let x=this.result.root;for(;!x[e];){x[e]=!0;let w=[g(x)];for(;w.length>0;){let E=this.visitTick(w);if(m(E))try{await E}catch(M){let k=w[w.length-1].node;throw this.handleError(M,k)}}}if(this.listeners.OnceExit)for(let[w,E]of this.listeners.OnceExit){this.result.lastPlugin=w;try{if(x.type==="document"){let M=x.nodes.map(k=>E(k,this.helpers));await Promise.all(M)}else await E(x,this.helpers)}catch(M){throw this.handleError(M)}}}return this.processed=!0,this.stringify()}runOnRoot(x){this.result.lastPlugin=x;try{if(typeof x=="object"&&x.Once){if(this.result.root.type==="document"){let w=this.result.root.nodes.map(E=>x.Once(E,this.helpers));return m(w[0])?Promise.all(w):w}return x.Once(this.result.root,this.helpers)}else if(typeof x=="function")return x(this.result.root,this.result)}catch(w){throw this.handleError(w)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let x=this.result.opts,w=s;x.syntax&&(w=x.syntax.stringify),x.stringifier&&(w=x.stringifier),w.stringify&&(w=w.stringify);let M=new r(w,this.result.root,this.result.opts).generate();return this.result.css=M[0],this.result.map=M[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 x of this.plugins){let w=this.runOnRoot(x);if(m(w))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let x=this.result.root;for(;!x[e];)x[e]=!0,this.walkSync(x);if(this.listeners.OnceExit)if(x.type==="document")for(let w of x.nodes)this.visitSync(this.listeners.OnceExit,w);else this.visitSync(this.listeners.OnceExit,x)}return this.result}then(x,w){return this.async().then(x,w)}toString(){return this.css}visitSync(x,w){for(let[E,M]of x){this.result.lastPlugin=E;let k;try{k=M(w,this.helpers)}catch(N){throw this.handleError(N,w.proxyOf)}if(w.type!=="root"&&w.type!=="document"&&!w.parent)return!0;if(m(k))throw this.getAsyncError()}}visitTick(x){let w=x[x.length-1],{node:E,visitors:M}=w;if(E.type!=="root"&&E.type!=="document"&&!E.parent){x.pop();return}if(M.length>0&&w.visitorIndex<M.length){let[N,P]=M[w.visitorIndex];w.visitorIndex+=1,w.visitorIndex===M.length&&(w.visitors=[],w.visitorIndex=0),this.result.lastPlugin=N;try{return P(E.toProxy(),this.helpers)}catch(A){throw this.handleError(A,E)}}if(w.iterator!==0){let N=w.iterator,P;for(;P=E.nodes[E.indexes[N]];)if(E.indexes[N]+=1,!P[e]){P[e]=!0,x.push(g(P));return}w.iterator=0,delete E.indexes[N]}let k=w.events;for(;w.eventIndex<k.length;){let N=k[w.eventIndex];if(w.eventIndex+=1,N===h){E.nodes&&E.nodes.length&&(E[e]=!0,w.iterator=E.getIterator());return}else if(this.listeners[N]){w.visitors=this.listeners[N];return}}x.pop()}walkSync(x){x[e]=!0;let w=f(x);for(let E of w)if(E===h)x.nodes&&x.each(M=>{M[e]||this.walkSync(M)});else{let M=this.listeners[E];if(M&&this.visitSync(M,x.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return y.registerPostcss=C=>{v=C},ds=y,y.default=y,c.registerLazyResult(y),i.registerLazyResult(y),ds}var hs,Hi;function zu(){if(Hi)return hs;Hi=1;let e=fa(),t=Cr(),r=ma(),s=Pn(),n=Dn();class i{constructor(l,u,c){u=u.toString(),this.stringified=!1,this._processor=l,this._css=u,this._opts=c,this._map=void 0;let a,p=t;this.result=new n(this._processor,a,this._opts),this.result.css=u;let d=this;Object.defineProperty(this.result,"root",{get(){return d.root}});let h=new e(p,a,this._opts,u);if(h.isMap()){let[m,f]=h.generate();m&&(this.result.css=m),f&&(this.result.map=f)}else h.clearAnnotation(),this.result.css=h.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(l){return this.async().catch(l)}finally(l){return this.async().then(l,l)}sync(){if(this.error)throw this.error;return this.result}then(l,u){return this.async().then(l,u)}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 l,u=s;try{l=u(this._css,this._opts)}catch(c){this.error=c}if(this.error)throw this.error;return this._root=l,l}get[Symbol.toStringTag](){return"NoWorkResult"}}return hs=i,i.default=i,hs}var ps,Gi;function Wu(){if(Gi)return ps;Gi=1;let e=zu(),t=ba(),r=Tn(),s=zt();class n{constructor(o=[]){this.version="8.4.38",this.plugins=this.normalize(o)}normalize(o){let l=[];for(let u of o)if(u.postcss===!0?u=u():u.postcss&&(u=u.postcss),typeof u=="object"&&Array.isArray(u.plugins))l=l.concat(u.plugins);else if(typeof u=="object"&&u.postcssPlugin)l.push(u);else if(typeof u=="function")l.push(u);else if(!(typeof u=="object"&&(u.parse||u.stringify)))throw new Error(u+" is not a PostCSS plugin");return l}process(o,l={}){return!this.plugins.length&&!l.parser&&!l.stringifier&&!l.syntax?new e(this,o,l):new t(this,o,l)}use(o){return this.plugins=this.plugins.concat(this.normalize([o])),this}}return ps=n,n.default=n,s.registerProcessor(n),r.registerProcessor(n),ps}var fs,Yi;function qu(){if(Yi)return fs;Yi=1;let e=Rr(),t=pa(),r=Nr(),s=An(),n=Mr(),i=zt(),o=Ln();function l(u,c){if(Array.isArray(u))return u.map(d=>l(d));let{inputs:a,...p}=u;if(a){c=[];for(let d of a){let h={...d,__proto__:n.prototype};h.map&&(h.map={...h.map,__proto__:t.prototype}),c.push(h)}}if(p.nodes&&(p.nodes=u.nodes.map(d=>l(d,c))),p.source){let{inputId:d,...h}=p.source;p.source=h,d!=null&&(p.source.input=c[d])}if(p.type==="root")return new i(p);if(p.type==="decl")return new e(p);if(p.type==="rule")return new o(p);if(p.type==="comment")return new r(p);if(p.type==="atrule")return new s(p);throw new Error("Unknown node type: "+u.type)}return fs=l,l.default=l,fs}var ms,Ji;function Vu(){if(Ji)return ms;Ji=1;let e=In(),t=Rr(),r=ba(),s=rt(),n=Wu(),i=Cr(),o=qu(),l=Tn(),u=ga(),c=Nr(),a=An(),p=Dn(),d=Mr(),h=Pn(),m=ya(),f=Ln(),g=zt(),b=Er();function v(...y){return y.length===1&&Array.isArray(y[0])&&(y=y[0]),new n(y)}return v.plugin=function(C,x){let w=!1;function E(...k){console&&console.warn&&!w&&(w=!0,console.warn(C+`: postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(C+`: \\u91CC\\u9762 postcss.plugin \\u88AB\\u5F03\\u7528. \\u8FC1\\u79FB\\u6307\\u5357:\nhttps://www.w3ctech.com/topic/2226`));let N=x(...k);return N.postcssPlugin=C,N.postcssVersion=new n().version,N}let M;return Object.defineProperty(E,"postcss",{get(){return M||(M=E()),M}}),E.process=function(k,N,P){return v([E(P)]).process(k,N)},E},v.stringify=i,v.parse=h,v.fromJSON=o,v.list=m,v.comment=y=>new c(y),v.atRule=y=>new a(y),v.decl=y=>new t(y),v.rule=y=>new f(y),v.root=y=>new g(y),v.document=y=>new l(y),v.CssSyntaxError=e,v.Declaration=t,v.Container=s,v.Processor=n,v.Document=l,v.Comment=c,v.Warning=u,v.AtRule=a,v.Result=p,v.Input=d,v.Rule=f,v.Root=g,v.Node=b,r.registerPostcss(v),ms=v,v.default=v,ms}var Hu=Vu(),Z=Lu(Hu);Z.stringify;Z.fromJSON;Z.plugin;Z.parse;Z.list;Z.document;Z.comment;Z.atRule;Z.rule;Z.decl;Z.root;Z.CssSyntaxError;Z.Declaration;Z.Container;Z.Processor;Z.Document;Z.Comment;Z.Warning;Z.AtRule;Z.Result;Z.Input;Z.Rule;Z.Root;Z.Node;var Qi={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 Gu(e){let t=Qi[e.tagName]?Qi[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function Or(e,t){let r=t?.stylesWithHoverClass.get(e);if(r)return r;let s=e;try{s=Z([Du,Au]).process(e).css}catch(n){console.warn("Failed to adapt css for replay",n)}return t?.stylesWithHoverClass.set(e,s),s}function Xi(){return{stylesWithHoverClass:new Map}}var Yu="rrweb-snapshot.rebuild() cannot rebuild into an unprotected browser document. Use rebuildIntoSandboxedIframe() or set UNSAFE_allowUnprotectedRebuild: true only when you accept the script-execution risk.",Ki="rrweb-snapshot.createSandboxedIframe() requires root to be connected to a document before creating a sandboxed iframe.",va=new WeakSet;function Ju(e){if(!e||e.tagName!=="IFRAME"||!("sandbox"in e))return!1;let t=Array.from(e.sandbox);return t.length===1&&t[0]==="allow-same-origin"}function Qu(e){if(e.UNSAFE_allowUnprotectedRebuild)return;let t=e.doc.defaultView;if(t&&!(va.has(e.doc)&&Ju(t.frameElement)))throw new Error(Yu)}function Xu(e,t,r,s){let n=[];for(let c of e.childNodes)c.type===B.Text&&n.push(c);let i=t.split("/* rr_split */");for(;i.length>1&&i.length>n.length;)i.splice(-2,2,i.slice(-2).join(""));let o="";r&&(o=Or(i.join(""),s));let l=0,u=-1;for(let c=0;c<n.length&&c!==i.length;c++){let a=n[c],p=i[c],d=c<i.length-1?i[c+1]:null;if(r&&d){let h=l,m=d.length;m=Math.min(m,30);let f=!1;for(;m>2;m--){let g=d.substring(0,m),b=o.substring(l).indexOf(g);if(f=b!==-1,f){h+=b;break}}f||(h+=p.length),p=o.substring(l,h),l=h}else r&&(p=o.substring(l));u!==-1&&(p=p.substring(u)),d&&(u!==-1||p.endsWith("0p")&&d.startsWith("x"))&&(u=d.indexOf("}"),u!==-1&&(u+=1,p+=d.substring(0,u))),a.textContent=p}}function Ku(e,t,r,s){let{doc:n,hackCss:i,cache:o}=s;e.childNodes.length?Xu(e,r,i,o):(i&&(r=Or(r,o)),t.appendChild(n.createTextNode(r)))}function Zu(e,t){var r;let{doc:s,hackCss:n,cache:i}=t;switch(e.type){case B.Document:return s.implementation.createDocument(null,"",null);case B.DocumentType:return s.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case B.Element:{let o=Gu(e),l;e.isSVG?l=s.createElementNS("http://www.w3.org/2000/svg",o):(e.isCustom&&((r=s.defaultView)!=null&&r.customElements)&&!s.defaultView.customElements.get(e.tagName)&&s.defaultView.customElements.define(e.tagName,class extends s.defaultView.HTMLElement{}),l=s.createElement(o));let u={};for(let c in e.attributes){if(!Object.prototype.hasOwnProperty.call(e.attributes,c))continue;let a=e.attributes[c];if(!(o==="option"&&c==="selected"&&a===!1)&&a!==null){if(a===!0&&(a=""),c.startsWith("rr_")){u[c]=a;continue}if(typeof a=="string"){if(o==="style"&&c==="_cssText"){Ku(e,l,a,t);continue}else if(o==="textarea"&&c==="value"){l.appendChild(s.createTextNode(a)),e.childNodes=[];continue}}try{if(e.isSVG&&c==="xlink:href")l.setAttributeNS("http://www.w3.org/1999/xlink",c,a.toString());else if(c==="onload"||c==="onclick"||c.substring(0,7)==="onmouse")l.setAttribute("_"+c,a.toString());else if(o==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&c==="content"){l.setAttribute("csp-content",a.toString());continue}else o==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||o==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Nn(e.attributes.href)==="js"||(o==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?l.setAttribute("rrweb-original-srcset",e.attributes.srcset):l.setAttribute(c,a.toString()))}catch{}}}for(let c in u){let a=u[c];if(o==="canvas"&&c==="rr_dataURL"){let p=s.createElement("img");p.onload=()=>{let d=l.getContext("2d");d&&d.drawImage(p,0,0,p.width,p.height)},p.src=a.toString(),l.RRNodeType&&(l.rr_dataURL=a.toString())}else if(o==="img"&&c==="rr_dataURL"){let p=l;p.currentSrc.startsWith("data:")||(p.setAttribute("rrweb-original-src",e.attributes.src),p.src=a.toString())}if(c==="rr_width")l.style.setProperty("width",a.toString());else if(c==="rr_height")l.style.setProperty("height",a.toString());else if(c==="rr_mediaCurrentTime"&&typeof a=="number")l.currentTime=a;else if(c==="rr_mediaState")switch(a){case"played":l.play().catch(p=>console.warn("media playback error",p));break;case"paused":l.pause();break}else c==="rr_mediaPlaybackRate"&&typeof a=="number"?l.playbackRate=a:c==="rr_mediaMuted"&&typeof a=="boolean"?l.muted=a:c==="rr_mediaLoop"&&typeof a=="boolean"?l.loop=a:c==="rr_mediaVolume"&&typeof a=="number"?l.volume=a:c==="rr_open_mode"&&l.setAttribute("rr_open_mode",a)}if(e.isShadowHost)if(!l.shadowRoot)l.attachShadow({mode:"open"});else for(;l.shadowRoot.firstChild;)l.shadowRoot.removeChild(l.shadowRoot.firstChild);return(o==="input"||o==="textarea")&&l.setAttribute("autocomplete","off"),l}case B.Text:return e.isStyle&&n?s.createTextNode(Or(e.textContent,i)):s.createTextNode(e.textContent);case B.CDATA:return s.createCDATASection(e.textContent);case B.Comment:return s.createComment(e.textContent);default:return null}}function Pt(e,t){let{doc:r,mirror:s,skipChild:n=!1,hackCss:i=!0,afterAppend:o,cache:l}=t;if(s.has(e.id)){let c=s.getNode(e.id),a=s.getMeta(c);if(iu(a,e))return s.getNode(e.id)}let u=Zu(e,{doc:r,hackCss:i,cache:l});if(!u)return null;if(e.rootId&&s.getNode(e.rootId)!==r&&s.replace(e.rootId,r),e.type===B.Document&&(r.close(),r.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==B.DocumentType&&(e.childNodes[0].type===B.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?r.write(\'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">\'):r.write(\'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">\')),u=r),s.add(u,e),(e.type===B.Document||e.type===B.Element)&&!n)for(let c of e.childNodes){let a=Pt(c,{doc:r,mirror:s,skipChild:!1,hackCss:i,afterAppend:o,cache:l});if(!a){console.warn("Failed to rebuild",c);continue}if(c.isShadow&&Mn(u)&&u.shadowRoot)u.shadowRoot.appendChild(a);else if(e.type===B.Document&&c.type==B.Element){let p=a,d=null;p.childNodes.forEach(h=>{h.nodeName==="BODY"&&(d=h)}),d?(p.removeChild(d),u.appendChild(a),p.appendChild(d)):u.appendChild(a)}else u.appendChild(a);o&&o(a,c.id)}return u}function ec(e,t){function r(s){t(s)}for(let s of e.getIds())e.has(s)&&r(e.getNode(s))}function tc(e,t){let r=t.getMeta(e);if(r?.type!==B.Element)return;let s=e;for(let n in r.attributes){if(!(Object.prototype.hasOwnProperty.call(r.attributes,n)&&n.startsWith("rr_")))continue;let i=r.attributes[n];n==="rr_scrollLeft"&&(s.scrollLeft=i),n==="rr_scrollTop"&&(s.scrollTop=i)}}function rc(e,t){Qu(t);let{doc:r,onVisit:s,hackCss:n=!0,afterAppend:i,cache:o,mirror:l=new Ft}=t,u=Pt(e,{doc:r,mirror:l,skipChild:!1,hackCss:n,afterAppend:i,cache:o});return ec(l,c=>{s&&s(c),tc(c,l)}),u}function sc(e){var t;if(!e.root.isConnected)throw new Error(Ki);let r=e.root.ownerDocument.createElement("iframe");for(let[n,i]of Object.entries(e.iframeAttributes||{}))n!=="sandbox"&&r.setAttribute(n,i);r.setAttribute("sandbox","allow-same-origin"),e.root.appendChild(r);let s=r.contentDocument;if(!s||!r.contentWindow)throw(t=r.parentNode)==null||t.removeChild(r),new Error(Ki);return va.add(s),r}var nc=Object.defineProperty,ic=(e,t,r)=>t in e?nc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,T=(e,t,r)=>ic(e,typeof t!="symbol"?t+"":t,r),oc=Object.defineProperty,ac=(e,t,r)=>t in e?oc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Zi=(e,t,r)=>ac(e,typeof t!="symbol"?t+"":t,r),eo={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},to={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},It={},Zs={},ro=0,lc=()=>!!globalThis.Zone;function _n(e){if(It[e])return It[e];let t=globalThis[e],r=t.prototype,s=e in eo?eo[e]:void 0,n=!!(s&&s.every(l=>{var u,c;return!!((c=(u=Object.getOwnPropertyDescriptor(r,l))==null?void 0:u.get)!=null&&c.toString().includes("[native code]"))})),i=e in to?to[e]:void 0,o=!!(i&&i.every(l=>{var u;return typeof r[l]=="function"&&((u=r[l])==null?void 0:u.toString().includes("[native code]"))}));if(n&&o&&!lc())return It[e]=t.prototype,t.prototype;try{let l=document.createElement("iframe");l.style.display="none",document.body.appendChild(l);let u=l.contentWindow;if(!u)return t.prototype;let c=u[e].prototype;if(!c)return l.remove(),r;let a=navigator.userAgent;return a.includes("Safari")&&!a.includes("Chrome")?(l.classList.add("rr-block"),l.setAttribute("__rrwebUntaintedMutationObserver",""),Zs[e]=()=>l.remove()):l.remove(),It[e]=c}catch{return r}}var gs={};function Ne(e,t,r){var s,n;let i=(s=gs[e])==null?void 0:s[r];if(i)return i.call(t);let o=_n(e),l=(n=Object.getOwnPropertyDescriptor(o,r))==null?void 0:n.get;return l?((gs[e]||(gs[e]={}))[r]=l,l.call(t)):t[r]}var ys={};function wa(e,t,r){let s=`${e}.${String(r)}`;if(ys[s])return ys[s].bind(t);let i=_n(e)[r];return typeof i!="function"?t[r]:(ys[s]=i,i.bind(t))}function uc(e){return Ne("Node",e,"ownerDocument")}function cc(e){return Ne("Node",e,"childNodes")}function dc(e){return Ne("Node",e,"parentNode")}function hc(e){return Ne("Node",e,"parentElement")}function pc(e){return Ne("Node",e,"textContent")}function fc(e){return Ne("Node",e,"firstChild")}function mc(e){return Ne("Node",e,"lastChild")}function gc(e){return Ne("Node",e,"nextSibling")}function yc(e){return Ne("Node",e,"previousSibling")}function bc(e,t){return wa("Node",e,"contains")(t)}function vc(e){return wa("Node",e,"getRootNode")()}function wc(e){return!e||!("host"in e)?null:Ne("ShadowRoot",e,"host")}function Sc(e){return e.styleSheets}function xc(e){return!e||!("shadowRoot"in e)?null:Ne("Element",e,"shadowRoot")}function Cc(e,t){return Ne("Element",e,"querySelector")(t)}function Ec(e,t){return Ne("Element",e,"querySelectorAll")(t)}function Rc(){let e=_n("MutationObserver");ro++;let t=!1;return[e.constructor,()=>{if(t||(t=!0,--ro!==0))return;let r=Zs.MutationObserver;if(r)try{r()}finally{delete It.MutationObserver,delete Zs.MutationObserver}}]}var Sa=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Sa=()=>new Date().getTime());function Mc(e,t,r){try{if(!(t in e))return()=>{};let s=e[t],n=r(s);return typeof n=="function"&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:s}})),e[t]=n,()=>{e[t]=s}}catch{return()=>{}}}var Nc={ownerDocument:uc,childNodes:cc,parentNode:dc,parentElement:hc,textContent:pc,firstChild:fc,lastChild:mc,nextSibling:gc,previousSibling:yc,contains:bc,getRootNode:vc,host:wc,styleSheets:Sc,shadowRoot:xc,querySelector:Cc,querySelectorAll:Ec,nowTimestamp:Sa,mutationObserverCtor:Rc,patch:Mc},Oc=class{constructor(){Zi(this,"idNodeMap",new Map),Zi(this,"nodeMetaMap",new WeakMap)}getId(t){var r;return t?((r=this.getMeta(t))==null?void 0:r.id)??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){let r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n));let s=Nc.shadowRoot(t);s&&this.removeNodeFromMap(s)}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let s=r.id;this.idNodeMap.set(s,t),this.nodeMetaMap.set(t,r)}replace(t,r){let s=this.getNode(t);if(s){let n=this.nodeMetaMap.get(s);n&&this.nodeMetaMap.set(r,n)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Ic(){return new Oc}function kc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Tc(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function s(){return this instanceof s?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(s){var n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(r,s,n.get?n:{enumerable:!0,get:function(){return e[s]}})}),r}var er={exports:{}},so;function Dc(){if(so)return er.exports;so=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return er.exports=t(),er.exports.createColors=t,er.exports}var Ac={},Lc=Object.freeze(Object.defineProperty({__proto__:null,default:Ac},Symbol.toStringTag,{value:"Module"})),Fe=Tc(Lc),bs,no;function $n(){if(no)return bs;no=1;let e=Dc(),t=Fe;class r extends Error{constructor(n,i,o,l,u,c){super(n),this.name="CssSyntaxError",this.reason=n,u&&(this.file=u),l&&(this.source=l),c&&(this.plugin=c),typeof i<"u"&&typeof o<"u"&&(typeof i=="number"?(this.line=i,this.column=o):(this.line=i.line,this.column=i.column,this.endLine=o.line,this.endColumn=o.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(n){if(!this.source)return"";let i=this.source;n==null&&(n=e.isColorSupported),t&&n&&(i=t(i));let o=i.split(/\\r?\\n/),l=Math.max(this.line-3,0),u=Math.min(this.line+2,o.length),c=String(u).length,a,p;if(n){let{bold:d,gray:h,red:m}=e.createColors(!0);a=f=>d(m(f)),p=f=>h(f)}else a=p=d=>d;return o.slice(l,u).map((d,h)=>{let m=l+1+h,f=" "+(" "+m).slice(-c)+" | ";if(m===this.line){let g=p(f.replace(/\\d/g," "))+d.slice(0,this.column-1).replace(/[^\\t]/g," ");return a(">")+p(f)+d+`\n `+g+a("^")}return" "+p(f)+d}).join(`\n`)}toString(){let n=this.showSourceCode();return n&&(n=`\n\n`+n+`\n`),this.name+": "+this.message+n}}return bs=r,r.default=r,bs}var tr={},io;function Fn(){return io||(io=1,tr.isClean=Symbol("isClean"),tr.my=Symbol("my")),tr}var vs,oo;function xa(){if(oo)return vs;oo=1;let e={after:`\n`,beforeClose:`\n`,beforeComment:`\n`,beforeDecl:`\n`,beforeOpen:" ",beforeRule:`\n`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function t(s){return s[0].toUpperCase()+s.slice(1)}class r{constructor(n){this.builder=n}atrule(n,i){let o="@"+n.name,l=n.params?this.rawValue(n,"params"):"";if(typeof n.raws.afterName<"u"?o+=n.raws.afterName:l&&(o+=" "),n.nodes)this.block(n,o+l);else{let u=(n.raws.between||"")+(i?";":"");this.builder(o+l+u,n)}}beforeAfter(n,i){let o;n.type==="decl"?o=this.raw(n,null,"beforeDecl"):n.type==="comment"?o=this.raw(n,null,"beforeComment"):i==="before"?o=this.raw(n,null,"beforeRule"):o=this.raw(n,null,"beforeClose");let l=n.parent,u=0;for(;l&&l.type!=="root";)u+=1,l=l.parent;if(o.includes(`\n`)){let c=this.raw(n,null,"indent");if(c.length)for(let a=0;a<u;a++)o+=c}return o}block(n,i){let o=this.raw(n,"between","beforeOpen");this.builder(i+o+"{",n,"start");let l;n.nodes&&n.nodes.length?(this.body(n),l=this.raw(n,"after")):l=this.raw(n,"after","emptyBody"),l&&this.builder(l),this.builder("}",n,"end")}body(n){let i=n.nodes.length-1;for(;i>0&&n.nodes[i].type==="comment";)i-=1;let o=this.raw(n,"semicolon");for(let l=0;l<n.nodes.length;l++){let u=n.nodes[l],c=this.raw(u,"before");c&&this.builder(c),this.stringify(u,i!==l||o)}}comment(n){let i=this.raw(n,"left","commentLeft"),o=this.raw(n,"right","commentRight");this.builder("/*"+i+n.text+o+"*/",n)}decl(n,i){let o=this.raw(n,"between","colon"),l=n.prop+o+this.rawValue(n,"value");n.important&&(l+=n.raws.important||" !important"),i&&(l+=";"),this.builder(l,n)}document(n){this.body(n)}raw(n,i,o){let l;if(o||(o=i),i&&(l=n.raws[i],typeof l<"u"))return l;let u=n.parent;if(o==="before"&&(!u||u.type==="root"&&u.first===n||u&&u.type==="document"))return"";if(!u)return e[o];let c=n.root();if(c.rawCache||(c.rawCache={}),typeof c.rawCache[o]<"u")return c.rawCache[o];if(o==="before"||o==="after")return this.beforeAfter(n,o);{let a="raw"+t(o);this[a]?l=this[a](c,n):c.walk(p=>{if(l=p.raws[i],typeof l<"u")return!1})}return typeof l>"u"&&(l=e[o]),c.rawCache[o]=l,l}rawBeforeClose(n){let i;return n.walk(o=>{if(o.nodes&&o.nodes.length>0&&typeof o.raws.after<"u")return i=o.raws.after,i.includes(`\n`)&&(i=i.replace(/[^\\n]+$/,"")),!1}),i&&(i=i.replace(/\\S/g,"")),i}rawBeforeComment(n,i){let o;return n.walkComments(l=>{if(typeof l.raws.before<"u")return o=l.raws.before,o.includes(`\n`)&&(o=o.replace(/[^\\n]+$/,"")),!1}),typeof o>"u"?o=this.raw(i,null,"beforeDecl"):o&&(o=o.replace(/\\S/g,"")),o}rawBeforeDecl(n,i){let o;return n.walkDecls(l=>{if(typeof l.raws.before<"u")return o=l.raws.before,o.includes(`\n`)&&(o=o.replace(/[^\\n]+$/,"")),!1}),typeof o>"u"?o=this.raw(i,null,"beforeRule"):o&&(o=o.replace(/\\S/g,"")),o}rawBeforeOpen(n){let i;return n.walk(o=>{if(o.type!=="decl"&&(i=o.raws.between,typeof i<"u"))return!1}),i}rawBeforeRule(n){let i;return n.walk(o=>{if(o.nodes&&(o.parent!==n||n.first!==o)&&typeof o.raws.before<"u")return i=o.raws.before,i.includes(`\n`)&&(i=i.replace(/[^\\n]+$/,"")),!1}),i&&(i=i.replace(/\\S/g,"")),i}rawColon(n){let i;return n.walkDecls(o=>{if(typeof o.raws.between<"u")return i=o.raws.between.replace(/[^\\s:]/g,""),!1}),i}rawEmptyBody(n){let i;return n.walk(o=>{if(o.nodes&&o.nodes.length===0&&(i=o.raws.after,typeof i<"u"))return!1}),i}rawIndent(n){if(n.raws.indent)return n.raws.indent;let i;return n.walk(o=>{let l=o.parent;if(l&&l!==n&&l.parent&&l.parent===n&&typeof o.raws.before<"u"){let u=o.raws.before.split(`\n`);return i=u[u.length-1],i=i.replace(/\\S/g,""),!1}}),i}rawSemicolon(n){let i;return n.walk(o=>{if(o.nodes&&o.nodes.length&&o.last.type==="decl"&&(i=o.raws.semicolon,typeof i<"u"))return!1}),i}rawValue(n,i){let o=n[i],l=n.raws[i];return l&&l.value===o?l.raw:o}root(n){this.body(n),n.raws.after&&this.builder(n.raws.after)}rule(n){this.block(n,this.rawValue(n,"selector")),n.raws.ownSemicolon&&this.builder(n.raws.ownSemicolon,n,"end")}stringify(n,i){if(!this[n.type])throw new Error("Unknown AST node type "+n.type+". Maybe you need to change PostCSS stringifier.");this[n.type](n,i)}}return vs=r,r.default=r,vs}var ws,ao;function Ir(){if(ao)return ws;ao=1;let e=xa();function t(r,s){new e(s).stringify(r)}return ws=t,t.default=t,ws}var Ss,lo;function kr(){if(lo)return Ss;lo=1;let{isClean:e,my:t}=Fn(),r=$n(),s=xa(),n=Ir();function i(l,u){let c=new l.constructor;for(let a in l){if(!Object.prototype.hasOwnProperty.call(l,a)||a==="proxyCache")continue;let p=l[a],d=typeof p;a==="parent"&&d==="object"?u&&(c[a]=u):a==="source"?c[a]=p:Array.isArray(p)?c[a]=p.map(h=>i(h,c)):(d==="object"&&p!==null&&(p=i(p)),c[a]=p)}return c}class o{constructor(u={}){this.raws={},this[e]=!1,this[t]=!0;for(let c in u)if(c==="nodes"){this.nodes=[];for(let a of u[c])typeof a.clone=="function"?this.append(a.clone()):this.append(a)}else this[c]=u[c]}addToError(u){if(u.postcssNode=this,u.stack&&this.source&&/\\n\\s{4}at /.test(u.stack)){let c=this.source;u.stack=u.stack.replace(/\\n\\s{4}at /,`$&${c.input.from}:${c.start.line}:${c.start.column}$&`)}return u}after(u){return this.parent.insertAfter(this,u),this}assign(u={}){for(let c in u)this[c]=u[c];return this}before(u){return this.parent.insertBefore(this,u),this}cleanRaws(u){delete this.raws.before,delete this.raws.after,u||delete this.raws.between}clone(u={}){let c=i(this);for(let a in u)c[a]=u[a];return c}cloneAfter(u={}){let c=this.clone(u);return this.parent.insertAfter(this,c),c}cloneBefore(u={}){let c=this.clone(u);return this.parent.insertBefore(this,c),c}error(u,c={}){if(this.source){let{end:a,start:p}=this.rangeBy(c);return this.source.input.error(u,{column:p.column,line:p.line},{column:a.column,line:a.line},c)}return new r(u)}getProxyProcessor(){return{get(u,c){return c==="proxyOf"?u:c==="root"?()=>u.root().toProxy():u[c]},set(u,c,a){return u[c]===a||(u[c]=a,(c==="prop"||c==="value"||c==="name"||c==="params"||c==="important"||c==="text")&&u.markDirty()),!0}}}markDirty(){if(this[e]){this[e]=!1;let u=this;for(;u=u.parent;)u[e]=!1}}next(){if(!this.parent)return;let u=this.parent.index(this);return this.parent.nodes[u+1]}positionBy(u,c){let a=this.source.start;if(u.index)a=this.positionInside(u.index,c);else if(u.word){c=this.toString();let p=c.indexOf(u.word);p!==-1&&(a=this.positionInside(p,c))}return a}positionInside(u,c){let a=c||this.toString(),p=this.source.start.column,d=this.source.start.line;for(let h=0;h<u;h++)a[h]===`\n`?(p=1,d+=1):p+=1;return{column:p,line:d}}prev(){if(!this.parent)return;let u=this.parent.index(this);return this.parent.nodes[u-1]}rangeBy(u){let c={column:this.source.start.column,line:this.source.start.line},a=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:c.column+1,line:c.line};if(u.word){let p=this.toString(),d=p.indexOf(u.word);d!==-1&&(c=this.positionInside(d,p),a=this.positionInside(d+u.word.length,p))}else u.start?c={column:u.start.column,line:u.start.line}:u.index&&(c=this.positionInside(u.index)),u.end?a={column:u.end.column,line:u.end.line}:typeof u.endIndex=="number"?a=this.positionInside(u.endIndex):u.index&&(a=this.positionInside(u.index+1));return(a.line<c.line||a.line===c.line&&a.column<=c.column)&&(a={column:c.column+1,line:c.line}),{end:a,start:c}}raw(u,c){return new s().raw(this,u,c)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...u){if(this.parent){let c=this,a=!1;for(let p of u)p===this?a=!0:a?(this.parent.insertAfter(c,p),c=p):this.parent.insertBefore(c,p);a||this.remove()}return this}root(){let u=this;for(;u.parent&&u.parent.type!=="document";)u=u.parent;return u}toJSON(u,c){let a={},p=c==null;c=c||new Map;let d=0;for(let h in this){if(!Object.prototype.hasOwnProperty.call(this,h)||h==="parent"||h==="proxyCache")continue;let m=this[h];if(Array.isArray(m))a[h]=m.map(f=>typeof f=="object"&&f.toJSON?f.toJSON(null,c):f);else if(typeof m=="object"&&m.toJSON)a[h]=m.toJSON(null,c);else if(h==="source"){let f=c.get(m.input);f==null&&(f=d,c.set(m.input,d),d++),a[h]={end:m.end,inputId:f,start:m.start}}else a[h]=m}return p&&(a.inputs=[...c.keys()].map(h=>h.toJSON())),a}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(u=n){u.stringify&&(u=u.stringify);let c="";return u(this,a=>{c+=a}),c}warn(u,c,a){let p={node:this};for(let d in a)p[d]=a[d];return u.warn(c,p)}get proxyOf(){return this}}return Ss=o,o.default=o,Ss}var xs,uo;function Tr(){if(uo)return xs;uo=1;let e=kr();class t extends e{constructor(s){s&&typeof s.value<"u"&&typeof s.value!="string"&&(s={...s,value:String(s.value)}),super(s),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}}return xs=t,t.default=t,xs}var Cs,co;function Pc(){if(co)return Cs;co=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return Cs={nanoid:(s=21)=>{let n="",i=s;for(;i--;)n+=e[Math.random()*64|0];return n},customAlphabet:(s,n=21)=>(i=n)=>{let o="",l=i;for(;l--;)o+=s[Math.random()*s.length|0];return o}},Cs}var Es,ho;function Ca(){if(ho)return Es;ho=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Fe,{existsSync:r,readFileSync:s}=Fe,{dirname:n,join:i}=Fe;function o(u){return Buffer?Buffer.from(u,"base64").toString():window.atob(u)}class l{constructor(c,a){if(a.map===!1)return;this.loadAnnotation(c),this.inline=this.startWith(this.annotation,"data:");let p=a.map?a.map.prev:void 0,d=this.loadMap(a.from,p);!this.mapFile&&a.from&&(this.mapFile=a.from),this.mapFile&&(this.root=n(this.mapFile)),d&&(this.text=d)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(c){let a=/^data:application\\/json;charset=utf-?8;base64,/,p=/^data:application\\/json;base64,/,d=/^data:application\\/json;charset=utf-?8,/,h=/^data:application\\/json,/;if(d.test(c)||h.test(c))return decodeURIComponent(c.substr(RegExp.lastMatch.length));if(a.test(c)||p.test(c))return o(c.substr(RegExp.lastMatch.length));let m=c.match(/data:application\\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+m)}getAnnotationURL(c){return c.replace(/^\\/\\*\\s*# sourceMappingURL=/,"").trim()}isMap(c){return typeof c!="object"?!1:typeof c.mappings=="string"||typeof c._mappings=="string"||Array.isArray(c.sections)}loadAnnotation(c){let a=c.match(/\\/\\*\\s*# sourceMappingURL=/gm);if(!a)return;let p=c.lastIndexOf(a.pop()),d=c.indexOf("*/",p);p>-1&&d>-1&&(this.annotation=this.getAnnotationURL(c.substring(p,d)))}loadFile(c){if(this.root=n(c),r(c))return this.mapFile=c,s(c,"utf-8").toString().trim()}loadMap(c,a){if(a===!1)return!1;if(a){if(typeof a=="string")return a;if(typeof a=="function"){let p=a(c);if(p){let d=this.loadFile(p);if(!d)throw new Error("Unable to load previous source map: "+p.toString());return d}}else{if(a instanceof e)return t.fromSourceMap(a).toString();if(a instanceof t)return a.toString();if(this.isMap(a))return JSON.stringify(a);throw new Error("Unsupported previous source map format: "+a.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let p=this.annotation;return c&&(p=i(n(c),p)),this.loadFile(p)}}}startWith(c,a){return c?c.substr(0,a.length)===a:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Es=l,l.default=l,Es}var Rs,po;function Dr(){if(po)return Rs;po=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Fe,{fileURLToPath:r,pathToFileURL:s}=Fe,{isAbsolute:n,resolve:i}=Fe,{nanoid:o}=Pc(),l=Fe,u=$n(),c=Ca(),a=Symbol("fromOffsetCache"),p=!!(e&&t),d=!!(i&&n);class h{constructor(f,g={}){if(f===null||typeof f>"u"||typeof f=="object"&&!f.toString)throw new Error(`PostCSS received ${f} instead of CSS string`);if(this.css=f.toString(),this.css[0]==="\\uFEFF"||this.css[0]==="\\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,g.from&&(!d||/^\\w+:\\/\\//.test(g.from)||n(g.from)?this.file=g.from:this.file=i(g.from)),d&&p){let b=new c(this.css,g);if(b.text){this.map=b;let v=b.consumer().file;!this.file&&v&&(this.file=this.mapResolve(v))}}this.file||(this.id="<input css "+o(6)+">"),this.map&&(this.map.file=this.from)}error(f,g,b,v={}){let y,C,x;if(g&&typeof g=="object"){let E=g,M=b;if(typeof E.offset=="number"){let k=this.fromOffset(E.offset);g=k.line,b=k.col}else g=E.line,b=E.column;if(typeof M.offset=="number"){let k=this.fromOffset(M.offset);C=k.line,x=k.col}else C=M.line,x=M.column}else if(!b){let E=this.fromOffset(g);g=E.line,b=E.col}let w=this.origin(g,b,C,x);return w?y=new u(f,w.endLine===void 0?w.line:{column:w.column,line:w.line},w.endLine===void 0?w.column:{column:w.endColumn,line:w.endLine},w.source,w.file,v.plugin):y=new u(f,C===void 0?g:{column:b,line:g},C===void 0?b:{column:x,line:C},this.css,this.file,v.plugin),y.input={column:b,endColumn:x,endLine:C,line:g,source:this.css},this.file&&(s&&(y.input.url=s(this.file).toString()),y.input.file=this.file),y}fromOffset(f){let g,b;if(this[a])b=this[a];else{let y=this.css.split(`\n`);b=new Array(y.length);let C=0;for(let x=0,w=y.length;x<w;x++)b[x]=C,C+=y[x].length+1;this[a]=b}g=b[b.length-1];let v=0;if(f>=g)v=b.length-1;else{let y=b.length-2,C;for(;v<y;)if(C=v+(y-v>>1),f<b[C])y=C-1;else if(f>=b[C+1])v=C+1;else{v=C;break}}return{col:f-b[v]+1,line:v+1}}mapResolve(f){return/^\\w+:\\/\\//.test(f)?f:i(this.map.consumer().sourceRoot||this.map.root||".",f)}origin(f,g,b,v){if(!this.map)return!1;let y=this.map.consumer(),C=y.originalPositionFor({column:g,line:f});if(!C.source)return!1;let x;typeof b=="number"&&(x=y.originalPositionFor({column:v,line:b}));let w;n(C.source)?w=s(C.source):w=new URL(C.source,this.map.consumer().sourceRoot||s(this.map.mapFile));let E={column:C.column,endColumn:x&&x.column,endLine:x&&x.line,line:C.line,url:w.toString()};if(w.protocol==="file:")if(r)E.file=r(w);else throw new Error("file: protocol is not available in this PostCSS build");let M=y.sourceContentFor(C.source);return M&&(E.source=M),E}toJSON(){let f={};for(let g of["hasBOM","css","file","id"])this[g]!=null&&(f[g]=this[g]);return this.map&&(f.map={...this.map},f.map.consumerCache&&(f.map.consumerCache=void 0)),f}get from(){return this.file||this.id}}return Rs=h,h.default=h,l&&l.registerInput&&l.registerInput(h),Rs}var Ms,fo;function Ea(){if(fo)return Ms;fo=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Fe,{dirname:r,relative:s,resolve:n,sep:i}=Fe,{pathToFileURL:o}=Fe,l=Dr(),u=!!(e&&t),c=!!(r&&n&&s&&i);class a{constructor(d,h,m,f){this.stringify=d,this.mapOpts=m.map||{},this.root=h,this.opts=m,this.css=f,this.originalCSS=f,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let d;this.isInline()?d="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?d=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?d=this.mapOpts.annotation(this.opts.to,this.root):d=this.outputFile()+".map";let h=`\n`;this.css.includes(`\\r\n`)&&(h=`\\r\n`),this.css+=h+"/*# sourceMappingURL="+d+" */"}applyPrevMaps(){for(let d of this.previous()){let h=this.toUrl(this.path(d.file)),m=d.root||r(d.file),f;this.mapOpts.sourcesContent===!1?(f=new e(d.text),f.sourcesContent&&(f.sourcesContent=null)):f=d.consumer(),this.map.applySourceMap(f,h,this.toUrl(this.path(m)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let d;for(let h=this.root.nodes.length-1;h>=0;h--)d=this.root.nodes[h],d.type==="comment"&&d.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(h)}else this.css&&(this.css=this.css.replace(/\\n*?\\/\\*#[\\S\\s]*?\\*\\/$/gm,""))}generate(){if(this.clearAnnotation(),c&&u&&this.isMap())return this.generateMap();{let d="";return this.stringify(this.root,h=>{d+=h}),[d]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let d=this.previous()[0].consumer();d.file=this.outputFile(),this.map=t.fromSourceMap(d,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<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 t({file:this.outputFile(),ignoreInvalidMapping:!0});let d=1,h=1,m="<no source>",f={generated:{column:0,line:0},original:{column:0,line:0},source:""},g,b;this.stringify(this.root,(v,y,C)=>{if(this.css+=v,y&&C!=="end"&&(f.generated.line=d,f.generated.column=h-1,y.source&&y.source.start?(f.source=this.sourcePath(y),f.original.line=y.source.start.line,f.original.column=y.source.start.column-1,this.map.addMapping(f)):(f.source=m,f.original.line=1,f.original.column=0,this.map.addMapping(f))),g=v.match(/\\n/g),g?(d+=g.length,b=v.lastIndexOf(`\n`),h=v.length-b):h+=v.length,y&&C!=="start"){let x=y.parent||{raws:{}};(!(y.type==="decl"||y.type==="atrule"&&!y.nodes)||y!==x.last||x.raws.semicolon)&&(y.source&&y.source.end?(f.source=this.sourcePath(y),f.original.line=y.source.end.line,f.original.column=y.source.end.column-1,f.generated.line=d,f.generated.column=h-2,this.map.addMapping(f)):(f.source=m,f.original.line=1,f.original.column=0,f.generated.line=d,f.generated.column=h-1,this.map.addMapping(f)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(d=>d.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let d=this.mapOpts.annotation;return typeof d<"u"&&d!==!0?!1:this.previous().length?this.previous().some(h=>h.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(d=>d.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(d){if(this.mapOpts.absolute||d.charCodeAt(0)===60||/^\\w+:\\/\\//.test(d))return d;let h=this.memoizedPaths.get(d);if(h)return h;let m=this.opts.to?r(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(m=r(n(m,this.mapOpts.annotation)));let f=s(m,d);return this.memoizedPaths.set(d,f),f}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(d=>{if(d.source&&d.source.input.map){let h=d.source.input.map;this.previousMaps.includes(h)||this.previousMaps.push(h)}});else{let d=new l(this.originalCSS,this.opts);d.map&&this.previousMaps.push(d.map)}return this.previousMaps}setSourcesContent(){let d={};if(this.root)this.root.walk(h=>{if(h.source){let m=h.source.input.from;if(m&&!d[m]){d[m]=!0;let f=this.usesFileUrls?this.toFileUrl(m):this.toUrl(this.path(m));this.map.setSourceContent(f,h.source.input.css)}}});else if(this.css){let h=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(h,this.css)}}sourcePath(d){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(d.source.input.from):this.toUrl(this.path(d.source.input.from))}toBase64(d){return Buffer?Buffer.from(d).toString("base64"):window.btoa(unescape(encodeURIComponent(d)))}toFileUrl(d){let h=this.memoizedFileURLs.get(d);if(h)return h;if(o){let m=o(d).toString();return this.memoizedFileURLs.set(d,m),m}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(d){let h=this.memoizedURLs.get(d);if(h)return h;i==="\\\\"&&(d=d.replace(/\\\\/g,"/"));let m=encodeURI(d).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(d,m),m}}return Ms=a,Ms}var Ns,mo;function Ar(){if(mo)return Ns;mo=1;let e=kr();class t extends e{constructor(s){super(s),this.type="comment"}}return Ns=t,t.default=t,Ns}var Os,go;function st(){if(go)return Os;go=1;let{isClean:e,my:t}=Fn(),r=Tr(),s=Ar(),n=kr(),i,o,l,u;function c(d){return d.map(h=>(h.nodes&&(h.nodes=c(h.nodes)),delete h.source,h))}function a(d){if(d[e]=!1,d.proxyOf.nodes)for(let h of d.proxyOf.nodes)a(h)}class p extends n{append(...h){for(let m of h){let f=this.normalize(m,this.last);for(let g of f)this.proxyOf.nodes.push(g)}return this.markDirty(),this}cleanRaws(h){if(super.cleanRaws(h),this.nodes)for(let m of this.nodes)m.cleanRaws(h)}each(h){if(!this.proxyOf.nodes)return;let m=this.getIterator(),f,g;for(;this.indexes[m]<this.proxyOf.nodes.length&&(f=this.indexes[m],g=h(this.proxyOf.nodes[f],f),g!==!1);)this.indexes[m]+=1;return delete this.indexes[m],g}every(h){return this.nodes.every(h)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let h=this.lastEach;return this.indexes[h]=0,h}getProxyProcessor(){return{get(h,m){return m==="proxyOf"?h:h[m]?m==="each"||typeof m=="string"&&m.startsWith("walk")?(...f)=>h[m](...f.map(g=>typeof g=="function"?(b,v)=>g(b.toProxy(),v):g)):m==="every"||m==="some"?f=>h[m]((g,...b)=>f(g.toProxy(),...b)):m==="root"?()=>h.root().toProxy():m==="nodes"?h.nodes.map(f=>f.toProxy()):m==="first"||m==="last"?h[m].toProxy():h[m]:h[m]},set(h,m,f){return h[m]===f||(h[m]=f,(m==="name"||m==="params"||m==="selector")&&h.markDirty()),!0}}}index(h){return typeof h=="number"?h:(h.proxyOf&&(h=h.proxyOf),this.proxyOf.nodes.indexOf(h))}insertAfter(h,m){let f=this.index(h),g=this.normalize(m,this.proxyOf.nodes[f]).reverse();f=this.index(h);for(let v of g)this.proxyOf.nodes.splice(f+1,0,v);let b;for(let v in this.indexes)b=this.indexes[v],f<b&&(this.indexes[v]=b+g.length);return this.markDirty(),this}insertBefore(h,m){let f=this.index(h),g=f===0?"prepend":!1,b=this.normalize(m,this.proxyOf.nodes[f],g).reverse();f=this.index(h);for(let y of b)this.proxyOf.nodes.splice(f,0,y);let v;for(let y in this.indexes)v=this.indexes[y],f<=v&&(this.indexes[y]=v+b.length);return this.markDirty(),this}normalize(h,m){if(typeof h=="string")h=c(i(h).nodes);else if(typeof h>"u")h=[];else if(Array.isArray(h)){h=h.slice(0);for(let g of h)g.parent&&g.parent.removeChild(g,"ignore")}else if(h.type==="root"&&this.type!=="document"){h=h.nodes.slice(0);for(let g of h)g.parent&&g.parent.removeChild(g,"ignore")}else if(h.type)h=[h];else if(h.prop){if(typeof h.value>"u")throw new Error("Value field is missed in node creation");typeof h.value!="string"&&(h.value=String(h.value)),h=[new r(h)]}else if(h.selector)h=[new o(h)];else if(h.name)h=[new l(h)];else if(h.text)h=[new s(h)];else throw new Error("Unknown node type in node creation");return h.map(g=>(g[t]||p.rebuild(g),g=g.proxyOf,g.parent&&g.parent.removeChild(g),g[e]&&a(g),typeof g.raws.before>"u"&&m&&typeof m.raws.before<"u"&&(g.raws.before=m.raws.before.replace(/\\S/g,"")),g.parent=this.proxyOf,g))}prepend(...h){h=h.reverse();for(let m of h){let f=this.normalize(m,this.first,"prepend").reverse();for(let g of f)this.proxyOf.nodes.unshift(g);for(let g in this.indexes)this.indexes[g]=this.indexes[g]+f.length}return this.markDirty(),this}push(h){return h.parent=this,this.proxyOf.nodes.push(h),this}removeAll(){for(let h of this.proxyOf.nodes)h.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(h){h=this.index(h),this.proxyOf.nodes[h].parent=void 0,this.proxyOf.nodes.splice(h,1);let m;for(let f in this.indexes)m=this.indexes[f],m>=h&&(this.indexes[f]=m-1);return this.markDirty(),this}replaceValues(h,m,f){return f||(f=m,m={}),this.walkDecls(g=>{m.props&&!m.props.includes(g.prop)||m.fast&&!g.value.includes(m.fast)||(g.value=g.value.replace(h,f))}),this.markDirty(),this}some(h){return this.nodes.some(h)}walk(h){return this.each((m,f)=>{let g;try{g=h(m,f)}catch(b){throw m.addToError(b)}return g!==!1&&m.walk&&(g=m.walk(h)),g})}walkAtRules(h,m){return m?h instanceof RegExp?this.walk((f,g)=>{if(f.type==="atrule"&&h.test(f.name))return m(f,g)}):this.walk((f,g)=>{if(f.type==="atrule"&&f.name===h)return m(f,g)}):(m=h,this.walk((f,g)=>{if(f.type==="atrule")return m(f,g)}))}walkComments(h){return this.walk((m,f)=>{if(m.type==="comment")return h(m,f)})}walkDecls(h,m){return m?h instanceof RegExp?this.walk((f,g)=>{if(f.type==="decl"&&h.test(f.prop))return m(f,g)}):this.walk((f,g)=>{if(f.type==="decl"&&f.prop===h)return m(f,g)}):(m=h,this.walk((f,g)=>{if(f.type==="decl")return m(f,g)}))}walkRules(h,m){return m?h instanceof RegExp?this.walk((f,g)=>{if(f.type==="rule"&&h.test(f.selector))return m(f,g)}):this.walk((f,g)=>{if(f.type==="rule"&&f.selector===h)return m(f,g)}):(m=h,this.walk((f,g)=>{if(f.type==="rule")return m(f,g)}))}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]}}return p.registerParse=d=>{i=d},p.registerRule=d=>{o=d},p.registerAtRule=d=>{l=d},p.registerRoot=d=>{u=d},Os=p,p.default=p,p.rebuild=d=>{d.type==="atrule"?Object.setPrototypeOf(d,l.prototype):d.type==="rule"?Object.setPrototypeOf(d,o.prototype):d.type==="decl"?Object.setPrototypeOf(d,r.prototype):d.type==="comment"?Object.setPrototypeOf(d,s.prototype):d.type==="root"&&Object.setPrototypeOf(d,u.prototype),d[t]=!0,d.nodes&&d.nodes.forEach(h=>{p.rebuild(h)})},Os}var Is,yo;function Un(){if(yo)return Is;yo=1;let e=st(),t,r;class s extends e{constructor(i){super({type:"document",...i}),this.nodes||(this.nodes=[])}toResult(i={}){return new t(new r,this,i).stringify()}}return s.registerLazyResult=n=>{t=n},s.registerProcessor=n=>{r=n},Is=s,s.default=s,Is}var ks,bo;function Ra(){if(bo)return ks;bo=1;let e={};return ks=function(r){e[r]||(e[r]=!0,typeof console<"u"&&console.warn&&console.warn(r))},ks}var Ts,vo;function Ma(){if(vo)return Ts;vo=1;class e{constructor(r,s={}){if(this.type="warning",this.text=r,s.node&&s.node.source){let n=s.node.rangeBy(s);this.line=n.start.line,this.column=n.start.column,this.endLine=n.end.line,this.endColumn=n.end.column}for(let n in s)this[n]=s[n]}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}}return Ts=e,e.default=e,Ts}var Ds,wo;function Bn(){if(wo)return Ds;wo=1;let e=Ma();class t{constructor(s,n,i){this.processor=s,this.messages=[],this.root=n,this.opts=i,this.css=void 0,this.map=void 0}toString(){return this.css}warn(s,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let i=new e(s,n);return this.messages.push(i),i}warnings(){return this.messages.filter(s=>s.type==="warning")}get content(){return this.css}}return Ds=t,t.default=t,Ds}var As,So;function _c(){if(So)return As;So=1;let e=39,t=34,r=92,s=47,n=10,i=32,o=12,l=9,u=13,c=91,a=93,p=40,d=41,h=123,m=125,f=59,g=42,b=58,v=64,y=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/g,C=/[\\t\\n\\f\\r !"#\'():;@[\\\\\\]{}]|\\/(?=\\*)/g,x=/.[\\r\\n"\'(/\\\\]/,w=/[\\da-f]/i;return As=function(M,k={}){let N=M.css.valueOf(),P=k.ignoreErrors,A,R,Ce,be,V,_,K,ue,ne,Y,Ye=N.length,I=0,Be=[],Ie=[];function vt(){return I}function ve($){throw M.error("Unclosed "+$,I)}function Ee(){return Ie.length===0&&I>=Ye}function et($){if(Ie.length)return Ie.pop();if(I>=Ye)return;let ce=$?$.ignoreUnclosed:!1;switch(A=N.charCodeAt(I),A){case n:case i:case l:case u:case o:{R=I;do R+=1,A=N.charCodeAt(R);while(A===i||A===n||A===l||A===u||A===o);Y=["space",N.slice(I,R)],I=R-1;break}case c:case a:case h:case m:case b:case f:case d:{let U=String.fromCharCode(A);Y=[U,U,I];break}case p:{if(ue=Be.length?Be.pop()[1]:"",ne=N.charCodeAt(I+1),ue==="url"&&ne!==e&&ne!==t&&ne!==i&&ne!==n&&ne!==l&&ne!==o&&ne!==u){R=I;do{if(_=!1,R=N.indexOf(")",R+1),R===-1)if(P||ce){R=I;break}else ve("bracket");for(K=R;N.charCodeAt(K-1)===r;)K-=1,_=!_}while(_);Y=["brackets",N.slice(I,R+1),I,R],I=R}else R=N.indexOf(")",I+1),be=N.slice(I,R+1),R===-1||x.test(be)?Y=["(","(",I]:(Y=["brackets",be,I,R],I=R);break}case e:case t:{Ce=A===e?"\'":\'"\',R=I;do{if(_=!1,R=N.indexOf(Ce,R+1),R===-1)if(P||ce){R=I+1;break}else ve("string");for(K=R;N.charCodeAt(K-1)===r;)K-=1,_=!_}while(_);Y=["string",N.slice(I,R+1),I,R],I=R;break}case v:{y.lastIndex=I+1,y.test(N),y.lastIndex===0?R=N.length-1:R=y.lastIndex-2,Y=["at-word",N.slice(I,R+1),I,R],I=R;break}case r:{for(R=I,V=!0;N.charCodeAt(R+1)===r;)R+=1,V=!V;if(A=N.charCodeAt(R+1),V&&A!==s&&A!==i&&A!==n&&A!==l&&A!==u&&A!==o&&(R+=1,w.test(N.charAt(R)))){for(;w.test(N.charAt(R+1));)R+=1;N.charCodeAt(R+1)===i&&(R+=1)}Y=["word",N.slice(I,R+1),I,R],I=R;break}default:{A===s&&N.charCodeAt(I+1)===g?(R=N.indexOf("*/",I+2)+1,R===0&&(P||ce?R=N.length:ve("comment")),Y=["comment",N.slice(I,R+1),I,R],I=R):(C.lastIndex=I+1,C.test(N),C.lastIndex===0?R=N.length-1:R=C.lastIndex-2,Y=["word",N.slice(I,R+1),I,R],Be.push(Y),I=R);break}}return I++,Y}function je($){Ie.push($)}return{back:je,endOfFile:Ee,nextToken:et,position:vt}},As}var Ls,xo;function jn(){if(xo)return Ls;xo=1;let e=st();class t extends e{constructor(s){super(s),this.type="atrule"}append(...s){return this.proxyOf.nodes||(this.nodes=[]),super.append(...s)}prepend(...s){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...s)}}return Ls=t,t.default=t,e.registerAtRule(t),Ls}var Ps,Co;function Wt(){if(Co)return Ps;Co=1;let e=st(),t,r;class s extends e{constructor(i){super(i),this.type="root",this.nodes||(this.nodes=[])}normalize(i,o,l){let u=super.normalize(i);if(o){if(l==="prepend")this.nodes.length>1?o.raws.before=this.nodes[1].raws.before:delete o.raws.before;else if(this.first!==o)for(let c of u)c.raws.before=o.raws.before}return u}removeChild(i,o){let l=this.index(i);return!o&&l===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[l].raws.before),super.removeChild(i)}toResult(i={}){return new t(new r,this,i).stringify()}}return s.registerLazyResult=n=>{t=n},s.registerProcessor=n=>{r=n},Ps=s,s.default=s,e.registerRoot(s),Ps}var _s,Eo;function Na(){if(Eo)return _s;Eo=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let r=[" ",`\n`," "];return e.split(t,r)},split(t,r,s){let n=[],i="",o=!1,l=0,u=!1,c="",a=!1;for(let p of t)a?a=!1:p==="\\\\"?a=!0:u?p===c&&(u=!1):p===\'"\'||p==="\'"?(u=!0,c=p):p==="("?l+=1:p===")"?l>0&&(l-=1):l===0&&r.includes(p)&&(o=!0),o?(i!==""&&n.push(i.trim()),i="",o=!1):i+=p;return(s||i!=="")&&n.push(i.trim()),n}};return _s=e,e.default=e,_s}var $s,Ro;function zn(){if(Ro)return $s;Ro=1;let e=st(),t=Na();class r extends e{constructor(n){super(n),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(n){let i=this.selector?this.selector.match(/,\\s*/):null,o=i?i[0]:","+this.raw("between","beforeOpen");this.selector=n.join(o)}}return $s=r,r.default=r,e.registerRule(r),$s}var Fs,Mo;function $c(){if(Mo)return Fs;Mo=1;let e=Tr(),t=_c(),r=Ar(),s=jn(),n=Wt(),i=zn(),o={empty:!0,space:!0};function l(c){for(let a=c.length-1;a>=0;a--){let p=c[a],d=p[3]||p[2];if(d)return d}}class u{constructor(a){this.input=a,this.root=new n,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:a,start:{column:1,line:1,offset:0}}}atrule(a){let p=new s;p.name=a[1].slice(1),p.name===""&&this.unnamedAtrule(p,a),this.init(p,a[2]);let d,h,m,f=!1,g=!1,b=[],v=[];for(;!this.tokenizer.endOfFile();){if(a=this.tokenizer.nextToken(),d=a[0],d==="("||d==="["?v.push(d==="("?")":"]"):d==="{"&&v.length>0?v.push("}"):d===v[v.length-1]&&v.pop(),v.length===0)if(d===";"){p.source.end=this.getPosition(a[2]),p.source.end.offset++,this.semicolon=!0;break}else if(d==="{"){g=!0;break}else if(d==="}"){if(b.length>0){for(m=b.length-1,h=b[m];h&&h[0]==="space";)h=b[--m];h&&(p.source.end=this.getPosition(h[3]||h[2]),p.source.end.offset++)}this.end(a);break}else b.push(a);else b.push(a);if(this.tokenizer.endOfFile()){f=!0;break}}p.raws.between=this.spacesAndCommentsFromEnd(b),b.length?(p.raws.afterName=this.spacesAndCommentsFromStart(b),this.raw(p,"params",b),f&&(a=b[b.length-1],p.source.end=this.getPosition(a[3]||a[2]),p.source.end.offset++,this.spaces=p.raws.between,p.raws.between="")):(p.raws.afterName="",p.params=""),g&&(p.nodes=[],this.current=p)}checkMissedSemicolon(a){let p=this.colon(a);if(p===!1)return;let d=0,h;for(let m=p-1;m>=0&&(h=a[m],!(h[0]!=="space"&&(d+=1,d===2)));m--);throw this.input.error("Missed semicolon",h[0]==="word"?h[3]+1:h[2])}colon(a){let p=0,d,h,m;for(let[f,g]of a.entries()){if(d=g,h=d[0],h==="("&&(p+=1),h===")"&&(p-=1),p===0&&h===":")if(!m)this.doubleColon(d);else{if(m[0]==="word"&&m[1]==="progid")continue;return f}m=d}return!1}comment(a){let p=new r;this.init(p,a[2]),p.source.end=this.getPosition(a[3]||a[2]),p.source.end.offset++;let d=a[1].slice(2,-2);if(/^\\s*$/.test(d))p.text="",p.raws.left=d,p.raws.right="";else{let h=d.match(/^(\\s*)([^]*\\S)(\\s*)$/);p.text=h[2],p.raws.left=h[1],p.raws.right=h[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(a,p){let d=new e;this.init(d,a[0][2]);let h=a[a.length-1];for(h[0]===";"&&(this.semicolon=!0,a.pop()),d.source.end=this.getPosition(h[3]||h[2]||l(a)),d.source.end.offset++;a[0][0]!=="word";)a.length===1&&this.unknownWord(a),d.raws.before+=a.shift()[1];for(d.source.start=this.getPosition(a[0][2]),d.prop="";a.length;){let v=a[0][0];if(v===":"||v==="space"||v==="comment")break;d.prop+=a.shift()[1]}d.raws.between="";let m;for(;a.length;)if(m=a.shift(),m[0]===":"){d.raws.between+=m[1];break}else m[0]==="word"&&/\\w/.test(m[1])&&this.unknownWord([m]),d.raws.between+=m[1];(d.prop[0]==="_"||d.prop[0]==="*")&&(d.raws.before+=d.prop[0],d.prop=d.prop.slice(1));let f=[],g;for(;a.length&&(g=a[0][0],!(g!=="space"&&g!=="comment"));)f.push(a.shift());this.precheckMissedSemicolon(a);for(let v=a.length-1;v>=0;v--){if(m=a[v],m[1].toLowerCase()==="!important"){d.important=!0;let y=this.stringFrom(a,v);y=this.spacesFromEnd(a)+y,y!==" !important"&&(d.raws.important=y);break}else if(m[1].toLowerCase()==="important"){let y=a.slice(0),C="";for(let x=v;x>0;x--){let w=y[x][0];if(C.trim().indexOf("!")===0&&w!=="space")break;C=y.pop()[1]+C}C.trim().indexOf("!")===0&&(d.important=!0,d.raws.important=C,a=y)}if(m[0]!=="space"&&m[0]!=="comment")break}a.some(v=>v[0]!=="space"&&v[0]!=="comment")&&(d.raws.between+=f.map(v=>v[1]).join(""),f=[]),this.raw(d,"value",f.concat(a),p),d.value.includes(":")&&!p&&this.checkMissedSemicolon(a)}doubleColon(a){throw this.input.error("Double colon",{offset:a[2]},{offset:a[2]+a[1].length})}emptyRule(a){let p=new i;this.init(p,a[2]),p.selector="",p.raws.between="",this.current=p}end(a){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(a[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(a)}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(a){if(this.spaces+=a[1],this.current.nodes){let p=this.current.nodes[this.current.nodes.length-1];p&&p.type==="rule"&&!p.raws.ownSemicolon&&(p.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(a){let p=this.input.fromOffset(a);return{column:p.col,line:p.line,offset:a}}init(a,p){this.current.push(a),a.source={input:this.input,start:this.getPosition(p)},a.raws.before=this.spaces,this.spaces="",a.type!=="comment"&&(this.semicolon=!1)}other(a){let p=!1,d=null,h=!1,m=null,f=[],g=a[1].startsWith("--"),b=[],v=a;for(;v;){if(d=v[0],b.push(v),d==="("||d==="[")m||(m=v),f.push(d==="("?")":"]");else if(g&&h&&d==="{")m||(m=v),f.push("}");else if(f.length===0)if(d===";")if(h){this.decl(b,g);return}else break;else if(d==="{"){this.rule(b);return}else if(d==="}"){this.tokenizer.back(b.pop()),p=!0;break}else d===":"&&(h=!0);else d===f[f.length-1]&&(f.pop(),f.length===0&&(m=null));v=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(p=!0),f.length>0&&this.unclosedBracket(m),p&&h){if(!g)for(;b.length&&(v=b[b.length-1][0],!(v!=="space"&&v!=="comment"));)this.tokenizer.back(b.pop());this.decl(b,g)}else this.unknownWord(b)}parse(){let a;for(;!this.tokenizer.endOfFile();)switch(a=this.tokenizer.nextToken(),a[0]){case"space":this.spaces+=a[1];break;case";":this.freeSemicolon(a);break;case"}":this.end(a);break;case"comment":this.comment(a);break;case"at-word":this.atrule(a);break;case"{":this.emptyRule(a);break;default:this.other(a);break}this.endFile()}precheckMissedSemicolon(){}raw(a,p,d,h){let m,f,g=d.length,b="",v=!0,y,C;for(let x=0;x<g;x+=1)m=d[x],f=m[0],f==="space"&&x===g-1&&!h?v=!1:f==="comment"?(C=d[x-1]?d[x-1][0]:"empty",y=d[x+1]?d[x+1][0]:"empty",!o[C]&&!o[y]?b.slice(-1)===","?v=!1:b+=m[1]:v=!1):b+=m[1];if(!v){let x=d.reduce((w,E)=>w+E[1],"");a.raws[p]={raw:x,value:b}}a[p]=b}rule(a){a.pop();let p=new i;this.init(p,a[0][2]),p.raws.between=this.spacesAndCommentsFromEnd(a),this.raw(p,"selector",a),this.current=p}spacesAndCommentsFromEnd(a){let p,d="";for(;a.length&&(p=a[a.length-1][0],!(p!=="space"&&p!=="comment"));)d=a.pop()[1]+d;return d}spacesAndCommentsFromStart(a){let p,d="";for(;a.length&&(p=a[0][0],!(p!=="space"&&p!=="comment"));)d+=a.shift()[1];return d}spacesFromEnd(a){let p,d="";for(;a.length&&(p=a[a.length-1][0],p==="space");)d=a.pop()[1]+d;return d}stringFrom(a,p){let d="";for(let h=p;h<a.length;h++)d+=a[h][1];return a.splice(p,a.length-p),d}unclosedBlock(){let a=this.current.source.start;throw this.input.error("Unclosed block",a.line,a.column)}unclosedBracket(a){throw this.input.error("Unclosed bracket",{offset:a[2]},{offset:a[2]+1})}unexpectedClose(a){throw this.input.error("Unexpected }",{offset:a[2]},{offset:a[2]+1})}unknownWord(a){throw this.input.error("Unknown word",{offset:a[0][2]},{offset:a[0][2]+a[0][1].length})}unnamedAtrule(a,p){throw this.input.error("At-rule without name",{offset:p[2]},{offset:p[2]+p[1].length})}}return Fs=u,Fs}var Us,No;function Wn(){if(No)return Us;No=1;let e=st(),t=$c(),r=Dr();function s(n,i){let o=new r(n,i),l=new t(o);try{l.parse()}catch(u){throw u}return l.root}return Us=s,s.default=s,e.registerParse(s),Us}var Bs,Oo;function Oa(){if(Oo)return Bs;Oo=1;let{isClean:e,my:t}=Fn(),r=Ea(),s=Ir(),n=st(),i=Un(),o=Ra(),l=Bn(),u=Wn(),c=Wt(),a={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},p={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},d={Once:!0,postcssPlugin:!0,prepare:!0},h=0;function m(C){return typeof C=="object"&&typeof C.then=="function"}function f(C){let x=!1,w=a[C.type];return C.type==="decl"?x=C.prop.toLowerCase():C.type==="atrule"&&(x=C.name.toLowerCase()),x&&C.append?[w,w+"-"+x,h,w+"Exit",w+"Exit-"+x]:x?[w,w+"-"+x,w+"Exit",w+"Exit-"+x]:C.append?[w,h,w+"Exit"]:[w,w+"Exit"]}function g(C){let x;return C.type==="document"?x=["Document",h,"DocumentExit"]:C.type==="root"?x=["Root",h,"RootExit"]:x=f(C),{eventIndex:0,events:x,iterator:0,node:C,visitorIndex:0,visitors:[]}}function b(C){return C[e]=!1,C.nodes&&C.nodes.forEach(x=>b(x)),C}let v={};class y{constructor(x,w,E){this.stringified=!1,this.processed=!1;let M;if(typeof w=="object"&&w!==null&&(w.type==="root"||w.type==="document"))M=b(w);else if(w instanceof y||w instanceof l)M=b(w.root),w.map&&(typeof E.map>"u"&&(E.map={}),E.map.inline||(E.map.inline=!1),E.map.prev=w.map);else{let k=u;E.syntax&&(k=E.syntax.parse),E.parser&&(k=E.parser),k.parse&&(k=k.parse);try{M=k(w,E)}catch(N){this.processed=!0,this.error=N}M&&!M[t]&&n.rebuild(M)}this.result=new l(x,M,E),this.helpers={...v,postcss:v,result:this.result},this.plugins=this.processor.plugins.map(k=>typeof k=="object"&&k.prepare?{...k,...k.prepare(this.result)}:k)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(x){return this.async().catch(x)}finally(x){return this.async().then(x,x)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(x,w){let E=this.result.lastPlugin;try{w&&w.addToError(x),this.error=x,x.name==="CssSyntaxError"&&!x.plugin?(x.plugin=E.postcssPlugin,x.setMessage()):E.postcssVersion}catch(M){console&&console.error&&console.error(M)}return x}prepareVisitors(){this.listeners={};let x=(w,E,M)=>{this.listeners[E]||(this.listeners[E]=[]),this.listeners[E].push([w,M])};for(let w of this.plugins)if(typeof w=="object")for(let E in w){if(!p[E]&&/^[A-Z]/.test(E))throw new Error(`Unknown event ${E} in ${w.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[E])if(typeof w[E]=="object")for(let M in w[E])M==="*"?x(w,E,w[E][M]):x(w,E+"-"+M.toLowerCase(),w[E][M]);else typeof w[E]=="function"&&x(w,E,w[E])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let x=0;x<this.plugins.length;x++){let w=this.plugins[x],E=this.runOnRoot(w);if(m(E))try{await E}catch(M){throw this.handleError(M)}}if(this.prepareVisitors(),this.hasListener){let x=this.result.root;for(;!x[e];){x[e]=!0;let w=[g(x)];for(;w.length>0;){let E=this.visitTick(w);if(m(E))try{await E}catch(M){let k=w[w.length-1].node;throw this.handleError(M,k)}}}if(this.listeners.OnceExit)for(let[w,E]of this.listeners.OnceExit){this.result.lastPlugin=w;try{if(x.type==="document"){let M=x.nodes.map(k=>E(k,this.helpers));await Promise.all(M)}else await E(x,this.helpers)}catch(M){throw this.handleError(M)}}}return this.processed=!0,this.stringify()}runOnRoot(x){this.result.lastPlugin=x;try{if(typeof x=="object"&&x.Once){if(this.result.root.type==="document"){let w=this.result.root.nodes.map(E=>x.Once(E,this.helpers));return m(w[0])?Promise.all(w):w}return x.Once(this.result.root,this.helpers)}else if(typeof x=="function")return x(this.result.root,this.result)}catch(w){throw this.handleError(w)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let x=this.result.opts,w=s;x.syntax&&(w=x.syntax.stringify),x.stringifier&&(w=x.stringifier),w.stringify&&(w=w.stringify);let M=new r(w,this.result.root,this.result.opts).generate();return this.result.css=M[0],this.result.map=M[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 x of this.plugins){let w=this.runOnRoot(x);if(m(w))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let x=this.result.root;for(;!x[e];)x[e]=!0,this.walkSync(x);if(this.listeners.OnceExit)if(x.type==="document")for(let w of x.nodes)this.visitSync(this.listeners.OnceExit,w);else this.visitSync(this.listeners.OnceExit,x)}return this.result}then(x,w){return this.async().then(x,w)}toString(){return this.css}visitSync(x,w){for(let[E,M]of x){this.result.lastPlugin=E;let k;try{k=M(w,this.helpers)}catch(N){throw this.handleError(N,w.proxyOf)}if(w.type!=="root"&&w.type!=="document"&&!w.parent)return!0;if(m(k))throw this.getAsyncError()}}visitTick(x){let w=x[x.length-1],{node:E,visitors:M}=w;if(E.type!=="root"&&E.type!=="document"&&!E.parent){x.pop();return}if(M.length>0&&w.visitorIndex<M.length){let[N,P]=M[w.visitorIndex];w.visitorIndex+=1,w.visitorIndex===M.length&&(w.visitors=[],w.visitorIndex=0),this.result.lastPlugin=N;try{return P(E.toProxy(),this.helpers)}catch(A){throw this.handleError(A,E)}}if(w.iterator!==0){let N=w.iterator,P;for(;P=E.nodes[E.indexes[N]];)if(E.indexes[N]+=1,!P[e]){P[e]=!0,x.push(g(P));return}w.iterator=0,delete E.indexes[N]}let k=w.events;for(;w.eventIndex<k.length;){let N=k[w.eventIndex];if(w.eventIndex+=1,N===h){E.nodes&&E.nodes.length&&(E[e]=!0,w.iterator=E.getIterator());return}else if(this.listeners[N]){w.visitors=this.listeners[N];return}}x.pop()}walkSync(x){x[e]=!0;let w=f(x);for(let E of w)if(E===h)x.nodes&&x.each(M=>{M[e]||this.walkSync(M)});else{let M=this.listeners[E];if(M&&this.visitSync(M,x.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return y.registerPostcss=C=>{v=C},Bs=y,y.default=y,c.registerLazyResult(y),i.registerLazyResult(y),Bs}var js,Io;function Fc(){if(Io)return js;Io=1;let e=Ea(),t=Ir(),r=Ra(),s=Wn(),n=Bn();class i{constructor(l,u,c){u=u.toString(),this.stringified=!1,this._processor=l,this._css=u,this._opts=c,this._map=void 0;let a,p=t;this.result=new n(this._processor,a,this._opts),this.result.css=u;let d=this;Object.defineProperty(this.result,"root",{get(){return d.root}});let h=new e(p,a,this._opts,u);if(h.isMap()){let[m,f]=h.generate();m&&(this.result.css=m),f&&(this.result.map=f)}else h.clearAnnotation(),this.result.css=h.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(l){return this.async().catch(l)}finally(l){return this.async().then(l,l)}sync(){if(this.error)throw this.error;return this.result}then(l,u){return this.async().then(l,u)}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 l,u=s;try{l=u(this._css,this._opts)}catch(c){this.error=c}if(this.error)throw this.error;return this._root=l,l}get[Symbol.toStringTag](){return"NoWorkResult"}}return js=i,i.default=i,js}var zs,ko;function Uc(){if(ko)return zs;ko=1;let e=Fc(),t=Oa(),r=Un(),s=Wt();class n{constructor(o=[]){this.version="8.4.38",this.plugins=this.normalize(o)}normalize(o){let l=[];for(let u of o)if(u.postcss===!0?u=u():u.postcss&&(u=u.postcss),typeof u=="object"&&Array.isArray(u.plugins))l=l.concat(u.plugins);else if(typeof u=="object"&&u.postcssPlugin)l.push(u);else if(typeof u=="function")l.push(u);else if(!(typeof u=="object"&&(u.parse||u.stringify)))throw new Error(u+" is not a PostCSS plugin");return l}process(o,l={}){return!this.plugins.length&&!l.parser&&!l.stringifier&&!l.syntax?new e(this,o,l):new t(this,o,l)}use(o){return this.plugins=this.plugins.concat(this.normalize([o])),this}}return zs=n,n.default=n,s.registerProcessor(n),r.registerProcessor(n),zs}var Ws,To;function Bc(){if(To)return Ws;To=1;let e=Tr(),t=Ca(),r=Ar(),s=jn(),n=Dr(),i=Wt(),o=zn();function l(u,c){if(Array.isArray(u))return u.map(d=>l(d));let{inputs:a,...p}=u;if(a){c=[];for(let d of a){let h={...d,__proto__:n.prototype};h.map&&(h.map={...h.map,__proto__:t.prototype}),c.push(h)}}if(p.nodes&&(p.nodes=u.nodes.map(d=>l(d,c))),p.source){let{inputId:d,...h}=p.source;p.source=h,d!=null&&(p.source.input=c[d])}if(p.type==="root")return new i(p);if(p.type==="decl")return new e(p);if(p.type==="rule")return new o(p);if(p.type==="comment")return new r(p);if(p.type==="atrule")return new s(p);throw new Error("Unknown node type: "+u.type)}return Ws=l,l.default=l,Ws}var qs,Do;function jc(){if(Do)return qs;Do=1;let e=$n(),t=Tr(),r=Oa(),s=st(),n=Uc(),i=Ir(),o=Bc(),l=Un(),u=Ma(),c=Ar(),a=jn(),p=Bn(),d=Dr(),h=Wn(),m=Na(),f=zn(),g=Wt(),b=kr();function v(...y){return y.length===1&&Array.isArray(y[0])&&(y=y[0]),new n(y)}return v.plugin=function(C,x){let w=!1;function E(...k){console&&console.warn&&!w&&(w=!0,console.warn(C+`: postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(C+`: \\u91CC\\u9762 postcss.plugin \\u88AB\\u5F03\\u7528. \\u8FC1\\u79FB\\u6307\\u5357:\nhttps://www.w3ctech.com/topic/2226`));let N=x(...k);return N.postcssPlugin=C,N.postcssVersion=new n().version,N}let M;return Object.defineProperty(E,"postcss",{get(){return M||(M=E()),M}}),E.process=function(k,N,P){return v([E(P)]).process(k,N)},E},v.stringify=i,v.parse=h,v.fromJSON=o,v.list=m,v.comment=y=>new c(y),v.atRule=y=>new a(y),v.decl=y=>new t(y),v.rule=y=>new f(y),v.root=y=>new g(y),v.document=y=>new l(y),v.CssSyntaxError=e,v.Declaration=t,v.Container=s,v.Processor=n,v.Document=l,v.Comment=c,v.Warning=u,v.AtRule=a,v.Result=p,v.Input=d,v.Rule=f,v.Root=g,v.Node=b,r.registerPostcss(v),qs=v,v.default=v,qs}var zc=jc(),se=kc(zc);se.stringify;se.fromJSON;se.plugin;se.parse;se.list;se.document;se.comment;se.atRule;se.rule;se.decl;se.root;se.CssSyntaxError;se.Declaration;se.Container;se.Processor;se.Document;se.Comment;se.Warning;se.AtRule;se.Result;se.Input;se.Rule;se.Root;se.Node;var j=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(j||{});function Wc(e){let t={},r=/;(?![^(]*\\))/g,s=/:(.+)/,n=/\\/\\*.*?\\*\\//g;return e.replace(n,"").split(r).forEach(function(i){if(i){let o=i.split(s);o.length>1&&(t[en(o[0].trim())]=o[1].trim())}}),t}function Ao(e){let t=[];for(let r in e){let s=e[r];if(typeof s!="string")continue;let n=Gc(r);t.push(`${n}: ${s};`)}return t.join(" ")}var qc=/-([a-z])/g,Vc=/^--[a-zA-Z0-9-]+$/,en=e=>Vc.test(e)?e:e.replace(qc,(t,r)=>r?r.toUpperCase():""),Hc=/\\B([A-Z])/g,Gc=e=>e.replace(Hc,"-$1").toLowerCase(),Ue=class e{constructor(...t){T(this,"parentElement",null),T(this,"parentNode",null),T(this,"ownerDocument"),T(this,"firstChild",null),T(this,"lastChild",null),T(this,"previousSibling",null),T(this,"nextSibling",null),T(this,"ELEMENT_NODE",1),T(this,"TEXT_NODE",3),T(this,"nodeType"),T(this,"nodeName"),T(this,"RRNodeType")}get childNodes(){let t=[],r=this.firstChild;for(;r;)t.push(r),r=r.nextSibling;return t}contains(t){if(t instanceof e){if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0}else return!1;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute \'appendChild\' on \'RRNode\': This RRNode type does not support this method.")}insertBefore(t,r){throw new Error("RRDomException: Failed to execute \'insertBefore\' on \'RRNode\': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute \'removeChild\' on \'RRNode\': This RRNode type does not support this method.")}toString(){return"RRNode"}},tn=class e extends Ue{constructor(...t){super(t),T(this,"nodeType",9),T(this,"nodeName","#document"),T(this,"compatMode","CSS1Compat"),T(this,"RRNodeType",j.Document),T(this,"textContent",null),this.ownerDocument=this}get documentElement(){return this.childNodes.find(t=>t.RRNodeType===j.Element&&t.tagName==="HTML")||null}get body(){var t;return((t=this.documentElement)==null?void 0:t.childNodes.find(r=>r.RRNodeType===j.Element&&r.tagName==="BODY"))||null}get head(){var t;return((t=this.documentElement)==null?void 0:t.childNodes.find(r=>r.RRNodeType===j.Element&&r.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(t){let r=t.RRNodeType;if((r===j.Element||r===j.DocumentType)&&this.childNodes.some(n=>n.RRNodeType===r))throw new Error(`RRDomException: Failed to execute \'appendChild\' on \'RRNode\': Only one ${r===j.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);let s=qn(this,t);return s.parentElement=null,s}insertBefore(t,r){let s=t.RRNodeType;if((s===j.Element||s===j.DocumentType)&&this.childNodes.some(i=>i.RRNodeType===s))throw new Error(`RRDomException: Failed to execute \'insertBefore\' on \'RRNode\': Only one ${s===j.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);let n=Ia(this,t,r);return n.parentElement=null,n}removeChild(t){return ka(this,t)}open(){this.firstChild=null,this.lastChild=null}close(){}write(t){let r;if(t===\'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">\'?r="-//W3C//DTD XHTML 1.0 Transitional//EN":t===\'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">\'&&(r="-//W3C//DTD HTML 4.0 Transitional//EN"),r){let s=this.createDocumentType("html",r,"");this.open(),this.appendChild(s)}}createDocument(t,r,s){return new e}createDocumentType(t,r,s){let n=new hr(t,r,s);return n.ownerDocument=this,n}createElement(t){let r=new gt(t);return r.ownerDocument=this,r}createElementNS(t,r){return this.createElement(r)}createTextNode(t){let r=new pr(t);return r.ownerDocument=this,r}createComment(t){let r=new fr(t);return r.ownerDocument=this,r}createCDATASection(t){let r=new mr(t);return r.ownerDocument=this,r}toString(){return"RRDocument"}},hr=class extends Ue{constructor(t,r,s){super(),T(this,"nodeType",10),T(this,"RRNodeType",j.DocumentType),T(this,"name"),T(this,"publicId"),T(this,"systemId"),T(this,"textContent",null),this.name=t,this.publicId=r,this.systemId=s,this.nodeName=t}toString(){return"RRDocumentType"}},gt=class extends Ue{constructor(t){super(),T(this,"nodeType",1),T(this,"RRNodeType",j.Element),T(this,"tagName"),T(this,"attributes",{}),T(this,"shadowRoot",null),T(this,"scrollLeft"),T(this,"scrollTop"),this.tagName=t.toUpperCase(),this.nodeName=t.toUpperCase()}get textContent(){let t="";return this.childNodes.forEach(r=>t+=r.textContent),t}set textContent(t){this.firstChild=null,this.lastChild=null,this.appendChild(this.ownerDocument.createTextNode(t))}get classList(){return new nn(this.attributes.class,t=>{this.attributes.class=t})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){let t=this.attributes.style?Wc(this.attributes.style):{},r=/\\B([A-Z])/g;return t.setProperty=(s,n,i)=>{if(r.test(s))return;let o=en(s);n?t[o]=n:delete t[o],i==="important"&&(t[o]+=" !important"),this.attributes.style=Ao(t)},t.removeProperty=s=>{if(r.test(s))return"";let n=en(s),i=t[n]||"";return delete t[n],this.attributes.style=Ao(t),i},t}getAttribute(t){return this.attributes[t]===void 0?null:this.attributes[t]}setAttribute(t,r){this.attributes[t]=r}setAttributeNS(t,r,s){this.setAttribute(r,s)}removeAttribute(t){delete this.attributes[t]}appendChild(t){return qn(this,t)}insertBefore(t,r){return Ia(this,t,r)}removeChild(t){return ka(this,t)}attachShadow(t){let r=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=r,r}dispatchEvent(t){return!0}toString(){let t="";for(let r in this.attributes)t+=`${r}="${this.attributes[r]}" `;return`${this.tagName} ${t}`}},rn=class extends gt{constructor(){super(...arguments),T(this,"currentTime"),T(this,"volume"),T(this,"paused"),T(this,"muted"),T(this,"playbackRate"),T(this,"loop")}attachShadow(t){throw new Error("RRDomException: Failed to execute \'attachShadow\' on \'RRElement\': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}},sn=class extends gt{constructor(){super(...arguments),T(this,"tagName","DIALOG"),T(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")}},pr=class extends Ue{constructor(t){super(),T(this,"nodeType",3),T(this,"nodeName","#text"),T(this,"RRNodeType",j.Text),T(this,"data"),this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRText text=${JSON.stringify(this.data)}`}},fr=class extends Ue{constructor(t){super(),T(this,"nodeType",8),T(this,"nodeName","#comment"),T(this,"RRNodeType",j.Comment),T(this,"data"),this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRComment text=${JSON.stringify(this.data)}`}},mr=class extends Ue{constructor(t){super(),T(this,"nodeName","#cdata-section"),T(this,"nodeType",4),T(this,"RRNodeType",j.CDATA),T(this,"data"),this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}},nn=class{constructor(t,r){if(T(this,"onChange"),T(this,"classes",[]),T(this,"add",(...s)=>{for(let n of s){let i=String(n);this.classes.indexOf(i)>=0||this.classes.push(i)}this.onChange&&this.onChange(this.classes.join(" "))}),T(this,"remove",(...s)=>{this.classes=this.classes.filter(n=>s.indexOf(n)===-1),this.onChange&&this.onChange(this.classes.join(" "))}),t){let s=t.trim().split(/\\s+/);this.classes.push(...s)}this.onChange=r}};function qn(e,t){return t.parentNode&&t.parentNode.removeChild(t),e.lastChild?(e.lastChild.nextSibling=t,t.previousSibling=e.lastChild):(e.firstChild=t,t.previousSibling=null),e.lastChild=t,t.nextSibling=null,t.parentNode=e,t.parentElement=e,t.ownerDocument=e.ownerDocument,t}function Ia(e,t,r){if(!r)return qn(e,t);if(r.parentNode!==e)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 t===r||(t.parentNode&&t.parentNode.removeChild(t),t.previousSibling=r.previousSibling,r.previousSibling=t,t.nextSibling=r,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,t.parentElement=e,t.parentNode=e,t.ownerDocument=e.ownerDocument),t}function ka(e,t){if(t.parentNode!==e)throw new Error("Failed to execute \'removeChild\' on \'RRNode\': The RRNode to be removed is not a child of this RRNode.");return t.previousSibling?t.previousSibling.nextSibling=t.nextSibling:e.firstChild=t.nextSibling,t.nextSibling?t.nextSibling.previousSibling=t.previousSibling:e.lastChild=t.previousSibling,t.previousSibling=null,t.nextSibling=null,t.parentElement=null,t.parentNode=null,t}var Re=(e=>(e[e.PLACEHOLDER=0]="PLACEHOLDER",e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE",e))(Re||{}),on={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},Yc={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"},We=null;function gr(e,t,r,s=t.mirror||t.ownerDocument.mirror){e=Jc(e,t,r,s),Ta(e,t,r,s),Qc(e,t,r)}function Jc(e,t,r,s){var n;if(r.afterAppend&&!We&&(We=new WeakSet,setTimeout(()=>{We=null},0)),!Vn(e,t)){let i=yr(t,r.mirror,s);(n=e.parentNode)==null||n.replaceChild(i,e),e=i}switch(t.RRNodeType){case j.Document:{if(!lt(e,t,r.mirror,s)){let i=s.getMeta(t);i&&(r.mirror.removeNodeFromMap(e),e.close(),e.open(),r.mirror.add(e,i),We?.add(e))}break}case j.Element:{let i=e,o=t;switch(o.tagName){case"IFRAME":{let l=e.contentDocument;if(!l)break;gr(l,t.contentDocument,r,s);break}}o.shadowRoot&&(i.shadowRoot||i.attachShadow({mode:"open"}),Ta(i.shadowRoot,o.shadowRoot,r,s)),Xc(i,o,s);break}}return e}function Qc(e,t,r){var s;switch(t.RRNodeType){case j.Document:{let n=t.scrollData;n&&r.applyScroll(n,!0);break}case j.Element:{let n=e,i=t;switch(i.scrollData&&r.applyScroll(i.scrollData,!0),i.inputData&&r.applyInput(i.inputData),i.tagName){case"AUDIO":case"VIDEO":{let o=e,l=i;l.paused!==void 0&&(l.paused?o.pause():o.play()),l.muted!==void 0&&(o.muted=l.muted),l.volume!==void 0&&(o.volume=l.volume),l.currentTime!==void 0&&(o.currentTime=l.currentTime),l.playbackRate!==void 0&&(o.playbackRate=l.playbackRate),l.loop!==void 0&&(o.loop=l.loop);break}case"CANVAS":{let o=t;if(o.rr_dataURL!==null){let l=document.createElement("img");l.onload=()=>{let u=n.getContext("2d");u&&u.drawImage(l,0,0,l.width,l.height)},l.src=o.rr_dataURL}o.canvasMutations.forEach(l=>r.applyCanvas(l.event,l.mutation,e));break}case"STYLE":{let o=n.sheet;o&&t.rules.forEach(l=>r.applyStyleSheetMutation(l,o));break}case"DIALOG":{let o=n,l=i,u=o.open,c=o.matches("dialog:modal"),a=l.open,p=l.isModal,d=c!==p,h=u!==a;if((d||u&&h)&&o.close(),a&&(h||d))try{p?o.showModal():o.show()}catch(m){console.warn(m)}break}}break}case j.Text:case j.Comment:case j.CDATA:{e.textContent!==t.data&&(e.textContent=t.data);break}}We?.has(e)&&(We.delete(e),(s=r.afterAppend)==null||s.call(r,e,r.mirror.getId(e)))}function Xc(e,t,r){let s=e.attributes,n=t.attributes;for(let i in n){let o=n[i],l=r.getMeta(t);if(l?.isSVG&&on[i])e.setAttributeNS(on[i],i,o);else if(t.tagName==="CANVAS"&&i==="rr_dataURL"){let u=document.createElement("img");u.src=o,u.onload=()=>{let c=e.getContext("2d");c&&c.drawImage(u,0,0,u.width,u.height)}}else{if(t.tagName==="IFRAME"&&i==="srcdoc")continue;try{e.setAttribute(i,o)}catch(u){console.warn(u)}}}for(let{name:i}of Array.from(s))i in n||e.removeAttribute(i);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function Ta(e,t,r,s){let n=Array.from(e.childNodes),i=t.childNodes;if(n.length===0&&i.length===0)return;let o=0,l=n.length-1,u=0,c=i.length-1,a=n[o],p=n[l],d=i[u],h=i[c],m,f;for(;o<=l&&u<=c;)if(a===void 0)a=n[++o];else if(p===void 0)p=n[--l];else if(lt(a,d,r.mirror,s))a=n[++o],d=i[++u];else if(lt(p,h,r.mirror,s))p=n[--l],h=i[--c];else if(lt(a,h,r.mirror,s)){try{e.insertBefore(a,p.nextSibling)}catch(v){console.warn(v)}a=n[++o],h=i[--c]}else if(lt(p,d,r.mirror,s)){try{e.insertBefore(p,a)}catch(v){console.warn(v)}p=n[--l],d=i[++u]}else{if(!m){m={};for(let y=o;y<=l;y++){let C=n[y];C&&r.mirror.hasNode(C)&&(m[r.mirror.getId(C)]=y)}}f=m[s.getId(d)];let v=n[f];if(f!==void 0&&v&&lt(v,d,r.mirror,s)){try{e.insertBefore(v,a)}catch(y){console.warn(y)}n[f]=void 0}else{let y=yr(d,r.mirror,s);e.nodeName==="#document"&&a&&(y.nodeType===y.DOCUMENT_TYPE_NODE&&a.nodeType===a.DOCUMENT_TYPE_NODE||y.nodeType===y.ELEMENT_NODE&&a.nodeType===a.ELEMENT_NODE)&&(e.removeChild(a),r.mirror.removeNodeFromMap(a),a=n[++o]);try{e.insertBefore(y,a||null)}catch(C){console.warn(C)}}d=i[++u]}if(o>l){let v=i[c+1],y=null;for(v&&(y=r.mirror.getNode(s.getId(v)));u<=c;++u){let C=yr(i[u],r.mirror,s);try{e.insertBefore(C,y)}catch(x){console.warn(x)}}}else if(u>c)for(;o<=l;o++){let v=n[o];if(!(!v||v.parentNode!==e))try{e.removeChild(v),r.mirror.removeNodeFromMap(v)}catch(y){console.warn(y)}}let g=e.firstChild,b=t.firstChild;for(;g!==null&&b!==null;)gr(g,b,r,s),g=g.nextSibling,b=b.nextSibling}function yr(e,t,r){let s=r.getId(e),n=r.getMeta(e),i=null;if(s>-1&&(i=t.getNode(s)),i!==null&&Vn(i,e))return i;switch(e.RRNodeType){case j.Document:i=new Document;break;case j.DocumentType:i=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case j.Element:{let o=e.tagName.toLowerCase();o=Yc[o]||o,n&&"isSVG"in n&&n?.isSVG?i=document.createElementNS(on.svg,o):i=document.createElement(e.tagName);break}case j.Text:i=document.createTextNode(e.data);break;case j.Comment:i=document.createComment(e.data);break;case j.CDATA:i=document.createCDATASection(e.data);break}n&&t.add(i,{...n});try{We?.add(i)}catch{}return i}function Vn(e,t){return e.nodeType!==t.nodeType?!1:e.nodeType!==e.ELEMENT_NODE||e.tagName.toUpperCase()===t.tagName}function lt(e,t,r,s){let n=r.getId(e),i=s.getId(t);return n===-1||n!==i?!1:Vn(e,t)}var yt=class e extends tn{constructor(t){super(),T(this,"UNSERIALIZED_STARTING_ID",-2),T(this,"_unserializedId",this.UNSERIALIZED_STARTING_ID),T(this,"mirror",nd()),T(this,"scrollData",null),t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,r,s){return new e}createDocumentType(t,r,s){let n=new Kc(t,r,s);return n.ownerDocument=this,n}createElement(t){let r=t.toUpperCase(),s;switch(r){case"AUDIO":case"VIDEO":s=new an(r);break;case"IFRAME":s=new dn(r,this.mirror);break;case"CANVAS":s=new un(r);break;case"STYLE":s=new cn(r);break;case"DIALOG":s=new ln(r);break;default:s=new bt(r);break}return s.ownerDocument=this,s}createComment(t){let r=new ed(t);return r.ownerDocument=this,r}createCDATASection(t){let r=new td(t);return r.ownerDocument=this,r}createTextNode(t){let r=new Zc(t);return r.ownerDocument=this,r}destroyTree(){this.firstChild=null,this.lastChild=null,this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}},Kc=hr,bt=class extends gt{constructor(){super(...arguments),T(this,"inputData",null),T(this,"scrollData",null)}},an=class extends rn{},ln=class extends sn{},un=class extends bt{constructor(){super(...arguments),T(this,"rr_dataURL",null),T(this,"canvasMutations",[])}getContext(){return null}},cn=class extends bt{constructor(){super(...arguments),T(this,"rules",[])}},dn=class extends bt{constructor(t,r){super(t),T(this,"contentDocument",new yt),this.contentDocument.mirror=r}},Zc=pr,ed=fr,td=mr;function rd(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function Da(e,t,r,s){let n;switch(e.nodeType){case Re.DOCUMENT_NODE:s&&s.nodeName==="IFRAME"?n=s.contentDocument:(n=t,n.compatMode=e.compatMode);break;case Re.DOCUMENT_TYPE_NODE:{let o=e;n=t.createDocumentType(o.name,o.publicId,o.systemId);break}case Re.ELEMENT_NODE:{let o=e,l=rd(o);n=t.createElement(l);let u=n;for(let{name:c,value:a}of Array.from(o.attributes))u.attributes[c]=a;o.scrollLeft&&(u.scrollLeft=o.scrollLeft),o.scrollTop&&(u.scrollTop=o.scrollTop);break}case Re.TEXT_NODE:n=t.createTextNode(e.textContent||"");break;case Re.CDATA_SECTION_NODE:n=t.createCDATASection(e.data);break;case Re.COMMENT_NODE:n=t.createComment(e.textContent||"");break;case Re.DOCUMENT_FRAGMENT_NODE:n=s.attachShadow({mode:"open"});break;default:return null}let i=r.getMeta(e);return t instanceof yt&&(i||(i=Aa(n,t.unserializedId),r.add(e,i)),t.mirror.add(n,{...i})),n}function sd(e,t=Ic(),r=new yt){function s(n,i){let o=Da(n,r,t,i);if(o!==null)if(i?.nodeName!=="IFRAME"&&n.nodeType!==Re.DOCUMENT_FRAGMENT_NODE&&(i?.appendChild(o),o.parentNode=i,o.parentElement=i),n.nodeName==="IFRAME"){let l=n.contentDocument;l&&s(l,o)}else(n.nodeType===Re.DOCUMENT_NODE||n.nodeType===Re.ELEMENT_NODE||n.nodeType===Re.DOCUMENT_FRAGMENT_NODE)&&(n.nodeType===Re.ELEMENT_NODE&&n.shadowRoot&&s(n.shadowRoot,o),n.childNodes.forEach(l=>s(l,o)))}return s(e,null),r}function nd(){return new hn}var hn=class{constructor(){T(this,"idNodeMap",new Map),T(this,"nodeMetaMap",new WeakMap)}getId(t){var r;return t?((r=this.getMeta(t))==null?void 0:r.id)??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){let r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(s=>this.removeNodeFromMap(s))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let s=r.id;this.idNodeMap.set(s,t),this.nodeMetaMap.set(t,r)}replace(t,r){let s=this.getNode(t);if(s){let n=this.nodeMetaMap.get(s);n&&this.nodeMetaMap.set(r,n)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Aa(e,t){switch(e.RRNodeType){case j.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case j.DocumentType:{let r=e;return{id:t,type:e.RRNodeType,name:r.name,publicId:r.publicId,systemId:r.systemId}}case j.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case j.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case j.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case j.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}var Lo={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Po={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},kt={},pn={},_o=0,id=()=>!!globalThis.Zone;function Hn(e){if(kt[e])return kt[e];let t=globalThis[e],r=t.prototype,s=e in Lo?Lo[e]:void 0,n=!!(s&&s.every(l=>{var u,c;return!!((c=(u=Object.getOwnPropertyDescriptor(r,l))==null?void 0:u.get)!=null&&c.toString().includes("[native code]"))})),i=e in Po?Po[e]:void 0,o=!!(i&&i.every(l=>{var u;return typeof r[l]=="function"&&((u=r[l])==null?void 0:u.toString().includes("[native code]"))}));if(n&&o&&!id())return kt[e]=t.prototype,t.prototype;try{let l=document.createElement("iframe");l.style.display="none",document.body.appendChild(l);let u=l.contentWindow;if(!u)return t.prototype;let c=u[e].prototype;if(!c)return l.remove(),r;let a=navigator.userAgent;return a.includes("Safari")&&!a.includes("Chrome")?(l.classList.add("rr-block"),l.setAttribute("__rrwebUntaintedMutationObserver",""),pn[e]=()=>l.remove()):l.remove(),kt[e]=c}catch{return r}}var Vs={};function Oe(e,t,r){var s,n;let i=(s=Vs[e])==null?void 0:s[r];if(i)return i.call(t);let o=Hn(e),l=(n=Object.getOwnPropertyDescriptor(o,r))==null?void 0:n.get;return l?((Vs[e]||(Vs[e]={}))[r]=l,l.call(t)):t[r]}var Hs={};function La(e,t,r){let s=`${e}.${String(r)}`;if(Hs[s])return Hs[s].bind(t);let i=Hn(e)[r];return typeof i!="function"?t[r]:(Hs[s]=i,i.bind(t))}function od(e){return Oe("Node",e,"ownerDocument")}function ad(e){return Oe("Node",e,"childNodes")}function ld(e){return Oe("Node",e,"parentNode")}function ud(e){return Oe("Node",e,"parentElement")}function cd(e){return Oe("Node",e,"textContent")}function dd(e){return Oe("Node",e,"firstChild")}function hd(e){return Oe("Node",e,"lastChild")}function pd(e){return Oe("Node",e,"nextSibling")}function fd(e){return Oe("Node",e,"previousSibling")}function md(e,t){return La("Node",e,"contains")(t)}function gd(e){return La("Node",e,"getRootNode")()}function yd(e){return!e||!("host"in e)?null:Oe("ShadowRoot",e,"host")}function bd(e){return e.styleSheets}function vd(e){return!e||!("shadowRoot"in e)?null:Oe("Element",e,"shadowRoot")}function wd(e,t){return Oe("Element",e,"querySelector")(t)}function Sd(e,t){return Oe("Element",e,"querySelectorAll")(t)}function Pa(){let e=Hn("MutationObserver");_o++;let t=!1;return[e.constructor,()=>{if(t||(t=!0,--_o!==0))return;let r=pn.MutationObserver;if(r)try{r()}finally{delete kt.MutationObserver,delete pn.MutationObserver}}]}var Ut=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Ut=()=>new Date().getTime());function nt(e,t,r){try{if(!(t in e))return()=>{};let s=e[t],n=r(s);return typeof n=="function"&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:s}})),e[t]=n,()=>{e[t]=s}}catch{return()=>{}}}var F={ownerDocument:od,childNodes:ad,parentNode:ld,parentElement:ud,textContent:cd,firstChild:dd,lastChild:hd,nextSibling:pd,previousSibling:fd,contains:md,getRootNode:gd,host:yd,styleSheets:bd,shadowRoot:vd,querySelector:wd,querySelectorAll:Sd,nowTimestamp:Ut,mutationObserverCtor:Pa,patch:nt};function ge(e,t,r=document){let s={capture:!0,passive:!0};return r.addEventListener(e,t,s),()=>r.removeEventListener(e,t,s)}var ut=`Please stop import mirror directly. Instead of that,\\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\\r\nor you can use record.mirror to access the mirror instance during recording.`,$o={map:{},getId(){return console.error(ut),-1},getNode(){return console.error(ut),null},removeNodeFromMap(){console.error(ut)},has(){return console.error(ut),!1},reset(){console.error(ut)}};typeof window<"u"&&window.Proxy&&window.Reflect&&($o=new Proxy($o,{get(e,t,r){return t==="map"&&console.error(ut),Reflect.get(e,t,r)}}));function Bt(e,t,r={}){let s=null,n=0;return function(...i){let o=Date.now();!n&&r.leading===!1&&(n=o);let l=t-(o-n),u=this;l<=0||l>t?(s&&(clearTimeout(s),s=null),n=o,e.apply(u,i)):!s&&r.trailing!==!1&&(s=setTimeout(()=>{n=r.leading===!1?0:Date.now(),s=null,e.apply(u,i)},l))}}function Lr(e,t,r,s,n=window){let i=n.Object.getOwnPropertyDescriptor(e,t);return n.Object.defineProperty(e,t,s?r:{set(o){setTimeout(()=>{r.set.call(this,o)},0),i&&i.set&&i.set.call(this,o)}}),()=>Lr(e,t,i||{},!0)}function _a(e){var t,r,s,n;let i=e.document;return{left:i.scrollingElement?i.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:i.documentElement.scrollLeft||i?.body&&((t=F.parentElement(i.body))==null?void 0:t.scrollLeft)||((r=i?.body)==null?void 0:r.scrollLeft)||0,top:i.scrollingElement?i.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:i?.documentElement.scrollTop||i?.body&&((s=F.parentElement(i.body))==null?void 0:s.scrollTop)||((n=i?.body)==null?void 0:n.scrollTop)||0}}function $a(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Fa(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ua(e){return e?e.nodeType===e.ELEMENT_NODE?e:F.parentElement(e):null}function we(e,t,r,s){if(!e)return!1;let n=Ua(e);if(!n)return!1;try{if(typeof t=="string"){if(n.classList.contains(t)||s&&n.closest("."+t)!==null)return!0}else if(dr(n,t,s))return!0}catch{}return!!(r&&(n.matches(r)||s&&n.closest(r)!==null))}function xd(e,t){return t.getId(e)!==-1}function Gs(e,t,r){return e.tagName==="TITLE"&&r.headTitleMutations?!0:t.getId(e)===cr}function Ba(e,t){if(At(e))return!1;let r=t.getId(e);if(!t.has(r))return!0;let s=F.parentNode(e);return s&&s.nodeType===e.DOCUMENT_NODE?!1:s?Ba(s,t):!0}function fn(e){return!!e.changedTouches}function ja(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function Cd(e){let t={},r=(n,i)=>{let o={value:n,parent:i,children:[]};return t[n.node.id]=o,o},s=[];for(let n of e){let{nextId:i,parentId:o}=n;if(i&&i in t){let l=t[i];if(l.parent){let u=l.parent.children.indexOf(l);l.parent.children.splice(u,0,r(n,l.parent))}else{let u=s.indexOf(l);s.splice(u,0,r(n,null))}continue}if(o in t){let l=t[o];l.children.push(r(n,l));continue}s.push(r(n,null))}return s}function za(e,t){t(e.value);for(let r=e.children.length-1;r>=0;r--)za(e.children[r],t)}function _t(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Wa(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function qa(e,t){var r,s;let n=(s=(r=e.ownerDocument)==null?void 0:r.defaultView)==null?void 0:s.frameElement;if(!n||n===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};let i=n.getBoundingClientRect(),o=qa(n,t),l=i.height/n.clientHeight;return{x:i.x*o.relativeScale+o.x,y:i.y*o.relativeScale+o.y,relativeScale:l,absoluteScale:o.absoluteScale*l}}function tt(e){return e?e instanceof Ue&&"shadowRoot"in e?!!e.shadowRoot:!!F.shadowRoot(e):!1}function Tt(e,t){let r=e?.[t[0]];return r?t.length===1?r:Tt(r.cssRules,t.slice(1)):null}function Fo(e){let t=[...e],r=t.pop();return{positions:t,index:r}}function Ed(e){let t=new Set,r=[];for(let s=e.length;s--;){let n=e[s];t.has(n.id)||(r.push(n),t.add(n.id))}return r}var br=class{constructor(){O(this,"id",1),O(this,"styleIDMap",new WeakMap),O(this,"idStyleMap",new Map)}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let s;return r===void 0?s=this.id++:s=r,this.styleIDMap.set(t,s),this.idStyleMap.set(s,t),s}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Va(e){var t;let r=null;return"getRootNode"in e&&((t=F.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&F.host(F.getRootNode(e))&&(r=F.host(F.getRootNode(e))),r}function Rd(e){let t=e,r;for(;r=Va(t);)t=r;return t}function Md(e){let t=F.ownerDocument(e);if(!t)return!1;let r=Rd(e);return F.contains(t,r)}function mn(e){let t=F.ownerDocument(e);return t?F.contains(t,e)||Md(e):!1}var L=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e[e.Asset=7]="Asset",e[e.Annotation=8]="Annotation",e))(L||{}),D=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(D||{}),H=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(H||{}),qe=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(qe||{}),Ge=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Ge||{}),Xe=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(Xe||{}),q=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Annotation="annotation",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e.Destroy="destroy",e))(q||{}),Ve=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Ve||{}),Uo=(e,t)=>`${e}@${t}`,gn=class{constructor(){O(this,"frozen",!1),O(this,"locked",!1),O(this,"texts",[]),O(this,"attributes",[]),O(this,"attributeMap",new WeakMap),O(this,"removes",[]),O(this,"mapRemoves",[]),O(this,"movedMap",{}),O(this,"addedSet",new Set),O(this,"movedSet",new Set),O(this,"droppedSet",new Set),O(this,"removesSubTreeCache",new Set),O(this,"mutationCb"),O(this,"blockClass"),O(this,"blockSelector"),O(this,"maskTextClass"),O(this,"maskTextSelector"),O(this,"inlineStylesheet"),O(this,"maskInputOptions"),O(this,"maskTextFn"),O(this,"maskInputFn"),O(this,"keepIframeSrcFn"),O(this,"recordCanvas"),O(this,"inlineImages"),O(this,"slimDOMOptions"),O(this,"dataURLOptions"),O(this,"doc"),O(this,"mirror"),O(this,"iframeManager"),O(this,"stylesheetManager"),O(this,"shadowDomManager"),O(this,"processedNodeManager"),O(this,"unattachedDoc"),O(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),O(this,"emit",()=>{if(this.frozen||this.locked)return;let t=[],r=new Set;for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let d of this.movedSet){let h=F.parentNode(d);this.removesSubTreeCache.has(h)&&!this.movedSet.has(h)||this.addedSet.add(d)}let s=null,n=null,i=-1,o=null,l=!1,u=new Set,c=this.addedSet.values(),a=c.next();for(;this.addedSet.size;){if(s!==null&&this.addedSet.has(F.previousSibling(s)))o=s,s=F.previousSibling(s);else{for(this.addedSet.has(a.value)||(a=c.next()),s=a.value;;){if(n=F.parentNode(s),this.addedSet.has(n)){s=n;continue}break}if(u.has(n))n=null;else if(n){if(mn(n)?(l=Bo(this.droppedSet,n)||this.removesSubTreeCache.has(n),l&&Bo(this.movedSet,s)&&(l=!1)):l=!0,this.addedSet.has(F.lastChild(n)))s=F.lastChild(n),o=null;else for(;;){if(o=F.nextSibling(s),this.addedSet.has(o)){s=o;continue}break}if(i=At(n)?this.mirror.getId(Va(s)):this.mirror.getId(n),i===-1&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let f=F.host(n);i=this.mirror.getId(f)}}}if(this.addedSet.delete(s),!n||i===-1){u.add(s);continue}else if(l){this.droppedSet.add(s);continue}let d=!1;if(s.nodeType===Node.TEXT_NODE){let f=n.tagName;if(f==="TEXTAREA")continue;f==="STYLE"&&r.has(i)&&(d=!0)}let h=o?this.mirror.getId(o):null;for(;h===cr;)o=o&&F.nextSibling(o),h=o&&this.mirror.getId(o);if(h===-1){console.warn("Couldn\'t record new node. Couldn\'t find mirror id for nextSibling:",o),s=null;continue}let m=ht(s,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:f=>{_t(f,this.mirror)&&this.iframeManager.addIframe(f),Wa(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),tt(s)&&this.shadowDomManager.addShadowRoot(F.shadowRoot(s),this.doc)},onIframeLoad:(f,g)=>{this.iframeManager.attachIframe(f,g),this.shadowDomManager.observeAttachShadow(f)},onStylesheetLoad:(f,g)=>{this.stylesheetManager.attachLinkElement(f,g)},cssCaptured:d});m&&(t.push({parentId:i,nextId:h,node:m}),r.add(m.id))}let p={texts:this.texts.map(d=>{let h=d.node,m=F.parentNode(h);return m&&m.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(m),{id:this.mirror.getId(h),value:d.value}}).filter(d=>!r.has(d.id)).filter(d=>this.mirror.has(d.id)),attributes:this.attributes.map(d=>{let{attributes:h}=d;if(typeof h.style=="string"){let m=JSON.stringify(d.styleDiff),f=JSON.stringify(d._unchangedStyles);m.length<h.style.length&&(m+f).split("var(").length===h.style.split("var(").length&&(h.style=d.styleDiff)}return{id:this.mirror.getId(d.node),attributes:h}}).filter(d=>!r.has(d.id)).filter(d=>this.mirror.has(d.id)),removes:this.removes,adds:t};!p.texts.length&&!p.attributes.length&&!p.removes.length&&!p.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(p))}),O(this,"genTextAreaValueMutation",t=>{let r=this.attributeMap.get(t);r||(r={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(t,r));let s=Array.from(F.childNodes(t),n=>F.textContent(n)||"").join("");r.attributes.value=ar({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:lr(t),value:s,maskInputFn:this.maskInputFn})}),O(this,"processMutation",t=>{if(!Gs(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{let r=F.textContent(t.target);!we(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:ca(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,Ua(t.target)):r.replace(/[\\S]/g,"*"):r,node:t.target});break}case"attributes":{let r=t.target,s=He(r.tagName),n=t.attributeName,i=t.target.getAttribute(n);if(n==="value"){let l=lr(r);i=ar({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:l,value:i,maskInputFn:this.maskInputFn})}if(we(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue)return;let o=this.attributeMap.get(t.target);if(s==="iframe"&&n==="src"&&!this.keepIframeSrcFn(i))if(!r.contentDocument)n="rr_src";else return;if(o||(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(t.target,o)),n==="type"&&s==="input"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!ua(s,n))if(o.attributes[n]=la(this.doc,s,He(n),i),n==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let l=this.unattachedDoc.createElement("span");t.oldValue&&l.setAttribute("style",t.oldValue);for(let u of Array.from(r.style)){let c=r.style.getPropertyValue(u),a=r.style.getPropertyPriority(u);c!==l.style.getPropertyValue(u)||a!==l.style.getPropertyPriority(u)?a===""?o.styleDiff[u]=c:o.styleDiff[u]=[c,a]:o._unchangedStyles[u]=[c,a]}for(let u of Array.from(l.style))r.style.getPropertyValue(u)===""&&(o.styleDiff[u]=!1)}else n==="open"&&r.tagName==="DIALOG"&&(r.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":{if(we(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{mn(r)||this.shadowDomManager.removeShadowRootsIn(r);let s=this.mirror.getId(r),n=At(t.target)?this.mirror.getId(F.host(t.target)):this.mirror.getId(t.target);we(t.target,this.blockClass,this.blockSelector,!1)||Gs(r,this.mirror,this.slimDOMOptions)||!xd(r,this.mirror)||(this.addedSet.has(r)?(yn(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&s===-1||Ba(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Uo(s,n)]?yn(this.movedSet,r):(this.removes.push({parentId:n,id:s,isShadow:At(t.target)&&Lt(t.target)?!0:void 0}),Nd(r,this.removesSubTreeCache))),this.mapRemoves.push(r))});break}}}),O(this,"genAdds",(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Gs(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let s=null;r&&this.mirror.hasNode(r)&&(s=this.mirror.getId(r)),s&&s!==-1&&(this.movedMap[Uo(this.mirror.getId(t),s)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);we(t,this.blockClass,this.blockSelector,!1)||(F.childNodes(t).forEach(s=>this.genAdds(s)),tt(t)&&F.childNodes(F.shadowRoot(t)).forEach(s=>{this.processedNodeManager.add(s,this),this.genAdds(s,t)}))}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","processedNodeManager"].forEach(r=>{this[r]=t[r]})}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1,this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0}unlock(){this.locked=!1,this.emit()}};function yn(e,t){e.delete(t),F.childNodes(t).forEach(r=>yn(e,r))}function Nd(e,t){let r=[e];for(;r.length;){let s=r.pop();t.has(s)||(t.add(s),F.childNodes(s).forEach(n=>r.push(n)))}}function Bo(e,t){return e.size===0?!1:Ha(e,t)}function Ha(e,t){if(e.has(t))return!0;let r=F.parentNode(t);return r?Ha(e,r):!1}var $t;function Od(e){$t=e}function Id(){$t=void 0}var z=e=>$t?(...r)=>{try{return e(...r)}catch(s){if($t&&$t(s)===!0)return;throw s}}:e,mt=new Set;function qt(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Ga(e,t){let r=new gn;mt.add(r),r.init(e);let[s,n]=Pa(),i=new s(z(r.processMutations.bind(r)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),()=>{i.disconnect(),mt.delete(r),n()}}function kd({mousemoveCb:e,sampling:t,doc:r,mirror:s}){if(t.mousemove===!1)return()=>{};let n=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,o=[],l,u=Bt(z(p=>{let d=Date.now()-l;e(o.map(h=>(h.timeOffset-=d,h)),p),o=[],l=null}),i),c=z(Bt(z(p=>{let d=qt(p),{clientX:h,clientY:m}=fn(p)?p.changedTouches[0]:p;l||(l=Ut()),o.push({x:h,y:m,id:s.getId(d),timeOffset:Ut()-l}),u(typeof DragEvent<"u"&&p instanceof DragEvent?D.Drag:p instanceof MouseEvent?D.MouseMove:D.TouchMove)}),n,{trailing:!1})),a=[ge("mousemove",c,r),ge("touchmove",c,r),ge("drag",c,r)];return z(()=>{a.forEach(p=>p())})}function Td({mouseInteractionCb:e,doc:t,mirror:r,blockClass:s,blockSelector:n,sampling:i}){if(i.mouseInteraction===!1)return()=>{};let o=i.mouseInteraction===!0||i.mouseInteraction===void 0?{}:i.mouseInteraction,l=[],u=null,c=a=>p=>{let d=qt(p);if(we(d,s,n,!0))return;let h=null,m=a;if("pointerType"in p){switch(p.pointerType){case"mouse":h=qe.Mouse;break;case"touch":h=qe.Touch;break;case"pen":h=qe.Pen;break}h===qe.Touch?H[a]===H.MouseDown?m="TouchStart":H[a]===H.MouseUp&&(m="TouchEnd"):qe.Pen}else fn(p)&&(h=qe.Touch);h!==null?(u=h,(m.startsWith("Touch")&&h===qe.Touch||m.startsWith("Mouse")&&h===qe.Mouse)&&(h=null)):H[a]===H.Click&&(h=u,u=null);let f=fn(p)?p.changedTouches[0]:p;if(!f)return;let g=r.getId(d),{clientX:b,clientY:v}=f;z(e)({type:H[m],id:g,x:b,y:v,...h!==null&&{pointerType:h}})};return Object.keys(H).filter(a=>Number.isNaN(Number(a))&&!a.endsWith("_Departed")&&o[a]!==!1).forEach(a=>{let p=He(a),d=c(a);if(window.PointerEvent)switch(H[a]){case H.MouseDown:case H.MouseUp:p=p.replace("mouse","pointer");break;case H.TouchStart:case H.TouchEnd:return}l.push(ge(p,d,t))}),z(()=>{l.forEach(a=>a())})}function Ya({scrollCb:e,doc:t,mirror:r,blockClass:s,blockSelector:n,sampling:i}){let o=z(Bt(z(l=>{let u=qt(l);if(!u||we(u,s,n,!0))return;let c=r.getId(u);if(u===t&&t.defaultView){let a=_a(t.defaultView);e({id:c,x:a.left,y:a.top})}else e({id:c,x:u.scrollLeft,y:u.scrollTop})}),i.scroll||100));return ge("scroll",o,t)}function Dd({viewportResizeCb:e},{win:t}){let r=-1,s=-1,n=z(Bt(z(()=>{let i=$a(),o=Fa();(r!==i||s!==o)&&(e({width:Number(o),height:Number(i)}),r=i,s=o)}),200));return ge("resize",n,t)}var Ad=["INPUT","TEXTAREA","SELECT"],jo=new WeakMap;function Ld({inputCb:e,doc:t,mirror:r,blockClass:s,blockSelector:n,ignoreClass:i,ignoreSelector:o,maskInputOptions:l,maskInputFn:u,sampling:c,userTriggeredOnInput:a}){function p(v){let y=qt(v),C=v.isTrusted,x=y&&y.tagName;if(y&&x==="OPTION"&&(y=F.parentElement(y)),!y||!x||Ad.indexOf(x)<0||we(y,s,n,!0)||y.classList.contains(i)||o&&y.matches(o))return;let w=y.value,E=!1,M=lr(y)||"";M==="radio"||M==="checkbox"?E=y.checked:(l[x.toLowerCase()]||l[M])&&(w=ar({element:y,maskInputOptions:l,tagName:x,type:M,value:w,maskInputFn:u})),d(y,a?{text:w,isChecked:E,userTriggered:C}:{text:w,isChecked:E});let k=y.name;M==="radio"&&k&&E&&t.querySelectorAll(`input[type="radio"][name="${k}"]`).forEach(N=>{if(N!==y){let P=N.value;d(N,a?{text:P,isChecked:!E,userTriggered:!1}:{text:P,isChecked:!E})}})}function d(v,y){let C=jo.get(v);if(!C||C.text!==y.text||C.isChecked!==y.isChecked){jo.set(v,y);let x=r.getId(v);z(e)({...y,id:x})}}let m=(c.input==="last"?["change"]:["input","change"]).map(v=>ge(v,z(p),t)),f=t.defaultView;if(!f)return()=>{m.forEach(v=>v())};let g=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),b=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&m.push(...b.map(v=>Lr(v[0],v[1],{set(){z(p)({target:this,isTrusted:!1})}},!1,f))),z(()=>{m.forEach(v=>v())})}function vr(e){let t=[];function r(s,n){if(rr("CSSGroupingRule")&&s.parentRule instanceof CSSGroupingRule||rr("CSSMediaRule")&&s.parentRule instanceof CSSMediaRule||rr("CSSSupportsRule")&&s.parentRule instanceof CSSSupportsRule||rr("CSSConditionRule")&&s.parentRule instanceof CSSConditionRule){let o=Array.from(s.parentRule.cssRules).indexOf(s);return n.unshift(o),r(s.parentRule,n)}else if(s.parentStyleSheet){let o=Array.from(s.parentStyleSheet.cssRules).indexOf(s);n.unshift(o)}return n}return r(e,t)}function Qe(e,t,r){let s,n;return e?(e.ownerNode?s=t.getId(e.ownerNode):n=r.getId(e),{styleId:n,id:s}):{}}function Pd({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:s}){if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};let n=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(n,{apply:z((a,p,d)=>{let[h,m]=d,{id:f,styleId:g}=Qe(p,t,r.styleMirror);return(f&&f!==-1||g&&g!==-1)&&e({id:f,styleId:g,adds:[{rule:h,index:m}]}),a.apply(p,d)})}),s.CSSStyleSheet.prototype.addRule=function(a,p,d=this.cssRules.length){let h=`${a} { ${p} }`;return s.CSSStyleSheet.prototype.insertRule.apply(this,[h,d])};let i=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:z((a,p,d)=>{let[h]=d,{id:m,styleId:f}=Qe(p,t,r.styleMirror);return(m&&m!==-1||f&&f!==-1)&&e({id:m,styleId:f,removes:[{index:h}]}),a.apply(p,d)})}),s.CSSStyleSheet.prototype.removeRule=function(a){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[a])};let o;s.CSSStyleSheet.prototype.replace&&(o=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:z((a,p,d)=>{let[h]=d,{id:m,styleId:f}=Qe(p,t,r.styleMirror);return(m&&m!==-1||f&&f!==-1)&&e({id:m,styleId:f,replace:h}),a.apply(p,d)})}));let l;s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:z((a,p,d)=>{let[h]=d,{id:m,styleId:f}=Qe(p,t,r.styleMirror);return(m&&m!==-1||f&&f!==-1)&&e({id:m,styleId:f,replaceSync:h}),a.apply(p,d)})}));let u={};sr("CSSGroupingRule")?u.CSSGroupingRule=s.CSSGroupingRule:(sr("CSSMediaRule")&&(u.CSSMediaRule=s.CSSMediaRule),sr("CSSConditionRule")&&(u.CSSConditionRule=s.CSSConditionRule),sr("CSSSupportsRule")&&(u.CSSSupportsRule=s.CSSSupportsRule));let c={};return Object.entries(u).forEach(([a,p])=>{c[a]={insertRule:p.prototype.insertRule,deleteRule:p.prototype.deleteRule},p.prototype.insertRule=new Proxy(c[a].insertRule,{apply:z((d,h,m)=>{let[f,g]=m,{id:b,styleId:v}=Qe(h.parentStyleSheet,t,r.styleMirror);return(b&&b!==-1||v&&v!==-1)&&e({id:b,styleId:v,adds:[{rule:f,index:[...vr(h),g||0]}]}),d.apply(h,m)})}),p.prototype.deleteRule=new Proxy(c[a].deleteRule,{apply:z((d,h,m)=>{let[f]=m,{id:g,styleId:b}=Qe(h.parentStyleSheet,t,r.styleMirror);return(g&&g!==-1||b&&b!==-1)&&e({id:g,styleId:b,removes:[{index:[...vr(h),f]}]}),d.apply(h,m)})})}),z(()=>{s.CSSStyleSheet.prototype.insertRule=n,s.CSSStyleSheet.prototype.deleteRule=i,o&&(s.CSSStyleSheet.prototype.replace=o),l&&(s.CSSStyleSheet.prototype.replaceSync=l),Object.entries(u).forEach(([a,p])=>{p.prototype.insertRule=c[a].insertRule,p.prototype.deleteRule=c[a].deleteRule})})}function Ja({mirror:e,stylesheetManager:t},r){var s,n,i;let o=null;r.nodeName==="#document"?o=e.getId(r):o=e.getId(F.host(r));let l=r.nodeName==="#document"?(s=r.defaultView)==null?void 0:s.Document:(i=(n=r.ownerDocument)==null?void 0:n.defaultView)==null?void 0:i.ShadowRoot,u=l?.prototype?Object.getOwnPropertyDescriptor(l?.prototype,"adoptedStyleSheets"):void 0;return o===null||o===-1||!l||!u?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var c;return(c=u.get)==null?void 0:c.call(this)},set(c){var a;let p=(a=u.set)==null?void 0:a.call(this,c);if(o!==null&&o!==-1)try{t.adoptStyleSheets(c,o)}catch{}return p}}),z(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))}function _d({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:s},{win:n}){let i=n.CSSStyleDeclaration.prototype.setProperty;n.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:z((l,u,c)=>{var a;let[p,d,h]=c;if(r.has(p))return i.apply(u,[p,d,h]);let{id:m,styleId:f}=Qe((a=u.parentRule)==null?void 0:a.parentStyleSheet,t,s.styleMirror);return(m&&m!==-1||f&&f!==-1)&&e({id:m,styleId:f,set:{property:p,value:d,priority:h},index:vr(u.parentRule)}),l.apply(u,c)})});let o=n.CSSStyleDeclaration.prototype.removeProperty;return n.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:z((l,u,c)=>{var a;let[p]=c;if(r.has(p))return o.apply(u,[p]);let{id:d,styleId:h}=Qe((a=u.parentRule)==null?void 0:a.parentStyleSheet,t,s.styleMirror);return(d&&d!==-1||h&&h!==-1)&&e({id:d,styleId:h,remove:{property:p},index:vr(u.parentRule)}),l.apply(u,c)})}),z(()=>{n.CSSStyleDeclaration.prototype.setProperty=i,n.CSSStyleDeclaration.prototype.removeProperty=o})}function $d({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:s,sampling:n,doc:i}){let o=z(u=>Bt(z(c=>{let a=qt(c);if(!a||we(a,t,r,!0))return;let{currentTime:p,volume:d,muted:h,playbackRate:m,loop:f}=a;e({type:u,id:s.getId(a),currentTime:p,volume:d,muted:h,playbackRate:m,loop:f})}),n.media||500)),l=[ge("play",o(Xe.Play),i),ge("pause",o(Xe.Pause),i),ge("seeked",o(Xe.Seeked),i),ge("volumechange",o(Xe.VolumeChange),i),ge("ratechange",o(Xe.RateChange),i)];return z(()=>{l.forEach(u=>u())})}function Fd({fontCb:e,doc:t}){let r=t.defaultView;if(!r)return()=>{};let s=[],n=new WeakMap,i=r.FontFace;r.FontFace=function(u,c,a){let p=new i(u,c,a);return n.set(p,{family:u,buffer:typeof c!="string",descriptors:a,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),p};let o=nt(t.fonts,"add",function(l){return function(u){return setTimeout(z(()=>{let c=n.get(u);c&&(e(c),n.delete(u))}),0),l.apply(this,[u])}});return s.push(()=>{r.FontFace=i}),s.push(o),z(()=>{s.forEach(l=>l())})}function Ud(e){let{doc:t,mirror:r,blockClass:s,blockSelector:n,selectionCb:i}=e,o=!0,l=z(()=>{let u=t.getSelection();if(!u||o&&u?.isCollapsed)return;o=u.isCollapsed||!1;let c=[],a=u.rangeCount||0;for(let p=0;p<a;p++){let d=u.getRangeAt(p),{startContainer:h,startOffset:m,endContainer:f,endOffset:g}=d;we(h,s,n,!0)||we(f,s,n,!0)||c.push({start:r.getId(h),startOffset:m,end:r.getId(f),endOffset:g})}i({ranges:c})});return l(),ge("selectionchange",l)}function Bd({doc:e,customElementCb:t}){let r=e.defaultView;return!r||!r.customElements?()=>{}:nt(r.customElements,"define",function(n){return function(i,o,l){try{t({define:{name:i}})}catch{console.warn(`Custom element callback failed for ${i}`)}return n.apply(this,[i,o,l])}})}function jd(e,t){let{mutationCb:r,mousemoveCb:s,mouseInteractionCb:n,scrollCb:i,viewportResizeCb:o,inputCb:l,mediaInteractionCb:u,styleSheetRuleCb:c,styleDeclarationCb:a,canvasMutationCb:p,fontCb:d,selectionCb:h,customElementCb:m}=e;e.mutationCb=(...f)=>{t.mutation&&t.mutation(...f),r(...f)},e.mousemoveCb=(...f)=>{t.mousemove&&t.mousemove(...f),s(...f)},e.mouseInteractionCb=(...f)=>{t.mouseInteraction&&t.mouseInteraction(...f),n(...f)},e.scrollCb=(...f)=>{t.scroll&&t.scroll(...f),i(...f)},e.viewportResizeCb=(...f)=>{t.viewportResize&&t.viewportResize(...f),o(...f)},e.inputCb=(...f)=>{t.input&&t.input(...f),l(...f)},e.mediaInteractionCb=(...f)=>{t.mediaInteaction&&t.mediaInteaction(...f),u(...f)},e.styleSheetRuleCb=(...f)=>{t.styleSheetRule&&t.styleSheetRule(...f),c(...f)},e.styleDeclarationCb=(...f)=>{t.styleDeclaration&&t.styleDeclaration(...f),a(...f)},e.canvasMutationCb=(...f)=>{t.canvasMutation&&t.canvasMutation(...f),p(...f)},e.fontCb=(...f)=>{t.font&&t.font(...f),d(...f)},e.selectionCb=(...f)=>{t.selection&&t.selection(...f),h(...f)},e.customElementCb=(...f)=>{t.customElement&&t.customElement(...f),m(...f)}}function zd(e,t={}){let r=e.doc.defaultView;if(!r)return()=>{};jd(e,t);let s;e.recordDOM&&(s=Ga(e,e.doc));let n=kd(e),i=Td(e),o=Ya(e),l=Dd(e,{win:r}),u=Ld(e),c=$d(e),a=()=>{},p=()=>{},d=()=>{},h=()=>{};e.recordDOM&&(a=Pd(e,{win:r}),p=Ja(e,e.doc),d=_d(e,{win:r}),e.collectFonts&&(h=Fd(e)));let m=Ud(e),f=Bd(e),g=[];for(let b of e.plugins)g.push(b.observer(b.callback,r,b.options));return z(()=>{s?.(),n(),i(),o(),l(),u(),c(),a(),p(),d(),h(),m(),f(),g.forEach(b=>b())})}function rr(e){return typeof window[e]<"u"}function sr(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var wr=class{constructor(t){O(this,"iframeIdToRemoteIdMap",new WeakMap),O(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,r,s,n){let i=s||this.getIdToRemoteIdMap(t),o=n||this.getRemoteIdToIdMap(t),l=i.get(r);return l||(l=this.generateIdFn(),i.set(r,l),o.set(l,r)),l}getIds(t,r){let s=this.getIdToRemoteIdMap(t),n=this.getRemoteIdToIdMap(t);return r.map(i=>this.getId(t,i,s,n))}getRemoteId(t,r,s){let n=s||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;let i=n.get(r);return i||-1}getRemoteIds(t,r){let s=this.getRemoteIdToIdMap(t);return r.map(n=>this.getRemoteId(t,n,s))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}},bn=class{constructor(t){O(this,"iframes",new WeakMap),O(this,"crossOriginIframeMap",new WeakMap),O(this,"crossOriginIframeMirror",new wr(aa)),O(this,"crossOriginIframeStyleMirror"),O(this,"crossOriginIframeRootIdMap",new WeakMap),O(this,"mirror"),O(this,"mutationCb"),O(this,"wrappedEmit"),O(this,"loadListener"),O(this,"unloadListener"),O(this,"attachedWindows",new Map),O(this,"messageHandler",r=>this.handleMessage(r)),O(this,"stylesheetManager"),O(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new wr(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}addUnloadListener(t){this.unloadListener=t}attachIframe(t,r){var s;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.watchIframeWindow(t),(s=this.loadListener)==null||s.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}destroy(){window.removeEventListener("message",this.messageHandler),this.attachedWindows.forEach(t=>t())}watchIframeWindow(t){let r=t.contentWindow;if(!r||this.attachedWindows.has(r))return;let s=[],n=()=>{this.attachedWindows.delete(r),s.forEach(i=>{try{i()}catch{}})};this.attachedWindows.set(r,n),this.recordCrossOriginIframes&&s.push(ge("message",this.messageHandler,r)),s.push(ge("pagehide",i=>{var o;if(i.persisted)return;let l=r.document;n(),(o=this.unloadListener)==null||o.call(this,l)},r))}handleMessage(t){let r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin||!t.source)return;let n=this.crossOriginIframeMap.get(t.source);if(!n)return;let i=this.transformCrossOriginEvent(n,r.data.event);i&&this.wrappedEmit(i,r.data.isCheckout)}transformCrossOriginEvent(t,r){var s;switch(r.type){case L.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);let n=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,n),this.patchRootIdOnNode(r.data.node,n),{timestamp:r.timestamp,type:L.IncrementalSnapshot,data:{source:D.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case L.Meta:case L.Load:case L.DomContentLoaded:return!1;case L.Annotation:case L.Plugin:return r;case L.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case L.IncrementalSnapshot:switch(r.data.source){case D.Mutation:return r.data.adds.forEach(n=>{this.replaceIds(n,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(n.node,t);let i=this.crossOriginIframeRootIdMap.get(t);i&&this.patchRootIdOnNode(n.node,i)}),r.data.removes.forEach(n=>{this.replaceIds(n,t,["parentId","id"])}),r.data.attributes.forEach(n=>{this.replaceIds(n,t,["id"])}),r.data.texts.forEach(n=>{this.replaceIds(n,t,["id"])}),r;case D.Drag:case D.TouchMove:case D.MouseMove:return r.data.positions.forEach(n=>{this.replaceIds(n,t,["id"])}),r;case D.ViewportResize:return!1;case D.MediaInteraction:case D.MouseInteraction:case D.Scroll:case D.CanvasMutation:case D.Input:return this.replaceIds(r.data,t,["id"]),r;case D.StyleSheetRule:case D.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case D.Font:return r;case D.Selection:return r.data.ranges.forEach(n=>{this.replaceIds(n,t,["start","end"])}),r;case D.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(s=r.data.styles)==null||s.forEach(n=>{this.replaceStyleIds(n,t,["styleId"])}),r}}return!1}replace(t,r,s,n){for(let i of n)!Array.isArray(r[i])&&typeof r[i]!="number"||(Array.isArray(r[i])?r[i]=t.getIds(s,r[i]):r[i]=t.getId(s,r[i]));return r}replaceIds(t,r,s){return this.replace(this.crossOriginIframeMirror,t,r,s)}replaceStyleIds(t,r,s){return this.replace(this.crossOriginIframeStyleMirror,t,r,s)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(s=>{this.replaceIdOnNode(s,r)})}patchRootIdOnNode(t,r){t.type!==Ve.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(s=>{this.patchRootIdOnNode(s,r)})}},vn=class{constructor(t){O(this,"shadowDoms",new Map),O(this,"mutationCb"),O(this,"scrollCb"),O(this,"bypassOptions"),O(this,"mirror"),O(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,r){if(!Lt(t)||this.shadowDoms.has(t))return;let s=[];this.shadowDoms.set(t,s);let n=Ga({...this.bypassOptions,doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);s.push(n),s.push(Ya({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),setTimeout(()=>{this.shadowDoms.get(t)===s&&(t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(F.host(t))),s.push(Ja({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)))},0)}removeShadowRootsIn(t){if(this.shadowDoms.size===0)return;let r=F.shadowRoot(t);r&&(this.shadowDoms.has(r)&&this.removeShadowRoot(r),this.removeShadowRootsIn(r)),F.childNodes(t).forEach(s=>this.removeShadowRootsIn(s))}removeShadowRoot(t){let r=this.shadowDoms.get(t);this.shadowDoms.delete(t),r?.forEach(Ys)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,r){let s=this;this.restoreHandlers.push(nt(t.prototype,"attachShadow",function(n){return function(i){let o=n.call(this,i),l=F.shadowRoot(this);return l&&mn(this)&&s.addShadowRoot(l,r),o}}))}reset(){this.restoreHandlers.forEach(Ys),this.restoreHandlers=[];let t=this.shadowDoms;this.shadowDoms=new Map,t.forEach(r=>r.forEach(Ys))}};function Ys(e){try{e()}catch{}}var pt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Dt=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(Nt=0;Nt<pt.length;Nt++)Dt[pt.charCodeAt(Nt)]=Nt;var Nt,Wd=function(e){var t=new Uint8Array(e),r,s=t.length,n="";for(r=0;r<s;r+=3)n+=pt[t[r]>>2],n+=pt[(t[r]&3)<<4|t[r+1]>>4],n+=pt[(t[r+1]&15)<<2|t[r+2]>>6],n+=pt[t[r+2]&63];return s%3===2?n=n.substring(0,n.length-1)+"=":s%3===1&&(n=n.substring(0,n.length-2)+"=="),n},qd=function(e){var t=e.length*.75,r=e.length,s,n=0,i,o,l,u;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var c=new ArrayBuffer(t),a=new Uint8Array(c);for(s=0;s<r;s+=4)i=Dt[e.charCodeAt(s)],o=Dt[e.charCodeAt(s+1)],l=Dt[e.charCodeAt(s+2)],u=Dt[e.charCodeAt(s+3)],a[n++]=i<<2|o>>4,a[n++]=(o&15)<<4|l>>2,a[n++]=(l&3)<<6|u&63;return c},zo=new Map;function Vd(e,t){let r=zo.get(e);return r||(r=new Map,zo.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}var Qa=(e,t,r)=>{if(!e||!(Ka(e,t)||typeof e=="object"))return;let s=e.constructor.name,n=Vd(r,s),i=n.indexOf(e);return i===-1&&(i=n.length,n.push(e)),i};function ir(e,t,r){if(e instanceof Array)return e.map(s=>ir(s,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){let s=e.constructor.name,n=Wd(e);return{rr_type:s,base64:n}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[ir(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let s=e.constructor.name,{src:n}=e;return{rr_type:s,src:n}}else if(e instanceof HTMLCanvasElement){let s="HTMLImageElement",n=e.toDataURL();return{rr_type:s,src:n}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[ir(e.data,t,r),e.width,e.height]};if(Ka(e,t)||typeof e=="object"){let s=e.constructor.name,n=Qa(e,t,r);return{rr_type:s,index:n}}}}return e}var Xa=(e,t,r)=>e.map(s=>ir(s,t,r)),Ka=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(n=>typeof t[n]=="function").find(n=>e instanceof t[n]);function Hd(e,t,r,s){let n=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let o of i)try{if(typeof t.CanvasRenderingContext2D.prototype[o]!="function")continue;let l=nt(t.CanvasRenderingContext2D.prototype,o,function(u){return function(...c){return we(this.canvas,r,s,!0)||setTimeout(()=>{let a=Xa(c,t,this);e(this.canvas,{type:Ge["2D"],property:o,args:a})},0),u.apply(this,c)}});n.push(l)}catch{let l=Lr(t.CanvasRenderingContext2D.prototype,o,{set(u){e(this.canvas,{type:Ge["2D"],property:o,args:[u],setter:!0})}});n.push(l)}return()=>{n.forEach(o=>o())}}function Gd(e){return e==="experimental-webgl"?"webgl":e}function Wo(e,t,r,s){let n=[];try{let i=nt(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(l,...u){if(!we(this,t,r,!0)){let c=Gd(l);if("__context"in this||(this.__context=c),s&&["webgl","webgl2"].includes(c))if(u[0]&&typeof u[0]=="object"){let a=u[0];a.preserveDrawingBuffer||(a.preserveDrawingBuffer=!0)}else u.splice(0,1,{preserveDrawingBuffer:!0})}return o.apply(this,[l,...u])}});n.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(i=>i())}}function qo(e,t,r,s,n,i){let o=[],l=Object.getOwnPropertyNames(e);for(let u of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))try{if(typeof e[u]!="function")continue;let c=nt(e,u,function(a){return function(...p){let d=a.apply(this,p);if(Qa(d,i,this),"tagName"in this.canvas&&!we(this.canvas,s,n,!0)){let h=Xa(p,i,this),m={type:t,property:u,args:h};r(this.canvas,m)}return d}});o.push(c)}catch{let c=Lr(e,u,{set(a){r(this.canvas,{type:t,property:u,args:[a],setter:!0})}});o.push(c)}return o}function Yd(e,t,r,s){let n=[];return typeof t.WebGLRenderingContext<"u"&&n.push(...qo(t.WebGLRenderingContext.prototype,Ge.WebGL,e,r,s,t)),typeof t.WebGL2RenderingContext<"u"&&n.push(...qo(t.WebGL2RenderingContext.prototype,Ge.WebGL2,e,r,s,t)),()=>{n.forEach(i=>i())}}var Za=`(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = \\`\\${width}-\\${height}\\`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n`,Vo=typeof self<"u"&&self.Blob&&new Blob([Za],{type:"text/javascript;charset=utf-8"});function Jd(e){let t;try{if(t=Vo&&(self.URL||self.webkitURL).createObjectURL(Vo),!t)throw"";let r=new Worker(t,{name:e?.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Za),{name:e?.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var wn=class{constructor(t){O(this,"pendingCanvasMutations",new Map),O(this,"rafStamps",{latestId:0,invokeId:null}),O(this,"mirror"),O(this,"mutationCb"),O(this,"resetObservers"),O(this,"frozen",!1),O(this,"locked",!1),O(this,"processMutation",(u,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(u)||this.pendingCanvasMutations.set(u,[]),this.pendingCanvasMutations.get(u).push(c)});let{sampling:r="all",win:s,blockClass:n,blockSelector:i,recordCanvas:o,dataURLOptions:l}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&r==="all"&&this.initCanvasMutationObserver(s,n,i),o&&typeof r=="number"&&this.initCanvasFPSObserver(r,s,n,i,{dataURLOptions:l})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,s,n,i){let o=Wo(r,s,n,!0),l=new Map,u=new Jd;u.onmessage=m=>{let{id:f}=m.data;if(l.set(f,!1),!("base64"in m.data))return;let{base64:g,type:b,width:v,height:y}=m.data;this.mutationCb({id:f,type:Ge["2D"],commands:[{property:"clearRect",args:[0,0,v,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:g}],type:b}]},0,0]}]})};let c=1e3/t,a=0,p,d=()=>{let m=[];return r.document.querySelectorAll("canvas").forEach(f=>{we(f,s,n,!0)||m.push(f)}),m},h=m=>{if(a&&m-a<c){p=requestAnimationFrame(h);return}a=m,d().forEach(async f=>{var g;let b=this.mirror.getId(f);if(l.get(b)||f.width===0||f.height===0)return;if(l.set(b,!0),["webgl","webgl2"].includes(f.__context)){let y=f.getContext(f.__context);((g=y?.getContextAttributes())==null?void 0:g.preserveDrawingBuffer)===!1&&y.clear(y.COLOR_BUFFER_BIT)}let v=await createImageBitmap(f);u.postMessage({id:b,bitmap:v,width:f.width,height:f.height,dataURLOptions:i.dataURLOptions},[v])}),p=requestAnimationFrame(h)};p=requestAnimationFrame(h),this.resetObservers=()=>{o(),cancelAnimationFrame(p)}}initCanvasMutationObserver(t,r,s){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let n=Wo(t,r,s,!1),i=Hd(this.processMutation.bind(this),t,r,s),o=Yd(this.processMutation.bind(this),t,r,s);this.resetObservers=()=>{n(),i(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{let s=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,s)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;let s=this.pendingCanvasMutations.get(t);if(!s||r===-1)return;let n=s.map(o=>{let{type:l,...u}=o;return u}),{type:i}=s[0];this.mutationCb({id:r,type:i,commands:n}),this.pendingCanvasMutations.delete(t)}},Sn=class{constructor(t){O(this,"trackedLinkElements",new WeakSet),O(this,"mutationCb"),O(this,"adoptedStyleSheetCb"),O(this,"styleMirror",new br),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;let s={id:r,styleIds:[]},n=[];for(let i of t){let o;this.styleMirror.has(i)?o=this.styleMirror.getId(i):(o=this.styleMirror.add(i),n.push({styleId:o,rules:Array.from(i.rules||CSSRule,(l,u)=>({rule:na(l,i.href),index:u}))})),s.styleIds.push(o)}n.length>0&&(s.styles=n),this.adoptedStyleSheetCb(s)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}},xn=class{constructor(){O(this,"nodeMap",new WeakMap),O(this,"active",!1)}inOtherBuffer(t,r){let s=this.nodeMap.get(t);return s&&Array.from(s).some(n=>n!==r)}add(t,r){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}destroy(){}},oe,or,Je,jt=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((hi=e.contentWindow)==null?void 0:hi.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var De=ia();function Ze(e={}){let{emit:t,checkoutEveryNms:r,checkoutEveryNth:s,blockClass:n="rr-block",blockSelector:i=null,ignoreClass:o="rr-ignore",ignoreSelector:l=null,maskTextClass:u="rr-mask",maskTextSelector:c=null,inlineStylesheet:a=!0,maskAllInputs:p,maskInputOptions:d,slimDOMOptions:h,maskInputFn:m,maskTextFn:f,hooks:g,packFn:b,sampling:v={},dataURLOptions:y={},mousemoveWait:C,recordDOM:x=!0,recordCanvas:w=!1,recordCrossOriginIframes:E=!1,recordAfter:M=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:k=!1,collectFonts:N=!1,inlineImages:P=!1,plugins:A,keepIframeSrcFn:R=()=>!1,ignoreCSSAttributes:Ce=new Set([]),errorHandler:be}=e;Od(be);let V=E?window.parent===window:!0,_=!1;if(!V)try{window.parent.document&&(_=!1)}catch{_=!0}if(V&&!t)throw new Error("emit function is required");if(!V&&!_)return()=>{};C!==void 0&&v.mousemove===void 0&&(v.mousemove=C),De.reset();let K=p===!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},ue=da(h);ja();let ne,Y=0,Ye=$=>{for(let ce of A||[])ce.eventProcessor&&($=ce.eventProcessor($));return b&&!_&&($=b($)),$};oe=($,ce)=>{let U=$;if(U.timestamp=Ut(),U.type!==L.FullSnapshot&&!(U.type===L.IncrementalSnapshot&&U.data.source===D.Mutation)){Je.unfreeze();for(let Se of mt)if(Se.isFrozen())Se.unfreeze();else break}if(V)t?.(Ye(U),ce);else if(_){let Se={type:"rrweb",event:Ye(U),origin:window.location.origin,isCheckout:ce};window.parent.postMessage(Se,"*")}if(U.type===L.FullSnapshot)ne=U,Y=0;else if(U.type===L.IncrementalSnapshot){if(U.data.source===D.Mutation&&U.data.isAttachIframe)return;Y++;let Se=s&&Y>=s,ke=r&&U.timestamp-ne.timestamp>r;(Se||ke)&&or(!0)}};let I=$=>{oe({type:L.IncrementalSnapshot,data:{source:D.Mutation,...$}})},Be=$=>oe({type:L.IncrementalSnapshot,data:{source:D.Scroll,...$}}),Ie=$=>oe({type:L.IncrementalSnapshot,data:{source:D.CanvasMutation,...$}}),vt=$=>oe({type:L.IncrementalSnapshot,data:{source:D.AdoptedStyleSheet,...$}}),ve=new Sn({mutationCb:I,adoptedStyleSheetCb:vt}),Ee=new bn({mirror:De,mutationCb:I,stylesheetManager:ve,recordCrossOriginIframes:E,wrappedEmit:oe});for(let $ of A||[])$.getMirror&&$.getMirror({nodeMirror:De,crossOriginIframeMirror:Ee.crossOriginIframeMirror,crossOriginIframeStyleMirror:Ee.crossOriginIframeStyleMirror});let et=new xn;Je=new wn({recordCanvas:w,mutationCb:Ie,win:window,blockClass:n,blockSelector:i,mirror:De,sampling:v.canvas,dataURLOptions:y});let je=new vn({mutationCb:I,scrollCb:Be,bypassOptions:{blockClass:n,blockSelector:i,maskTextClass:u,maskTextSelector:c,inlineStylesheet:a,maskInputOptions:K,dataURLOptions:y,maskTextFn:f,maskInputFn:m,recordCanvas:w,inlineImages:P,sampling:v,slimDOMOptions:ue,iframeManager:Ee,stylesheetManager:ve,canvasManager:Je,keepIframeSrcFn:R,processedNodeManager:et},mirror:De});or=($=!1)=>{if(!x)return;oe({type:L.Meta,data:{href:window.location.href,width:Fa(),height:$a()}},$),ve.reset(),je.init(),Je.lock(),mt.forEach(U=>U.lock());let ce=ku(document,{mirror:De,blockClass:n,blockSelector:i,maskTextClass:u,maskTextSelector:c,inlineStylesheet:a,maskAllInputs:K,maskTextFn:f,maskInputFn:m,slimDOM:ue,dataURLOptions:y,recordCanvas:w,inlineImages:P,onSerialize:U=>{_t(U,De)&&Ee.addIframe(U),Wa(U,De)&&ve.trackLinkElement(U),tt(U)&&je.addShadowRoot(F.shadowRoot(U),document)},onIframeLoad:(U,Se)=>{Ee.attachIframe(U,Se),je.observeAttachShadow(U)},onStylesheetLoad:(U,Se)=>{ve.attachLinkElement(U,Se)},keepIframeSrcFn:R});if(!ce)return console.warn("Failed to snapshot the document");oe({type:L.FullSnapshot,data:{node:ce,initialOffset:_a(window)}},$),Je.unlock(),mt.forEach(U=>U.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ve.adoptStyleSheets(document.adoptedStyleSheets,De.getId(document))};try{let $=[],ce=ke=>{var xe;return z(zd)({mutationCb:I,mousemoveCb:(Q,_r)=>oe({type:L.IncrementalSnapshot,data:{source:_r,positions:Q}}),mouseInteractionCb:Q=>oe({type:L.IncrementalSnapshot,data:{source:D.MouseInteraction,...Q}}),scrollCb:Be,viewportResizeCb:Q=>oe({type:L.IncrementalSnapshot,data:{source:D.ViewportResize,...Q}}),inputCb:Q=>oe({type:L.IncrementalSnapshot,data:{source:D.Input,...Q}}),mediaInteractionCb:Q=>oe({type:L.IncrementalSnapshot,data:{source:D.MediaInteraction,...Q}}),styleSheetRuleCb:Q=>oe({type:L.IncrementalSnapshot,data:{source:D.StyleSheetRule,...Q}}),styleDeclarationCb:Q=>oe({type:L.IncrementalSnapshot,data:{source:D.StyleDeclaration,...Q}}),canvasMutationCb:Ie,fontCb:Q=>oe({type:L.IncrementalSnapshot,data:{source:D.Font,...Q}}),selectionCb:Q=>{oe({type:L.IncrementalSnapshot,data:{source:D.Selection,...Q}})},customElementCb:Q=>{oe({type:L.IncrementalSnapshot,data:{source:D.CustomElement,...Q}})},blockClass:n,ignoreClass:o,ignoreSelector:l,maskTextClass:u,maskTextSelector:c,maskInputOptions:K,inlineStylesheet:a,sampling:v,recordDOM:x,recordCanvas:w,inlineImages:P,userTriggeredOnInput:k,collectFonts:N,doc:ke,maskInputFn:m,maskTextFn:f,keepIframeSrcFn:R,blockSelector:i,slimDOMOptions:ue,dataURLOptions:y,mirror:De,iframeManager:Ee,stylesheetManager:ve,shadowDomManager:je,processedNodeManager:et,canvasManager:Je,ignoreCSSAttributes:Ce,plugins:((xe=A?.filter(Q=>Q.observer))==null?void 0:xe.map(Q=>({observer:Q.observer,options:Q.options,callback:_r=>oe({type:L.Plugin,data:{plugin:Q.name,payload:_r}})})))||[]},g)},U=new Map;Ee.addLoadListener(ke=>{try{let xe=ke.contentDocument;if(U.has(xe))return;U.set(xe,ce(xe))}catch(xe){console.warn(xe)}}),Ee.addUnloadListener(ke=>{let xe=U.get(ke);xe&&(U.delete(ke),xe(),je.removeShadowRootsIn(ke),De.removeNodeFromMap(ke))});let Se=()=>{or(),$.push(ce(document)),jt=!0};return["interactive","complete"].includes(document.readyState)?Se():($.push(ge("DOMContentLoaded",()=>{oe({type:L.DomContentLoaded,data:{}}),M==="DOMContentLoaded"&&Se()})),$.push(ge("load",()=>{oe({type:L.Load,data:{}}),M==="load"&&Se()},window))),()=>{[...$,...U.values()].forEach(ke=>{try{ke()}catch(xe){String(xe).toLowerCase().includes("cross-origin")||console.warn(xe)}}),U.clear(),Ee.destroy(),et.destroy(),je.reset(),Je.reset(),jt=!1,Id()}}catch($){console.warn($)}}Ze.addCustomEvent=(e,t)=>{if(!jt)throw new Error("please add custom event after start recording");oe({type:L.Custom,data:{tag:e,payload:t}})};Ze.addAnnotation=e=>{if(!jt)throw new Error("please add annotation after recording started");oe({type:L.Annotation,data:e})};Ze.freezePage=()=>{Je.freeze(),mt.forEach(e=>e.freeze())};Ze.takeFullSnapshot=e=>{if(!jt)throw new Error("please take full snapshot after start recording");or(e)};Ze.mirror=De;function Qd(e){return{all:e=e||new Map,on:function(t,r){var s=e.get(t);s?s.push(r):e.set(t,[r])},off:function(t,r){var s=e.get(t);s&&(r?s.splice(s.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var s=e.get(t);s&&s.slice().map(function(n){n(r)}),(s=e.get("*"))&&s.slice().map(function(n){n(t,r)})}}}function Xd(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;let r=e.HTMLElement||e.Element,s=468,n={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||u,scrollIntoView:r.prototype.scrollIntoView},i=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function o(b){let v=["MSIE ","Trident/","Edge/"];return new RegExp(v.join("|")).test(b)}let l=o(e.navigator.userAgent)?1:0;function u(b,v){this.scrollLeft=b,this.scrollTop=v}function c(b){return .5*(1-Math.cos(Math.PI*b))}function a(b){if(b===null||typeof b!="object"||b.behavior===void 0||b.behavior==="auto"||b.behavior==="instant")return!0;if(typeof b=="object"&&b.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+b.behavior+" is not a valid value for enumeration ScrollBehavior.")}function p(b,v){if(v==="Y")return b.clientHeight+l<b.scrollHeight;if(v==="X")return b.clientWidth+l<b.scrollWidth}function d(b,v){let y=e.getComputedStyle(b,null)["overflow"+v];return y==="auto"||y==="scroll"}function h(b){let v=p(b,"Y")&&d(b,"Y"),y=p(b,"X")&&d(b,"X");return v||y}function m(b){for(;b!==t.body&&h(b)===!1;)b=b.parentNode||b.host;return b}function f(b){let v=i(),y,C,x,w=(v-b.startTime)/s;w=w>1?1:w,y=c(w),C=b.startX+(b.x-b.startX)*y,x=b.startY+(b.y-b.startY)*y,b.method.call(b.scrollable,C,x),(C!==b.x||x!==b.y)&&e.requestAnimationFrame(f.bind(e,b))}function g(b,v,y){let C,x,w,E,M=i();b===t.body?(C=e,x=e.scrollX||e.pageXOffset,w=e.scrollY||e.pageYOffset,E=n.scroll):(C=b,x=b.scrollLeft,w=b.scrollTop,E=u),f({scrollable:C,method:E,startTime:M,startX:x,startY:w,x:v,y})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(a(arguments[0])===!0){n.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset);return}g.call(e,t.body,arguments[0].left!==void 0?~~arguments[0].left:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:e.scrollY||e.pageYOffset)}},e.scrollBy=function(){if(arguments[0]!==void 0){if(a(arguments[0])){n.scrollBy.call(e,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}g.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset))}},r.prototype.scroll=r.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(a(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");n.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}let b=arguments[0].left,v=arguments[0].top;g.call(this,this,typeof b>"u"?this.scrollLeft:~~b,typeof v>"u"?this.scrollTop:~~v)},r.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(a(arguments[0])===!0){n.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})}},r.prototype.scrollIntoView=function(){if(a(arguments[0])===!0){n.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}let b=m(this),v=b.getBoundingClientRect(),y=this.getBoundingClientRect();b!==t.body?(g.call(this,b,b.scrollLeft+y.left-v.left,b.scrollTop+y.top-v.top),e.getComputedStyle(b).position!=="fixed"&&e.scrollBy({left:v.left,top:v.top,behavior:"smooth"})):e.scrollBy({left:y.left,top:y.top,behavior:"smooth"})}}var Cn=class{constructor(t=[],r){O(this,"timeOffset",0),O(this,"speed"),O(this,"actions"),O(this,"raf",null),O(this,"lastTimestamp"),this.actions=t,this.speed=r.speed}addAction(t){let r=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=t.delay)this.actions.push(t);else{let s=this.findActionIndex(t);this.actions.splice(s,0,t)}r&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}updateLiveTime(){this.raf===!0&&this.rafCheck()}rafCheck(){let t=performance.now();for(this.timeOffset+=(t-this.lastTimestamp)*this.speed,this.lastTimestamp=t;this.actions.length;){let r=this.actions[0];if(this.timeOffset>=r.delay)this.actions.shift(),r.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(t){this.speed=t}isActive(){return this.raf!==null}findActionIndex(t){let r=0,s=this.actions.length-1;for(;r<=s;){let n=Math.floor((r+s)/2);if(this.actions[n].delay<t.delay)r=n+1;else if(this.actions[n].delay>t.delay)s=n-1;else return n+1}return r}};function Ho(e,t){if(e.type===L.IncrementalSnapshot&&e.data.source===D.MouseMove&&e.data.positions&&e.data.positions.length){let r=e.data.positions[0].timeOffset,s=e.timestamp+r;return e.delay=s-t,s-t}return e.delay=e.timestamp-t,e.delay}function Go(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var s,n,i=r.call(e),o=[];try{for(;(t===void 0||t-- >0)&&!(s=i.next()).done;)o.push(s.value)}catch(l){n={error:l}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return o}var ft;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(ft||(ft={}));var el={type:"xstate.init"};function Js(e){return e===void 0?[]:[].concat(e)}function ct(e){return{type:"xstate.assign",assignment:e}}function Yo(e,t){return typeof(e=typeof e=="string"&&t&&t[e]?t[e]:e)=="string"?{type:e}:typeof e=="function"?{type:e.name,exec:e}:e}function Sr(e){return function(t){return e===t}}function tl(e){return typeof e=="string"?{type:e}:e}function Jo(e,t){return{value:e,context:t,actions:[],changed:!1,matches:Sr(e)}}function Qo(e,t,r){var s=t,n=!1;return[e.filter(function(i){if(i.type==="xstate.assign"){n=!0;var o=Object.assign({},s);return typeof i.assignment=="function"?o=i.assignment(s,r):Object.keys(i.assignment).forEach(function(l){o[l]=typeof i.assignment[l]=="function"?i.assignment[l](s,r):i.assignment[l]}),s=o,!1}return!0}),s,n]}function rl(e,t){t===void 0&&(t={});var r=Go(Qo(Js(e.states[e.initial].entry).map(function(o){return Yo(o,t.actions)}),e.context,el),2),s=r[0],n=r[1],i={config:e,_options:t,initialState:{value:e.initial,actions:s,context:n,matches:Sr(e.initial)},transition:function(o,l){var u,c,a=typeof o=="string"?{value:o,context:e.context}:o,p=a.value,d=a.context,h=tl(l),m=e.states[p];if(m.on){var f=Js(m.on[h.type]);try{for(var g=(function(_){var K=typeof Symbol=="function"&&Symbol.iterator,ue=K&&_[K],ne=0;if(ue)return ue.call(_);if(_&&typeof _.length=="number")return{next:function(){return _&&ne>=_.length&&(_=void 0),{value:_&&_[ne++],done:!_}}};throw new TypeError(K?"Object is not iterable.":"Symbol.iterator is not defined.")})(f),b=g.next();!b.done;b=g.next()){var v=b.value;if(v===void 0)return Jo(p,d);var y=typeof v=="string"?{target:v}:v,C=y.target,x=y.actions,w=x===void 0?[]:x,E=y.cond,M=E===void 0?function(){return!0}:E,k=C===void 0,N=C??p,P=e.states[N];if(M(d,h)){var A=Go(Qo((k?Js(w):[].concat(m.exit,w,P.entry).filter(function(_){return _})).map(function(_){return Yo(_,i._options.actions)}),d,h),3),R=A[0],Ce=A[1],be=A[2],V=C??p;return{value:V,context:Ce,actions:R,changed:C!==p||R.length>0||be,matches:Sr(V)}}}}catch(_){u={error:_}}finally{try{b&&!b.done&&(c=g.return)&&c.call(g)}finally{if(u)throw u.error}}}return Jo(p,d)}};return i}var Xo=function(e,t){return e.actions.forEach(function(r){var s=r.exec;return s&&s(e.context,t)})};function sl(e){var t=e.initialState,r=ft.NotStarted,s=new Set,n={_machine:e,send:function(i){r===ft.Running&&(t=e.transition(t,i),Xo(t,tl(i)),s.forEach(function(o){return o(t)}))},subscribe:function(i){return s.add(i),i(t),{unsubscribe:function(){return s.delete(i)}}},start:function(i){if(i){var o=typeof i=="object"?i:{context:e.config.context,value:i};t={value:o.value,actions:[],context:o.context,matches:Sr(o.value)}}return r=ft.Running,Xo(t,el),n},stop:function(){return r=ft.Stopped,s.clear(),n},get state(){return t},get status(){return r}};return n}function Kd(e,t){for(let r=e.length-1;r>=0;r--){let s=e[r];if(s.type===L.Meta&&s.timestamp<=t)return e.slice(r)}return e}function Zd(e,{getCastFn:t,applyEventsSynchronously:r,emitter:s}){let n=rl({id:"player",context:e,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:ct({lastPlayedEvent:(i,o)=>o.type==="CAST_EVENT"?o.payload.event:i.lastPlayedEvent}),recordTimeOffset:ct((i,o)=>{let l=i.timeOffset;return"payload"in o&&"timeOffset"in o.payload&&(l=o.payload.timeOffset),{...i,timeOffset:l,baselineTime:i.events[0].timestamp+l}}),play(i){var o;let{timer:l,events:u,baselineTime:c,lastPlayedEvent:a}=i;l.clear();for(let m of u)Ho(m,c);let p=Kd(u,c),d=a?.timestamp;a?.type===L.IncrementalSnapshot&&a.data.source===D.MouseMove&&(d=a.timestamp+((o=a.data.positions[0])==null?void 0:o.timeOffset)),c<(d||0)&&s.emit(q.PlayBack);let h=new Array;for(let m of p)if(!(d&&d<c&&(m.timestamp<=d||m===a)))if(m.timestamp<c)h.push(m);else{let f=t(m,!1);l.addAction({doAction:()=>{f()},delay:m.delay})}r(h),s.emit(q.Flush),l.start()},pause(i){i.timer.clear()},resetLastPlayedEvent:ct(i=>({...i,lastPlayedEvent:null})),startLive:ct({baselineTime:(i,o)=>(i.timer.start(),o.type==="TO_LIVE"&&o.payload.baselineTime?o.payload.baselineTime:Date.now())}),addEvent:ct((i,o)=>{let{baselineTime:l,timer:u,events:c}=i;if(o.type==="ADD_EVENT"){let{event:a}=o.payload;Ho(a,l);let p=c.length-1;if(!c[p]||c[p].timestamp<=a.timestamp)c.push(a);else{let m=-1,f=0;for(;f<=p;){let g=Math.floor((f+p)/2);c[g].timestamp<=a.timestamp?f=g+1:p=g-1}m===-1&&(m=f),c.splice(m,0,a)}let d=a.timestamp<l,h=t(a,d);d?h():u.isActive()&&u.addAction({doAction:()=>{h()},delay:a.delay})}return{...i,events:c}})}});return sl(n)}function eh(e){let t=rl({id:"speed",context:e,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:(r,s)=>{"payload"in s&&r.timer.setSpeed(s.payload.speed)},recordSpeed:ct({normalSpeed:r=>r.timer.speed}),restoreSpeed:r=>{r.timer.setSpeed(r.normalSpeed)}}});return sl(t)}var th=e=>[`.${e} { background: currentColor }`,"noscript { display: none !important; }"],Ko=new Map;function nl(e,t){let r=Ko.get(e);return r||(r=new Map,Ko.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}function Ke(e,t,r){return async s=>{if(s&&typeof s=="object"&&"rr_type"in s)if(r&&(r.isUnchanged=!1),s.rr_type==="ImageBitmap"&&"args"in s){let n=await Ke(e,t,r)(s.args);return await createImageBitmap.apply(null,n)}else if("index"in s){if(r||t===null)return s;let{rr_type:n,index:i}=s;return nl(t,n)[i]}else if("args"in s){let{rr_type:n,args:i}=s,o=window[n];return new o(...await Promise.all(i.map(Ke(e,t,r))))}else{if("base64"in s)return qd(s.base64);if("src"in s){let n=e.get(s.src);if(n)return n;{let i=new Image;return i.src=s.src,e.set(s.src,i),i}}else if("data"in s&&s.rr_type==="Blob"){let n=await Promise.all(s.data.map(Ke(e,t,r)));return new Blob(n,{type:s.type})}}else if(Array.isArray(s))return await Promise.all(s.map(Ke(e,t,r)));return s}}function rh(e,t){try{return t===Ge.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}var sh=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function nh(e,t){if(!t?.constructor)return;let{name:r}=t.constructor;if(!sh.includes(r))return;let s=nl(e,r);s.includes(t)||s.push(t)}async function ih({mutation:e,target:t,type:r,imageMap:s,errorHandler:n}){try{let i=rh(t,r);if(!i)return;if(e.setter){i[e.property]=e.args[0];return}let o=i[e.property],l=await Promise.all(e.args.map(Ke(s,i))),u=o.apply(i,l);nh(i,u);let c=!1}catch(i){n(e,i)}}async function oh({event:e,mutations:t,target:r,imageMap:s,errorHandler:n}){let i=r.getContext("2d");if(!i){n(t[0],new Error("Canvas context is null"));return}let o=t.map(async u=>Promise.all(u.args.map(Ke(s,i))));(await Promise.all(o)).forEach((u,c)=>{let a=t[c];try{if(a.setter){i[a.property]=a.args[0];return}let p=i[a.property];a.property==="drawImage"&&typeof a.args[0]=="string"?(s.get(e),p.apply(i,a.args)):p.apply(i,u)}catch(p){n(a,p)}})}async function Zo({event:e,mutation:t,target:r,imageMap:s,canvasEventMap:n,errorHandler:i}){try{let o=n.get(e)||t,l="commands"in o?o.commands:[o];if([Ge.WebGL,Ge.WebGL2].includes(t.type)){for(let u=0;u<l.length;u++){let c=l[u];await ih({mutation:c,type:t.type,target:r,imageMap:s,errorHandler:i})}return}await oh({event:e,mutations:l,target:r,imageMap:s,errorHandler:i})}catch(o){i(t,o)}}var En=class{constructor(t){O(this,"mediaMap",new Map),O(this,"warn"),O(this,"service"),O(this,"speedService"),O(this,"emitter"),O(this,"getCurrentTime"),O(this,"metadataCallbackMap",new Map),this.warn=t.warn,this.service=t.service,this.speedService=t.speedService,this.emitter=t.emitter,this.getCurrentTime=t.getCurrentTime,this.emitter.on(q.Start,this.start.bind(this)),this.emitter.on(q.SkipStart,this.start.bind(this)),this.emitter.on(q.Pause,this.pause.bind(this)),this.emitter.on(q.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(t={pause:!1}){this.mediaMap.forEach((r,s)=>{this.syncTargetWithState(s),t.pause&&s.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:t,target:r,mediaState:s}){if(s.isPlaying){let i=(t-s.lastInteractionTimeOffset)/1e3*s.playbackRate,o="duration"in r&&r.duration;if(Number.isNaN(o)){this.waitForMetadata(r);return}let l=s.currentTimeAtLastInteraction+i;r.loop&&o!==!1&&(l=l%o),r.currentTime=l}else r.pause(),r.currentTime=s.currentTimeAtLastInteraction}waitForMetadata(t){if(this.metadataCallbackMap.has(t)||!("addEventListener"in t))return;let r=()=>{this.metadataCallbackMap.delete(t);let s=this.mediaMap.get(t);s&&this.seekTo({time:this.getCurrentTime(),target:t,mediaState:s})};this.metadataCallbackMap.set(t,r),t.addEventListener("loadedmetadata",r,{once:!0})}getMediaStateFromMutation({target:t,timeOffset:r,mutation:s}){let n=this.mediaMap.get(t),{type:i,playbackRate:o,currentTime:l,muted:u,volume:c,loop:a}=s;return{isPlaying:i===Xe.Play||i!==Xe.Pause&&(n?.isPlaying||t.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:l??n?.currentTimeAtLastInteraction??0,lastInteractionTimeOffset:r,playbackRate:o??n?.playbackRate??1,volume:c??n?.volume??1,muted:u??n?.muted??t.getAttribute("muted")===null,loop:a??n?.loop??t.getAttribute("loop")===null}}syncTargetWithState(t){let r=this.mediaMap.get(t);if(!r)return;let{muted:s,loop:n,volume:i,isPlaying:o}=r,l=this.service.state.matches("paused"),u=r.playbackRate*this.speedService.state.context.timer.speed;try{this.seekTo({time:this.getCurrentTime(),target:t,mediaState:r}),t.volume!==i&&(t.volume=i),t.muted=s,t.loop=n,t.playbackRate!==u&&(t.playbackRate=u),o&&!l?t.play():t.pause()}catch(c){this.warn(`Failed to replay media interactions: ${c.message||c}`)}}addMediaElements(t,r,s){if(!["AUDIO","VIDEO"].includes(t.nodeName))return;let n=t,i=s.getMeta(n);if(!i||!("attributes"in i))return;let o=this.service.state.matches("paused"),l=i.attributes,u=!1;l.rr_mediaState?u=l.rr_mediaState==="played":u=n.getAttribute("autoplay")!==null,u&&o&&n.pause();let c=1;typeof l.rr_mediaPlaybackRate=="number"&&(c=l.rr_mediaPlaybackRate);let a=!1;typeof l.rr_mediaMuted=="boolean"?a=l.rr_mediaMuted:a=n.getAttribute("muted")!==null;let p=!1;typeof l.rr_mediaLoop=="boolean"?p=l.rr_mediaLoop:p=n.getAttribute("loop")!==null;let d=1;typeof l.rr_mediaVolume=="number"&&(d=l.rr_mediaVolume);let h=0;typeof l.rr_mediaCurrentTime=="number"&&(h=l.rr_mediaCurrentTime),this.mediaMap.set(n,{isPlaying:u,currentTimeAtLastInteraction:h,lastInteractionTimeOffset:r,playbackRate:c,volume:d,muted:a,loop:p}),this.syncTargetWithState(n)}mediaMutation({target:t,timeOffset:r,mutation:s}){this.mediaMap.set(t,this.getMediaStateFromMutation({target:t,timeOffset:r,mutation:s})),this.syncTargetWithState(t)}isSupportedMediaElement(t){return["AUDIO","VIDEO"].includes(t.nodeName)}reset(){this.mediaMap.clear()}};function nr(e,t){if(e.nodeName!=="DIALOG"||e instanceof Ue)return;let r=e,s=r.open,n=s&&r.matches("dialog:modal"),i=r.getAttribute("rr_open_mode"),o=typeof t?.attributes.open=="string"||typeof r.getAttribute("open")=="string",l=i==="modal";if(!(s&&!(n&&i==="non-modal"||!n&&l))){if(!r.isConnected){console.warn("dialog is not attached to the dom",r);return}s&&r.close(),o&&(l?r.showModal():r.show())}}function ah(e,t){if(e.nodeName!=="DIALOG"||e instanceof Ue)return;let r=e;if(!r.isConnected){console.warn("dialog is not attached to the dom",r);return}t.attributes.open===null&&(r.removeAttribute("open"),r.removeAttribute("rr_open_mode"))}var lh=5*1e3,uh=Qd,ea="[replayer]",Qs={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function ta(e){return e.type==L.IncrementalSnapshot&&(e.data.source==D.TouchMove||e.data.source==D.MouseInteraction&&e.data.type==H.TouchStart)}var xr=class{constructor(t,r){if(O(this,"wrapper"),O(this,"iframe"),O(this,"UNSAFE_replayCanvas",!1),O(this,"service"),O(this,"speedService"),O(this,"config"),O(this,"usingVirtualDom",!1),O(this,"virtualDom",new yt),O(this,"mouse"),O(this,"mouseTail",null),O(this,"tailPositions",[]),O(this,"emitter",uh()),O(this,"nextUserInteractionEvent"),O(this,"legacy_missingNodeRetryMap",{}),O(this,"cache",Xi()),O(this,"imageMap",new Map),O(this,"canvasEventMap",new Map),O(this,"mirror",ia()),O(this,"styleMirror",new br),O(this,"mediaManager"),O(this,"firstFullSnapshot",null),O(this,"newDocumentQueue",[]),O(this,"mousePos",null),O(this,"touchActive",null),O(this,"lastMouseDownEvent",null),O(this,"lastHoveredRootNode"),O(this,"lastSelectionData",null),O(this,"constructedStyleMutations",[]),O(this,"adoptedStyleSheets",[]),O(this,"handleResize",l=>{this.iframe.style.display="inherit";for(let u of[this.mouseTail,this.iframe])u&&(u.setAttribute("width",String(l.width)),u.setAttribute("height",String(l.height)))}),O(this,"applyEventsSynchronously",l=>{for(let u of l){switch(u.type){case L.DomContentLoaded:case L.Load:continue;case L.FullSnapshot:case L.Meta:case L.Plugin:case L.IncrementalSnapshot:break}this.getCastFn(u,!0)()}}),O(this,"getCastFn",(l,u=!1)=>{let c;switch(l.type){case L.DomContentLoaded:case L.Load:break;case L.Annotation:c=()=>this.emitter.emit(q.Annotation,l);break;case L.Custom:c=()=>{this.emitter.emit(q.CustomEvent,l)};break;case L.Meta:c=()=>this.emitter.emit(q.Resize,{width:l.data.width,height:l.data.height});break;case L.FullSnapshot:c=()=>{var p;if(this.firstFullSnapshot){if(this.firstFullSnapshot===l){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(l,u),(p=this.iframe.contentWindow)==null||p.scrollTo(l.data.initialOffset)};break;case L.IncrementalSnapshot:c=()=>{if(this.applyIncremental(l,u),!u&&(l===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(let p of this.service.state.context.events)if(!(p.timestamp<=l.timestamp)&&this.isUserInteraction(p)){p.delay-l.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=p);break}if(this.nextUserInteractionEvent){let p=this.nextUserInteractionEvent.delay-l.delay,d={speed:Math.min(Math.round(p/lh),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:d}),this.emitter.emit(q.SkipStart,d)}}};break}return()=>{c&&c();for(let d of this.config.plugins||[])d.handler&&d.handler(l,u,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:l}});let p=this.service.state.context.events.length-1;if(!this.config.liveMode&&l===this.service.state.context.events[p]){let d=()=>{p<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(q.Finish))},h=50;l.type===L.IncrementalSnapshot&&l.data.source===D.MouseMove&&l.data.positions.length&&(h+=Math.max(0,-l.data.positions[0].timeOffset)),setTimeout(d,h)}this.emitter.emit(q.EventCast,l)}}),!r?.liveMode&&t.length<2)throw new Error("Replayer need at least 2 events.");let s={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:Qs,useVirtualDom:!0,logger:console};this.config=Object.assign({},s,r),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(q.Resize,this.handleResize),this.setupDom();for(let l of this.config.plugins||[])l.getMirror&&l.getMirror({nodeMirror:this.mirror});this.emitter.on(q.Flush,()=>{if(this.usingVirtualDom){let l={mirror:this.mirror,applyCanvas:(u,c,a)=>{Zo({event:u,mutation:c,target:a,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(u,c)=>{u.source===D.StyleSheetRule?this.applyStyleSheetRule(u,c):u.source===D.StyleDeclaration&&this.applyStyleDeclaration(u,c)},afterAppend:(u,c)=>{for(let a of this.config.plugins||[])a.onBuild&&a.onBuild(u,{id:c,replayer:this})}};if(this.iframe.contentDocument)try{gr(this.iframe.contentDocument,this.virtualDom,l,this.virtualDom.mirror)}catch(u){this.warn(u)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(let u in this.legacy_missingNodeRetryMap)try{let c=this.legacy_missingNodeRetryMap[u],a=yr(c.node,this.mirror,this.virtualDom.mirror);gr(a,c.node,l,this.virtualDom.mirror),c.node=a}catch(c){this.warn(c)}this.constructedStyleMutations.forEach(u=>{this.applyStyleSheetMutation(u)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(u=>{this.applyAdoptedStyleSheet(u)}),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){let[l,u]=this.lastMouseDownEvent;l.dispatchEvent(u)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(q.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()});let n=new Cn([],{speed:this.config.speed});this.service=Zd({events:t.map(l=>r&&r.unpackFn?r.unpackFn(l):l).sort((l,u)=>l.timestamp-u.timestamp),timer:n,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(l=>{this.emitter.emit(q.StateChange,{player:l})}),this.speedService=eh({normalSpeed:-1,timer:n}),this.speedService.start(),this.speedService.subscribe(l=>{this.emitter.emit(q.StateChange,{speed:l})}),this.mediaManager=new En({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});let i=this.service.state.context.events.find(l=>l.type===L.Meta),o=this.service.state.context.events.find(l=>l.type===L.FullSnapshot);if(i){let{width:l,height:u}=i.data;setTimeout(()=>{this.emitter.emit(q.Resize,{width:l,height:u})},0)}o&&setTimeout(()=>{var l;this.firstFullSnapshot||(this.firstFullSnapshot=o,this.rebuildFullSnapshot(o),(l=this.iframe.contentWindow)==null||l.scrollTo(o.data.initialOffset))},1),this.service.state.context.events.find(ta)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(t,r){return this.emitter.on(t,r),this}off(t,r){return this.emitter.off(t,r),this}setConfig(t){Object.keys(t).forEach(r=>{t[r],this.config[r]=t[r]}),this.config.skipInactive||this.backToNormal(),typeof t.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:t.speed}}),typeof t.mouseTail<"u"&&(t.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(){let t=this.service.state.context.events[0],r=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:t.timestamp,endTime:r.timestamp,totalTime:r.timestamp-t.timestamp}}getCurrentTime(){return this.config.liveMode&&this.timer.updateLiveTime(),this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){let{baselineTime:t,events:r}=this.service.state.context;return t-r[0].timestamp}getMirror(){return this.mirror}play(t=0){var r,s;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:t}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:t}})),(s=(r=this.iframe.contentDocument)==null?void 0:r.getElementsByTagName("html")[0])==null||s.classList.remove("rrweb-paused"),this.emitter.emit(q.Start)}pause(t){var r,s;t===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof t=="number"&&(this.play(t),this.service.send({type:"PAUSE"})),(s=(r=this.iframe.contentDocument)==null?void 0:r.getElementsByTagName("html")[0])==null||s.classList.add("rrweb-paused"),this.emitter.emit(q.Pause)}resume(t=0){this.warn("The \'resume\' was deprecated in 1.0. Please use \'play\' method which has the same interface."),this.play(t),this.emitter.emit(q.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(q.Destroy)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){let r=this.config.unpackFn?this.config.unpackFn(t):t;ta(r)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:r}}))}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=Xi()}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.config.UNSAFE_replayCanvas?(this.iframe=document.createElement("iframe"),this.iframe.setAttribute("sandbox","allow-same-origin allow-scripts"),this.wrapper.appendChild(this.iframe),this.UNSAFE_replayCanvas=!0):(this.iframe=sc({root:this.wrapper}),this.UNSAFE_replayCanvas=!1),this.iframe.style.display="none",this.disableInteract(),this.iframe.contentWindow&&this.iframe.contentDocument&&(Xd(this.iframe.contentWindow,this.iframe.contentDocument),ja(this.iframe.contentWindow))}rebuildFullSnapshot(t,r=!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={};let s=[],n=new Set,i=(u,c)=>{if(u.nodeName==="DIALOG"&&n.add(u),this.collectIframeAndAttachDocument(s,u),this.mediaManager.isSupportedMediaElement(u)){let{events:a}=this.service.state.context;this.mediaManager.addMediaElements(u,t.timestamp-a[0].timestamp,this.mirror)}for(let a of this.config.plugins||[])a.onBuild&&a.onBuild(u,{id:c,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),rc(t.data.node,{doc:this.iframe.contentDocument,afterAppend:i,cache:this.cache,mirror:this.mirror,UNSAFE_allowUnprotectedRebuild:this.UNSAFE_replayCanvas}),i(this.iframe.contentDocument,t.data.node.id);for(let{mutationInQueue:u,builtNode:c}of s)this.attachDocumentToIframe(u,c),this.newDocumentQueue=this.newDocumentQueue.filter(a=>a!==u);let{documentElement:o,head:l}=this.iframe.contentDocument;this.insertStyleRules(o,l),n.forEach(u=>nr(u)),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(q.FullsnapshotRebuilded,t),r||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,r){var s;let n=th(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&n.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),!!n.length)if(this.usingVirtualDom){let i=this.virtualDom.createElement("style");this.virtualDom.mirror.add(i,Aa(i,this.virtualDom.unserializedId)),t.insertBefore(i,r),i.rules.push({source:D.StyleSheetRule,adds:n.map((o,l)=>({rule:o,index:l}))})}else{let i=document.createElement("style");t.insertBefore(i,r);for(let o=0;o<n.length;o++)(s=i.sheet)==null||s.insertRule(n[o],o)}}attachDocumentToIframe(t,r){let s=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,n=[],i=new Set,o=(l,u)=>{l.nodeName==="DIALOG"&&i.add(l),this.collectIframeAndAttachDocument(n,l);let c=s.getMeta(l);if(c?.type===Ve.Element&&c?.tagName.toUpperCase()==="HTML"){let{documentElement:a,head:p}=r.contentDocument;this.insertStyleRules(a,p)}if(!this.usingVirtualDom)for(let a of this.config.plugins||[])a.onBuild&&a.onBuild(l,{id:u,replayer:this})};Pt(t.node,{doc:r.contentDocument,mirror:s,hackCss:!0,skipChild:!1,afterAppend:o,cache:this.cache}),o(r.contentDocument,t.node.id);for(let{mutationInQueue:l,builtNode:u}of n)this.attachDocumentToIframe(l,u),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==l);i.forEach(l=>nr(l))}collectIframeAndAttachDocument(t,r){if(_t(r,this.mirror)){let s=this.newDocumentQueue.find(n=>n.parentId===this.mirror.getId(r));s&&t.push({mutationInQueue:s,builtNode:r})}}waitForStylesheetLoad(){var t;let r=(t=this.iframe.contentDocument)==null?void 0:t.head;if(r){let s=new Set,n,i=this.service.state,o=()=>{i=this.service.state};this.emitter.on(q.Start,o),this.emitter.on(q.Pause,o);let l=()=>{this.emitter.off(q.Start,o),this.emitter.off(q.Pause,o)};r.querySelectorAll(\'link[rel="stylesheet"]\').forEach(u=>{u.sheet||(s.add(u),u.addEventListener("load",()=>{s.delete(u),s.size===0&&n!==-1&&(i.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(q.LoadStylesheetEnd),n&&clearTimeout(n),l())}))}),s.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(q.LoadStylesheetStart),n=setTimeout(()=>{i.matches("playing")&&this.play(this.getCurrentTime()),n=-1,l()},this.config.loadTimeout))}}async preloadAllImages(){let t=[];for(let r of this.service.state.context.events)r.type===L.IncrementalSnapshot&&r.data.source===D.CanvasMutation&&(t.push(this.deserializeAndPreloadCanvasEvents(r.data,r)),("commands"in r.data?r.data.commands:[r.data]).forEach(n=>{this.preloadImages(n,r)}));return Promise.all(t)}preloadImages(t,r){if(t.property==="drawImage"&&typeof t.args[0]=="string"&&!this.imageMap.has(r)){let s=document.createElement("canvas"),n=s.getContext("2d"),i=n?.createImageData(s.width,s.height);n?.putImageData(i,0,0)}}async deserializeAndPreloadCanvasEvents(t,r){if(!this.canvasEventMap.has(r)){let s={isUnchanged:!0};if("commands"in t){let n=await Promise.all(t.commands.map(async i=>{let o=await Promise.all(i.args.map(Ke(this.imageMap,null,s)));return{...i,args:o}}));s.isUnchanged===!1&&this.canvasEventMap.set(r,{...t,commands:n})}else{let n=await Promise.all(t.args.map(Ke(this.imageMap,null,s)));s.isUnchanged===!1&&this.canvasEventMap.set(r,{...t,args:n})}}}applyIncremental(t,r){var s,n,i;let{data:o}=t;switch(o.source){case D.Mutation:{try{this.applyMutation(o,r)}catch(l){this.warn(`Exception in mutation ${l.message||l}`,o)}break}case D.Drag:case D.TouchMove:case D.MouseMove:if(r){let l=o.positions[o.positions.length-1];this.mousePos={x:l.x,y:l.y,id:l.id,debugData:o}}else o.positions.forEach(l=>{let u={doAction:()=>{this.moveAndHover(l.x,l.y,l.id,r,o)},delay:l.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(u)}),this.timer.addAction({doAction(){},delay:t.delay-((s=o.positions[0])==null?void 0:s.timeOffset)});break;case D.MouseInteraction:{if(o.id===-1)break;let l=new Event(He(H[o.type])),u=this.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);this.emitter.emit(q.MouseInteraction,{type:o.type,target:u});let{triggerFocus:c}=this.config;switch(o.type){case H.Blur:"blur"in u&&u.blur();break;case H.Focus:c&&u.focus&&u.focus({preventScroll:!0});break;case H.Click:case H.TouchStart:case H.TouchEnd:case H.MouseDown:case H.MouseUp:r?(o.type===H.TouchStart?this.touchActive=!0:o.type===H.TouchEnd&&(this.touchActive=!1),o.type===H.MouseDown?this.lastMouseDownEvent=[u,l]:o.type===H.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:o.x||0,y:o.y||0,id:o.id,debugData:o}):(o.type===H.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(o.x||0,o.y||0,o.id,r,o),o.type===H.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):o.type===H.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):o.type===H.TouchEnd?this.mouse.classList.remove("touch-active"):u.dispatchEvent(l));break;case H.TouchCancel:r?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:u.dispatchEvent(l)}break}case D.Scroll:{if(o.id===-1)break;if(this.usingVirtualDom){let l=this.virtualDom.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);l.scrollData=o;break}this.applyScroll(o,r);break}case D.ViewportResize:this.emitter.emit(q.Resize,{width:o.width,height:o.height});break;case D.Input:{if(o.id===-1)break;if(this.usingVirtualDom){let l=this.virtualDom.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);l.inputData=o;break}this.applyInput(o);break}case D.MediaInteraction:{let l=this.usingVirtualDom?this.virtualDom.mirror.getNode(o.id):this.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);let u=l,{events:c}=this.service.state.context;this.mediaManager.mediaMutation({target:u,timeOffset:t.timestamp-c[0].timestamp,mutation:o});break}case D.StyleSheetRule:case D.StyleDeclaration:{this.usingVirtualDom?o.styleId?this.constructedStyleMutations.push(o):o.id&&((n=this.virtualDom.mirror.getNode(o.id))==null||n.rules.push(o)):this.applyStyleSheetMutation(o);break}case D.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){let l=this.virtualDom.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);l.canvasMutations.push({event:t,mutation:o})}else{let l=this.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);Zo({event:t,mutation:o,target:l,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case D.Font:{try{let l=new FontFace(o.family,o.buffer?new Uint8Array(JSON.parse(o.fontSource)):o.fontSource,o.descriptors);(i=this.iframe.contentDocument)==null||i.fonts.add(l)}catch(l){this.warn(l)}break}case D.Selection:{if(r){this.lastSelectionData=o;break}this.applySelection(o);break}case D.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(o):this.applyAdoptedStyleSheet(o);break}}}applyMutation(t,r){if(this.config.useVirtualDom&&!this.usingVirtualDom&&r&&(this.usingVirtualDom=!0,sd(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(let c in this.legacy_missingNodeRetryMap)try{let a=this.legacy_missingNodeRetryMap[c],p=Da(a.node,this.virtualDom,this.mirror);p&&(a.node=p)}catch(a){this.warn(a)}let s=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;t.removes=t.removes.filter(c=>s.getNode(c.id)?!0:(this.warnNodeNotFound(t,c.id),!1)),t.removes.forEach(c=>{var a;let p=s.getNode(c.id);if(!p)return;let d=s.getNode(c.parentId);if(!d)return this.warnNodeNotFound(t,c.parentId);if(c.isShadow&&tt(d)&&(d=d.shadowRoot),s.removeNodeFromMap(p),d)try{d.removeChild(p),this.usingVirtualDom&&p.nodeName==="#text"&&d.nodeName==="STYLE"&&((a=d.rules)==null?void 0:a.length)>0&&(d.rules=[])}catch(h){if(h instanceof DOMException)this.warn("parent could not remove child in mutation",d,p,t);else throw h}});let n={...this.legacy_missingNodeRetryMap},i=[],o=c=>{let a=null;return c.nextId&&(a=s.getNode(c.nextId)),c.nextId!==null&&c.nextId!==void 0&&c.nextId!==-1&&!a},l=c=>{var a,p;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let d=s.getNode(c.parentId);if(!d)return c.node.type===Ve.Document?this.newDocumentQueue.push(c):i.push(c);c.node.isShadow&&(tt(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let h=null,m=null;if(c.previousId&&(h=s.getNode(c.previousId)),c.nextId&&(m=s.getNode(c.nextId)),o(c))return i.push(c);if(c.node.rootId&&!s.getNode(c.node.rootId))return;let f=c.node.rootId?s.getNode(c.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(_t(d,s)){this.attachDocumentToIframe(c,d);return}let g=(y,C)=>{if(!this.usingVirtualDom){nr(y);for(let x of this.config.plugins||[])x.onBuild&&x.onBuild(y,{id:C,replayer:this})}},b=Pt(c.node,{doc:f,mirror:s,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:g});if(c.previousId===-1||c.nextId===-1){n[c.node.id]={node:b,mutation:c};return}let v=s.getMeta(d);if(v&&v.type===Ve.Element&&c.node.type===Ve.Text){let y=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);if(v.tagName==="textarea")for(let C of y)C.nodeType===d.TEXT_NODE&&d.removeChild(C);else if(v.tagName==="style"&&y.length===1)for(let C of y)C.nodeType===d.TEXT_NODE&&!s.hasNode(C)&&(b.textContent=C.textContent,d.removeChild(C))}else if(v?.type===Ve.Document){let y=d;c.node.type===Ve.DocumentType&&((a=y.childNodes[0])==null?void 0:a.nodeType)===Node.DOCUMENT_TYPE_NODE&&y.removeChild(y.childNodes[0]),b.nodeName==="HTML"&&y.documentElement&&y.removeChild(y.documentElement)}if(h&&h.nextSibling&&h.nextSibling.parentNode?d.insertBefore(b,h.nextSibling):m&&m.parentNode?d.contains(m)?d.insertBefore(b,m):d.insertBefore(b,null):d.appendChild(b),g(b,c.node.id),this.usingVirtualDom&&b.nodeName==="#text"&&d.nodeName==="STYLE"&&((p=d.rules)==null?void 0:p.length)>0&&(d.rules=[]),_t(b,this.mirror)){let y=this.mirror.getId(b),C=this.newDocumentQueue.find(x=>x.parentId===y);C&&(this.attachDocumentToIframe(C,b),this.newDocumentQueue=this.newDocumentQueue.filter(x=>x!==C))}(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(n,d,b,c)};t.adds.forEach(c=>{l(c)});let u=Date.now();for(;i.length;){let c=Cd(i);if(i.length=0,Date.now()-u>500){this.warn("Timeout in the loop, please check the resolve tree data:",c);break}for(let a of c)s.getNode(a.value.parentId)?za(a,d=>{l(d)}):this.debug("Drop resolve tree since there is no parent for the root node.",a)}Object.keys(n).length&&Object.assign(this.legacy_missingNodeRetryMap,n),Ed(t.texts).forEach(c=>{var a;let p=s.getNode(c.id);if(!p)return t.removes.find(h=>h.id===c.id)?void 0:this.warnNodeNotFound(t,c.id);let d=p.parentElement;if(c.value&&d&&d.tagName==="STYLE"?p.textContent=Or(c.value,this.cache):p.textContent=c.value,this.usingVirtualDom){let h=p.parentNode;((a=h?.rules)==null?void 0:a.length)>0&&(h.rules=[])}}),t.attributes.forEach(c=>{var a;let p=s.getNode(c.id);if(!p)return t.removes.find(d=>d.id===c.id)?void 0:this.warnNodeNotFound(t,c.id);for(let d in c.attributes)if(typeof d=="string"){let h=c.attributes[d];if(h===null)p.removeAttribute(d),d==="open"&&ah(p,c);else if(typeof h=="string")try{if(d==="_cssText"&&(p.nodeName==="LINK"||p.nodeName==="STYLE"))try{let m=s.getMeta(p),f=Pt({...m,attributes:{...m.attributes,...c.attributes}},{doc:p.ownerDocument,mirror:s,skipChild:!0,hackCss:!0,cache:this.cache});Object.assign(m.attributes,c.attributes);let g=p.nextSibling,b=p.parentNode;if(f&&b){b.removeChild(p),b.insertBefore(f,g),s.replace(c.id,f);break}}catch{}if(d==="value"&&p.nodeName==="TEXTAREA"){let m=p;m.childNodes.forEach(g=>m.removeChild(g));let f=(a=p.ownerDocument)==null?void 0:a.createTextNode(h);f&&m.appendChild(f)}else p.setAttribute(d,h);d==="rr_open_mode"&&p.nodeName==="DIALOG"&&nr(p,c)}catch(m){this.warn("An error occurred may due to the checkout feature.",m)}else if(d==="style"){let m=h,f=p;for(let g in m)if(m[g]===!1)f.style.removeProperty(g);else if(m[g]instanceof Array){let b=m[g];f.style.setProperty(g,b[0],b[1])}else{let b=m[g];f.style.setProperty(g,b)}}}})}applyScroll(t,r){var s,n;let i=this.mirror.getNode(t.id);if(!i)return this.debugNodeNotFound(t,t.id);let o=this.mirror.getMeta(i);if(i===this.iframe.contentDocument)(s=this.iframe.contentWindow)==null||s.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else if(o?.type===Ve.Document)(n=i.defaultView)==null||n.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else try{i.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"})}catch{}}applyInput(t){let r=this.mirror.getNode(t.id);if(!r)return this.debugNodeNotFound(t,t.id);try{r.checked=t.isChecked,r.value=t.text}catch{}}applySelection(t){try{let r=new Set,s=t.ranges.map(({start:n,startOffset:i,end:o,endOffset:l})=>{let u=this.mirror.getNode(n),c=this.mirror.getNode(o);if(!u||!c)return;let a=new Range;a.setStart(u,i),a.setEnd(c,l);let p=u.ownerDocument,d=p?.getSelection();return d&&r.add(d),{range:a,selection:d}});r.forEach(n=>n.removeAllRanges()),s.forEach(n=>{var i;return n&&((i=n.selection)==null?void 0:i.addRange(n.range))})}catch{}}applyStyleSheetMutation(t){var r;let s=null;t.styleId?s=this.styleMirror.getStyle(t.styleId):t.id&&(s=((r=this.mirror.getNode(t.id))==null?void 0:r.sheet)||null),s&&(t.source===D.StyleSheetRule?this.applyStyleSheetRule(t,s):t.source===D.StyleDeclaration&&this.applyStyleDeclaration(t,s))}applyStyleSheetRule(t,r){var s,n,i,o;if((s=t.adds)==null||s.forEach(({rule:l,index:u})=>{try{if(Array.isArray(u)){let{positions:c,index:a}=Fo(u),p=Tt(r.cssRules,c);p?.insertRule(l,a)}else{let c=u===void 0?void 0:Math.min(u,r.cssRules.length);r?.insertRule(l,c)}}catch{}}),(n=t.removes)==null||n.forEach(({index:l})=>{try{if(Array.isArray(l)){let{positions:u,index:c}=Fo(l),a=Tt(r.cssRules,u);a?.deleteRule(c||0)}else r?.deleteRule(l)}catch{}}),typeof t.replace=="string")try{(i=r.replace)==null||i.call(r,t.replace)}catch{}if(typeof t.replaceSync=="string")try{(o=r.replaceSync)==null||o.call(r,t.replaceSync)}catch{}}applyStyleDeclaration(t,r){if(t.set){let s=Tt(r.rules,t.index);s?.style&&s.style.setProperty(t.set.property,t.set.value,t.set.priority)}if(t.remove){let s=Tt(r.rules,t.index);s?.style&&s.style.removeProperty(t.remove.property)}}applyAdoptedStyleSheet(t){var r;let s=this.mirror.getNode(t.id);if(!s)return;(r=t.styles)==null||r.forEach(l=>{var u;let c=null,a=null;if(tt(s)?a=((u=s.ownerDocument)==null?void 0:u.defaultView)||null:s.nodeName==="#document"&&(a=s.defaultView),!!a)try{c=new a.CSSStyleSheet,this.styleMirror.add(c,l.styleId),this.applyStyleSheetRule({source:D.StyleSheetRule,adds:l.rules},c)}catch{}});let n=10,i=0,o=(l,u)=>{let c=u.map(a=>this.styleMirror.getStyle(a)).filter(a=>a!==null);tt(l)?l.shadowRoot.adoptedStyleSheets=c:l.nodeName==="#document"&&(l.adoptedStyleSheets=c),c.length!==u.length&&i<n&&(setTimeout(()=>o(l,u),0+100*i),i++)};o(s,t.styleIds)}legacy_resolveMissingNode(t,r,s,n){let{previousId:i,nextId:o}=n,l=i&&t[i],u=o&&t[o];if(l){let{node:c,mutation:a}=l;r.insertBefore(c,s),delete t[a.node.id],delete this.legacy_missingNodeRetryMap[a.node.id],(a.previousId||a.nextId)&&this.legacy_resolveMissingNode(t,r,c,a)}if(u){let{node:c,mutation:a}=u;r.insertBefore(c,s.nextSibling),delete t[a.node.id],delete this.legacy_missingNodeRetryMap[a.node.id],(a.previousId||a.nextId)&&this.legacy_resolveMissingNode(t,r,c,a)}}moveAndHover(t,r,s,n,i){let o=this.mirror.getNode(s);if(!o)return this.debugNodeNotFound(i,s);let l=qa(o,this.iframe),u=t*l.absoluteScale+l.x,c=r*l.absoluteScale+l.y;this.mouse.style.left=`${u}px`,this.mouse.style.top=`${c}px`,n||this.drawMouseTail({x:u,y:c}),this.hoverElements(o)}drawMouseTail(t){if(!this.mouseTail)return;let{lineCap:r,lineWidth:s,strokeStyle:n,duration:i}=this.config.mouseTail===!0?Qs:Object.assign({},Qs,this.config.mouseTail),o=()=>{if(!this.mouseTail)return;let l=this.mouseTail.getContext("2d");!l||!this.tailPositions.length||(l.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),l.beginPath(),l.lineWidth=s,l.lineCap=r,l.strokeStyle=n,l.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(u=>l.lineTo(u.x,u.y)),l.stroke())};this.tailPositions.push(t),o(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(l=>l!==t),o()},i/this.speedService.state.context.timer.speed)}hoverElements(t){var r;(r=this.lastHoveredRootNode||this.iframe.contentDocument)==null||r.querySelectorAll(".\\\\:hover").forEach(n=>{n.classList.remove(":hover")}),this.lastHoveredRootNode=t.getRootNode();let s=t;for(;s;)s.classList&&s.classList.add(":hover"),s=s.parentElement}isUserInteraction(t){return t.type!==L.IncrementalSnapshot?!1:t.data.source>D.Mutation&&t.data.source<=D.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(q.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(t,r){this.warn(`Node with id \'${r}\' not found. `,t)}warnCanvasMutationFailed(t,r){this.warn("Has error on canvas update",r,"canvas mutation:",t)}debugNodeNotFound(t,r){this.debug(`Node with id \'${r}\' not found. `,t)}warn(...t){this.config.showWarning&&this.config.logger.warn(ea,...t)}debug(...t){this.config.showDebug&&this.config.logger.log(ea,...t)}},{addCustomEvent:cp,addAnnotation:dp}=Ze,{freezePage:hp}=Ze,{takeFullSnapshot:pp}=Ze;function ch(e){let t=e.params.get("errors")==="1",r=S("label",{class:"switch"},S("input",{type:"checkbox",checked:t,onchange:()=>de("replays",{errors:t?null:"1"})}),"Only sessions with errors");return[re("Replays","Recorded sessions. Each one has a text transcript that agents can read.",r),le(async()=>{let s=await W.get("/api/replays",{project:ie().project,with_errors:t||void 0,limit:100});return s.enabled?s.replays.length===0?te(t?"No recorded sessions with errors.":\'No recordings yet. Set data-replay-sample-rate="0.1" on the script tag to record 10% of sessions.\'):he(["Started","Person","Length","Clicks","Errors","First page","Device"],s.replays.map(n=>[S("a",{href:fe(`replays/${n.session}`)},Pe(n.started)),S("a",{href:fe(`users/${encodeURIComponent(n.person)}`)},n.person.slice(0,16)),Et(n.durationSeconds),String(n.clicks),n.errors?S("span",{class:"badge bad"},String(n.errors)):"0",S("span",{class:"muted"},n.url.replace(/^https?:\\/\\//,"")),S("span",{class:"muted"},n.device)]),{numeric:[3,4]}):te("Session replay is not enabled on this deployment. Enable R2 in your Cloudflare account, then run glass upgrade.")})]}function dh(e){let t=ie().project,r=S("div",{class:"replay-stage"});return[re("Replay",`Session ${e}`,ye(`Using the Glass MCP tool summarise_replay, read session ${e} and tell me what went wrong.`,"Copy as agent prompt")),S("div",{class:"replay-layout"},G("Recording",le(async()=>{let s=await W.get(`/api/replays/${encodeURIComponent(e)}/events`,{project:t});if(s.events.length<2)return te("This recording has no playable events yet.");r.replaceChildren();let n=new xr(s.events,{root:r,skipInactive:!0,showWarning:!1}),i=n.getMetaData(),o=!1,l=S("button",{type:"button",class:"primary"},"Play");return l.addEventListener("click",()=>{o?n.pause():n.play(),o=!o,l.textContent=o?"Pause":"Play"}),[r,S("div",{class:"player-bar"},l,S("span",{class:"muted"},Et(i.totalTime/1e3)))]},"Loading recording"),{class:"player"}),G("Transcript",le(async()=>{let s=await W.get(`/api/replays/${encodeURIComponent(e)}/summary`,{project:t});return S("pre",{class:"transcript"},s.transcript)},"Reading the session")))]}function il(e){return e.rest[0]?dh(e.rest[0]):ch(e)}var hh=()=>`${location.origin}${Ht.base}`;function Pr(e){return S("div",{class:"code-block"},S("pre",{},S("code",{},e)),ye(e))}function ol(){let e=ie().project??"your-project",t=hh();return[re("Settings","Install Glass on a site, connect an agent, manage projects."),S("div",{class:"grid-2"},G("Install on a site",[S("p",{},"Add this to the <head> of every page. Pageviews, clicks, errors and web vitals are captured automatically."),Pr(`<script defer src="${t}/s.js" data-project="${e}"><\\/script>`),S("p",{},"Then track what matters:"),Pr(`glass.capture(\'signup_completed\', { plan: \'pro\' });\nglass.identify(user.id, { plan: user.plan });`)]),G("Connect an agent",[S("p",{},"In a project set up with glass init, agents already have the MCP server. Elsewhere, add it by URL with your key:"),Pr(`claude mcp add --transport http glass ${t}/mcp \\\\\n --header "Authorization: Bearer $GLASS_API_KEY"`),S("p",{},"Agent instructions for this deployment:"),Pr(`${t}/llms.txt`)])),le(async()=>{let[r,s]=await Promise.all([W.get("/health"),W.get("/api/projects")]),n=S("input",{type:"text",required:!0,placeholder:"acme-docs",pattern:"[a-z0-9][a-z0-9_-]*"}),i=S("div",{}),o=S("form",{class:"inline-form"},n,S("button",{type:"submit",class:"ghost"},"Add project"),i);return o.addEventListener("submit",async l=>{l.preventDefault();try{await W.post("/api/projects",{id:n.value}),Le(`Project ${n.value} added`),location.reload()}catch(u){J(i,Te(u))}}),S("div",{class:"grid-2"},G("Projects",[he(["Project","Created","Allowed origins"],s.projects.map(l=>[S("code",{},l.id),Pe(l.createdAt),l.allowedOrigins.join(", ")||S("span",{class:"muted"},"Any")])),o]),G("This deployment",S("dl",{class:"props"},S("dt",{},"Version"),S("dd",{},r.version),S("dt",{},"Event store"),S("dd",{},r.store==="lake"?`Iceberg lake (data appears after about ${Math.round(r.freshnessSeconds/60)} min)`:"D1 (real time)"),S("dt",{},"Session replay"),S("dd",{},r.replay?"Enabled":"Disabled (no R2 bucket)"),S("dt",{},"Signed in with"),S("dd",{},S("button",{type:"button",class:"ghost small",onclick:()=>{ee.key=null,location.reload()}},"Forget this key")))))})]}function Gn(e){let t=S("input",{type:"password",required:!0,autocomplete:"off",placeholder:"Paste your Glass API key","aria-label":"API key"}),r=S("div",{}),s=S("form",{class:"stack"},t,r,S("button",{type:"submit",class:"primary"},"Open dashboard"));return s.addEventListener("submit",async n=>{n.preventDefault(),ee.key=t.value.trim();try{await W.get("/api"),e()}catch(i){ee.key=null,J(r,Te(i))}}),S("main",{class:"key-screen"},S("h1",{},"Glass"),S("p",{},"Paste the API key created by glass init. Run ",S("code",{},"npx @glassanalytics/cli key")," in your project to print it."),s,S("p",{class:"muted small"},"The key stays in this browser. Use the read-only key to share the dashboard without letting people change flags."))}function al(){return Ae().params.getAll("f").map(e=>{let t=e.indexOf(":");return t>0?{property:e.slice(0,t),value:e.slice(t+1)}:null}).filter(e=>e!==null)}function ll(e,t){let r=Ae(),s=new URLSearchParams(r.params);return s.append("f",`${e}:${t}`),`#/${[r.page,...r.rest].join("/")}?${s}`}function ul(){return al().map(e=>({property:e.property,value:e.value}))}function cl(){let e=al();if(e.length===0)return null;let t=Ae();return S("div",{class:"chips","aria-label":"Active filters"},e.map(r=>S("button",{type:"button",class:"chip",title:"Remove filter",onclick:()=>{let s=new URLSearchParams(t.params),n=s.getAll("f").filter(i=>i!==`${r.property}:${r.value}`);s.delete("f");for(let i of n)s.append("f",i);de([t.page,...t.rest].join("/"),Object.fromEntries(s),!1)}},`${r.property} is ${r.value}`,S("span",{"aria-hidden":"true"}," \\xD7"))))}var ph={pages:"path",entry_pages:"path",exit_pages:"path",referrers:"referrer_host",utm_source:"utm_source",utm_medium:"utm_medium",utm_campaign:"utm_campaign",countries:"country",devices:"device",browsers:"browser",os:"os"};function fh(e){let t=[{label:"Visitors",value:ae(e.totals.visitors),now:e.totals.visitors,before:e.previous?.visitors},{label:"Pageviews",value:ae(e.totals.pageviews),now:e.totals.pageviews,before:e.previous?.pageviews},{label:"Sessions",value:ae(e.totals.sessions),now:e.totals.sessions,before:e.previous?.sessions},{label:"Bounce rate",value:pe(e.totals.bounceRate,0),now:e.totals.bounceRate,before:e.previous?.bounceRate,lowerIsBetter:!0},{label:"Session length",value:Et(e.totals.avgSessionSeconds),now:e.totals.avgSessionSeconds,before:e.previous?.avgSessionSeconds},{label:"Views per session",value:Xn(e.totals.viewsPerSession,1),now:e.totals.viewsPerSession,before:e.previous?.viewsPerSession}];return S("dl",{class:"kpis"},t.map(r=>{let s=Kn(r.now,r.before),n=s&&s.direction!=="flat"&&s.direction==="up"!=!!r.lowerIsBetter;return S("div",{class:"kpi"},S("dt",{},r.label),S("dd",{},r.value,s?S("span",{class:`delta ${s.direction==="flat"?"":n?"good":"bad"}`,title:"vs previous period"},s.text):null))}))}function Vt(e,t,r,s){let n=S("div",{}),i=r[0].key,o=()=>{let l=e.breakdowns[i]??[],u=ph[i];J(n,r.length>1?Gt(r.map(c=>({value:c.key,label:c.label})),i,c=>{i=c,o()}):null,l.length?ni(l.map(c=>({label:c.value,value:i==="errors"?c.count:c.visitors,secondary:i==="errors"?c.visitors:c.count,href:u&&c.value!=="(none)"&&c.value!=="Direct / None"?ll(u,c.value):void 0})),s):te("Nothing here for this period."))};return o(),G(t,n,{sql:[e.sql[e.sql.length-2]]})}function mh(e){let t={LCP:[2500,4e3,s=>`${(s/1e3).toFixed(2)}s`],INP:[200,500,s=>`${Math.round(s)}ms`],CLS:[.1,.25,s=>s.toFixed(2)],FCP:[1800,3e3,s=>`${(s/1e3).toFixed(2)}s`],TTFB:[800,1800,s=>`${Math.round(s)}ms`]},r=Object.entries(e.vitals);return G("Web vitals (p75)",r.length?S("dl",{class:"vitals"},r.map(([s,n])=>{let[i,o,l]=t[s]??[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,c=>String(c)],u=n.p75<=i?"good":n.p75<=o?"ok":"poor";return S("div",{class:`vital ${u}`},S("dt",{},s),S("dd",{},l(n.p75)),S("span",{class:"muted small"},`${ae(n.samples)} ${n.samples===1?"sample":"samples"}`))})):te("No web vitals yet. They are sent when a visitor leaves a page."),{sql:[e.sql[e.sql.length-1]]})}function dl(){let e=ie();return[re("Web","Visitors, pages and sources. Click any row to filter."),cl()??S("span",{}),le(async()=>{let t=await W.post("/api/query",{kind:"web",...e,filters:ul()});return t.totals.pageviews===0&&!t.previous?.pageviews?te("No pageviews yet. Add the script tag to your site, then visit a page.",S("a",{class:"button",href:"#/settings"},"Show the install snippet")):[fh(t),G("Visitors and pageviews",Jt(t.timeseries.buckets,[{label:"Visitors",values:t.timeseries.visitors},{label:"Pageviews",values:t.timeseries.pageviews}],t.interval),{sql:[t.sql[0],t.sql[t.previous?2:1]],class:"wide"}),S("div",{class:"grid-2"},Vt(t,"Pages",[{key:"pages",label:"Top"},{key:"entry_pages",label:"Entry"},{key:"exit_pages",label:"Exit"}],["Page","Visitors","Views"]),Vt(t,"Sources",[{key:"referrers",label:"Referrers"},{key:"utm_source",label:"Source"},{key:"utm_medium",label:"Medium"},{key:"utm_campaign",label:"Campaign"}],["Source","Visitors","Visits"]),Vt(t,"Locations",[{key:"countries",label:"Countries"}],["Country","Visitors","Views"]),Vt(t,"Devices",[{key:"devices",label:"Device"},{key:"browsers",label:"Browser"},{key:"os",label:"OS"}],["Device","Visitors","Views"]),Vt(t,"Errors",[{key:"errors",label:"Errors"}],["Message","Times","Visitors"]),mh(t))]})]}var Yn={web:{label:"Web",render:dl},insights:{label:"Insights",render:ui},users:{label:"People",render:di},replays:{label:"Replays",render:il},flags:{label:"Flags",render:si},experiments:{label:"Experiments",render:ti},events:{label:"Events",render:Zn},sql:{label:"SQL",render:ei},settings:{label:"Settings",render:ol}},hl=[["today","Today"],["-24h","Last 24 hours"],["-7d","Last 7 days"],["-30d","Last 30 days"],["-90d","Last 90 days"],["-12mo","Last 12 months"]],gh={m:["minute","minutes"],h:["hour","hours"],d:["day","days"],w:["week","weeks"],mo:["month","months"],y:["year","years"]};function yh(e){let t=/^-(\\d+)(mo|m|h|d|w|y)$/.exec(e);if(!t)return`Since ${e}`;let r=Number(t[1]),[s,n]=gh[t[2]];return r===1?`Last ${s}`:`Last ${r} ${n}`}var Jn=document.getElementById("app"),it=[];function bh(e){let t=e.params.get("project")??ee.project??it[0]??"",r=S("select",{"aria-label":"Project"},it.map(o=>S("option",{value:o,selected:o===t},o)));r.addEventListener("change",()=>{ee.project=r.value,de(e.page,{project:r.value})});let s=e.params.get("from")??"-30d",n=S("select",{"aria-label":"Date range"},hl.map(([o,l])=>S("option",{value:o,selected:o===s},l)));hl.some(([o])=>o===s)||n.appendChild(S("option",{value:s,selected:!0},yh(s))),n.addEventListener("change",()=>de([e.page,...e.rest].join("/"),{from:n.value,to:null}));let i=S("input",{type:"checkbox",checked:ee.showSql});return i.addEventListener("change",()=>{ee.showSql=i.checked}),S("div",{class:"topbar"},it.length>1?r:S("span",{class:"project-name"},t),n,S("label",{class:"switch sql-switch",title:"Show the SQL behind every panel (press s)"},i,"Show SQL"))}function vh(e){return S("nav",{class:"sidebar","aria-label":"Sections"},S("a",{class:"brand",href:"#/web"},S("span",{class:"mark","aria-hidden":"true"}),"Glass"),S("ul",{},Object.entries(Yn).map(([t,r])=>S("li",{},S("a",{href:`#/${t}`,class:t===e.page?"active":"","aria-current":t===e.page?"page":null},r.label)))))}function pl(){let e=Ae(),t=Yn[e.page]??Yn.web,r=S("main",{class:"content",id:"content"});J(Jn,S("div",{class:"shell"},vh(e),S("div",{class:"main"},bh(e),r))),J(r,t.render(e)),document.title=`Glass: ${t.label}`}async function Qn(){if(ee.showSql=ee.showSql,!ee.key){J(Jn,Gn(()=>{Qn()}));return}try{it=(await W.get("/api/projects")).projects.map(t=>t.id)}catch{if(!ee.key)return}if(!Ae().params.get("project")&&it[0]){let e=ee.project&&it.includes(ee.project)?ee.project:it[0];de(Ae().page,{project:e});return}pl()}window.addEventListener("hashchange",()=>ee.key?pl():void 0);window.addEventListener("glass:unauthorized",()=>{ee.key=null,J(Jn,Gn(()=>{Qn()}))});window.addEventListener("keydown",e=>{let t=e.target;if(e.key==="s"&&!e.metaKey&&!e.ctrlKey&&!["INPUT","TEXTAREA","SELECT"].includes(t.tagName)){ee.showSql=!ee.showSql;let r=document.querySelector(".sql-switch input");r&&(r.checked=ee.showSql)}});Qn();\n', dashboardCss: ':root{--field: #f6f8f7;--surface: #ffffff;--ink: #1e2925;--muted: #5f6f69;--hairline: #d9e3df;--pane: #eaf3f0;--pane-ink: #24453c;--glass-green: #2e7d6b;--glass-green-soft: #cfe7df;--glass-cobalt: #3159c4;--glass-amber: #b8791d;--glass-ruby: #b03a48;--glass-teal: #2b8a99;--smoke: #7b8a84;--good: #2e7d6b;--bad: #b03a48;--warn: #b8791d;--radius: 10px;--sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;--mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;color-scheme:light}@media(prefers-color-scheme:dark){:root{--field: #121917;--surface: #18211e;--ink: #e4ece9;--muted: #93a39d;--hairline: #2a3632;--pane: #1d2b27;--pane-ink: #b9dacf;--glass-green: #5fb59f;--glass-green-soft: #24453c;--glass-cobalt: #7d9bf0;--glass-amber: #e0a54f;--glass-ruby: #e07884;--glass-teal: #5cc0cf;--smoke: #93a39d;--good: #5fb59f;--bad: #e07884;--warn: #e0a54f;color-scheme:dark}}*{box-sizing:border-box}html,body{margin:0;background:var(--field);color:var(--ink);font:15px/1.5 var(--sans);-webkit-font-smoothing:antialiased}a{color:var(--glass-green);text-decoration-thickness:1px;text-underline-offset:2px}code,pre{font-family:var(--mono);font-size:.88em}:focus-visible{outline:2px solid var(--glass-cobalt);outline-offset:2px;border-radius:4px}.muted{color:var(--muted)}.small{font-size:.85em}.num{text-align:right;font-variant-numeric:tabular-nums}.shell{display:grid;grid-template-columns:208px minmax(0,1fr);min-height:100vh}.sidebar{border-right:1px solid var(--hairline);padding:20px 12px;position:sticky;top:0;height:100vh}.brand{display:flex;align-items:center;gap:10px;font-weight:700;font-size:18px;letter-spacing:-.01em;color:var(--ink);text-decoration:none;padding:0 10px 18px}.mark{width:22px;height:22px;border-radius:5px;background:linear-gradient(135deg,var(--surface) 0 58%,var(--glass-green-soft) 58% 78%,var(--glass-green) 78%);border:1.5px solid var(--glass-green)}.sidebar ul{list-style:none;margin:0;padding:0}.sidebar li a{display:block;padding:7px 10px;border-radius:7px;color:var(--muted);text-decoration:none;font-weight:500}.sidebar li a:hover{color:var(--ink);background:var(--surface)}.sidebar li a.active{color:var(--ink);background:var(--surface);box-shadow:inset 3px 0 0 var(--glass-green)}.main{min-width:0}.topbar{display:flex;align-items:center;gap:12px;padding:14px 32px;border-bottom:1px solid var(--hairline);background:var(--field);position:sticky;top:0;z-index:5}.project-name{font-weight:600;margin-right:auto}.topbar select:first-child{margin-right:auto}.sql-switch{margin-left:4px}.content{padding:28px 32px 64px;max-width:1240px}.page-head{display:flex;justify-content:space-between;align-items:flex-start;gap:24px;margin-bottom:20px}.page-head h1{margin:0;font-size:28px;line-height:1.15;letter-spacing:-.02em;font-weight:700;overflow-wrap:anywhere}.page-head p{margin:6px 0 0;max-width:70ch}.page-actions{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 16px}.page-head .page-actions{margin:0}.panel{background:var(--surface);border:1px solid var(--hairline);border-radius:var(--radius);margin-bottom:16px;overflow:hidden}.panel-head{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px 18px 0}.panel-head h2{margin:0;font-size:15px;font-weight:650}.panel-actions{display:flex;gap:6px;align-items:center}.panel-body{padding:12px 18px 16px}.sql-pane{display:none;background:var(--pane);border-top:1px solid var(--hairline);padding:10px 18px 14px;color:var(--pane-ink)}.show-sql .sql-pane{display:block}.sql-pane-head{display:flex;justify-content:space-between;align-items:center;font-size:13px;font-weight:600;margin-bottom:6px}pre.sql{margin:0 0 8px;white-space:pre-wrap;word-break:break-word;max-height:260px;overflow:auto;font-size:12.5px;line-height:1.5}.grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.grid-2>.panel{margin-bottom:0}.grid-2+.panel,.grid-2+.grid-2{margin-top:16px}.kpis{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));margin:0 0 16px;background:var(--surface);border:1px solid var(--hairline);border-radius:var(--radius)}.kpi{padding:14px 18px;border-left:1px solid var(--hairline)}.kpi:first-child{border-left:0}.kpi dt{color:var(--muted);font-size:13px}.kpi dd{margin:2px 0 0;font-size:24px;font-weight:700;letter-spacing:-.02em;font-variant-numeric:tabular-nums;display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}.delta{font-size:13px;font-weight:600;letter-spacing:0;color:var(--muted)}.delta.good{color:var(--good)}.delta.bad{color:var(--bad)}.chart-wrap{position:relative}svg.chart{width:100%;height:auto;display:block;overflow:visible}.chart .grid{stroke:var(--hairline);stroke-width:1}.chart .axis{fill:var(--muted);font-size:11px;font-family:var(--sans)}.chart .line{fill:none;stroke-width:2;stroke-linejoin:round;stroke-linecap:round}.chart .area{opacity:.1}.chart .cursor{stroke:var(--muted);stroke-dasharray:3 3}.readout{position:absolute;top:0;transform:translate(-50%);background:var(--surface);border:1px solid var(--hairline);border-radius:8px;padding:6px 10px;font-size:12.5px;display:grid;gap:2px;pointer-events:none;white-space:nowrap;box-shadow:0 6px 20px #1e292514}.readout[hidden]{display:none}.legend{display:flex;gap:16px;list-style:none;padding:0;margin:8px 0 0;font-size:13px;color:var(--muted)}.swatch{display:inline-block;width:10px;height:10px;border-radius:2px;margin-right:6px;vertical-align:-1px}.bar-list{font-size:14px}.bar-head,.bar-row{display:grid;grid-template-columns:minmax(0,1fr) 72px 64px;gap:8px;align-items:center}.bar-head{color:var(--muted);font-size:12.5px;padding:0 8px 6px}.bar-row{position:relative;padding:5px 8px;border-radius:6px}.bar-fill{position:absolute;inset:2px auto 2px 0;background:var(--glass-green-soft);border-radius:5px;z-index:0}.bar-row>:not(.bar-fill){position:relative;z-index:1}.bar-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink);text-decoration:none}a.bar-label:hover{text-decoration:underline}.funnel{list-style:none;margin:0;padding:0;display:grid;gap:14px}.funnel-label{display:flex;justify-content:space-between;gap:12px;margin-bottom:4px}.step-name{font-weight:600}.funnel-track{background:var(--field);border-radius:6px;height:26px;overflow:hidden}.funnel-bar{height:100%;background:var(--glass-green);border-radius:6px;min-width:2px}.funnel-drop{font-size:13px;margin-top:4px}table.retention td.heat{background:color-mix(in srgb,var(--glass-green) calc(var(--heat) * .85%),transparent)}table.retention tr.average td{font-weight:600}.vitals{display:grid;grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:12px;margin:0}.vital{border:1px solid var(--hairline);border-radius:8px;padding:10px 12px}.vital dt{font-weight:600}.vital dd{margin:2px 0;font-size:20px;font-weight:700;font-variant-numeric:tabular-nums}.vital.good dd{color:var(--good)}.vital.ok dd{color:var(--warn)}.vital.poor dd{color:var(--bad)}.table-wrap{overflow-x:auto}table{width:100%;border-collapse:collapse;font-size:14px}th{text-align:left;font-weight:600;color:var(--muted);font-size:12.5px;padding:6px 10px;border-bottom:1px solid var(--hairline)}td{padding:8px 10px;border-bottom:1px solid var(--hairline);vertical-align:top}tr:last-child td{border-bottom:0}td input{width:100%}button,.button{font:inherit;font-weight:600;font-size:14px;border-radius:8px;padding:7px 14px;border:1px solid var(--hairline);background:var(--surface);color:var(--ink);cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;gap:6px}button:hover,.button:hover{border-color:var(--muted)}.primary{background:var(--glass-green);border-color:var(--glass-green);color:#fff}.primary:hover{filter:brightness(1.08);border-color:var(--glass-green)}.ghost{background:transparent}button.small{padding:3px 9px;font-size:12.5px}input[type=text],input[type=search],input[type=password],select,textarea{font:inherit;color:var(--ink);background:var(--surface);border:1px solid var(--hairline);border-radius:8px;padding:7px 10px;min-width:0}textarea{width:100%;font-family:var(--mono);font-size:13px}.sql-editor{min-height:180px}.field{display:grid;gap:4px;font-size:13px;font-weight:600;color:var(--muted)}.field input,.field select,.field textarea{font-weight:400;font-size:15px}.switch{display:inline-flex;align-items:center;gap:8px;font-size:14px;font-weight:500;cursor:pointer;white-space:nowrap}.switch input{accent-color:var(--glass-green);width:16px;height:16px}.range{display:flex;gap:12px;align-items:center}.range input{flex:1;accent-color:var(--glass-green)}.stack{display:grid;gap:14px;max-width:560px}.form-row{display:flex;flex-wrap:wrap;gap:12px 16px;align-items:flex-end}.series-row{display:flex;gap:12px;align-items:flex-end;flex-wrap:wrap;width:100%}.steps-editor{width:100%;margin:0;padding-left:22px;display:grid;gap:8px}.steps-editor li input{width:min(360px,70%);margin-right:8px}.builder{background:var(--surface);border:1px solid var(--hairline);border-radius:var(--radius);padding:16px 18px;margin:12px 0 16px}.form-actions{display:flex;gap:12px;align-items:center;margin-top:14px}.inline-form{display:flex;gap:8px;margin-top:12px;flex-wrap:wrap}.search{display:flex;gap:8px;margin-bottom:16px;max-width:520px}.search input{flex:1}.tabs{display:inline-flex;gap:2px;background:var(--field);border:1px solid var(--hairline);border-radius:9px;padding:2px;margin-bottom:10px}.tab{border:0;background:transparent;padding:4px 11px;font-size:13px;color:var(--muted);border-radius:7px}.tab.active{background:var(--surface);color:var(--ink);box-shadow:0 0 0 1px var(--hairline)}.chips{display:flex;gap:8px;flex-wrap:wrap;margin:-6px 0 16px}.chip{font-size:13px;font-weight:500;padding:3px 10px;border-radius:999px;background:var(--glass-green-soft);border-color:transparent}.badge{display:inline-block;font-size:12px;font-weight:600;padding:1px 8px;border-radius:999px;background:var(--field);border:1px solid var(--hairline);margin-left:6px}.badge:first-child{margin-left:0}.badge.good{background:var(--glass-green-soft);border-color:transparent}.badge.bad{background:color-mix(in srgb,var(--glass-ruby) 15%,transparent);color:var(--bad);border-color:transparent}.good{color:var(--good)}.state{padding:18px;border-radius:var(--radius)}.state.loading{color:var(--muted)}.state.empty{border:1px dashed var(--hairline);color:var(--muted);text-align:center}.state.empty p{margin:0 0 10px}.state.error{background:color-mix(in srgb,var(--glass-ruby) 10%,transparent);color:var(--bad)}.state.error p{margin:0}.state .hint{margin-top:6px;color:var(--ink)}.notice{background:color-mix(in srgb,var(--glass-amber) 12%,transparent);padding:8px 12px;border-radius:8px}.summary{margin:0 0 14px;font-size:15px}.toast{position:fixed;bottom:24px;right:24px;background:var(--ink);color:var(--field);padding:10px 16px;border-radius:8px;font-weight:600;z-index:50}.toast.error{background:var(--bad);color:#fff}dl.props{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:6px 16px;margin:0}dl.props dt{color:var(--muted)}dl.props dd{margin:0;overflow-wrap:anywhere}ul.plain{list-style:none;padding:0;margin:0;display:grid;gap:6px}.code-block{position:relative;background:var(--pane);color:var(--pane-ink);border-radius:8px;padding:10px 12px;margin:8px 0 14px}.code-block pre{margin:0;white-space:pre-wrap;word-break:break-all;padding-right:64px}.code-block button{position:absolute;top:8px;right:8px}.replay-layout{display:grid;grid-template-columns:minmax(0,3fr) minmax(280px,2fr);gap:16px}.replay-stage{background:var(--field);border-radius:8px;overflow:auto;min-height:320px;max-height:560px}.player-bar{display:flex;gap:12px;align-items:center;margin-top:10px}pre.transcript{margin:0;white-space:pre-wrap;font-size:13px;line-height:1.6;max-height:600px;overflow:auto}.key-screen{max-width:420px;margin:14vh auto;padding:0 20px}.key-screen h1{font-size:32px;letter-spacing:-.02em;margin:0 0 8px}@media(max-width:980px){.kpis{grid-template-columns:repeat(3,minmax(0,1fr))}.kpi:nth-child(4){border-left:0}.kpi:nth-child(n+4){border-top:1px solid var(--hairline)}.grid-2,.replay-layout{grid-template-columns:minmax(0,1fr)}}@media(max-width:720px){.shell{grid-template-columns:minmax(0,1fr)}.sidebar{position:static;height:auto;border-right:0;border-bottom:1px solid var(--hairline);padding:12px}.sidebar ul{display:flex;flex-wrap:wrap;gap:2px}.brand{padding-bottom:10px}.topbar,.content{padding-left:16px;padding-right:16px}.topbar{flex-wrap:wrap}.kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.kpi:nth-child(odd){border-left:0}.kpi:nth-child(n+3){border-top:1px solid var(--hairline)}.page-head{flex-direction:column}}@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}.replayer-wrapper{position:relative}.replayer-mouse{position:absolute;width:20px;height:20px;transition:left .05s linear,top .05s linear;background-size:contain;background-position:center center;background-repeat:no-repeat;background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzMwMHB4JyB3aWR0aD0nMzAwcHgnICBmaWxsPSIjMDAwMDAwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGRhdGEtbmFtZT0iTGF5ZXIgMSIgdmlld0JveD0iMCAwIDUwIDUwIiB4PSIwcHgiIHk9IjBweCI+PHRpdGxlPkRlc2lnbl90bnA8L3RpdGxlPjxwYXRoIGQ9Ik00OC43MSw0Mi45MUwzNC4wOCwyOC4yOSw0NC4zMywxOEExLDEsMCwwLDAsNDQsMTYuMzlMMi4zNSwxLjA2QTEsMSwwLDAsMCwxLjA2LDIuMzVMMTYuMzksNDRhMSwxLDAsMCwwLDEuNjUuMzZMMjguMjksMzQuMDgsNDIuOTEsNDguNzFhMSwxLDAsMCwwLDEuNDEsMGw0LjM4LTQuMzhBMSwxLDAsMCwwLDQ4LjcxLDQyLjkxWm0tNS4wOSwzLjY3TDI5LDMyYTEsMSwwLDAsMC0xLjQxLDBsLTkuODUsOS44NUwzLjY5LDMuNjlsMzguMTIsMTRMMzIsMjcuNThBMSwxLDAsMCwwLDMyLDI5TDQ2LjU5LDQzLjYyWiI+PC9wYXRoPjwvc3ZnPg==);border-color:transparent}.replayer-mouse:after{content:"";display:inline-block;width:20px;height:20px;background:#4950f6;border-radius:100%;transform:translate(-50%,-50%);opacity:.3}.replayer-mouse.active:after{animation:click .2s ease-in-out 1}.replayer-mouse.touch-device{background-image:none;width:70px;height:70px;border-width:4px;border-style:solid;border-radius:100%;margin-left:-37px;margin-top:-37px;border-color:#4950f600;transition:left 0s linear,top 0s linear,border-color .2s ease-in-out}.replayer-mouse.touch-device.touch-active{border-color:#4950f6;transition:left .25s linear,top .25s linear,border-color .2s ease-in-out}.replayer-mouse.touch-device:after{opacity:0}.replayer-mouse.touch-device.active:after{animation:touch-click .2s ease-in-out 1}.replayer-mouse-tail{position:absolute;pointer-events:none}@keyframes click{0%{opacity:.3;width:20px;height:20px}50%{opacity:.5;width:10px;height:10px}}@keyframes touch-click{0%{opacity:0;width:20px;height:20px}50%{opacity:.5;width:10px;height:10px}}\n' };
8
+ var define_GLASS_ASSETS_default = { sdk: '"use strict";(()=>{var L=Object.defineProperty;var M=(i,e,t)=>e in i?L(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var a=(i,e,t)=>M(i,typeof e!="symbol"?e+"":e,t);function _(i){let e=new Uint8Array(i);return crypto.getRandomValues(e),e}function T(i){let e="";for(let t of i)e+=t.toString(16).padStart(2,"0");return e}function p(i=Date.now()){let e=_(16),t=i;for(let n=5;n>=0;n--)e[n]=t&255,t=Math.floor(t/256);e[6]=e[6]&15|112,e[8]=e[8]&63|128;let s=T(e);return`${s.slice(0,8)}-${s.slice(8,12)}-${s.slice(12,16)}-${s.slice(16,20)}-${s.slice(20)}`}var b="0.2.1";var A=\'a, button, [role="button"], input[type="submit"], input[type="button"], [data-glass-event]\';function R(i){let e=location.href,t=()=>{location.href!==e&&(i.pageleave(),e=location.href,i.pageview())},s=history.pushState,n=history.replaceState;return history.pushState=function(...r){s.apply(this,r),queueMicrotask(t)},history.replaceState=function(...r){n.apply(this,r),queueMicrotask(t)},addEventListener("popstate",t),i.pageview(),()=>{history.pushState=s,history.replaceState=n,removeEventListener("popstate",t)}}function I(i){return i instanceof HTMLInputElement?i.value&&i.type!=="password"?i.value.slice(0,60):"":(i.textContent??"").replace(/\\s+/g," ").trim().slice(0,60)}function E(i){let e=t=>{let s=t.target instanceof Element?t.target.closest(A):null;if(!s||s.closest("[data-glass-no-capture]"))return;let n=s.getAttribute("data-glass-event");if(n){let o={};for(let l of Array.from(s.attributes))l.name.startsWith("data-glass-prop-")&&(o[l.name.slice(16).replace(/-/g,"_")]=l.value);i.capture(n,o);return}let r={tag:s.tagName.toLowerCase(),text:I(s)};s.id&&(r.id=s.id),s instanceof HTMLAnchorElement&&s.href&&(r.href=s.href.split("?")[0],r.outbound=s.host!==location.host),i.capture("$click",r)};return addEventListener("click",e,{capture:!0}),()=>removeEventListener("click",e,{capture:!0})}function k(i,e){let t=0,s=new Set,n=(l,c,v,m={})=>{let S=`${l}:${c}`;t>=10||s.has(S)||(s.add(S),t++,i.capture("$exception",{type:l,message:c.slice(0,500),stack:v?.slice(0,2e3),...m}),e())},r=l=>{let c=l.error instanceof Error?l.error:null;n(c?.name??"Error",c?.message??l.message??"Unknown error",c?.stack,{source:l.filename,line:l.lineno,column:l.colno})},o=l=>{let c=l.reason;c instanceof Error?n(c.name,c.message,c.stack,{unhandled_rejection:!0}):n("UnhandledRejection",String(c),void 0,{unhandled_rejection:!0})};return addEventListener("error",r),addEventListener("unhandledrejection",o),()=>{removeEventListener("error",r),removeEventListener("unhandledrejection",o)}}var $=30*6e4,h=class{constructor(e,t){a(this,"memory",new Map);a(this,"project");a(this,"persistence");this.project=e,this.persistence=t}setPersistence(e){e==="cookieless"&&this.clear(),this.persistence=e}get cookieless(){return this.persistence==="cookieless"}key(e){return`glass:${this.project}:${e}`}get(e){if(!this.cookieless)try{return localStorage.getItem(this.key(e))}catch{}return this.memory.get(e)??null}set(e,t){if(t===null?this.memory.delete(e):this.memory.set(e,t),!this.cookieless)try{t===null?localStorage.removeItem(this.key(e)):localStorage.setItem(this.key(e),t)}catch{}}clear(){for(let e of["id","user","session","flags"])this.set(e,null);this.memory.clear()}distinctId(){if(this.cookieless)return null;let e=this.get("id");return e||(e=p(),this.set("id",e)),e}userId(){return this.get("user")}setUserId(e){this.set("user",e)}session(e=!0){let t=Date.now(),s=null;try{s=JSON.parse(this.get("session")??"null")}catch{s=null}let n=!s||t-s.last>$;return(!s||n)&&(s={id:p(t),last:t}),e&&(s.last=t),this.set("session",JSON.stringify(s)),{...s,isNew:n}}setReplayDecision(e){let t=this.session(!1);this.set("session",JSON.stringify({id:t.id,last:t.last,replay:e}))}};var d=class{constructor(e,t,s,n){a(this,"queue",[]);a(this,"timer",null);a(this,"endpoint");a(this,"project");a(this,"lib");a(this,"intervalMs");this.endpoint=e,this.project=t,this.lib=s,this.intervalMs=n}push(e){this.queue.push(e),this.queue.length>500&&this.queue.splice(0,this.queue.length-500),this.queue.length>=20?this.flush():this.schedule()}schedule(){this.timer||(this.timer=setTimeout(()=>{this.timer=null,this.flush()},this.intervalMs))}body(e){let t={project:this.project,sent_at:Date.now(),lib:this.lib,events:e};return JSON.stringify(t)}async flush(){for(this.timer&&(clearTimeout(this.timer),this.timer=null);this.queue.length>0;){let e=this.queue.splice(0,20);try{let t=await fetch(this.endpoint,{method:"POST",body:this.body(e),headers:{"Content-Type":"text/plain"},keepalive:!0});if(t.status>=500)throw new Error(`HTTP ${t.status}`)}catch{this.queue.unshift(...e),this.schedule();return}}}beacon(){if(this.queue.length===0)return;let e=this.queue.splice(0,this.queue.length),t=this.body(e);typeof navigator<"u"&&typeof navigator.sendBeacon=="function"&&navigator.sendBeacon(this.endpoint,new Blob([t],{type:"text/plain"}))||fetch(this.endpoint,{method:"POST",body:t,keepalive:!0,headers:{"Content-Type":"text/plain"}}).catch(()=>{})}};function P(i){let e={},t=[],s=(r,o,l={})=>{try{let c=new PerformanceObserver(v=>{for(let m of v.getEntries())o(m)});c.observe({type:r,buffered:!0,...l}),t.push(c)}catch{}};s("largest-contentful-paint",r=>{e.LCP=r.startTime}),s("layout-shift",r=>{let o=r;o.hadRecentInput||(e.CLS=(e.CLS??0)+o.value)}),s("event",r=>{let o=r;o.interactionId&&(e.INP=Math.max(e.INP??0,o.duration))},{durationThreshold:16}),s("paint",r=>{r.name==="first-contentful-paint"&&(e.FCP=r.startTime)});try{let r=performance.getEntriesByType("navigation")[0];r&&r.responseStart>0&&(e.TTFB=r.responseStart)}catch{}let n=!1;return()=>{if(!n){n=!0;for(let r of t)r.disconnect();for(let[r,o]of Object.entries(e))typeof o=="number"&&Number.isFinite(o)&&i(r,r==="CLS"?Math.round(o*1e3)/1e3:Math.round(o))}}}var g=class{constructor(){a(this,"version",b);a(this,"options",null);a(this,"host","");a(this,"store",null);a(this,"transport",null);a(this,"flagValues",{});a(this,"flagsLoaded",!1);a(this,"flagListeners",new Set);a(this,"exposed",new Set);a(this,"replay",null);a(this,"replayMode",null);a(this,"replaySession",null);a(this,"teardown",[]);a(this,"pageStart",Date.now())}init(e){if(this.options)return this;if(!e?.host||!e?.project)return console.warn("[glass] init() needs { host, project }"),this;if(typeof window>"u")return this;this.options=e,this.host=new URL(e.host.replace(/\\/+$/,""),location.href).href.replace(/\\/+$/,""),this.store=new h(e.project,e.persistence??"localStorage"),this.transport=new d(`${this.host}/e`,e.project,`web/${b}`,e.flushIntervalMs??5e3);try{this.flagValues=JSON.parse(this.store.get("flags")??"{}")}catch{this.flagValues={}}e.flags!==!1&&this.reloadFlags();let t=e.autocapture===!1?{pageviews:!1,clicks:!1,errors:!1,webVitals:!1}:e.autocapture===!0||!e.autocapture?{}:e.autocapture,s={pageview:()=>{this.pageStart=Date.now(),this.capture("$pageview")},pageleave:()=>this.capture("$pageleave",{duration_ms:Date.now()-this.pageStart}),capture:(o,l)=>this.capture(o,l)},n=null;if(t.webVitals!==!1&&(n=P((o,l)=>this.capture("$web_vitals",{metric:o,value:l}))),t.pageviews!==!1&&this.teardown.push(R(s)),t.clicks!==!1&&this.teardown.push(E(s)),t.errors!==!1){let o=()=>{this.replay?.noteError(),this.replay?.flushBuffer(),this.replayMode==="buffer"&&(this.replayMode="record")};this.teardown.push(k(s,o))}let r=()=>{document.visibilityState==="hidden"&&(n?.(),n=null,t.pageviews!==!1&&s.pageleave(),this.transport?.beacon())};return addEventListener("visibilitychange",r),addEventListener("pagehide",r),this.teardown.push(()=>{removeEventListener("visibilitychange",r),removeEventListener("pagehide",r)}),this.maybeStartReplay(),this}capture(e,t={}){let s=this.store;if(!s||!this.transport)return;let n=s.session();n.isNew&&this.replay&&this.restartReplay();let r={id:p(),event:e,ts:Date.now(),distinct_id:s.distinctId(),user_id:s.userId(),session_id:s.cookieless?null:n.id,url:location.href,referrer:document.referrer||null,title:document.title,props:t};Object.keys(this.flagValues).length>0&&(r.flags={...this.flagValues});let o=this.options?.beforeSend?this.options.beforeSend(r):r;o&&(this.options?.debug&&console.debug("[glass]",o.event,o),this.transport.push(o))}identify(e,t={}){!this.store||!e||(this.store.setUserId(String(e)),this.capture("$identify",{$set:t}),this.reloadFlags())}setPersonProperties(e,t=!1){this.capture("$set",t?{$set_once:e}:{$set:e})}reset(){this.store&&(this.replay?.stop(),this.replay=null,this.store.clear(),this.flagValues={},this.exposed.clear(),this.reloadFlags())}flag(e){let t=this.flagValues[e]??null;return t!==null&&!this.exposed.has(e)&&(this.exposed.add(e),this.capture("$exposure",{flag:e,variant:t})),t}isEnabled(e){return this.flag(e)!==null}flags(){return{...this.flagValues}}onFlags(e){return this.flagListeners.add(e),this.flagsLoaded&&e(this.flags()),()=>this.flagListeners.delete(e)}async reloadFlags(){if(!(!this.store||!this.options))try{let e=await fetch(`${this.host}/f`,{method:"POST",headers:{"Content-Type":"text/plain"},body:JSON.stringify({project:this.options.project,distinct_id:this.store.distinctId(),user_id:this.store.userId()})});if(!e.ok)return;let t=await e.json();this.flagValues=t.flags??{},this.store.set("flags",JSON.stringify(this.flagValues))}catch{}finally{this.flagsLoaded=!0;for(let e of this.flagListeners)e(this.flags())}}consent(e){this.store&&(this.store.setPersistence(e?"localStorage":"cookieless"),e?this.maybeStartReplay():(this.replay?.stop(),this.replay=null))}async startReplay(){if(this.store?.setReplayDecision("record"),this.replay&&this.replayMode==="buffer"){this.replay.flushBuffer(),this.replayMode="record";return}this.replay||await this.loadReplay("record")}stopReplay(){this.store?.setReplayDecision("off"),this.replay?.stop(),this.replay=null}distinctId(){return this.store?.distinctId()??null}sessionId(){return this.store&&!this.store.cookieless?this.store.session(!1).id:null}flush(){return this.transport?.flush()??Promise.resolve()}shutdown(){for(let e of this.teardown.splice(0))e();this.replay?.stop(),this.replay=null,this.transport?.beacon(),this.options=null}async maybeStartReplay(){let e=this.options?.replay;if(!e||!this.store||this.store.cookieless||this.replay)return;let s=this.store.session(!1).replay;s||(s=Math.random()<(e.sampleRate??0)?"record":Math.random()<(e.onErrorSampleRate??0)?"buffer":"off",this.store.setReplayDecision(s)),s!=="off"&&await this.loadReplay(s)}async restartReplay(){this.replay?.stop(),this.replay=null,await this.maybeStartReplay()}async loadReplay(e){if(!this.store||!this.options)return;let t=await j(this.host);if(!t||!this.store||!this.options)return;let s=this.options.replay||{},n=this.store.session(!1);this.replaySession=n.id,this.replayMode=e,this.replay=t.startReplay({host:this.host,project:this.options.project,sessionId:this.replaySession,distinctId:this.store.distinctId(),userId:this.store.userId(),mode:e,maskAllText:s.maskAllText??!1,blockSelector:s.blockSelector??"[data-glass-block]"})}},f=null;function j(i){return window.__glassReplay?Promise.resolve(window.__glassReplay):(f??(f=new Promise(e=>{let t=document.createElement("script");t.src=`${i}/replay.js`,t.async=!0,t.onload=()=>e(window.__glassReplay??null),t.onerror=()=>{f=null,e(null)},document.head.appendChild(t)})),f)}var x=window,N=x.glass?.q??[],y=new g;x.glass=y;var w=document.currentScript,u=w?.dataset;if(w&&u?.project){let i=u.host??new URL(w.src,location.href).href.replace(/\\/s\\.js(\\?.*)?$/,""),e=Number(u.replaySampleRate??0),t=Number(u.replayOnErrorSampleRate??0);y.init({host:i,project:u.project,persistence:u.persistence==="cookieless"?"cookieless":"localStorage",autocapture:u.autocapture!=="false",replay:e>0||t>0?{sampleRate:e,onErrorSampleRate:t}:!1,debug:u.debug==="true"})}for(let[i,...e]of N){let t=y[i];typeof t=="function"&&t.apply(y,e)}})();\n', replay: '"use strict";(()=>{var En=Object.defineProperty,xn=(e,t,s)=>t in e?En(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,I=(e,t,s)=>xn(e,typeof t!="symbol"?t+"":t,s),ls,Rn=Object.defineProperty,Mn=(e,t,s)=>t in e?Rn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,us=(e,t,s)=>Mn(e,typeof t!="symbol"?t+"":t,s),J=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(J||{}),cs={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},hs={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Fe={},Ar={},fs=0,Nn=()=>!!globalThis.Zone;function jr(e){if(Fe[e])return Fe[e];let t=globalThis[e],s=t.prototype,a=e in cs?cs[e]:void 0,r=!!(a&&a.every(m=>{var l,d;return!!((d=(l=Object.getOwnPropertyDescriptor(s,m))==null?void 0:l.get)!=null&&d.toString().includes("[native code]"))})),c=e in hs?hs[e]:void 0,f=!!(c&&c.every(m=>{var l;return typeof s[m]=="function"&&((l=s[m])==null?void 0:l.toString().includes("[native code]"))}));if(r&&f&&!Nn())return Fe[e]=t.prototype,t.prototype;try{let m=document.createElement("iframe");m.style.display="none",document.body.appendChild(m);let l=m.contentWindow;if(!l)return t.prototype;let d=l[e].prototype;if(!d)return m.remove(),s;let i=navigator.userAgent;return i.includes("Safari")&&!i.includes("Chrome")?(m.classList.add("rr-block"),m.setAttribute("__rrwebUntaintedMutationObserver",""),Ar[e]=()=>m.remove()):m.remove(),Fe[e]=d}catch{return s}}var xt={};function oe(e,t,s){var a,r;let c=(a=xt[e])==null?void 0:a[s];if(c)return c.call(t);let f=jr(e),m=(r=Object.getOwnPropertyDescriptor(f,s))==null?void 0:r.get;return m?((xt[e]||(xt[e]={}))[s]=m,m.call(t)):t[s]}var Rt={};function Ti(e,t,s){let a=`${e}.${String(s)}`;if(Rt[a])return Rt[a].bind(t);let c=jr(e)[s];return typeof c!="function"?t[s]:(Rt[a]=c,c.bind(t))}function On(e){return oe("Node",e,"ownerDocument")}function In(e){return oe("Node",e,"childNodes")}function An(e){return oe("Node",e,"parentNode")}function Dn(e){return oe("Node",e,"parentElement")}function Tn(e){return oe("Node",e,"textContent")}function _n(e){return oe("Node",e,"firstChild")}function Pn(e){return oe("Node",e,"lastChild")}function kn(e){return oe("Node",e,"nextSibling")}function Ln(e){return oe("Node",e,"previousSibling")}function Fn(e,t){return Ti("Node",e,"contains")(t)}function Un(e){return Ti("Node",e,"getRootNode")()}function $n(e){return!e||!("host"in e)?null:oe("ShadowRoot",e,"host")}function Bn(e){return e.styleSheets}function Wn(e){return!e||!("shadowRoot"in e)?null:oe("Element",e,"shadowRoot")}function zn(e,t){return oe("Element",e,"querySelector")(t)}function qn(e,t){return oe("Element",e,"querySelectorAll")(t)}function Vn(){let e=jr("MutationObserver");fs++;let t=!1;return[e.constructor,()=>{if(t||(t=!0,--fs!==0))return;let s=Ar.MutationObserver;if(s)try{s()}finally{delete Fe.MutationObserver,delete Ar.MutationObserver}}]}var _i=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(_i=()=>new Date().getTime());function jn(e,t,s){try{if(!(t in e))return()=>{};let a=e[t],r=s(a);return typeof r=="function"&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:a}})),e[t]=r,()=>{e[t]=a}}catch{return()=>{}}}var X={ownerDocument:On,childNodes:In,parentNode:An,parentElement:Dn,textContent:Tn,firstChild:_n,lastChild:Pn,nextSibling:kn,previousSibling:Ln,contains:Fn,getRootNode:Un,host:$n,styleSheets:Bn,shadowRoot:Wn,querySelector:zn,querySelectorAll:qn,nowTimestamp:_i,mutationObserverCtor:Vn,patch:jn};function Pi(e){return e.nodeType===e.ELEMENT_NODE}function $e(e){let t=e&&"host"in e&&"mode"in e&&X.host(e)||null;return!!(t&&"shadowRoot"in t&&X.shadowRoot(t)===e)}function Be(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Gn(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\\sbackground-clip:\\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function Hn(e){let{cssText:t}=e;if(t.split(\'"\').length<3)return t;let s=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?s.push("layer"):e.layerName&&s.push(`layer(${e.layerName})`),e.supportsText&&s.push(`supports(${e.supportsText})`),e.media.length&&s.push(e.media.mediaText),s.join(" ")+";"}function Dr(e){try{let t=e.rules||e.cssRules;if(!t)return null;let s=e.href;!s&&e.ownerNode&&(s=e.ownerNode.baseURI);let a=Array.from(t,r=>ki(r,s)).join("");return Gn(a)}catch{return null}}function ki(e,t){if(Jn(e)){let s;try{s=Dr(e.styleSheet)||Hn(e)}catch{s=e.cssText}return e.styleSheet.href?ot(s,e.styleSheet.href):s}else{let s=e.cssText;return Xn(e)&&e.selectorText.includes(":")&&(s=Yn(s)),t?ot(s,t):s}}function Yn(e){let t=/(\\[(?:[\\w-]+)[^\\\\])(:(?:[\\w-]+)\\])/gm;return e.replace(t,"$1\\\\$2")}function Jn(e){return"styleSheet"in e}function Xn(e){return"selectorText"in e}var st=class{constructor(){us(this,"idNodeMap",new Map),us(this,"nodeMetaMap",new WeakMap)}getId(t){var s;return t?((s=this.getMeta(t))==null?void 0:s.id)??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){let s=this.getId(t);this.idNodeMap.delete(s),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r));let a=X.shadowRoot(t);a&&this.removeNodeFromMap(a)}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,s){let a=s.id;this.idNodeMap.set(a,t),this.nodeMetaMap.set(t,s)}replace(t,s){let a=this.getNode(t);if(a){let r=this.nodeMetaMap.get(a);r&&this.nodeMetaMap.set(s,r)}this.idNodeMap.set(t,s)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Qn(){return new st}function it({element:e,maskInputOptions:t,tagName:s,type:a,value:r,maskInputFn:c}){let f=r||"",m=a&&Ce(a);return(t[s.toLowerCase()]||m&&t[m])&&(c?f=c(f,e):f="*".repeat(f.length)),f}function Ce(e){return e.toLowerCase()}var ds="__rrweb_original__";function Zn(e){let t=e.getContext("2d");if(!t)return!0;let s=50;for(let a=0;a<e.width;a+=s)for(let r=0;r<e.height;r+=s){let c=t.getImageData,f=ds in c?c[ds]:c;if(new Uint32Array(f.call(t,a,r,Math.min(s,e.width-a),Math.min(s,e.height-r)).data.buffer).some(l=>l!==0))return!1}return!0}function nt(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ce(t):null}function Li(e,t){let s;try{s=new URL(e,t??window.location.href)}catch{return null}let a=/\\.([0-9a-z]+)(?:$)/i,r=s.pathname.match(a);return r?.[1]??null}function Kn(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var eo=/url\\((?:(\')([^\']*)\'|(")(.*?)"|([^)]*))\\)/gm,to=/^(?:[a-z+]+:)?\\/\\//i,ro=/^www\\..*/i,so=/^(data:)([^,]*),(.*)/i;function ot(e,t){return(e||"").replace(eo,(s,a,r,c,f,m)=>{let l=r||f||m,d=a||c||"";if(!l)return s;if(to.test(l)||ro.test(l))return`url(${d}${l}${d})`;if(so.test(l))return`url(${d}${l}${d})`;if(l[0]==="/")return`url(${d}${Kn(t)+l}${d})`;let i=l.split("#")[0],h=l.substring(i.length),o=t.split("#")[0].split("/"),n=i.split("/");o.pop();for(let p of n)p!=="."&&(p===".."?o.pop():o.push(p));return`url(${d}${o.join("/")}${h}${d})`})}var Fi="(?:/\\\\*[^*]*\\\\*/)|[\\\\s;]",io=new RegExp(`${Fi}|\\\\b(0)px?`,"g"),no=new RegExp(Fi,"g");function Ye(e,t=!1){return t?e.replace(no,""):e.replace(io,"$1")}function oo(e,t,s=!1){let a=Array.from(t.childNodes),r=[],c=0;if(a.length>1&&e&&typeof e=="string"){let f=Ye(e,s),m=f.length/e.length;for(let l=1;l<a.length;l++)if(a[l].textContent&&typeof a[l].textContent=="string"){let d=Ye(a[l].textContent,s),i=100,h=3;for(;h<d.length&&(d[h].match(/[a-zA-Z0-9]/)||d.indexOf(d.substring(0,h),1)!==-1);h++);for(;h<d.length;h++){let o=d.substring(0,h),n=f.split(o),p=-1;if(n.length===2)p=n[0].length;else if(n.length>2&&n[0]===""&&a[l-1].textContent!=="")p=f.indexOf(o,1);else if(n.length===1){if(o=o.substring(0,o.length-1),n=f.split(o),n.length<=1)return r.push(e),r;h=i+1}else h===d.length-1&&(p=f.indexOf(o));if(n.length>=2&&h>i){let u=a[l-1].textContent;if(u&&typeof u=="string"){let g=Ye(u).length;p=f.indexOf(o,g)}p===-1&&(p=n[0].length)}if(p!==-1){let u=Math.floor(p/m);for(;u>0&&u<e.length;){if(c+=1,c>50*a.length)return r.push(e),r;let g=Ye(e.substring(0,u),s);if(g.length===p){r.push(e.substring(0,u)),e=e.substring(u),f=f.substring(p);break}else g.length<p?u+=Math.max(1,Math.floor((p-g.length)/m)):u-=Math.max(1,Math.floor((g.length-p)*m))}break}}}}return r.push(e),r}function ao(e,t){return oo(e,t).join("/* rr_split */")}var lo=1,uo=new RegExp("[^a-z0-9-_:]"),at=-2;function Ui(){return lo++}function co(e){if(e instanceof HTMLFormElement)return"form";let t=Ce(e.tagName);return uo.test(t)?"div":t}var Ne,ps,ho=/^[^ \\t\\n\\r\\u000c]+/,fo=/^[, \\t\\n\\r\\u000c]+/;function po(e,t){if(t.trim()==="")return t;let s=0;function a(c){let f,m=c.exec(t.substring(s));return m?(f=m[0],s+=f.length,f):""}let r=[];for(;a(fo),!(s>=t.length);){let c=a(ho);if(c.slice(-1)===",")c=Ae(e,c.substring(0,c.length-1)),r.push(c);else{let f="";c=Ae(e,c);let m=!1;for(;;){let l=t.charAt(s);if(l===""){r.push((c+f).trim());break}else if(m)l===")"&&(m=!1);else if(l===","){s+=1,r.push((c+f).trim());break}else l==="("&&(m=!0);f+=l,s+=1}}}return r.join(", ")}var ms=new WeakMap;function Ae(e,t){return!t||t.trim()===""?t:Gr(e,t)}function mo(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Gr(e,t){let s=ms.get(e);if(s||(s=e.createElement("a"),ms.set(e,s)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return s.setAttribute("href",t),s.href}function $i(e,t,s,a){return a&&(s==="src"||s==="href"&&!(t==="use"&&a[0]==="#")||s==="xlink:href"&&a[0]!=="#"||s==="background"&&["table","td","th"].includes(t)?Ae(e,a):s==="srcset"?po(e,a):s==="style"?ot(a,Gr(e)):t==="object"&&s==="data"?Ae(e,a):a)}function Bi(e,t,s){return["video","audio"].includes(e)&&Ce(t)==="autoplay"}function go(e,t,s){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let a=e.classList.length;a--;){let r=e.classList[a];if(t.test(r))return!0}if(s)return e.matches(s)}catch{}return!1}function lt(e,t,s){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return s?lt(X.parentNode(e),t,s):!1;for(let a=e.classList.length;a--;){let r=e.classList[a];if(t.test(r))return!0}return s?lt(X.parentNode(e),t,s):!1}function Wi(e,t,s,a){let r;if(Pi(e)){if(r=e,!X.childNodes(r).length)return!1}else{if(X.parentElement(e)===null)return!1;r=X.parentElement(e)}try{if(typeof t=="string"){if(a){if(r.closest(`.${t}`))return!0}else if(r.classList.contains(t))return!0}else if(lt(r,t,a))return!0;if(s){if(a){if(r.closest(s))return!0}else if(r.matches(s))return!0}}catch{}return!1}function yo(e,t,s){let a=e.contentWindow;if(!a)return;let r=!1,c;try{c=a.document.readyState}catch{return}if(c!=="complete"){let m=setTimeout(()=>{r||(t(),r=!0)},s);e.addEventListener("load",()=>{clearTimeout(m),r=!0,t()});return}let f="about:blank";if(a.location.href!==f||e.src===f||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function wo(e,t,s){let a=!1,r;try{r=e.sheet}catch{return}if(r)return;let c=setTimeout(()=>{a||(t(),a=!0)},s);e.addEventListener("load",()=>{clearTimeout(c),a=!0,t()})}function bo(e,t){let{doc:s,mirror:a,blockClass:r,blockSelector:c,needsMask:f,inlineStylesheet:m,maskInputOptions:l={},maskTextFn:d,maskInputFn:i,dataURLOptions:h={},inlineImages:o,recordCanvas:n,keepIframeSrcFn:p,newlyAddedElement:u=!1,cssCaptured:g=!1}=t,S=vo(s,a);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:J.Document,childNodes:[],compatMode:e.compatMode}:{type:J.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:J.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return Co(e,{doc:s,blockClass:r,blockSelector:c,inlineStylesheet:m,maskInputOptions:l,maskInputFn:i,dataURLOptions:h,inlineImages:o,recordCanvas:n,keepIframeSrcFn:p,newlyAddedElement:u,rootId:S});case e.TEXT_NODE:return So(e,{doc:s,needsMask:f,maskTextFn:d,rootId:S,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:J.CDATA,textContent:"",rootId:S};case e.COMMENT_NODE:return{type:J.Comment,textContent:X.textContent(e)||"",rootId:S};default:return!1}}function vo(e,t){if(!t.hasNode(e))return;let s=t.getId(e);return s===1?void 0:s}function So(e,t){let{needsMask:s,maskTextFn:a,rootId:r,cssCaptured:c}=t,f=X.parentNode(e),m=f&&f.tagName,l="",d=m==="STYLE"?!0:void 0,i=m==="SCRIPT"?!0:void 0;return i?l="SCRIPT_PLACEHOLDER":c||(l=X.textContent(e),d&&l&&(l=ot(l,Gr(t.doc)))),!d&&!i&&l&&s&&(l=a?a(l,X.parentElement(e)):l.replace(/[\\S]/g,"*")),{type:J.Text,textContent:l||"",rootId:r}}function Co(e,t){let{doc:s,blockClass:a,blockSelector:r,inlineStylesheet:c,maskInputOptions:f={},maskInputFn:m,dataURLOptions:l={},inlineImages:d,recordCanvas:i,keepIframeSrcFn:h,newlyAddedElement:o=!1,rootId:n}=t,p=go(e,a,r),u=co(e),g={},S=e.attributes.length;for(let b=0;b<S;b++){let C=e.attributes[b];Bi(u,C.name,C.value)||(g[C.name]=$i(s,u,Ce(C.name),C.value))}if(u==="link"&&c){let b=Array.from(s.styleSheets).find(y=>y.href===e.href),C=null;b&&(C=Dr(b)),C&&(delete g.rel,delete g.href,g._cssText=C)}if(u==="style"&&e.sheet){let b=Dr(e.sheet);b&&(e.childNodes.length>1&&(b=ao(b,e)),g._cssText=b)}if(["input","textarea","select"].includes(u)){let b=e.value,C=e.checked;g.type!=="radio"&&g.type!=="checkbox"&&g.type!=="submit"&&g.type!=="button"&&b?g.value=it({element:e,type:nt(e),tagName:u,value:b,maskInputOptions:f,maskInputFn:m}):C&&(g.checked=C)}if(u==="option"&&(e.selected&&!f.select?g.selected=!0:delete g.selected),u==="dialog"&&e.open&&(g.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),u==="canvas"&&i){if(e.__context==="2d")Zn(e)||(g.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){let b=e.toDataURL(l.type,l.quality),C=s.createElement("canvas");C.width=e.width,C.height=e.height;let y=C.toDataURL(l.type,l.quality);b!==y&&(g.rr_dataURL=b)}}if(u==="img"&&d){Ne||(Ne=s.createElement("canvas"),ps=Ne.getContext("2d"));let b=e,C=b.currentSrc||b.getAttribute("src")||"<unknown-src>",y=b.crossOrigin,w=()=>{b.removeEventListener("load",w);try{Ne.width=b.naturalWidth,Ne.height=b.naturalHeight,ps.drawImage(b,0,0),g.rr_dataURL=Ne.toDataURL(l.type,l.quality)}catch(E){if(b.crossOrigin!=="anonymous"){b.crossOrigin="anonymous",b.complete&&b.naturalWidth!==0?w():b.addEventListener("load",w);return}else console.warn(`Cannot inline img src=${C}! Error: ${E}`)}b.crossOrigin==="anonymous"&&(y?g.crossOrigin=y:b.removeAttribute("crossorigin"))};b.complete&&b.naturalWidth!==0?w():b.addEventListener("load",w)}if(["audio","video"].includes(u)){let b=g;b.rr_mediaState=e.paused?"paused":"played",b.rr_mediaCurrentTime=e.currentTime,b.rr_mediaPlaybackRate=e.playbackRate,b.rr_mediaMuted=e.muted,b.rr_mediaLoop=e.loop,b.rr_mediaVolume=e.volume}if(o||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop)),p){let{width:b,height:C}=e.getBoundingClientRect();g={class:g.class,rr_width:`${b}px`,rr_height:`${C}px`}}u==="iframe"&&!h(g.src)&&(e.contentDocument||(g.rr_src=g.src),delete g.src);let v;try{customElements.get(u)&&(v=!0)}catch{}return{type:J.Element,tagName:u,attributes:g,childNodes:[],isSVG:mo(e)||void 0,needBlock:p,rootId:n,isCustom:v}}function z(e){return e==null?"":e.toLowerCase()}function zi(e){return e===!0||e==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:e==="all",headMetaDescKeywords:e==="all",headTitleMutations:e==="all"}:e||{}}function Eo(e,t){if(t.comment&&e.type===J.Comment)return!0;if(e.type===J.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Li(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(z(e.attributes.name).match(/^msapplication-tile(image|color)$/)||z(e.attributes.name)==="application-name"||z(e.attributes.rel)==="icon"||z(e.attributes.rel)==="apple-touch-icon"||z(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&z(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(z(e.attributes.property).match(/^(og|twitter|fb):/)||z(e.attributes.name).match(/^(og|twitter):/)||z(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(z(e.attributes.name)==="robots"||z(e.attributes.name)==="googlebot"||z(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(z(e.attributes.name)==="author"||z(e.attributes.name)==="generator"||z(e.attributes.name)==="framework"||z(e.attributes.name)==="publisher"||z(e.attributes.name)==="progid"||z(e.attributes.property).match(/^article:/)||z(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(z(e.attributes.name)==="google-site-verification"||z(e.attributes.name)==="yandex-verification"||z(e.attributes.name)==="csrf-token"||z(e.attributes.name)==="p:domain_verify"||z(e.attributes.name)==="verify-v1"||z(e.attributes.name)==="verification"||z(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function De(e,t){let{doc:s,mirror:a,blockClass:r,blockSelector:c,maskTextClass:f,maskTextSelector:m,skipChild:l=!1,inlineStylesheet:d=!0,maskInputOptions:i={},maskTextFn:h,maskInputFn:o,slimDOMOptions:n,dataURLOptions:p={},inlineImages:u=!1,recordCanvas:g=!1,onSerialize:S,onIframeLoad:v,iframeLoadTimeout:b=5e3,onStylesheetLoad:C,stylesheetLoadTimeout:y=5e3,keepIframeSrcFn:w=()=>!1,newlyAddedElement:E=!1,cssCaptured:R=!1}=t,{needsMask:O}=t,{preserveWhiteSpace:M=!0}=t;O||(O=Wi(e,f,m,O===void 0));let P=bo(e,{doc:s,mirror:a,blockClass:r,blockSelector:c,needsMask:O,inlineStylesheet:d,maskInputOptions:i,maskTextFn:h,maskInputFn:o,dataURLOptions:p,inlineImages:u,recordCanvas:g,keepIframeSrcFn:w,newlyAddedElement:E,cssCaptured:R});if(!P)return console.warn(e,"not serialized"),null;let A;a.hasNode(e)?A=a.getId(e):Eo(P,n)||!M&&P.type===J.Text&&!P.textContent.replace(/^\\s+|\\s+$/gm,"").length?A=at:A=Ui();let x=Object.assign(P,{id:A});if(a.add(e,x),A===at)return null;S&&S(e);let fe=!l;if(x.type===J.Element){fe=fe&&!x.needBlock,delete x.needBlock;let $=X.shadowRoot(e);$&&Be($)&&(x.isShadowHost=!0)}if((x.type===J.Document||x.type===J.Element)&&fe){n.headWhitespace&&x.type===J.Element&&x.tagName==="head"&&(M=!1);let $={doc:s,mirror:a,blockClass:r,blockSelector:c,needsMask:O,maskTextClass:f,maskTextSelector:m,skipChild:l,inlineStylesheet:d,maskInputOptions:i,maskTextFn:h,maskInputFn:o,slimDOMOptions:n,dataURLOptions:p,inlineImages:u,recordCanvas:g,preserveWhiteSpace:M,onSerialize:S,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:C,stylesheetLoadTimeout:y,keepIframeSrcFn:w,cssCaptured:!1};if(!(x.type===J.Element&&x.tagName==="textarea"&&x.attributes.value!==void 0)){x.type===J.Element&&x.attributes._cssText!==void 0&&typeof x.attributes._cssText=="string"&&($.cssCaptured=!0);for(let G of Array.from(X.childNodes(e))){let Z=De(G,$);Z&&x.childNodes.push(Z)}}let U=null;if(Pi(e)&&(U=X.shadowRoot(e)))for(let G of Array.from(X.childNodes(U))){let Z=De(G,$);Z&&(Be(U)&&(Z.isShadow=!0),x.childNodes.push(Z))}}let ie=X.parentNode(e);return ie&&$e(ie)&&Be(ie)&&(x.isShadow=!0),x.type===J.Element&&x.tagName==="iframe"&&yo(e,()=>{let $=e.contentDocument;if($&&v){let U=De($,{doc:$,mirror:a,blockClass:r,blockSelector:c,needsMask:O,maskTextClass:f,maskTextSelector:m,skipChild:!1,inlineStylesheet:d,maskInputOptions:i,maskTextFn:h,maskInputFn:o,slimDOMOptions:n,dataURLOptions:p,inlineImages:u,recordCanvas:g,preserveWhiteSpace:M,onSerialize:S,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:C,stylesheetLoadTimeout:y,keepIframeSrcFn:w});U&&v(e,U)}},b),x.type===J.Element&&x.tagName==="link"&&typeof x.attributes.rel=="string"&&(x.attributes.rel==="stylesheet"||x.attributes.rel==="preload"&&typeof x.attributes.href=="string"&&Li(x.attributes.href)==="css")&&wo(e,()=>{if(C){let $=De(e,{doc:s,mirror:a,blockClass:r,blockSelector:c,needsMask:O,maskTextClass:f,maskTextSelector:m,skipChild:!1,inlineStylesheet:d,maskInputOptions:i,maskTextFn:h,maskInputFn:o,slimDOMOptions:n,dataURLOptions:p,inlineImages:u,recordCanvas:g,preserveWhiteSpace:M,onSerialize:S,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:C,stylesheetLoadTimeout:y,keepIframeSrcFn:w});$&&C(e,$)}},y),x}function xo(e,t){let{mirror:s=new st,blockClass:a="rr-block",blockSelector:r=null,maskTextClass:c="rr-mask",maskTextSelector:f=null,inlineStylesheet:m=!0,inlineImages:l=!1,recordCanvas:d=!1,maskAllInputs:i=!1,maskTextFn:h,maskInputFn:o,slimDOM:n=!1,dataURLOptions:p,preserveWhiteSpace:u,onSerialize:g,onIframeLoad:S,iframeLoadTimeout:v,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:y=()=>!1}=t,w=i===!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}:i===!1?{password:!0}:i,E=zi(n);return De(e,{doc:e,mirror:s,blockClass:a,blockSelector:r,maskTextClass:c,maskTextSelector:f,skipChild:!1,inlineStylesheet:m,maskInputOptions:w,maskTextFn:h,maskInputFn:o,slimDOMOptions:E,dataURLOptions:p,inlineImages:l,recordCanvas:d,preserveWhiteSpace:u,onSerialize:g,onIframeLoad:S,iframeLoadTimeout:v,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:y,newlyAddedElement:!1})}var Ro=/(max|min)-device-(width|height)/,Za=new RegExp(Ro.source,"g");function Mo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function No(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var s=function a(){return this instanceof a?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(s,a,r.get?r:{enumerable:!0,get:function(){return e[a]}})}),s}var Je={exports:{}},gs;function Oo(){if(gs)return Je.exports;gs=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return Je.exports=t(),Je.exports.createColors=t,Je.exports}var Io={},Ao=Object.freeze(Object.defineProperty({__proto__:null,default:Io},Symbol.toStringTag,{value:"Module"})),de=No(Ao),Mt,ys;function Hr(){if(ys)return Mt;ys=1;let e=Oo(),t=de;class s extends Error{constructor(r,c,f,m,l,d){super(r),this.name="CssSyntaxError",this.reason=r,l&&(this.file=l),m&&(this.source=m),d&&(this.plugin=d),typeof c<"u"&&typeof f<"u"&&(typeof c=="number"?(this.line=c,this.column=f):(this.line=c.line,this.column=c.column,this.endLine=f.line,this.endColumn=f.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,s)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(r){if(!this.source)return"";let c=this.source;r==null&&(r=e.isColorSupported),t&&r&&(c=t(c));let f=c.split(/\\r?\\n/),m=Math.max(this.line-3,0),l=Math.min(this.line+2,f.length),d=String(l).length,i,h;if(r){let{bold:o,gray:n,red:p}=e.createColors(!0);i=u=>o(p(u)),h=u=>n(u)}else i=h=o=>o;return f.slice(m,l).map((o,n)=>{let p=m+1+n,u=" "+(" "+p).slice(-d)+" | ";if(p===this.line){let g=h(u.replace(/\\d/g," "))+o.slice(0,this.column-1).replace(/[^\\t]/g," ");return i(">")+h(u)+o+`\n `+g+i("^")}return" "+h(u)+o}).join(`\n`)}toString(){let r=this.showSourceCode();return r&&(r=`\n\n`+r+`\n`),this.name+": "+this.message+r}}return Mt=s,s.default=s,Mt}var Xe={},ws;function Yr(){return ws||(ws=1,Xe.isClean=Symbol("isClean"),Xe.my=Symbol("my")),Xe}var Nt,bs;function qi(){if(bs)return Nt;bs=1;let e={after:`\n`,beforeClose:`\n`,beforeComment:`\n`,beforeDecl:`\n`,beforeOpen:" ",beforeRule:`\n`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function t(a){return a[0].toUpperCase()+a.slice(1)}class s{constructor(r){this.builder=r}atrule(r,c){let f="@"+r.name,m=r.params?this.rawValue(r,"params"):"";if(typeof r.raws.afterName<"u"?f+=r.raws.afterName:m&&(f+=" "),r.nodes)this.block(r,f+m);else{let l=(r.raws.between||"")+(c?";":"");this.builder(f+m+l,r)}}beforeAfter(r,c){let f;r.type==="decl"?f=this.raw(r,null,"beforeDecl"):r.type==="comment"?f=this.raw(r,null,"beforeComment"):c==="before"?f=this.raw(r,null,"beforeRule"):f=this.raw(r,null,"beforeClose");let m=r.parent,l=0;for(;m&&m.type!=="root";)l+=1,m=m.parent;if(f.includes(`\n`)){let d=this.raw(r,null,"indent");if(d.length)for(let i=0;i<l;i++)f+=d}return f}block(r,c){let f=this.raw(r,"between","beforeOpen");this.builder(c+f+"{",r,"start");let m;r.nodes&&r.nodes.length?(this.body(r),m=this.raw(r,"after")):m=this.raw(r,"after","emptyBody"),m&&this.builder(m),this.builder("}",r,"end")}body(r){let c=r.nodes.length-1;for(;c>0&&r.nodes[c].type==="comment";)c-=1;let f=this.raw(r,"semicolon");for(let m=0;m<r.nodes.length;m++){let l=r.nodes[m],d=this.raw(l,"before");d&&this.builder(d),this.stringify(l,c!==m||f)}}comment(r){let c=this.raw(r,"left","commentLeft"),f=this.raw(r,"right","commentRight");this.builder("/*"+c+r.text+f+"*/",r)}decl(r,c){let f=this.raw(r,"between","colon"),m=r.prop+f+this.rawValue(r,"value");r.important&&(m+=r.raws.important||" !important"),c&&(m+=";"),this.builder(m,r)}document(r){this.body(r)}raw(r,c,f){let m;if(f||(f=c),c&&(m=r.raws[c],typeof m<"u"))return m;let l=r.parent;if(f==="before"&&(!l||l.type==="root"&&l.first===r||l&&l.type==="document"))return"";if(!l)return e[f];let d=r.root();if(d.rawCache||(d.rawCache={}),typeof d.rawCache[f]<"u")return d.rawCache[f];if(f==="before"||f==="after")return this.beforeAfter(r,f);{let i="raw"+t(f);this[i]?m=this[i](d,r):d.walk(h=>{if(m=h.raws[c],typeof m<"u")return!1})}return typeof m>"u"&&(m=e[f]),d.rawCache[f]=m,m}rawBeforeClose(r){let c;return r.walk(f=>{if(f.nodes&&f.nodes.length>0&&typeof f.raws.after<"u")return c=f.raws.after,c.includes(`\n`)&&(c=c.replace(/[^\\n]+$/,"")),!1}),c&&(c=c.replace(/\\S/g,"")),c}rawBeforeComment(r,c){let f;return r.walkComments(m=>{if(typeof m.raws.before<"u")return f=m.raws.before,f.includes(`\n`)&&(f=f.replace(/[^\\n]+$/,"")),!1}),typeof f>"u"?f=this.raw(c,null,"beforeDecl"):f&&(f=f.replace(/\\S/g,"")),f}rawBeforeDecl(r,c){let f;return r.walkDecls(m=>{if(typeof m.raws.before<"u")return f=m.raws.before,f.includes(`\n`)&&(f=f.replace(/[^\\n]+$/,"")),!1}),typeof f>"u"?f=this.raw(c,null,"beforeRule"):f&&(f=f.replace(/\\S/g,"")),f}rawBeforeOpen(r){let c;return r.walk(f=>{if(f.type!=="decl"&&(c=f.raws.between,typeof c<"u"))return!1}),c}rawBeforeRule(r){let c;return r.walk(f=>{if(f.nodes&&(f.parent!==r||r.first!==f)&&typeof f.raws.before<"u")return c=f.raws.before,c.includes(`\n`)&&(c=c.replace(/[^\\n]+$/,"")),!1}),c&&(c=c.replace(/\\S/g,"")),c}rawColon(r){let c;return r.walkDecls(f=>{if(typeof f.raws.between<"u")return c=f.raws.between.replace(/[^\\s:]/g,""),!1}),c}rawEmptyBody(r){let c;return r.walk(f=>{if(f.nodes&&f.nodes.length===0&&(c=f.raws.after,typeof c<"u"))return!1}),c}rawIndent(r){if(r.raws.indent)return r.raws.indent;let c;return r.walk(f=>{let m=f.parent;if(m&&m!==r&&m.parent&&m.parent===r&&typeof f.raws.before<"u"){let l=f.raws.before.split(`\n`);return c=l[l.length-1],c=c.replace(/\\S/g,""),!1}}),c}rawSemicolon(r){let c;return r.walk(f=>{if(f.nodes&&f.nodes.length&&f.last.type==="decl"&&(c=f.raws.semicolon,typeof c<"u"))return!1}),c}rawValue(r,c){let f=r[c],m=r.raws[c];return m&&m.value===f?m.raw:f}root(r){this.body(r),r.raws.after&&this.builder(r.raws.after)}rule(r){this.block(r,this.rawValue(r,"selector")),r.raws.ownSemicolon&&this.builder(r.raws.ownSemicolon,r,"end")}stringify(r,c){if(!this[r.type])throw new Error("Unknown AST node type "+r.type+". Maybe you need to change PostCSS stringifier.");this[r.type](r,c)}}return Nt=s,s.default=s,Nt}var Ot,vs;function ht(){if(vs)return Ot;vs=1;let e=qi();function t(s,a){new e(a).stringify(s)}return Ot=t,t.default=t,Ot}var It,Ss;function ft(){if(Ss)return It;Ss=1;let{isClean:e,my:t}=Yr(),s=Hr(),a=qi(),r=ht();function c(m,l){let d=new m.constructor;for(let i in m){if(!Object.prototype.hasOwnProperty.call(m,i)||i==="proxyCache")continue;let h=m[i],o=typeof h;i==="parent"&&o==="object"?l&&(d[i]=l):i==="source"?d[i]=h:Array.isArray(h)?d[i]=h.map(n=>c(n,d)):(o==="object"&&h!==null&&(h=c(h)),d[i]=h)}return d}class f{constructor(l={}){this.raws={},this[e]=!1,this[t]=!0;for(let d in l)if(d==="nodes"){this.nodes=[];for(let i of l[d])typeof i.clone=="function"?this.append(i.clone()):this.append(i)}else this[d]=l[d]}addToError(l){if(l.postcssNode=this,l.stack&&this.source&&/\\n\\s{4}at /.test(l.stack)){let d=this.source;l.stack=l.stack.replace(/\\n\\s{4}at /,`$&${d.input.from}:${d.start.line}:${d.start.column}$&`)}return l}after(l){return this.parent.insertAfter(this,l),this}assign(l={}){for(let d in l)this[d]=l[d];return this}before(l){return this.parent.insertBefore(this,l),this}cleanRaws(l){delete this.raws.before,delete this.raws.after,l||delete this.raws.between}clone(l={}){let d=c(this);for(let i in l)d[i]=l[i];return d}cloneAfter(l={}){let d=this.clone(l);return this.parent.insertAfter(this,d),d}cloneBefore(l={}){let d=this.clone(l);return this.parent.insertBefore(this,d),d}error(l,d={}){if(this.source){let{end:i,start:h}=this.rangeBy(d);return this.source.input.error(l,{column:h.column,line:h.line},{column:i.column,line:i.line},d)}return new s(l)}getProxyProcessor(){return{get(l,d){return d==="proxyOf"?l:d==="root"?()=>l.root().toProxy():l[d]},set(l,d,i){return l[d]===i||(l[d]=i,(d==="prop"||d==="value"||d==="name"||d==="params"||d==="important"||d==="text")&&l.markDirty()),!0}}}markDirty(){if(this[e]){this[e]=!1;let l=this;for(;l=l.parent;)l[e]=!1}}next(){if(!this.parent)return;let l=this.parent.index(this);return this.parent.nodes[l+1]}positionBy(l,d){let i=this.source.start;if(l.index)i=this.positionInside(l.index,d);else if(l.word){d=this.toString();let h=d.indexOf(l.word);h!==-1&&(i=this.positionInside(h,d))}return i}positionInside(l,d){let i=d||this.toString(),h=this.source.start.column,o=this.source.start.line;for(let n=0;n<l;n++)i[n]===`\n`?(h=1,o+=1):h+=1;return{column:h,line:o}}prev(){if(!this.parent)return;let l=this.parent.index(this);return this.parent.nodes[l-1]}rangeBy(l){let d={column:this.source.start.column,line:this.source.start.line},i=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:d.column+1,line:d.line};if(l.word){let h=this.toString(),o=h.indexOf(l.word);o!==-1&&(d=this.positionInside(o,h),i=this.positionInside(o+l.word.length,h))}else l.start?d={column:l.start.column,line:l.start.line}:l.index&&(d=this.positionInside(l.index)),l.end?i={column:l.end.column,line:l.end.line}:typeof l.endIndex=="number"?i=this.positionInside(l.endIndex):l.index&&(i=this.positionInside(l.index+1));return(i.line<d.line||i.line===d.line&&i.column<=d.column)&&(i={column:d.column+1,line:d.line}),{end:i,start:d}}raw(l,d){return new a().raw(this,l,d)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...l){if(this.parent){let d=this,i=!1;for(let h of l)h===this?i=!0:i?(this.parent.insertAfter(d,h),d=h):this.parent.insertBefore(d,h);i||this.remove()}return this}root(){let l=this;for(;l.parent&&l.parent.type!=="document";)l=l.parent;return l}toJSON(l,d){let i={},h=d==null;d=d||new Map;let o=0;for(let n in this){if(!Object.prototype.hasOwnProperty.call(this,n)||n==="parent"||n==="proxyCache")continue;let p=this[n];if(Array.isArray(p))i[n]=p.map(u=>typeof u=="object"&&u.toJSON?u.toJSON(null,d):u);else if(typeof p=="object"&&p.toJSON)i[n]=p.toJSON(null,d);else if(n==="source"){let u=d.get(p.input);u==null&&(u=o,d.set(p.input,o),o++),i[n]={end:p.end,inputId:u,start:p.start}}else i[n]=p}return h&&(i.inputs=[...d.keys()].map(n=>n.toJSON())),i}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(l=r){l.stringify&&(l=l.stringify);let d="";return l(this,i=>{d+=i}),d}warn(l,d,i){let h={node:this};for(let o in i)h[o]=i[o];return l.warn(d,h)}get proxyOf(){return this}}return It=f,f.default=f,It}var At,Cs;function dt(){if(Cs)return At;Cs=1;let e=ft();class t extends e{constructor(a){a&&typeof a.value<"u"&&typeof a.value!="string"&&(a={...a,value:String(a.value)}),super(a),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}}return At=t,t.default=t,At}var Dt,Es;function Do(){if(Es)return Dt;Es=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return Dt={nanoid:(a=21)=>{let r="",c=a;for(;c--;)r+=e[Math.random()*64|0];return r},customAlphabet:(a,r=21)=>(c=r)=>{let f="",m=c;for(;m--;)f+=a[Math.random()*a.length|0];return f}},Dt}var Tt,xs;function Vi(){if(xs)return Tt;xs=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=de,{existsSync:s,readFileSync:a}=de,{dirname:r,join:c}=de;function f(l){return Buffer?Buffer.from(l,"base64").toString():window.atob(l)}class m{constructor(d,i){if(i.map===!1)return;this.loadAnnotation(d),this.inline=this.startWith(this.annotation,"data:");let h=i.map?i.map.prev:void 0,o=this.loadMap(i.from,h);!this.mapFile&&i.from&&(this.mapFile=i.from),this.mapFile&&(this.root=r(this.mapFile)),o&&(this.text=o)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(d){let i=/^data:application\\/json;charset=utf-?8;base64,/,h=/^data:application\\/json;base64,/,o=/^data:application\\/json;charset=utf-?8,/,n=/^data:application\\/json,/;if(o.test(d)||n.test(d))return decodeURIComponent(d.substr(RegExp.lastMatch.length));if(i.test(d)||h.test(d))return f(d.substr(RegExp.lastMatch.length));let p=d.match(/data:application\\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+p)}getAnnotationURL(d){return d.replace(/^\\/\\*\\s*# sourceMappingURL=/,"").trim()}isMap(d){return typeof d!="object"?!1:typeof d.mappings=="string"||typeof d._mappings=="string"||Array.isArray(d.sections)}loadAnnotation(d){let i=d.match(/\\/\\*\\s*# sourceMappingURL=/gm);if(!i)return;let h=d.lastIndexOf(i.pop()),o=d.indexOf("*/",h);h>-1&&o>-1&&(this.annotation=this.getAnnotationURL(d.substring(h,o)))}loadFile(d){if(this.root=r(d),s(d))return this.mapFile=d,a(d,"utf-8").toString().trim()}loadMap(d,i){if(i===!1)return!1;if(i){if(typeof i=="string")return i;if(typeof i=="function"){let h=i(d);if(h){let o=this.loadFile(h);if(!o)throw new Error("Unable to load previous source map: "+h.toString());return o}}else{if(i instanceof e)return t.fromSourceMap(i).toString();if(i instanceof t)return i.toString();if(this.isMap(i))return JSON.stringify(i);throw new Error("Unsupported previous source map format: "+i.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let h=this.annotation;return d&&(h=c(r(d),h)),this.loadFile(h)}}}startWith(d,i){return d?d.substr(0,i.length)===i:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Tt=m,m.default=m,Tt}var _t,Rs;function pt(){if(Rs)return _t;Rs=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=de,{fileURLToPath:s,pathToFileURL:a}=de,{isAbsolute:r,resolve:c}=de,{nanoid:f}=Do(),m=de,l=Hr(),d=Vi(),i=Symbol("fromOffsetCache"),h=!!(e&&t),o=!!(c&&r);class n{constructor(u,g={}){if(u===null||typeof u>"u"||typeof u=="object"&&!u.toString)throw new Error(`PostCSS received ${u} instead of CSS string`);if(this.css=u.toString(),this.css[0]==="\\uFEFF"||this.css[0]==="\\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,g.from&&(!o||/^\\w+:\\/\\//.test(g.from)||r(g.from)?this.file=g.from:this.file=c(g.from)),o&&h){let S=new d(this.css,g);if(S.text){this.map=S;let v=S.consumer().file;!this.file&&v&&(this.file=this.mapResolve(v))}}this.file||(this.id="<input css "+f(6)+">"),this.map&&(this.map.file=this.from)}error(u,g,S,v={}){let b,C,y;if(g&&typeof g=="object"){let E=g,R=S;if(typeof E.offset=="number"){let O=this.fromOffset(E.offset);g=O.line,S=O.col}else g=E.line,S=E.column;if(typeof R.offset=="number"){let O=this.fromOffset(R.offset);C=O.line,y=O.col}else C=R.line,y=R.column}else if(!S){let E=this.fromOffset(g);g=E.line,S=E.col}let w=this.origin(g,S,C,y);return w?b=new l(u,w.endLine===void 0?w.line:{column:w.column,line:w.line},w.endLine===void 0?w.column:{column:w.endColumn,line:w.endLine},w.source,w.file,v.plugin):b=new l(u,C===void 0?g:{column:S,line:g},C===void 0?S:{column:y,line:C},this.css,this.file,v.plugin),b.input={column:S,endColumn:y,endLine:C,line:g,source:this.css},this.file&&(a&&(b.input.url=a(this.file).toString()),b.input.file=this.file),b}fromOffset(u){let g,S;if(this[i])S=this[i];else{let b=this.css.split(`\n`);S=new Array(b.length);let C=0;for(let y=0,w=b.length;y<w;y++)S[y]=C,C+=b[y].length+1;this[i]=S}g=S[S.length-1];let v=0;if(u>=g)v=S.length-1;else{let b=S.length-2,C;for(;v<b;)if(C=v+(b-v>>1),u<S[C])b=C-1;else if(u>=S[C+1])v=C+1;else{v=C;break}}return{col:u-S[v]+1,line:v+1}}mapResolve(u){return/^\\w+:\\/\\//.test(u)?u:c(this.map.consumer().sourceRoot||this.map.root||".",u)}origin(u,g,S,v){if(!this.map)return!1;let b=this.map.consumer(),C=b.originalPositionFor({column:g,line:u});if(!C.source)return!1;let y;typeof S=="number"&&(y=b.originalPositionFor({column:v,line:S}));let w;r(C.source)?w=a(C.source):w=new URL(C.source,this.map.consumer().sourceRoot||a(this.map.mapFile));let E={column:C.column,endColumn:y&&y.column,endLine:y&&y.line,line:C.line,url:w.toString()};if(w.protocol==="file:")if(s)E.file=s(w);else throw new Error("file: protocol is not available in this PostCSS build");let R=b.sourceContentFor(C.source);return R&&(E.source=R),E}toJSON(){let u={};for(let g of["hasBOM","css","file","id"])this[g]!=null&&(u[g]=this[g]);return this.map&&(u.map={...this.map},u.map.consumerCache&&(u.map.consumerCache=void 0)),u}get from(){return this.file||this.id}}return _t=n,n.default=n,m&&m.registerInput&&m.registerInput(n),_t}var Pt,Ms;function ji(){if(Ms)return Pt;Ms=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=de,{dirname:s,relative:a,resolve:r,sep:c}=de,{pathToFileURL:f}=de,m=pt(),l=!!(e&&t),d=!!(s&&r&&a&&c);class i{constructor(o,n,p,u){this.stringify=o,this.mapOpts=p.map||{},this.root=n,this.opts=p,this.css=u,this.originalCSS=u,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let o;this.isInline()?o="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?o=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?o=this.mapOpts.annotation(this.opts.to,this.root):o=this.outputFile()+".map";let n=`\n`;this.css.includes(`\\r\n`)&&(n=`\\r\n`),this.css+=n+"/*# sourceMappingURL="+o+" */"}applyPrevMaps(){for(let o of this.previous()){let n=this.toUrl(this.path(o.file)),p=o.root||s(o.file),u;this.mapOpts.sourcesContent===!1?(u=new e(o.text),u.sourcesContent&&(u.sourcesContent=null)):u=o.consumer(),this.map.applySourceMap(u,n,this.toUrl(this.path(p)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let o;for(let n=this.root.nodes.length-1;n>=0;n--)o=this.root.nodes[n],o.type==="comment"&&o.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(n)}else this.css&&(this.css=this.css.replace(/\\n*?\\/\\*#[\\S\\s]*?\\*\\/$/gm,""))}generate(){if(this.clearAnnotation(),d&&l&&this.isMap())return this.generateMap();{let o="";return this.stringify(this.root,n=>{o+=n}),[o]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let o=this.previous()[0].consumer();o.file=this.outputFile(),this.map=t.fromSourceMap(o,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<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 t({file:this.outputFile(),ignoreInvalidMapping:!0});let o=1,n=1,p="<no source>",u={generated:{column:0,line:0},original:{column:0,line:0},source:""},g,S;this.stringify(this.root,(v,b,C)=>{if(this.css+=v,b&&C!=="end"&&(u.generated.line=o,u.generated.column=n-1,b.source&&b.source.start?(u.source=this.sourcePath(b),u.original.line=b.source.start.line,u.original.column=b.source.start.column-1,this.map.addMapping(u)):(u.source=p,u.original.line=1,u.original.column=0,this.map.addMapping(u))),g=v.match(/\\n/g),g?(o+=g.length,S=v.lastIndexOf(`\n`),n=v.length-S):n+=v.length,b&&C!=="start"){let y=b.parent||{raws:{}};(!(b.type==="decl"||b.type==="atrule"&&!b.nodes)||b!==y.last||y.raws.semicolon)&&(b.source&&b.source.end?(u.source=this.sourcePath(b),u.original.line=b.source.end.line,u.original.column=b.source.end.column-1,u.generated.line=o,u.generated.column=n-2,this.map.addMapping(u)):(u.source=p,u.original.line=1,u.original.column=0,u.generated.line=o,u.generated.column=n-1,this.map.addMapping(u)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(o=>o.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let o=this.mapOpts.annotation;return typeof o<"u"&&o!==!0?!1:this.previous().length?this.previous().some(n=>n.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(o=>o.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(o){if(this.mapOpts.absolute||o.charCodeAt(0)===60||/^\\w+:\\/\\//.test(o))return o;let n=this.memoizedPaths.get(o);if(n)return n;let p=this.opts.to?s(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(p=s(r(p,this.mapOpts.annotation)));let u=a(p,o);return this.memoizedPaths.set(o,u),u}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(o=>{if(o.source&&o.source.input.map){let n=o.source.input.map;this.previousMaps.includes(n)||this.previousMaps.push(n)}});else{let o=new m(this.originalCSS,this.opts);o.map&&this.previousMaps.push(o.map)}return this.previousMaps}setSourcesContent(){let o={};if(this.root)this.root.walk(n=>{if(n.source){let p=n.source.input.from;if(p&&!o[p]){o[p]=!0;let u=this.usesFileUrls?this.toFileUrl(p):this.toUrl(this.path(p));this.map.setSourceContent(u,n.source.input.css)}}});else if(this.css){let n=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(n,this.css)}}sourcePath(o){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(o.source.input.from):this.toUrl(this.path(o.source.input.from))}toBase64(o){return Buffer?Buffer.from(o).toString("base64"):window.btoa(unescape(encodeURIComponent(o)))}toFileUrl(o){let n=this.memoizedFileURLs.get(o);if(n)return n;if(f){let p=f(o).toString();return this.memoizedFileURLs.set(o,p),p}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(o){let n=this.memoizedURLs.get(o);if(n)return n;c==="\\\\"&&(o=o.replace(/\\\\/g,"/"));let p=encodeURI(o).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(o,p),p}}return Pt=i,Pt}var kt,Ns;function mt(){if(Ns)return kt;Ns=1;let e=ft();class t extends e{constructor(a){super(a),this.type="comment"}}return kt=t,t.default=t,kt}var Lt,Os;function xe(){if(Os)return Lt;Os=1;let{isClean:e,my:t}=Yr(),s=dt(),a=mt(),r=ft(),c,f,m,l;function d(o){return o.map(n=>(n.nodes&&(n.nodes=d(n.nodes)),delete n.source,n))}function i(o){if(o[e]=!1,o.proxyOf.nodes)for(let n of o.proxyOf.nodes)i(n)}class h extends r{append(...n){for(let p of n){let u=this.normalize(p,this.last);for(let g of u)this.proxyOf.nodes.push(g)}return this.markDirty(),this}cleanRaws(n){if(super.cleanRaws(n),this.nodes)for(let p of this.nodes)p.cleanRaws(n)}each(n){if(!this.proxyOf.nodes)return;let p=this.getIterator(),u,g;for(;this.indexes[p]<this.proxyOf.nodes.length&&(u=this.indexes[p],g=n(this.proxyOf.nodes[u],u),g!==!1);)this.indexes[p]+=1;return delete this.indexes[p],g}every(n){return this.nodes.every(n)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let n=this.lastEach;return this.indexes[n]=0,n}getProxyProcessor(){return{get(n,p){return p==="proxyOf"?n:n[p]?p==="each"||typeof p=="string"&&p.startsWith("walk")?(...u)=>n[p](...u.map(g=>typeof g=="function"?(S,v)=>g(S.toProxy(),v):g)):p==="every"||p==="some"?u=>n[p]((g,...S)=>u(g.toProxy(),...S)):p==="root"?()=>n.root().toProxy():p==="nodes"?n.nodes.map(u=>u.toProxy()):p==="first"||p==="last"?n[p].toProxy():n[p]:n[p]},set(n,p,u){return n[p]===u||(n[p]=u,(p==="name"||p==="params"||p==="selector")&&n.markDirty()),!0}}}index(n){return typeof n=="number"?n:(n.proxyOf&&(n=n.proxyOf),this.proxyOf.nodes.indexOf(n))}insertAfter(n,p){let u=this.index(n),g=this.normalize(p,this.proxyOf.nodes[u]).reverse();u=this.index(n);for(let v of g)this.proxyOf.nodes.splice(u+1,0,v);let S;for(let v in this.indexes)S=this.indexes[v],u<S&&(this.indexes[v]=S+g.length);return this.markDirty(),this}insertBefore(n,p){let u=this.index(n),g=u===0?"prepend":!1,S=this.normalize(p,this.proxyOf.nodes[u],g).reverse();u=this.index(n);for(let b of S)this.proxyOf.nodes.splice(u,0,b);let v;for(let b in this.indexes)v=this.indexes[b],u<=v&&(this.indexes[b]=v+S.length);return this.markDirty(),this}normalize(n,p){if(typeof n=="string")n=d(c(n).nodes);else if(typeof n>"u")n=[];else if(Array.isArray(n)){n=n.slice(0);for(let g of n)g.parent&&g.parent.removeChild(g,"ignore")}else if(n.type==="root"&&this.type!=="document"){n=n.nodes.slice(0);for(let g of n)g.parent&&g.parent.removeChild(g,"ignore")}else if(n.type)n=[n];else if(n.prop){if(typeof n.value>"u")throw new Error("Value field is missed in node creation");typeof n.value!="string"&&(n.value=String(n.value)),n=[new s(n)]}else if(n.selector)n=[new f(n)];else if(n.name)n=[new m(n)];else if(n.text)n=[new a(n)];else throw new Error("Unknown node type in node creation");return n.map(g=>(g[t]||h.rebuild(g),g=g.proxyOf,g.parent&&g.parent.removeChild(g),g[e]&&i(g),typeof g.raws.before>"u"&&p&&typeof p.raws.before<"u"&&(g.raws.before=p.raws.before.replace(/\\S/g,"")),g.parent=this.proxyOf,g))}prepend(...n){n=n.reverse();for(let p of n){let u=this.normalize(p,this.first,"prepend").reverse();for(let g of u)this.proxyOf.nodes.unshift(g);for(let g in this.indexes)this.indexes[g]=this.indexes[g]+u.length}return this.markDirty(),this}push(n){return n.parent=this,this.proxyOf.nodes.push(n),this}removeAll(){for(let n of this.proxyOf.nodes)n.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(n){n=this.index(n),this.proxyOf.nodes[n].parent=void 0,this.proxyOf.nodes.splice(n,1);let p;for(let u in this.indexes)p=this.indexes[u],p>=n&&(this.indexes[u]=p-1);return this.markDirty(),this}replaceValues(n,p,u){return u||(u=p,p={}),this.walkDecls(g=>{p.props&&!p.props.includes(g.prop)||p.fast&&!g.value.includes(p.fast)||(g.value=g.value.replace(n,u))}),this.markDirty(),this}some(n){return this.nodes.some(n)}walk(n){return this.each((p,u)=>{let g;try{g=n(p,u)}catch(S){throw p.addToError(S)}return g!==!1&&p.walk&&(g=p.walk(n)),g})}walkAtRules(n,p){return p?n instanceof RegExp?this.walk((u,g)=>{if(u.type==="atrule"&&n.test(u.name))return p(u,g)}):this.walk((u,g)=>{if(u.type==="atrule"&&u.name===n)return p(u,g)}):(p=n,this.walk((u,g)=>{if(u.type==="atrule")return p(u,g)}))}walkComments(n){return this.walk((p,u)=>{if(p.type==="comment")return n(p,u)})}walkDecls(n,p){return p?n instanceof RegExp?this.walk((u,g)=>{if(u.type==="decl"&&n.test(u.prop))return p(u,g)}):this.walk((u,g)=>{if(u.type==="decl"&&u.prop===n)return p(u,g)}):(p=n,this.walk((u,g)=>{if(u.type==="decl")return p(u,g)}))}walkRules(n,p){return p?n instanceof RegExp?this.walk((u,g)=>{if(u.type==="rule"&&n.test(u.selector))return p(u,g)}):this.walk((u,g)=>{if(u.type==="rule"&&u.selector===n)return p(u,g)}):(p=n,this.walk((u,g)=>{if(u.type==="rule")return p(u,g)}))}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]}}return h.registerParse=o=>{c=o},h.registerRule=o=>{f=o},h.registerAtRule=o=>{m=o},h.registerRoot=o=>{l=o},Lt=h,h.default=h,h.rebuild=o=>{o.type==="atrule"?Object.setPrototypeOf(o,m.prototype):o.type==="rule"?Object.setPrototypeOf(o,f.prototype):o.type==="decl"?Object.setPrototypeOf(o,s.prototype):o.type==="comment"?Object.setPrototypeOf(o,a.prototype):o.type==="root"&&Object.setPrototypeOf(o,l.prototype),o[t]=!0,o.nodes&&o.nodes.forEach(n=>{h.rebuild(n)})},Lt}var Ft,Is;function Jr(){if(Is)return Ft;Is=1;let e=xe(),t,s;class a extends e{constructor(c){super({type:"document",...c}),this.nodes||(this.nodes=[])}toResult(c={}){return new t(new s,this,c).stringify()}}return a.registerLazyResult=r=>{t=r},a.registerProcessor=r=>{s=r},Ft=a,a.default=a,Ft}var Ut,As;function Gi(){if(As)return Ut;As=1;let e={};return Ut=function(s){e[s]||(e[s]=!0,typeof console<"u"&&console.warn&&console.warn(s))},Ut}var $t,Ds;function Hi(){if(Ds)return $t;Ds=1;class e{constructor(s,a={}){if(this.type="warning",this.text=s,a.node&&a.node.source){let r=a.node.rangeBy(a);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in a)this[r]=a[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}}return $t=e,e.default=e,$t}var Bt,Ts;function Xr(){if(Ts)return Bt;Ts=1;let e=Hi();class t{constructor(a,r,c){this.processor=a,this.messages=[],this.root=r,this.opts=c,this.css=void 0,this.map=void 0}toString(){return this.css}warn(a,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let c=new e(a,r);return this.messages.push(c),c}warnings(){return this.messages.filter(a=>a.type==="warning")}get content(){return this.css}}return Bt=t,t.default=t,Bt}var Wt,_s;function To(){if(_s)return Wt;_s=1;let e=39,t=34,s=92,a=47,r=10,c=32,f=12,m=9,l=13,d=91,i=93,h=40,o=41,n=123,p=125,u=59,g=42,S=58,v=64,b=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/g,C=/[\\t\\n\\f\\r !"#\'():;@[\\\\\\]{}]|\\/(?=\\*)/g,y=/.[\\r\\n"\'(/\\\\]/,w=/[\\da-f]/i;return Wt=function(R,O={}){let M=R.css.valueOf(),P=O.ignoreErrors,A,x,fe,ie,$,U,G,Z,H,B,be=M.length,N=0,me=[],le=[];function ke(){return N}function K(D){throw R.error("Unclosed "+D,N)}function ne(){return le.length===0&&N>=be}function Ee(D){if(le.length)return le.pop();if(N>=be)return;let Y=D?D.ignoreUnclosed:!1;switch(A=M.charCodeAt(N),A){case r:case c:case m:case l:case f:{x=N;do x+=1,A=M.charCodeAt(x);while(A===c||A===r||A===m||A===l||A===f);B=["space",M.slice(N,x)],N=x-1;break}case d:case i:case n:case p:case S:case u:case o:{let _=String.fromCharCode(A);B=[_,_,N];break}case h:{if(Z=me.length?me.pop()[1]:"",H=M.charCodeAt(N+1),Z==="url"&&H!==e&&H!==t&&H!==c&&H!==r&&H!==m&&H!==f&&H!==l){x=N;do{if(U=!1,x=M.indexOf(")",x+1),x===-1)if(P||Y){x=N;break}else K("bracket");for(G=x;M.charCodeAt(G-1)===s;)G-=1,U=!U}while(U);B=["brackets",M.slice(N,x+1),N,x],N=x}else x=M.indexOf(")",N+1),ie=M.slice(N,x+1),x===-1||y.test(ie)?B=["(","(",N]:(B=["brackets",ie,N,x],N=x);break}case e:case t:{fe=A===e?"\'":\'"\',x=N;do{if(U=!1,x=M.indexOf(fe,x+1),x===-1)if(P||Y){x=N+1;break}else K("string");for(G=x;M.charCodeAt(G-1)===s;)G-=1,U=!U}while(U);B=["string",M.slice(N,x+1),N,x],N=x;break}case v:{b.lastIndex=N+1,b.test(M),b.lastIndex===0?x=M.length-1:x=b.lastIndex-2,B=["at-word",M.slice(N,x+1),N,x],N=x;break}case s:{for(x=N,$=!0;M.charCodeAt(x+1)===s;)x+=1,$=!$;if(A=M.charCodeAt(x+1),$&&A!==a&&A!==c&&A!==r&&A!==m&&A!==l&&A!==f&&(x+=1,w.test(M.charAt(x)))){for(;w.test(M.charAt(x+1));)x+=1;M.charCodeAt(x+1)===c&&(x+=1)}B=["word",M.slice(N,x+1),N,x],N=x;break}default:{A===a&&M.charCodeAt(N+1)===g?(x=M.indexOf("*/",N+2)+1,x===0&&(P||Y?x=M.length:K("comment")),B=["comment",M.slice(N,x+1),N,x],N=x):(C.lastIndex=N+1,C.test(M),C.lastIndex===0?x=M.length-1:x=C.lastIndex-2,B=["word",M.slice(N,x+1),N,x],me.push(B),N=x);break}}return N++,B}function ge(D){le.push(D)}return{back:ge,endOfFile:ne,nextToken:Ee,position:ke}},Wt}var zt,Ps;function Qr(){if(Ps)return zt;Ps=1;let e=xe();class t extends e{constructor(a){super(a),this.type="atrule"}append(...a){return this.proxyOf.nodes||(this.nodes=[]),super.append(...a)}prepend(...a){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...a)}}return zt=t,t.default=t,e.registerAtRule(t),zt}var qt,ks;function je(){if(ks)return qt;ks=1;let e=xe(),t,s;class a extends e{constructor(c){super(c),this.type="root",this.nodes||(this.nodes=[])}normalize(c,f,m){let l=super.normalize(c);if(f){if(m==="prepend")this.nodes.length>1?f.raws.before=this.nodes[1].raws.before:delete f.raws.before;else if(this.first!==f)for(let d of l)d.raws.before=f.raws.before}return l}removeChild(c,f){let m=this.index(c);return!f&&m===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[m].raws.before),super.removeChild(c)}toResult(c={}){return new t(new s,this,c).stringify()}}return a.registerLazyResult=r=>{t=r},a.registerProcessor=r=>{s=r},qt=a,a.default=a,e.registerRoot(a),qt}var Vt,Ls;function Yi(){if(Ls)return Vt;Ls=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let s=[" ",`\n`," "];return e.split(t,s)},split(t,s,a){let r=[],c="",f=!1,m=0,l=!1,d="",i=!1;for(let h of t)i?i=!1:h==="\\\\"?i=!0:l?h===d&&(l=!1):h===\'"\'||h==="\'"?(l=!0,d=h):h==="("?m+=1:h===")"?m>0&&(m-=1):m===0&&s.includes(h)&&(f=!0),f?(c!==""&&r.push(c.trim()),c="",f=!1):c+=h;return(a||c!=="")&&r.push(c.trim()),r}};return Vt=e,e.default=e,Vt}var jt,Fs;function Zr(){if(Fs)return jt;Fs=1;let e=xe(),t=Yi();class s extends e{constructor(r){super(r),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(r){let c=this.selector?this.selector.match(/,\\s*/):null,f=c?c[0]:","+this.raw("between","beforeOpen");this.selector=r.join(f)}}return jt=s,s.default=s,e.registerRule(s),jt}var Gt,Us;function _o(){if(Us)return Gt;Us=1;let e=dt(),t=To(),s=mt(),a=Qr(),r=je(),c=Zr(),f={empty:!0,space:!0};function m(d){for(let i=d.length-1;i>=0;i--){let h=d[i],o=h[3]||h[2];if(o)return o}}class l{constructor(i){this.input=i,this.root=new r,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:i,start:{column:1,line:1,offset:0}}}atrule(i){let h=new a;h.name=i[1].slice(1),h.name===""&&this.unnamedAtrule(h,i),this.init(h,i[2]);let o,n,p,u=!1,g=!1,S=[],v=[];for(;!this.tokenizer.endOfFile();){if(i=this.tokenizer.nextToken(),o=i[0],o==="("||o==="["?v.push(o==="("?")":"]"):o==="{"&&v.length>0?v.push("}"):o===v[v.length-1]&&v.pop(),v.length===0)if(o===";"){h.source.end=this.getPosition(i[2]),h.source.end.offset++,this.semicolon=!0;break}else if(o==="{"){g=!0;break}else if(o==="}"){if(S.length>0){for(p=S.length-1,n=S[p];n&&n[0]==="space";)n=S[--p];n&&(h.source.end=this.getPosition(n[3]||n[2]),h.source.end.offset++)}this.end(i);break}else S.push(i);else S.push(i);if(this.tokenizer.endOfFile()){u=!0;break}}h.raws.between=this.spacesAndCommentsFromEnd(S),S.length?(h.raws.afterName=this.spacesAndCommentsFromStart(S),this.raw(h,"params",S),u&&(i=S[S.length-1],h.source.end=this.getPosition(i[3]||i[2]),h.source.end.offset++,this.spaces=h.raws.between,h.raws.between="")):(h.raws.afterName="",h.params=""),g&&(h.nodes=[],this.current=h)}checkMissedSemicolon(i){let h=this.colon(i);if(h===!1)return;let o=0,n;for(let p=h-1;p>=0&&(n=i[p],!(n[0]!=="space"&&(o+=1,o===2)));p--);throw this.input.error("Missed semicolon",n[0]==="word"?n[3]+1:n[2])}colon(i){let h=0,o,n,p;for(let[u,g]of i.entries()){if(o=g,n=o[0],n==="("&&(h+=1),n===")"&&(h-=1),h===0&&n===":")if(!p)this.doubleColon(o);else{if(p[0]==="word"&&p[1]==="progid")continue;return u}p=o}return!1}comment(i){let h=new s;this.init(h,i[2]),h.source.end=this.getPosition(i[3]||i[2]),h.source.end.offset++;let o=i[1].slice(2,-2);if(/^\\s*$/.test(o))h.text="",h.raws.left=o,h.raws.right="";else{let n=o.match(/^(\\s*)([^]*\\S)(\\s*)$/);h.text=n[2],h.raws.left=n[1],h.raws.right=n[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(i,h){let o=new e;this.init(o,i[0][2]);let n=i[i.length-1];for(n[0]===";"&&(this.semicolon=!0,i.pop()),o.source.end=this.getPosition(n[3]||n[2]||m(i)),o.source.end.offset++;i[0][0]!=="word";)i.length===1&&this.unknownWord(i),o.raws.before+=i.shift()[1];for(o.source.start=this.getPosition(i[0][2]),o.prop="";i.length;){let v=i[0][0];if(v===":"||v==="space"||v==="comment")break;o.prop+=i.shift()[1]}o.raws.between="";let p;for(;i.length;)if(p=i.shift(),p[0]===":"){o.raws.between+=p[1];break}else p[0]==="word"&&/\\w/.test(p[1])&&this.unknownWord([p]),o.raws.between+=p[1];(o.prop[0]==="_"||o.prop[0]==="*")&&(o.raws.before+=o.prop[0],o.prop=o.prop.slice(1));let u=[],g;for(;i.length&&(g=i[0][0],!(g!=="space"&&g!=="comment"));)u.push(i.shift());this.precheckMissedSemicolon(i);for(let v=i.length-1;v>=0;v--){if(p=i[v],p[1].toLowerCase()==="!important"){o.important=!0;let b=this.stringFrom(i,v);b=this.spacesFromEnd(i)+b,b!==" !important"&&(o.raws.important=b);break}else if(p[1].toLowerCase()==="important"){let b=i.slice(0),C="";for(let y=v;y>0;y--){let w=b[y][0];if(C.trim().indexOf("!")===0&&w!=="space")break;C=b.pop()[1]+C}C.trim().indexOf("!")===0&&(o.important=!0,o.raws.important=C,i=b)}if(p[0]!=="space"&&p[0]!=="comment")break}i.some(v=>v[0]!=="space"&&v[0]!=="comment")&&(o.raws.between+=u.map(v=>v[1]).join(""),u=[]),this.raw(o,"value",u.concat(i),h),o.value.includes(":")&&!h&&this.checkMissedSemicolon(i)}doubleColon(i){throw this.input.error("Double colon",{offset:i[2]},{offset:i[2]+i[1].length})}emptyRule(i){let h=new c;this.init(h,i[2]),h.selector="",h.raws.between="",this.current=h}end(i){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(i[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(i)}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(i){if(this.spaces+=i[1],this.current.nodes){let h=this.current.nodes[this.current.nodes.length-1];h&&h.type==="rule"&&!h.raws.ownSemicolon&&(h.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(i){let h=this.input.fromOffset(i);return{column:h.col,line:h.line,offset:i}}init(i,h){this.current.push(i),i.source={input:this.input,start:this.getPosition(h)},i.raws.before=this.spaces,this.spaces="",i.type!=="comment"&&(this.semicolon=!1)}other(i){let h=!1,o=null,n=!1,p=null,u=[],g=i[1].startsWith("--"),S=[],v=i;for(;v;){if(o=v[0],S.push(v),o==="("||o==="[")p||(p=v),u.push(o==="("?")":"]");else if(g&&n&&o==="{")p||(p=v),u.push("}");else if(u.length===0)if(o===";")if(n){this.decl(S,g);return}else break;else if(o==="{"){this.rule(S);return}else if(o==="}"){this.tokenizer.back(S.pop()),h=!0;break}else o===":"&&(n=!0);else o===u[u.length-1]&&(u.pop(),u.length===0&&(p=null));v=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(h=!0),u.length>0&&this.unclosedBracket(p),h&&n){if(!g)for(;S.length&&(v=S[S.length-1][0],!(v!=="space"&&v!=="comment"));)this.tokenizer.back(S.pop());this.decl(S,g)}else this.unknownWord(S)}parse(){let i;for(;!this.tokenizer.endOfFile();)switch(i=this.tokenizer.nextToken(),i[0]){case"space":this.spaces+=i[1];break;case";":this.freeSemicolon(i);break;case"}":this.end(i);break;case"comment":this.comment(i);break;case"at-word":this.atrule(i);break;case"{":this.emptyRule(i);break;default:this.other(i);break}this.endFile()}precheckMissedSemicolon(){}raw(i,h,o,n){let p,u,g=o.length,S="",v=!0,b,C;for(let y=0;y<g;y+=1)p=o[y],u=p[0],u==="space"&&y===g-1&&!n?v=!1:u==="comment"?(C=o[y-1]?o[y-1][0]:"empty",b=o[y+1]?o[y+1][0]:"empty",!f[C]&&!f[b]?S.slice(-1)===","?v=!1:S+=p[1]:v=!1):S+=p[1];if(!v){let y=o.reduce((w,E)=>w+E[1],"");i.raws[h]={raw:y,value:S}}i[h]=S}rule(i){i.pop();let h=new c;this.init(h,i[0][2]),h.raws.between=this.spacesAndCommentsFromEnd(i),this.raw(h,"selector",i),this.current=h}spacesAndCommentsFromEnd(i){let h,o="";for(;i.length&&(h=i[i.length-1][0],!(h!=="space"&&h!=="comment"));)o=i.pop()[1]+o;return o}spacesAndCommentsFromStart(i){let h,o="";for(;i.length&&(h=i[0][0],!(h!=="space"&&h!=="comment"));)o+=i.shift()[1];return o}spacesFromEnd(i){let h,o="";for(;i.length&&(h=i[i.length-1][0],h==="space");)o=i.pop()[1]+o;return o}stringFrom(i,h){let o="";for(let n=h;n<i.length;n++)o+=i[n][1];return i.splice(h,i.length-h),o}unclosedBlock(){let i=this.current.source.start;throw this.input.error("Unclosed block",i.line,i.column)}unclosedBracket(i){throw this.input.error("Unclosed bracket",{offset:i[2]},{offset:i[2]+1})}unexpectedClose(i){throw this.input.error("Unexpected }",{offset:i[2]},{offset:i[2]+1})}unknownWord(i){throw this.input.error("Unknown word",{offset:i[0][2]},{offset:i[0][2]+i[0][1].length})}unnamedAtrule(i,h){throw this.input.error("At-rule without name",{offset:h[2]},{offset:h[2]+h[1].length})}}return Gt=l,Gt}var Ht,$s;function Kr(){if($s)return Ht;$s=1;let e=xe(),t=_o(),s=pt();function a(r,c){let f=new s(r,c),m=new t(f);try{m.parse()}catch(l){throw l}return m.root}return Ht=a,a.default=a,e.registerParse(a),Ht}var Yt,Bs;function Ji(){if(Bs)return Yt;Bs=1;let{isClean:e,my:t}=Yr(),s=ji(),a=ht(),r=xe(),c=Jr(),f=Gi(),m=Xr(),l=Kr(),d=je(),i={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={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},o={Once:!0,postcssPlugin:!0,prepare:!0},n=0;function p(C){return typeof C=="object"&&typeof C.then=="function"}function u(C){let y=!1,w=i[C.type];return C.type==="decl"?y=C.prop.toLowerCase():C.type==="atrule"&&(y=C.name.toLowerCase()),y&&C.append?[w,w+"-"+y,n,w+"Exit",w+"Exit-"+y]:y?[w,w+"-"+y,w+"Exit",w+"Exit-"+y]:C.append?[w,n,w+"Exit"]:[w,w+"Exit"]}function g(C){let y;return C.type==="document"?y=["Document",n,"DocumentExit"]:C.type==="root"?y=["Root",n,"RootExit"]:y=u(C),{eventIndex:0,events:y,iterator:0,node:C,visitorIndex:0,visitors:[]}}function S(C){return C[e]=!1,C.nodes&&C.nodes.forEach(y=>S(y)),C}let v={};class b{constructor(y,w,E){this.stringified=!1,this.processed=!1;let R;if(typeof w=="object"&&w!==null&&(w.type==="root"||w.type==="document"))R=S(w);else if(w instanceof b||w instanceof m)R=S(w.root),w.map&&(typeof E.map>"u"&&(E.map={}),E.map.inline||(E.map.inline=!1),E.map.prev=w.map);else{let O=l;E.syntax&&(O=E.syntax.parse),E.parser&&(O=E.parser),O.parse&&(O=O.parse);try{R=O(w,E)}catch(M){this.processed=!0,this.error=M}R&&!R[t]&&r.rebuild(R)}this.result=new m(y,R,E),this.helpers={...v,postcss:v,result:this.result},this.plugins=this.processor.plugins.map(O=>typeof O=="object"&&O.prepare?{...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(y){return this.async().catch(y)}finally(y){return this.async().then(y,y)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(y,w){let E=this.result.lastPlugin;try{w&&w.addToError(y),this.error=y,y.name==="CssSyntaxError"&&!y.plugin?(y.plugin=E.postcssPlugin,y.setMessage()):E.postcssVersion}catch(R){console&&console.error&&console.error(R)}return y}prepareVisitors(){this.listeners={};let y=(w,E,R)=>{this.listeners[E]||(this.listeners[E]=[]),this.listeners[E].push([w,R])};for(let w of this.plugins)if(typeof w=="object")for(let E in w){if(!h[E]&&/^[A-Z]/.test(E))throw new Error(`Unknown event ${E} in ${w.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!o[E])if(typeof w[E]=="object")for(let R in w[E])R==="*"?y(w,E,w[E][R]):y(w,E+"-"+R.toLowerCase(),w[E][R]);else typeof w[E]=="function"&&y(w,E,w[E])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let y=0;y<this.plugins.length;y++){let w=this.plugins[y],E=this.runOnRoot(w);if(p(E))try{await E}catch(R){throw this.handleError(R)}}if(this.prepareVisitors(),this.hasListener){let y=this.result.root;for(;!y[e];){y[e]=!0;let w=[g(y)];for(;w.length>0;){let E=this.visitTick(w);if(p(E))try{await E}catch(R){let O=w[w.length-1].node;throw this.handleError(R,O)}}}if(this.listeners.OnceExit)for(let[w,E]of this.listeners.OnceExit){this.result.lastPlugin=w;try{if(y.type==="document"){let R=y.nodes.map(O=>E(O,this.helpers));await Promise.all(R)}else await E(y,this.helpers)}catch(R){throw this.handleError(R)}}}return this.processed=!0,this.stringify()}runOnRoot(y){this.result.lastPlugin=y;try{if(typeof y=="object"&&y.Once){if(this.result.root.type==="document"){let w=this.result.root.nodes.map(E=>y.Once(E,this.helpers));return p(w[0])?Promise.all(w):w}return y.Once(this.result.root,this.helpers)}else if(typeof y=="function")return y(this.result.root,this.result)}catch(w){throw this.handleError(w)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let y=this.result.opts,w=a;y.syntax&&(w=y.syntax.stringify),y.stringifier&&(w=y.stringifier),w.stringify&&(w=w.stringify);let R=new s(w,this.result.root,this.result.opts).generate();return this.result.css=R[0],this.result.map=R[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 y of this.plugins){let w=this.runOnRoot(y);if(p(w))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let y=this.result.root;for(;!y[e];)y[e]=!0,this.walkSync(y);if(this.listeners.OnceExit)if(y.type==="document")for(let w of y.nodes)this.visitSync(this.listeners.OnceExit,w);else this.visitSync(this.listeners.OnceExit,y)}return this.result}then(y,w){return this.async().then(y,w)}toString(){return this.css}visitSync(y,w){for(let[E,R]of y){this.result.lastPlugin=E;let O;try{O=R(w,this.helpers)}catch(M){throw this.handleError(M,w.proxyOf)}if(w.type!=="root"&&w.type!=="document"&&!w.parent)return!0;if(p(O))throw this.getAsyncError()}}visitTick(y){let w=y[y.length-1],{node:E,visitors:R}=w;if(E.type!=="root"&&E.type!=="document"&&!E.parent){y.pop();return}if(R.length>0&&w.visitorIndex<R.length){let[M,P]=R[w.visitorIndex];w.visitorIndex+=1,w.visitorIndex===R.length&&(w.visitors=[],w.visitorIndex=0),this.result.lastPlugin=M;try{return P(E.toProxy(),this.helpers)}catch(A){throw this.handleError(A,E)}}if(w.iterator!==0){let M=w.iterator,P;for(;P=E.nodes[E.indexes[M]];)if(E.indexes[M]+=1,!P[e]){P[e]=!0,y.push(g(P));return}w.iterator=0,delete E.indexes[M]}let O=w.events;for(;w.eventIndex<O.length;){let M=O[w.eventIndex];if(w.eventIndex+=1,M===n){E.nodes&&E.nodes.length&&(E[e]=!0,w.iterator=E.getIterator());return}else if(this.listeners[M]){w.visitors=this.listeners[M];return}}y.pop()}walkSync(y){y[e]=!0;let w=u(y);for(let E of w)if(E===n)y.nodes&&y.each(R=>{R[e]||this.walkSync(R)});else{let R=this.listeners[E];if(R&&this.visitSync(R,y.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return b.registerPostcss=C=>{v=C},Yt=b,b.default=b,d.registerLazyResult(b),c.registerLazyResult(b),Yt}var Jt,Ws;function Po(){if(Ws)return Jt;Ws=1;let e=ji(),t=ht(),s=Gi(),a=Kr(),r=Xr();class c{constructor(m,l,d){l=l.toString(),this.stringified=!1,this._processor=m,this._css=l,this._opts=d,this._map=void 0;let i,h=t;this.result=new r(this._processor,i,this._opts),this.result.css=l;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let n=new e(h,i,this._opts,l);if(n.isMap()){let[p,u]=n.generate();p&&(this.result.css=p),u&&(this.result.map=u)}else n.clearAnnotation(),this.result.css=n.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(m){return this.async().catch(m)}finally(m){return this.async().then(m,m)}sync(){if(this.error)throw this.error;return this.result}then(m,l){return this.async().then(m,l)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let m,l=a;try{m=l(this._css,this._opts)}catch(d){this.error=d}if(this.error)throw this.error;return this._root=m,m}get[Symbol.toStringTag](){return"NoWorkResult"}}return Jt=c,c.default=c,Jt}var Xt,zs;function ko(){if(zs)return Xt;zs=1;let e=Po(),t=Ji(),s=Jr(),a=je();class r{constructor(f=[]){this.version="8.4.38",this.plugins=this.normalize(f)}normalize(f){let m=[];for(let l of f)if(l.postcss===!0?l=l():l.postcss&&(l=l.postcss),typeof l=="object"&&Array.isArray(l.plugins))m=m.concat(l.plugins);else if(typeof l=="object"&&l.postcssPlugin)m.push(l);else if(typeof l=="function")m.push(l);else if(!(typeof l=="object"&&(l.parse||l.stringify)))throw new Error(l+" is not a PostCSS plugin");return m}process(f,m={}){return!this.plugins.length&&!m.parser&&!m.stringifier&&!m.syntax?new e(this,f,m):new t(this,f,m)}use(f){return this.plugins=this.plugins.concat(this.normalize([f])),this}}return Xt=r,r.default=r,a.registerProcessor(r),s.registerProcessor(r),Xt}var Qt,qs;function Lo(){if(qs)return Qt;qs=1;let e=dt(),t=Vi(),s=mt(),a=Qr(),r=pt(),c=je(),f=Zr();function m(l,d){if(Array.isArray(l))return l.map(o=>m(o));let{inputs:i,...h}=l;if(i){d=[];for(let o of i){let n={...o,__proto__:r.prototype};n.map&&(n.map={...n.map,__proto__:t.prototype}),d.push(n)}}if(h.nodes&&(h.nodes=l.nodes.map(o=>m(o,d))),h.source){let{inputId:o,...n}=h.source;h.source=n,o!=null&&(h.source.input=d[o])}if(h.type==="root")return new c(h);if(h.type==="decl")return new e(h);if(h.type==="rule")return new f(h);if(h.type==="comment")return new s(h);if(h.type==="atrule")return new a(h);throw new Error("Unknown node type: "+l.type)}return Qt=m,m.default=m,Qt}var Zt,Vs;function Fo(){if(Vs)return Zt;Vs=1;let e=Hr(),t=dt(),s=Ji(),a=xe(),r=ko(),c=ht(),f=Lo(),m=Jr(),l=Hi(),d=mt(),i=Qr(),h=Xr(),o=pt(),n=Kr(),p=Yi(),u=Zr(),g=je(),S=ft();function v(...b){return b.length===1&&Array.isArray(b[0])&&(b=b[0]),new r(b)}return v.plugin=function(C,y){let w=!1;function E(...O){console&&console.warn&&!w&&(w=!0,console.warn(C+`: postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(C+`: \\u91CC\\u9762 postcss.plugin \\u88AB\\u5F03\\u7528. \\u8FC1\\u79FB\\u6307\\u5357:\nhttps://www.w3ctech.com/topic/2226`));let M=y(...O);return M.postcssPlugin=C,M.postcssVersion=new r().version,M}let R;return Object.defineProperty(E,"postcss",{get(){return R||(R=E()),R}}),E.process=function(O,M,P){return v([E(P)]).process(O,M)},E},v.stringify=c,v.parse=n,v.fromJSON=f,v.list=p,v.comment=b=>new d(b),v.atRule=b=>new i(b),v.decl=b=>new t(b),v.rule=b=>new u(b),v.root=b=>new g(b),v.document=b=>new m(b),v.CssSyntaxError=e,v.Declaration=t,v.Container=a,v.Processor=r,v.Document=m,v.Comment=d,v.Warning=l,v.AtRule=i,v.Result=h,v.Input=o,v.Rule=u,v.Root=g,v.Node=S,s.registerPostcss(v),Zt=v,v.default=v,Zt}var Uo=Fo(),q=Mo(Uo);q.stringify;q.fromJSON;q.plugin;q.parse;q.list;q.document;q.comment;q.atRule;q.rule;q.decl;q.root;q.CssSyntaxError;q.Declaration;q.Container;q.Processor;q.Document;q.Comment;q.Warning;q.AtRule;q.Result;q.Input;q.Rule;q.Root;q.Node;var $o=Object.defineProperty,Bo=(e,t,s)=>t in e?$o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,ce=(e,t,s)=>Bo(e,typeof t!="symbol"?t+"":t,s);var Wo=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Wo=()=>new Date().getTime());function zo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function qo(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var s=function a(){return this instanceof a?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(s,a,r.get?r:{enumerable:!0,get:function(){return e[a]}})}),s}var Qe={exports:{}},js;function Vo(){if(js)return Qe.exports;js=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return Qe.exports=t(),Qe.exports.createColors=t,Qe.exports}var jo={},Go=Object.freeze(Object.defineProperty({__proto__:null,default:jo},Symbol.toStringTag,{value:"Module"})),pe=qo(Go),Kt,Gs;function es(){if(Gs)return Kt;Gs=1;let e=Vo(),t=pe;class s extends Error{constructor(r,c,f,m,l,d){super(r),this.name="CssSyntaxError",this.reason=r,l&&(this.file=l),m&&(this.source=m),d&&(this.plugin=d),typeof c<"u"&&typeof f<"u"&&(typeof c=="number"?(this.line=c,this.column=f):(this.line=c.line,this.column=c.column,this.endLine=f.line,this.endColumn=f.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,s)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(r){if(!this.source)return"";let c=this.source;r==null&&(r=e.isColorSupported),t&&r&&(c=t(c));let f=c.split(/\\r?\\n/),m=Math.max(this.line-3,0),l=Math.min(this.line+2,f.length),d=String(l).length,i,h;if(r){let{bold:o,gray:n,red:p}=e.createColors(!0);i=u=>o(p(u)),h=u=>n(u)}else i=h=o=>o;return f.slice(m,l).map((o,n)=>{let p=m+1+n,u=" "+(" "+p).slice(-d)+" | ";if(p===this.line){let g=h(u.replace(/\\d/g," "))+o.slice(0,this.column-1).replace(/[^\\t]/g," ");return i(">")+h(u)+o+`\n `+g+i("^")}return" "+h(u)+o}).join(`\n`)}toString(){let r=this.showSourceCode();return r&&(r=`\n\n`+r+`\n`),this.name+": "+this.message+r}}return Kt=s,s.default=s,Kt}var Ze={},Hs;function ts(){return Hs||(Hs=1,Ze.isClean=Symbol("isClean"),Ze.my=Symbol("my")),Ze}var er,Ys;function Xi(){if(Ys)return er;Ys=1;let e={after:`\n`,beforeClose:`\n`,beforeComment:`\n`,beforeDecl:`\n`,beforeOpen:" ",beforeRule:`\n`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function t(a){return a[0].toUpperCase()+a.slice(1)}class s{constructor(r){this.builder=r}atrule(r,c){let f="@"+r.name,m=r.params?this.rawValue(r,"params"):"";if(typeof r.raws.afterName<"u"?f+=r.raws.afterName:m&&(f+=" "),r.nodes)this.block(r,f+m);else{let l=(r.raws.between||"")+(c?";":"");this.builder(f+m+l,r)}}beforeAfter(r,c){let f;r.type==="decl"?f=this.raw(r,null,"beforeDecl"):r.type==="comment"?f=this.raw(r,null,"beforeComment"):c==="before"?f=this.raw(r,null,"beforeRule"):f=this.raw(r,null,"beforeClose");let m=r.parent,l=0;for(;m&&m.type!=="root";)l+=1,m=m.parent;if(f.includes(`\n`)){let d=this.raw(r,null,"indent");if(d.length)for(let i=0;i<l;i++)f+=d}return f}block(r,c){let f=this.raw(r,"between","beforeOpen");this.builder(c+f+"{",r,"start");let m;r.nodes&&r.nodes.length?(this.body(r),m=this.raw(r,"after")):m=this.raw(r,"after","emptyBody"),m&&this.builder(m),this.builder("}",r,"end")}body(r){let c=r.nodes.length-1;for(;c>0&&r.nodes[c].type==="comment";)c-=1;let f=this.raw(r,"semicolon");for(let m=0;m<r.nodes.length;m++){let l=r.nodes[m],d=this.raw(l,"before");d&&this.builder(d),this.stringify(l,c!==m||f)}}comment(r){let c=this.raw(r,"left","commentLeft"),f=this.raw(r,"right","commentRight");this.builder("/*"+c+r.text+f+"*/",r)}decl(r,c){let f=this.raw(r,"between","colon"),m=r.prop+f+this.rawValue(r,"value");r.important&&(m+=r.raws.important||" !important"),c&&(m+=";"),this.builder(m,r)}document(r){this.body(r)}raw(r,c,f){let m;if(f||(f=c),c&&(m=r.raws[c],typeof m<"u"))return m;let l=r.parent;if(f==="before"&&(!l||l.type==="root"&&l.first===r||l&&l.type==="document"))return"";if(!l)return e[f];let d=r.root();if(d.rawCache||(d.rawCache={}),typeof d.rawCache[f]<"u")return d.rawCache[f];if(f==="before"||f==="after")return this.beforeAfter(r,f);{let i="raw"+t(f);this[i]?m=this[i](d,r):d.walk(h=>{if(m=h.raws[c],typeof m<"u")return!1})}return typeof m>"u"&&(m=e[f]),d.rawCache[f]=m,m}rawBeforeClose(r){let c;return r.walk(f=>{if(f.nodes&&f.nodes.length>0&&typeof f.raws.after<"u")return c=f.raws.after,c.includes(`\n`)&&(c=c.replace(/[^\\n]+$/,"")),!1}),c&&(c=c.replace(/\\S/g,"")),c}rawBeforeComment(r,c){let f;return r.walkComments(m=>{if(typeof m.raws.before<"u")return f=m.raws.before,f.includes(`\n`)&&(f=f.replace(/[^\\n]+$/,"")),!1}),typeof f>"u"?f=this.raw(c,null,"beforeDecl"):f&&(f=f.replace(/\\S/g,"")),f}rawBeforeDecl(r,c){let f;return r.walkDecls(m=>{if(typeof m.raws.before<"u")return f=m.raws.before,f.includes(`\n`)&&(f=f.replace(/[^\\n]+$/,"")),!1}),typeof f>"u"?f=this.raw(c,null,"beforeRule"):f&&(f=f.replace(/\\S/g,"")),f}rawBeforeOpen(r){let c;return r.walk(f=>{if(f.type!=="decl"&&(c=f.raws.between,typeof c<"u"))return!1}),c}rawBeforeRule(r){let c;return r.walk(f=>{if(f.nodes&&(f.parent!==r||r.first!==f)&&typeof f.raws.before<"u")return c=f.raws.before,c.includes(`\n`)&&(c=c.replace(/[^\\n]+$/,"")),!1}),c&&(c=c.replace(/\\S/g,"")),c}rawColon(r){let c;return r.walkDecls(f=>{if(typeof f.raws.between<"u")return c=f.raws.between.replace(/[^\\s:]/g,""),!1}),c}rawEmptyBody(r){let c;return r.walk(f=>{if(f.nodes&&f.nodes.length===0&&(c=f.raws.after,typeof c<"u"))return!1}),c}rawIndent(r){if(r.raws.indent)return r.raws.indent;let c;return r.walk(f=>{let m=f.parent;if(m&&m!==r&&m.parent&&m.parent===r&&typeof f.raws.before<"u"){let l=f.raws.before.split(`\n`);return c=l[l.length-1],c=c.replace(/\\S/g,""),!1}}),c}rawSemicolon(r){let c;return r.walk(f=>{if(f.nodes&&f.nodes.length&&f.last.type==="decl"&&(c=f.raws.semicolon,typeof c<"u"))return!1}),c}rawValue(r,c){let f=r[c],m=r.raws[c];return m&&m.value===f?m.raw:f}root(r){this.body(r),r.raws.after&&this.builder(r.raws.after)}rule(r){this.block(r,this.rawValue(r,"selector")),r.raws.ownSemicolon&&this.builder(r.raws.ownSemicolon,r,"end")}stringify(r,c){if(!this[r.type])throw new Error("Unknown AST node type "+r.type+". Maybe you need to change PostCSS stringifier.");this[r.type](r,c)}}return er=s,s.default=s,er}var tr,Js;function gt(){if(Js)return tr;Js=1;let e=Xi();function t(s,a){new e(a).stringify(s)}return tr=t,t.default=t,tr}var rr,Xs;function yt(){if(Xs)return rr;Xs=1;let{isClean:e,my:t}=ts(),s=es(),a=Xi(),r=gt();function c(m,l){let d=new m.constructor;for(let i in m){if(!Object.prototype.hasOwnProperty.call(m,i)||i==="proxyCache")continue;let h=m[i],o=typeof h;i==="parent"&&o==="object"?l&&(d[i]=l):i==="source"?d[i]=h:Array.isArray(h)?d[i]=h.map(n=>c(n,d)):(o==="object"&&h!==null&&(h=c(h)),d[i]=h)}return d}class f{constructor(l={}){this.raws={},this[e]=!1,this[t]=!0;for(let d in l)if(d==="nodes"){this.nodes=[];for(let i of l[d])typeof i.clone=="function"?this.append(i.clone()):this.append(i)}else this[d]=l[d]}addToError(l){if(l.postcssNode=this,l.stack&&this.source&&/\\n\\s{4}at /.test(l.stack)){let d=this.source;l.stack=l.stack.replace(/\\n\\s{4}at /,`$&${d.input.from}:${d.start.line}:${d.start.column}$&`)}return l}after(l){return this.parent.insertAfter(this,l),this}assign(l={}){for(let d in l)this[d]=l[d];return this}before(l){return this.parent.insertBefore(this,l),this}cleanRaws(l){delete this.raws.before,delete this.raws.after,l||delete this.raws.between}clone(l={}){let d=c(this);for(let i in l)d[i]=l[i];return d}cloneAfter(l={}){let d=this.clone(l);return this.parent.insertAfter(this,d),d}cloneBefore(l={}){let d=this.clone(l);return this.parent.insertBefore(this,d),d}error(l,d={}){if(this.source){let{end:i,start:h}=this.rangeBy(d);return this.source.input.error(l,{column:h.column,line:h.line},{column:i.column,line:i.line},d)}return new s(l)}getProxyProcessor(){return{get(l,d){return d==="proxyOf"?l:d==="root"?()=>l.root().toProxy():l[d]},set(l,d,i){return l[d]===i||(l[d]=i,(d==="prop"||d==="value"||d==="name"||d==="params"||d==="important"||d==="text")&&l.markDirty()),!0}}}markDirty(){if(this[e]){this[e]=!1;let l=this;for(;l=l.parent;)l[e]=!1}}next(){if(!this.parent)return;let l=this.parent.index(this);return this.parent.nodes[l+1]}positionBy(l,d){let i=this.source.start;if(l.index)i=this.positionInside(l.index,d);else if(l.word){d=this.toString();let h=d.indexOf(l.word);h!==-1&&(i=this.positionInside(h,d))}return i}positionInside(l,d){let i=d||this.toString(),h=this.source.start.column,o=this.source.start.line;for(let n=0;n<l;n++)i[n]===`\n`?(h=1,o+=1):h+=1;return{column:h,line:o}}prev(){if(!this.parent)return;let l=this.parent.index(this);return this.parent.nodes[l-1]}rangeBy(l){let d={column:this.source.start.column,line:this.source.start.line},i=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:d.column+1,line:d.line};if(l.word){let h=this.toString(),o=h.indexOf(l.word);o!==-1&&(d=this.positionInside(o,h),i=this.positionInside(o+l.word.length,h))}else l.start?d={column:l.start.column,line:l.start.line}:l.index&&(d=this.positionInside(l.index)),l.end?i={column:l.end.column,line:l.end.line}:typeof l.endIndex=="number"?i=this.positionInside(l.endIndex):l.index&&(i=this.positionInside(l.index+1));return(i.line<d.line||i.line===d.line&&i.column<=d.column)&&(i={column:d.column+1,line:d.line}),{end:i,start:d}}raw(l,d){return new a().raw(this,l,d)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...l){if(this.parent){let d=this,i=!1;for(let h of l)h===this?i=!0:i?(this.parent.insertAfter(d,h),d=h):this.parent.insertBefore(d,h);i||this.remove()}return this}root(){let l=this;for(;l.parent&&l.parent.type!=="document";)l=l.parent;return l}toJSON(l,d){let i={},h=d==null;d=d||new Map;let o=0;for(let n in this){if(!Object.prototype.hasOwnProperty.call(this,n)||n==="parent"||n==="proxyCache")continue;let p=this[n];if(Array.isArray(p))i[n]=p.map(u=>typeof u=="object"&&u.toJSON?u.toJSON(null,d):u);else if(typeof p=="object"&&p.toJSON)i[n]=p.toJSON(null,d);else if(n==="source"){let u=d.get(p.input);u==null&&(u=o,d.set(p.input,o),o++),i[n]={end:p.end,inputId:u,start:p.start}}else i[n]=p}return h&&(i.inputs=[...d.keys()].map(n=>n.toJSON())),i}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(l=r){l.stringify&&(l=l.stringify);let d="";return l(this,i=>{d+=i}),d}warn(l,d,i){let h={node:this};for(let o in i)h[o]=i[o];return l.warn(d,h)}get proxyOf(){return this}}return rr=f,f.default=f,rr}var sr,Qs;function wt(){if(Qs)return sr;Qs=1;let e=yt();class t extends e{constructor(a){a&&typeof a.value<"u"&&typeof a.value!="string"&&(a={...a,value:String(a.value)}),super(a),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}}return sr=t,t.default=t,sr}var ir,Zs;function Ho(){if(Zs)return ir;Zs=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return ir={nanoid:(a=21)=>{let r="",c=a;for(;c--;)r+=e[Math.random()*64|0];return r},customAlphabet:(a,r=21)=>(c=r)=>{let f="",m=c;for(;m--;)f+=a[Math.random()*a.length|0];return f}},ir}var nr,Ks;function Qi(){if(Ks)return nr;Ks=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=pe,{existsSync:s,readFileSync:a}=pe,{dirname:r,join:c}=pe;function f(l){return Buffer?Buffer.from(l,"base64").toString():window.atob(l)}class m{constructor(d,i){if(i.map===!1)return;this.loadAnnotation(d),this.inline=this.startWith(this.annotation,"data:");let h=i.map?i.map.prev:void 0,o=this.loadMap(i.from,h);!this.mapFile&&i.from&&(this.mapFile=i.from),this.mapFile&&(this.root=r(this.mapFile)),o&&(this.text=o)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(d){let i=/^data:application\\/json;charset=utf-?8;base64,/,h=/^data:application\\/json;base64,/,o=/^data:application\\/json;charset=utf-?8,/,n=/^data:application\\/json,/;if(o.test(d)||n.test(d))return decodeURIComponent(d.substr(RegExp.lastMatch.length));if(i.test(d)||h.test(d))return f(d.substr(RegExp.lastMatch.length));let p=d.match(/data:application\\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+p)}getAnnotationURL(d){return d.replace(/^\\/\\*\\s*# sourceMappingURL=/,"").trim()}isMap(d){return typeof d!="object"?!1:typeof d.mappings=="string"||typeof d._mappings=="string"||Array.isArray(d.sections)}loadAnnotation(d){let i=d.match(/\\/\\*\\s*# sourceMappingURL=/gm);if(!i)return;let h=d.lastIndexOf(i.pop()),o=d.indexOf("*/",h);h>-1&&o>-1&&(this.annotation=this.getAnnotationURL(d.substring(h,o)))}loadFile(d){if(this.root=r(d),s(d))return this.mapFile=d,a(d,"utf-8").toString().trim()}loadMap(d,i){if(i===!1)return!1;if(i){if(typeof i=="string")return i;if(typeof i=="function"){let h=i(d);if(h){let o=this.loadFile(h);if(!o)throw new Error("Unable to load previous source map: "+h.toString());return o}}else{if(i instanceof e)return t.fromSourceMap(i).toString();if(i instanceof t)return i.toString();if(this.isMap(i))return JSON.stringify(i);throw new Error("Unsupported previous source map format: "+i.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let h=this.annotation;return d&&(h=c(r(d),h)),this.loadFile(h)}}}startWith(d,i){return d?d.substr(0,i.length)===i:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return nr=m,m.default=m,nr}var or,ei;function bt(){if(ei)return or;ei=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=pe,{fileURLToPath:s,pathToFileURL:a}=pe,{isAbsolute:r,resolve:c}=pe,{nanoid:f}=Ho(),m=pe,l=es(),d=Qi(),i=Symbol("fromOffsetCache"),h=!!(e&&t),o=!!(c&&r);class n{constructor(u,g={}){if(u===null||typeof u>"u"||typeof u=="object"&&!u.toString)throw new Error(`PostCSS received ${u} instead of CSS string`);if(this.css=u.toString(),this.css[0]==="\\uFEFF"||this.css[0]==="\\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,g.from&&(!o||/^\\w+:\\/\\//.test(g.from)||r(g.from)?this.file=g.from:this.file=c(g.from)),o&&h){let S=new d(this.css,g);if(S.text){this.map=S;let v=S.consumer().file;!this.file&&v&&(this.file=this.mapResolve(v))}}this.file||(this.id="<input css "+f(6)+">"),this.map&&(this.map.file=this.from)}error(u,g,S,v={}){let b,C,y;if(g&&typeof g=="object"){let E=g,R=S;if(typeof E.offset=="number"){let O=this.fromOffset(E.offset);g=O.line,S=O.col}else g=E.line,S=E.column;if(typeof R.offset=="number"){let O=this.fromOffset(R.offset);C=O.line,y=O.col}else C=R.line,y=R.column}else if(!S){let E=this.fromOffset(g);g=E.line,S=E.col}let w=this.origin(g,S,C,y);return w?b=new l(u,w.endLine===void 0?w.line:{column:w.column,line:w.line},w.endLine===void 0?w.column:{column:w.endColumn,line:w.endLine},w.source,w.file,v.plugin):b=new l(u,C===void 0?g:{column:S,line:g},C===void 0?S:{column:y,line:C},this.css,this.file,v.plugin),b.input={column:S,endColumn:y,endLine:C,line:g,source:this.css},this.file&&(a&&(b.input.url=a(this.file).toString()),b.input.file=this.file),b}fromOffset(u){let g,S;if(this[i])S=this[i];else{let b=this.css.split(`\n`);S=new Array(b.length);let C=0;for(let y=0,w=b.length;y<w;y++)S[y]=C,C+=b[y].length+1;this[i]=S}g=S[S.length-1];let v=0;if(u>=g)v=S.length-1;else{let b=S.length-2,C;for(;v<b;)if(C=v+(b-v>>1),u<S[C])b=C-1;else if(u>=S[C+1])v=C+1;else{v=C;break}}return{col:u-S[v]+1,line:v+1}}mapResolve(u){return/^\\w+:\\/\\//.test(u)?u:c(this.map.consumer().sourceRoot||this.map.root||".",u)}origin(u,g,S,v){if(!this.map)return!1;let b=this.map.consumer(),C=b.originalPositionFor({column:g,line:u});if(!C.source)return!1;let y;typeof S=="number"&&(y=b.originalPositionFor({column:v,line:S}));let w;r(C.source)?w=a(C.source):w=new URL(C.source,this.map.consumer().sourceRoot||a(this.map.mapFile));let E={column:C.column,endColumn:y&&y.column,endLine:y&&y.line,line:C.line,url:w.toString()};if(w.protocol==="file:")if(s)E.file=s(w);else throw new Error("file: protocol is not available in this PostCSS build");let R=b.sourceContentFor(C.source);return R&&(E.source=R),E}toJSON(){let u={};for(let g of["hasBOM","css","file","id"])this[g]!=null&&(u[g]=this[g]);return this.map&&(u.map={...this.map},u.map.consumerCache&&(u.map.consumerCache=void 0)),u}get from(){return this.file||this.id}}return or=n,n.default=n,m&&m.registerInput&&m.registerInput(n),or}var ar,ti;function Zi(){if(ti)return ar;ti=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=pe,{dirname:s,relative:a,resolve:r,sep:c}=pe,{pathToFileURL:f}=pe,m=bt(),l=!!(e&&t),d=!!(s&&r&&a&&c);class i{constructor(o,n,p,u){this.stringify=o,this.mapOpts=p.map||{},this.root=n,this.opts=p,this.css=u,this.originalCSS=u,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let o;this.isInline()?o="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?o=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?o=this.mapOpts.annotation(this.opts.to,this.root):o=this.outputFile()+".map";let n=`\n`;this.css.includes(`\\r\n`)&&(n=`\\r\n`),this.css+=n+"/*# sourceMappingURL="+o+" */"}applyPrevMaps(){for(let o of this.previous()){let n=this.toUrl(this.path(o.file)),p=o.root||s(o.file),u;this.mapOpts.sourcesContent===!1?(u=new e(o.text),u.sourcesContent&&(u.sourcesContent=null)):u=o.consumer(),this.map.applySourceMap(u,n,this.toUrl(this.path(p)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let o;for(let n=this.root.nodes.length-1;n>=0;n--)o=this.root.nodes[n],o.type==="comment"&&o.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(n)}else this.css&&(this.css=this.css.replace(/\\n*?\\/\\*#[\\S\\s]*?\\*\\/$/gm,""))}generate(){if(this.clearAnnotation(),d&&l&&this.isMap())return this.generateMap();{let o="";return this.stringify(this.root,n=>{o+=n}),[o]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let o=this.previous()[0].consumer();o.file=this.outputFile(),this.map=t.fromSourceMap(o,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<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 t({file:this.outputFile(),ignoreInvalidMapping:!0});let o=1,n=1,p="<no source>",u={generated:{column:0,line:0},original:{column:0,line:0},source:""},g,S;this.stringify(this.root,(v,b,C)=>{if(this.css+=v,b&&C!=="end"&&(u.generated.line=o,u.generated.column=n-1,b.source&&b.source.start?(u.source=this.sourcePath(b),u.original.line=b.source.start.line,u.original.column=b.source.start.column-1,this.map.addMapping(u)):(u.source=p,u.original.line=1,u.original.column=0,this.map.addMapping(u))),g=v.match(/\\n/g),g?(o+=g.length,S=v.lastIndexOf(`\n`),n=v.length-S):n+=v.length,b&&C!=="start"){let y=b.parent||{raws:{}};(!(b.type==="decl"||b.type==="atrule"&&!b.nodes)||b!==y.last||y.raws.semicolon)&&(b.source&&b.source.end?(u.source=this.sourcePath(b),u.original.line=b.source.end.line,u.original.column=b.source.end.column-1,u.generated.line=o,u.generated.column=n-2,this.map.addMapping(u)):(u.source=p,u.original.line=1,u.original.column=0,u.generated.line=o,u.generated.column=n-1,this.map.addMapping(u)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(o=>o.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let o=this.mapOpts.annotation;return typeof o<"u"&&o!==!0?!1:this.previous().length?this.previous().some(n=>n.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(o=>o.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(o){if(this.mapOpts.absolute||o.charCodeAt(0)===60||/^\\w+:\\/\\//.test(o))return o;let n=this.memoizedPaths.get(o);if(n)return n;let p=this.opts.to?s(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(p=s(r(p,this.mapOpts.annotation)));let u=a(p,o);return this.memoizedPaths.set(o,u),u}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(o=>{if(o.source&&o.source.input.map){let n=o.source.input.map;this.previousMaps.includes(n)||this.previousMaps.push(n)}});else{let o=new m(this.originalCSS,this.opts);o.map&&this.previousMaps.push(o.map)}return this.previousMaps}setSourcesContent(){let o={};if(this.root)this.root.walk(n=>{if(n.source){let p=n.source.input.from;if(p&&!o[p]){o[p]=!0;let u=this.usesFileUrls?this.toFileUrl(p):this.toUrl(this.path(p));this.map.setSourceContent(u,n.source.input.css)}}});else if(this.css){let n=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(n,this.css)}}sourcePath(o){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(o.source.input.from):this.toUrl(this.path(o.source.input.from))}toBase64(o){return Buffer?Buffer.from(o).toString("base64"):window.btoa(unescape(encodeURIComponent(o)))}toFileUrl(o){let n=this.memoizedFileURLs.get(o);if(n)return n;if(f){let p=f(o).toString();return this.memoizedFileURLs.set(o,p),p}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(o){let n=this.memoizedURLs.get(o);if(n)return n;c==="\\\\"&&(o=o.replace(/\\\\/g,"/"));let p=encodeURI(o).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(o,p),p}}return ar=i,ar}var lr,ri;function vt(){if(ri)return lr;ri=1;let e=yt();class t extends e{constructor(a){super(a),this.type="comment"}}return lr=t,t.default=t,lr}var ur,si;function Re(){if(si)return ur;si=1;let{isClean:e,my:t}=ts(),s=wt(),a=vt(),r=yt(),c,f,m,l;function d(o){return o.map(n=>(n.nodes&&(n.nodes=d(n.nodes)),delete n.source,n))}function i(o){if(o[e]=!1,o.proxyOf.nodes)for(let n of o.proxyOf.nodes)i(n)}class h extends r{append(...n){for(let p of n){let u=this.normalize(p,this.last);for(let g of u)this.proxyOf.nodes.push(g)}return this.markDirty(),this}cleanRaws(n){if(super.cleanRaws(n),this.nodes)for(let p of this.nodes)p.cleanRaws(n)}each(n){if(!this.proxyOf.nodes)return;let p=this.getIterator(),u,g;for(;this.indexes[p]<this.proxyOf.nodes.length&&(u=this.indexes[p],g=n(this.proxyOf.nodes[u],u),g!==!1);)this.indexes[p]+=1;return delete this.indexes[p],g}every(n){return this.nodes.every(n)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let n=this.lastEach;return this.indexes[n]=0,n}getProxyProcessor(){return{get(n,p){return p==="proxyOf"?n:n[p]?p==="each"||typeof p=="string"&&p.startsWith("walk")?(...u)=>n[p](...u.map(g=>typeof g=="function"?(S,v)=>g(S.toProxy(),v):g)):p==="every"||p==="some"?u=>n[p]((g,...S)=>u(g.toProxy(),...S)):p==="root"?()=>n.root().toProxy():p==="nodes"?n.nodes.map(u=>u.toProxy()):p==="first"||p==="last"?n[p].toProxy():n[p]:n[p]},set(n,p,u){return n[p]===u||(n[p]=u,(p==="name"||p==="params"||p==="selector")&&n.markDirty()),!0}}}index(n){return typeof n=="number"?n:(n.proxyOf&&(n=n.proxyOf),this.proxyOf.nodes.indexOf(n))}insertAfter(n,p){let u=this.index(n),g=this.normalize(p,this.proxyOf.nodes[u]).reverse();u=this.index(n);for(let v of g)this.proxyOf.nodes.splice(u+1,0,v);let S;for(let v in this.indexes)S=this.indexes[v],u<S&&(this.indexes[v]=S+g.length);return this.markDirty(),this}insertBefore(n,p){let u=this.index(n),g=u===0?"prepend":!1,S=this.normalize(p,this.proxyOf.nodes[u],g).reverse();u=this.index(n);for(let b of S)this.proxyOf.nodes.splice(u,0,b);let v;for(let b in this.indexes)v=this.indexes[b],u<=v&&(this.indexes[b]=v+S.length);return this.markDirty(),this}normalize(n,p){if(typeof n=="string")n=d(c(n).nodes);else if(typeof n>"u")n=[];else if(Array.isArray(n)){n=n.slice(0);for(let g of n)g.parent&&g.parent.removeChild(g,"ignore")}else if(n.type==="root"&&this.type!=="document"){n=n.nodes.slice(0);for(let g of n)g.parent&&g.parent.removeChild(g,"ignore")}else if(n.type)n=[n];else if(n.prop){if(typeof n.value>"u")throw new Error("Value field is missed in node creation");typeof n.value!="string"&&(n.value=String(n.value)),n=[new s(n)]}else if(n.selector)n=[new f(n)];else if(n.name)n=[new m(n)];else if(n.text)n=[new a(n)];else throw new Error("Unknown node type in node creation");return n.map(g=>(g[t]||h.rebuild(g),g=g.proxyOf,g.parent&&g.parent.removeChild(g),g[e]&&i(g),typeof g.raws.before>"u"&&p&&typeof p.raws.before<"u"&&(g.raws.before=p.raws.before.replace(/\\S/g,"")),g.parent=this.proxyOf,g))}prepend(...n){n=n.reverse();for(let p of n){let u=this.normalize(p,this.first,"prepend").reverse();for(let g of u)this.proxyOf.nodes.unshift(g);for(let g in this.indexes)this.indexes[g]=this.indexes[g]+u.length}return this.markDirty(),this}push(n){return n.parent=this,this.proxyOf.nodes.push(n),this}removeAll(){for(let n of this.proxyOf.nodes)n.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(n){n=this.index(n),this.proxyOf.nodes[n].parent=void 0,this.proxyOf.nodes.splice(n,1);let p;for(let u in this.indexes)p=this.indexes[u],p>=n&&(this.indexes[u]=p-1);return this.markDirty(),this}replaceValues(n,p,u){return u||(u=p,p={}),this.walkDecls(g=>{p.props&&!p.props.includes(g.prop)||p.fast&&!g.value.includes(p.fast)||(g.value=g.value.replace(n,u))}),this.markDirty(),this}some(n){return this.nodes.some(n)}walk(n){return this.each((p,u)=>{let g;try{g=n(p,u)}catch(S){throw p.addToError(S)}return g!==!1&&p.walk&&(g=p.walk(n)),g})}walkAtRules(n,p){return p?n instanceof RegExp?this.walk((u,g)=>{if(u.type==="atrule"&&n.test(u.name))return p(u,g)}):this.walk((u,g)=>{if(u.type==="atrule"&&u.name===n)return p(u,g)}):(p=n,this.walk((u,g)=>{if(u.type==="atrule")return p(u,g)}))}walkComments(n){return this.walk((p,u)=>{if(p.type==="comment")return n(p,u)})}walkDecls(n,p){return p?n instanceof RegExp?this.walk((u,g)=>{if(u.type==="decl"&&n.test(u.prop))return p(u,g)}):this.walk((u,g)=>{if(u.type==="decl"&&u.prop===n)return p(u,g)}):(p=n,this.walk((u,g)=>{if(u.type==="decl")return p(u,g)}))}walkRules(n,p){return p?n instanceof RegExp?this.walk((u,g)=>{if(u.type==="rule"&&n.test(u.selector))return p(u,g)}):this.walk((u,g)=>{if(u.type==="rule"&&u.selector===n)return p(u,g)}):(p=n,this.walk((u,g)=>{if(u.type==="rule")return p(u,g)}))}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]}}return h.registerParse=o=>{c=o},h.registerRule=o=>{f=o},h.registerAtRule=o=>{m=o},h.registerRoot=o=>{l=o},ur=h,h.default=h,h.rebuild=o=>{o.type==="atrule"?Object.setPrototypeOf(o,m.prototype):o.type==="rule"?Object.setPrototypeOf(o,f.prototype):o.type==="decl"?Object.setPrototypeOf(o,s.prototype):o.type==="comment"?Object.setPrototypeOf(o,a.prototype):o.type==="root"&&Object.setPrototypeOf(o,l.prototype),o[t]=!0,o.nodes&&o.nodes.forEach(n=>{h.rebuild(n)})},ur}var cr,ii;function rs(){if(ii)return cr;ii=1;let e=Re(),t,s;class a extends e{constructor(c){super({type:"document",...c}),this.nodes||(this.nodes=[])}toResult(c={}){return new t(new s,this,c).stringify()}}return a.registerLazyResult=r=>{t=r},a.registerProcessor=r=>{s=r},cr=a,a.default=a,cr}var hr,ni;function Ki(){if(ni)return hr;ni=1;let e={};return hr=function(s){e[s]||(e[s]=!0,typeof console<"u"&&console.warn&&console.warn(s))},hr}var fr,oi;function en(){if(oi)return fr;oi=1;class e{constructor(s,a={}){if(this.type="warning",this.text=s,a.node&&a.node.source){let r=a.node.rangeBy(a);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in a)this[r]=a[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}}return fr=e,e.default=e,fr}var dr,ai;function ss(){if(ai)return dr;ai=1;let e=en();class t{constructor(a,r,c){this.processor=a,this.messages=[],this.root=r,this.opts=c,this.css=void 0,this.map=void 0}toString(){return this.css}warn(a,r={}){r.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(r.plugin=this.lastPlugin.postcssPlugin);let c=new e(a,r);return this.messages.push(c),c}warnings(){return this.messages.filter(a=>a.type==="warning")}get content(){return this.css}}return dr=t,t.default=t,dr}var pr,li;function Yo(){if(li)return pr;li=1;let e=39,t=34,s=92,a=47,r=10,c=32,f=12,m=9,l=13,d=91,i=93,h=40,o=41,n=123,p=125,u=59,g=42,S=58,v=64,b=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/g,C=/[\\t\\n\\f\\r !"#\'():;@[\\\\\\]{}]|\\/(?=\\*)/g,y=/.[\\r\\n"\'(/\\\\]/,w=/[\\da-f]/i;return pr=function(R,O={}){let M=R.css.valueOf(),P=O.ignoreErrors,A,x,fe,ie,$,U,G,Z,H,B,be=M.length,N=0,me=[],le=[];function ke(){return N}function K(D){throw R.error("Unclosed "+D,N)}function ne(){return le.length===0&&N>=be}function Ee(D){if(le.length)return le.pop();if(N>=be)return;let Y=D?D.ignoreUnclosed:!1;switch(A=M.charCodeAt(N),A){case r:case c:case m:case l:case f:{x=N;do x+=1,A=M.charCodeAt(x);while(A===c||A===r||A===m||A===l||A===f);B=["space",M.slice(N,x)],N=x-1;break}case d:case i:case n:case p:case S:case u:case o:{let _=String.fromCharCode(A);B=[_,_,N];break}case h:{if(Z=me.length?me.pop()[1]:"",H=M.charCodeAt(N+1),Z==="url"&&H!==e&&H!==t&&H!==c&&H!==r&&H!==m&&H!==f&&H!==l){x=N;do{if(U=!1,x=M.indexOf(")",x+1),x===-1)if(P||Y){x=N;break}else K("bracket");for(G=x;M.charCodeAt(G-1)===s;)G-=1,U=!U}while(U);B=["brackets",M.slice(N,x+1),N,x],N=x}else x=M.indexOf(")",N+1),ie=M.slice(N,x+1),x===-1||y.test(ie)?B=["(","(",N]:(B=["brackets",ie,N,x],N=x);break}case e:case t:{fe=A===e?"\'":\'"\',x=N;do{if(U=!1,x=M.indexOf(fe,x+1),x===-1)if(P||Y){x=N+1;break}else K("string");for(G=x;M.charCodeAt(G-1)===s;)G-=1,U=!U}while(U);B=["string",M.slice(N,x+1),N,x],N=x;break}case v:{b.lastIndex=N+1,b.test(M),b.lastIndex===0?x=M.length-1:x=b.lastIndex-2,B=["at-word",M.slice(N,x+1),N,x],N=x;break}case s:{for(x=N,$=!0;M.charCodeAt(x+1)===s;)x+=1,$=!$;if(A=M.charCodeAt(x+1),$&&A!==a&&A!==c&&A!==r&&A!==m&&A!==l&&A!==f&&(x+=1,w.test(M.charAt(x)))){for(;w.test(M.charAt(x+1));)x+=1;M.charCodeAt(x+1)===c&&(x+=1)}B=["word",M.slice(N,x+1),N,x],N=x;break}default:{A===a&&M.charCodeAt(N+1)===g?(x=M.indexOf("*/",N+2)+1,x===0&&(P||Y?x=M.length:K("comment")),B=["comment",M.slice(N,x+1),N,x],N=x):(C.lastIndex=N+1,C.test(M),C.lastIndex===0?x=M.length-1:x=C.lastIndex-2,B=["word",M.slice(N,x+1),N,x],me.push(B),N=x);break}}return N++,B}function ge(D){le.push(D)}return{back:ge,endOfFile:ne,nextToken:Ee,position:ke}},pr}var mr,ui;function is(){if(ui)return mr;ui=1;let e=Re();class t extends e{constructor(a){super(a),this.type="atrule"}append(...a){return this.proxyOf.nodes||(this.nodes=[]),super.append(...a)}prepend(...a){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...a)}}return mr=t,t.default=t,e.registerAtRule(t),mr}var gr,ci;function Ge(){if(ci)return gr;ci=1;let e=Re(),t,s;class a extends e{constructor(c){super(c),this.type="root",this.nodes||(this.nodes=[])}normalize(c,f,m){let l=super.normalize(c);if(f){if(m==="prepend")this.nodes.length>1?f.raws.before=this.nodes[1].raws.before:delete f.raws.before;else if(this.first!==f)for(let d of l)d.raws.before=f.raws.before}return l}removeChild(c,f){let m=this.index(c);return!f&&m===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[m].raws.before),super.removeChild(c)}toResult(c={}){return new t(new s,this,c).stringify()}}return a.registerLazyResult=r=>{t=r},a.registerProcessor=r=>{s=r},gr=a,a.default=a,e.registerRoot(a),gr}var yr,hi;function tn(){if(hi)return yr;hi=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let s=[" ",`\n`," "];return e.split(t,s)},split(t,s,a){let r=[],c="",f=!1,m=0,l=!1,d="",i=!1;for(let h of t)i?i=!1:h==="\\\\"?i=!0:l?h===d&&(l=!1):h===\'"\'||h==="\'"?(l=!0,d=h):h==="("?m+=1:h===")"?m>0&&(m-=1):m===0&&s.includes(h)&&(f=!0),f?(c!==""&&r.push(c.trim()),c="",f=!1):c+=h;return(a||c!=="")&&r.push(c.trim()),r}};return yr=e,e.default=e,yr}var wr,fi;function ns(){if(fi)return wr;fi=1;let e=Re(),t=tn();class s extends e{constructor(r){super(r),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(r){let c=this.selector?this.selector.match(/,\\s*/):null,f=c?c[0]:","+this.raw("between","beforeOpen");this.selector=r.join(f)}}return wr=s,s.default=s,e.registerRule(s),wr}var br,di;function Jo(){if(di)return br;di=1;let e=wt(),t=Yo(),s=vt(),a=is(),r=Ge(),c=ns(),f={empty:!0,space:!0};function m(d){for(let i=d.length-1;i>=0;i--){let h=d[i],o=h[3]||h[2];if(o)return o}}class l{constructor(i){this.input=i,this.root=new r,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:i,start:{column:1,line:1,offset:0}}}atrule(i){let h=new a;h.name=i[1].slice(1),h.name===""&&this.unnamedAtrule(h,i),this.init(h,i[2]);let o,n,p,u=!1,g=!1,S=[],v=[];for(;!this.tokenizer.endOfFile();){if(i=this.tokenizer.nextToken(),o=i[0],o==="("||o==="["?v.push(o==="("?")":"]"):o==="{"&&v.length>0?v.push("}"):o===v[v.length-1]&&v.pop(),v.length===0)if(o===";"){h.source.end=this.getPosition(i[2]),h.source.end.offset++,this.semicolon=!0;break}else if(o==="{"){g=!0;break}else if(o==="}"){if(S.length>0){for(p=S.length-1,n=S[p];n&&n[0]==="space";)n=S[--p];n&&(h.source.end=this.getPosition(n[3]||n[2]),h.source.end.offset++)}this.end(i);break}else S.push(i);else S.push(i);if(this.tokenizer.endOfFile()){u=!0;break}}h.raws.between=this.spacesAndCommentsFromEnd(S),S.length?(h.raws.afterName=this.spacesAndCommentsFromStart(S),this.raw(h,"params",S),u&&(i=S[S.length-1],h.source.end=this.getPosition(i[3]||i[2]),h.source.end.offset++,this.spaces=h.raws.between,h.raws.between="")):(h.raws.afterName="",h.params=""),g&&(h.nodes=[],this.current=h)}checkMissedSemicolon(i){let h=this.colon(i);if(h===!1)return;let o=0,n;for(let p=h-1;p>=0&&(n=i[p],!(n[0]!=="space"&&(o+=1,o===2)));p--);throw this.input.error("Missed semicolon",n[0]==="word"?n[3]+1:n[2])}colon(i){let h=0,o,n,p;for(let[u,g]of i.entries()){if(o=g,n=o[0],n==="("&&(h+=1),n===")"&&(h-=1),h===0&&n===":")if(!p)this.doubleColon(o);else{if(p[0]==="word"&&p[1]==="progid")continue;return u}p=o}return!1}comment(i){let h=new s;this.init(h,i[2]),h.source.end=this.getPosition(i[3]||i[2]),h.source.end.offset++;let o=i[1].slice(2,-2);if(/^\\s*$/.test(o))h.text="",h.raws.left=o,h.raws.right="";else{let n=o.match(/^(\\s*)([^]*\\S)(\\s*)$/);h.text=n[2],h.raws.left=n[1],h.raws.right=n[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(i,h){let o=new e;this.init(o,i[0][2]);let n=i[i.length-1];for(n[0]===";"&&(this.semicolon=!0,i.pop()),o.source.end=this.getPosition(n[3]||n[2]||m(i)),o.source.end.offset++;i[0][0]!=="word";)i.length===1&&this.unknownWord(i),o.raws.before+=i.shift()[1];for(o.source.start=this.getPosition(i[0][2]),o.prop="";i.length;){let v=i[0][0];if(v===":"||v==="space"||v==="comment")break;o.prop+=i.shift()[1]}o.raws.between="";let p;for(;i.length;)if(p=i.shift(),p[0]===":"){o.raws.between+=p[1];break}else p[0]==="word"&&/\\w/.test(p[1])&&this.unknownWord([p]),o.raws.between+=p[1];(o.prop[0]==="_"||o.prop[0]==="*")&&(o.raws.before+=o.prop[0],o.prop=o.prop.slice(1));let u=[],g;for(;i.length&&(g=i[0][0],!(g!=="space"&&g!=="comment"));)u.push(i.shift());this.precheckMissedSemicolon(i);for(let v=i.length-1;v>=0;v--){if(p=i[v],p[1].toLowerCase()==="!important"){o.important=!0;let b=this.stringFrom(i,v);b=this.spacesFromEnd(i)+b,b!==" !important"&&(o.raws.important=b);break}else if(p[1].toLowerCase()==="important"){let b=i.slice(0),C="";for(let y=v;y>0;y--){let w=b[y][0];if(C.trim().indexOf("!")===0&&w!=="space")break;C=b.pop()[1]+C}C.trim().indexOf("!")===0&&(o.important=!0,o.raws.important=C,i=b)}if(p[0]!=="space"&&p[0]!=="comment")break}i.some(v=>v[0]!=="space"&&v[0]!=="comment")&&(o.raws.between+=u.map(v=>v[1]).join(""),u=[]),this.raw(o,"value",u.concat(i),h),o.value.includes(":")&&!h&&this.checkMissedSemicolon(i)}doubleColon(i){throw this.input.error("Double colon",{offset:i[2]},{offset:i[2]+i[1].length})}emptyRule(i){let h=new c;this.init(h,i[2]),h.selector="",h.raws.between="",this.current=h}end(i){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(i[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(i)}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(i){if(this.spaces+=i[1],this.current.nodes){let h=this.current.nodes[this.current.nodes.length-1];h&&h.type==="rule"&&!h.raws.ownSemicolon&&(h.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(i){let h=this.input.fromOffset(i);return{column:h.col,line:h.line,offset:i}}init(i,h){this.current.push(i),i.source={input:this.input,start:this.getPosition(h)},i.raws.before=this.spaces,this.spaces="",i.type!=="comment"&&(this.semicolon=!1)}other(i){let h=!1,o=null,n=!1,p=null,u=[],g=i[1].startsWith("--"),S=[],v=i;for(;v;){if(o=v[0],S.push(v),o==="("||o==="[")p||(p=v),u.push(o==="("?")":"]");else if(g&&n&&o==="{")p||(p=v),u.push("}");else if(u.length===0)if(o===";")if(n){this.decl(S,g);return}else break;else if(o==="{"){this.rule(S);return}else if(o==="}"){this.tokenizer.back(S.pop()),h=!0;break}else o===":"&&(n=!0);else o===u[u.length-1]&&(u.pop(),u.length===0&&(p=null));v=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(h=!0),u.length>0&&this.unclosedBracket(p),h&&n){if(!g)for(;S.length&&(v=S[S.length-1][0],!(v!=="space"&&v!=="comment"));)this.tokenizer.back(S.pop());this.decl(S,g)}else this.unknownWord(S)}parse(){let i;for(;!this.tokenizer.endOfFile();)switch(i=this.tokenizer.nextToken(),i[0]){case"space":this.spaces+=i[1];break;case";":this.freeSemicolon(i);break;case"}":this.end(i);break;case"comment":this.comment(i);break;case"at-word":this.atrule(i);break;case"{":this.emptyRule(i);break;default:this.other(i);break}this.endFile()}precheckMissedSemicolon(){}raw(i,h,o,n){let p,u,g=o.length,S="",v=!0,b,C;for(let y=0;y<g;y+=1)p=o[y],u=p[0],u==="space"&&y===g-1&&!n?v=!1:u==="comment"?(C=o[y-1]?o[y-1][0]:"empty",b=o[y+1]?o[y+1][0]:"empty",!f[C]&&!f[b]?S.slice(-1)===","?v=!1:S+=p[1]:v=!1):S+=p[1];if(!v){let y=o.reduce((w,E)=>w+E[1],"");i.raws[h]={raw:y,value:S}}i[h]=S}rule(i){i.pop();let h=new c;this.init(h,i[0][2]),h.raws.between=this.spacesAndCommentsFromEnd(i),this.raw(h,"selector",i),this.current=h}spacesAndCommentsFromEnd(i){let h,o="";for(;i.length&&(h=i[i.length-1][0],!(h!=="space"&&h!=="comment"));)o=i.pop()[1]+o;return o}spacesAndCommentsFromStart(i){let h,o="";for(;i.length&&(h=i[0][0],!(h!=="space"&&h!=="comment"));)o+=i.shift()[1];return o}spacesFromEnd(i){let h,o="";for(;i.length&&(h=i[i.length-1][0],h==="space");)o=i.pop()[1]+o;return o}stringFrom(i,h){let o="";for(let n=h;n<i.length;n++)o+=i[n][1];return i.splice(h,i.length-h),o}unclosedBlock(){let i=this.current.source.start;throw this.input.error("Unclosed block",i.line,i.column)}unclosedBracket(i){throw this.input.error("Unclosed bracket",{offset:i[2]},{offset:i[2]+1})}unexpectedClose(i){throw this.input.error("Unexpected }",{offset:i[2]},{offset:i[2]+1})}unknownWord(i){throw this.input.error("Unknown word",{offset:i[0][2]},{offset:i[0][2]+i[0][1].length})}unnamedAtrule(i,h){throw this.input.error("At-rule without name",{offset:h[2]},{offset:h[2]+h[1].length})}}return br=l,br}var vr,pi;function os(){if(pi)return vr;pi=1;let e=Re(),t=Jo(),s=bt();function a(r,c){let f=new s(r,c),m=new t(f);try{m.parse()}catch(l){throw l}return m.root}return vr=a,a.default=a,e.registerParse(a),vr}var Sr,mi;function rn(){if(mi)return Sr;mi=1;let{isClean:e,my:t}=ts(),s=Zi(),a=gt(),r=Re(),c=rs(),f=Ki(),m=ss(),l=os(),d=Ge(),i={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={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},o={Once:!0,postcssPlugin:!0,prepare:!0},n=0;function p(C){return typeof C=="object"&&typeof C.then=="function"}function u(C){let y=!1,w=i[C.type];return C.type==="decl"?y=C.prop.toLowerCase():C.type==="atrule"&&(y=C.name.toLowerCase()),y&&C.append?[w,w+"-"+y,n,w+"Exit",w+"Exit-"+y]:y?[w,w+"-"+y,w+"Exit",w+"Exit-"+y]:C.append?[w,n,w+"Exit"]:[w,w+"Exit"]}function g(C){let y;return C.type==="document"?y=["Document",n,"DocumentExit"]:C.type==="root"?y=["Root",n,"RootExit"]:y=u(C),{eventIndex:0,events:y,iterator:0,node:C,visitorIndex:0,visitors:[]}}function S(C){return C[e]=!1,C.nodes&&C.nodes.forEach(y=>S(y)),C}let v={};class b{constructor(y,w,E){this.stringified=!1,this.processed=!1;let R;if(typeof w=="object"&&w!==null&&(w.type==="root"||w.type==="document"))R=S(w);else if(w instanceof b||w instanceof m)R=S(w.root),w.map&&(typeof E.map>"u"&&(E.map={}),E.map.inline||(E.map.inline=!1),E.map.prev=w.map);else{let O=l;E.syntax&&(O=E.syntax.parse),E.parser&&(O=E.parser),O.parse&&(O=O.parse);try{R=O(w,E)}catch(M){this.processed=!0,this.error=M}R&&!R[t]&&r.rebuild(R)}this.result=new m(y,R,E),this.helpers={...v,postcss:v,result:this.result},this.plugins=this.processor.plugins.map(O=>typeof O=="object"&&O.prepare?{...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(y){return this.async().catch(y)}finally(y){return this.async().then(y,y)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(y,w){let E=this.result.lastPlugin;try{w&&w.addToError(y),this.error=y,y.name==="CssSyntaxError"&&!y.plugin?(y.plugin=E.postcssPlugin,y.setMessage()):E.postcssVersion}catch(R){console&&console.error&&console.error(R)}return y}prepareVisitors(){this.listeners={};let y=(w,E,R)=>{this.listeners[E]||(this.listeners[E]=[]),this.listeners[E].push([w,R])};for(let w of this.plugins)if(typeof w=="object")for(let E in w){if(!h[E]&&/^[A-Z]/.test(E))throw new Error(`Unknown event ${E} in ${w.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!o[E])if(typeof w[E]=="object")for(let R in w[E])R==="*"?y(w,E,w[E][R]):y(w,E+"-"+R.toLowerCase(),w[E][R]);else typeof w[E]=="function"&&y(w,E,w[E])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let y=0;y<this.plugins.length;y++){let w=this.plugins[y],E=this.runOnRoot(w);if(p(E))try{await E}catch(R){throw this.handleError(R)}}if(this.prepareVisitors(),this.hasListener){let y=this.result.root;for(;!y[e];){y[e]=!0;let w=[g(y)];for(;w.length>0;){let E=this.visitTick(w);if(p(E))try{await E}catch(R){let O=w[w.length-1].node;throw this.handleError(R,O)}}}if(this.listeners.OnceExit)for(let[w,E]of this.listeners.OnceExit){this.result.lastPlugin=w;try{if(y.type==="document"){let R=y.nodes.map(O=>E(O,this.helpers));await Promise.all(R)}else await E(y,this.helpers)}catch(R){throw this.handleError(R)}}}return this.processed=!0,this.stringify()}runOnRoot(y){this.result.lastPlugin=y;try{if(typeof y=="object"&&y.Once){if(this.result.root.type==="document"){let w=this.result.root.nodes.map(E=>y.Once(E,this.helpers));return p(w[0])?Promise.all(w):w}return y.Once(this.result.root,this.helpers)}else if(typeof y=="function")return y(this.result.root,this.result)}catch(w){throw this.handleError(w)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let y=this.result.opts,w=a;y.syntax&&(w=y.syntax.stringify),y.stringifier&&(w=y.stringifier),w.stringify&&(w=w.stringify);let R=new s(w,this.result.root,this.result.opts).generate();return this.result.css=R[0],this.result.map=R[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 y of this.plugins){let w=this.runOnRoot(y);if(p(w))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let y=this.result.root;for(;!y[e];)y[e]=!0,this.walkSync(y);if(this.listeners.OnceExit)if(y.type==="document")for(let w of y.nodes)this.visitSync(this.listeners.OnceExit,w);else this.visitSync(this.listeners.OnceExit,y)}return this.result}then(y,w){return this.async().then(y,w)}toString(){return this.css}visitSync(y,w){for(let[E,R]of y){this.result.lastPlugin=E;let O;try{O=R(w,this.helpers)}catch(M){throw this.handleError(M,w.proxyOf)}if(w.type!=="root"&&w.type!=="document"&&!w.parent)return!0;if(p(O))throw this.getAsyncError()}}visitTick(y){let w=y[y.length-1],{node:E,visitors:R}=w;if(E.type!=="root"&&E.type!=="document"&&!E.parent){y.pop();return}if(R.length>0&&w.visitorIndex<R.length){let[M,P]=R[w.visitorIndex];w.visitorIndex+=1,w.visitorIndex===R.length&&(w.visitors=[],w.visitorIndex=0),this.result.lastPlugin=M;try{return P(E.toProxy(),this.helpers)}catch(A){throw this.handleError(A,E)}}if(w.iterator!==0){let M=w.iterator,P;for(;P=E.nodes[E.indexes[M]];)if(E.indexes[M]+=1,!P[e]){P[e]=!0,y.push(g(P));return}w.iterator=0,delete E.indexes[M]}let O=w.events;for(;w.eventIndex<O.length;){let M=O[w.eventIndex];if(w.eventIndex+=1,M===n){E.nodes&&E.nodes.length&&(E[e]=!0,w.iterator=E.getIterator());return}else if(this.listeners[M]){w.visitors=this.listeners[M];return}}y.pop()}walkSync(y){y[e]=!0;let w=u(y);for(let E of w)if(E===n)y.nodes&&y.each(R=>{R[e]||this.walkSync(R)});else{let R=this.listeners[E];if(R&&this.visitSync(R,y.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return b.registerPostcss=C=>{v=C},Sr=b,b.default=b,d.registerLazyResult(b),c.registerLazyResult(b),Sr}var Cr,gi;function Xo(){if(gi)return Cr;gi=1;let e=Zi(),t=gt(),s=Ki(),a=os(),r=ss();class c{constructor(m,l,d){l=l.toString(),this.stringified=!1,this._processor=m,this._css=l,this._opts=d,this._map=void 0;let i,h=t;this.result=new r(this._processor,i,this._opts),this.result.css=l;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let n=new e(h,i,this._opts,l);if(n.isMap()){let[p,u]=n.generate();p&&(this.result.css=p),u&&(this.result.map=u)}else n.clearAnnotation(),this.result.css=n.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(m){return this.async().catch(m)}finally(m){return this.async().then(m,m)}sync(){if(this.error)throw this.error;return this.result}then(m,l){return this.async().then(m,l)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let m,l=a;try{m=l(this._css,this._opts)}catch(d){this.error=d}if(this.error)throw this.error;return this._root=m,m}get[Symbol.toStringTag](){return"NoWorkResult"}}return Cr=c,c.default=c,Cr}var Er,yi;function Qo(){if(yi)return Er;yi=1;let e=Xo(),t=rn(),s=rs(),a=Ge();class r{constructor(f=[]){this.version="8.4.38",this.plugins=this.normalize(f)}normalize(f){let m=[];for(let l of f)if(l.postcss===!0?l=l():l.postcss&&(l=l.postcss),typeof l=="object"&&Array.isArray(l.plugins))m=m.concat(l.plugins);else if(typeof l=="object"&&l.postcssPlugin)m.push(l);else if(typeof l=="function")m.push(l);else if(!(typeof l=="object"&&(l.parse||l.stringify)))throw new Error(l+" is not a PostCSS plugin");return m}process(f,m={}){return!this.plugins.length&&!m.parser&&!m.stringifier&&!m.syntax?new e(this,f,m):new t(this,f,m)}use(f){return this.plugins=this.plugins.concat(this.normalize([f])),this}}return Er=r,r.default=r,a.registerProcessor(r),s.registerProcessor(r),Er}var xr,wi;function Zo(){if(wi)return xr;wi=1;let e=wt(),t=Qi(),s=vt(),a=is(),r=bt(),c=Ge(),f=ns();function m(l,d){if(Array.isArray(l))return l.map(o=>m(o));let{inputs:i,...h}=l;if(i){d=[];for(let o of i){let n={...o,__proto__:r.prototype};n.map&&(n.map={...n.map,__proto__:t.prototype}),d.push(n)}}if(h.nodes&&(h.nodes=l.nodes.map(o=>m(o,d))),h.source){let{inputId:o,...n}=h.source;h.source=n,o!=null&&(h.source.input=d[o])}if(h.type==="root")return new c(h);if(h.type==="decl")return new e(h);if(h.type==="rule")return new f(h);if(h.type==="comment")return new s(h);if(h.type==="atrule")return new a(h);throw new Error("Unknown node type: "+l.type)}return xr=m,m.default=m,xr}var Rr,bi;function Ko(){if(bi)return Rr;bi=1;let e=es(),t=wt(),s=rn(),a=Re(),r=Qo(),c=gt(),f=Zo(),m=rs(),l=en(),d=vt(),i=is(),h=ss(),o=bt(),n=os(),p=tn(),u=ns(),g=Ge(),S=yt();function v(...b){return b.length===1&&Array.isArray(b[0])&&(b=b[0]),new r(b)}return v.plugin=function(C,y){let w=!1;function E(...O){console&&console.warn&&!w&&(w=!0,console.warn(C+`: postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(C+`: \\u91CC\\u9762 postcss.plugin \\u88AB\\u5F03\\u7528. \\u8FC1\\u79FB\\u6307\\u5357:\nhttps://www.w3ctech.com/topic/2226`));let M=y(...O);return M.postcssPlugin=C,M.postcssVersion=new r().version,M}let R;return Object.defineProperty(E,"postcss",{get(){return R||(R=E()),R}}),E.process=function(O,M,P){return v([E(P)]).process(O,M)},E},v.stringify=c,v.parse=n,v.fromJSON=f,v.list=p,v.comment=b=>new d(b),v.atRule=b=>new i(b),v.decl=b=>new t(b),v.rule=b=>new u(b),v.root=b=>new g(b),v.document=b=>new m(b),v.CssSyntaxError=e,v.Declaration=t,v.Container=a,v.Processor=r,v.Document=m,v.Comment=d,v.Warning=l,v.AtRule=i,v.Result=h,v.Input=o,v.Rule=u,v.Root=g,v.Node=S,s.registerPostcss(v),Rr=v,v.default=v,Rr}var ea=Ko(),V=zo(ea);V.stringify;V.fromJSON;V.plugin;V.parse;V.list;V.document;V.comment;V.atRule;V.rule;V.decl;V.root;V.CssSyntaxError;V.Declaration;V.Container;V.Processor;V.Document;V.Comment;V.Warning;V.AtRule;V.Result;V.Input;V.Rule;V.Root;V.Node;var Tr=class e{constructor(...t){ce(this,"parentElement",null),ce(this,"parentNode",null),ce(this,"ownerDocument"),ce(this,"firstChild",null),ce(this,"lastChild",null),ce(this,"previousSibling",null),ce(this,"nextSibling",null),ce(this,"ELEMENT_NODE",1),ce(this,"TEXT_NODE",3),ce(this,"nodeType"),ce(this,"nodeName"),ce(this,"RRNodeType")}get childNodes(){let t=[],s=this.firstChild;for(;s;)t.push(s),s=s.nextSibling;return t}contains(t){if(t instanceof e){if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0}else return!1;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute \'appendChild\' on \'RRNode\': This RRNode type does not support this method.")}insertBefore(t,s){throw new Error("RRDomException: Failed to execute \'insertBefore\' on \'RRNode\': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute \'removeChild\' on \'RRNode\': This RRNode type does not support this method.")}toString(){return"RRNode"}};var vi={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Si={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ue={},_r={},Ci=0,ta=()=>!!globalThis.Zone;function as(e){if(Ue[e])return Ue[e];let t=globalThis[e],s=t.prototype,a=e in vi?vi[e]:void 0,r=!!(a&&a.every(m=>{var l,d;return!!((d=(l=Object.getOwnPropertyDescriptor(s,m))==null?void 0:l.get)!=null&&d.toString().includes("[native code]"))})),c=e in Si?Si[e]:void 0,f=!!(c&&c.every(m=>{var l;return typeof s[m]=="function"&&((l=s[m])==null?void 0:l.toString().includes("[native code]"))}));if(r&&f&&!ta())return Ue[e]=t.prototype,t.prototype;try{let m=document.createElement("iframe");m.style.display="none",document.body.appendChild(m);let l=m.contentWindow;if(!l)return t.prototype;let d=l[e].prototype;if(!d)return m.remove(),s;let i=navigator.userAgent;return i.includes("Safari")&&!i.includes("Chrome")?(m.classList.add("rr-block"),m.setAttribute("__rrwebUntaintedMutationObserver",""),_r[e]=()=>m.remove()):m.remove(),Ue[e]=d}catch{return s}}var Mr={};function ae(e,t,s){var a,r;let c=(a=Mr[e])==null?void 0:a[s];if(c)return c.call(t);let f=as(e),m=(r=Object.getOwnPropertyDescriptor(f,s))==null?void 0:r.get;return m?((Mr[e]||(Mr[e]={}))[s]=m,m.call(t)):t[s]}var Nr={};function sn(e,t,s){let a=`${e}.${String(s)}`;if(Nr[a])return Nr[a].bind(t);let c=as(e)[s];return typeof c!="function"?t[s]:(Nr[a]=c,c.bind(t))}function ra(e){return ae("Node",e,"ownerDocument")}function sa(e){return ae("Node",e,"childNodes")}function ia(e){return ae("Node",e,"parentNode")}function na(e){return ae("Node",e,"parentElement")}function oa(e){return ae("Node",e,"textContent")}function aa(e){return ae("Node",e,"firstChild")}function la(e){return ae("Node",e,"lastChild")}function ua(e){return ae("Node",e,"nextSibling")}function ca(e){return ae("Node",e,"previousSibling")}function ha(e,t){return sn("Node",e,"contains")(t)}function fa(e){return sn("Node",e,"getRootNode")()}function da(e){return!e||!("host"in e)?null:ae("ShadowRoot",e,"host")}function pa(e){return e.styleSheets}function ma(e){return!e||!("shadowRoot"in e)?null:ae("Element",e,"shadowRoot")}function ga(e,t){return ae("Element",e,"querySelector")(t)}function ya(e,t){return ae("Element",e,"querySelectorAll")(t)}function nn(){let e=as("MutationObserver");Ci++;let t=!1;return[e.constructor,()=>{if(t||(t=!0,--Ci!==0))return;let s=_r.MutationObserver;if(s)try{s()}finally{delete Ue.MutationObserver,delete _r.MutationObserver}}]}var ze=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(ze=()=>new Date().getTime());function Me(e,t,s){try{if(!(t in e))return()=>{};let a=e[t],r=s(a);return typeof r=="function"&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:a}})),e[t]=r,()=>{e[t]=a}}catch{return()=>{}}}var T={ownerDocument:ra,childNodes:sa,parentNode:ia,parentElement:na,textContent:oa,firstChild:aa,lastChild:la,nextSibling:ua,previousSibling:ca,contains:ha,getRootNode:fa,host:da,styleSheets:pa,shadowRoot:ma,querySelector:ga,querySelectorAll:ya,nowTimestamp:ze,mutationObserverCtor:nn,patch:Me};function Q(e,t,s=document){let a={capture:!0,passive:!0};return s.addEventListener(e,t,a),()=>s.removeEventListener(e,t,a)}var Oe=`Please stop import mirror directly. Instead of that,\\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\\r\nor you can use record.mirror to access the mirror instance during recording.`,Ei={map:{},getId(){return console.error(Oe),-1},getNode(){return console.error(Oe),null},removeNodeFromMap(){console.error(Oe)},has(){return console.error(Oe),!1},reset(){console.error(Oe)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Ei=new Proxy(Ei,{get(e,t,s){return t==="map"&&console.error(Oe),Reflect.get(e,t,s)}}));function qe(e,t,s={}){let a=null,r=0;return function(...c){let f=Date.now();!r&&s.leading===!1&&(r=f);let m=t-(f-r),l=this;m<=0||m>t?(a&&(clearTimeout(a),a=null),r=f,e.apply(l,c)):!a&&s.trailing!==!1&&(a=setTimeout(()=>{r=s.leading===!1?0:Date.now(),a=null,e.apply(l,c)},m))}}function St(e,t,s,a,r=window){let c=r.Object.getOwnPropertyDescriptor(e,t);return r.Object.defineProperty(e,t,a?s:{set(f){setTimeout(()=>{s.set.call(this,f)},0),c&&c.set&&c.set.call(this,f)}}),()=>St(e,t,c||{},!0)}function on(e){var t,s,a,r;let c=e.document;return{left:c.scrollingElement?c.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:c.documentElement.scrollLeft||c?.body&&((t=T.parentElement(c.body))==null?void 0:t.scrollLeft)||((s=c?.body)==null?void 0:s.scrollLeft)||0,top:c.scrollingElement?c.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:c?.documentElement.scrollTop||c?.body&&((a=T.parentElement(c.body))==null?void 0:a.scrollTop)||((r=c?.body)==null?void 0:r.scrollTop)||0}}function an(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ln(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function un(e){return e?e.nodeType===e.ELEMENT_NODE?e:T.parentElement(e):null}function ee(e,t,s,a){if(!e)return!1;let r=un(e);if(!r)return!1;try{if(typeof t=="string"){if(r.classList.contains(t)||a&&r.closest("."+t)!==null)return!0}else if(lt(r,t,a))return!0}catch{}return!!(s&&(r.matches(s)||a&&r.closest(s)!==null))}function wa(e,t){return t.getId(e)!==-1}function Or(e,t,s){return e.tagName==="TITLE"&&s.headTitleMutations?!0:t.getId(e)===at}function cn(e,t){if($e(e))return!1;let s=t.getId(e);if(!t.has(s))return!0;let a=T.parentNode(e);return a&&a.nodeType===e.DOCUMENT_NODE?!1:a?cn(a,t):!0}function Pr(e){return!!e.changedTouches}function ba(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function hn(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function fn(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function kr(e){return e?e instanceof Tr&&"shadowRoot"in e?!!e.shadowRoot:!!T.shadowRoot(e):!1}var Lr=class{constructor(){I(this,"id",1),I(this,"styleIDMap",new WeakMap),I(this,"idStyleMap",new Map)}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,s){if(this.has(t))return this.getId(t);let a;return s===void 0?a=this.id++:a=s,this.styleIDMap.set(t,a),this.idStyleMap.set(a,t),a}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function dn(e){var t;let s=null;return"getRootNode"in e&&((t=T.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&T.host(T.getRootNode(e))&&(s=T.host(T.getRootNode(e))),s}function va(e){let t=e,s;for(;s=dn(t);)t=s;return t}function Sa(e){let t=T.ownerDocument(e);if(!t)return!1;let s=va(e);return T.contains(t,s)}function Fr(e){let t=T.ownerDocument(e);return t?T.contains(t,e)||Sa(e):!1}var k=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e[e.Asset=7]="Asset",e[e.Annotation=8]="Annotation",e))(k||{}),L=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(L||{}),se=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(se||{}),we=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(we||{}),Pe=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Pe||{}),Ie=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(Ie||{});var pn=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(pn||{}),xi=(e,t)=>`${e}@${t}`,Ur=class{constructor(){I(this,"frozen",!1),I(this,"locked",!1),I(this,"texts",[]),I(this,"attributes",[]),I(this,"attributeMap",new WeakMap),I(this,"removes",[]),I(this,"mapRemoves",[]),I(this,"movedMap",{}),I(this,"addedSet",new Set),I(this,"movedSet",new Set),I(this,"droppedSet",new Set),I(this,"removesSubTreeCache",new Set),I(this,"mutationCb"),I(this,"blockClass"),I(this,"blockSelector"),I(this,"maskTextClass"),I(this,"maskTextSelector"),I(this,"inlineStylesheet"),I(this,"maskInputOptions"),I(this,"maskTextFn"),I(this,"maskInputFn"),I(this,"keepIframeSrcFn"),I(this,"recordCanvas"),I(this,"inlineImages"),I(this,"slimDOMOptions"),I(this,"dataURLOptions"),I(this,"doc"),I(this,"mirror"),I(this,"iframeManager"),I(this,"stylesheetManager"),I(this,"shadowDomManager"),I(this,"processedNodeManager"),I(this,"unattachedDoc"),I(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),I(this,"emit",()=>{if(this.frozen||this.locked)return;let t=[],s=new Set;for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let o of this.movedSet){let n=T.parentNode(o);this.removesSubTreeCache.has(n)&&!this.movedSet.has(n)||this.addedSet.add(o)}let a=null,r=null,c=-1,f=null,m=!1,l=new Set,d=this.addedSet.values(),i=d.next();for(;this.addedSet.size;){if(a!==null&&this.addedSet.has(T.previousSibling(a)))f=a,a=T.previousSibling(a);else{for(this.addedSet.has(i.value)||(i=d.next()),a=i.value;;){if(r=T.parentNode(a),this.addedSet.has(r)){a=r;continue}break}if(l.has(r))r=null;else if(r){if(Fr(r)?(m=Ri(this.droppedSet,r)||this.removesSubTreeCache.has(r),m&&Ri(this.movedSet,a)&&(m=!1)):m=!0,this.addedSet.has(T.lastChild(r)))a=T.lastChild(r),f=null;else for(;;){if(f=T.nextSibling(a),this.addedSet.has(f)){a=f;continue}break}if(c=$e(r)?this.mirror.getId(dn(a)):this.mirror.getId(r),c===-1&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let u=T.host(r);c=this.mirror.getId(u)}}}if(this.addedSet.delete(a),!r||c===-1){l.add(a);continue}else if(m){this.droppedSet.add(a);continue}let o=!1;if(a.nodeType===Node.TEXT_NODE){let u=r.tagName;if(u==="TEXTAREA")continue;u==="STYLE"&&s.has(c)&&(o=!0)}let n=f?this.mirror.getId(f):null;for(;n===at;)f=f&&T.nextSibling(f),n=f&&this.mirror.getId(f);if(n===-1){console.warn("Couldn\'t record new node. Couldn\'t find mirror id for nextSibling:",f),a=null;continue}let p=De(a,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:u=>{hn(u,this.mirror)&&this.iframeManager.addIframe(u),fn(u,this.mirror)&&this.stylesheetManager.trackLinkElement(u),kr(a)&&this.shadowDomManager.addShadowRoot(T.shadowRoot(a),this.doc)},onIframeLoad:(u,g)=>{this.iframeManager.attachIframe(u,g),this.shadowDomManager.observeAttachShadow(u)},onStylesheetLoad:(u,g)=>{this.stylesheetManager.attachLinkElement(u,g)},cssCaptured:o});p&&(t.push({parentId:c,nextId:n,node:p}),s.add(p.id))}let h={texts:this.texts.map(o=>{let n=o.node,p=T.parentNode(n);return p&&p.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(p),{id:this.mirror.getId(n),value:o.value}}).filter(o=>!s.has(o.id)).filter(o=>this.mirror.has(o.id)),attributes:this.attributes.map(o=>{let{attributes:n}=o;if(typeof n.style=="string"){let p=JSON.stringify(o.styleDiff),u=JSON.stringify(o._unchangedStyles);p.length<n.style.length&&(p+u).split("var(").length===n.style.split("var(").length&&(n.style=o.styleDiff)}return{id:this.mirror.getId(o.node),attributes:n}}).filter(o=>!s.has(o.id)).filter(o=>this.mirror.has(o.id)),removes:this.removes,adds:t};!h.texts.length&&!h.attributes.length&&!h.removes.length&&!h.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(h))}),I(this,"genTextAreaValueMutation",t=>{let s=this.attributeMap.get(t);s||(s={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(t,s));let a=Array.from(T.childNodes(t),r=>T.textContent(r)||"").join("");s.attributes.value=it({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:nt(t),value:a,maskInputFn:this.maskInputFn})}),I(this,"processMutation",t=>{if(!Or(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{let s=T.textContent(t.target);!ee(t.target,this.blockClass,this.blockSelector,!1)&&s!==t.oldValue&&this.texts.push({value:Wi(t.target,this.maskTextClass,this.maskTextSelector,!0)&&s?this.maskTextFn?this.maskTextFn(s,un(t.target)):s.replace(/[\\S]/g,"*"):s,node:t.target});break}case"attributes":{let s=t.target,a=Ce(s.tagName),r=t.attributeName,c=t.target.getAttribute(r);if(r==="value"){let m=nt(s);c=it({element:s,maskInputOptions:this.maskInputOptions,tagName:s.tagName,type:m,value:c,maskInputFn:this.maskInputFn})}if(ee(t.target,this.blockClass,this.blockSelector,!1)||c===t.oldValue)return;let f=this.attributeMap.get(t.target);if(a==="iframe"&&r==="src"&&!this.keepIframeSrcFn(c))if(!s.contentDocument)r="rr_src";else return;if(f||(f={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(f),this.attributeMap.set(t.target,f)),r==="type"&&a==="input"&&(t.oldValue||"").toLowerCase()==="password"&&s.setAttribute("data-rr-is-password","true"),!Bi(a,r))if(f.attributes[r]=$i(this.doc,a,Ce(r),c),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let m=this.unattachedDoc.createElement("span");t.oldValue&&m.setAttribute("style",t.oldValue);for(let l of Array.from(s.style)){let d=s.style.getPropertyValue(l),i=s.style.getPropertyPriority(l);d!==m.style.getPropertyValue(l)||i!==m.style.getPropertyPriority(l)?i===""?f.styleDiff[l]=d:f.styleDiff[l]=[d,i]:f._unchangedStyles[l]=[d,i]}for(let l of Array.from(m.style))s.style.getPropertyValue(l)===""&&(f.styleDiff[l]=!1)}else r==="open"&&s.tagName==="DIALOG"&&(s.matches("dialog:modal")?f.attributes.rr_open_mode="modal":f.attributes.rr_open_mode="non-modal");break}case"childList":{if(ee(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(s=>this.genAdds(s,t.target)),t.removedNodes.forEach(s=>{Fr(s)||this.shadowDomManager.removeShadowRootsIn(s);let a=this.mirror.getId(s),r=$e(t.target)?this.mirror.getId(T.host(t.target)):this.mirror.getId(t.target);ee(t.target,this.blockClass,this.blockSelector,!1)||Or(s,this.mirror,this.slimDOMOptions)||!wa(s,this.mirror)||(this.addedSet.has(s)?($r(this.addedSet,s),this.droppedSet.add(s)):this.addedSet.has(t.target)&&a===-1||cn(t.target,this.mirror)||(this.movedSet.has(s)&&this.movedMap[xi(a,r)]?$r(this.movedSet,s):(this.removes.push({parentId:r,id:a,isShadow:$e(t.target)&&Be(t.target)?!0:void 0}),Ca(s,this.removesSubTreeCache))),this.mapRemoves.push(s))});break}}}),I(this,"genAdds",(t,s)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Or(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let a=null;s&&this.mirror.hasNode(s)&&(a=this.mirror.getId(s)),a&&a!==-1&&(this.movedMap[xi(this.mirror.getId(t),a)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);ee(t,this.blockClass,this.blockSelector,!1)||(T.childNodes(t).forEach(a=>this.genAdds(a)),kr(t)&&T.childNodes(T.shadowRoot(t)).forEach(a=>{this.processedNodeManager.add(a,this),this.genAdds(a,t)}))}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","processedNodeManager"].forEach(s=>{this[s]=t[s]})}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1,this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0}unlock(){this.locked=!1,this.emit()}};function $r(e,t){e.delete(t),T.childNodes(t).forEach(s=>$r(e,s))}function Ca(e,t){let s=[e];for(;s.length;){let a=s.pop();t.has(a)||(t.add(a),T.childNodes(a).forEach(r=>s.push(r)))}}function Ri(e,t){return e.size===0?!1:mn(e,t)}function mn(e,t){if(e.has(t))return!0;let s=T.parentNode(t);return s?mn(e,s):!1}var We;function Ea(e){We=e}function xa(){We=void 0}var F=e=>We?(...s)=>{try{return e(...s)}catch(a){if(We&&We(a)===!0)return;throw a}}:e,_e=new Set;function He(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function gn(e,t){let s=new Ur;_e.add(s),s.init(e);let[a,r]=nn(),c=new a(F(s.processMutations.bind(s)));return c.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),()=>{c.disconnect(),_e.delete(s),r()}}function Ra({mousemoveCb:e,sampling:t,doc:s,mirror:a}){if(t.mousemove===!1)return()=>{};let r=typeof t.mousemove=="number"?t.mousemove:50,c=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,f=[],m,l=qe(F(h=>{let o=Date.now()-m;e(f.map(n=>(n.timeOffset-=o,n)),h),f=[],m=null}),c),d=F(qe(F(h=>{let o=He(h),{clientX:n,clientY:p}=Pr(h)?h.changedTouches[0]:h;m||(m=ze()),f.push({x:n,y:p,id:a.getId(o),timeOffset:ze()-m}),l(typeof DragEvent<"u"&&h instanceof DragEvent?L.Drag:h instanceof MouseEvent?L.MouseMove:L.TouchMove)}),r,{trailing:!1})),i=[Q("mousemove",d,s),Q("touchmove",d,s),Q("drag",d,s)];return F(()=>{i.forEach(h=>h())})}function Ma({mouseInteractionCb:e,doc:t,mirror:s,blockClass:a,blockSelector:r,sampling:c}){if(c.mouseInteraction===!1)return()=>{};let f=c.mouseInteraction===!0||c.mouseInteraction===void 0?{}:c.mouseInteraction,m=[],l=null,d=i=>h=>{let o=He(h);if(ee(o,a,r,!0))return;let n=null,p=i;if("pointerType"in h){switch(h.pointerType){case"mouse":n=we.Mouse;break;case"touch":n=we.Touch;break;case"pen":n=we.Pen;break}n===we.Touch?se[i]===se.MouseDown?p="TouchStart":se[i]===se.MouseUp&&(p="TouchEnd"):we.Pen}else Pr(h)&&(n=we.Touch);n!==null?(l=n,(p.startsWith("Touch")&&n===we.Touch||p.startsWith("Mouse")&&n===we.Mouse)&&(n=null)):se[i]===se.Click&&(n=l,l=null);let u=Pr(h)?h.changedTouches[0]:h;if(!u)return;let g=s.getId(o),{clientX:S,clientY:v}=u;F(e)({type:se[p],id:g,x:S,y:v,...n!==null&&{pointerType:n}})};return Object.keys(se).filter(i=>Number.isNaN(Number(i))&&!i.endsWith("_Departed")&&f[i]!==!1).forEach(i=>{let h=Ce(i),o=d(i);if(window.PointerEvent)switch(se[i]){case se.MouseDown:case se.MouseUp:h=h.replace("mouse","pointer");break;case se.TouchStart:case se.TouchEnd:return}m.push(Q(h,o,t))}),F(()=>{m.forEach(i=>i())})}function yn({scrollCb:e,doc:t,mirror:s,blockClass:a,blockSelector:r,sampling:c}){let f=F(qe(F(m=>{let l=He(m);if(!l||ee(l,a,r,!0))return;let d=s.getId(l);if(l===t&&t.defaultView){let i=on(t.defaultView);e({id:d,x:i.left,y:i.top})}else e({id:d,x:l.scrollLeft,y:l.scrollTop})}),c.scroll||100));return Q("scroll",f,t)}function Na({viewportResizeCb:e},{win:t}){let s=-1,a=-1,r=F(qe(F(()=>{let c=an(),f=ln();(s!==c||a!==f)&&(e({width:Number(f),height:Number(c)}),s=c,a=f)}),200));return Q("resize",r,t)}var Oa=["INPUT","TEXTAREA","SELECT"],Mi=new WeakMap;function Ia({inputCb:e,doc:t,mirror:s,blockClass:a,blockSelector:r,ignoreClass:c,ignoreSelector:f,maskInputOptions:m,maskInputFn:l,sampling:d,userTriggeredOnInput:i}){function h(v){let b=He(v),C=v.isTrusted,y=b&&b.tagName;if(b&&y==="OPTION"&&(b=T.parentElement(b)),!b||!y||Oa.indexOf(y)<0||ee(b,a,r,!0)||b.classList.contains(c)||f&&b.matches(f))return;let w=b.value,E=!1,R=nt(b)||"";R==="radio"||R==="checkbox"?E=b.checked:(m[y.toLowerCase()]||m[R])&&(w=it({element:b,maskInputOptions:m,tagName:y,type:R,value:w,maskInputFn:l})),o(b,i?{text:w,isChecked:E,userTriggered:C}:{text:w,isChecked:E});let O=b.name;R==="radio"&&O&&E&&t.querySelectorAll(`input[type="radio"][name="${O}"]`).forEach(M=>{if(M!==b){let P=M.value;o(M,i?{text:P,isChecked:!E,userTriggered:!1}:{text:P,isChecked:!E})}})}function o(v,b){let C=Mi.get(v);if(!C||C.text!==b.text||C.isChecked!==b.isChecked){Mi.set(v,b);let y=s.getId(v);F(e)({...b,id:y})}}let p=(d.input==="last"?["change"]:["input","change"]).map(v=>Q(v,F(h),t)),u=t.defaultView;if(!u)return()=>{p.forEach(v=>v())};let g=u.Object.getOwnPropertyDescriptor(u.HTMLInputElement.prototype,"value"),S=[[u.HTMLInputElement.prototype,"value"],[u.HTMLInputElement.prototype,"checked"],[u.HTMLSelectElement.prototype,"value"],[u.HTMLTextAreaElement.prototype,"value"],[u.HTMLSelectElement.prototype,"selectedIndex"],[u.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&p.push(...S.map(v=>St(v[0],v[1],{set(){F(h)({target:this,isTrusted:!1})}},!1,u))),F(()=>{p.forEach(v=>v())})}function ut(e){let t=[];function s(a,r){if(Ke("CSSGroupingRule")&&a.parentRule instanceof CSSGroupingRule||Ke("CSSMediaRule")&&a.parentRule instanceof CSSMediaRule||Ke("CSSSupportsRule")&&a.parentRule instanceof CSSSupportsRule||Ke("CSSConditionRule")&&a.parentRule instanceof CSSConditionRule){let f=Array.from(a.parentRule.cssRules).indexOf(a);return r.unshift(f),s(a.parentRule,r)}else if(a.parentStyleSheet){let f=Array.from(a.parentStyleSheet.cssRules).indexOf(a);r.unshift(f)}return r}return s(e,t)}function Se(e,t,s){let a,r;return e?(e.ownerNode?a=t.getId(e.ownerNode):r=s.getId(e),{styleId:r,id:a}):{}}function Aa({styleSheetRuleCb:e,mirror:t,stylesheetManager:s},{win:a}){if(!a.CSSStyleSheet||!a.CSSStyleSheet.prototype)return()=>{};let r=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=new Proxy(r,{apply:F((i,h,o)=>{let[n,p]=o,{id:u,styleId:g}=Se(h,t,s.styleMirror);return(u&&u!==-1||g&&g!==-1)&&e({id:u,styleId:g,adds:[{rule:n,index:p}]}),i.apply(h,o)})}),a.CSSStyleSheet.prototype.addRule=function(i,h,o=this.cssRules.length){let n=`${i} { ${h} }`;return a.CSSStyleSheet.prototype.insertRule.apply(this,[n,o])};let c=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=new Proxy(c,{apply:F((i,h,o)=>{let[n]=o,{id:p,styleId:u}=Se(h,t,s.styleMirror);return(p&&p!==-1||u&&u!==-1)&&e({id:p,styleId:u,removes:[{index:n}]}),i.apply(h,o)})}),a.CSSStyleSheet.prototype.removeRule=function(i){return a.CSSStyleSheet.prototype.deleteRule.apply(this,[i])};let f;a.CSSStyleSheet.prototype.replace&&(f=a.CSSStyleSheet.prototype.replace,a.CSSStyleSheet.prototype.replace=new Proxy(f,{apply:F((i,h,o)=>{let[n]=o,{id:p,styleId:u}=Se(h,t,s.styleMirror);return(p&&p!==-1||u&&u!==-1)&&e({id:p,styleId:u,replace:n}),i.apply(h,o)})}));let m;a.CSSStyleSheet.prototype.replaceSync&&(m=a.CSSStyleSheet.prototype.replaceSync,a.CSSStyleSheet.prototype.replaceSync=new Proxy(m,{apply:F((i,h,o)=>{let[n]=o,{id:p,styleId:u}=Se(h,t,s.styleMirror);return(p&&p!==-1||u&&u!==-1)&&e({id:p,styleId:u,replaceSync:n}),i.apply(h,o)})}));let l={};et("CSSGroupingRule")?l.CSSGroupingRule=a.CSSGroupingRule:(et("CSSMediaRule")&&(l.CSSMediaRule=a.CSSMediaRule),et("CSSConditionRule")&&(l.CSSConditionRule=a.CSSConditionRule),et("CSSSupportsRule")&&(l.CSSSupportsRule=a.CSSSupportsRule));let d={};return Object.entries(l).forEach(([i,h])=>{d[i]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(d[i].insertRule,{apply:F((o,n,p)=>{let[u,g]=p,{id:S,styleId:v}=Se(n.parentStyleSheet,t,s.styleMirror);return(S&&S!==-1||v&&v!==-1)&&e({id:S,styleId:v,adds:[{rule:u,index:[...ut(n),g||0]}]}),o.apply(n,p)})}),h.prototype.deleteRule=new Proxy(d[i].deleteRule,{apply:F((o,n,p)=>{let[u]=p,{id:g,styleId:S}=Se(n.parentStyleSheet,t,s.styleMirror);return(g&&g!==-1||S&&S!==-1)&&e({id:g,styleId:S,removes:[{index:[...ut(n),u]}]}),o.apply(n,p)})})}),F(()=>{a.CSSStyleSheet.prototype.insertRule=r,a.CSSStyleSheet.prototype.deleteRule=c,f&&(a.CSSStyleSheet.prototype.replace=f),m&&(a.CSSStyleSheet.prototype.replaceSync=m),Object.entries(l).forEach(([i,h])=>{h.prototype.insertRule=d[i].insertRule,h.prototype.deleteRule=d[i].deleteRule})})}function wn({mirror:e,stylesheetManager:t},s){var a,r,c;let f=null;s.nodeName==="#document"?f=e.getId(s):f=e.getId(T.host(s));let m=s.nodeName==="#document"?(a=s.defaultView)==null?void 0:a.Document:(c=(r=s.ownerDocument)==null?void 0:r.defaultView)==null?void 0:c.ShadowRoot,l=m?.prototype?Object.getOwnPropertyDescriptor(m?.prototype,"adoptedStyleSheets"):void 0;return f===null||f===-1||!m||!l?()=>{}:(Object.defineProperty(s,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var d;return(d=l.get)==null?void 0:d.call(this)},set(d){var i;let h=(i=l.set)==null?void 0:i.call(this,d);if(f!==null&&f!==-1)try{t.adoptStyleSheets(d,f)}catch{}return h}}),F(()=>{Object.defineProperty(s,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function Da({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:s,stylesheetManager:a},{win:r}){let c=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=new Proxy(c,{apply:F((m,l,d)=>{var i;let[h,o,n]=d;if(s.has(h))return c.apply(l,[h,o,n]);let{id:p,styleId:u}=Se((i=l.parentRule)==null?void 0:i.parentStyleSheet,t,a.styleMirror);return(p&&p!==-1||u&&u!==-1)&&e({id:p,styleId:u,set:{property:h,value:o,priority:n},index:ut(l.parentRule)}),m.apply(l,d)})});let f=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=new Proxy(f,{apply:F((m,l,d)=>{var i;let[h]=d;if(s.has(h))return f.apply(l,[h]);let{id:o,styleId:n}=Se((i=l.parentRule)==null?void 0:i.parentStyleSheet,t,a.styleMirror);return(o&&o!==-1||n&&n!==-1)&&e({id:o,styleId:n,remove:{property:h},index:ut(l.parentRule)}),m.apply(l,d)})}),F(()=>{r.CSSStyleDeclaration.prototype.setProperty=c,r.CSSStyleDeclaration.prototype.removeProperty=f})}function Ta({mediaInteractionCb:e,blockClass:t,blockSelector:s,mirror:a,sampling:r,doc:c}){let f=F(l=>qe(F(d=>{let i=He(d);if(!i||ee(i,t,s,!0))return;let{currentTime:h,volume:o,muted:n,playbackRate:p,loop:u}=i;e({type:l,id:a.getId(i),currentTime:h,volume:o,muted:n,playbackRate:p,loop:u})}),r.media||500)),m=[Q("play",f(Ie.Play),c),Q("pause",f(Ie.Pause),c),Q("seeked",f(Ie.Seeked),c),Q("volumechange",f(Ie.VolumeChange),c),Q("ratechange",f(Ie.RateChange),c)];return F(()=>{m.forEach(l=>l())})}function _a({fontCb:e,doc:t}){let s=t.defaultView;if(!s)return()=>{};let a=[],r=new WeakMap,c=s.FontFace;s.FontFace=function(l,d,i){let h=new c(l,d,i);return r.set(h,{family:l,buffer:typeof d!="string",descriptors:i,fontSource:typeof d=="string"?d:JSON.stringify(Array.from(new Uint8Array(d)))}),h};let f=Me(t.fonts,"add",function(m){return function(l){return setTimeout(F(()=>{let d=r.get(l);d&&(e(d),r.delete(l))}),0),m.apply(this,[l])}});return a.push(()=>{s.FontFace=c}),a.push(f),F(()=>{a.forEach(m=>m())})}function Pa(e){let{doc:t,mirror:s,blockClass:a,blockSelector:r,selectionCb:c}=e,f=!0,m=F(()=>{let l=t.getSelection();if(!l||f&&l?.isCollapsed)return;f=l.isCollapsed||!1;let d=[],i=l.rangeCount||0;for(let h=0;h<i;h++){let o=l.getRangeAt(h),{startContainer:n,startOffset:p,endContainer:u,endOffset:g}=o;ee(n,a,r,!0)||ee(u,a,r,!0)||d.push({start:s.getId(n),startOffset:p,end:s.getId(u),endOffset:g})}c({ranges:d})});return m(),Q("selectionchange",m)}function ka({doc:e,customElementCb:t}){let s=e.defaultView;return!s||!s.customElements?()=>{}:Me(s.customElements,"define",function(r){return function(c,f,m){try{t({define:{name:c}})}catch{console.warn(`Custom element callback failed for ${c}`)}return r.apply(this,[c,f,m])}})}function La(e,t){let{mutationCb:s,mousemoveCb:a,mouseInteractionCb:r,scrollCb:c,viewportResizeCb:f,inputCb:m,mediaInteractionCb:l,styleSheetRuleCb:d,styleDeclarationCb:i,canvasMutationCb:h,fontCb:o,selectionCb:n,customElementCb:p}=e;e.mutationCb=(...u)=>{t.mutation&&t.mutation(...u),s(...u)},e.mousemoveCb=(...u)=>{t.mousemove&&t.mousemove(...u),a(...u)},e.mouseInteractionCb=(...u)=>{t.mouseInteraction&&t.mouseInteraction(...u),r(...u)},e.scrollCb=(...u)=>{t.scroll&&t.scroll(...u),c(...u)},e.viewportResizeCb=(...u)=>{t.viewportResize&&t.viewportResize(...u),f(...u)},e.inputCb=(...u)=>{t.input&&t.input(...u),m(...u)},e.mediaInteractionCb=(...u)=>{t.mediaInteaction&&t.mediaInteaction(...u),l(...u)},e.styleSheetRuleCb=(...u)=>{t.styleSheetRule&&t.styleSheetRule(...u),d(...u)},e.styleDeclarationCb=(...u)=>{t.styleDeclaration&&t.styleDeclaration(...u),i(...u)},e.canvasMutationCb=(...u)=>{t.canvasMutation&&t.canvasMutation(...u),h(...u)},e.fontCb=(...u)=>{t.font&&t.font(...u),o(...u)},e.selectionCb=(...u)=>{t.selection&&t.selection(...u),n(...u)},e.customElementCb=(...u)=>{t.customElement&&t.customElement(...u),p(...u)}}function Fa(e,t={}){let s=e.doc.defaultView;if(!s)return()=>{};La(e,t);let a;e.recordDOM&&(a=gn(e,e.doc));let r=Ra(e),c=Ma(e),f=yn(e),m=Na(e,{win:s}),l=Ia(e),d=Ta(e),i=()=>{},h=()=>{},o=()=>{},n=()=>{};e.recordDOM&&(i=Aa(e,{win:s}),h=wn(e,e.doc),o=Da(e,{win:s}),e.collectFonts&&(n=_a(e)));let p=Pa(e),u=ka(e),g=[];for(let S of e.plugins)g.push(S.observer(S.callback,s,S.options));return F(()=>{a?.(),r(),c(),f(),m(),l(),d(),i(),h(),o(),n(),p(),u(),g.forEach(S=>S())})}function Ke(e){return typeof window[e]<"u"}function et(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var ct=class{constructor(t){I(this,"iframeIdToRemoteIdMap",new WeakMap),I(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,s,a,r){let c=a||this.getIdToRemoteIdMap(t),f=r||this.getRemoteIdToIdMap(t),m=c.get(s);return m||(m=this.generateIdFn(),c.set(s,m),f.set(m,s)),m}getIds(t,s){let a=this.getIdToRemoteIdMap(t),r=this.getRemoteIdToIdMap(t);return s.map(c=>this.getId(t,c,a,r))}getRemoteId(t,s,a){let r=a||this.getRemoteIdToIdMap(t);if(typeof s!="number")return s;let c=r.get(s);return c||-1}getRemoteIds(t,s){let a=this.getRemoteIdToIdMap(t);return s.map(r=>this.getRemoteId(t,r,a))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let s=this.iframeIdToRemoteIdMap.get(t);return s||(s=new Map,this.iframeIdToRemoteIdMap.set(t,s)),s}getRemoteIdToIdMap(t){let s=this.iframeRemoteIdToIdMap.get(t);return s||(s=new Map,this.iframeRemoteIdToIdMap.set(t,s)),s}},Br=class{constructor(t){I(this,"iframes",new WeakMap),I(this,"crossOriginIframeMap",new WeakMap),I(this,"crossOriginIframeMirror",new ct(Ui)),I(this,"crossOriginIframeStyleMirror"),I(this,"crossOriginIframeRootIdMap",new WeakMap),I(this,"mirror"),I(this,"mutationCb"),I(this,"wrappedEmit"),I(this,"loadListener"),I(this,"unloadListener"),I(this,"attachedWindows",new Map),I(this,"messageHandler",s=>this.handleMessage(s)),I(this,"stylesheetManager"),I(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ct(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}addUnloadListener(t){this.unloadListener=t}attachIframe(t,s){var a;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:s}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.watchIframeWindow(t),(a=this.loadListener)==null||a.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}destroy(){window.removeEventListener("message",this.messageHandler),this.attachedWindows.forEach(t=>t())}watchIframeWindow(t){let s=t.contentWindow;if(!s||this.attachedWindows.has(s))return;let a=[],r=()=>{this.attachedWindows.delete(s),a.forEach(c=>{try{c()}catch{}})};this.attachedWindows.set(s,r),this.recordCrossOriginIframes&&a.push(Q("message",this.messageHandler,s)),a.push(Q("pagehide",c=>{var f;if(c.persisted)return;let m=s.document;r(),(f=this.unloadListener)==null||f.call(this,m)},s))}handleMessage(t){let s=t;if(s.data.type!=="rrweb"||s.origin!==s.data.origin||!t.source)return;let r=this.crossOriginIframeMap.get(t.source);if(!r)return;let c=this.transformCrossOriginEvent(r,s.data.event);c&&this.wrappedEmit(c,s.data.isCheckout)}transformCrossOriginEvent(t,s){var a;switch(s.type){case k.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(s.data.node,t);let r=s.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(s.data.node,r),{timestamp:s.timestamp,type:k.IncrementalSnapshot,data:{source:L.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:s.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case k.Meta:case k.Load:case k.DomContentLoaded:return!1;case k.Annotation:case k.Plugin:return s;case k.Custom:return this.replaceIds(s.data.payload,t,["id","parentId","previousId","nextId"]),s;case k.IncrementalSnapshot:switch(s.data.source){case L.Mutation:return s.data.adds.forEach(r=>{this.replaceIds(r,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,t);let c=this.crossOriginIframeRootIdMap.get(t);c&&this.patchRootIdOnNode(r.node,c)}),s.data.removes.forEach(r=>{this.replaceIds(r,t,["parentId","id"])}),s.data.attributes.forEach(r=>{this.replaceIds(r,t,["id"])}),s.data.texts.forEach(r=>{this.replaceIds(r,t,["id"])}),s;case L.Drag:case L.TouchMove:case L.MouseMove:return s.data.positions.forEach(r=>{this.replaceIds(r,t,["id"])}),s;case L.ViewportResize:return!1;case L.MediaInteraction:case L.MouseInteraction:case L.Scroll:case L.CanvasMutation:case L.Input:return this.replaceIds(s.data,t,["id"]),s;case L.StyleSheetRule:case L.StyleDeclaration:return this.replaceIds(s.data,t,["id"]),this.replaceStyleIds(s.data,t,["styleId"]),s;case L.Font:return s;case L.Selection:return s.data.ranges.forEach(r=>{this.replaceIds(r,t,["start","end"])}),s;case L.AdoptedStyleSheet:return this.replaceIds(s.data,t,["id"]),this.replaceStyleIds(s.data,t,["styleIds"]),(a=s.data.styles)==null||a.forEach(r=>{this.replaceStyleIds(r,t,["styleId"])}),s}}return!1}replace(t,s,a,r){for(let c of r)!Array.isArray(s[c])&&typeof s[c]!="number"||(Array.isArray(s[c])?s[c]=t.getIds(a,s[c]):s[c]=t.getId(a,s[c]));return s}replaceIds(t,s,a){return this.replace(this.crossOriginIframeMirror,t,s,a)}replaceStyleIds(t,s,a){return this.replace(this.crossOriginIframeStyleMirror,t,s,a)}replaceIdOnNode(t,s){this.replaceIds(t,s,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(a=>{this.replaceIdOnNode(a,s)})}patchRootIdOnNode(t,s){t.type!==pn.Document&&!t.rootId&&(t.rootId=s),"childNodes"in t&&t.childNodes.forEach(a=>{this.patchRootIdOnNode(a,s)})}},Wr=class{constructor(t){I(this,"shadowDoms",new Map),I(this,"mutationCb"),I(this,"scrollCb"),I(this,"bypassOptions"),I(this,"mirror"),I(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,s){if(!Be(t)||this.shadowDoms.has(t))return;let a=[];this.shadowDoms.set(t,a);let r=gn({...this.bypassOptions,doc:s,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);a.push(r),a.push(yn({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),setTimeout(()=>{this.shadowDoms.get(t)===a&&(t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(T.host(t))),a.push(wn({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)))},0)}removeShadowRootsIn(t){if(this.shadowDoms.size===0)return;let s=T.shadowRoot(t);s&&(this.shadowDoms.has(s)&&this.removeShadowRoot(s),this.removeShadowRootsIn(s)),T.childNodes(t).forEach(a=>this.removeShadowRootsIn(a))}removeShadowRoot(t){let s=this.shadowDoms.get(t);this.shadowDoms.delete(t),s?.forEach(Ir)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,s){let a=this;this.restoreHandlers.push(Me(t.prototype,"attachShadow",function(r){return function(c){let f=r.call(this,c),m=T.shadowRoot(this);return m&&Fr(this)&&a.addShadowRoot(m,s),f}}))}reset(){this.restoreHandlers.forEach(Ir),this.restoreHandlers=[];let t=this.shadowDoms;this.shadowDoms=new Map,t.forEach(s=>s.forEach(Ir))}};function Ir(e){try{e()}catch{}}var Te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ua=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(Le=0;Le<Te.length;Le++)Ua[Te.charCodeAt(Le)]=Le;var Le,$a=function(e){var t=new Uint8Array(e),s,a=t.length,r="";for(s=0;s<a;s+=3)r+=Te[t[s]>>2],r+=Te[(t[s]&3)<<4|t[s+1]>>4],r+=Te[(t[s+1]&15)<<2|t[s+2]>>6],r+=Te[t[s+2]&63];return a%3===2?r=r.substring(0,r.length-1)+"=":a%3===1&&(r=r.substring(0,r.length-2)+"=="),r};var Ni=new Map;function Ba(e,t){let s=Ni.get(e);return s||(s=new Map,Ni.set(e,s)),s.has(t)||s.set(t,[]),s.get(t)}var bn=(e,t,s)=>{if(!e||!(Sn(e,t)||typeof e=="object"))return;let a=e.constructor.name,r=Ba(s,a),c=r.indexOf(e);return c===-1&&(c=r.length,r.push(e)),c};function tt(e,t,s){if(e instanceof Array)return e.map(a=>tt(a,t,s));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){let a=e.constructor.name,r=$a(e);return{rr_type:a,base64:r}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[tt(e.buffer,t,s),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let a=e.constructor.name,{src:r}=e;return{rr_type:a,src:r}}else if(e instanceof HTMLCanvasElement){let a="HTMLImageElement",r=e.toDataURL();return{rr_type:a,src:r}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[tt(e.data,t,s),e.width,e.height]};if(Sn(e,t)||typeof e=="object"){let a=e.constructor.name,r=bn(e,t,s);return{rr_type:a,index:r}}}}return e}var vn=(e,t,s)=>e.map(a=>tt(a,t,s)),Sn=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(r=>typeof t[r]=="function").find(r=>e instanceof t[r]);function Wa(e,t,s,a){let r=[],c=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let f of c)try{if(typeof t.CanvasRenderingContext2D.prototype[f]!="function")continue;let m=Me(t.CanvasRenderingContext2D.prototype,f,function(l){return function(...d){return ee(this.canvas,s,a,!0)||setTimeout(()=>{let i=vn(d,t,this);e(this.canvas,{type:Pe["2D"],property:f,args:i})},0),l.apply(this,d)}});r.push(m)}catch{let m=St(t.CanvasRenderingContext2D.prototype,f,{set(l){e(this.canvas,{type:Pe["2D"],property:f,args:[l],setter:!0})}});r.push(m)}return()=>{r.forEach(f=>f())}}function za(e){return e==="experimental-webgl"?"webgl":e}function Oi(e,t,s,a){let r=[];try{let c=Me(e.HTMLCanvasElement.prototype,"getContext",function(f){return function(m,...l){if(!ee(this,t,s,!0)){let d=za(m);if("__context"in this||(this.__context=d),a&&["webgl","webgl2"].includes(d))if(l[0]&&typeof l[0]=="object"){let i=l[0];i.preserveDrawingBuffer||(i.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return f.apply(this,[m,...l])}});r.push(c)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(c=>c())}}function Ii(e,t,s,a,r,c){let f=[],m=Object.getOwnPropertyNames(e);for(let l of m)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof e[l]!="function")continue;let d=Me(e,l,function(i){return function(...h){let o=i.apply(this,h);if(bn(o,c,this),"tagName"in this.canvas&&!ee(this.canvas,a,r,!0)){let n=vn(h,c,this),p={type:t,property:l,args:n};s(this.canvas,p)}return o}});f.push(d)}catch{let d=St(e,l,{set(i){s(this.canvas,{type:t,property:l,args:[i],setter:!0})}});f.push(d)}return f}function qa(e,t,s,a){let r=[];return typeof t.WebGLRenderingContext<"u"&&r.push(...Ii(t.WebGLRenderingContext.prototype,Pe.WebGL,e,s,a,t)),typeof t.WebGL2RenderingContext<"u"&&r.push(...Ii(t.WebGL2RenderingContext.prototype,Pe.WebGL2,e,s,a,t)),()=>{r.forEach(c=>c())}}var Cn=`(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = \\`\\${width}-\\${height}\\`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n`,Ai=typeof self<"u"&&self.Blob&&new Blob([Cn],{type:"text/javascript;charset=utf-8"});function Va(e){let t;try{if(t=Ai&&(self.URL||self.webkitURL).createObjectURL(Ai),!t)throw"";let s=new Worker(t,{name:e?.name});return s.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),s}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Cn),{name:e?.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var zr=class{constructor(t){I(this,"pendingCanvasMutations",new Map),I(this,"rafStamps",{latestId:0,invokeId:null}),I(this,"mirror"),I(this,"mutationCb"),I(this,"resetObservers"),I(this,"frozen",!1),I(this,"locked",!1),I(this,"processMutation",(l,d)=>{(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(d)});let{sampling:s="all",win:a,blockClass:r,blockSelector:c,recordCanvas:f,dataURLOptions:m}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,f&&s==="all"&&this.initCanvasMutationObserver(a,r,c),f&&typeof s=="number"&&this.initCanvasFPSObserver(s,a,r,c,{dataURLOptions:m})}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(t,s,a,r,c){let f=Oi(s,a,r,!0),m=new Map,l=new Va;l.onmessage=p=>{let{id:u}=p.data;if(m.set(u,!1),!("base64"in p.data))return;let{base64:g,type:S,width:v,height:b}=p.data;this.mutationCb({id:u,type:Pe["2D"],commands:[{property:"clearRect",args:[0,0,v,b]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:g}],type:S}]},0,0]}]})};let d=1e3/t,i=0,h,o=()=>{let p=[];return s.document.querySelectorAll("canvas").forEach(u=>{ee(u,a,r,!0)||p.push(u)}),p},n=p=>{if(i&&p-i<d){h=requestAnimationFrame(n);return}i=p,o().forEach(async u=>{var g;let S=this.mirror.getId(u);if(m.get(S)||u.width===0||u.height===0)return;if(m.set(S,!0),["webgl","webgl2"].includes(u.__context)){let b=u.getContext(u.__context);((g=b?.getContextAttributes())==null?void 0:g.preserveDrawingBuffer)===!1&&b.clear(b.COLOR_BUFFER_BIT)}let v=await createImageBitmap(u);l.postMessage({id:S,bitmap:v,width:u.width,height:u.height,dataURLOptions:c.dataURLOptions},[v])}),h=requestAnimationFrame(n)};h=requestAnimationFrame(n),this.resetObservers=()=>{f(),cancelAnimationFrame(h)}}initCanvasMutationObserver(t,s,a){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let r=Oi(t,s,a,!1),c=Wa(this.processMutation.bind(this),t,s,a),f=qa(this.processMutation.bind(this),t,s,a);this.resetObservers=()=>{r(),c(),f()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=s=>{this.rafStamps.latestId=s,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,s)=>{let a=this.mirror.getId(s);this.flushPendingCanvasMutationFor(s,a)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,s){if(this.frozen||this.locked)return;let a=this.pendingCanvasMutations.get(t);if(!a||s===-1)return;let r=a.map(f=>{let{type:m,...l}=f;return l}),{type:c}=a[0];this.mutationCb({id:s,type:c,commands:r}),this.pendingCanvasMutations.delete(t)}},qr=class{constructor(t){I(this,"trackedLinkElements",new WeakSet),I(this,"mutationCb"),I(this,"adoptedStyleSheetCb"),I(this,"styleMirror",new Lr),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,s){"_cssText"in s.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:s.id,attributes:s.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,s){if(t.length===0)return;let a={id:s,styleIds:[]},r=[];for(let c of t){let f;this.styleMirror.has(c)?f=this.styleMirror.getId(c):(f=this.styleMirror.add(c),r.push({styleId:f,rules:Array.from(c.rules||CSSRule,(m,l)=>({rule:ki(m,c.href),index:l}))})),a.styleIds.push(f)}r.length>0&&(a.styles=r),this.adoptedStyleSheetCb(a)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}},Vr=class{constructor(){I(this,"nodeMap",new WeakMap),I(this,"active",!1)}inOtherBuffer(t,s){let a=this.nodeMap.get(t);return a&&Array.from(a).some(r=>r!==s)}add(t,s){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(s))}destroy(){}},j,rt,ve,Ve=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((ls=e.contentWindow)==null?void 0:ls.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var he=Qn();function ye(e={}){let{emit:t,checkoutEveryNms:s,checkoutEveryNth:a,blockClass:r="rr-block",blockSelector:c=null,ignoreClass:f="rr-ignore",ignoreSelector:m=null,maskTextClass:l="rr-mask",maskTextSelector:d=null,inlineStylesheet:i=!0,maskAllInputs:h,maskInputOptions:o,slimDOMOptions:n,maskInputFn:p,maskTextFn:u,hooks:g,packFn:S,sampling:v={},dataURLOptions:b={},mousemoveWait:C,recordDOM:y=!0,recordCanvas:w=!1,recordCrossOriginIframes:E=!1,recordAfter:R=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:O=!1,collectFonts:M=!1,inlineImages:P=!1,plugins:A,keepIframeSrcFn:x=()=>!1,ignoreCSSAttributes:fe=new Set([]),errorHandler:ie}=e;Ea(ie);let $=E?window.parent===window:!0,U=!1;if(!$)try{window.parent.document&&(U=!1)}catch{U=!0}if($&&!t)throw new Error("emit function is required");if(!$&&!U)return()=>{};C!==void 0&&v.mousemove===void 0&&(v.mousemove=C),he.reset();let G=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}:o!==void 0?o:{password:!0},Z=zi(n);ba();let H,B=0,be=D=>{for(let Y of A||[])Y.eventProcessor&&(D=Y.eventProcessor(D));return S&&!U&&(D=S(D)),D};j=(D,Y)=>{let _=D;if(_.timestamp=ze(),_.type!==k.FullSnapshot&&!(_.type===k.IncrementalSnapshot&&_.data.source===L.Mutation)){ve.unfreeze();for(let te of _e)if(te.isFrozen())te.unfreeze();else break}if($)t?.(be(_),Y);else if(U){let te={type:"rrweb",event:be(_),origin:window.location.origin,isCheckout:Y};window.parent.postMessage(te,"*")}if(_.type===k.FullSnapshot)H=_,B=0;else if(_.type===k.IncrementalSnapshot){if(_.data.source===L.Mutation&&_.data.isAttachIframe)return;B++;let te=a&&B>=a,ue=s&&_.timestamp-H.timestamp>s;(te||ue)&&rt(!0)}};let N=D=>{j({type:k.IncrementalSnapshot,data:{source:L.Mutation,...D}})},me=D=>j({type:k.IncrementalSnapshot,data:{source:L.Scroll,...D}}),le=D=>j({type:k.IncrementalSnapshot,data:{source:L.CanvasMutation,...D}}),ke=D=>j({type:k.IncrementalSnapshot,data:{source:L.AdoptedStyleSheet,...D}}),K=new qr({mutationCb:N,adoptedStyleSheetCb:ke}),ne=new Br({mirror:he,mutationCb:N,stylesheetManager:K,recordCrossOriginIframes:E,wrappedEmit:j});for(let D of A||[])D.getMirror&&D.getMirror({nodeMirror:he,crossOriginIframeMirror:ne.crossOriginIframeMirror,crossOriginIframeStyleMirror:ne.crossOriginIframeStyleMirror});let Ee=new Vr;ve=new zr({recordCanvas:w,mutationCb:le,win:window,blockClass:r,blockSelector:c,mirror:he,sampling:v.canvas,dataURLOptions:b});let ge=new Wr({mutationCb:N,scrollCb:me,bypassOptions:{blockClass:r,blockSelector:c,maskTextClass:l,maskTextSelector:d,inlineStylesheet:i,maskInputOptions:G,dataURLOptions:b,maskTextFn:u,maskInputFn:p,recordCanvas:w,inlineImages:P,sampling:v,slimDOMOptions:Z,iframeManager:ne,stylesheetManager:K,canvasManager:ve,keepIframeSrcFn:x,processedNodeManager:Ee},mirror:he});rt=(D=!1)=>{if(!y)return;j({type:k.Meta,data:{href:window.location.href,width:ln(),height:an()}},D),K.reset(),ge.init(),ve.lock(),_e.forEach(_=>_.lock());let Y=xo(document,{mirror:he,blockClass:r,blockSelector:c,maskTextClass:l,maskTextSelector:d,inlineStylesheet:i,maskAllInputs:G,maskTextFn:u,maskInputFn:p,slimDOM:Z,dataURLOptions:b,recordCanvas:w,inlineImages:P,onSerialize:_=>{hn(_,he)&&ne.addIframe(_),fn(_,he)&&K.trackLinkElement(_),kr(_)&&ge.addShadowRoot(T.shadowRoot(_),document)},onIframeLoad:(_,te)=>{ne.attachIframe(_,te),ge.observeAttachShadow(_)},onStylesheetLoad:(_,te)=>{K.attachLinkElement(_,te)},keepIframeSrcFn:x});if(!Y)return console.warn("Failed to snapshot the document");j({type:k.FullSnapshot,data:{node:Y,initialOffset:on(window)}},D),ve.unlock(),_e.forEach(_=>_.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&K.adoptStyleSheets(document.adoptedStyleSheets,he.getId(document))};try{let D=[],Y=ue=>{var re;return F(Fa)({mutationCb:N,mousemoveCb:(W,Et)=>j({type:k.IncrementalSnapshot,data:{source:Et,positions:W}}),mouseInteractionCb:W=>j({type:k.IncrementalSnapshot,data:{source:L.MouseInteraction,...W}}),scrollCb:me,viewportResizeCb:W=>j({type:k.IncrementalSnapshot,data:{source:L.ViewportResize,...W}}),inputCb:W=>j({type:k.IncrementalSnapshot,data:{source:L.Input,...W}}),mediaInteractionCb:W=>j({type:k.IncrementalSnapshot,data:{source:L.MediaInteraction,...W}}),styleSheetRuleCb:W=>j({type:k.IncrementalSnapshot,data:{source:L.StyleSheetRule,...W}}),styleDeclarationCb:W=>j({type:k.IncrementalSnapshot,data:{source:L.StyleDeclaration,...W}}),canvasMutationCb:le,fontCb:W=>j({type:k.IncrementalSnapshot,data:{source:L.Font,...W}}),selectionCb:W=>{j({type:k.IncrementalSnapshot,data:{source:L.Selection,...W}})},customElementCb:W=>{j({type:k.IncrementalSnapshot,data:{source:L.CustomElement,...W}})},blockClass:r,ignoreClass:f,ignoreSelector:m,maskTextClass:l,maskTextSelector:d,maskInputOptions:G,inlineStylesheet:i,sampling:v,recordDOM:y,recordCanvas:w,inlineImages:P,userTriggeredOnInput:O,collectFonts:M,doc:ue,maskInputFn:p,maskTextFn:u,keepIframeSrcFn:x,blockSelector:c,slimDOMOptions:Z,dataURLOptions:b,mirror:he,iframeManager:ne,stylesheetManager:K,shadowDomManager:ge,processedNodeManager:Ee,canvasManager:ve,ignoreCSSAttributes:fe,plugins:((re=A?.filter(W=>W.observer))==null?void 0:re.map(W=>({observer:W.observer,options:W.options,callback:Et=>j({type:k.Plugin,data:{plugin:W.name,payload:Et}})})))||[]},g)},_=new Map;ne.addLoadListener(ue=>{try{let re=ue.contentDocument;if(_.has(re))return;_.set(re,Y(re))}catch(re){console.warn(re)}}),ne.addUnloadListener(ue=>{let re=_.get(ue);re&&(_.delete(ue),re(),ge.removeShadowRootsIn(ue),he.removeNodeFromMap(ue))});let te=()=>{rt(),D.push(Y(document)),Ve=!0};return["interactive","complete"].includes(document.readyState)?te():(D.push(Q("DOMContentLoaded",()=>{j({type:k.DomContentLoaded,data:{}}),R==="DOMContentLoaded"&&te()})),D.push(Q("load",()=>{j({type:k.Load,data:{}}),R==="load"&&te()},window))),()=>{[...D,..._.values()].forEach(ue=>{try{ue()}catch(re){String(re).toLowerCase().includes("cross-origin")||console.warn(re)}}),_.clear(),ne.destroy(),Ee.destroy(),ge.reset(),ve.reset(),Ve=!1,xa()}}catch(D){console.warn(D)}}ye.addCustomEvent=(e,t)=>{if(!Ve)throw new Error("please add custom event after start recording");j({type:k.Custom,data:{tag:e,payload:t}})};ye.addAnnotation=e=>{if(!Ve)throw new Error("please add annotation after recording started");j({type:k.Annotation,data:e})};ye.freezePage=()=>{ve.freeze(),_e.forEach(e=>e.freeze())};ye.takeFullSnapshot=e=>{if(!Ve)throw new Error("please take full snapshot after start recording");rt(e)};ye.mirror=he;var Di;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Di||(Di={}));var Ka=5*1e3;var{addCustomEvent:el,addAnnotation:tl}=ye,{freezePage:rl}=ye,{takeFullSnapshot:sl}=ye;var ja=1e4,Ct=48e3,Ga=1e3,Ha=3e4,Ya=2,Ja=e=>e.type===3&&e.data?.source===2&&e.data?.type===2;function Xa(e){let t=e.mode,s=Math.random().toString(36).slice(2,10),a=0,r=[],c=0,f=0,m=0,l=0,d=0,i=0,h,o=[[]];function n(C){let y=JSON.stringify(C);r.length===0&&(f=C.timestamp),m=C.timestamp,r.push(y),c+=y.length,Ja(C)&&l++}function p(){if(h!==void 0)return;let C=i+Ga-Date.now();C<=0?u(!1):h=setTimeout(()=>{u(!1)},C)}async function u(C){if(h!==void 0&&clearTimeout(h),h=void 0,r.length===0)return;let y=`[${r.join(",")}]`,w=new URLSearchParams({project:e.project,session:e.sessionId,seq:String(a++),page:s,start:String(f),end:String(m),clicks:String(l),errors:String(d),href:location.href.split("?")[0].slice(0,500)});e.distinctId&&w.set("d",e.distinctId),e.userId&&w.set("u",e.userId),r=[],c=0,l=0,d=0,i=Date.now();let E=O=>`${e.host}/r?${w}&enc=${O}`,R={"Content-Type":"text/plain"};try{if(C&&y.length<=Ct&&navigator.sendBeacon?.(E("json"),new Blob([y],{type:"text/plain"})))return;if(typeof CompressionStream>"u"){await fetch(E("json"),{method:"POST",body:y,headers:R,keepalive:y.length<=Ct});return}let O=await new Response(new Blob([y]).stream().pipeThrough(new CompressionStream("gzip"))).blob();await fetch(E("gzip"),{method:"POST",body:new Blob([O],{type:"text/plain"}),keepalive:O.size<=Ct})}catch{}}function g(C,y){if(t==="buffer"){y&&(o.push([]),o.length>2&&o.shift()),o[o.length-1].push(C);return}n(C),C.type===Ya?u(!1):c>Ct&&p()}let S=()=>{document.visibilityState==="hidden"&&u(!0)},v=ye({emit:g,checkoutEveryNms:t==="buffer"?Ha:void 0,maskAllInputs:!0,maskTextSelector:e.maskAllText?"*":void 0,blockSelector:e.blockSelector,recordCanvas:!1,collectFonts:!1,sampling:{mousemove:50,scroll:150,input:"last"}}),b=setInterval(()=>{u(!1)},ja);return addEventListener("visibilitychange",S),addEventListener("pagehide",S),{stop(){v?.(),clearInterval(b),removeEventListener("visibilitychange",S),removeEventListener("pagehide",S),u(!0)},flushBuffer(){if(t==="buffer"){t="record";for(let C of o.flat())n(C);o=[[]],u(!1)}},noteError(){d++}}}var Qa={startReplay:Xa};window.__glassReplay=Qa;})();\n', dashboardJs: 'var Zl=document.querySelector(\'meta[name="glass-base"]\')?.content??"",ir={base:Zl};function en(e){try{return localStorage.getItem(`glass:${e}`)}catch{return null}}function tn(e,t){try{t===null?localStorage.removeItem(`glass:${e}`):localStorage.setItem(`glass:${e}`,t)}catch{}}var le={get key(){return en("key")},set key(e){tn("key",e)},get showSql(){return en("show-sql")==="1"},set showSql(e){tn("show-sql",e?"1":null),document.documentElement.classList.toggle("show-sql",e)},get project(){return en("project")},set project(e){tn("project",e)}};function Le(){let e=location.hash.replace(/^#\\/?/,""),[t="",r=""]=e.split("?"),[n="reports",...s]=t.split("/").filter(Boolean).map(decodeURIComponent);return{page:n,rest:s,params:new URLSearchParams(r)}}function de(e,t={},r=!0){let n=Le().params,s=new URLSearchParams;if(r)for(let i of["project","from","to"])n.get(i)&&s.set(i,n.get(i));for(let[i,a]of Object.entries(t))a==null||a===""?s.delete(i):s.set(i,a);let o=s.toString();location.hash=`#/${e}${o?`?${o}`:""}`}function ce(e,t={}){let r=Le().params,n=new URLSearchParams;for(let o of["project","from","to"])r.get(o)&&n.set(o,r.get(o));for(let[o,i]of Object.entries(t))i&&n.set(o,i);let s=n.toString();return`#/${e}${s?`?${s}`:""}`}function Z(){let e=Le().params;return{project:e.get("project")??le.project??void 0,from:e.get("from")??"-30d",to:e.get("to")??void 0}}var Nt=class extends Error{status;hint;constructor(t,r,n){super(r),this.status=t,this.hint=n}};async function Mt(e,t,r,n){let s=new URL(`${ir.base}${t}`,location.origin);for(let[a,c]of Object.entries(n??{}))c!=null&&c!==""&&s.searchParams.set(a,String(c));let o=await fetch(s,{method:e,headers:{Authorization:`Bearer ${le.key??""}`,...r===void 0?{}:{"Content-Type":"application/json"}},body:r===void 0?void 0:JSON.stringify(r)}),i=await o.json().catch(()=>({}));if(!o.ok)throw o.status===401&&window.dispatchEvent(new CustomEvent("glass:unauthorized")),new Nt(o.status,i.error??`Request failed (${o.status})`,i.hint);return i}var U={get:(e,t)=>Mt("GET",e,void 0,t),post:(e,t={},r)=>Mt("POST",e,t,r),put:(e,t)=>Mt("PUT",e,t),patch:(e,t)=>Mt("PATCH",e,t),delete:(e,t)=>Mt("DELETE",e,void 0,t)};function Ot(e,t){if(!(t==null||t===!1)){if(Array.isArray(t)){for(let r of t)Ot(e,r);return}e.appendChild(typeof t=="object"?t:document.createTextNode(String(t)))}}function ec(e,t){for(let[r,n]of Object.entries(t))n==null||n===!1||(r.startsWith("on")&&typeof n=="function"?e.addEventListener(r.slice(2),n):r==="value"&&"value"in e?e.value=String(n):r==="checked"&&e instanceof HTMLInputElement?e.checked=!!n:e.setAttribute(r,n===!0?"":String(n)))}var tc=e=>!!e&&typeof e=="object"&&!(e instanceof Node)&&!Array.isArray(e);function g(e,t,...r){let n=document.createElement(e);return tc(t)?ec(n,t):Ot(n,t),Ot(n,r),n}var rc="http://www.w3.org/2000/svg";function je(e,t={},...r){let n=document.createElementNS(rc,e);for(let[s,o]of Object.entries(t))o!=null&&n.setAttribute(s,String(o));return Ot(n,r),n}function q(e,...t){e.replaceChildren(),Ot(e,t)}function J(e,t,r={}){return g("section",{class:`panel ${r.class??""}`},g("header",{class:"panel-head"},g("h2",{},e),r.actions?g("div",{class:"panel-actions"},r.actions):null),g("div",{class:"panel-body"},t),r.sql?.length?nc(r.sql):null)}function nc(e){return g("div",{class:"sql-pane"},g("div",{class:"sql-pane-head"},g("span",{},e.length===1?"Query":`${e.length} queries`),we(e.join(`;\n\n`),"Copy SQL")),...e.map(t=>g("pre",{class:"sql"},g("code",{},t.trim()))))}function we(e,t="Copy"){let r=g("button",{class:"ghost small",type:"button"},t);return r.addEventListener("click",async()=>{try{await navigator.clipboard.writeText(typeof e=="function"?e():e),r.textContent="Copied"}catch{r.textContent="Copy failed"}setTimeout(()=>{r.textContent=t},1500)}),r}function st(e="Loading"){return g("div",{class:"state loading",role:"status"},e)}function ne(e,t){return g("div",{class:"state empty"},g("p",{},e),t??null)}function Re(e){let t=e instanceof Error?e.message:String(e),r=e instanceof Nt?e.hint:void 0;return g("div",{class:"state error",role:"alert"},g("p",{},t),r?g("p",{class:"hint"},r):null)}function he(e,t){let r=g("div",{class:"later"},st(t));return e().then(n=>q(r,n),n=>q(r,Re(n))),r}function oe(e,t,r){return g("div",{class:"page-head"},g("div",{},g("h1",{},e),t?g("p",{class:"muted"},t):null),r?g("div",{class:"page-actions"},r):null)}function ye(e,t,r={}){let n=new Set(r.numeric??[]);return g("div",{class:"table-wrap"},g("table",{class:r.class??""},g("thead",{},g("tr",{},e.map((s,o)=>g("th",{class:n.has(o)?"num":""},s)))),g("tbody",{},t.map(s=>g("tr",{},s.map((o,i)=>g("td",{class:n.has(i)?"num":""},o)))))))}function It(e,t,r){return g("div",{class:"tabs",role:"tablist"},e.map(n=>g("button",{type:"button",role:"tab","aria-selected":String(n.value===t),class:n.value===t?"tab active":"tab",onclick:()=>r(n.value)},n.label)))}function fe(e,t="ok"){let r=g("div",{class:`toast ${t}`,role:"status"},e);document.body.appendChild(r),setTimeout(()=>r.remove(),3200)}function V(e){if(!Number.isFinite(e))return"\\u2013";let t=Math.abs(e);return t>=1e6?`${(e/1e6).toFixed(t>=1e7?0:1)}M`:t>=1e4?`${(e/1e3).toFixed(t>=1e5?0:1)}k`:Math.round(e).toLocaleString("en-US")}function Ei(e,t=2){return Number.isFinite(e)?e.toFixed(t):"\\u2013"}function te(e,t=1){return Number.isFinite(e)?`${(e*100).toFixed(t)}%`:"\\u2013"}function Ve(e){if(!Number.isFinite(e)||e<=0)return"0s";let t=Math.round(e);if(t<60)return`${t}s`;let r=Math.floor(t/60);return r<60?`${r}m ${t%60}s`:`${Math.floor(r/60)}h ${r%60}m`}function Ri(e,t){if(!t)return null;let r=(e-t)/t;return Math.abs(r)<.005?{text:"0%",direction:"flat"}:{text:`${r>0?"+":"\\u2212"}${Math.abs(r*100).toFixed(0)}%`,direction:r>0?"up":"down"}}var rn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function or(e,t){let r=new Date(e);return t==="hour"?`${String(r.getUTCHours()).padStart(2,"0")}:00`:t==="month"?`${rn[r.getUTCMonth()]} ${r.getUTCFullYear()}`:`${r.getUTCDate()} ${rn[r.getUTCMonth()]}`}function Pe(e){let t=new Date(e);return`${t.getDate()} ${rn[t.getMonth()]} ${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}function Dt(e){let t=(Date.now()-new Date(e).getTime())/1e3;return t<60?"just now":t<3600?`${Math.floor(t/60)} min ago`:t<86400?`${Math.floor(t/3600)} h ago`:`${Math.floor(t/86400)} d ago`}function sc(e){let t=Z().project;return[he(async()=>{let r=await U.get(`/api/events/${encodeURIComponent(e)}`,{project:t}),n=g("input",{type:"text",value:r.description,placeholder:"How and when this fires, e.g. Fired when payment succeeds after checkout"}),s=g("input",{type:"text",value:r.owner,placeholder:"team or person"}),o=new Map(r.properties.map(a=>[a.name,g("input",{type:"text",value:a.description,placeholder:"What this property means and which values to expect","aria-label":`Description of ${a.name}`})])),i=g("form",{class:"stack"},g("label",{class:"field"},g("span",{},"Description"),n),g("label",{class:"field"},g("span",{},"Owner"),s),g("div",{class:"form-actions"},g("button",{type:"submit",class:"primary"},"Save description")));return i.addEventListener("submit",async a=>{a.preventDefault();try{await U.put(`/api/events/${encodeURIComponent(e)}`,{project:t,description:n.value,owner:s.value,properties:Object.fromEntries([...o].map(([c,u])=>[c,u.value]).filter(([,c])=>c))}),fe("Saved")}catch(c){fe(c instanceof Error?c.message:String(c),"error")}}),[oe(r.event,r.summary,we(`glass.capture(\'${r.event}\', {})`,"Copy capture code")),g("div",{class:"grid-2"},J("Definition",i),J("Explore",g("ul",{class:"plain"},g("li",{},g("a",{href:ce("insights/trends",{spec:JSON.stringify({series:[{event:r.event}],interval:"day"})})},"Trend over time")),g("li",{},g("a",{href:ce("insights/retention",{spec:JSON.stringify({cohortEvent:{event:r.event},returnEvent:{event:r.event},period:"week",periods:8})})},"Retention of people who did it"))))),J("Properties",r.properties.length?ye(["Property","Type","Present on","Examples","Meaning"],r.properties.map(a=>[g("code",{},a.name),a.types.join(", "),te(a.coverage,0),g("span",{class:"muted"},a.examples.join(", ")),o.get(a.name)]),{numeric:[2]}):ne("No properties sent with this event."),{sql:r.sql})]})]}function ki(e){if(e.rest[0])return sc(e.rest[0]);let t=Z().project;return[oe("Events","Everything tracked in the last 30 days. Document custom events with how/when they fire and what each property means \\u2014 agents need that before querying them."),he(async()=>{let r=await U.get("/api/events",{project:t});return r.events.length===0?ne("No events yet."):[r.undocumented.length?g("p",{class:"notice"},`${r.undocumented.length} custom event${r.undocumented.length===1?" has":"s have"} no description yet. Open each and add how/when it fires plus property meanings.`):null,ye(["Event","Count","Last seen","Description"],r.events.map(n=>[g("a",{href:ce(`events/${encodeURIComponent(n.event)}`)},g("code",{},n.event)),V(n.count),Dt(n.lastSeen),n.system?g("span",{class:"muted"},"Built in"):n.description||g("span",{class:"muted"},"No description")]),{numeric:[1]})]})]}function Mi(e){let t=Z().project,r=e.params.get("query")??`SELECT event, COUNT(*) AS n\nFROM events\nWHERE project = \'${t??"default"}\'\n AND ts_ms >= ${Date.now()-7*864e5}\nGROUP BY event\nORDER BY n DESC`,n=g("textarea",{class:"sql-editor",rows:10,spellcheck:!1,"aria-label":"SQL query"},r),s=g("div",{}),o=async()=>{q(s,st("Running"));try{let i=await U.post("/api/sql",{project:t,query:n.value});q(s,J("Rows",i.rows.length?ye(i.columns,i.rows.map(c=>i.columns.map(u=>c[u]===null?g("span",{class:"muted"},"null"):String(c[u])))):ne("The query returned no rows."),{actions:g("span",{class:"muted"},i.summary)}));let a=new URLSearchParams(e.params);a.set("query",n.value),history.replaceState(null,"",`#/sql?${a}`)}catch(i){q(s,Re(i))}};return n.addEventListener("keydown",i=>{i.key==="Enter"&&(i.metaKey||i.ctrlKey)&&o()}),[oe("SQL","One read-only SELECT against your events. Timestamps are epoch milliseconds in ts_ms."),J("Query",[n,g("div",{class:"form-actions"},g("button",{type:"button",class:"primary",onclick:()=>{o()}},"Run"),g("span",{class:"muted small"},"Ctrl or \\u2318 + Enter"))]),s]}function ic(){let e=g("input",{type:"text",required:!0,placeholder:"pricing-page-v2"}),t=g("input",{type:"text",required:!0,placeholder:"signup_completed"}),r=g("input",{type:"text",placeholder:"Showing annual pricing first increases signups"}),n=g("div",{}),s=g("form",{class:"stack"},g("label",{class:"field"},g("span",{},"Key (also the flag key)"),e),g("label",{class:"field"},g("span",{},"Goal event"),t),g("label",{class:"field"},g("span",{},"Hypothesis"),r),n,g("div",{class:"form-actions"},g("button",{type:"submit",class:"primary"},"Create experiment")));return s.addEventListener("submit",async o=>{o.preventDefault();try{await U.post("/api/experiments",{project:Z().project,key:e.value,goal:{event:t.value},hypothesis:r.value||void 0}),fe("Experiment created"),de(`experiments/${encodeURIComponent(e.value)}`)}catch(i){q(n,Re(i))}}),s}function oc(e){return g("div",{},g("p",{class:"summary"},e.summary),e.srm.mismatch?g("p",{class:"state error"},`Sample ratio mismatch (p = ${e.srm.pValue.toExponential(1)}). Exposure tracking or assignment is broken.`):null,ye(["Variant","Exposed","Converted","Rate","95% interval","Chance to beat control","Lift (95% interval)"],e.variants.map(t=>[g("strong",{},t.variant),V(t.exposures),V(t.conversions),te(t.conversionRate),`${te(t.rateInterval[0])} to ${te(t.rateInterval[1])}`,t.vsControl?g("span",{class:t.vsControl.probabilityToBeatControl>=.95?"good":""},te(t.vsControl.probabilityToBeatControl,0)):"control",t.vsControl?`${te(t.vsControl.expectedLift,0)} (${te(t.vsControl.liftInterval[0],0)} to ${te(t.vsControl.liftInterval[1],0)})`:""]),{numeric:[1,2,3]}),e.excludedMultipleVariants?g("p",{class:"muted"},`${V(e.excludedMultipleVariants)} people saw more than one variant and are excluded.`):null)}function ac(e){let t=Z().project;return[he(async()=>{let r=await U.get(`/api/experiments/${encodeURIComponent(e)}`,{project:t}),n=r.experiment,s=async(i,a)=>{try{await U.post(`/api/experiments/${encodeURIComponent(e)}/${i}`,{project:t,variant:a}),fe(i==="ship"?`Shipped ${a}`:i==="start"?"Experiment started":"Experiment stopped"),de(`experiments/${encodeURIComponent(e)}`,{t:String(Date.now())})}catch(c){fe(c instanceof Error?c.message:String(c),"error")}},o=[n.status==="draft"||n.status==="stopped"?g("button",{type:"button",class:"primary",onclick:()=>s("start")},n.status==="draft"?"Start experiment":"Restart"):null,n.status==="running"?g("button",{type:"button",class:"ghost",onclick:()=>s("stop")},"Stop"):null,n.status!=="shipped"?r.results.variants.map(i=>g("button",{type:"button",class:"ghost",onclick:()=>s("ship",i.variant)},`Ship ${i.variant}`)):null];return[oe(n.key,n.hypothesis||`Goal: ${n.goal.event}`,we(`if (glass.flag(\'${n.flag}\') === \'test\') {\n // show the new variant\n}`,"Copy code")),g("p",{class:"muted"},g("span",{class:`badge ${n.status==="running"?"good":""}`},n.status)," Flag ",g("a",{href:ce(`flags/${encodeURIComponent(n.flag)}`)},n.flag),`, goal ${n.goal.event}`,n.startedAt?`, started ${Pe(n.startedAt)}`:"",n.shippedVariant?`, shipped ${n.shippedVariant}`:"","."),g("div",{class:"page-actions"},o),J("Results",oc(r.results),{sql:r.results.sql})]})]}function Ni(e){let t=Z().project,r=e.rest[0];return r==="new"?[oe("New experiment"),J("Experiment",ic())]:r?ac(r):[oe("Experiments","A/B tests on top of flags. Results update as exposures and conversions arrive.",g("a",{class:"button primary",href:ce("experiments/new")},"New experiment")),he(async()=>{let{experiments:n}=await U.get("/api/experiments",{project:t});return n.length===0?ne("No experiments yet. Create one here, or ask your agent to use create_experiment."):ye(["Experiment","Status","Goal","Started"],n.map(s=>[g("a",{href:ce(`experiments/${encodeURIComponent(s.key)}`)},s.key),g("span",{class:`badge ${s.status==="running"?"good":""}`},s.status),s.goal.event,s.startedAt?Pe(s.startedAt):"not started"]))})]}function Oi(e){let t=Z().project,r=g("input",{type:"text",value:e?.key??"",required:!0,pattern:"[A-Za-z0-9][A-Za-z0-9_.-]*",disabled:!!e,placeholder:"new-checkout"}),n=g("input",{type:"text",value:e?.description??"",placeholder:"What this flag controls"}),s=g("input",{type:"checkbox",checked:e?.enabled??!0}),o=g("input",{type:"range",min:0,max:100,step:1,value:e?.rollout??100}),i=g("output",{},`${e?.rollout??100}%`);o.addEventListener("input",()=>{i.textContent=`${o.value}%`});let a=g("input",{type:"text",value:(e?.variants??[]).map(h=>`${h.key}:${h.weight}`).join(", "),placeholder:"control:50, test:50 (leave empty for on/off)"}),c=g("textarea",{rows:5,spellcheck:!1,placeholder:\'[{"conditions":[{"property":"person.plan","value":"pro"}],"rollout":100}]\'},e?.rules?.length?JSON.stringify(e.rules,null,2):""),u=g("div",{}),l=g("form",{class:"stack"},g("label",{class:"field"},g("span",{},"Key"),r),g("label",{class:"field"},g("span",{},"Description"),n),g("label",{class:"switch"},s,"Enabled"),g("label",{class:"field"},g("span",{},"Rollout"),g("div",{class:"range"},o,i)),g("label",{class:"field"},g("span",{},"Variants"),a),g("label",{class:"field"},g("span",{},"Targeting rules (JSON, first match wins)"),c),u,g("div",{class:"form-actions"},g("button",{type:"submit",class:"primary"},e?"Save changes":"Create flag")));return l.addEventListener("submit",async h=>{h.preventDefault();try{let p=a.value.trim()?a.value.split(",").map(m=>{let[f,y]=m.trim().split(":");return{key:f.trim(),weight:Number(y??1)}}):[],d={project:t,description:n.value||void 0,enabled:s.checked,rollout:Number(o.value),variants:p.length?p:void 0,rules:c.value.trim()?JSON.parse(c.value):[]};await U.put(`/api/flags/${encodeURIComponent(r.value)}`,d),fe(e?"Flag saved":"Flag created"),de("flags")}catch(p){q(u,Re(p))}}),l}function Ii(e){let t=Z().project,r=e.rest[0];return r==="new"?[oe("New flag"),J("Definition",Oi(null))]:r?[oe(r,\'Read it in code with glass.flag(key): "on", a variant key, or null.\',we(`glass.flag(\'${r}\')`,"Copy code")),he(async()=>{let{flag:n}=await U.get(`/api/flags/${encodeURIComponent(r)}`,{project:t});return J("Definition",Oi(n))})]:[oe("Flags","Feature flags, evaluated in your Worker. Assignment is stable per device.",g("a",{class:"button primary",href:ce("flags/new")},"New flag")),he(async()=>{let{flags:n}=await U.get("/api/flags",{project:t});return n.length===0?ne("No flags yet. Create one here, or ask your agent to use the save_flag tool."):ye(["Flag","Status","Rollout","Variants","Rules"],n.map(s=>[g("a",{href:ce(`flags/${encodeURIComponent(s.key)}`)},s.key),g("span",{class:`badge ${s.enabled?"good":""}`},s.enabled?"On":"Off"),`${s.rollout}%`,(s.variants??[]).map(o=>o.key).join(", ")||"on/off",String(s.rules?.length??0)]),{numeric:[2,4]})})]}var dt=["var(--glass-green)","var(--glass-cobalt)","var(--glass-amber)","var(--glass-ruby)","var(--smoke)","var(--glass-teal)"];function lc(e){if(e<=0)return 1;let t=10**Math.floor(Math.log10(e)),r=e/t;return Math.max(r<=1?1:r<=2?2:r<=5?5:10,t<1?1:0)*t}function cc(e){let t=Math.max(1,lc(e/4)),r=[0];for(;r[r.length-1]<e;)r.push(r[r.length-1]+t);return r.length<2&&r.push(t),r}function ar(e,t,r,n={}){let o=n.height??220,i={top:12,right:12,bottom:26,left:44},a=760-i.left-i.right,c=o-i.top-i.bottom,u=cc(Math.max(0,...t.flatMap(v=>v.values))),l=u[u.length-1],h=v=>i.left+(e.length<=1?a/2:v/(e.length-1)*a),p=v=>i.top+c-v/l*c,d=u.map(v=>je("g",{},je("line",{x1:i.left,x2:760-i.right,y1:p(v),y2:p(v),class:"grid"}),je("text",{x:i.left-8,y:p(v)+4,class:"axis","text-anchor":"end"},V(v)))),m=Math.max(1,Math.ceil(e.length/8)),f=e.map((v,R)=>R%m===0?je("text",{x:h(R),y:o-6,class:"axis","text-anchor":"middle"},or(v,r)):null),y=t.map((v,R)=>{let k=dt[R%dt.length],O=v.values.map((_,D)=>`${D?"L":"M"}${h(D).toFixed(1)},${p(_).toFixed(1)}`).join(" "),M=R===0&&t.length===1?je("path",{d:`${O} L${h(v.values.length-1)},${p(0)} L${h(0)},${p(0)} Z`,fill:k,class:"area"}):null;return je("g",{},M,je("path",{d:O,stroke:k,class:"line"}))}),b=je("line",{y1:i.top,y2:i.top+c,class:"cursor",visibility:"hidden"}),w=je("svg",{viewBox:`0 0 760 ${o}`,class:"chart",role:"img","aria-label":t.map(v=>v.label).join(", ")},...d,...f,...y,b),x=g("div",{class:"readout",hidden:!0}),E=t.length>1?g("ul",{class:"legend"},t.map((v,R)=>g("li",{},g("span",{class:"swatch",style:`background:${dt[R%dt.length]}`}),v.label))):null,S=g("div",{class:"chart-wrap"},w,x,E);return w.addEventListener("mousemove",v=>{let R=v,k=w.getBoundingClientRect(),O=(R.clientX-k.left)/k.width*760,M=Math.max(0,Math.min(e.length-1,Math.round((O-i.left)/a*(e.length-1))));b.setAttribute("x1",String(h(M))),b.setAttribute("x2",String(h(M))),b.setAttribute("visibility","visible"),x.hidden=!1,x.replaceChildren(g("strong",{},or(e[M]??0,r)),...t.map((_,D)=>g("span",{},g("span",{class:"swatch",style:`background:${dt[D%dt.length]}`}),`${_.label} ${V(_.values[M]??0)}`))),x.style.left=`${h(M)/760*100}%`}),w.addEventListener("mouseleave",()=>{b.setAttribute("visibility","hidden"),x.hidden=!0}),S}function Di(e,t){let r=Math.max(1,...e.map(n=>n.value));return g("div",{class:"bar-list"},g("div",{class:"bar-head"},g("span",{},t[0]),g("span",{class:"num"},t[1]),t[2]?g("span",{class:"num"},t[2]):null),e.map(n=>g("div",{class:"bar-row",title:n.label},g("span",{class:"bar-fill",style:`width:${n.value/r*100}%`}),n.href?g("a",{class:"bar-label",href:n.href},n.label):g("span",{class:"bar-label"},n.label),g("span",{class:"num"},V(n.value)),n.secondary!==void 0?g("span",{class:"num muted"},V(n.secondary)):null)))}function At(e,t,r){return g("div",{class:"funnel-kpi"},g("div",{class:"funnel-kpi-value"},t),g("div",{class:"funnel-kpi-label"},e),r?g("div",{class:"funnel-kpi-hint muted"},r):null)}function Ai(e,t={}){let r=e[0],n=e[e.length-1],s=Math.max(1,r.count),o=r.count?n.count/r.count:0,i=Math.max(0,r.count-n.count),a=e.length>1?e.slice(1).reduce((l,h)=>l+(h.avgSecondsFromPrevious??0),0):null,c=g("ol",{class:"funnel-steps"},e.map((l,h)=>{let p=h>0?e[h-1]:null,d=p?Math.max(0,p.count-l.count):0,m=p&&p.count?d/p.count:0,f=p&&g("li",{class:"funnel-bridge","aria-hidden":"true"},g("div",{class:"funnel-bridge-rail"},g("span",{class:"funnel-bridge-convert"},`${te(l.conversionFromPrevious,1)} converted`),g("span",{class:"funnel-bridge-drop"},`${te(m,1)} dropped \\xB7 ${V(d)}`),l.avgSecondsFromPrevious!==null?g("span",{class:"funnel-bridge-time muted"},`avg ${Ve(l.avgSecondsFromPrevious)}`):null)),y=g("li",{class:"funnel-step"},g("div",{class:"funnel-step-index","aria-hidden":"true"},String(h+1)),g("div",{class:"funnel-step-main"},g("div",{class:"funnel-step-head"},g("div",{class:"funnel-step-title"},g("span",{class:"step-name"},l.label),g("span",{class:"funnel-step-count"},V(l.count))),g("div",{class:"funnel-step-rates"},g("span",{class:"funnel-rate-primary"},te(l.conversionFromStart,1)),g("span",{class:"muted"},"of start"),h>0?g("span",{class:"funnel-rate-prev muted"},`${te(l.conversionFromPrevious,1)} of previous`):null)),g("div",{class:"funnel-track",title:`${V(l.count)} people`},g("div",{class:"funnel-bar",style:`width:${Math.max(l.count?2:0,l.count/s*100)}%`}))));return f?[f,y]:y})),u=t.breakdowns&&t.breakdowns.length?g("div",{class:"funnel-breakdowns"},g("h3",{class:"funnel-breakdowns-title"},"Breakdown"),g("div",{class:"table-wrap"},g("table",{class:"funnel-breakdown-table"},g("thead",{},g("tr",{},g("th",{},"Segment"),...e.map(l=>g("th",{class:"num"},l.label)),g("th",{class:"num"},"Conversion"))),g("tbody",{},t.breakdowns.map(l=>{let h=l.steps[0]?.count??0,p=l.steps[l.steps.length-1]?.count??0,d=h?p/h:0;return g("tr",{},g("td",{},g("code",{},l.value)),...l.steps.map(m=>g("td",{class:"num"},g("div",{class:"funnel-bd-count"},V(m.count)),g("div",{class:"muted small"},te(m.conversionFromStart,0)))),g("td",{class:"num"},g("div",{class:"funnel-bd-conv"},g("span",{class:"funnel-bd-conv-bar",style:`width:${d*100}%`}),g("span",{},te(d,1)))))}))))):null;return g("div",{class:"funnel-view"},g("div",{class:"funnel-kpis"},At("Conversion",te(o,1),`${V(n.count)} of ${V(r.count)}`),At("Completed",V(n.count),n.label),At("Drop-off",V(i),r.count?te(i/r.count,1):void 0),a!==null&&a>0?At("Avg. time",Ve(a),"start \\u2192 finish"):null,t.windowSeconds?At("Window",Ve(t.windowSeconds),"to complete"):null),c,u)}function Ti(e,t,r){let n=t.length,s=(o,i)=>g("td",{class:"num heat",style:`--heat:${Math.round(o*100)}`,title:`${V(i)} people`},te(o,0));return g("div",{class:"table-wrap"},g("table",{class:"retention"},g("thead",{},g("tr",{},g("th",{},"Cohort"),g("th",{class:"num"},"People"),Array.from({length:n},(o,i)=>g("th",{class:"num"},`${r[0].toUpperCase()}${i}`)))),g("tbody",{},g("tr",{class:"average"},g("td",{},"Average"),g("td",{},""),t.map(o=>s(o,0))),e.map(o=>g("tr",{},g("td",{},or(o.start,r==="month"?"month":"day")),g("td",{class:"num"},V(o.size)),o.rates.map((i,a)=>s(i,o.counts[a]??0)))))))}var nn={$pageview:"Automatic page view captured by the Glass snippet whenever the URL changes.",$pageleave:"Fired when the user leaves a page (tab hide or navigation). Used for time-on-page.",$click:"Automatic click on links, buttons and elements with data-glass-event.",$exception:"Uncaught JavaScript error or unhandled promise rejection.",$web_vitals:"Core Web Vitals (LCP, CLS, INP) reported by the browser.",$identify:"Links an anonymous device to your user id via glass.identify().",$set:"Updates person properties without changing identity.",$exposure:"Someone was assigned a feature-flag variant (used by experiments)."},Lt=[{name:"path",description:"URL path of the page, e.g. /pricing.",group:"Page"},{name:"host",description:"Hostname of the page URL.",group:"Page"},{name:"url",description:"Full page URL including query string.",group:"Page"},{name:"title",description:"document.title at capture time.",group:"Page"},{name:"referrer_host",description:"Hostname of the referrer, e.g. news.ycombinator.com.",group:"Acquisition"},{name:"referrer",description:"Full referrer URL (query stripped).",group:"Acquisition"},{name:"utm_source",description:"utm_source query parameter.",group:"Acquisition"},{name:"utm_medium",description:"utm_medium query parameter.",group:"Acquisition"},{name:"utm_campaign",description:"utm_campaign query parameter.",group:"Acquisition"},{name:"utm_term",description:"utm_term query parameter.",group:"Acquisition"},{name:"utm_content",description:"utm_content query parameter.",group:"Acquisition"},{name:"country",description:"ISO country from the request edge (Cloudflare).",group:"Geo"},{name:"region",description:"Region / subdivision from the request edge.",group:"Geo"},{name:"city",description:"City from the request edge.",group:"Geo"},{name:"device",description:"desktop, mobile or tablet.",group:"Device"},{name:"browser",description:"Browser family: Chrome, Safari, Firefox, \\u2026",group:"Device"},{name:"os",description:"Operating system family.",group:"Device"},{name:"distinct_id",description:"Anonymous device id (stable across identify).",group:"Identity"},{name:"user_id",description:"Your user id after glass.identify().",group:"Identity"},{name:"person_id",description:"Resolved person id (user_id or distinct_id).",group:"Identity"},{name:"session_id",description:"Browser session id.",group:"Identity"}],Li=new Map,Pi=new Map,_i=new Map,Tt=new Map;function lr(e){return e??""}function $i(e){for(let t of Tt.keys())t.split("::")[1]===e&&Tt.delete(t)}function Fi(e){let t=lr(e),r=Li.get(t);return r||(r=U.get("/api/events",{project:e,days:30}).then(n=>n.events.map(s=>({...s,description:s.description||nn[s.event]||""}))).catch(()=>[]),Li.set(t,r)),r}function Pt(e,t){let r=`${lr(t)}::${e}`,n=Pi.get(r);return n||(n=U.get(`/api/events/${encodeURIComponent(e)}`,{project:t}).then(s=>({...s,description:s.description||nn[s.event]||""})).catch(()=>({event:e,description:nn[e]||"",owner:"",sampled:0,lastSeen:null,properties:[]})),Pi.set(r,n)),n}function cr(e){let t=lr(e),r=_i.get(t);return r||(r=U.get("/api/person-properties",{project:e}).then(n=>n.properties).catch(()=>[]),_i.set(t,r)),r}function sn(e,t={}){let r=t.query?.trim().toLowerCase()??"",n=[lr(t.project),e,t.event??"",r].join("::"),s=Tt.get(n);return s||(s=U.get("/api/properties/values",{project:t.project,property:e,event:t.event,query:r,limit:50}).then(o=>o.values).catch(()=>(Tt.delete(n),[])),Tt.set(n,s)),s}function ur(){document.querySelectorAll(".picker-pop").forEach(e=>e.remove()),document.querySelectorAll(".picker.open").forEach(e=>e.classList.remove("open"))}function it(e,t,r=680){let n=e.getBoundingClientRect(),s=Math.min(r,Math.max(Math.min(420,r),window.innerWidth-24)),o=n.left;o+s>window.innerWidth-12&&(o=Math.max(12,window.innerWidth-s-12));let i=n.bottom+6,a=380;i+a>window.innerHeight-12&&(i=Math.max(12,n.top-a-6)),t.style.width=`${s}px`,t.style.left=`${Math.round(o)}px`,t.style.top=`${Math.round(i)}px`}var qi=e=>e==="cohort"?"Cohort":e;function Bi(e,t,r){let n=!e,s=g("button",{type:"button",class:`picker-trigger${n?" empty":""}`,"aria-haspopup":"listbox","aria-expanded":"false"},g("span",{class:"picker-trigger-value"},n?t:qi(e)),g("span",{class:"picker-chevron","aria-hidden":"true"},"\\u25BE"));return s.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation(),r()}),s}function ji(){let e=g("aside",{class:"picker-detail","aria-live":"polite"});return{root:e,show:t=>q(e,t)}}function $t(e){return g("div",{class:"picker-detail-empty"},g("p",{class:"muted"},e))}function uc(e,t){return[g("div",{class:"picker-detail-head"},g("h3",{},e.event),t?g("span",{class:"muted"},`${V(t.count)} in 30d`):null),e.description?g("p",{class:"picker-detail-desc"},e.description):g("p",{class:"muted"},"No description yet. Document this event under Events so agents know when it fires."),e.owner?g("p",{class:"muted small"},`Owner: ${e.owner}`):null,e.properties.length?g("div",{class:"picker-detail-props"},g("h4",{},"Properties"),g("ul",{},e.properties.slice(0,12).map(r=>g("li",{},g("code",{},r.name),g("span",{class:"muted"},r.types.join("|")||"\\u2014"),g("span",{class:"picker-detail-prop-desc"},r.description||(r.examples.length?`e.g. ${r.examples.slice(0,3).join(", ")}`:""))))),e.properties.length>12?g("p",{class:"muted small"},`+${e.properties.length-12} more`):null):g("p",{class:"muted small"},"No custom properties seen on recent events."),g("a",{class:"picker-detail-link",href:ce(`events/${encodeURIComponent(e.event)}`)},"Open in Events")]}function _t(e){return[g("div",{class:"picker-detail-head"},g("h3",{},e.name)),g("p",{class:"picker-detail-desc"},e.description||"No description for this property yet."),e.types?.length?g("p",{class:"muted small"},`Type: ${e.types.join(", ")}${e.coverage!=null?` \\xB7 ${te(e.coverage,0)} of recent events`:""}`):null,e.examples?.length?g("p",{class:"muted small"},`Examples: ${e.examples.slice(0,5).join(", ")}`):null]}function zi(e,t,r,n,s,o){let i="",a=[];t.length===0&&a.push(g("p",{class:"picker-empty muted"},"No matches."));for(let c of t)c.group!==i&&(i=c.group,c.group.trim()&&a.push(g("div",{class:"picker-group-label"},c.group))),a.push(g("button",{type:"button",class:`picker-item${c.id===r?" selected":""}${c.id===n?" active":""}`,role:"option","aria-selected":String(c.id===r),"data-id":c.id,onmouseenter:()=>s(c.id),onclick:u=>{u.preventDefault(),o(c.id)}},g("span",{class:"picker-item-name"},c.label),c.meta?g("span",{class:"picker-item-meta"},c.meta):null));q(e,a),e.querySelector(".picker-item.active, .picker-item.selected")?.scrollIntoView({block:"nearest"})}function ot(e){let t=e.project??Z().project,r=e.placeholder??"Select an event",n=g("div",{class:"picker","aria-label":e.label??"Event"}),s=Bi(e.value,r,()=>u());n.append(s);let o=[],i="",a=e.value,c=0,u=()=>{ur(),n.classList.add("open"),s.setAttribute("aria-expanded","true");let l=g("input",{type:"search",class:"picker-search",placeholder:"Search events\\u2026",value:i,"aria-label":"Search events",autocomplete:"off"}),h=g("div",{class:"picker-list",role:"listbox"}),p=ji(),d=g("div",{class:"picker-pop",role:"dialog","aria-label":"Choose an event"},l,g("div",{class:"picker-body"},h,p.root));document.body.append(d),it(s,d),l.focus();let m=()=>{let v=i.trim().toLowerCase(),R=o.filter(D=>!v||D.event.toLowerCase().includes(v)||D.description.toLowerCase().includes(v)),k=o.filter(D=>!D.system),O=o.filter(D=>D.system),_=[...k,...O].filter(D=>R.includes(D)).map(D=>({id:D.event,label:D.event,meta:V(D.count),group:D.system?"Built-in":"Your events",search:`${D.event} ${D.description}`.toLowerCase()}));return v&&!o.some(D=>D.event.toLowerCase()===v)&&_.unshift({id:i.trim(),label:`Use \\u201C${i.trim()}\\u201D`,meta:"new",group:"Custom",search:v}),_},f=v=>{a=v;let R=o.find(O=>O.event===v);if(!v){p.show($t("Hover an event to see its description and properties."));return}let k=++c;p.show(g("div",{class:"picker-detail-loading muted"},"Loading\\u2026")),Pt(v,t).then(O=>{k===c&&(e.onDetail?.(O),p.show(uc(O,R)))})},y=()=>{let v=m();v.some(R=>R.id===a)||(a=v[0]?.id??""),zi(h,v,e.value,a,f,b),a?f(a):p.show($t("Hover an event to see its description and properties."))},b=v=>{e.onChange(v),q(s.querySelector(".picker-trigger-value"),v||r),s.classList.toggle("empty",!v),E()},w=v=>{let R=m(),k=R.findIndex(O=>O.id===a);v.key==="Escape"?(v.preventDefault(),E()):v.key==="ArrowDown"?(v.preventDefault(),a=R[Math.min(R.length-1,k+1)]?.id??a,y()):v.key==="ArrowUp"?(v.preventDefault(),a=R[Math.max(0,k-1)]?.id??a,y()):v.key==="Enter"&&(v.preventDefault(),a&&b(a))},x=v=>{v.target instanceof Node&&(d.contains(v.target)||n.contains(v.target))||E()},E=()=>{d.remove(),n.classList.remove("open"),s.setAttribute("aria-expanded","false"),window.removeEventListener("keydown",w,!0),window.removeEventListener("resize",S),document.removeEventListener("mousedown",x,!0)},S=()=>it(s,d);l.addEventListener("input",()=>{i=l.value,y()}),window.addEventListener("keydown",w,!0),window.addEventListener("resize",S),document.addEventListener("mousedown",x,!0),p.show($t("Loading events\\u2026")),Fi(t).then(v=>{o=v,!a&&e.value&&(a=e.value),y()})};return n}var Ui="People in (or not in) a saved cohort. Pick the cohorts as values; define cohorts on the People tab.";function Ft(e){let t=e.project??Z().project,r=e.columns!==!1,n=e.allowCustom!==!1,s=e.clearable===!0,o=e.eventProperties!==!1,i=e.person!==!1,a=e.cohorts===!0,c=e.placeholder??"Select a property",u=g("div",{class:"picker","aria-label":e.label??"Property"}),l=Bi(e.value,c,()=>f());u.append(l);let h=[],p=[],d="",m=e.value,f=()=>{ur(),u.classList.add("open"),l.setAttribute("aria-expanded","true");let y=g("input",{type:"search",class:"picker-search",placeholder:"Search properties\\u2026",value:d,"aria-label":"Search properties",autocomplete:"off"}),b=g("div",{class:"picker-list",role:"listbox"}),w=ji(),x=g("div",{class:"picker-pop",role:"dialog","aria-label":"Choose a property"},y,g("div",{class:"picker-body"},b,w.root));document.body.append(x),it(l,x),y.focus();let E=()=>{let C=[];s&&C.push({id:"",label:"No property",meta:"clear",group:" ",search:"none clear optional"}),a&&C.push({id:"cohort",label:"Cohort",meta:"in / not in",group:"Cohorts",search:`cohort segment ${Ui}`.toLowerCase()});for(let A of h)C.push({id:A.name,label:A.name,meta:A.types[0]??"",group:e.event?`On ${e.event}`:"Event properties",search:`${A.name} ${A.description} ${A.examples.join(" ")}`.toLowerCase()});for(let A of p)C.push({id:A.name,label:A.name,meta:A.types[0]??"",group:"Person properties",search:`${A.name} ${A.examples.join(" ")}`.toLowerCase()});if(r)for(let A of Lt)C.push({id:A.name,label:A.name,meta:A.group,group:"Built-in columns",search:`${A.name} ${A.description} ${A.group}`.toLowerCase()});return C},S=()=>{let C=d.trim().toLowerCase(),A=E().filter(P=>!C||P.search.includes(C)||P.id.toLowerCase().includes(C)),G=e.customPrefix??"",F=G&&!d.trim().startsWith(G)?`${G}${d.trim()}`:d.trim();if(n&&C&&!A.some(P=>P.id.toLowerCase()===F.toLowerCase())){let P=F.startsWith("person.")?`Person property \\u201C${F}\\u201D`:`Use \\u201C${F}\\u201D`;A.unshift({id:F,label:P,meta:"custom",group:"Custom",search:C})}return A},v=C=>{if(m=C,!C){w.show($t("Leave empty for no breakdown or aggregation property."));return}if(C==="cohort"&&a){w.show(_t({name:"Cohort",description:Ui}));return}let A=h.find(F=>F.name===C)??p.find(F=>F.name===C);if(A){w.show(_t(A));return}let G=Lt.find(F=>F.name===C);if(G){w.show(_t({name:G.name,description:G.description,types:["string"]}));return}if(C.startsWith("person.")){w.show(_t({name:C,description:`Person property \\u201C${C.slice(7)}\\u201D as of the event time. Set via glass.identify() or $set.`}));return}w.show(_t({name:C,description:"Custom event property (looked up on props)."}))},R=()=>{let C=S();C.some(A=>A.id===m)||(m=C[0]?.id??""),zi(b,C,e.value,m,v,k),m?v(m):w.show($t("Hover a property to see its description."))},k=C=>{e.onChange(C),q(l.querySelector(".picker-trigger-value"),qi(C)||c),l.classList.toggle("empty",!C),_()},O=C=>{let A=S(),G=A.findIndex(F=>F.id===m);C.key==="Escape"?(C.preventDefault(),_()):C.key==="ArrowDown"?(C.preventDefault(),m=A[Math.min(A.length-1,G+1)]?.id??m,R()):C.key==="ArrowUp"?(C.preventDefault(),m=A[Math.max(0,G-1)]?.id??m,R()):C.key==="Enter"&&(C.preventDefault(),m&&k(m))},M=C=>{C.target instanceof Node&&(x.contains(C.target)||u.contains(C.target))||_()},_=()=>{x.remove(),u.classList.remove("open"),l.setAttribute("aria-expanded","false"),window.removeEventListener("keydown",O,!0),window.removeEventListener("resize",D),document.removeEventListener("mousedown",M,!0)},D=()=>it(l,x);y.addEventListener("input",()=>{d=y.value,R()}),window.addEventListener("keydown",O,!0),window.addEventListener("resize",D),document.addEventListener("mousedown",M,!0),w.show(g("div",{class:"picker-detail-loading muted"},"Loading properties\\u2026")),Promise.all([o&&e.event?Pt(e.event,t).then(C=>C.properties):Promise.resolve([]),i?cr(t):Promise.resolve([])]).then(([C,A])=>{h=C,p=A,R()})};return u}function Wi(e){let t=e.project??Z().project,r=e.placeholder??(e.property?"Select values":"Pick a property first"),n=[...e.values],s=new Map,o=g("div",{class:"picker value-input","aria-label":"Filter value"}),i=g("div",{class:"picker-trigger value-trigger",role:"button",tabindex:0,"aria-haspopup":"listbox","aria-expanded":"false"});o.append(i);let a=h=>{n=h,c(),e.onChange([...n])},c=()=>{i.classList.toggle("empty",n.length===0),q(i,n.length===0?g("span",{class:"picker-trigger-value"},r):g("span",{class:"value-chips"},n.map(h=>g("span",{class:"value-chip"},g("span",{class:"value-chip-label"},s.get(h)??h),g("button",{type:"button",class:"value-chip-remove","aria-label":`Remove ${s.get(h)??h}`,onclick:p=>{p.stopPropagation(),a(n.filter(d=>d!==h))}},"\\xD7")))),g("span",{class:"picker-chevron","aria-hidden":"true"},"\\u25BE"))},u=h=>{for(let p of h)p.label!==p.value&&s.set(p.value,p.label)},l=()=>{if(!e.property)return;ur(),o.classList.add("open"),i.setAttribute("aria-expanded","true");let h=JSON.stringify(n),p=g("input",{type:"search",class:"picker-search",placeholder:e.multiple?"Search or type values\\u2026":"Search or type a value\\u2026","aria-label":"Search values",autocomplete:"off"}),d=g("div",{class:"picker-list value-list",role:"listbox","aria-multiselectable":String(e.multiple)}),m=g("div",{class:"value-foot"}),f=g("div",{class:"picker-pop value-pop",role:"dialog","aria-label":`Values of ${e.property}`},p,d,m);document.body.append(f),it(i,f,420),p.focus();let y=[],b=!0,w=0,x=0,E=()=>{let C=p.value.trim(),A=C.toLowerCase(),G=[],F=new Set,P=(B,me,ie)=>{F.has(B)||(F.add(B),G.push({value:B,label:me,meta:ie}))};for(let B of n)(!A||B.toLowerCase().includes(A)||(s.get(B)??"").toLowerCase().includes(A))&&P(B,s.get(B)??B,"");for(let B of y)A&&!B.value.toLowerCase().includes(A)&&!B.label.toLowerCase().includes(A)||P(B.value,B.label,B.people!=null?`${V(B.people)} ${B.people===1?"person":"people"}`:"");return C&&!F.has(C)&&e.property!=="cohort"&&G.unshift({value:C,label:`Add \\u201C${C}\\u201D`,meta:"new",add:!0}),G},S=()=>{let C=E();w=Math.max(0,Math.min(w,C.length-1)),q(d,C.length===0?g("p",{class:"picker-empty muted"},b?"Loading values\\u2026":e.property==="cohort"?"No saved cohorts yet. Create one on the People tab.":"No values seen in the last 30 days. Type one to add it."):C.map((A,G)=>{let F=n.includes(A.value);return g("button",{type:"button",class:`picker-item value-item${G===w?" active":""}${F?" selected":""}`,role:"option","aria-selected":String(F),onmouseenter:()=>{w=G,d.querySelectorAll(".picker-item").forEach((P,B)=>{P.classList.toggle("active",B===G)})},onclick:P=>{P.preventDefault(),v(A)}},e.multiple?g("span",{class:`value-check${F?" on":""}`,"aria-hidden":"true"},F?"\\u2713":""):null,g("span",{class:"picker-item-name"},A.label),A.meta?g("span",{class:"picker-item-meta"},A.meta):null)})),d.querySelector(".picker-item.active")?.scrollIntoView({block:"nearest"}),q(m,g("span",{class:"muted small"},e.multiple?`${n.length} selected \\xB7 matches any`:"Enter to use the typed value"),e.multiple?g("button",{type:"button",class:"primary small",onclick:()=>D()},"Done"):null)},v=C=>{if(!e.multiple){n=[C.value],D();return}n=n.includes(C.value)?n.filter(A=>A!==C.value):[...n,C.value],C.add&&(p.value=""),c(),S(),p.focus()},R=()=>{let C=++x;b=!0,sn(e.property,{event:e.event,project:t,query:p.value}).then(A=>{C===x&&(b=!1,y=A,u(A),c(),S())})},k;p.addEventListener("input",()=>{w=0,S(),clearTimeout(k),k=setTimeout(R,150)});let O=C=>{let A=E();if(C.key==="Escape")C.preventDefault(),D();else if(C.key==="ArrowDown")C.preventDefault(),w=Math.min(A.length-1,w+1),S();else if(C.key==="ArrowUp")C.preventDefault(),w=Math.max(0,w-1),S();else if(C.key==="Enter"){C.preventDefault();let G=A[w];G?v(G):(!e.multiple||!p.value.trim())&&D()}else C.key==="Backspace"&&e.multiple&&!p.value&&n.length&&(n=n.slice(0,-1),c(),S())},M=C=>{C.target instanceof Node&&(f.contains(C.target)||o.contains(C.target))||D()},_=()=>it(i,f,420),D=()=>{clearTimeout(k),f.remove(),o.classList.remove("open"),i.setAttribute("aria-expanded","false"),window.removeEventListener("keydown",O,!0),window.removeEventListener("resize",_),document.removeEventListener("mousedown",M,!0),c(),JSON.stringify(n)!==h&&e.onChange([...n])};window.addEventListener("keydown",O,!0),window.addEventListener("resize",_),document.addEventListener("mousedown",M,!0),S(),R()};return i.addEventListener("click",h=>{h.preventDefault(),h.stopPropagation(),l()}),i.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" "||h.key==="ArrowDown")&&(h.preventDefault(),l())}),c(),e.property==="cohort"&&n.length&&sn("cohort",{project:t}).then(h=>{u(h),c()}),o}var pc={cohort:[["eq","is in"],["neq","is not in"]],string:[["eq","is"],["neq","is not"],["contains","contains"],["not_contains","does not contain"],["is_set","is set"],["is_not_set","is not set"]],number:[["eq","="],["neq","\\u2260"],["gt",">"],["gte","\\u2265"],["lt","<"],["lte","\\u2264"],["is_set","is set"],["is_not_set","is not set"]],boolean:[["eq","is"],["neq","is not"],["is_set","is set"],["is_not_set","is not set"]]},ln=new Set(["is_set","is_not_set"]),on=new Set(["eq","neq"]),Vi=new Set(["gt","gte","lt","lte"]),dc=new Set(Lt.map(e=>e.name));function hc(e){if(e.property==="cohort")return"cohort";let t=Array.isArray(e.value)?e.value[0]:e.value;return typeof t=="number"||Vi.has(e.op??"")?"number":typeof t=="boolean"?"boolean":"string"}async function fc(e,t,r){if(e==="cohort")return"cohort";if(!e||dc.has(e))return"string";let n=e.startsWith("person.")?await cr(r):t?(await Pt(t,r)).properties:[],s=e.startsWith("props.")?e.slice(6):e,o=n.find(i=>i.name===s)?.types??[];return o.length&&o.every(i=>i==="number"||i==="null")?"number":o.length&&o.every(i=>i==="boolean"||i==="null")?"boolean":"string"}function mc(e,t){return t==="number"&&/^-?\\d+(\\.\\d+)?$/.test(e)?Number(e):t==="boolean"&&(e==="true"||e==="false")?e==="true":e}var an=e=>e.value===void 0||e.value===null||e.value===""?[]:(Array.isArray(e.value)?e.value:[e.value]).map(String);function gc(e,t,r,n){let s=g("select",{class:"filter-op","aria-label":n},t.map(([o,i])=>g("option",{value:o,selected:o===e},i)));return s.addEventListener("change",()=>r(s.value)),s}function ze(e,t,r={}){let n=g("div",{class:"filter-editor"});for(let a of e)a.op==="in"&&(a.op="eq"),a.op==="not_in"&&(a.op="neq");let s=()=>{i(),t()},o=(a,c,u)=>{let l=pc[u];l.some(([d])=>d===(a.op??"eq"))||(a.op="eq");let h=a.op??"eq",p=g("div",{class:"filter-row"},g("span",{class:"filter-joiner"},c===0?"where":"and"));if(p.append(Ft({value:a.property,event:r.personOnly?void 0:r.event,project:r.project,columns:!r.personOnly,eventProperties:!r.personOnly,cohorts:r.cohorts===!0,customPrefix:r.personOnly?"person.":void 0,placeholder:r.personOnly?"Person property":"Property",label:"Filter property",onChange:d=>{d!==a.property&&(a.property=d,a.op="eq",a.value="",s())}}),gc(h,l,d=>{let m=on.has(a.op??"eq");a.op=d,ln.has(d)?delete a.value:m&&!on.has(d)&&(a.value=an(a)[0]??""),s()},"Operator")),Vi.has(h)){let d=g("input",{type:"number",class:"filter-number",value:an(a)[0]??"",placeholder:"Number","aria-label":"Filter value",step:"any"});d.addEventListener("input",()=>{a.value=d.value===""?"":Number(d.value)}),d.addEventListener("change",t),p.append(d)}else ln.has(h)||p.append(Wi({property:a.property,event:r.personOnly?void 0:r.event,project:r.project,values:an(a),multiple:on.has(h),placeholder:u==="cohort"?"Select cohorts":void 0,onChange:d=>{let m=d.map(f=>mc(f,u));a.value=m.length>1?m:m[0]??"",t()}}));return p.append(g("button",{type:"button",class:"ghost small filter-remove","aria-label":"Remove filter",title:"Remove filter",onclick:()=>{e.splice(c,1),s()}},"\\xD7")),p},i=()=>{n.replaceChildren(),r.label&&n.append(g("div",{class:"filter-editor-label"},r.label)),e.forEach((a,c)=>{let u=hc(a),l=o(a,c,u);n.append(l),fc(a.property,r.event,r.project).then(h=>{if(h===u||!l.isConnected)return;let p=o(a,c,h);l.replaceWith(p),l=p})}),n.append(g("div",{class:"filter-actions"},g("button",{type:"button",class:"ghost small",onclick:()=>{e.push({property:"",op:"eq",value:""}),s()}},r.personOnly?"+ Person property":"+ Filter"),r.cohorts?g("button",{type:"button",class:"ghost small",onclick:()=>{e.push({property:"cohort",op:"eq",value:""}),s()}},"+ Cohort"):null))};return i(),n}function Xe(e){if(!e?.length)return;let t=[];for(let r of e){let n=r.property?.trim();if(!n)continue;let s=r.op&&r.op!=="eq"?r.op:void 0;if(s&&ln.has(s)){t.push({property:n,op:s});continue}let o=(Array.isArray(r.value)?r.value:[r.value]).filter(a=>a!=null&&a!=="");if(o.length===0)continue;if(o.length>1&&(s===void 0||s==="neq")){t.push({property:n,op:s==="neq"?"not_in":"in",value:o.map(a=>typeof a=="boolean"?String(a):a)});continue}let i=o[0];t.push(s?{property:n,op:s,value:i}:{property:n,value:i})}return t.length?t:void 0}var dn=["trends","funnel","retention"],hr={trends:"Trends",funnel:"Funnel",retention:"Retention"},pr={trends:{series:[{event:"$pageview",math:"total"}],interval:"day"},funnel:{steps:[{event:"$pageview"},{event:""}],window:"7d"},retention:{cohortEvent:{event:"$pageview"},returnEvent:{event:"$pageview"},period:"week",periods:8}};function Hi(e,t,r,n){let s=g("input",{type:"text",value:e??"",placeholder:t,"aria-label":n});return s.addEventListener("input",()=>r(s.value)),s}function cn(e,t,r,n){let s=g("select",{"aria-label":n},t.map(([o,i])=>g("option",{value:o,selected:o===e},i)));return s.addEventListener("change",()=>r(s.value)),s}function _e(e,t){return g("label",{class:"field"},g("span",{},e),t)}function Ut(e){let t=e.breakdown;return Array.isArray(t)?t.filter(r=>typeof r=="string"):typeof t=="string"&&t?[t]:[]}function un(e,t){t.length===0?delete e.breakdown:e.breakdown=t}function dr(e){return e.filters??=[],e.filters}function Gi(e,t,r,n){let s=Ut(e);return g("div",{class:"breakdown-editor"},g("div",{class:"filter-editor-label"},"Break down by"),s.map((o,i)=>g("div",{class:"breakdown-row"},Ft({value:o,event:t,project:r,placeholder:i===0?"browser, utm_source, plan\\u2026":"Add another property",onChange:a=>{let c=Ut(e);a?c[i]=a:c.splice(i,1),un(e,c),n()}}),g("button",{type:"button",class:"ghost small","aria-label":"Remove breakdown",onclick:()=>{let a=Ut(e);a.splice(i,1),un(e,a),n()}},"Remove"))),s.length<4?g("button",{type:"button",class:"ghost small",onclick:()=>{un(e,[...Ut(e),""]),n()}},(s.length,"Add breakdown")):null,s.length>1?g("p",{class:"muted small"},"Values are combined with \\u201C \\xB7 \\u201D, e.g. Chrome \\xB7 google."):null)}function Yi(e,t){let r=structuredClone(t),n=Xe(r.filters);if(n?r.filters=n:delete r.filters,e==="trends"){let o=r.series.map(i=>{let a=Xe(i.filters),c={...i};return a?c.filters=a:delete c.filters,c});r.series=o}if(e==="funnel"&&(r.steps=r.steps.map(o=>{let i=Xe(o.filters),a={...o};return i?a.filters=i:delete a.filters,a})),e==="retention")for(let o of["cohortEvent","returnEvent"]){let i=r[o];if(!i)continue;let a=Xe(i.filters);a?i.filters=a:delete i.filters}let s=Ut(r).map(o=>o.trim()).filter(Boolean);return s.length?r.breakdown=s:delete r.breakdown,r}function yc(e,t,r,n){if(Array.isArray(t.filters)||(t.filters=[]),e==="trends"){let i=t.series;return g("div",{class:"builder-stack"},i.map((a,c)=>(dr(a),g("div",{class:"series-block"},g("div",{class:"series-row"},_e(`Event ${i.length>1?c+1:""}`,ot({value:a.event,project:n,label:"Event",onChange:u=>{a.event=u,r()}})),_e("Measure",cn(a.math??"total",[["total","Total count"],["unique_persons","Unique people"],["unique_sessions","Unique sessions"],["sum","Sum of property"],["avg","Average of property"]],u=>{a.math=u,r()},"Measure")),a.math==="sum"||a.math==="avg"?_e("Property",Ft({value:a.property??"",event:a.event,project:n,columns:!1,placeholder:"Select a property to aggregate",onChange:u=>{a.property=u,r()}})):null,i.length>1?g("button",{type:"button",class:"ghost small",onclick:()=>{i.splice(c,1),r()}},"Remove series"):null),ze(a.filters,r,{event:a.event,project:n,label:"Series filters",cohorts:!0})))),g("button",{type:"button",class:"ghost small",onclick:()=>{i.push({event:"",math:"total",filters:[]}),r()}},"Add series"),_e("Interval",cn(String(t.interval??"day"),[["hour","Hour"],["day","Day"],["week","Week"],["month","Month"]],a=>t.interval=a,"Interval")),Gi(t,i[0]?.event,n,r),ze(t.filters,r,{event:i[0]?.event,project:n,label:"Filters on all series",cohorts:!0}))}if(e==="funnel"){let i=t.steps;return g("div",{class:"builder-stack"},g("ol",{class:"steps-editor"},i.map((a,c)=>(dr(a),g("li",{class:"step-block"},g("div",{class:"step-row"},ot({value:a.event,project:n,label:`Step ${c+1}`,placeholder:`Step ${c+1} event`,onChange:u=>{a.event=u,r()}}),i.length>2?g("button",{type:"button",class:"ghost small",onclick:()=>{i.splice(c,1),r()}},"Remove"):null),ze(a.filters,r,{event:a.event,project:n,label:`Step ${c+1} filters`,cohorts:!0}))))),g("button",{type:"button",class:"ghost small",onclick:()=>{i.push({event:"",filters:[]}),r()}},"Add step"),_e("Within",Hi(String(t.window??"7d"),"7d",a=>t.window=a,"Conversion window")),Gi(t,i[0]?.event,n,r),ze(t.filters,r,{event:i[0]?.event,project:n,label:"Filters on every step",cohorts:!0}))}let s=t.cohortEvent,o=t.returnEvent;return dr(s),dr(o),g("div",{class:"builder-stack"},_e("First did",ot({value:s.event,project:n,label:"Cohort event",onChange:i=>{s.event=i,r()}})),ze(s.filters,r,{event:s.event,project:n,label:"First event filters",cohorts:!0}),_e("Came back and did",ot({value:o.event,project:n,label:"Return event",onChange:i=>{o.event=i,r()}})),ze(o.filters,r,{event:o.event,project:n,label:"Return event filters",cohorts:!0}),_e("Period",cn(String(t.period??"week"),[["day","Day"],["week","Week"],["month","Month"]],i=>t.period=i,"Period")),_e("Periods",Hi(String(t.periods??8),"8",i=>t.periods=Number(i)||8,"Number of periods")),ze(t.filters,r,{event:s.event,project:n,label:"Filters on both events",cohorts:!0}))}function vc(e,t){if(e==="trends"){let o=t,i=o.series[0];return g("div",{class:"insight-result"},i?g("div",{class:"funnel-kpis trends-kpis"},g("div",{class:"funnel-kpi"},g("div",{class:"funnel-kpi-value"},V(i.total)),g("div",{class:"funnel-kpi-label"},i.label),g("div",{class:"funnel-kpi-hint muted"},`by ${o.interval}`)),o.series.length>1?g("div",{class:"funnel-kpi"},g("div",{class:"funnel-kpi-value"},String(o.series.length)),g("div",{class:"funnel-kpi-label"},"Series")):null):null,ar(o.buckets,o.series.map(a=>({label:a.label,values:a.values})),o.interval),o.series.length>1?ye(["Series","Total"],o.series.map(a=>[a.label,V(a.total)]),{numeric:[1]}):null)}if(e==="funnel"){let o=t;return o.steps[0]?.count?Ai(o.steps,{windowSeconds:o.windowSeconds,breakdowns:o.breakdowns}):ne("No one did the first step in this period.")}let r=t;if(!r.cohorts.length)return ne("No one in any cohort for this period.");let n=r.average[0]??0,s=r.average[r.average.length-1]??0;return g("div",{class:"insight-result"},g("div",{class:"funnel-kpis"},g("div",{class:"funnel-kpi"},g("div",{class:"funnel-kpi-value"},te(s,0)),g("div",{class:"funnel-kpi-label"},`Retained (${r.period} ${r.average.length-1})`),g("div",{class:"funnel-kpi-hint muted"},`${te(n,0)} on day/period 0`)),g("div",{class:"funnel-kpi"},g("div",{class:"funnel-kpi-value"},V(r.cohorts.reduce((o,i)=>o+i.size,0))),g("div",{class:"funnel-kpi-label"},"People in cohorts"),g("div",{class:"funnel-kpi-hint muted"},`${r.cohorts.length} cohorts`))),Ti(r.cohorts,r.average,r.period))}function bc(){let e=Z().project;return[oe("Insights","Saved analyses you and your agents can reopen. New projects start with DAU, WAU, retention and a few other defaults.",g("a",{class:"button primary",href:ce("insights/new")},"Create new")),he(async()=>{let t=await U.get("/api/insights",{project:e});return t.insights.length===0?ne("No saved analyses yet.",g("a",{class:"button primary",href:ce("insights/new")},"Create new")):g("div",{class:"insight-library"},t.insights.map(r=>g("a",{class:"insight-card",href:ce(`insights/${r.key}`)},g("div",{class:"insight-card-head"},g("h2",{},r.name),g("span",{class:"badge"},hr[r.kind])),r.description?g("p",{class:"muted"},r.description):g("p",{class:"muted"},"No description"))))})]}function pn(e){let t=e.kind,r=structuredClone(e.spec),n=Z(),s=g("form",{class:"builder"}),o=g("div",{class:"insight-output"}),i=g("input",{type:"text",value:e.name??"",placeholder:"Title, e.g. Daily active users","aria-label":"Analysis title",required:!0}),a=g("textarea",{rows:2,placeholder:"What question does this answer?","aria-label":"Description"},e.description??""),c=()=>{let f=Yi(t,r);return{kind:t,...f,from:f.from??n.from,to:f.to??n.to,project:n.project}},u=()=>q(s,yc(t,r,u,n.project),g("div",{class:"form-actions"},g("button",{type:"submit",class:"primary"},"Run query"),e.mode==="saved"?g("button",{type:"button",class:"ghost",onclick:()=>{confirm("Delete this saved analysis?")&&U.delete(`/api/insights/${encodeURIComponent(e.key)}`,{project:n.project}).then(()=>{fe("Deleted"),de("insights")})}},"Delete"):null,g("a",{class:"button ghost",href:ce("insights")},"Back to library"))),l=async()=>{q(o,st("Running query"));try{let f=c(),y=await U.post("/api/query",f),{kind:b,project:w,...x}=f,E=`Using the Glass MCP tool query_${t}, run ${JSON.stringify(x)} and explain what it shows.`;if(q(o,J("Result",[g("p",{class:"summary muted"},y.summary),vc(t,y)],{sql:y.sql,actions:[we(E,"Copy as agent prompt"),we(()=>location.href,"Copy link")]})),e.mode==="ephemeral"||e.mode==="new"){let S=new URLSearchParams(Object.fromEntries(e.route.params));S.set("spec",JSON.stringify(r));let v=e.mode==="new"?`insights/new/${t}`:`insights/${t}`;history.replaceState(null,"",`#/${v}?${S}`)}}catch(f){q(o,Re(f))}},h=J(e.mode==="saved"?"Save changes":"Save analysis",g("form",{class:"stack save-insight"},_e("Title",i),_e("Description",a),g("div",{class:"form-actions"},g("button",{type:"submit",class:"primary"},e.mode==="saved"?"Update":"Save to library"))));h.querySelector("form").addEventListener("submit",f=>{f.preventDefault(),(async()=>{if(!i.value.trim()){fe("Add a title","error");return}try{let y=await U.post("/api/insights",{project:n.project,key:e.mode==="saved"?e.key:void 0,name:i.value.trim(),description:a.value.trim(),kind:t,spec:Yi(t,r)});fe(e.mode==="saved"?"Updated":"Saved"),de(`insights/${y.key}`)}catch(y){fe(y instanceof Error?y.message:String(y),"error")}})()}),s.addEventListener("submit",f=>{f.preventDefault(),l()}),u(),(t==="funnel"?r.steps.every(f=>f.event):!0)?l():q(o,ne("Pick the events for each step, then run the query."));let d=e.mode==="new"?"New analysis":e.mode==="saved"?e.name??"Analysis":`${hr[t]} query`,m=e.mode==="new"?"Build a trends, funnel or retention chart, then save it to the library.":e.description||"Run, tweak, and save.";return[oe(d,m),e.mode==="new"||e.mode==="ephemeral"?It(dn.map(f=>({value:f,label:hr[f]})),t,f=>{e.mode==="new"?de(`insights/new/${f}`,{spec:null}):de(`insights/${f}`,{spec:null})}):g("p",{class:"muted"},hr[t]),s,h,o]}function Ji(e){let t=e.rest[0];if(!t)return bc();if(t==="new"){let r=dn.includes(e.rest[1])?e.rest[1]:"trends",n;try{n=e.params.get("spec")?JSON.parse(e.params.get("spec")):structuredClone(pr[r])}catch{n=structuredClone(pr[r])}return pn({mode:"new",kind:r,spec:n,route:e})}if(dn.includes(t)){let r=t,n;try{n=e.params.get("spec")?JSON.parse(e.params.get("spec")):structuredClone(pr[r])}catch{n=structuredClone(pr[r])}return pn({mode:"ephemeral",kind:r,spec:n,route:e})}return[he(async()=>{let r=Z().project,n=await U.get(`/api/insights/${encodeURIComponent(t)}`,{project:r});return pn({mode:"saved",kind:n.kind,key:n.key,name:n.name,description:n.description,spec:n.spec,route:e})})]}var Ki=e=>Object.entries(e).slice(0,3).map(([t,r])=>`${t}: ${typeof r=="object"?JSON.stringify(r):String(r)}`).join(", ");function wc(e){return g("dl",{class:"kpis"},g("div",{class:"kpi"},g("dt",{},"Identified"),g("dd",{},V(e.identified))),g("div",{class:"kpi"},g("dt",{},`Anonymous devices (${e.days}d)`),g("dd",{},V(e.anonymousDevices))),g("div",{class:"kpi"},g("dt",{},"Identified share"),g("dd",{},e.identified+e.anonymousDevices?`${Math.round(e.identified/(e.identified+e.anonymousDevices)*100)}%`:"\\u2013")))}var xc={eq:"is",neq:"is not",in:"is any of",not_in:"is none of",contains:"contains",not_contains:"does not contain",gt:">",gte:"\\u2265",lt:"<",lte:"\\u2264",is_set:"is set",is_not_set:"is not set"};function Sc(e){let t=[...e.filters.map(r=>[r.property,xc[r.op??"eq"]??r.op,r.value===void 0?"":Array.isArray(r.value)?r.value.join(", "):String(r.value)].filter(Boolean).join(" ")),e.didEvent?`did ${e.didEvent}`:null].filter(Boolean);return t.length?t.join(", "):"everyone with events"}function Cc(e){let t=g("div",{}),r=g("input",{type:"text",placeholder:"Name, e.g. Pro plan","aria-label":"Cohort name",required:!0}),n=[{property:"",op:"eq",value:""}],s="",o=g("p",{class:"muted small cohort-estimate","aria-live":"polite"}),i=0,a,c=()=>{clearTimeout(a),a=setTimeout(()=>{let f=++i,y={project:e,filters:Xe(n)??[],didEvent:s||void 0};if(!y.filters.length&&!y.didEvent){o.textContent="Add a person property or a did-event to see how many people match.";return}o.textContent="Counting\\u2026",U.post("/api/cohorts/count",y).then(b=>{f===i&&(o.textContent=`${V(b.count)} ${b.count===1?"person matches":"people match"} in the last 90 days.`)}).catch(()=>{f===i&&(o.textContent="Could not count this definition yet. Check the filter values.")})},250)},u=g("div",{class:"cohort-filters"}),l=()=>q(u,ze(n,c,{project:e,personOnly:!0})),h=g("div",{}),p=()=>q(h,ot({value:s,project:e,label:"Did event",placeholder:"Optional \\u2014 people who did this event",onChange:f=>{s=f,c()}}));l(),p(),c();let d=g("form",{class:"cohort-form"},g("div",{class:"form-row"},g("label",{class:"field"},g("span",{},"Name"),r)),g("div",{class:"field"},g("span",{},"Person properties"),u),g("div",{class:"field"},g("span",{},"Did event"),h),g("div",{class:"form-row cohort-submit"},g("button",{type:"submit",class:"primary"},"Save cohort"),o)),m=async()=>{q(t,g("p",{class:"muted"},"Loading cohorts\\u2026"));try{let f=await U.get("/api/cohorts",{project:e}),y=f.cohorts.length===0?ne("No cohorts yet. Save a filter below \\u2014 counts update live, and each cohort links to retention."):ye(["Cohort","Definition","People",""],f.cohorts.map(b=>[g("strong",{},b.name),g("span",{class:"muted"},Sc(b)),V(b.count),g("span",{class:"row-actions"},g("a",{class:"button ghost small",href:b.retention},"Retention"),g("button",{type:"button",class:"ghost small",onclick:async()=>{confirm(`Delete cohort \\u201C${b.name}\\u201D?`)&&(await U.delete(`/api/cohorts/${encodeURIComponent(b.key)}`,{project:e}),fe(`Deleted ${b.name}`),m())}},"Delete"))]),{numeric:[2]});q(t,y,d)}catch(f){q(t,g("p",{class:"state error"},f instanceof Error?f.message:"Could not load cohorts."),d)}};return d.addEventListener("submit",f=>{f.preventDefault(),(async()=>{let y=Xe(n)??[];if(!r.value.trim()){fe("Name the cohort","error");return}if(!y.length&&!s.trim()){fe("Add a person property or a did-event","error");return}try{await U.post("/api/cohorts",{project:e,name:r.value.trim(),filters:y,didEvent:s.trim()||void 0})}catch(b){fe(b instanceof Error?b.message:"Could not save the cohort","error");return}fe("Cohort saved"),$i("cohort"),r.value="",n=[{property:"",op:"eq",value:""}],s="",l(),p(),c(),m()})()}),m(),t}function Ec(e){let t=e.params.get("q")??"",r=g("input",{type:"search",value:t,placeholder:"Search by id or property value","aria-label":"Search people"}),n=g("form",{class:"search",role:"search"},r,g("button",{type:"submit",class:"ghost"},"Search"));n.addEventListener("submit",o=>{o.preventDefault(),de("users",{q:r.value})});let s=Z().project;return[oe("People","Identified users from glass.identify(), anonymous device volume, and saved cohorts you can reuse in insights."),he(async()=>{let o=await U.get("/api/persons",{project:s,query:t,limit:100});return[J("Overview",[wc(o.stats),g("p",{class:"summary"},o.summary)],{sql:o.sql}),J("Cohorts",Cc(s)),n,o.persons.length===0?ne(t?`No identified people match "${t}".`:"No identified people yet. Call glass.identify(userId) after login \\u2014 anonymous devices still count in the overview above."):J("Identified people",ye(["Person","Properties","Last seen"],o.persons.map(i=>[g("a",{href:ce(`users/${encodeURIComponent(i.id)}`)},i.id),g("span",{class:"muted"},Ki(i.properties)),Dt(i.lastSeen)])))]})]}function Rc(e){return[he(async()=>{let t=await U.get(`/api/persons/${encodeURIComponent(e)}`,{project:Z().project});return[oe(t.id,t.summary,we(t.id,"Copy id")),g("div",{class:"grid-2"},J("Properties",Object.keys(t.properties).length?g("dl",{class:"props"},Object.entries(t.properties).map(([r,n])=>[g("dt",{},r),g("dd",{},typeof n=="object"?JSON.stringify(n):String(n))])):ne(t.identified?"No properties set.":"Anonymous device: identify() has not been called.")),J("Devices and sessions",g("div",{},g("p",{class:"muted"},`First seen ${t.firstSeen?Pe(t.firstSeen):"never"}, last seen ${t.lastSeen?Dt(t.lastSeen):"never"}.`),t.devices.length?g("p",{},`${t.devices.length} linked device${t.devices.length===1?"":"s"}.`):null,t.replays.length?g("ul",{class:"plain"},t.replays.map(r=>g("li",{},g("a",{href:ce(`replays/${r.session}`)},Pe(r.started)),r.errors?g("span",{class:"badge bad"},`${r.errors} errors`):null))):g("p",{class:"muted"},"No recorded sessions.")))),J("Recent events",t.recentEvents.length?ye(["Time","Event","Page","Properties"],t.recentEvents.map(r=>[Pe(r.time),g("code",{},r.event),r.path,g("span",{class:"muted"},Ki(r.properties))])):ne("No events in the last 90 days."),{sql:t.sql})]})]}function Xi(e){return e.rest[0]?Rc(e.rest[0]):Ec(e)}var kc=Object.defineProperty,Mc=(e,t,r)=>t in e?kc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,N=(e,t,r)=>Mc(e,typeof t!="symbol"?t+"":t,r),Qi,Nc=Object.defineProperty,Oc=(e,t,r)=>t in e?Nc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Zi=(e,t,r)=>Oc(e,typeof t!="symbol"?t+"":t,r),H=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(H||{}),eo={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},to={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Bt={},Cs={},ro=0,Ic=()=>!!globalThis.Zone;function Ks(e){if(Bt[e])return Bt[e];let t=globalThis[e],r=t.prototype,n=e in eo?eo[e]:void 0,s=!!(n&&n.every(a=>{var c,u;return!!((u=(c=Object.getOwnPropertyDescriptor(r,a))==null?void 0:c.get)!=null&&u.toString().includes("[native code]"))})),o=e in to?to[e]:void 0,i=!!(o&&o.every(a=>{var c;return typeof r[a]=="function"&&((c=r[a])==null?void 0:c.toString().includes("[native code]"))}));if(s&&i&&!Ic())return Bt[e]=t.prototype,t.prototype;try{let a=document.createElement("iframe");a.style.display="none",document.body.appendChild(a);let c=a.contentWindow;if(!c)return t.prototype;let u=c[e].prototype;if(!u)return a.remove(),r;let l=navigator.userAgent;return l.includes("Safari")&&!l.includes("Chrome")?(a.classList.add("rr-block"),a.setAttribute("__rrwebUntaintedMutationObserver",""),Cs[e]=()=>a.remove()):a.remove(),Bt[e]=u}catch{return r}}var hn={};function Ne(e,t,r){var n,s;let o=(n=hn[e])==null?void 0:n[r];if(o)return o.call(t);let i=Ks(e),a=(s=Object.getOwnPropertyDescriptor(i,r))==null?void 0:s.get;return a?((hn[e]||(hn[e]={}))[r]=a,a.call(t)):t[r]}var fn={};function ja(e,t,r){let n=`${e}.${String(r)}`;if(fn[n])return fn[n].bind(t);let o=Ks(e)[r];return typeof o!="function"?t[r]:(fn[n]=o,o.bind(t))}function Dc(e){return Ne("Node",e,"ownerDocument")}function Ac(e){return Ne("Node",e,"childNodes")}function Tc(e){return Ne("Node",e,"parentNode")}function Lc(e){return Ne("Node",e,"parentElement")}function Pc(e){return Ne("Node",e,"textContent")}function _c(e){return Ne("Node",e,"firstChild")}function $c(e){return Ne("Node",e,"lastChild")}function Fc(e){return Ne("Node",e,"nextSibling")}function Uc(e){return Ne("Node",e,"previousSibling")}function qc(e,t){return ja("Node",e,"contains")(t)}function Bc(e){return ja("Node",e,"getRootNode")()}function jc(e){return!e||!("host"in e)?null:Ne("ShadowRoot",e,"host")}function zc(e){return e.styleSheets}function Wc(e){return!e||!("shadowRoot"in e)?null:Ne("Element",e,"shadowRoot")}function Vc(e,t){return Ne("Element",e,"querySelector")(t)}function Hc(e,t){return Ne("Element",e,"querySelectorAll")(t)}function Gc(){let e=Ks("MutationObserver");ro++;let t=!1;return[e.constructor,()=>{if(t||(t=!0,--ro!==0))return;let r=Cs.MutationObserver;if(r)try{r()}finally{delete Bt.MutationObserver,delete Cs.MutationObserver}}]}var za=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(za=()=>new Date().getTime());function Yc(e,t,r){try{if(!(t in e))return()=>{};let n=e[t],s=r(n);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=s,()=>{e[t]=n}}catch{return()=>{}}}var ve={ownerDocument:Dc,childNodes:Ac,parentNode:Tc,parentElement:Lc,textContent:Pc,firstChild:_c,lastChild:$c,nextSibling:Fc,previousSibling:Uc,contains:qc,getRootNode:Bc,host:jc,styleSheets:zc,shadowRoot:Wc,querySelector:Vc,querySelectorAll:Hc,nowTimestamp:za,mutationObserverCtor:Gc,patch:Yc};function Xs(e){return e.nodeType===e.ELEMENT_NODE}function Ht(e){let t=e&&"host"in e&&"mode"in e&&ve.host(e)||null;return!!(t&&"shadowRoot"in t&&ve.shadowRoot(t)===e)}function Gt(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Jc(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\\sbackground-clip:\\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function Kc(e){let{cssText:t}=e;if(t.split(\'"\').length<3)return t;let r=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function Es(e){try{let t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);let n=Array.from(t,s=>Wa(s,r)).join("");return Jc(n)}catch{return null}}function Wa(e,t){if(Qc(e)){let r;try{r=Es(e.styleSheet)||Kc(e)}catch{r=e.cssText}return e.styleSheet.href?kr(r,e.styleSheet.href):r}else{let r=e.cssText;return Zc(e)&&e.selectorText.includes(":")&&(r=Xc(r)),t?kr(r,t):r}}function Xc(e){let t=/(\\[(?:[\\w-]+)[^\\\\])(:(?:[\\w-]+)\\])/gm;return e.replace(t,"$1\\\\$2")}function Qc(e){return"styleSheet"in e}function Zc(e){return"selectorText"in e}var Xt=class{constructor(){Zi(this,"idNodeMap",new Map),Zi(this,"nodeMetaMap",new WeakMap)}getId(t){var r;return t?((r=this.getMeta(t))==null?void 0:r.id)??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){let r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(s=>this.removeNodeFromMap(s));let n=ve.shadowRoot(t);n&&this.removeNodeFromMap(n)}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){let n=this.getNode(t);if(n){let s=this.nodeMetaMap.get(n);s&&this.nodeMetaMap.set(r,s)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Va(){return new Xt}function Er({element:e,maskInputOptions:t,tagName:r,type:n,value:s,maskInputFn:o}){let i=s||"",a=n&&Ye(n);return(t[r.toLowerCase()]||a&&t[a])&&(o?i=o(i,e):i="*".repeat(i.length)),i}function Ye(e){return e.toLowerCase()}var no="__rrweb_original__";function eu(e){let t=e.getContext("2d");if(!t)return!0;let r=50;for(let n=0;n<e.width;n+=r)for(let s=0;s<e.height;s+=r){let o=t.getImageData,i=no in o?o[no]:o;if(new Uint32Array(i.call(t,n,s,Math.min(r,e.width-n),Math.min(r,e.height-s)).data.buffer).some(c=>c!==0))return!1}return!0}function tu(e,t){return!e||!t||e.type!==t.type?!1:e.type===H.Document?e.compatMode===t.compatMode:e.type===H.DocumentType?e.name===t.name&&e.publicId===t.publicId&&e.systemId===t.systemId:e.type===H.Comment||e.type===H.Text||e.type===H.CDATA?e.textContent===t.textContent:e.type===H.Element?e.tagName===t.tagName&&JSON.stringify(e.attributes)===JSON.stringify(t.attributes)&&e.isSVG===t.isSVG&&e.needBlock===t.needBlock:!1}function Rr(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ye(t):null}function Qs(e,t){let r;try{r=new URL(e,t??window.location.href)}catch{return null}let n=/\\.([0-9a-z]+)(?:$)/i,s=r.pathname.match(n);return s?.[1]??null}function ru(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var nu=/url\\((?:(\')([^\']*)\'|(")(.*?)"|([^)]*))\\)/gm,su=/^(?:[a-z+]+:)?\\/\\//i,iu=/^www\\..*/i,ou=/^(data:)([^,]*),(.*)/i;function kr(e,t){return(e||"").replace(nu,(r,n,s,o,i,a)=>{let c=s||i||a,u=n||o||"";if(!c)return r;if(su.test(c)||iu.test(c))return`url(${u}${c}${u})`;if(ou.test(c))return`url(${u}${c}${u})`;if(c[0]==="/")return`url(${u}${ru(t)+c}${u})`;let l=c.split("#")[0],h=c.substring(l.length),p=t.split("#")[0].split("/"),d=l.split("/");p.pop();for(let m of d)m!=="."&&(m===".."?p.pop():p.push(m));return`url(${u}${p.join("/")}${h}${u})`})}var Ha="(?:/\\\\*[^*]*\\\\*/)|[\\\\s;]",au=new RegExp(`${Ha}|\\\\b(0)px?`,"g"),lu=new RegExp(Ha,"g");function fr(e,t=!1){return t?e.replace(lu,""):e.replace(au,"$1")}function cu(e,t,r=!1){let n=Array.from(t.childNodes),s=[],o=0;if(n.length>1&&e&&typeof e=="string"){let i=fr(e,r),a=i.length/e.length;for(let c=1;c<n.length;c++)if(n[c].textContent&&typeof n[c].textContent=="string"){let u=fr(n[c].textContent,r),l=100,h=3;for(;h<u.length&&(u[h].match(/[a-zA-Z0-9]/)||u.indexOf(u.substring(0,h),1)!==-1);h++);for(;h<u.length;h++){let p=u.substring(0,h),d=i.split(p),m=-1;if(d.length===2)m=d[0].length;else if(d.length>2&&d[0]===""&&n[c-1].textContent!=="")m=i.indexOf(p,1);else if(d.length===1){if(p=p.substring(0,p.length-1),d=i.split(p),d.length<=1)return s.push(e),s;h=l+1}else h===u.length-1&&(m=i.indexOf(p));if(d.length>=2&&h>l){let f=n[c-1].textContent;if(f&&typeof f=="string"){let y=fr(f).length;m=i.indexOf(p,y)}m===-1&&(m=d[0].length)}if(m!==-1){let f=Math.floor(m/a);for(;f>0&&f<e.length;){if(o+=1,o>50*n.length)return s.push(e),s;let y=fr(e.substring(0,f),r);if(y.length===m){s.push(e.substring(0,f)),e=e.substring(f),i=i.substring(m);break}else y.length<m?f+=Math.max(1,Math.floor((m-y.length)/a)):f-=Math.max(1,Math.floor((y.length-m)*a))}break}}}}return s.push(e),s}function uu(e,t){return cu(e,t).join("/* rr_split */")}var pu=1,du=new RegExp("[^a-z0-9-_:]"),Mr=-2;function Ga(){return pu++}function hu(e){if(e instanceof HTMLFormElement)return"form";let t=Ye(e.tagName);return du.test(t)?"div":t}var ht,so,fu=/^[^ \\t\\n\\r\\u000c]+/,mu=/^[, \\t\\n\\r\\u000c]+/;function gu(e,t){if(t.trim()==="")return t;let r=0;function n(o){let i,a=o.exec(t.substring(r));return a?(i=a[0],r+=i.length,i):""}let s=[];for(;n(mu),!(r>=t.length);){let o=n(fu);if(o.slice(-1)===",")o=yt(e,o.substring(0,o.length-1)),s.push(o);else{let i="";o=yt(e,o);let a=!1;for(;;){let c=t.charAt(r);if(c===""){s.push((o+i).trim());break}else if(a)c===")"&&(a=!1);else if(c===","){r+=1,s.push((o+i).trim());break}else c==="("&&(a=!0);i+=c,r+=1}}}return s.join(", ")}var io=new WeakMap;function yt(e,t){return!t||t.trim()===""?t:Zs(e,t)}function yu(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Zs(e,t){let r=io.get(e);if(r||(r=e.createElement("a"),io.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function Ya(e,t,r,n){return n&&(r==="src"||r==="href"&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&["table","td","th"].includes(t)?yt(e,n):r==="srcset"?gu(e,n):r==="style"?kr(n,Zs(e)):t==="object"&&r==="data"?yt(e,n):n)}function Ja(e,t,r){return["video","audio"].includes(e)&&Ye(t)==="autoplay"}function vu(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){let s=e.classList[n];if(t.test(s))return!0}if(r)return e.matches(r)}catch{}return!1}function Nr(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?Nr(ve.parentNode(e),t,r):!1;for(let n=e.classList.length;n--;){let s=e.classList[n];if(t.test(s))return!0}return r?Nr(ve.parentNode(e),t,r):!1}function Ka(e,t,r,n){let s;if(Xs(e)){if(s=e,!ve.childNodes(s).length)return!1}else{if(ve.parentElement(e)===null)return!1;s=ve.parentElement(e)}try{if(typeof t=="string"){if(n){if(s.closest(`.${t}`))return!0}else if(s.classList.contains(t))return!0}else if(Nr(s,t,n))return!0;if(r){if(n){if(s.closest(r))return!0}else if(s.matches(r))return!0}}catch{}return!1}function bu(e,t,r){let n=e.contentWindow;if(!n)return;let s=!1,o;try{o=n.document.readyState}catch{return}if(o!=="complete"){let a=setTimeout(()=>{s||(t(),s=!0)},r);e.addEventListener("load",()=>{clearTimeout(a),s=!0,t()});return}let i="about:blank";if(n.location.href!==i||e.src===i||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function wu(e,t,r){let n=!1,s;try{s=e.sheet}catch{return}if(s)return;let o=setTimeout(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{clearTimeout(o),n=!0,t()})}function xu(e,t){let{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:i,inlineStylesheet:a,maskInputOptions:c={},maskTextFn:u,maskInputFn:l,dataURLOptions:h={},inlineImages:p,recordCanvas:d,keepIframeSrcFn:m,newlyAddedElement:f=!1,cssCaptured:y=!1}=t,b=Su(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:H.Document,childNodes:[],compatMode:e.compatMode}:{type:H.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:H.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:b};case e.ELEMENT_NODE:return Eu(e,{doc:r,blockClass:s,blockSelector:o,inlineStylesheet:a,maskInputOptions:c,maskInputFn:l,dataURLOptions:h,inlineImages:p,recordCanvas:d,keepIframeSrcFn:m,newlyAddedElement:f,rootId:b});case e.TEXT_NODE:return Cu(e,{doc:r,needsMask:i,maskTextFn:u,rootId:b,cssCaptured:y});case e.CDATA_SECTION_NODE:return{type:H.CDATA,textContent:"",rootId:b};case e.COMMENT_NODE:return{type:H.Comment,textContent:ve.textContent(e)||"",rootId:b};default:return!1}}function Su(e,t){if(!t.hasNode(e))return;let r=t.getId(e);return r===1?void 0:r}function Cu(e,t){let{needsMask:r,maskTextFn:n,rootId:s,cssCaptured:o}=t,i=ve.parentNode(e),a=i&&i.tagName,c="",u=a==="STYLE"?!0:void 0,l=a==="SCRIPT"?!0:void 0;return l?c="SCRIPT_PLACEHOLDER":o||(c=ve.textContent(e),u&&c&&(c=kr(c,Zs(t.doc)))),!u&&!l&&c&&r&&(c=n?n(c,ve.parentElement(e)):c.replace(/[\\S]/g,"*")),{type:H.Text,textContent:c||"",rootId:s}}function Eu(e,t){let{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:i={},maskInputFn:a,dataURLOptions:c={},inlineImages:u,recordCanvas:l,keepIframeSrcFn:h,newlyAddedElement:p=!1,rootId:d}=t,m=vu(e,n,s),f=hu(e),y={},b=e.attributes.length;for(let x=0;x<b;x++){let E=e.attributes[x];Ja(f,E.name,E.value)||(y[E.name]=Ya(r,f,Ye(E.name),E.value))}if(f==="link"&&o){let x=Array.from(r.styleSheets).find(S=>S.href===e.href),E=null;x&&(E=Es(x)),E&&(delete y.rel,delete y.href,y._cssText=E)}if(f==="style"&&e.sheet){let x=Es(e.sheet);x&&(e.childNodes.length>1&&(x=uu(x,e)),y._cssText=x)}if(["input","textarea","select"].includes(f)){let x=e.value,E=e.checked;y.type!=="radio"&&y.type!=="checkbox"&&y.type!=="submit"&&y.type!=="button"&&x?y.value=Er({element:e,type:Rr(e),tagName:f,value:x,maskInputOptions:i,maskInputFn:a}):E&&(y.checked=E)}if(f==="option"&&(e.selected&&!i.select?y.selected=!0:delete y.selected),f==="dialog"&&e.open&&(y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),f==="canvas"&&l){if(e.__context==="2d")eu(e)||(y.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){let x=e.toDataURL(c.type,c.quality),E=r.createElement("canvas");E.width=e.width,E.height=e.height;let S=E.toDataURL(c.type,c.quality);x!==S&&(y.rr_dataURL=x)}}if(f==="img"&&u){ht||(ht=r.createElement("canvas"),so=ht.getContext("2d"));let x=e,E=x.currentSrc||x.getAttribute("src")||"<unknown-src>",S=x.crossOrigin,v=()=>{x.removeEventListener("load",v);try{ht.width=x.naturalWidth,ht.height=x.naturalHeight,so.drawImage(x,0,0),y.rr_dataURL=ht.toDataURL(c.type,c.quality)}catch(R){if(x.crossOrigin!=="anonymous"){x.crossOrigin="anonymous",x.complete&&x.naturalWidth!==0?v():x.addEventListener("load",v);return}else console.warn(`Cannot inline img src=${E}! Error: ${R}`)}x.crossOrigin==="anonymous"&&(S?y.crossOrigin=S:x.removeAttribute("crossorigin"))};x.complete&&x.naturalWidth!==0?v():x.addEventListener("load",v)}if(["audio","video"].includes(f)){let x=y;x.rr_mediaState=e.paused?"paused":"played",x.rr_mediaCurrentTime=e.currentTime,x.rr_mediaPlaybackRate=e.playbackRate,x.rr_mediaMuted=e.muted,x.rr_mediaLoop=e.loop,x.rr_mediaVolume=e.volume}if(p||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),m){let{width:x,height:E}=e.getBoundingClientRect();y={class:y.class,rr_width:`${x}px`,rr_height:`${E}px`}}f==="iframe"&&!h(y.src)&&(e.contentDocument||(y.rr_src=y.src),delete y.src);let w;try{customElements.get(f)&&(w=!0)}catch{}return{type:H.Element,tagName:f,attributes:y,childNodes:[],isSVG:yu(e)||void 0,needBlock:m,rootId:d,isCustom:w}}function se(e){return e==null?"":e.toLowerCase()}function Xa(e){return e===!0||e==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:e==="all",headMetaDescKeywords:e==="all",headTitleMutations:e==="all"}:e||{}}function Ru(e,t){if(t.comment&&e.type===H.Comment)return!0;if(e.type===H.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Qs(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(se(e.attributes.name).match(/^msapplication-tile(image|color)$/)||se(e.attributes.name)==="application-name"||se(e.attributes.rel)==="icon"||se(e.attributes.rel)==="apple-touch-icon"||se(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&se(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(se(e.attributes.property).match(/^(og|twitter|fb):/)||se(e.attributes.name).match(/^(og|twitter):/)||se(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(se(e.attributes.name)==="robots"||se(e.attributes.name)==="googlebot"||se(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(se(e.attributes.name)==="author"||se(e.attributes.name)==="generator"||se(e.attributes.name)==="framework"||se(e.attributes.name)==="publisher"||se(e.attributes.name)==="progid"||se(e.attributes.property).match(/^article:/)||se(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(se(e.attributes.name)==="google-site-verification"||se(e.attributes.name)==="yandex-verification"||se(e.attributes.name)==="csrf-token"||se(e.attributes.name)==="p:domain_verify"||se(e.attributes.name)==="verify-v1"||se(e.attributes.name)==="verification"||se(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function vt(e,t){let{doc:r,mirror:n,blockClass:s,blockSelector:o,maskTextClass:i,maskTextSelector:a,skipChild:c=!1,inlineStylesheet:u=!0,maskInputOptions:l={},maskTextFn:h,maskInputFn:p,slimDOMOptions:d,dataURLOptions:m={},inlineImages:f=!1,recordCanvas:y=!1,onSerialize:b,onIframeLoad:w,iframeLoadTimeout:x=5e3,onStylesheetLoad:E,stylesheetLoadTimeout:S=5e3,keepIframeSrcFn:v=()=>!1,newlyAddedElement:R=!1,cssCaptured:k=!1}=t,{needsMask:O}=t,{preserveWhiteSpace:M=!0}=t;O||(O=Ka(e,i,a,O===void 0));let _=xu(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:O,inlineStylesheet:u,maskInputOptions:l,maskTextFn:h,maskInputFn:p,dataURLOptions:m,inlineImages:f,recordCanvas:y,keepIframeSrcFn:v,newlyAddedElement:R,cssCaptured:k});if(!_)return console.warn(e,"not serialized"),null;let D;n.hasNode(e)?D=n.getId(e):Ru(_,d)||!M&&_.type===H.Text&&!_.textContent.replace(/^\\s+|\\s+$/gm,"").length?D=Mr:D=Ga();let C=Object.assign(_,{id:D});if(n.add(e,C),D===Mr)return null;b&&b(e);let A=!c;if(C.type===H.Element){A=A&&!C.needBlock,delete C.needBlock;let F=ve.shadowRoot(e);F&&Gt(F)&&(C.isShadowHost=!0)}if((C.type===H.Document||C.type===H.Element)&&A){d.headWhitespace&&C.type===H.Element&&C.tagName==="head"&&(M=!1);let F={doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:O,maskTextClass:i,maskTextSelector:a,skipChild:c,inlineStylesheet:u,maskInputOptions:l,maskTextFn:h,maskInputFn:p,slimDOMOptions:d,dataURLOptions:m,inlineImages:f,recordCanvas:y,preserveWhiteSpace:M,onSerialize:b,onIframeLoad:w,iframeLoadTimeout:x,onStylesheetLoad:E,stylesheetLoadTimeout:S,keepIframeSrcFn:v,cssCaptured:!1};if(!(C.type===H.Element&&C.tagName==="textarea"&&C.attributes.value!==void 0)){C.type===H.Element&&C.attributes._cssText!==void 0&&typeof C.attributes._cssText=="string"&&(F.cssCaptured=!0);for(let B of Array.from(ve.childNodes(e))){let me=vt(B,F);me&&C.childNodes.push(me)}}let P=null;if(Xs(e)&&(P=ve.shadowRoot(e)))for(let B of Array.from(ve.childNodes(P))){let me=vt(B,F);me&&(Gt(P)&&(me.isShadow=!0),C.childNodes.push(me))}}let G=ve.parentNode(e);return G&&Ht(G)&&Gt(G)&&(C.isShadow=!0),C.type===H.Element&&C.tagName==="iframe"&&bu(e,()=>{let F=e.contentDocument;if(F&&w){let P=vt(F,{doc:F,mirror:n,blockClass:s,blockSelector:o,needsMask:O,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:l,maskTextFn:h,maskInputFn:p,slimDOMOptions:d,dataURLOptions:m,inlineImages:f,recordCanvas:y,preserveWhiteSpace:M,onSerialize:b,onIframeLoad:w,iframeLoadTimeout:x,onStylesheetLoad:E,stylesheetLoadTimeout:S,keepIframeSrcFn:v});P&&w(e,P)}},x),C.type===H.Element&&C.tagName==="link"&&typeof C.attributes.rel=="string"&&(C.attributes.rel==="stylesheet"||C.attributes.rel==="preload"&&typeof C.attributes.href=="string"&&Qs(C.attributes.href)==="css")&&wu(e,()=>{if(E){let F=vt(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:O,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:l,maskTextFn:h,maskInputFn:p,slimDOMOptions:d,dataURLOptions:m,inlineImages:f,recordCanvas:y,preserveWhiteSpace:M,onSerialize:b,onIframeLoad:w,iframeLoadTimeout:x,onStylesheetLoad:E,stylesheetLoadTimeout:S,keepIframeSrcFn:v});F&&E(e,F)}},S),C}function ku(e,t){let{mirror:r=new Xt,blockClass:n="rr-block",blockSelector:s=null,maskTextClass:o="rr-mask",maskTextSelector:i=null,inlineStylesheet:a=!0,inlineImages:c=!1,recordCanvas:u=!1,maskAllInputs:l=!1,maskTextFn:h,maskInputFn:p,slimDOM:d=!1,dataURLOptions:m,preserveWhiteSpace:f,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:w,onStylesheetLoad:x,stylesheetLoadTimeout:E,keepIframeSrcFn:S=()=>!1}=t,v=l===!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}:l===!1?{password:!0}:l,R=Xa(d);return vt(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,maskTextClass:o,maskTextSelector:i,skipChild:!1,inlineStylesheet:a,maskInputOptions:v,maskTextFn:h,maskInputFn:p,slimDOMOptions:R,dataURLOptions:m,inlineImages:c,recordCanvas:u,preserveWhiteSpace:f,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:w,onStylesheetLoad:x,stylesheetLoadTimeout:E,keepIframeSrcFn:S,newlyAddedElement:!1})}var Mu=/(max|min)-device-(width|height)/,oo=new RegExp(Mu.source,"g"),Nu={postcssPlugin:"postcss-custom-selectors",prepare(){return{postcssPlugin:"postcss-custom-selectors",AtRule:function(e){e.params.match(oo)&&(e.params=e.params.replace(oo,"$1-$2"))}}}},Ou={postcssPlugin:"postcss-hover-classes",prepare:function(){let e=[];return{Rule:function(t){e.indexOf(t)===-1&&(e.push(t),t.selectors.forEach(function(r){r.includes(":hover")&&(t.selector+=`,\n`+r.replace(/:hover/g,".\\\\:hover"))}))}}}};function Iu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Du(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:function(){return e[n]}})}),r}var mr={exports:{}},ao;function Au(){if(ao)return mr.exports;ao=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return mr.exports=t(),mr.exports.createColors=t,mr.exports}var Tu={},Lu=Object.freeze(Object.defineProperty({__proto__:null,default:Tu},Symbol.toStringTag,{value:"Module"})),$e=Du(Lu),mn,lo;function ei(){if(lo)return mn;lo=1;let e=Au(),t=$e;class r extends Error{constructor(s,o,i,a,c,u){super(s),this.name="CssSyntaxError",this.reason=s,c&&(this.file=c),a&&(this.source=a),u&&(this.plugin=u),typeof o<"u"&&typeof i<"u"&&(typeof o=="number"?(this.line=o,this.column=i):(this.line=o.line,this.column=o.column,this.endLine=i.line,this.endColumn=i.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(s){if(!this.source)return"";let o=this.source;s==null&&(s=e.isColorSupported),t&&s&&(o=t(o));let i=o.split(/\\r?\\n/),a=Math.max(this.line-3,0),c=Math.min(this.line+2,i.length),u=String(c).length,l,h;if(s){let{bold:p,gray:d,red:m}=e.createColors(!0);l=f=>p(m(f)),h=f=>d(f)}else l=h=p=>p;return i.slice(a,c).map((p,d)=>{let m=a+1+d,f=" "+(" "+m).slice(-u)+" | ";if(m===this.line){let y=h(f.replace(/\\d/g," "))+p.slice(0,this.column-1).replace(/[^\\t]/g," ");return l(">")+h(f)+p+`\n `+y+l("^")}return" "+h(f)+p}).join(`\n`)}toString(){let s=this.showSourceCode();return s&&(s=`\n\n`+s+`\n`),this.name+": "+this.message+s}}return mn=r,r.default=r,mn}var gr={},co;function ti(){return co||(co=1,gr.isClean=Symbol("isClean"),gr.my=Symbol("my")),gr}var gn,uo;function Qa(){if(uo)return gn;uo=1;let e={after:`\n`,beforeClose:`\n`,beforeComment:`\n`,beforeDecl:`\n`,beforeOpen:" ",beforeRule:`\n`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function t(n){return n[0].toUpperCase()+n.slice(1)}class r{constructor(s){this.builder=s}atrule(s,o){let i="@"+s.name,a=s.params?this.rawValue(s,"params"):"";if(typeof s.raws.afterName<"u"?i+=s.raws.afterName:a&&(i+=" "),s.nodes)this.block(s,i+a);else{let c=(s.raws.between||"")+(o?";":"");this.builder(i+a+c,s)}}beforeAfter(s,o){let i;s.type==="decl"?i=this.raw(s,null,"beforeDecl"):s.type==="comment"?i=this.raw(s,null,"beforeComment"):o==="before"?i=this.raw(s,null,"beforeRule"):i=this.raw(s,null,"beforeClose");let a=s.parent,c=0;for(;a&&a.type!=="root";)c+=1,a=a.parent;if(i.includes(`\n`)){let u=this.raw(s,null,"indent");if(u.length)for(let l=0;l<c;l++)i+=u}return i}block(s,o){let i=this.raw(s,"between","beforeOpen");this.builder(o+i+"{",s,"start");let a;s.nodes&&s.nodes.length?(this.body(s),a=this.raw(s,"after")):a=this.raw(s,"after","emptyBody"),a&&this.builder(a),this.builder("}",s,"end")}body(s){let o=s.nodes.length-1;for(;o>0&&s.nodes[o].type==="comment";)o-=1;let i=this.raw(s,"semicolon");for(let a=0;a<s.nodes.length;a++){let c=s.nodes[a],u=this.raw(c,"before");u&&this.builder(u),this.stringify(c,o!==a||i)}}comment(s){let o=this.raw(s,"left","commentLeft"),i=this.raw(s,"right","commentRight");this.builder("/*"+o+s.text+i+"*/",s)}decl(s,o){let i=this.raw(s,"between","colon"),a=s.prop+i+this.rawValue(s,"value");s.important&&(a+=s.raws.important||" !important"),o&&(a+=";"),this.builder(a,s)}document(s){this.body(s)}raw(s,o,i){let a;if(i||(i=o),o&&(a=s.raws[o],typeof a<"u"))return a;let c=s.parent;if(i==="before"&&(!c||c.type==="root"&&c.first===s||c&&c.type==="document"))return"";if(!c)return e[i];let u=s.root();if(u.rawCache||(u.rawCache={}),typeof u.rawCache[i]<"u")return u.rawCache[i];if(i==="before"||i==="after")return this.beforeAfter(s,i);{let l="raw"+t(i);this[l]?a=this[l](u,s):u.walk(h=>{if(a=h.raws[o],typeof a<"u")return!1})}return typeof a>"u"&&(a=e[i]),u.rawCache[i]=a,a}rawBeforeClose(s){let o;return s.walk(i=>{if(i.nodes&&i.nodes.length>0&&typeof i.raws.after<"u")return o=i.raws.after,o.includes(`\n`)&&(o=o.replace(/[^\\n]+$/,"")),!1}),o&&(o=o.replace(/\\S/g,"")),o}rawBeforeComment(s,o){let i;return s.walkComments(a=>{if(typeof a.raws.before<"u")return i=a.raws.before,i.includes(`\n`)&&(i=i.replace(/[^\\n]+$/,"")),!1}),typeof i>"u"?i=this.raw(o,null,"beforeDecl"):i&&(i=i.replace(/\\S/g,"")),i}rawBeforeDecl(s,o){let i;return s.walkDecls(a=>{if(typeof a.raws.before<"u")return i=a.raws.before,i.includes(`\n`)&&(i=i.replace(/[^\\n]+$/,"")),!1}),typeof i>"u"?i=this.raw(o,null,"beforeRule"):i&&(i=i.replace(/\\S/g,"")),i}rawBeforeOpen(s){let o;return s.walk(i=>{if(i.type!=="decl"&&(o=i.raws.between,typeof o<"u"))return!1}),o}rawBeforeRule(s){let o;return s.walk(i=>{if(i.nodes&&(i.parent!==s||s.first!==i)&&typeof i.raws.before<"u")return o=i.raws.before,o.includes(`\n`)&&(o=o.replace(/[^\\n]+$/,"")),!1}),o&&(o=o.replace(/\\S/g,"")),o}rawColon(s){let o;return s.walkDecls(i=>{if(typeof i.raws.between<"u")return o=i.raws.between.replace(/[^\\s:]/g,""),!1}),o}rawEmptyBody(s){let o;return s.walk(i=>{if(i.nodes&&i.nodes.length===0&&(o=i.raws.after,typeof o<"u"))return!1}),o}rawIndent(s){if(s.raws.indent)return s.raws.indent;let o;return s.walk(i=>{let a=i.parent;if(a&&a!==s&&a.parent&&a.parent===s&&typeof i.raws.before<"u"){let c=i.raws.before.split(`\n`);return o=c[c.length-1],o=o.replace(/\\S/g,""),!1}}),o}rawSemicolon(s){let o;return s.walk(i=>{if(i.nodes&&i.nodes.length&&i.last.type==="decl"&&(o=i.raws.semicolon,typeof o<"u"))return!1}),o}rawValue(s,o){let i=s[o],a=s.raws[o];return a&&a.value===i?a.raw:i}root(s){this.body(s),s.raws.after&&this.builder(s.raws.after)}rule(s){this.block(s,this.rawValue(s,"selector")),s.raws.ownSemicolon&&this.builder(s.raws.ownSemicolon,s,"end")}stringify(s,o){if(!this[s.type])throw new Error("Unknown AST node type "+s.type+". Maybe you need to change PostCSS stringifier.");this[s.type](s,o)}}return gn=r,r.default=r,gn}var yn,po;function qr(){if(po)return yn;po=1;let e=Qa();function t(r,n){new e(n).stringify(r)}return yn=t,t.default=t,yn}var vn,ho;function Br(){if(ho)return vn;ho=1;let{isClean:e,my:t}=ti(),r=ei(),n=Qa(),s=qr();function o(a,c){let u=new a.constructor;for(let l in a){if(!Object.prototype.hasOwnProperty.call(a,l)||l==="proxyCache")continue;let h=a[l],p=typeof h;l==="parent"&&p==="object"?c&&(u[l]=c):l==="source"?u[l]=h:Array.isArray(h)?u[l]=h.map(d=>o(d,u)):(p==="object"&&h!==null&&(h=o(h)),u[l]=h)}return u}class i{constructor(c={}){this.raws={},this[e]=!1,this[t]=!0;for(let u in c)if(u==="nodes"){this.nodes=[];for(let l of c[u])typeof l.clone=="function"?this.append(l.clone()):this.append(l)}else this[u]=c[u]}addToError(c){if(c.postcssNode=this,c.stack&&this.source&&/\\n\\s{4}at /.test(c.stack)){let u=this.source;c.stack=c.stack.replace(/\\n\\s{4}at /,`$&${u.input.from}:${u.start.line}:${u.start.column}$&`)}return c}after(c){return this.parent.insertAfter(this,c),this}assign(c={}){for(let u in c)this[u]=c[u];return this}before(c){return this.parent.insertBefore(this,c),this}cleanRaws(c){delete this.raws.before,delete this.raws.after,c||delete this.raws.between}clone(c={}){let u=o(this);for(let l in c)u[l]=c[l];return u}cloneAfter(c={}){let u=this.clone(c);return this.parent.insertAfter(this,u),u}cloneBefore(c={}){let u=this.clone(c);return this.parent.insertBefore(this,u),u}error(c,u={}){if(this.source){let{end:l,start:h}=this.rangeBy(u);return this.source.input.error(c,{column:h.column,line:h.line},{column:l.column,line:l.line},u)}return new r(c)}getProxyProcessor(){return{get(c,u){return u==="proxyOf"?c:u==="root"?()=>c.root().toProxy():c[u]},set(c,u,l){return c[u]===l||(c[u]=l,(u==="prop"||u==="value"||u==="name"||u==="params"||u==="important"||u==="text")&&c.markDirty()),!0}}}markDirty(){if(this[e]){this[e]=!1;let c=this;for(;c=c.parent;)c[e]=!1}}next(){if(!this.parent)return;let c=this.parent.index(this);return this.parent.nodes[c+1]}positionBy(c,u){let l=this.source.start;if(c.index)l=this.positionInside(c.index,u);else if(c.word){u=this.toString();let h=u.indexOf(c.word);h!==-1&&(l=this.positionInside(h,u))}return l}positionInside(c,u){let l=u||this.toString(),h=this.source.start.column,p=this.source.start.line;for(let d=0;d<c;d++)l[d]===`\n`?(h=1,p+=1):h+=1;return{column:h,line:p}}prev(){if(!this.parent)return;let c=this.parent.index(this);return this.parent.nodes[c-1]}rangeBy(c){let u={column:this.source.start.column,line:this.source.start.line},l=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:u.column+1,line:u.line};if(c.word){let h=this.toString(),p=h.indexOf(c.word);p!==-1&&(u=this.positionInside(p,h),l=this.positionInside(p+c.word.length,h))}else c.start?u={column:c.start.column,line:c.start.line}:c.index&&(u=this.positionInside(c.index)),c.end?l={column:c.end.column,line:c.end.line}:typeof c.endIndex=="number"?l=this.positionInside(c.endIndex):c.index&&(l=this.positionInside(c.index+1));return(l.line<u.line||l.line===u.line&&l.column<=u.column)&&(l={column:u.column+1,line:u.line}),{end:l,start:u}}raw(c,u){return new n().raw(this,c,u)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...c){if(this.parent){let u=this,l=!1;for(let h of c)h===this?l=!0:l?(this.parent.insertAfter(u,h),u=h):this.parent.insertBefore(u,h);l||this.remove()}return this}root(){let c=this;for(;c.parent&&c.parent.type!=="document";)c=c.parent;return c}toJSON(c,u){let l={},h=u==null;u=u||new Map;let p=0;for(let d in this){if(!Object.prototype.hasOwnProperty.call(this,d)||d==="parent"||d==="proxyCache")continue;let m=this[d];if(Array.isArray(m))l[d]=m.map(f=>typeof f=="object"&&f.toJSON?f.toJSON(null,u):f);else if(typeof m=="object"&&m.toJSON)l[d]=m.toJSON(null,u);else if(d==="source"){let f=u.get(m.input);f==null&&(f=p,u.set(m.input,p),p++),l[d]={end:m.end,inputId:f,start:m.start}}else l[d]=m}return h&&(l.inputs=[...u.keys()].map(d=>d.toJSON())),l}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(c=s){c.stringify&&(c=c.stringify);let u="";return c(this,l=>{u+=l}),u}warn(c,u,l){let h={node:this};for(let p in l)h[p]=l[p];return c.warn(u,h)}get proxyOf(){return this}}return vn=i,i.default=i,vn}var bn,fo;function jr(){if(fo)return bn;fo=1;let e=Br();class t extends e{constructor(n){n&&typeof n.value<"u"&&typeof n.value!="string"&&(n={...n,value:String(n.value)}),super(n),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}}return bn=t,t.default=t,bn}var wn,mo;function Pu(){if(mo)return wn;mo=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return wn={nanoid:(n=21)=>{let s="",o=n;for(;o--;)s+=e[Math.random()*64|0];return s},customAlphabet:(n,s=21)=>(o=s)=>{let i="",a=o;for(;a--;)i+=n[Math.random()*n.length|0];return i}},wn}var xn,go;function Za(){if(go)return xn;go=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=$e,{existsSync:r,readFileSync:n}=$e,{dirname:s,join:o}=$e;function i(c){return Buffer?Buffer.from(c,"base64").toString():window.atob(c)}class a{constructor(u,l){if(l.map===!1)return;this.loadAnnotation(u),this.inline=this.startWith(this.annotation,"data:");let h=l.map?l.map.prev:void 0,p=this.loadMap(l.from,h);!this.mapFile&&l.from&&(this.mapFile=l.from),this.mapFile&&(this.root=s(this.mapFile)),p&&(this.text=p)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(u){let l=/^data:application\\/json;charset=utf-?8;base64,/,h=/^data:application\\/json;base64,/,p=/^data:application\\/json;charset=utf-?8,/,d=/^data:application\\/json,/;if(p.test(u)||d.test(u))return decodeURIComponent(u.substr(RegExp.lastMatch.length));if(l.test(u)||h.test(u))return i(u.substr(RegExp.lastMatch.length));let m=u.match(/data:application\\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+m)}getAnnotationURL(u){return u.replace(/^\\/\\*\\s*# sourceMappingURL=/,"").trim()}isMap(u){return typeof u!="object"?!1:typeof u.mappings=="string"||typeof u._mappings=="string"||Array.isArray(u.sections)}loadAnnotation(u){let l=u.match(/\\/\\*\\s*# sourceMappingURL=/gm);if(!l)return;let h=u.lastIndexOf(l.pop()),p=u.indexOf("*/",h);h>-1&&p>-1&&(this.annotation=this.getAnnotationURL(u.substring(h,p)))}loadFile(u){if(this.root=s(u),r(u))return this.mapFile=u,n(u,"utf-8").toString().trim()}loadMap(u,l){if(l===!1)return!1;if(l){if(typeof l=="string")return l;if(typeof l=="function"){let h=l(u);if(h){let p=this.loadFile(h);if(!p)throw new Error("Unable to load previous source map: "+h.toString());return p}}else{if(l instanceof e)return t.fromSourceMap(l).toString();if(l instanceof t)return l.toString();if(this.isMap(l))return JSON.stringify(l);throw new Error("Unsupported previous source map format: "+l.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let h=this.annotation;return u&&(h=o(s(u),h)),this.loadFile(h)}}}startWith(u,l){return u?u.substr(0,l.length)===l:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return xn=a,a.default=a,xn}var Sn,yo;function zr(){if(yo)return Sn;yo=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=$e,{fileURLToPath:r,pathToFileURL:n}=$e,{isAbsolute:s,resolve:o}=$e,{nanoid:i}=Pu(),a=$e,c=ei(),u=Za(),l=Symbol("fromOffsetCache"),h=!!(e&&t),p=!!(o&&s);class d{constructor(f,y={}){if(f===null||typeof f>"u"||typeof f=="object"&&!f.toString)throw new Error(`PostCSS received ${f} instead of CSS string`);if(this.css=f.toString(),this.css[0]==="\\uFEFF"||this.css[0]==="\\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,y.from&&(!p||/^\\w+:\\/\\//.test(y.from)||s(y.from)?this.file=y.from:this.file=o(y.from)),p&&h){let b=new u(this.css,y);if(b.text){this.map=b;let w=b.consumer().file;!this.file&&w&&(this.file=this.mapResolve(w))}}this.file||(this.id="<input css "+i(6)+">"),this.map&&(this.map.file=this.from)}error(f,y,b,w={}){let x,E,S;if(y&&typeof y=="object"){let R=y,k=b;if(typeof R.offset=="number"){let O=this.fromOffset(R.offset);y=O.line,b=O.col}else y=R.line,b=R.column;if(typeof k.offset=="number"){let O=this.fromOffset(k.offset);E=O.line,S=O.col}else E=k.line,S=k.column}else if(!b){let R=this.fromOffset(y);y=R.line,b=R.col}let v=this.origin(y,b,E,S);return v?x=new c(f,v.endLine===void 0?v.line:{column:v.column,line:v.line},v.endLine===void 0?v.column:{column:v.endColumn,line:v.endLine},v.source,v.file,w.plugin):x=new c(f,E===void 0?y:{column:b,line:y},E===void 0?b:{column:S,line:E},this.css,this.file,w.plugin),x.input={column:b,endColumn:S,endLine:E,line:y,source:this.css},this.file&&(n&&(x.input.url=n(this.file).toString()),x.input.file=this.file),x}fromOffset(f){let y,b;if(this[l])b=this[l];else{let x=this.css.split(`\n`);b=new Array(x.length);let E=0;for(let S=0,v=x.length;S<v;S++)b[S]=E,E+=x[S].length+1;this[l]=b}y=b[b.length-1];let w=0;if(f>=y)w=b.length-1;else{let x=b.length-2,E;for(;w<x;)if(E=w+(x-w>>1),f<b[E])x=E-1;else if(f>=b[E+1])w=E+1;else{w=E;break}}return{col:f-b[w]+1,line:w+1}}mapResolve(f){return/^\\w+:\\/\\//.test(f)?f:o(this.map.consumer().sourceRoot||this.map.root||".",f)}origin(f,y,b,w){if(!this.map)return!1;let x=this.map.consumer(),E=x.originalPositionFor({column:y,line:f});if(!E.source)return!1;let S;typeof b=="number"&&(S=x.originalPositionFor({column:w,line:b}));let v;s(E.source)?v=n(E.source):v=new URL(E.source,this.map.consumer().sourceRoot||n(this.map.mapFile));let R={column:E.column,endColumn:S&&S.column,endLine:S&&S.line,line:E.line,url:v.toString()};if(v.protocol==="file:")if(r)R.file=r(v);else throw new Error("file: protocol is not available in this PostCSS build");let k=x.sourceContentFor(E.source);return k&&(R.source=k),R}toJSON(){let f={};for(let y of["hasBOM","css","file","id"])this[y]!=null&&(f[y]=this[y]);return this.map&&(f.map={...this.map},f.map.consumerCache&&(f.map.consumerCache=void 0)),f}get from(){return this.file||this.id}}return Sn=d,d.default=d,a&&a.registerInput&&a.registerInput(d),Sn}var Cn,vo;function el(){if(vo)return Cn;vo=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=$e,{dirname:r,relative:n,resolve:s,sep:o}=$e,{pathToFileURL:i}=$e,a=zr(),c=!!(e&&t),u=!!(r&&s&&n&&o);class l{constructor(p,d,m,f){this.stringify=p,this.mapOpts=m.map||{},this.root=d,this.opts=m,this.css=f,this.originalCSS=f,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let p;this.isInline()?p="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?p=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?p=this.mapOpts.annotation(this.opts.to,this.root):p=this.outputFile()+".map";let d=`\n`;this.css.includes(`\\r\n`)&&(d=`\\r\n`),this.css+=d+"/*# sourceMappingURL="+p+" */"}applyPrevMaps(){for(let p of this.previous()){let d=this.toUrl(this.path(p.file)),m=p.root||r(p.file),f;this.mapOpts.sourcesContent===!1?(f=new e(p.text),f.sourcesContent&&(f.sourcesContent=null)):f=p.consumer(),this.map.applySourceMap(f,d,this.toUrl(this.path(m)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let p;for(let d=this.root.nodes.length-1;d>=0;d--)p=this.root.nodes[d],p.type==="comment"&&p.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(d)}else this.css&&(this.css=this.css.replace(/\\n*?\\/\\*#[\\S\\s]*?\\*\\/$/gm,""))}generate(){if(this.clearAnnotation(),u&&c&&this.isMap())return this.generateMap();{let p="";return this.stringify(this.root,d=>{p+=d}),[p]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let p=this.previous()[0].consumer();p.file=this.outputFile(),this.map=t.fromSourceMap(p,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<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 t({file:this.outputFile(),ignoreInvalidMapping:!0});let p=1,d=1,m="<no source>",f={generated:{column:0,line:0},original:{column:0,line:0},source:""},y,b;this.stringify(this.root,(w,x,E)=>{if(this.css+=w,x&&E!=="end"&&(f.generated.line=p,f.generated.column=d-1,x.source&&x.source.start?(f.source=this.sourcePath(x),f.original.line=x.source.start.line,f.original.column=x.source.start.column-1,this.map.addMapping(f)):(f.source=m,f.original.line=1,f.original.column=0,this.map.addMapping(f))),y=w.match(/\\n/g),y?(p+=y.length,b=w.lastIndexOf(`\n`),d=w.length-b):d+=w.length,x&&E!=="start"){let S=x.parent||{raws:{}};(!(x.type==="decl"||x.type==="atrule"&&!x.nodes)||x!==S.last||S.raws.semicolon)&&(x.source&&x.source.end?(f.source=this.sourcePath(x),f.original.line=x.source.end.line,f.original.column=x.source.end.column-1,f.generated.line=p,f.generated.column=d-2,this.map.addMapping(f)):(f.source=m,f.original.line=1,f.original.column=0,f.generated.line=p,f.generated.column=d-1,this.map.addMapping(f)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(p=>p.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let p=this.mapOpts.annotation;return typeof p<"u"&&p!==!0?!1:this.previous().length?this.previous().some(d=>d.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(p=>p.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(p){if(this.mapOpts.absolute||p.charCodeAt(0)===60||/^\\w+:\\/\\//.test(p))return p;let d=this.memoizedPaths.get(p);if(d)return d;let m=this.opts.to?r(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(m=r(s(m,this.mapOpts.annotation)));let f=n(m,p);return this.memoizedPaths.set(p,f),f}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(p=>{if(p.source&&p.source.input.map){let d=p.source.input.map;this.previousMaps.includes(d)||this.previousMaps.push(d)}});else{let p=new a(this.originalCSS,this.opts);p.map&&this.previousMaps.push(p.map)}return this.previousMaps}setSourcesContent(){let p={};if(this.root)this.root.walk(d=>{if(d.source){let m=d.source.input.from;if(m&&!p[m]){p[m]=!0;let f=this.usesFileUrls?this.toFileUrl(m):this.toUrl(this.path(m));this.map.setSourceContent(f,d.source.input.css)}}});else if(this.css){let d=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(d,this.css)}}sourcePath(p){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(p.source.input.from):this.toUrl(this.path(p.source.input.from))}toBase64(p){return Buffer?Buffer.from(p).toString("base64"):window.btoa(unescape(encodeURIComponent(p)))}toFileUrl(p){let d=this.memoizedFileURLs.get(p);if(d)return d;if(i){let m=i(p).toString();return this.memoizedFileURLs.set(p,m),m}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(p){let d=this.memoizedURLs.get(p);if(d)return d;o==="\\\\"&&(p=p.replace(/\\\\/g,"/"));let m=encodeURI(p).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(p,m),m}}return Cn=l,Cn}var En,bo;function Wr(){if(bo)return En;bo=1;let e=Br();class t extends e{constructor(n){super(n),this.type="comment"}}return En=t,t.default=t,En}var Rn,wo;function lt(){if(wo)return Rn;wo=1;let{isClean:e,my:t}=ti(),r=jr(),n=Wr(),s=Br(),o,i,a,c;function u(p){return p.map(d=>(d.nodes&&(d.nodes=u(d.nodes)),delete d.source,d))}function l(p){if(p[e]=!1,p.proxyOf.nodes)for(let d of p.proxyOf.nodes)l(d)}class h extends s{append(...d){for(let m of d){let f=this.normalize(m,this.last);for(let y of f)this.proxyOf.nodes.push(y)}return this.markDirty(),this}cleanRaws(d){if(super.cleanRaws(d),this.nodes)for(let m of this.nodes)m.cleanRaws(d)}each(d){if(!this.proxyOf.nodes)return;let m=this.getIterator(),f,y;for(;this.indexes[m]<this.proxyOf.nodes.length&&(f=this.indexes[m],y=d(this.proxyOf.nodes[f],f),y!==!1);)this.indexes[m]+=1;return delete this.indexes[m],y}every(d){return this.nodes.every(d)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let d=this.lastEach;return this.indexes[d]=0,d}getProxyProcessor(){return{get(d,m){return m==="proxyOf"?d:d[m]?m==="each"||typeof m=="string"&&m.startsWith("walk")?(...f)=>d[m](...f.map(y=>typeof y=="function"?(b,w)=>y(b.toProxy(),w):y)):m==="every"||m==="some"?f=>d[m]((y,...b)=>f(y.toProxy(),...b)):m==="root"?()=>d.root().toProxy():m==="nodes"?d.nodes.map(f=>f.toProxy()):m==="first"||m==="last"?d[m].toProxy():d[m]:d[m]},set(d,m,f){return d[m]===f||(d[m]=f,(m==="name"||m==="params"||m==="selector")&&d.markDirty()),!0}}}index(d){return typeof d=="number"?d:(d.proxyOf&&(d=d.proxyOf),this.proxyOf.nodes.indexOf(d))}insertAfter(d,m){let f=this.index(d),y=this.normalize(m,this.proxyOf.nodes[f]).reverse();f=this.index(d);for(let w of y)this.proxyOf.nodes.splice(f+1,0,w);let b;for(let w in this.indexes)b=this.indexes[w],f<b&&(this.indexes[w]=b+y.length);return this.markDirty(),this}insertBefore(d,m){let f=this.index(d),y=f===0?"prepend":!1,b=this.normalize(m,this.proxyOf.nodes[f],y).reverse();f=this.index(d);for(let x of b)this.proxyOf.nodes.splice(f,0,x);let w;for(let x in this.indexes)w=this.indexes[x],f<=w&&(this.indexes[x]=w+b.length);return this.markDirty(),this}normalize(d,m){if(typeof d=="string")d=u(o(d).nodes);else if(typeof d>"u")d=[];else if(Array.isArray(d)){d=d.slice(0);for(let y of d)y.parent&&y.parent.removeChild(y,"ignore")}else if(d.type==="root"&&this.type!=="document"){d=d.nodes.slice(0);for(let y of d)y.parent&&y.parent.removeChild(y,"ignore")}else if(d.type)d=[d];else if(d.prop){if(typeof d.value>"u")throw new Error("Value field is missed in node creation");typeof d.value!="string"&&(d.value=String(d.value)),d=[new r(d)]}else if(d.selector)d=[new i(d)];else if(d.name)d=[new a(d)];else if(d.text)d=[new n(d)];else throw new Error("Unknown node type in node creation");return d.map(y=>(y[t]||h.rebuild(y),y=y.proxyOf,y.parent&&y.parent.removeChild(y),y[e]&&l(y),typeof y.raws.before>"u"&&m&&typeof m.raws.before<"u"&&(y.raws.before=m.raws.before.replace(/\\S/g,"")),y.parent=this.proxyOf,y))}prepend(...d){d=d.reverse();for(let m of d){let f=this.normalize(m,this.first,"prepend").reverse();for(let y of f)this.proxyOf.nodes.unshift(y);for(let y in this.indexes)this.indexes[y]=this.indexes[y]+f.length}return this.markDirty(),this}push(d){return d.parent=this,this.proxyOf.nodes.push(d),this}removeAll(){for(let d of this.proxyOf.nodes)d.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(d){d=this.index(d),this.proxyOf.nodes[d].parent=void 0,this.proxyOf.nodes.splice(d,1);let m;for(let f in this.indexes)m=this.indexes[f],m>=d&&(this.indexes[f]=m-1);return this.markDirty(),this}replaceValues(d,m,f){return f||(f=m,m={}),this.walkDecls(y=>{m.props&&!m.props.includes(y.prop)||m.fast&&!y.value.includes(m.fast)||(y.value=y.value.replace(d,f))}),this.markDirty(),this}some(d){return this.nodes.some(d)}walk(d){return this.each((m,f)=>{let y;try{y=d(m,f)}catch(b){throw m.addToError(b)}return y!==!1&&m.walk&&(y=m.walk(d)),y})}walkAtRules(d,m){return m?d instanceof RegExp?this.walk((f,y)=>{if(f.type==="atrule"&&d.test(f.name))return m(f,y)}):this.walk((f,y)=>{if(f.type==="atrule"&&f.name===d)return m(f,y)}):(m=d,this.walk((f,y)=>{if(f.type==="atrule")return m(f,y)}))}walkComments(d){return this.walk((m,f)=>{if(m.type==="comment")return d(m,f)})}walkDecls(d,m){return m?d instanceof RegExp?this.walk((f,y)=>{if(f.type==="decl"&&d.test(f.prop))return m(f,y)}):this.walk((f,y)=>{if(f.type==="decl"&&f.prop===d)return m(f,y)}):(m=d,this.walk((f,y)=>{if(f.type==="decl")return m(f,y)}))}walkRules(d,m){return m?d instanceof RegExp?this.walk((f,y)=>{if(f.type==="rule"&&d.test(f.selector))return m(f,y)}):this.walk((f,y)=>{if(f.type==="rule"&&f.selector===d)return m(f,y)}):(m=d,this.walk((f,y)=>{if(f.type==="rule")return m(f,y)}))}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]}}return h.registerParse=p=>{o=p},h.registerRule=p=>{i=p},h.registerAtRule=p=>{a=p},h.registerRoot=p=>{c=p},Rn=h,h.default=h,h.rebuild=p=>{p.type==="atrule"?Object.setPrototypeOf(p,a.prototype):p.type==="rule"?Object.setPrototypeOf(p,i.prototype):p.type==="decl"?Object.setPrototypeOf(p,r.prototype):p.type==="comment"?Object.setPrototypeOf(p,n.prototype):p.type==="root"&&Object.setPrototypeOf(p,c.prototype),p[t]=!0,p.nodes&&p.nodes.forEach(d=>{h.rebuild(d)})},Rn}var kn,xo;function ri(){if(xo)return kn;xo=1;let e=lt(),t,r;class n extends e{constructor(o){super({type:"document",...o}),this.nodes||(this.nodes=[])}toResult(o={}){return new t(new r,this,o).stringify()}}return n.registerLazyResult=s=>{t=s},n.registerProcessor=s=>{r=s},kn=n,n.default=n,kn}var Mn,So;function tl(){if(So)return Mn;So=1;let e={};return Mn=function(r){e[r]||(e[r]=!0,typeof console<"u"&&console.warn&&console.warn(r))},Mn}var Nn,Co;function rl(){if(Co)return Nn;Co=1;class e{constructor(r,n={}){if(this.type="warning",this.text=r,n.node&&n.node.source){let s=n.node.rangeBy(n);this.line=s.start.line,this.column=s.start.column,this.endLine=s.end.line,this.endColumn=s.end.column}for(let s in n)this[s]=n[s]}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}}return Nn=e,e.default=e,Nn}var On,Eo;function ni(){if(Eo)return On;Eo=1;let e=rl();class t{constructor(n,s,o){this.processor=n,this.messages=[],this.root=s,this.opts=o,this.css=void 0,this.map=void 0}toString(){return this.css}warn(n,s={}){s.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(s.plugin=this.lastPlugin.postcssPlugin);let o=new e(n,s);return this.messages.push(o),o}warnings(){return this.messages.filter(n=>n.type==="warning")}get content(){return this.css}}return On=t,t.default=t,On}var In,Ro;function _u(){if(Ro)return In;Ro=1;let e=39,t=34,r=92,n=47,s=10,o=32,i=12,a=9,c=13,u=91,l=93,h=40,p=41,d=123,m=125,f=59,y=42,b=58,w=64,x=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/g,E=/[\\t\\n\\f\\r !"#\'():;@[\\\\\\]{}]|\\/(?=\\*)/g,S=/.[\\r\\n"\'(/\\\\]/,v=/[\\da-f]/i;return In=function(k,O={}){let M=k.css.valueOf(),_=O.ignoreErrors,D,C,A,G,F,P,B,me,ie,ee,Ke=M.length,I=0,qe=[],De=[];function kt(){return I}function xe(j){throw k.error("Unclosed "+j,I)}function ke(){return De.length===0&&I>=Ke}function nt(j){if(De.length)return De.pop();if(I>=Ke)return;let ge=j?j.ignoreUnclosed:!1;switch(D=M.charCodeAt(I),D){case s:case o:case a:case c:case i:{C=I;do C+=1,D=M.charCodeAt(C);while(D===o||D===s||D===a||D===c||D===i);ee=["space",M.slice(I,C)],I=C-1;break}case u:case l:case d:case m:case b:case f:case p:{let W=String.fromCharCode(D);ee=[W,W,I];break}case h:{if(me=qe.length?qe.pop()[1]:"",ie=M.charCodeAt(I+1),me==="url"&&ie!==e&&ie!==t&&ie!==o&&ie!==s&&ie!==a&&ie!==i&&ie!==c){C=I;do{if(P=!1,C=M.indexOf(")",C+1),C===-1)if(_||ge){C=I;break}else xe("bracket");for(B=C;M.charCodeAt(B-1)===r;)B-=1,P=!P}while(P);ee=["brackets",M.slice(I,C+1),I,C],I=C}else C=M.indexOf(")",I+1),G=M.slice(I,C+1),C===-1||S.test(G)?ee=["(","(",I]:(ee=["brackets",G,I,C],I=C);break}case e:case t:{A=D===e?"\'":\'"\',C=I;do{if(P=!1,C=M.indexOf(A,C+1),C===-1)if(_||ge){C=I+1;break}else xe("string");for(B=C;M.charCodeAt(B-1)===r;)B-=1,P=!P}while(P);ee=["string",M.slice(I,C+1),I,C],I=C;break}case w:{x.lastIndex=I+1,x.test(M),x.lastIndex===0?C=M.length-1:C=x.lastIndex-2,ee=["at-word",M.slice(I,C+1),I,C],I=C;break}case r:{for(C=I,F=!0;M.charCodeAt(C+1)===r;)C+=1,F=!F;if(D=M.charCodeAt(C+1),F&&D!==n&&D!==o&&D!==s&&D!==a&&D!==c&&D!==i&&(C+=1,v.test(M.charAt(C)))){for(;v.test(M.charAt(C+1));)C+=1;M.charCodeAt(C+1)===o&&(C+=1)}ee=["word",M.slice(I,C+1),I,C],I=C;break}default:{D===n&&M.charCodeAt(I+1)===y?(C=M.indexOf("*/",I+2)+1,C===0&&(_||ge?C=M.length:xe("comment")),ee=["comment",M.slice(I,C+1),I,C],I=C):(E.lastIndex=I+1,E.test(M),E.lastIndex===0?C=M.length-1:C=E.lastIndex-2,ee=["word",M.slice(I,C+1),I,C],qe.push(ee),I=C);break}}return I++,ee}function Be(j){De.push(j)}return{back:Be,endOfFile:ke,nextToken:nt,position:kt}},In}var Dn,ko;function si(){if(ko)return Dn;ko=1;let e=lt();class t extends e{constructor(n){super(n),this.type="atrule"}append(...n){return this.proxyOf.nodes||(this.nodes=[]),super.append(...n)}prepend(...n){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...n)}}return Dn=t,t.default=t,e.registerAtRule(t),Dn}var An,Mo;function tr(){if(Mo)return An;Mo=1;let e=lt(),t,r;class n extends e{constructor(o){super(o),this.type="root",this.nodes||(this.nodes=[])}normalize(o,i,a){let c=super.normalize(o);if(i){if(a==="prepend")this.nodes.length>1?i.raws.before=this.nodes[1].raws.before:delete i.raws.before;else if(this.first!==i)for(let u of c)u.raws.before=i.raws.before}return c}removeChild(o,i){let a=this.index(o);return!i&&a===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[a].raws.before),super.removeChild(o)}toResult(o={}){return new t(new r,this,o).stringify()}}return n.registerLazyResult=s=>{t=s},n.registerProcessor=s=>{r=s},An=n,n.default=n,e.registerRoot(n),An}var Tn,No;function nl(){if(No)return Tn;No=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let r=[" ",`\n`," "];return e.split(t,r)},split(t,r,n){let s=[],o="",i=!1,a=0,c=!1,u="",l=!1;for(let h of t)l?l=!1:h==="\\\\"?l=!0:c?h===u&&(c=!1):h===\'"\'||h==="\'"?(c=!0,u=h):h==="("?a+=1:h===")"?a>0&&(a-=1):a===0&&r.includes(h)&&(i=!0),i?(o!==""&&s.push(o.trim()),o="",i=!1):o+=h;return(n||o!=="")&&s.push(o.trim()),s}};return Tn=e,e.default=e,Tn}var Ln,Oo;function ii(){if(Oo)return Ln;Oo=1;let e=lt(),t=nl();class r extends e{constructor(s){super(s),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(s){let o=this.selector?this.selector.match(/,\\s*/):null,i=o?o[0]:","+this.raw("between","beforeOpen");this.selector=s.join(i)}}return Ln=r,r.default=r,e.registerRule(r),Ln}var Pn,Io;function $u(){if(Io)return Pn;Io=1;let e=jr(),t=_u(),r=Wr(),n=si(),s=tr(),o=ii(),i={empty:!0,space:!0};function a(u){for(let l=u.length-1;l>=0;l--){let h=u[l],p=h[3]||h[2];if(p)return p}}class c{constructor(l){this.input=l,this.root=new s,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:l,start:{column:1,line:1,offset:0}}}atrule(l){let h=new n;h.name=l[1].slice(1),h.name===""&&this.unnamedAtrule(h,l),this.init(h,l[2]);let p,d,m,f=!1,y=!1,b=[],w=[];for(;!this.tokenizer.endOfFile();){if(l=this.tokenizer.nextToken(),p=l[0],p==="("||p==="["?w.push(p==="("?")":"]"):p==="{"&&w.length>0?w.push("}"):p===w[w.length-1]&&w.pop(),w.length===0)if(p===";"){h.source.end=this.getPosition(l[2]),h.source.end.offset++,this.semicolon=!0;break}else if(p==="{"){y=!0;break}else if(p==="}"){if(b.length>0){for(m=b.length-1,d=b[m];d&&d[0]==="space";)d=b[--m];d&&(h.source.end=this.getPosition(d[3]||d[2]),h.source.end.offset++)}this.end(l);break}else b.push(l);else b.push(l);if(this.tokenizer.endOfFile()){f=!0;break}}h.raws.between=this.spacesAndCommentsFromEnd(b),b.length?(h.raws.afterName=this.spacesAndCommentsFromStart(b),this.raw(h,"params",b),f&&(l=b[b.length-1],h.source.end=this.getPosition(l[3]||l[2]),h.source.end.offset++,this.spaces=h.raws.between,h.raws.between="")):(h.raws.afterName="",h.params=""),y&&(h.nodes=[],this.current=h)}checkMissedSemicolon(l){let h=this.colon(l);if(h===!1)return;let p=0,d;for(let m=h-1;m>=0&&(d=l[m],!(d[0]!=="space"&&(p+=1,p===2)));m--);throw this.input.error("Missed semicolon",d[0]==="word"?d[3]+1:d[2])}colon(l){let h=0,p,d,m;for(let[f,y]of l.entries()){if(p=y,d=p[0],d==="("&&(h+=1),d===")"&&(h-=1),h===0&&d===":")if(!m)this.doubleColon(p);else{if(m[0]==="word"&&m[1]==="progid")continue;return f}m=p}return!1}comment(l){let h=new r;this.init(h,l[2]),h.source.end=this.getPosition(l[3]||l[2]),h.source.end.offset++;let p=l[1].slice(2,-2);if(/^\\s*$/.test(p))h.text="",h.raws.left=p,h.raws.right="";else{let d=p.match(/^(\\s*)([^]*\\S)(\\s*)$/);h.text=d[2],h.raws.left=d[1],h.raws.right=d[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(l,h){let p=new e;this.init(p,l[0][2]);let d=l[l.length-1];for(d[0]===";"&&(this.semicolon=!0,l.pop()),p.source.end=this.getPosition(d[3]||d[2]||a(l)),p.source.end.offset++;l[0][0]!=="word";)l.length===1&&this.unknownWord(l),p.raws.before+=l.shift()[1];for(p.source.start=this.getPosition(l[0][2]),p.prop="";l.length;){let w=l[0][0];if(w===":"||w==="space"||w==="comment")break;p.prop+=l.shift()[1]}p.raws.between="";let m;for(;l.length;)if(m=l.shift(),m[0]===":"){p.raws.between+=m[1];break}else m[0]==="word"&&/\\w/.test(m[1])&&this.unknownWord([m]),p.raws.between+=m[1];(p.prop[0]==="_"||p.prop[0]==="*")&&(p.raws.before+=p.prop[0],p.prop=p.prop.slice(1));let f=[],y;for(;l.length&&(y=l[0][0],!(y!=="space"&&y!=="comment"));)f.push(l.shift());this.precheckMissedSemicolon(l);for(let w=l.length-1;w>=0;w--){if(m=l[w],m[1].toLowerCase()==="!important"){p.important=!0;let x=this.stringFrom(l,w);x=this.spacesFromEnd(l)+x,x!==" !important"&&(p.raws.important=x);break}else if(m[1].toLowerCase()==="important"){let x=l.slice(0),E="";for(let S=w;S>0;S--){let v=x[S][0];if(E.trim().indexOf("!")===0&&v!=="space")break;E=x.pop()[1]+E}E.trim().indexOf("!")===0&&(p.important=!0,p.raws.important=E,l=x)}if(m[0]!=="space"&&m[0]!=="comment")break}l.some(w=>w[0]!=="space"&&w[0]!=="comment")&&(p.raws.between+=f.map(w=>w[1]).join(""),f=[]),this.raw(p,"value",f.concat(l),h),p.value.includes(":")&&!h&&this.checkMissedSemicolon(l)}doubleColon(l){throw this.input.error("Double colon",{offset:l[2]},{offset:l[2]+l[1].length})}emptyRule(l){let h=new o;this.init(h,l[2]),h.selector="",h.raws.between="",this.current=h}end(l){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(l[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(l)}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(l){if(this.spaces+=l[1],this.current.nodes){let h=this.current.nodes[this.current.nodes.length-1];h&&h.type==="rule"&&!h.raws.ownSemicolon&&(h.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(l){let h=this.input.fromOffset(l);return{column:h.col,line:h.line,offset:l}}init(l,h){this.current.push(l),l.source={input:this.input,start:this.getPosition(h)},l.raws.before=this.spaces,this.spaces="",l.type!=="comment"&&(this.semicolon=!1)}other(l){let h=!1,p=null,d=!1,m=null,f=[],y=l[1].startsWith("--"),b=[],w=l;for(;w;){if(p=w[0],b.push(w),p==="("||p==="[")m||(m=w),f.push(p==="("?")":"]");else if(y&&d&&p==="{")m||(m=w),f.push("}");else if(f.length===0)if(p===";")if(d){this.decl(b,y);return}else break;else if(p==="{"){this.rule(b);return}else if(p==="}"){this.tokenizer.back(b.pop()),h=!0;break}else p===":"&&(d=!0);else p===f[f.length-1]&&(f.pop(),f.length===0&&(m=null));w=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(h=!0),f.length>0&&this.unclosedBracket(m),h&&d){if(!y)for(;b.length&&(w=b[b.length-1][0],!(w!=="space"&&w!=="comment"));)this.tokenizer.back(b.pop());this.decl(b,y)}else this.unknownWord(b)}parse(){let l;for(;!this.tokenizer.endOfFile();)switch(l=this.tokenizer.nextToken(),l[0]){case"space":this.spaces+=l[1];break;case";":this.freeSemicolon(l);break;case"}":this.end(l);break;case"comment":this.comment(l);break;case"at-word":this.atrule(l);break;case"{":this.emptyRule(l);break;default:this.other(l);break}this.endFile()}precheckMissedSemicolon(){}raw(l,h,p,d){let m,f,y=p.length,b="",w=!0,x,E;for(let S=0;S<y;S+=1)m=p[S],f=m[0],f==="space"&&S===y-1&&!d?w=!1:f==="comment"?(E=p[S-1]?p[S-1][0]:"empty",x=p[S+1]?p[S+1][0]:"empty",!i[E]&&!i[x]?b.slice(-1)===","?w=!1:b+=m[1]:w=!1):b+=m[1];if(!w){let S=p.reduce((v,R)=>v+R[1],"");l.raws[h]={raw:S,value:b}}l[h]=b}rule(l){l.pop();let h=new o;this.init(h,l[0][2]),h.raws.between=this.spacesAndCommentsFromEnd(l),this.raw(h,"selector",l),this.current=h}spacesAndCommentsFromEnd(l){let h,p="";for(;l.length&&(h=l[l.length-1][0],!(h!=="space"&&h!=="comment"));)p=l.pop()[1]+p;return p}spacesAndCommentsFromStart(l){let h,p="";for(;l.length&&(h=l[0][0],!(h!=="space"&&h!=="comment"));)p+=l.shift()[1];return p}spacesFromEnd(l){let h,p="";for(;l.length&&(h=l[l.length-1][0],h==="space");)p=l.pop()[1]+p;return p}stringFrom(l,h){let p="";for(let d=h;d<l.length;d++)p+=l[d][1];return l.splice(h,l.length-h),p}unclosedBlock(){let l=this.current.source.start;throw this.input.error("Unclosed block",l.line,l.column)}unclosedBracket(l){throw this.input.error("Unclosed bracket",{offset:l[2]},{offset:l[2]+1})}unexpectedClose(l){throw this.input.error("Unexpected }",{offset:l[2]},{offset:l[2]+1})}unknownWord(l){throw this.input.error("Unknown word",{offset:l[0][2]},{offset:l[0][2]+l[0][1].length})}unnamedAtrule(l,h){throw this.input.error("At-rule without name",{offset:h[2]},{offset:h[2]+h[1].length})}}return Pn=c,Pn}var _n,Do;function oi(){if(Do)return _n;Do=1;let e=lt(),t=$u(),r=zr();function n(s,o){let i=new r(s,o),a=new t(i);try{a.parse()}catch(c){throw c}return a.root}return _n=n,n.default=n,e.registerParse(n),_n}var $n,Ao;function sl(){if(Ao)return $n;Ao=1;let{isClean:e,my:t}=ti(),r=el(),n=qr(),s=lt(),o=ri(),i=tl(),a=ni(),c=oi(),u=tr(),l={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={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},p={Once:!0,postcssPlugin:!0,prepare:!0},d=0;function m(E){return typeof E=="object"&&typeof E.then=="function"}function f(E){let S=!1,v=l[E.type];return E.type==="decl"?S=E.prop.toLowerCase():E.type==="atrule"&&(S=E.name.toLowerCase()),S&&E.append?[v,v+"-"+S,d,v+"Exit",v+"Exit-"+S]:S?[v,v+"-"+S,v+"Exit",v+"Exit-"+S]:E.append?[v,d,v+"Exit"]:[v,v+"Exit"]}function y(E){let S;return E.type==="document"?S=["Document",d,"DocumentExit"]:E.type==="root"?S=["Root",d,"RootExit"]:S=f(E),{eventIndex:0,events:S,iterator:0,node:E,visitorIndex:0,visitors:[]}}function b(E){return E[e]=!1,E.nodes&&E.nodes.forEach(S=>b(S)),E}let w={};class x{constructor(S,v,R){this.stringified=!1,this.processed=!1;let k;if(typeof v=="object"&&v!==null&&(v.type==="root"||v.type==="document"))k=b(v);else if(v instanceof x||v instanceof a)k=b(v.root),v.map&&(typeof R.map>"u"&&(R.map={}),R.map.inline||(R.map.inline=!1),R.map.prev=v.map);else{let O=c;R.syntax&&(O=R.syntax.parse),R.parser&&(O=R.parser),O.parse&&(O=O.parse);try{k=O(v,R)}catch(M){this.processed=!0,this.error=M}k&&!k[t]&&s.rebuild(k)}this.result=new a(S,k,R),this.helpers={...w,postcss:w,result:this.result},this.plugins=this.processor.plugins.map(O=>typeof O=="object"&&O.prepare?{...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(S){return this.async().catch(S)}finally(S){return this.async().then(S,S)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(S,v){let R=this.result.lastPlugin;try{v&&v.addToError(S),this.error=S,S.name==="CssSyntaxError"&&!S.plugin?(S.plugin=R.postcssPlugin,S.setMessage()):R.postcssVersion}catch(k){console&&console.error&&console.error(k)}return S}prepareVisitors(){this.listeners={};let S=(v,R,k)=>{this.listeners[R]||(this.listeners[R]=[]),this.listeners[R].push([v,k])};for(let v of this.plugins)if(typeof v=="object")for(let R in v){if(!h[R]&&/^[A-Z]/.test(R))throw new Error(`Unknown event ${R} in ${v.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!p[R])if(typeof v[R]=="object")for(let k in v[R])k==="*"?S(v,R,v[R][k]):S(v,R+"-"+k.toLowerCase(),v[R][k]);else typeof v[R]=="function"&&S(v,R,v[R])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let S=0;S<this.plugins.length;S++){let v=this.plugins[S],R=this.runOnRoot(v);if(m(R))try{await R}catch(k){throw this.handleError(k)}}if(this.prepareVisitors(),this.hasListener){let S=this.result.root;for(;!S[e];){S[e]=!0;let v=[y(S)];for(;v.length>0;){let R=this.visitTick(v);if(m(R))try{await R}catch(k){let O=v[v.length-1].node;throw this.handleError(k,O)}}}if(this.listeners.OnceExit)for(let[v,R]of this.listeners.OnceExit){this.result.lastPlugin=v;try{if(S.type==="document"){let k=S.nodes.map(O=>R(O,this.helpers));await Promise.all(k)}else await R(S,this.helpers)}catch(k){throw this.handleError(k)}}}return this.processed=!0,this.stringify()}runOnRoot(S){this.result.lastPlugin=S;try{if(typeof S=="object"&&S.Once){if(this.result.root.type==="document"){let v=this.result.root.nodes.map(R=>S.Once(R,this.helpers));return m(v[0])?Promise.all(v):v}return S.Once(this.result.root,this.helpers)}else if(typeof S=="function")return S(this.result.root,this.result)}catch(v){throw this.handleError(v)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let S=this.result.opts,v=n;S.syntax&&(v=S.syntax.stringify),S.stringifier&&(v=S.stringifier),v.stringify&&(v=v.stringify);let k=new r(v,this.result.root,this.result.opts).generate();return this.result.css=k[0],this.result.map=k[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 S of this.plugins){let v=this.runOnRoot(S);if(m(v))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let S=this.result.root;for(;!S[e];)S[e]=!0,this.walkSync(S);if(this.listeners.OnceExit)if(S.type==="document")for(let v of S.nodes)this.visitSync(this.listeners.OnceExit,v);else this.visitSync(this.listeners.OnceExit,S)}return this.result}then(S,v){return this.async().then(S,v)}toString(){return this.css}visitSync(S,v){for(let[R,k]of S){this.result.lastPlugin=R;let O;try{O=k(v,this.helpers)}catch(M){throw this.handleError(M,v.proxyOf)}if(v.type!=="root"&&v.type!=="document"&&!v.parent)return!0;if(m(O))throw this.getAsyncError()}}visitTick(S){let v=S[S.length-1],{node:R,visitors:k}=v;if(R.type!=="root"&&R.type!=="document"&&!R.parent){S.pop();return}if(k.length>0&&v.visitorIndex<k.length){let[M,_]=k[v.visitorIndex];v.visitorIndex+=1,v.visitorIndex===k.length&&(v.visitors=[],v.visitorIndex=0),this.result.lastPlugin=M;try{return _(R.toProxy(),this.helpers)}catch(D){throw this.handleError(D,R)}}if(v.iterator!==0){let M=v.iterator,_;for(;_=R.nodes[R.indexes[M]];)if(R.indexes[M]+=1,!_[e]){_[e]=!0,S.push(y(_));return}v.iterator=0,delete R.indexes[M]}let O=v.events;for(;v.eventIndex<O.length;){let M=O[v.eventIndex];if(v.eventIndex+=1,M===d){R.nodes&&R.nodes.length&&(R[e]=!0,v.iterator=R.getIterator());return}else if(this.listeners[M]){v.visitors=this.listeners[M];return}}S.pop()}walkSync(S){S[e]=!0;let v=f(S);for(let R of v)if(R===d)S.nodes&&S.each(k=>{k[e]||this.walkSync(k)});else{let k=this.listeners[R];if(k&&this.visitSync(k,S.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return x.registerPostcss=E=>{w=E},$n=x,x.default=x,u.registerLazyResult(x),o.registerLazyResult(x),$n}var Fn,To;function Fu(){if(To)return Fn;To=1;let e=el(),t=qr(),r=tl(),n=oi(),s=ni();class o{constructor(a,c,u){c=c.toString(),this.stringified=!1,this._processor=a,this._css=c,this._opts=u,this._map=void 0;let l,h=t;this.result=new s(this._processor,l,this._opts),this.result.css=c;let p=this;Object.defineProperty(this.result,"root",{get(){return p.root}});let d=new e(h,l,this._opts,c);if(d.isMap()){let[m,f]=d.generate();m&&(this.result.css=m),f&&(this.result.map=f)}else d.clearAnnotation(),this.result.css=d.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(a){return this.async().catch(a)}finally(a){return this.async().then(a,a)}sync(){if(this.error)throw this.error;return this.result}then(a,c){return this.async().then(a,c)}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 a,c=n;try{a=c(this._css,this._opts)}catch(u){this.error=u}if(this.error)throw this.error;return this._root=a,a}get[Symbol.toStringTag](){return"NoWorkResult"}}return Fn=o,o.default=o,Fn}var Un,Lo;function Uu(){if(Lo)return Un;Lo=1;let e=Fu(),t=sl(),r=ri(),n=tr();class s{constructor(i=[]){this.version="8.4.38",this.plugins=this.normalize(i)}normalize(i){let a=[];for(let c of i)if(c.postcss===!0?c=c():c.postcss&&(c=c.postcss),typeof c=="object"&&Array.isArray(c.plugins))a=a.concat(c.plugins);else if(typeof c=="object"&&c.postcssPlugin)a.push(c);else if(typeof c=="function")a.push(c);else if(!(typeof c=="object"&&(c.parse||c.stringify)))throw new Error(c+" is not a PostCSS plugin");return a}process(i,a={}){return!this.plugins.length&&!a.parser&&!a.stringifier&&!a.syntax?new e(this,i,a):new t(this,i,a)}use(i){return this.plugins=this.plugins.concat(this.normalize([i])),this}}return Un=s,s.default=s,n.registerProcessor(s),r.registerProcessor(s),Un}var qn,Po;function qu(){if(Po)return qn;Po=1;let e=jr(),t=Za(),r=Wr(),n=si(),s=zr(),o=tr(),i=ii();function a(c,u){if(Array.isArray(c))return c.map(p=>a(p));let{inputs:l,...h}=c;if(l){u=[];for(let p of l){let d={...p,__proto__:s.prototype};d.map&&(d.map={...d.map,__proto__:t.prototype}),u.push(d)}}if(h.nodes&&(h.nodes=c.nodes.map(p=>a(p,u))),h.source){let{inputId:p,...d}=h.source;h.source=d,p!=null&&(h.source.input=u[p])}if(h.type==="root")return new o(h);if(h.type==="decl")return new e(h);if(h.type==="rule")return new i(h);if(h.type==="comment")return new r(h);if(h.type==="atrule")return new n(h);throw new Error("Unknown node type: "+c.type)}return qn=a,a.default=a,qn}var Bn,_o;function Bu(){if(_o)return Bn;_o=1;let e=ei(),t=jr(),r=sl(),n=lt(),s=Uu(),o=qr(),i=qu(),a=ri(),c=rl(),u=Wr(),l=si(),h=ni(),p=zr(),d=oi(),m=nl(),f=ii(),y=tr(),b=Br();function w(...x){return x.length===1&&Array.isArray(x[0])&&(x=x[0]),new s(x)}return w.plugin=function(E,S){let v=!1;function R(...O){console&&console.warn&&!v&&(v=!0,console.warn(E+`: postcss.plugin was deprecated. Migration guide:\nhttps://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:\nhttps://www.w3ctech.com/topic/2226`));let M=S(...O);return M.postcssPlugin=E,M.postcssVersion=new s().version,M}let k;return Object.defineProperty(R,"postcss",{get(){return k||(k=R()),k}}),R.process=function(O,M,_){return w([R(_)]).process(O,M)},R},w.stringify=o,w.parse=d,w.fromJSON=i,w.list=m,w.comment=x=>new u(x),w.atRule=x=>new l(x),w.decl=x=>new t(x),w.rule=x=>new f(x),w.root=x=>new y(x),w.document=x=>new a(x),w.CssSyntaxError=e,w.Declaration=t,w.Container=n,w.Processor=s,w.Document=a,w.Comment=u,w.Warning=c,w.AtRule=l,w.Result=h,w.Input=p,w.Rule=f,w.Root=y,w.Node=b,r.registerPostcss(w),Bn=w,w.default=w,Bn}var ju=Bu(),ae=Iu(ju);ae.stringify;ae.fromJSON;ae.plugin;ae.parse;ae.list;ae.document;ae.comment;ae.atRule;ae.rule;ae.decl;ae.root;ae.CssSyntaxError;ae.Declaration;ae.Container;ae.Processor;ae.Document;ae.Comment;ae.Warning;ae.AtRule;ae.Result;ae.Input;ae.Rule;ae.Root;ae.Node;var $o={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 zu(e){let t=$o[e.tagName]?$o[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function Vr(e,t){let r=t?.stylesWithHoverClass.get(e);if(r)return r;let n=e;try{n=ae([Nu,Ou]).process(e).css}catch(s){console.warn("Failed to adapt css for replay",s)}return t?.stylesWithHoverClass.set(e,n),n}function Fo(){return{stylesWithHoverClass:new Map}}var Wu="rrweb-snapshot.rebuild() cannot rebuild into an unprotected browser document. Use rebuildIntoSandboxedIframe() or set UNSAFE_allowUnprotectedRebuild: true only when you accept the script-execution risk.",Uo="rrweb-snapshot.createSandboxedIframe() requires root to be connected to a document before creating a sandboxed iframe.",il=new WeakSet;function Vu(e){if(!e||e.tagName!=="IFRAME"||!("sandbox"in e))return!1;let t=Array.from(e.sandbox);return t.length===1&&t[0]==="allow-same-origin"}function Hu(e){if(e.UNSAFE_allowUnprotectedRebuild)return;let t=e.doc.defaultView;if(t&&!(il.has(e.doc)&&Vu(t.frameElement)))throw new Error(Wu)}function Gu(e,t,r,n){let s=[];for(let u of e.childNodes)u.type===H.Text&&s.push(u);let o=t.split("/* rr_split */");for(;o.length>1&&o.length>s.length;)o.splice(-2,2,o.slice(-2).join(""));let i="";r&&(i=Vr(o.join(""),n));let a=0,c=-1;for(let u=0;u<s.length&&u!==o.length;u++){let l=s[u],h=o[u],p=u<o.length-1?o[u+1]:null;if(r&&p){let d=a,m=p.length;m=Math.min(m,30);let f=!1;for(;m>2;m--){let y=p.substring(0,m),b=i.substring(a).indexOf(y);if(f=b!==-1,f){d+=b;break}}f||(d+=h.length),h=i.substring(a,d),a=d}else r&&(h=i.substring(a));c!==-1&&(h=h.substring(c)),p&&(c!==-1||h.endsWith("0p")&&p.startsWith("x"))&&(c=p.indexOf("}"),c!==-1&&(c+=1,h+=p.substring(0,c))),l.textContent=h}}function Yu(e,t,r,n){let{doc:s,hackCss:o,cache:i}=n;e.childNodes.length?Gu(e,r,o,i):(o&&(r=Vr(r,i)),t.appendChild(s.createTextNode(r)))}function Ju(e,t){var r;let{doc:n,hackCss:s,cache:o}=t;switch(e.type){case H.Document:return n.implementation.createDocument(null,"",null);case H.DocumentType:return n.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case H.Element:{let i=zu(e),a;e.isSVG?a=n.createElementNS("http://www.w3.org/2000/svg",i):(e.isCustom&&((r=n.defaultView)!=null&&r.customElements)&&!n.defaultView.customElements.get(e.tagName)&&n.defaultView.customElements.define(e.tagName,class extends n.defaultView.HTMLElement{}),a=n.createElement(i));let c={};for(let u in e.attributes){if(!Object.prototype.hasOwnProperty.call(e.attributes,u))continue;let l=e.attributes[u];if(!(i==="option"&&u==="selected"&&l===!1)&&l!==null){if(l===!0&&(l=""),u.startsWith("rr_")){c[u]=l;continue}if(typeof l=="string"){if(i==="style"&&u==="_cssText"){Yu(e,a,l,t);continue}else if(i==="textarea"&&u==="value"){a.appendChild(n.createTextNode(l)),e.childNodes=[];continue}}try{if(e.isSVG&&u==="xlink:href")a.setAttributeNS("http://www.w3.org/1999/xlink",u,l.toString());else if(u==="onload"||u==="onclick"||u.substring(0,7)==="onmouse")a.setAttribute("_"+u,l.toString());else if(i==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&u==="content"){a.setAttribute("csp-content",l.toString());continue}else i==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||i==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Qs(e.attributes.href)==="js"||(i==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?a.setAttribute("rrweb-original-srcset",e.attributes.srcset):a.setAttribute(u,l.toString()))}catch{}}}for(let u in c){let l=c[u];if(i==="canvas"&&u==="rr_dataURL"){let h=n.createElement("img");h.onload=()=>{let p=a.getContext("2d");p&&p.drawImage(h,0,0,h.width,h.height)},h.src=l.toString(),a.RRNodeType&&(a.rr_dataURL=l.toString())}else if(i==="img"&&u==="rr_dataURL"){let h=a;h.currentSrc.startsWith("data:")||(h.setAttribute("rrweb-original-src",e.attributes.src),h.src=l.toString())}if(u==="rr_width")a.style.setProperty("width",l.toString());else if(u==="rr_height")a.style.setProperty("height",l.toString());else if(u==="rr_mediaCurrentTime"&&typeof l=="number")a.currentTime=l;else if(u==="rr_mediaState")switch(l){case"played":a.play().catch(h=>console.warn("media playback error",h));break;case"paused":a.pause();break}else u==="rr_mediaPlaybackRate"&&typeof l=="number"?a.playbackRate=l:u==="rr_mediaMuted"&&typeof l=="boolean"?a.muted=l:u==="rr_mediaLoop"&&typeof l=="boolean"?a.loop=l:u==="rr_mediaVolume"&&typeof l=="number"?a.volume=l:u==="rr_open_mode"&&a.setAttribute("rr_open_mode",l)}if(e.isShadowHost)if(!a.shadowRoot)a.attachShadow({mode:"open"});else for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);return(i==="input"||i==="textarea")&&a.setAttribute("autocomplete","off"),a}case H.Text:return e.isStyle&&s?n.createTextNode(Vr(e.textContent,o)):n.createTextNode(e.textContent);case H.CDATA:return n.createCDATASection(e.textContent);case H.Comment:return n.createComment(e.textContent);default:return null}}function Yt(e,t){let{doc:r,mirror:n,skipChild:s=!1,hackCss:o=!0,afterAppend:i,cache:a}=t;if(n.has(e.id)){let u=n.getNode(e.id),l=n.getMeta(u);if(tu(l,e))return n.getNode(e.id)}let c=Ju(e,{doc:r,hackCss:o,cache:a});if(!c)return null;if(e.rootId&&n.getNode(e.rootId)!==r&&n.replace(e.rootId,r),e.type===H.Document&&(r.close(),r.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==H.DocumentType&&(e.childNodes[0].type===H.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?r.write(\'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">\'):r.write(\'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">\')),c=r),n.add(c,e),(e.type===H.Document||e.type===H.Element)&&!s)for(let u of e.childNodes){let l=Yt(u,{doc:r,mirror:n,skipChild:!1,hackCss:o,afterAppend:i,cache:a});if(!l){console.warn("Failed to rebuild",u);continue}if(u.isShadow&&Xs(c)&&c.shadowRoot)c.shadowRoot.appendChild(l);else if(e.type===H.Document&&u.type==H.Element){let h=l,p=null;h.childNodes.forEach(d=>{d.nodeName==="BODY"&&(p=d)}),p?(h.removeChild(p),c.appendChild(l),h.appendChild(p)):c.appendChild(l)}else c.appendChild(l);i&&i(l,u.id)}return c}function Ku(e,t){function r(n){t(n)}for(let n of e.getIds())e.has(n)&&r(e.getNode(n))}function Xu(e,t){let r=t.getMeta(e);if(r?.type!==H.Element)return;let n=e;for(let s in r.attributes){if(!(Object.prototype.hasOwnProperty.call(r.attributes,s)&&s.startsWith("rr_")))continue;let o=r.attributes[s];s==="rr_scrollLeft"&&(n.scrollLeft=o),s==="rr_scrollTop"&&(n.scrollTop=o)}}function Qu(e,t){Hu(t);let{doc:r,onVisit:n,hackCss:s=!0,afterAppend:o,cache:i,mirror:a=new Xt}=t,c=Yt(e,{doc:r,mirror:a,skipChild:!1,hackCss:s,afterAppend:o,cache:i});return Ku(a,u=>{n&&n(u),Xu(u,a)}),c}function Zu(e){var t;if(!e.root.isConnected)throw new Error(Uo);let r=e.root.ownerDocument.createElement("iframe");for(let[s,o]of Object.entries(e.iframeAttributes||{}))s!=="sandbox"&&r.setAttribute(s,o);r.setAttribute("sandbox","allow-same-origin"),e.root.appendChild(r);let n=r.contentDocument;if(!n||!r.contentWindow)throw(t=r.parentNode)==null||t.removeChild(r),new Error(Uo);return il.add(n),r}var ep=Object.defineProperty,tp=(e,t,r)=>t in e?ep(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,T=(e,t,r)=>tp(e,typeof t!="symbol"?t+"":t,r),rp=Object.defineProperty,np=(e,t,r)=>t in e?rp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,qo=(e,t,r)=>np(e,typeof t!="symbol"?t+"":t,r),Bo={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},jo={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},jt={},Rs={},zo=0,sp=()=>!!globalThis.Zone;function ai(e){if(jt[e])return jt[e];let t=globalThis[e],r=t.prototype,n=e in Bo?Bo[e]:void 0,s=!!(n&&n.every(a=>{var c,u;return!!((u=(c=Object.getOwnPropertyDescriptor(r,a))==null?void 0:c.get)!=null&&u.toString().includes("[native code]"))})),o=e in jo?jo[e]:void 0,i=!!(o&&o.every(a=>{var c;return typeof r[a]=="function"&&((c=r[a])==null?void 0:c.toString().includes("[native code]"))}));if(s&&i&&!sp())return jt[e]=t.prototype,t.prototype;try{let a=document.createElement("iframe");a.style.display="none",document.body.appendChild(a);let c=a.contentWindow;if(!c)return t.prototype;let u=c[e].prototype;if(!u)return a.remove(),r;let l=navigator.userAgent;return l.includes("Safari")&&!l.includes("Chrome")?(a.classList.add("rr-block"),a.setAttribute("__rrwebUntaintedMutationObserver",""),Rs[e]=()=>a.remove()):a.remove(),jt[e]=u}catch{return r}}var jn={};function Oe(e,t,r){var n,s;let o=(n=jn[e])==null?void 0:n[r];if(o)return o.call(t);let i=ai(e),a=(s=Object.getOwnPropertyDescriptor(i,r))==null?void 0:s.get;return a?((jn[e]||(jn[e]={}))[r]=a,a.call(t)):t[r]}var zn={};function ol(e,t,r){let n=`${e}.${String(r)}`;if(zn[n])return zn[n].bind(t);let o=ai(e)[r];return typeof o!="function"?t[r]:(zn[n]=o,o.bind(t))}function ip(e){return Oe("Node",e,"ownerDocument")}function op(e){return Oe("Node",e,"childNodes")}function ap(e){return Oe("Node",e,"parentNode")}function lp(e){return Oe("Node",e,"parentElement")}function cp(e){return Oe("Node",e,"textContent")}function up(e){return Oe("Node",e,"firstChild")}function pp(e){return Oe("Node",e,"lastChild")}function dp(e){return Oe("Node",e,"nextSibling")}function hp(e){return Oe("Node",e,"previousSibling")}function fp(e,t){return ol("Node",e,"contains")(t)}function mp(e){return ol("Node",e,"getRootNode")()}function gp(e){return!e||!("host"in e)?null:Oe("ShadowRoot",e,"host")}function yp(e){return e.styleSheets}function vp(e){return!e||!("shadowRoot"in e)?null:Oe("Element",e,"shadowRoot")}function bp(e,t){return Oe("Element",e,"querySelector")(t)}function wp(e,t){return Oe("Element",e,"querySelectorAll")(t)}function xp(){let e=ai("MutationObserver");zo++;let t=!1;return[e.constructor,()=>{if(t||(t=!0,--zo!==0))return;let r=Rs.MutationObserver;if(r)try{r()}finally{delete jt.MutationObserver,delete Rs.MutationObserver}}]}var al=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(al=()=>new Date().getTime());function Sp(e,t,r){try{if(!(t in e))return()=>{};let n=e[t],s=r(n);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=s,()=>{e[t]=n}}catch{return()=>{}}}var Cp={ownerDocument:ip,childNodes:op,parentNode:ap,parentElement:lp,textContent:cp,firstChild:up,lastChild:pp,nextSibling:dp,previousSibling:hp,contains:fp,getRootNode:mp,host:gp,styleSheets:yp,shadowRoot:vp,querySelector:bp,querySelectorAll:wp,nowTimestamp:al,mutationObserverCtor:xp,patch:Sp},Ep=class{constructor(){qo(this,"idNodeMap",new Map),qo(this,"nodeMetaMap",new WeakMap)}getId(t){var r;return t?((r=this.getMeta(t))==null?void 0:r.id)??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){let r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(s=>this.removeNodeFromMap(s));let n=Cp.shadowRoot(t);n&&this.removeNodeFromMap(n)}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){let n=this.getNode(t);if(n){let s=this.nodeMetaMap.get(n);s&&this.nodeMetaMap.set(r,s)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Rp(){return new Ep}function kp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Mp(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:function(){return e[n]}})}),r}var yr={exports:{}},Wo;function Np(){if(Wo)return yr.exports;Wo=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return yr.exports=t(),yr.exports.createColors=t,yr.exports}var Op={},Ip=Object.freeze(Object.defineProperty({__proto__:null,default:Op},Symbol.toStringTag,{value:"Module"})),Fe=Mp(Ip),Wn,Vo;function li(){if(Vo)return Wn;Vo=1;let e=Np(),t=Fe;class r extends Error{constructor(s,o,i,a,c,u){super(s),this.name="CssSyntaxError",this.reason=s,c&&(this.file=c),a&&(this.source=a),u&&(this.plugin=u),typeof o<"u"&&typeof i<"u"&&(typeof o=="number"?(this.line=o,this.column=i):(this.line=o.line,this.column=o.column,this.endLine=i.line,this.endColumn=i.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(s){if(!this.source)return"";let o=this.source;s==null&&(s=e.isColorSupported),t&&s&&(o=t(o));let i=o.split(/\\r?\\n/),a=Math.max(this.line-3,0),c=Math.min(this.line+2,i.length),u=String(c).length,l,h;if(s){let{bold:p,gray:d,red:m}=e.createColors(!0);l=f=>p(m(f)),h=f=>d(f)}else l=h=p=>p;return i.slice(a,c).map((p,d)=>{let m=a+1+d,f=" "+(" "+m).slice(-u)+" | ";if(m===this.line){let y=h(f.replace(/\\d/g," "))+p.slice(0,this.column-1).replace(/[^\\t]/g," ");return l(">")+h(f)+p+`\n `+y+l("^")}return" "+h(f)+p}).join(`\n`)}toString(){let s=this.showSourceCode();return s&&(s=`\n\n`+s+`\n`),this.name+": "+this.message+s}}return Wn=r,r.default=r,Wn}var vr={},Ho;function ci(){return Ho||(Ho=1,vr.isClean=Symbol("isClean"),vr.my=Symbol("my")),vr}var Vn,Go;function ll(){if(Go)return Vn;Go=1;let e={after:`\n`,beforeClose:`\n`,beforeComment:`\n`,beforeDecl:`\n`,beforeOpen:" ",beforeRule:`\n`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function t(n){return n[0].toUpperCase()+n.slice(1)}class r{constructor(s){this.builder=s}atrule(s,o){let i="@"+s.name,a=s.params?this.rawValue(s,"params"):"";if(typeof s.raws.afterName<"u"?i+=s.raws.afterName:a&&(i+=" "),s.nodes)this.block(s,i+a);else{let c=(s.raws.between||"")+(o?";":"");this.builder(i+a+c,s)}}beforeAfter(s,o){let i;s.type==="decl"?i=this.raw(s,null,"beforeDecl"):s.type==="comment"?i=this.raw(s,null,"beforeComment"):o==="before"?i=this.raw(s,null,"beforeRule"):i=this.raw(s,null,"beforeClose");let a=s.parent,c=0;for(;a&&a.type!=="root";)c+=1,a=a.parent;if(i.includes(`\n`)){let u=this.raw(s,null,"indent");if(u.length)for(let l=0;l<c;l++)i+=u}return i}block(s,o){let i=this.raw(s,"between","beforeOpen");this.builder(o+i+"{",s,"start");let a;s.nodes&&s.nodes.length?(this.body(s),a=this.raw(s,"after")):a=this.raw(s,"after","emptyBody"),a&&this.builder(a),this.builder("}",s,"end")}body(s){let o=s.nodes.length-1;for(;o>0&&s.nodes[o].type==="comment";)o-=1;let i=this.raw(s,"semicolon");for(let a=0;a<s.nodes.length;a++){let c=s.nodes[a],u=this.raw(c,"before");u&&this.builder(u),this.stringify(c,o!==a||i)}}comment(s){let o=this.raw(s,"left","commentLeft"),i=this.raw(s,"right","commentRight");this.builder("/*"+o+s.text+i+"*/",s)}decl(s,o){let i=this.raw(s,"between","colon"),a=s.prop+i+this.rawValue(s,"value");s.important&&(a+=s.raws.important||" !important"),o&&(a+=";"),this.builder(a,s)}document(s){this.body(s)}raw(s,o,i){let a;if(i||(i=o),o&&(a=s.raws[o],typeof a<"u"))return a;let c=s.parent;if(i==="before"&&(!c||c.type==="root"&&c.first===s||c&&c.type==="document"))return"";if(!c)return e[i];let u=s.root();if(u.rawCache||(u.rawCache={}),typeof u.rawCache[i]<"u")return u.rawCache[i];if(i==="before"||i==="after")return this.beforeAfter(s,i);{let l="raw"+t(i);this[l]?a=this[l](u,s):u.walk(h=>{if(a=h.raws[o],typeof a<"u")return!1})}return typeof a>"u"&&(a=e[i]),u.rawCache[i]=a,a}rawBeforeClose(s){let o;return s.walk(i=>{if(i.nodes&&i.nodes.length>0&&typeof i.raws.after<"u")return o=i.raws.after,o.includes(`\n`)&&(o=o.replace(/[^\\n]+$/,"")),!1}),o&&(o=o.replace(/\\S/g,"")),o}rawBeforeComment(s,o){let i;return s.walkComments(a=>{if(typeof a.raws.before<"u")return i=a.raws.before,i.includes(`\n`)&&(i=i.replace(/[^\\n]+$/,"")),!1}),typeof i>"u"?i=this.raw(o,null,"beforeDecl"):i&&(i=i.replace(/\\S/g,"")),i}rawBeforeDecl(s,o){let i;return s.walkDecls(a=>{if(typeof a.raws.before<"u")return i=a.raws.before,i.includes(`\n`)&&(i=i.replace(/[^\\n]+$/,"")),!1}),typeof i>"u"?i=this.raw(o,null,"beforeRule"):i&&(i=i.replace(/\\S/g,"")),i}rawBeforeOpen(s){let o;return s.walk(i=>{if(i.type!=="decl"&&(o=i.raws.between,typeof o<"u"))return!1}),o}rawBeforeRule(s){let o;return s.walk(i=>{if(i.nodes&&(i.parent!==s||s.first!==i)&&typeof i.raws.before<"u")return o=i.raws.before,o.includes(`\n`)&&(o=o.replace(/[^\\n]+$/,"")),!1}),o&&(o=o.replace(/\\S/g,"")),o}rawColon(s){let o;return s.walkDecls(i=>{if(typeof i.raws.between<"u")return o=i.raws.between.replace(/[^\\s:]/g,""),!1}),o}rawEmptyBody(s){let o;return s.walk(i=>{if(i.nodes&&i.nodes.length===0&&(o=i.raws.after,typeof o<"u"))return!1}),o}rawIndent(s){if(s.raws.indent)return s.raws.indent;let o;return s.walk(i=>{let a=i.parent;if(a&&a!==s&&a.parent&&a.parent===s&&typeof i.raws.before<"u"){let c=i.raws.before.split(`\n`);return o=c[c.length-1],o=o.replace(/\\S/g,""),!1}}),o}rawSemicolon(s){let o;return s.walk(i=>{if(i.nodes&&i.nodes.length&&i.last.type==="decl"&&(o=i.raws.semicolon,typeof o<"u"))return!1}),o}rawValue(s,o){let i=s[o],a=s.raws[o];return a&&a.value===i?a.raw:i}root(s){this.body(s),s.raws.after&&this.builder(s.raws.after)}rule(s){this.block(s,this.rawValue(s,"selector")),s.raws.ownSemicolon&&this.builder(s.raws.ownSemicolon,s,"end")}stringify(s,o){if(!this[s.type])throw new Error("Unknown AST node type "+s.type+". Maybe you need to change PostCSS stringifier.");this[s.type](s,o)}}return Vn=r,r.default=r,Vn}var Hn,Yo;function Hr(){if(Yo)return Hn;Yo=1;let e=ll();function t(r,n){new e(n).stringify(r)}return Hn=t,t.default=t,Hn}var Gn,Jo;function Gr(){if(Jo)return Gn;Jo=1;let{isClean:e,my:t}=ci(),r=li(),n=ll(),s=Hr();function o(a,c){let u=new a.constructor;for(let l in a){if(!Object.prototype.hasOwnProperty.call(a,l)||l==="proxyCache")continue;let h=a[l],p=typeof h;l==="parent"&&p==="object"?c&&(u[l]=c):l==="source"?u[l]=h:Array.isArray(h)?u[l]=h.map(d=>o(d,u)):(p==="object"&&h!==null&&(h=o(h)),u[l]=h)}return u}class i{constructor(c={}){this.raws={},this[e]=!1,this[t]=!0;for(let u in c)if(u==="nodes"){this.nodes=[];for(let l of c[u])typeof l.clone=="function"?this.append(l.clone()):this.append(l)}else this[u]=c[u]}addToError(c){if(c.postcssNode=this,c.stack&&this.source&&/\\n\\s{4}at /.test(c.stack)){let u=this.source;c.stack=c.stack.replace(/\\n\\s{4}at /,`$&${u.input.from}:${u.start.line}:${u.start.column}$&`)}return c}after(c){return this.parent.insertAfter(this,c),this}assign(c={}){for(let u in c)this[u]=c[u];return this}before(c){return this.parent.insertBefore(this,c),this}cleanRaws(c){delete this.raws.before,delete this.raws.after,c||delete this.raws.between}clone(c={}){let u=o(this);for(let l in c)u[l]=c[l];return u}cloneAfter(c={}){let u=this.clone(c);return this.parent.insertAfter(this,u),u}cloneBefore(c={}){let u=this.clone(c);return this.parent.insertBefore(this,u),u}error(c,u={}){if(this.source){let{end:l,start:h}=this.rangeBy(u);return this.source.input.error(c,{column:h.column,line:h.line},{column:l.column,line:l.line},u)}return new r(c)}getProxyProcessor(){return{get(c,u){return u==="proxyOf"?c:u==="root"?()=>c.root().toProxy():c[u]},set(c,u,l){return c[u]===l||(c[u]=l,(u==="prop"||u==="value"||u==="name"||u==="params"||u==="important"||u==="text")&&c.markDirty()),!0}}}markDirty(){if(this[e]){this[e]=!1;let c=this;for(;c=c.parent;)c[e]=!1}}next(){if(!this.parent)return;let c=this.parent.index(this);return this.parent.nodes[c+1]}positionBy(c,u){let l=this.source.start;if(c.index)l=this.positionInside(c.index,u);else if(c.word){u=this.toString();let h=u.indexOf(c.word);h!==-1&&(l=this.positionInside(h,u))}return l}positionInside(c,u){let l=u||this.toString(),h=this.source.start.column,p=this.source.start.line;for(let d=0;d<c;d++)l[d]===`\n`?(h=1,p+=1):h+=1;return{column:h,line:p}}prev(){if(!this.parent)return;let c=this.parent.index(this);return this.parent.nodes[c-1]}rangeBy(c){let u={column:this.source.start.column,line:this.source.start.line},l=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:u.column+1,line:u.line};if(c.word){let h=this.toString(),p=h.indexOf(c.word);p!==-1&&(u=this.positionInside(p,h),l=this.positionInside(p+c.word.length,h))}else c.start?u={column:c.start.column,line:c.start.line}:c.index&&(u=this.positionInside(c.index)),c.end?l={column:c.end.column,line:c.end.line}:typeof c.endIndex=="number"?l=this.positionInside(c.endIndex):c.index&&(l=this.positionInside(c.index+1));return(l.line<u.line||l.line===u.line&&l.column<=u.column)&&(l={column:u.column+1,line:u.line}),{end:l,start:u}}raw(c,u){return new n().raw(this,c,u)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...c){if(this.parent){let u=this,l=!1;for(let h of c)h===this?l=!0:l?(this.parent.insertAfter(u,h),u=h):this.parent.insertBefore(u,h);l||this.remove()}return this}root(){let c=this;for(;c.parent&&c.parent.type!=="document";)c=c.parent;return c}toJSON(c,u){let l={},h=u==null;u=u||new Map;let p=0;for(let d in this){if(!Object.prototype.hasOwnProperty.call(this,d)||d==="parent"||d==="proxyCache")continue;let m=this[d];if(Array.isArray(m))l[d]=m.map(f=>typeof f=="object"&&f.toJSON?f.toJSON(null,u):f);else if(typeof m=="object"&&m.toJSON)l[d]=m.toJSON(null,u);else if(d==="source"){let f=u.get(m.input);f==null&&(f=p,u.set(m.input,p),p++),l[d]={end:m.end,inputId:f,start:m.start}}else l[d]=m}return h&&(l.inputs=[...u.keys()].map(d=>d.toJSON())),l}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(c=s){c.stringify&&(c=c.stringify);let u="";return c(this,l=>{u+=l}),u}warn(c,u,l){let h={node:this};for(let p in l)h[p]=l[p];return c.warn(u,h)}get proxyOf(){return this}}return Gn=i,i.default=i,Gn}var Yn,Ko;function Yr(){if(Ko)return Yn;Ko=1;let e=Gr();class t extends e{constructor(n){n&&typeof n.value<"u"&&typeof n.value!="string"&&(n={...n,value:String(n.value)}),super(n),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}}return Yn=t,t.default=t,Yn}var Jn,Xo;function Dp(){if(Xo)return Jn;Xo=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return Jn={nanoid:(n=21)=>{let s="",o=n;for(;o--;)s+=e[Math.random()*64|0];return s},customAlphabet:(n,s=21)=>(o=s)=>{let i="",a=o;for(;a--;)i+=n[Math.random()*n.length|0];return i}},Jn}var Kn,Qo;function cl(){if(Qo)return Kn;Qo=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Fe,{existsSync:r,readFileSync:n}=Fe,{dirname:s,join:o}=Fe;function i(c){return Buffer?Buffer.from(c,"base64").toString():window.atob(c)}class a{constructor(u,l){if(l.map===!1)return;this.loadAnnotation(u),this.inline=this.startWith(this.annotation,"data:");let h=l.map?l.map.prev:void 0,p=this.loadMap(l.from,h);!this.mapFile&&l.from&&(this.mapFile=l.from),this.mapFile&&(this.root=s(this.mapFile)),p&&(this.text=p)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(u){let l=/^data:application\\/json;charset=utf-?8;base64,/,h=/^data:application\\/json;base64,/,p=/^data:application\\/json;charset=utf-?8,/,d=/^data:application\\/json,/;if(p.test(u)||d.test(u))return decodeURIComponent(u.substr(RegExp.lastMatch.length));if(l.test(u)||h.test(u))return i(u.substr(RegExp.lastMatch.length));let m=u.match(/data:application\\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+m)}getAnnotationURL(u){return u.replace(/^\\/\\*\\s*# sourceMappingURL=/,"").trim()}isMap(u){return typeof u!="object"?!1:typeof u.mappings=="string"||typeof u._mappings=="string"||Array.isArray(u.sections)}loadAnnotation(u){let l=u.match(/\\/\\*\\s*# sourceMappingURL=/gm);if(!l)return;let h=u.lastIndexOf(l.pop()),p=u.indexOf("*/",h);h>-1&&p>-1&&(this.annotation=this.getAnnotationURL(u.substring(h,p)))}loadFile(u){if(this.root=s(u),r(u))return this.mapFile=u,n(u,"utf-8").toString().trim()}loadMap(u,l){if(l===!1)return!1;if(l){if(typeof l=="string")return l;if(typeof l=="function"){let h=l(u);if(h){let p=this.loadFile(h);if(!p)throw new Error("Unable to load previous source map: "+h.toString());return p}}else{if(l instanceof e)return t.fromSourceMap(l).toString();if(l instanceof t)return l.toString();if(this.isMap(l))return JSON.stringify(l);throw new Error("Unsupported previous source map format: "+l.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let h=this.annotation;return u&&(h=o(s(u),h)),this.loadFile(h)}}}startWith(u,l){return u?u.substr(0,l.length)===l:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Kn=a,a.default=a,Kn}var Xn,Zo;function Jr(){if(Zo)return Xn;Zo=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Fe,{fileURLToPath:r,pathToFileURL:n}=Fe,{isAbsolute:s,resolve:o}=Fe,{nanoid:i}=Dp(),a=Fe,c=li(),u=cl(),l=Symbol("fromOffsetCache"),h=!!(e&&t),p=!!(o&&s);class d{constructor(f,y={}){if(f===null||typeof f>"u"||typeof f=="object"&&!f.toString)throw new Error(`PostCSS received ${f} instead of CSS string`);if(this.css=f.toString(),this.css[0]==="\\uFEFF"||this.css[0]==="\\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,y.from&&(!p||/^\\w+:\\/\\//.test(y.from)||s(y.from)?this.file=y.from:this.file=o(y.from)),p&&h){let b=new u(this.css,y);if(b.text){this.map=b;let w=b.consumer().file;!this.file&&w&&(this.file=this.mapResolve(w))}}this.file||(this.id="<input css "+i(6)+">"),this.map&&(this.map.file=this.from)}error(f,y,b,w={}){let x,E,S;if(y&&typeof y=="object"){let R=y,k=b;if(typeof R.offset=="number"){let O=this.fromOffset(R.offset);y=O.line,b=O.col}else y=R.line,b=R.column;if(typeof k.offset=="number"){let O=this.fromOffset(k.offset);E=O.line,S=O.col}else E=k.line,S=k.column}else if(!b){let R=this.fromOffset(y);y=R.line,b=R.col}let v=this.origin(y,b,E,S);return v?x=new c(f,v.endLine===void 0?v.line:{column:v.column,line:v.line},v.endLine===void 0?v.column:{column:v.endColumn,line:v.endLine},v.source,v.file,w.plugin):x=new c(f,E===void 0?y:{column:b,line:y},E===void 0?b:{column:S,line:E},this.css,this.file,w.plugin),x.input={column:b,endColumn:S,endLine:E,line:y,source:this.css},this.file&&(n&&(x.input.url=n(this.file).toString()),x.input.file=this.file),x}fromOffset(f){let y,b;if(this[l])b=this[l];else{let x=this.css.split(`\n`);b=new Array(x.length);let E=0;for(let S=0,v=x.length;S<v;S++)b[S]=E,E+=x[S].length+1;this[l]=b}y=b[b.length-1];let w=0;if(f>=y)w=b.length-1;else{let x=b.length-2,E;for(;w<x;)if(E=w+(x-w>>1),f<b[E])x=E-1;else if(f>=b[E+1])w=E+1;else{w=E;break}}return{col:f-b[w]+1,line:w+1}}mapResolve(f){return/^\\w+:\\/\\//.test(f)?f:o(this.map.consumer().sourceRoot||this.map.root||".",f)}origin(f,y,b,w){if(!this.map)return!1;let x=this.map.consumer(),E=x.originalPositionFor({column:y,line:f});if(!E.source)return!1;let S;typeof b=="number"&&(S=x.originalPositionFor({column:w,line:b}));let v;s(E.source)?v=n(E.source):v=new URL(E.source,this.map.consumer().sourceRoot||n(this.map.mapFile));let R={column:E.column,endColumn:S&&S.column,endLine:S&&S.line,line:E.line,url:v.toString()};if(v.protocol==="file:")if(r)R.file=r(v);else throw new Error("file: protocol is not available in this PostCSS build");let k=x.sourceContentFor(E.source);return k&&(R.source=k),R}toJSON(){let f={};for(let y of["hasBOM","css","file","id"])this[y]!=null&&(f[y]=this[y]);return this.map&&(f.map={...this.map},f.map.consumerCache&&(f.map.consumerCache=void 0)),f}get from(){return this.file||this.id}}return Xn=d,d.default=d,a&&a.registerInput&&a.registerInput(d),Xn}var Qn,ea;function ul(){if(ea)return Qn;ea=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Fe,{dirname:r,relative:n,resolve:s,sep:o}=Fe,{pathToFileURL:i}=Fe,a=Jr(),c=!!(e&&t),u=!!(r&&s&&n&&o);class l{constructor(p,d,m,f){this.stringify=p,this.mapOpts=m.map||{},this.root=d,this.opts=m,this.css=f,this.originalCSS=f,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let p;this.isInline()?p="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?p=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?p=this.mapOpts.annotation(this.opts.to,this.root):p=this.outputFile()+".map";let d=`\n`;this.css.includes(`\\r\n`)&&(d=`\\r\n`),this.css+=d+"/*# sourceMappingURL="+p+" */"}applyPrevMaps(){for(let p of this.previous()){let d=this.toUrl(this.path(p.file)),m=p.root||r(p.file),f;this.mapOpts.sourcesContent===!1?(f=new e(p.text),f.sourcesContent&&(f.sourcesContent=null)):f=p.consumer(),this.map.applySourceMap(f,d,this.toUrl(this.path(m)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let p;for(let d=this.root.nodes.length-1;d>=0;d--)p=this.root.nodes[d],p.type==="comment"&&p.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(d)}else this.css&&(this.css=this.css.replace(/\\n*?\\/\\*#[\\S\\s]*?\\*\\/$/gm,""))}generate(){if(this.clearAnnotation(),u&&c&&this.isMap())return this.generateMap();{let p="";return this.stringify(this.root,d=>{p+=d}),[p]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let p=this.previous()[0].consumer();p.file=this.outputFile(),this.map=t.fromSourceMap(p,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<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 t({file:this.outputFile(),ignoreInvalidMapping:!0});let p=1,d=1,m="<no source>",f={generated:{column:0,line:0},original:{column:0,line:0},source:""},y,b;this.stringify(this.root,(w,x,E)=>{if(this.css+=w,x&&E!=="end"&&(f.generated.line=p,f.generated.column=d-1,x.source&&x.source.start?(f.source=this.sourcePath(x),f.original.line=x.source.start.line,f.original.column=x.source.start.column-1,this.map.addMapping(f)):(f.source=m,f.original.line=1,f.original.column=0,this.map.addMapping(f))),y=w.match(/\\n/g),y?(p+=y.length,b=w.lastIndexOf(`\n`),d=w.length-b):d+=w.length,x&&E!=="start"){let S=x.parent||{raws:{}};(!(x.type==="decl"||x.type==="atrule"&&!x.nodes)||x!==S.last||S.raws.semicolon)&&(x.source&&x.source.end?(f.source=this.sourcePath(x),f.original.line=x.source.end.line,f.original.column=x.source.end.column-1,f.generated.line=p,f.generated.column=d-2,this.map.addMapping(f)):(f.source=m,f.original.line=1,f.original.column=0,f.generated.line=p,f.generated.column=d-1,this.map.addMapping(f)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(p=>p.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let p=this.mapOpts.annotation;return typeof p<"u"&&p!==!0?!1:this.previous().length?this.previous().some(d=>d.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(p=>p.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(p){if(this.mapOpts.absolute||p.charCodeAt(0)===60||/^\\w+:\\/\\//.test(p))return p;let d=this.memoizedPaths.get(p);if(d)return d;let m=this.opts.to?r(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(m=r(s(m,this.mapOpts.annotation)));let f=n(m,p);return this.memoizedPaths.set(p,f),f}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(p=>{if(p.source&&p.source.input.map){let d=p.source.input.map;this.previousMaps.includes(d)||this.previousMaps.push(d)}});else{let p=new a(this.originalCSS,this.opts);p.map&&this.previousMaps.push(p.map)}return this.previousMaps}setSourcesContent(){let p={};if(this.root)this.root.walk(d=>{if(d.source){let m=d.source.input.from;if(m&&!p[m]){p[m]=!0;let f=this.usesFileUrls?this.toFileUrl(m):this.toUrl(this.path(m));this.map.setSourceContent(f,d.source.input.css)}}});else if(this.css){let d=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(d,this.css)}}sourcePath(p){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(p.source.input.from):this.toUrl(this.path(p.source.input.from))}toBase64(p){return Buffer?Buffer.from(p).toString("base64"):window.btoa(unescape(encodeURIComponent(p)))}toFileUrl(p){let d=this.memoizedFileURLs.get(p);if(d)return d;if(i){let m=i(p).toString();return this.memoizedFileURLs.set(p,m),m}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(p){let d=this.memoizedURLs.get(p);if(d)return d;o==="\\\\"&&(p=p.replace(/\\\\/g,"/"));let m=encodeURI(p).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(p,m),m}}return Qn=l,Qn}var Zn,ta;function Kr(){if(ta)return Zn;ta=1;let e=Gr();class t extends e{constructor(n){super(n),this.type="comment"}}return Zn=t,t.default=t,Zn}var es,ra;function ct(){if(ra)return es;ra=1;let{isClean:e,my:t}=ci(),r=Yr(),n=Kr(),s=Gr(),o,i,a,c;function u(p){return p.map(d=>(d.nodes&&(d.nodes=u(d.nodes)),delete d.source,d))}function l(p){if(p[e]=!1,p.proxyOf.nodes)for(let d of p.proxyOf.nodes)l(d)}class h extends s{append(...d){for(let m of d){let f=this.normalize(m,this.last);for(let y of f)this.proxyOf.nodes.push(y)}return this.markDirty(),this}cleanRaws(d){if(super.cleanRaws(d),this.nodes)for(let m of this.nodes)m.cleanRaws(d)}each(d){if(!this.proxyOf.nodes)return;let m=this.getIterator(),f,y;for(;this.indexes[m]<this.proxyOf.nodes.length&&(f=this.indexes[m],y=d(this.proxyOf.nodes[f],f),y!==!1);)this.indexes[m]+=1;return delete this.indexes[m],y}every(d){return this.nodes.every(d)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let d=this.lastEach;return this.indexes[d]=0,d}getProxyProcessor(){return{get(d,m){return m==="proxyOf"?d:d[m]?m==="each"||typeof m=="string"&&m.startsWith("walk")?(...f)=>d[m](...f.map(y=>typeof y=="function"?(b,w)=>y(b.toProxy(),w):y)):m==="every"||m==="some"?f=>d[m]((y,...b)=>f(y.toProxy(),...b)):m==="root"?()=>d.root().toProxy():m==="nodes"?d.nodes.map(f=>f.toProxy()):m==="first"||m==="last"?d[m].toProxy():d[m]:d[m]},set(d,m,f){return d[m]===f||(d[m]=f,(m==="name"||m==="params"||m==="selector")&&d.markDirty()),!0}}}index(d){return typeof d=="number"?d:(d.proxyOf&&(d=d.proxyOf),this.proxyOf.nodes.indexOf(d))}insertAfter(d,m){let f=this.index(d),y=this.normalize(m,this.proxyOf.nodes[f]).reverse();f=this.index(d);for(let w of y)this.proxyOf.nodes.splice(f+1,0,w);let b;for(let w in this.indexes)b=this.indexes[w],f<b&&(this.indexes[w]=b+y.length);return this.markDirty(),this}insertBefore(d,m){let f=this.index(d),y=f===0?"prepend":!1,b=this.normalize(m,this.proxyOf.nodes[f],y).reverse();f=this.index(d);for(let x of b)this.proxyOf.nodes.splice(f,0,x);let w;for(let x in this.indexes)w=this.indexes[x],f<=w&&(this.indexes[x]=w+b.length);return this.markDirty(),this}normalize(d,m){if(typeof d=="string")d=u(o(d).nodes);else if(typeof d>"u")d=[];else if(Array.isArray(d)){d=d.slice(0);for(let y of d)y.parent&&y.parent.removeChild(y,"ignore")}else if(d.type==="root"&&this.type!=="document"){d=d.nodes.slice(0);for(let y of d)y.parent&&y.parent.removeChild(y,"ignore")}else if(d.type)d=[d];else if(d.prop){if(typeof d.value>"u")throw new Error("Value field is missed in node creation");typeof d.value!="string"&&(d.value=String(d.value)),d=[new r(d)]}else if(d.selector)d=[new i(d)];else if(d.name)d=[new a(d)];else if(d.text)d=[new n(d)];else throw new Error("Unknown node type in node creation");return d.map(y=>(y[t]||h.rebuild(y),y=y.proxyOf,y.parent&&y.parent.removeChild(y),y[e]&&l(y),typeof y.raws.before>"u"&&m&&typeof m.raws.before<"u"&&(y.raws.before=m.raws.before.replace(/\\S/g,"")),y.parent=this.proxyOf,y))}prepend(...d){d=d.reverse();for(let m of d){let f=this.normalize(m,this.first,"prepend").reverse();for(let y of f)this.proxyOf.nodes.unshift(y);for(let y in this.indexes)this.indexes[y]=this.indexes[y]+f.length}return this.markDirty(),this}push(d){return d.parent=this,this.proxyOf.nodes.push(d),this}removeAll(){for(let d of this.proxyOf.nodes)d.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(d){d=this.index(d),this.proxyOf.nodes[d].parent=void 0,this.proxyOf.nodes.splice(d,1);let m;for(let f in this.indexes)m=this.indexes[f],m>=d&&(this.indexes[f]=m-1);return this.markDirty(),this}replaceValues(d,m,f){return f||(f=m,m={}),this.walkDecls(y=>{m.props&&!m.props.includes(y.prop)||m.fast&&!y.value.includes(m.fast)||(y.value=y.value.replace(d,f))}),this.markDirty(),this}some(d){return this.nodes.some(d)}walk(d){return this.each((m,f)=>{let y;try{y=d(m,f)}catch(b){throw m.addToError(b)}return y!==!1&&m.walk&&(y=m.walk(d)),y})}walkAtRules(d,m){return m?d instanceof RegExp?this.walk((f,y)=>{if(f.type==="atrule"&&d.test(f.name))return m(f,y)}):this.walk((f,y)=>{if(f.type==="atrule"&&f.name===d)return m(f,y)}):(m=d,this.walk((f,y)=>{if(f.type==="atrule")return m(f,y)}))}walkComments(d){return this.walk((m,f)=>{if(m.type==="comment")return d(m,f)})}walkDecls(d,m){return m?d instanceof RegExp?this.walk((f,y)=>{if(f.type==="decl"&&d.test(f.prop))return m(f,y)}):this.walk((f,y)=>{if(f.type==="decl"&&f.prop===d)return m(f,y)}):(m=d,this.walk((f,y)=>{if(f.type==="decl")return m(f,y)}))}walkRules(d,m){return m?d instanceof RegExp?this.walk((f,y)=>{if(f.type==="rule"&&d.test(f.selector))return m(f,y)}):this.walk((f,y)=>{if(f.type==="rule"&&f.selector===d)return m(f,y)}):(m=d,this.walk((f,y)=>{if(f.type==="rule")return m(f,y)}))}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]}}return h.registerParse=p=>{o=p},h.registerRule=p=>{i=p},h.registerAtRule=p=>{a=p},h.registerRoot=p=>{c=p},es=h,h.default=h,h.rebuild=p=>{p.type==="atrule"?Object.setPrototypeOf(p,a.prototype):p.type==="rule"?Object.setPrototypeOf(p,i.prototype):p.type==="decl"?Object.setPrototypeOf(p,r.prototype):p.type==="comment"?Object.setPrototypeOf(p,n.prototype):p.type==="root"&&Object.setPrototypeOf(p,c.prototype),p[t]=!0,p.nodes&&p.nodes.forEach(d=>{h.rebuild(d)})},es}var ts,na;function ui(){if(na)return ts;na=1;let e=ct(),t,r;class n extends e{constructor(o){super({type:"document",...o}),this.nodes||(this.nodes=[])}toResult(o={}){return new t(new r,this,o).stringify()}}return n.registerLazyResult=s=>{t=s},n.registerProcessor=s=>{r=s},ts=n,n.default=n,ts}var rs,sa;function pl(){if(sa)return rs;sa=1;let e={};return rs=function(r){e[r]||(e[r]=!0,typeof console<"u"&&console.warn&&console.warn(r))},rs}var ns,ia;function dl(){if(ia)return ns;ia=1;class e{constructor(r,n={}){if(this.type="warning",this.text=r,n.node&&n.node.source){let s=n.node.rangeBy(n);this.line=s.start.line,this.column=s.start.column,this.endLine=s.end.line,this.endColumn=s.end.column}for(let s in n)this[s]=n[s]}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}}return ns=e,e.default=e,ns}var ss,oa;function pi(){if(oa)return ss;oa=1;let e=dl();class t{constructor(n,s,o){this.processor=n,this.messages=[],this.root=s,this.opts=o,this.css=void 0,this.map=void 0}toString(){return this.css}warn(n,s={}){s.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(s.plugin=this.lastPlugin.postcssPlugin);let o=new e(n,s);return this.messages.push(o),o}warnings(){return this.messages.filter(n=>n.type==="warning")}get content(){return this.css}}return ss=t,t.default=t,ss}var is,aa;function Ap(){if(aa)return is;aa=1;let e=39,t=34,r=92,n=47,s=10,o=32,i=12,a=9,c=13,u=91,l=93,h=40,p=41,d=123,m=125,f=59,y=42,b=58,w=64,x=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/g,E=/[\\t\\n\\f\\r !"#\'():;@[\\\\\\]{}]|\\/(?=\\*)/g,S=/.[\\r\\n"\'(/\\\\]/,v=/[\\da-f]/i;return is=function(k,O={}){let M=k.css.valueOf(),_=O.ignoreErrors,D,C,A,G,F,P,B,me,ie,ee,Ke=M.length,I=0,qe=[],De=[];function kt(){return I}function xe(j){throw k.error("Unclosed "+j,I)}function ke(){return De.length===0&&I>=Ke}function nt(j){if(De.length)return De.pop();if(I>=Ke)return;let ge=j?j.ignoreUnclosed:!1;switch(D=M.charCodeAt(I),D){case s:case o:case a:case c:case i:{C=I;do C+=1,D=M.charCodeAt(C);while(D===o||D===s||D===a||D===c||D===i);ee=["space",M.slice(I,C)],I=C-1;break}case u:case l:case d:case m:case b:case f:case p:{let W=String.fromCharCode(D);ee=[W,W,I];break}case h:{if(me=qe.length?qe.pop()[1]:"",ie=M.charCodeAt(I+1),me==="url"&&ie!==e&&ie!==t&&ie!==o&&ie!==s&&ie!==a&&ie!==i&&ie!==c){C=I;do{if(P=!1,C=M.indexOf(")",C+1),C===-1)if(_||ge){C=I;break}else xe("bracket");for(B=C;M.charCodeAt(B-1)===r;)B-=1,P=!P}while(P);ee=["brackets",M.slice(I,C+1),I,C],I=C}else C=M.indexOf(")",I+1),G=M.slice(I,C+1),C===-1||S.test(G)?ee=["(","(",I]:(ee=["brackets",G,I,C],I=C);break}case e:case t:{A=D===e?"\'":\'"\',C=I;do{if(P=!1,C=M.indexOf(A,C+1),C===-1)if(_||ge){C=I+1;break}else xe("string");for(B=C;M.charCodeAt(B-1)===r;)B-=1,P=!P}while(P);ee=["string",M.slice(I,C+1),I,C],I=C;break}case w:{x.lastIndex=I+1,x.test(M),x.lastIndex===0?C=M.length-1:C=x.lastIndex-2,ee=["at-word",M.slice(I,C+1),I,C],I=C;break}case r:{for(C=I,F=!0;M.charCodeAt(C+1)===r;)C+=1,F=!F;if(D=M.charCodeAt(C+1),F&&D!==n&&D!==o&&D!==s&&D!==a&&D!==c&&D!==i&&(C+=1,v.test(M.charAt(C)))){for(;v.test(M.charAt(C+1));)C+=1;M.charCodeAt(C+1)===o&&(C+=1)}ee=["word",M.slice(I,C+1),I,C],I=C;break}default:{D===n&&M.charCodeAt(I+1)===y?(C=M.indexOf("*/",I+2)+1,C===0&&(_||ge?C=M.length:xe("comment")),ee=["comment",M.slice(I,C+1),I,C],I=C):(E.lastIndex=I+1,E.test(M),E.lastIndex===0?C=M.length-1:C=E.lastIndex-2,ee=["word",M.slice(I,C+1),I,C],qe.push(ee),I=C);break}}return I++,ee}function Be(j){De.push(j)}return{back:Be,endOfFile:ke,nextToken:nt,position:kt}},is}var os,la;function di(){if(la)return os;la=1;let e=ct();class t extends e{constructor(n){super(n),this.type="atrule"}append(...n){return this.proxyOf.nodes||(this.nodes=[]),super.append(...n)}prepend(...n){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...n)}}return os=t,t.default=t,e.registerAtRule(t),os}var as,ca;function rr(){if(ca)return as;ca=1;let e=ct(),t,r;class n extends e{constructor(o){super(o),this.type="root",this.nodes||(this.nodes=[])}normalize(o,i,a){let c=super.normalize(o);if(i){if(a==="prepend")this.nodes.length>1?i.raws.before=this.nodes[1].raws.before:delete i.raws.before;else if(this.first!==i)for(let u of c)u.raws.before=i.raws.before}return c}removeChild(o,i){let a=this.index(o);return!i&&a===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[a].raws.before),super.removeChild(o)}toResult(o={}){return new t(new r,this,o).stringify()}}return n.registerLazyResult=s=>{t=s},n.registerProcessor=s=>{r=s},as=n,n.default=n,e.registerRoot(n),as}var ls,ua;function hl(){if(ua)return ls;ua=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let r=[" ",`\n`," "];return e.split(t,r)},split(t,r,n){let s=[],o="",i=!1,a=0,c=!1,u="",l=!1;for(let h of t)l?l=!1:h==="\\\\"?l=!0:c?h===u&&(c=!1):h===\'"\'||h==="\'"?(c=!0,u=h):h==="("?a+=1:h===")"?a>0&&(a-=1):a===0&&r.includes(h)&&(i=!0),i?(o!==""&&s.push(o.trim()),o="",i=!1):o+=h;return(n||o!=="")&&s.push(o.trim()),s}};return ls=e,e.default=e,ls}var cs,pa;function hi(){if(pa)return cs;pa=1;let e=ct(),t=hl();class r extends e{constructor(s){super(s),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(s){let o=this.selector?this.selector.match(/,\\s*/):null,i=o?o[0]:","+this.raw("between","beforeOpen");this.selector=s.join(i)}}return cs=r,r.default=r,e.registerRule(r),cs}var us,da;function Tp(){if(da)return us;da=1;let e=Yr(),t=Ap(),r=Kr(),n=di(),s=rr(),o=hi(),i={empty:!0,space:!0};function a(u){for(let l=u.length-1;l>=0;l--){let h=u[l],p=h[3]||h[2];if(p)return p}}class c{constructor(l){this.input=l,this.root=new s,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:l,start:{column:1,line:1,offset:0}}}atrule(l){let h=new n;h.name=l[1].slice(1),h.name===""&&this.unnamedAtrule(h,l),this.init(h,l[2]);let p,d,m,f=!1,y=!1,b=[],w=[];for(;!this.tokenizer.endOfFile();){if(l=this.tokenizer.nextToken(),p=l[0],p==="("||p==="["?w.push(p==="("?")":"]"):p==="{"&&w.length>0?w.push("}"):p===w[w.length-1]&&w.pop(),w.length===0)if(p===";"){h.source.end=this.getPosition(l[2]),h.source.end.offset++,this.semicolon=!0;break}else if(p==="{"){y=!0;break}else if(p==="}"){if(b.length>0){for(m=b.length-1,d=b[m];d&&d[0]==="space";)d=b[--m];d&&(h.source.end=this.getPosition(d[3]||d[2]),h.source.end.offset++)}this.end(l);break}else b.push(l);else b.push(l);if(this.tokenizer.endOfFile()){f=!0;break}}h.raws.between=this.spacesAndCommentsFromEnd(b),b.length?(h.raws.afterName=this.spacesAndCommentsFromStart(b),this.raw(h,"params",b),f&&(l=b[b.length-1],h.source.end=this.getPosition(l[3]||l[2]),h.source.end.offset++,this.spaces=h.raws.between,h.raws.between="")):(h.raws.afterName="",h.params=""),y&&(h.nodes=[],this.current=h)}checkMissedSemicolon(l){let h=this.colon(l);if(h===!1)return;let p=0,d;for(let m=h-1;m>=0&&(d=l[m],!(d[0]!=="space"&&(p+=1,p===2)));m--);throw this.input.error("Missed semicolon",d[0]==="word"?d[3]+1:d[2])}colon(l){let h=0,p,d,m;for(let[f,y]of l.entries()){if(p=y,d=p[0],d==="("&&(h+=1),d===")"&&(h-=1),h===0&&d===":")if(!m)this.doubleColon(p);else{if(m[0]==="word"&&m[1]==="progid")continue;return f}m=p}return!1}comment(l){let h=new r;this.init(h,l[2]),h.source.end=this.getPosition(l[3]||l[2]),h.source.end.offset++;let p=l[1].slice(2,-2);if(/^\\s*$/.test(p))h.text="",h.raws.left=p,h.raws.right="";else{let d=p.match(/^(\\s*)([^]*\\S)(\\s*)$/);h.text=d[2],h.raws.left=d[1],h.raws.right=d[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(l,h){let p=new e;this.init(p,l[0][2]);let d=l[l.length-1];for(d[0]===";"&&(this.semicolon=!0,l.pop()),p.source.end=this.getPosition(d[3]||d[2]||a(l)),p.source.end.offset++;l[0][0]!=="word";)l.length===1&&this.unknownWord(l),p.raws.before+=l.shift()[1];for(p.source.start=this.getPosition(l[0][2]),p.prop="";l.length;){let w=l[0][0];if(w===":"||w==="space"||w==="comment")break;p.prop+=l.shift()[1]}p.raws.between="";let m;for(;l.length;)if(m=l.shift(),m[0]===":"){p.raws.between+=m[1];break}else m[0]==="word"&&/\\w/.test(m[1])&&this.unknownWord([m]),p.raws.between+=m[1];(p.prop[0]==="_"||p.prop[0]==="*")&&(p.raws.before+=p.prop[0],p.prop=p.prop.slice(1));let f=[],y;for(;l.length&&(y=l[0][0],!(y!=="space"&&y!=="comment"));)f.push(l.shift());this.precheckMissedSemicolon(l);for(let w=l.length-1;w>=0;w--){if(m=l[w],m[1].toLowerCase()==="!important"){p.important=!0;let x=this.stringFrom(l,w);x=this.spacesFromEnd(l)+x,x!==" !important"&&(p.raws.important=x);break}else if(m[1].toLowerCase()==="important"){let x=l.slice(0),E="";for(let S=w;S>0;S--){let v=x[S][0];if(E.trim().indexOf("!")===0&&v!=="space")break;E=x.pop()[1]+E}E.trim().indexOf("!")===0&&(p.important=!0,p.raws.important=E,l=x)}if(m[0]!=="space"&&m[0]!=="comment")break}l.some(w=>w[0]!=="space"&&w[0]!=="comment")&&(p.raws.between+=f.map(w=>w[1]).join(""),f=[]),this.raw(p,"value",f.concat(l),h),p.value.includes(":")&&!h&&this.checkMissedSemicolon(l)}doubleColon(l){throw this.input.error("Double colon",{offset:l[2]},{offset:l[2]+l[1].length})}emptyRule(l){let h=new o;this.init(h,l[2]),h.selector="",h.raws.between="",this.current=h}end(l){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(l[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(l)}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(l){if(this.spaces+=l[1],this.current.nodes){let h=this.current.nodes[this.current.nodes.length-1];h&&h.type==="rule"&&!h.raws.ownSemicolon&&(h.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(l){let h=this.input.fromOffset(l);return{column:h.col,line:h.line,offset:l}}init(l,h){this.current.push(l),l.source={input:this.input,start:this.getPosition(h)},l.raws.before=this.spaces,this.spaces="",l.type!=="comment"&&(this.semicolon=!1)}other(l){let h=!1,p=null,d=!1,m=null,f=[],y=l[1].startsWith("--"),b=[],w=l;for(;w;){if(p=w[0],b.push(w),p==="("||p==="[")m||(m=w),f.push(p==="("?")":"]");else if(y&&d&&p==="{")m||(m=w),f.push("}");else if(f.length===0)if(p===";")if(d){this.decl(b,y);return}else break;else if(p==="{"){this.rule(b);return}else if(p==="}"){this.tokenizer.back(b.pop()),h=!0;break}else p===":"&&(d=!0);else p===f[f.length-1]&&(f.pop(),f.length===0&&(m=null));w=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(h=!0),f.length>0&&this.unclosedBracket(m),h&&d){if(!y)for(;b.length&&(w=b[b.length-1][0],!(w!=="space"&&w!=="comment"));)this.tokenizer.back(b.pop());this.decl(b,y)}else this.unknownWord(b)}parse(){let l;for(;!this.tokenizer.endOfFile();)switch(l=this.tokenizer.nextToken(),l[0]){case"space":this.spaces+=l[1];break;case";":this.freeSemicolon(l);break;case"}":this.end(l);break;case"comment":this.comment(l);break;case"at-word":this.atrule(l);break;case"{":this.emptyRule(l);break;default:this.other(l);break}this.endFile()}precheckMissedSemicolon(){}raw(l,h,p,d){let m,f,y=p.length,b="",w=!0,x,E;for(let S=0;S<y;S+=1)m=p[S],f=m[0],f==="space"&&S===y-1&&!d?w=!1:f==="comment"?(E=p[S-1]?p[S-1][0]:"empty",x=p[S+1]?p[S+1][0]:"empty",!i[E]&&!i[x]?b.slice(-1)===","?w=!1:b+=m[1]:w=!1):b+=m[1];if(!w){let S=p.reduce((v,R)=>v+R[1],"");l.raws[h]={raw:S,value:b}}l[h]=b}rule(l){l.pop();let h=new o;this.init(h,l[0][2]),h.raws.between=this.spacesAndCommentsFromEnd(l),this.raw(h,"selector",l),this.current=h}spacesAndCommentsFromEnd(l){let h,p="";for(;l.length&&(h=l[l.length-1][0],!(h!=="space"&&h!=="comment"));)p=l.pop()[1]+p;return p}spacesAndCommentsFromStart(l){let h,p="";for(;l.length&&(h=l[0][0],!(h!=="space"&&h!=="comment"));)p+=l.shift()[1];return p}spacesFromEnd(l){let h,p="";for(;l.length&&(h=l[l.length-1][0],h==="space");)p=l.pop()[1]+p;return p}stringFrom(l,h){let p="";for(let d=h;d<l.length;d++)p+=l[d][1];return l.splice(h,l.length-h),p}unclosedBlock(){let l=this.current.source.start;throw this.input.error("Unclosed block",l.line,l.column)}unclosedBracket(l){throw this.input.error("Unclosed bracket",{offset:l[2]},{offset:l[2]+1})}unexpectedClose(l){throw this.input.error("Unexpected }",{offset:l[2]},{offset:l[2]+1})}unknownWord(l){throw this.input.error("Unknown word",{offset:l[0][2]},{offset:l[0][2]+l[0][1].length})}unnamedAtrule(l,h){throw this.input.error("At-rule without name",{offset:h[2]},{offset:h[2]+h[1].length})}}return us=c,us}var ps,ha;function fi(){if(ha)return ps;ha=1;let e=ct(),t=Tp(),r=Jr();function n(s,o){let i=new r(s,o),a=new t(i);try{a.parse()}catch(c){throw c}return a.root}return ps=n,n.default=n,e.registerParse(n),ps}var ds,fa;function fl(){if(fa)return ds;fa=1;let{isClean:e,my:t}=ci(),r=ul(),n=Hr(),s=ct(),o=ui(),i=pl(),a=pi(),c=fi(),u=rr(),l={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={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},p={Once:!0,postcssPlugin:!0,prepare:!0},d=0;function m(E){return typeof E=="object"&&typeof E.then=="function"}function f(E){let S=!1,v=l[E.type];return E.type==="decl"?S=E.prop.toLowerCase():E.type==="atrule"&&(S=E.name.toLowerCase()),S&&E.append?[v,v+"-"+S,d,v+"Exit",v+"Exit-"+S]:S?[v,v+"-"+S,v+"Exit",v+"Exit-"+S]:E.append?[v,d,v+"Exit"]:[v,v+"Exit"]}function y(E){let S;return E.type==="document"?S=["Document",d,"DocumentExit"]:E.type==="root"?S=["Root",d,"RootExit"]:S=f(E),{eventIndex:0,events:S,iterator:0,node:E,visitorIndex:0,visitors:[]}}function b(E){return E[e]=!1,E.nodes&&E.nodes.forEach(S=>b(S)),E}let w={};class x{constructor(S,v,R){this.stringified=!1,this.processed=!1;let k;if(typeof v=="object"&&v!==null&&(v.type==="root"||v.type==="document"))k=b(v);else if(v instanceof x||v instanceof a)k=b(v.root),v.map&&(typeof R.map>"u"&&(R.map={}),R.map.inline||(R.map.inline=!1),R.map.prev=v.map);else{let O=c;R.syntax&&(O=R.syntax.parse),R.parser&&(O=R.parser),O.parse&&(O=O.parse);try{k=O(v,R)}catch(M){this.processed=!0,this.error=M}k&&!k[t]&&s.rebuild(k)}this.result=new a(S,k,R),this.helpers={...w,postcss:w,result:this.result},this.plugins=this.processor.plugins.map(O=>typeof O=="object"&&O.prepare?{...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(S){return this.async().catch(S)}finally(S){return this.async().then(S,S)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(S,v){let R=this.result.lastPlugin;try{v&&v.addToError(S),this.error=S,S.name==="CssSyntaxError"&&!S.plugin?(S.plugin=R.postcssPlugin,S.setMessage()):R.postcssVersion}catch(k){console&&console.error&&console.error(k)}return S}prepareVisitors(){this.listeners={};let S=(v,R,k)=>{this.listeners[R]||(this.listeners[R]=[]),this.listeners[R].push([v,k])};for(let v of this.plugins)if(typeof v=="object")for(let R in v){if(!h[R]&&/^[A-Z]/.test(R))throw new Error(`Unknown event ${R} in ${v.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!p[R])if(typeof v[R]=="object")for(let k in v[R])k==="*"?S(v,R,v[R][k]):S(v,R+"-"+k.toLowerCase(),v[R][k]);else typeof v[R]=="function"&&S(v,R,v[R])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let S=0;S<this.plugins.length;S++){let v=this.plugins[S],R=this.runOnRoot(v);if(m(R))try{await R}catch(k){throw this.handleError(k)}}if(this.prepareVisitors(),this.hasListener){let S=this.result.root;for(;!S[e];){S[e]=!0;let v=[y(S)];for(;v.length>0;){let R=this.visitTick(v);if(m(R))try{await R}catch(k){let O=v[v.length-1].node;throw this.handleError(k,O)}}}if(this.listeners.OnceExit)for(let[v,R]of this.listeners.OnceExit){this.result.lastPlugin=v;try{if(S.type==="document"){let k=S.nodes.map(O=>R(O,this.helpers));await Promise.all(k)}else await R(S,this.helpers)}catch(k){throw this.handleError(k)}}}return this.processed=!0,this.stringify()}runOnRoot(S){this.result.lastPlugin=S;try{if(typeof S=="object"&&S.Once){if(this.result.root.type==="document"){let v=this.result.root.nodes.map(R=>S.Once(R,this.helpers));return m(v[0])?Promise.all(v):v}return S.Once(this.result.root,this.helpers)}else if(typeof S=="function")return S(this.result.root,this.result)}catch(v){throw this.handleError(v)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let S=this.result.opts,v=n;S.syntax&&(v=S.syntax.stringify),S.stringifier&&(v=S.stringifier),v.stringify&&(v=v.stringify);let k=new r(v,this.result.root,this.result.opts).generate();return this.result.css=k[0],this.result.map=k[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 S of this.plugins){let v=this.runOnRoot(S);if(m(v))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let S=this.result.root;for(;!S[e];)S[e]=!0,this.walkSync(S);if(this.listeners.OnceExit)if(S.type==="document")for(let v of S.nodes)this.visitSync(this.listeners.OnceExit,v);else this.visitSync(this.listeners.OnceExit,S)}return this.result}then(S,v){return this.async().then(S,v)}toString(){return this.css}visitSync(S,v){for(let[R,k]of S){this.result.lastPlugin=R;let O;try{O=k(v,this.helpers)}catch(M){throw this.handleError(M,v.proxyOf)}if(v.type!=="root"&&v.type!=="document"&&!v.parent)return!0;if(m(O))throw this.getAsyncError()}}visitTick(S){let v=S[S.length-1],{node:R,visitors:k}=v;if(R.type!=="root"&&R.type!=="document"&&!R.parent){S.pop();return}if(k.length>0&&v.visitorIndex<k.length){let[M,_]=k[v.visitorIndex];v.visitorIndex+=1,v.visitorIndex===k.length&&(v.visitors=[],v.visitorIndex=0),this.result.lastPlugin=M;try{return _(R.toProxy(),this.helpers)}catch(D){throw this.handleError(D,R)}}if(v.iterator!==0){let M=v.iterator,_;for(;_=R.nodes[R.indexes[M]];)if(R.indexes[M]+=1,!_[e]){_[e]=!0,S.push(y(_));return}v.iterator=0,delete R.indexes[M]}let O=v.events;for(;v.eventIndex<O.length;){let M=O[v.eventIndex];if(v.eventIndex+=1,M===d){R.nodes&&R.nodes.length&&(R[e]=!0,v.iterator=R.getIterator());return}else if(this.listeners[M]){v.visitors=this.listeners[M];return}}S.pop()}walkSync(S){S[e]=!0;let v=f(S);for(let R of v)if(R===d)S.nodes&&S.each(k=>{k[e]||this.walkSync(k)});else{let k=this.listeners[R];if(k&&this.visitSync(k,S.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return x.registerPostcss=E=>{w=E},ds=x,x.default=x,u.registerLazyResult(x),o.registerLazyResult(x),ds}var hs,ma;function Lp(){if(ma)return hs;ma=1;let e=ul(),t=Hr(),r=pl(),n=fi(),s=pi();class o{constructor(a,c,u){c=c.toString(),this.stringified=!1,this._processor=a,this._css=c,this._opts=u,this._map=void 0;let l,h=t;this.result=new s(this._processor,l,this._opts),this.result.css=c;let p=this;Object.defineProperty(this.result,"root",{get(){return p.root}});let d=new e(h,l,this._opts,c);if(d.isMap()){let[m,f]=d.generate();m&&(this.result.css=m),f&&(this.result.map=f)}else d.clearAnnotation(),this.result.css=d.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(a){return this.async().catch(a)}finally(a){return this.async().then(a,a)}sync(){if(this.error)throw this.error;return this.result}then(a,c){return this.async().then(a,c)}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 a,c=n;try{a=c(this._css,this._opts)}catch(u){this.error=u}if(this.error)throw this.error;return this._root=a,a}get[Symbol.toStringTag](){return"NoWorkResult"}}return hs=o,o.default=o,hs}var fs,ga;function Pp(){if(ga)return fs;ga=1;let e=Lp(),t=fl(),r=ui(),n=rr();class s{constructor(i=[]){this.version="8.4.38",this.plugins=this.normalize(i)}normalize(i){let a=[];for(let c of i)if(c.postcss===!0?c=c():c.postcss&&(c=c.postcss),typeof c=="object"&&Array.isArray(c.plugins))a=a.concat(c.plugins);else if(typeof c=="object"&&c.postcssPlugin)a.push(c);else if(typeof c=="function")a.push(c);else if(!(typeof c=="object"&&(c.parse||c.stringify)))throw new Error(c+" is not a PostCSS plugin");return a}process(i,a={}){return!this.plugins.length&&!a.parser&&!a.stringifier&&!a.syntax?new e(this,i,a):new t(this,i,a)}use(i){return this.plugins=this.plugins.concat(this.normalize([i])),this}}return fs=s,s.default=s,n.registerProcessor(s),r.registerProcessor(s),fs}var ms,ya;function _p(){if(ya)return ms;ya=1;let e=Yr(),t=cl(),r=Kr(),n=di(),s=Jr(),o=rr(),i=hi();function a(c,u){if(Array.isArray(c))return c.map(p=>a(p));let{inputs:l,...h}=c;if(l){u=[];for(let p of l){let d={...p,__proto__:s.prototype};d.map&&(d.map={...d.map,__proto__:t.prototype}),u.push(d)}}if(h.nodes&&(h.nodes=c.nodes.map(p=>a(p,u))),h.source){let{inputId:p,...d}=h.source;h.source=d,p!=null&&(h.source.input=u[p])}if(h.type==="root")return new o(h);if(h.type==="decl")return new e(h);if(h.type==="rule")return new i(h);if(h.type==="comment")return new r(h);if(h.type==="atrule")return new n(h);throw new Error("Unknown node type: "+c.type)}return ms=a,a.default=a,ms}var gs,va;function $p(){if(va)return gs;va=1;let e=li(),t=Yr(),r=fl(),n=ct(),s=Pp(),o=Hr(),i=_p(),a=ui(),c=dl(),u=Kr(),l=di(),h=pi(),p=Jr(),d=fi(),m=hl(),f=hi(),y=rr(),b=Gr();function w(...x){return x.length===1&&Array.isArray(x[0])&&(x=x[0]),new s(x)}return w.plugin=function(E,S){let v=!1;function R(...O){console&&console.warn&&!v&&(v=!0,console.warn(E+`: postcss.plugin was deprecated. Migration guide:\nhttps://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:\nhttps://www.w3ctech.com/topic/2226`));let M=S(...O);return M.postcssPlugin=E,M.postcssVersion=new s().version,M}let k;return Object.defineProperty(R,"postcss",{get(){return k||(k=R()),k}}),R.process=function(O,M,_){return w([R(_)]).process(O,M)},R},w.stringify=o,w.parse=d,w.fromJSON=i,w.list=m,w.comment=x=>new u(x),w.atRule=x=>new l(x),w.decl=x=>new t(x),w.rule=x=>new f(x),w.root=x=>new y(x),w.document=x=>new a(x),w.CssSyntaxError=e,w.Declaration=t,w.Container=n,w.Processor=s,w.Document=a,w.Comment=u,w.Warning=c,w.AtRule=l,w.Result=h,w.Input=p,w.Rule=f,w.Root=y,w.Node=b,r.registerPostcss(w),gs=w,w.default=w,gs}var Fp=$p(),ue=kp(Fp);ue.stringify;ue.fromJSON;ue.plugin;ue.parse;ue.list;ue.document;ue.comment;ue.atRule;ue.rule;ue.decl;ue.root;ue.CssSyntaxError;ue.Declaration;ue.Container;ue.Processor;ue.Document;ue.Comment;ue.Warning;ue.AtRule;ue.Result;ue.Input;ue.Rule;ue.Root;ue.Node;var Y=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Y||{});function Up(e){let t={},r=/;(?![^(]*\\))/g,n=/:(.+)/,s=/\\/\\*.*?\\*\\//g;return e.replace(s,"").split(r).forEach(function(o){if(o){let i=o.split(n);i.length>1&&(t[ks(i[0].trim())]=i[1].trim())}}),t}function ba(e){let t=[];for(let r in e){let n=e[r];if(typeof n!="string")continue;let s=zp(r);t.push(`${s}: ${n};`)}return t.join(" ")}var qp=/-([a-z])/g,Bp=/^--[a-zA-Z0-9-]+$/,ks=e=>Bp.test(e)?e:e.replace(qp,(t,r)=>r?r.toUpperCase():""),jp=/\\B([A-Z])/g,zp=e=>e.replace(jp,"-$1").toLowerCase(),Ue=class e{constructor(...t){T(this,"parentElement",null),T(this,"parentNode",null),T(this,"ownerDocument"),T(this,"firstChild",null),T(this,"lastChild",null),T(this,"previousSibling",null),T(this,"nextSibling",null),T(this,"ELEMENT_NODE",1),T(this,"TEXT_NODE",3),T(this,"nodeType"),T(this,"nodeName"),T(this,"RRNodeType")}get childNodes(){let t=[],r=this.firstChild;for(;r;)t.push(r),r=r.nextSibling;return t}contains(t){if(t instanceof e){if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0}else return!1;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute \'appendChild\' on \'RRNode\': This RRNode type does not support this method.")}insertBefore(t,r){throw new Error("RRDomException: Failed to execute \'insertBefore\' on \'RRNode\': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute \'removeChild\' on \'RRNode\': This RRNode type does not support this method.")}toString(){return"RRNode"}},Ms=class e extends Ue{constructor(...t){super(t),T(this,"nodeType",9),T(this,"nodeName","#document"),T(this,"compatMode","CSS1Compat"),T(this,"RRNodeType",Y.Document),T(this,"textContent",null),this.ownerDocument=this}get documentElement(){return this.childNodes.find(t=>t.RRNodeType===Y.Element&&t.tagName==="HTML")||null}get body(){var t;return((t=this.documentElement)==null?void 0:t.childNodes.find(r=>r.RRNodeType===Y.Element&&r.tagName==="BODY"))||null}get head(){var t;return((t=this.documentElement)==null?void 0:t.childNodes.find(r=>r.RRNodeType===Y.Element&&r.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(t){let r=t.RRNodeType;if((r===Y.Element||r===Y.DocumentType)&&this.childNodes.some(s=>s.RRNodeType===r))throw new Error(`RRDomException: Failed to execute \'appendChild\' on \'RRNode\': Only one ${r===Y.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);let n=mi(this,t);return n.parentElement=null,n}insertBefore(t,r){let n=t.RRNodeType;if((n===Y.Element||n===Y.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===n))throw new Error(`RRDomException: Failed to execute \'insertBefore\' on \'RRNode\': Only one ${n===Y.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);let s=ml(this,t,r);return s.parentElement=null,s}removeChild(t){return gl(this,t)}open(){this.firstChild=null,this.lastChild=null}close(){}write(t){let r;if(t===\'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">\'?r="-//W3C//DTD XHTML 1.0 Transitional//EN":t===\'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">\'&&(r="-//W3C//DTD HTML 4.0 Transitional//EN"),r){let n=this.createDocumentType("html",r,"");this.open(),this.appendChild(n)}}createDocument(t,r,n){return new e}createDocumentType(t,r,n){let s=new Or(t,r,n);return s.ownerDocument=this,s}createElement(t){let r=new St(t);return r.ownerDocument=this,r}createElementNS(t,r){return this.createElement(r)}createTextNode(t){let r=new Ir(t);return r.ownerDocument=this,r}createComment(t){let r=new Dr(t);return r.ownerDocument=this,r}createCDATASection(t){let r=new Ar(t);return r.ownerDocument=this,r}toString(){return"RRDocument"}},Or=class extends Ue{constructor(t,r,n){super(),T(this,"nodeType",10),T(this,"RRNodeType",Y.DocumentType),T(this,"name"),T(this,"publicId"),T(this,"systemId"),T(this,"textContent",null),this.name=t,this.publicId=r,this.systemId=n,this.nodeName=t}toString(){return"RRDocumentType"}},St=class extends Ue{constructor(t){super(),T(this,"nodeType",1),T(this,"RRNodeType",Y.Element),T(this,"tagName"),T(this,"attributes",{}),T(this,"shadowRoot",null),T(this,"scrollLeft"),T(this,"scrollTop"),this.tagName=t.toUpperCase(),this.nodeName=t.toUpperCase()}get textContent(){let t="";return this.childNodes.forEach(r=>t+=r.textContent),t}set textContent(t){this.firstChild=null,this.lastChild=null,this.appendChild(this.ownerDocument.createTextNode(t))}get classList(){return new Is(this.attributes.class,t=>{this.attributes.class=t})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){let t=this.attributes.style?Up(this.attributes.style):{},r=/\\B([A-Z])/g;return t.setProperty=(n,s,o)=>{if(r.test(n))return;let i=ks(n);s?t[i]=s:delete t[i],o==="important"&&(t[i]+=" !important"),this.attributes.style=ba(t)},t.removeProperty=n=>{if(r.test(n))return"";let s=ks(n),o=t[s]||"";return delete t[s],this.attributes.style=ba(t),o},t}getAttribute(t){return this.attributes[t]===void 0?null:this.attributes[t]}setAttribute(t,r){this.attributes[t]=r}setAttributeNS(t,r,n){this.setAttribute(r,n)}removeAttribute(t){delete this.attributes[t]}appendChild(t){return mi(this,t)}insertBefore(t,r){return ml(this,t,r)}removeChild(t){return gl(this,t)}attachShadow(t){let r=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=r,r}dispatchEvent(t){return!0}toString(){let t="";for(let r in this.attributes)t+=`${r}="${this.attributes[r]}" `;return`${this.tagName} ${t}`}},Ns=class extends St{constructor(){super(...arguments),T(this,"currentTime"),T(this,"volume"),T(this,"paused"),T(this,"muted"),T(this,"playbackRate"),T(this,"loop")}attachShadow(t){throw new Error("RRDomException: Failed to execute \'attachShadow\' on \'RRElement\': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}},Os=class extends St{constructor(){super(...arguments),T(this,"tagName","DIALOG"),T(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")}},Ir=class extends Ue{constructor(t){super(),T(this,"nodeType",3),T(this,"nodeName","#text"),T(this,"RRNodeType",Y.Text),T(this,"data"),this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRText text=${JSON.stringify(this.data)}`}},Dr=class extends Ue{constructor(t){super(),T(this,"nodeType",8),T(this,"nodeName","#comment"),T(this,"RRNodeType",Y.Comment),T(this,"data"),this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRComment text=${JSON.stringify(this.data)}`}},Ar=class extends Ue{constructor(t){super(),T(this,"nodeName","#cdata-section"),T(this,"nodeType",4),T(this,"RRNodeType",Y.CDATA),T(this,"data"),this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}},Is=class{constructor(t,r){if(T(this,"onChange"),T(this,"classes",[]),T(this,"add",(...n)=>{for(let s of n){let o=String(s);this.classes.indexOf(o)>=0||this.classes.push(o)}this.onChange&&this.onChange(this.classes.join(" "))}),T(this,"remove",(...n)=>{this.classes=this.classes.filter(s=>n.indexOf(s)===-1),this.onChange&&this.onChange(this.classes.join(" "))}),t){let n=t.trim().split(/\\s+/);this.classes.push(...n)}this.onChange=r}};function mi(e,t){return t.parentNode&&t.parentNode.removeChild(t),e.lastChild?(e.lastChild.nextSibling=t,t.previousSibling=e.lastChild):(e.firstChild=t,t.previousSibling=null),e.lastChild=t,t.nextSibling=null,t.parentNode=e,t.parentElement=e,t.ownerDocument=e.ownerDocument,t}function ml(e,t,r){if(!r)return mi(e,t);if(r.parentNode!==e)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 t===r||(t.parentNode&&t.parentNode.removeChild(t),t.previousSibling=r.previousSibling,r.previousSibling=t,t.nextSibling=r,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,t.parentElement=e,t.parentNode=e,t.ownerDocument=e.ownerDocument),t}function gl(e,t){if(t.parentNode!==e)throw new Error("Failed to execute \'removeChild\' on \'RRNode\': The RRNode to be removed is not a child of this RRNode.");return t.previousSibling?t.previousSibling.nextSibling=t.nextSibling:e.firstChild=t.nextSibling,t.nextSibling?t.nextSibling.previousSibling=t.previousSibling:e.lastChild=t.previousSibling,t.previousSibling=null,t.nextSibling=null,t.parentElement=null,t.parentNode=null,t}var Me=(e=>(e[e.PLACEHOLDER=0]="PLACEHOLDER",e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE",e))(Me||{}),Ds={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},Wp={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"},We=null;function Tr(e,t,r,n=t.mirror||t.ownerDocument.mirror){e=Vp(e,t,r,n),yl(e,t,r,n),Hp(e,t,r)}function Vp(e,t,r,n){var s;if(r.afterAppend&&!We&&(We=new WeakSet,setTimeout(()=>{We=null},0)),!gi(e,t)){let o=Lr(t,r.mirror,n);(s=e.parentNode)==null||s.replaceChild(o,e),e=o}switch(t.RRNodeType){case Y.Document:{if(!ft(e,t,r.mirror,n)){let o=n.getMeta(t);o&&(r.mirror.removeNodeFromMap(e),e.close(),e.open(),r.mirror.add(e,o),We?.add(e))}break}case Y.Element:{let o=e,i=t;switch(i.tagName){case"IFRAME":{let a=e.contentDocument;if(!a)break;Tr(a,t.contentDocument,r,n);break}}i.shadowRoot&&(o.shadowRoot||o.attachShadow({mode:"open"}),yl(o.shadowRoot,i.shadowRoot,r,n)),Gp(o,i,n);break}}return e}function Hp(e,t,r){var n;switch(t.RRNodeType){case Y.Document:{let s=t.scrollData;s&&r.applyScroll(s,!0);break}case Y.Element:{let s=e,o=t;switch(o.scrollData&&r.applyScroll(o.scrollData,!0),o.inputData&&r.applyInput(o.inputData),o.tagName){case"AUDIO":case"VIDEO":{let i=e,a=o;a.paused!==void 0&&(a.paused?i.pause():i.play()),a.muted!==void 0&&(i.muted=a.muted),a.volume!==void 0&&(i.volume=a.volume),a.currentTime!==void 0&&(i.currentTime=a.currentTime),a.playbackRate!==void 0&&(i.playbackRate=a.playbackRate),a.loop!==void 0&&(i.loop=a.loop);break}case"CANVAS":{let i=t;if(i.rr_dataURL!==null){let a=document.createElement("img");a.onload=()=>{let c=s.getContext("2d");c&&c.drawImage(a,0,0,a.width,a.height)},a.src=i.rr_dataURL}i.canvasMutations.forEach(a=>r.applyCanvas(a.event,a.mutation,e));break}case"STYLE":{let i=s.sheet;i&&t.rules.forEach(a=>r.applyStyleSheetMutation(a,i));break}case"DIALOG":{let i=s,a=o,c=i.open,u=i.matches("dialog:modal"),l=a.open,h=a.isModal,p=u!==h,d=c!==l;if((p||c&&d)&&i.close(),l&&(d||p))try{h?i.showModal():i.show()}catch(m){console.warn(m)}break}}break}case Y.Text:case Y.Comment:case Y.CDATA:{e.textContent!==t.data&&(e.textContent=t.data);break}}We?.has(e)&&(We.delete(e),(n=r.afterAppend)==null||n.call(r,e,r.mirror.getId(e)))}function Gp(e,t,r){let n=e.attributes,s=t.attributes;for(let o in s){let i=s[o],a=r.getMeta(t);if(a?.isSVG&&Ds[o])e.setAttributeNS(Ds[o],o,i);else if(t.tagName==="CANVAS"&&o==="rr_dataURL"){let c=document.createElement("img");c.src=i,c.onload=()=>{let u=e.getContext("2d");u&&u.drawImage(c,0,0,c.width,c.height)}}else{if(t.tagName==="IFRAME"&&o==="srcdoc")continue;try{e.setAttribute(o,i)}catch(c){console.warn(c)}}}for(let{name:o}of Array.from(n))o in s||e.removeAttribute(o);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function yl(e,t,r,n){let s=Array.from(e.childNodes),o=t.childNodes;if(s.length===0&&o.length===0)return;let i=0,a=s.length-1,c=0,u=o.length-1,l=s[i],h=s[a],p=o[c],d=o[u],m,f;for(;i<=a&&c<=u;)if(l===void 0)l=s[++i];else if(h===void 0)h=s[--a];else if(ft(l,p,r.mirror,n))l=s[++i],p=o[++c];else if(ft(h,d,r.mirror,n))h=s[--a],d=o[--u];else if(ft(l,d,r.mirror,n)){try{e.insertBefore(l,h.nextSibling)}catch(w){console.warn(w)}l=s[++i],d=o[--u]}else if(ft(h,p,r.mirror,n)){try{e.insertBefore(h,l)}catch(w){console.warn(w)}h=s[--a],p=o[++c]}else{if(!m){m={};for(let x=i;x<=a;x++){let E=s[x];E&&r.mirror.hasNode(E)&&(m[r.mirror.getId(E)]=x)}}f=m[n.getId(p)];let w=s[f];if(f!==void 0&&w&&ft(w,p,r.mirror,n)){try{e.insertBefore(w,l)}catch(x){console.warn(x)}s[f]=void 0}else{let x=Lr(p,r.mirror,n);e.nodeName==="#document"&&l&&(x.nodeType===x.DOCUMENT_TYPE_NODE&&l.nodeType===l.DOCUMENT_TYPE_NODE||x.nodeType===x.ELEMENT_NODE&&l.nodeType===l.ELEMENT_NODE)&&(e.removeChild(l),r.mirror.removeNodeFromMap(l),l=s[++i]);try{e.insertBefore(x,l||null)}catch(E){console.warn(E)}}p=o[++c]}if(i>a){let w=o[u+1],x=null;for(w&&(x=r.mirror.getNode(n.getId(w)));c<=u;++c){let E=Lr(o[c],r.mirror,n);try{e.insertBefore(E,x)}catch(S){console.warn(S)}}}else if(c>u)for(;i<=a;i++){let w=s[i];if(!(!w||w.parentNode!==e))try{e.removeChild(w),r.mirror.removeNodeFromMap(w)}catch(x){console.warn(x)}}let y=e.firstChild,b=t.firstChild;for(;y!==null&&b!==null;)Tr(y,b,r,n),y=y.nextSibling,b=b.nextSibling}function Lr(e,t,r){let n=r.getId(e),s=r.getMeta(e),o=null;if(n>-1&&(o=t.getNode(n)),o!==null&&gi(o,e))return o;switch(e.RRNodeType){case Y.Document:o=new Document;break;case Y.DocumentType:o=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case Y.Element:{let i=e.tagName.toLowerCase();i=Wp[i]||i,s&&"isSVG"in s&&s?.isSVG?o=document.createElementNS(Ds.svg,i):o=document.createElement(e.tagName);break}case Y.Text:o=document.createTextNode(e.data);break;case Y.Comment:o=document.createComment(e.data);break;case Y.CDATA:o=document.createCDATASection(e.data);break}s&&t.add(o,{...s});try{We?.add(o)}catch{}return o}function gi(e,t){return e.nodeType!==t.nodeType?!1:e.nodeType!==e.ELEMENT_NODE||e.tagName.toUpperCase()===t.tagName}function ft(e,t,r,n){let s=r.getId(e),o=n.getId(t);return s===-1||s!==o?!1:gi(e,t)}var Ct=class e extends Ms{constructor(t){super(),T(this,"UNSERIALIZED_STARTING_ID",-2),T(this,"_unserializedId",this.UNSERIALIZED_STARTING_ID),T(this,"mirror",ed()),T(this,"scrollData",null),t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,r,n){return new e}createDocumentType(t,r,n){let s=new Yp(t,r,n);return s.ownerDocument=this,s}createElement(t){let r=t.toUpperCase(),n;switch(r){case"AUDIO":case"VIDEO":n=new As(r);break;case"IFRAME":n=new _s(r,this.mirror);break;case"CANVAS":n=new Ls(r);break;case"STYLE":n=new Ps(r);break;case"DIALOG":n=new Ts(r);break;default:n=new Et(r);break}return n.ownerDocument=this,n}createComment(t){let r=new Kp(t);return r.ownerDocument=this,r}createCDATASection(t){let r=new Xp(t);return r.ownerDocument=this,r}createTextNode(t){let r=new Jp(t);return r.ownerDocument=this,r}destroyTree(){this.firstChild=null,this.lastChild=null,this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}},Yp=Or,Et=class extends St{constructor(){super(...arguments),T(this,"inputData",null),T(this,"scrollData",null)}},As=class extends Ns{},Ts=class extends Os{},Ls=class extends Et{constructor(){super(...arguments),T(this,"rr_dataURL",null),T(this,"canvasMutations",[])}getContext(){return null}},Ps=class extends Et{constructor(){super(...arguments),T(this,"rules",[])}},_s=class extends Et{constructor(t,r){super(t),T(this,"contentDocument",new Ct),this.contentDocument.mirror=r}},Jp=Ir,Kp=Dr,Xp=Ar;function Qp(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function vl(e,t,r,n){let s;switch(e.nodeType){case Me.DOCUMENT_NODE:n&&n.nodeName==="IFRAME"?s=n.contentDocument:(s=t,s.compatMode=e.compatMode);break;case Me.DOCUMENT_TYPE_NODE:{let i=e;s=t.createDocumentType(i.name,i.publicId,i.systemId);break}case Me.ELEMENT_NODE:{let i=e,a=Qp(i);s=t.createElement(a);let c=s;for(let{name:u,value:l}of Array.from(i.attributes))c.attributes[u]=l;i.scrollLeft&&(c.scrollLeft=i.scrollLeft),i.scrollTop&&(c.scrollTop=i.scrollTop);break}case Me.TEXT_NODE:s=t.createTextNode(e.textContent||"");break;case Me.CDATA_SECTION_NODE:s=t.createCDATASection(e.data);break;case Me.COMMENT_NODE:s=t.createComment(e.textContent||"");break;case Me.DOCUMENT_FRAGMENT_NODE:s=n.attachShadow({mode:"open"});break;default:return null}let o=r.getMeta(e);return t instanceof Ct&&(o||(o=bl(s,t.unserializedId),r.add(e,o)),t.mirror.add(s,{...o})),s}function Zp(e,t=Rp(),r=new Ct){function n(s,o){let i=vl(s,r,t,o);if(i!==null)if(o?.nodeName!=="IFRAME"&&s.nodeType!==Me.DOCUMENT_FRAGMENT_NODE&&(o?.appendChild(i),i.parentNode=o,i.parentElement=o),s.nodeName==="IFRAME"){let a=s.contentDocument;a&&n(a,i)}else(s.nodeType===Me.DOCUMENT_NODE||s.nodeType===Me.ELEMENT_NODE||s.nodeType===Me.DOCUMENT_FRAGMENT_NODE)&&(s.nodeType===Me.ELEMENT_NODE&&s.shadowRoot&&n(s.shadowRoot,i),s.childNodes.forEach(a=>n(a,i)))}return n(e,null),r}function ed(){return new $s}var $s=class{constructor(){T(this,"idNodeMap",new Map),T(this,"nodeMetaMap",new WeakMap)}getId(t){var r;return t?((r=this.getMeta(t))==null?void 0:r.id)??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){let r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){let n=this.getNode(t);if(n){let s=this.nodeMetaMap.get(n);s&&this.nodeMetaMap.set(r,s)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function bl(e,t){switch(e.RRNodeType){case Y.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case Y.DocumentType:{let r=e;return{id:t,type:e.RRNodeType,name:r.name,publicId:r.publicId,systemId:r.systemId}}case Y.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case Y.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case Y.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case Y.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}var wa={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},xa={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},zt={},Fs={},Sa=0,td=()=>!!globalThis.Zone;function yi(e){if(zt[e])return zt[e];let t=globalThis[e],r=t.prototype,n=e in wa?wa[e]:void 0,s=!!(n&&n.every(a=>{var c,u;return!!((u=(c=Object.getOwnPropertyDescriptor(r,a))==null?void 0:c.get)!=null&&u.toString().includes("[native code]"))})),o=e in xa?xa[e]:void 0,i=!!(o&&o.every(a=>{var c;return typeof r[a]=="function"&&((c=r[a])==null?void 0:c.toString().includes("[native code]"))}));if(s&&i&&!td())return zt[e]=t.prototype,t.prototype;try{let a=document.createElement("iframe");a.style.display="none",document.body.appendChild(a);let c=a.contentWindow;if(!c)return t.prototype;let u=c[e].prototype;if(!u)return a.remove(),r;let l=navigator.userAgent;return l.includes("Safari")&&!l.includes("Chrome")?(a.classList.add("rr-block"),a.setAttribute("__rrwebUntaintedMutationObserver",""),Fs[e]=()=>a.remove()):a.remove(),zt[e]=u}catch{return r}}var ys={};function Ie(e,t,r){var n,s;let o=(n=ys[e])==null?void 0:n[r];if(o)return o.call(t);let i=yi(e),a=(s=Object.getOwnPropertyDescriptor(i,r))==null?void 0:s.get;return a?((ys[e]||(ys[e]={}))[r]=a,a.call(t)):t[r]}var vs={};function wl(e,t,r){let n=`${e}.${String(r)}`;if(vs[n])return vs[n].bind(t);let o=yi(e)[r];return typeof o!="function"?t[r]:(vs[n]=o,o.bind(t))}function rd(e){return Ie("Node",e,"ownerDocument")}function nd(e){return Ie("Node",e,"childNodes")}function sd(e){return Ie("Node",e,"parentNode")}function id(e){return Ie("Node",e,"parentElement")}function od(e){return Ie("Node",e,"textContent")}function ad(e){return Ie("Node",e,"firstChild")}function ld(e){return Ie("Node",e,"lastChild")}function cd(e){return Ie("Node",e,"nextSibling")}function ud(e){return Ie("Node",e,"previousSibling")}function pd(e,t){return wl("Node",e,"contains")(t)}function dd(e){return wl("Node",e,"getRootNode")()}function hd(e){return!e||!("host"in e)?null:Ie("ShadowRoot",e,"host")}function fd(e){return e.styleSheets}function md(e){return!e||!("shadowRoot"in e)?null:Ie("Element",e,"shadowRoot")}function gd(e,t){return Ie("Element",e,"querySelector")(t)}function yd(e,t){return Ie("Element",e,"querySelectorAll")(t)}function xl(){let e=yi("MutationObserver");Sa++;let t=!1;return[e.constructor,()=>{if(t||(t=!0,--Sa!==0))return;let r=Fs.MutationObserver;if(r)try{r()}finally{delete zt.MutationObserver,delete Fs.MutationObserver}}]}var Qt=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Qt=()=>new Date().getTime());function ut(e,t,r){try{if(!(t in e))return()=>{};let n=e[t],s=r(n);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=s,()=>{e[t]=n}}catch{return()=>{}}}var z={ownerDocument:rd,childNodes:nd,parentNode:sd,parentElement:id,textContent:od,firstChild:ad,lastChild:ld,nextSibling:cd,previousSibling:ud,contains:pd,getRootNode:dd,host:hd,styleSheets:fd,shadowRoot:md,querySelector:gd,querySelectorAll:yd,nowTimestamp:Qt,mutationObserverCtor:xl,patch:ut};function be(e,t,r=document){let n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}var mt=`Please stop import mirror directly. Instead of that,\\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\\r\nor you can use record.mirror to access the mirror instance during recording.`,Ca={map:{},getId(){return console.error(mt),-1},getNode(){return console.error(mt),null},removeNodeFromMap(){console.error(mt)},has(){return console.error(mt),!1},reset(){console.error(mt)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Ca=new Proxy(Ca,{get(e,t,r){return t==="map"&&console.error(mt),Reflect.get(e,t,r)}}));function Zt(e,t,r={}){let n=null,s=0;return function(...o){let i=Date.now();!s&&r.leading===!1&&(s=i);let a=t-(i-s),c=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),s=i,e.apply(c,o)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{s=r.leading===!1?0:Date.now(),n=null,e.apply(c,o)},a))}}function Xr(e,t,r,n,s=window){let o=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,n?r:{set(i){setTimeout(()=>{r.set.call(this,i)},0),o&&o.set&&o.set.call(this,i)}}),()=>Xr(e,t,o||{},!0)}function Sl(e){var t,r,n,s;let o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:o.documentElement.scrollLeft||o?.body&&((t=z.parentElement(o.body))==null?void 0:t.scrollLeft)||((r=o?.body)==null?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:o?.documentElement.scrollTop||o?.body&&((n=z.parentElement(o.body))==null?void 0:n.scrollTop)||((s=o?.body)==null?void 0:s.scrollTop)||0}}function Cl(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function El(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Rl(e){return e?e.nodeType===e.ELEMENT_NODE?e:z.parentElement(e):null}function Se(e,t,r,n){if(!e)return!1;let s=Rl(e);if(!s)return!1;try{if(typeof t=="string"){if(s.classList.contains(t)||n&&s.closest("."+t)!==null)return!0}else if(Nr(s,t,n))return!0}catch{}return!!(r&&(s.matches(r)||n&&s.closest(r)!==null))}function vd(e,t){return t.getId(e)!==-1}function bs(e,t,r){return e.tagName==="TITLE"&&r.headTitleMutations?!0:t.getId(e)===Mr}function kl(e,t){if(Ht(e))return!1;let r=t.getId(e);if(!t.has(r))return!0;let n=z.parentNode(e);return n&&n.nodeType===e.DOCUMENT_NODE?!1:n?kl(n,t):!0}function Us(e){return!!e.changedTouches}function Ml(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function bd(e){let t={},r=(s,o)=>{let i={value:s,parent:o,children:[]};return t[s.node.id]=i,i},n=[];for(let s of e){let{nextId:o,parentId:i}=s;if(o&&o in t){let a=t[o];if(a.parent){let c=a.parent.children.indexOf(a);a.parent.children.splice(c,0,r(s,a.parent))}else{let c=n.indexOf(a);n.splice(c,0,r(s,null))}continue}if(i in t){let a=t[i];a.children.push(r(s,a));continue}n.push(r(s,null))}return n}function Nl(e,t){t(e.value);for(let r=e.children.length-1;r>=0;r--)Nl(e.children[r],t)}function Jt(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Ol(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Il(e,t){var r,n;let s=(n=(r=e.ownerDocument)==null?void 0:r.defaultView)==null?void 0:n.frameElement;if(!s||s===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};let o=s.getBoundingClientRect(),i=Il(s,t),a=o.height/s.clientHeight;return{x:o.x*i.relativeScale+i.x,y:o.y*i.relativeScale+i.y,relativeScale:a,absoluteScale:i.absoluteScale*a}}function at(e){return e?e instanceof Ue&&"shadowRoot"in e?!!e.shadowRoot:!!z.shadowRoot(e):!1}function Wt(e,t){let r=e?.[t[0]];return r?t.length===1?r:Wt(r.cssRules,t.slice(1)):null}function Ea(e){let t=[...e],r=t.pop();return{positions:t,index:r}}function wd(e){let t=new Set,r=[];for(let n=e.length;n--;){let s=e[n];t.has(s.id)||(r.push(s),t.add(s.id))}return r}var Pr=class{constructor(){N(this,"id",1),N(this,"styleIDMap",new WeakMap),N(this,"idStyleMap",new Map)}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let n;return r===void 0?n=this.id++:n=r,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Dl(e){var t;let r=null;return"getRootNode"in e&&((t=z.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&z.host(z.getRootNode(e))&&(r=z.host(z.getRootNode(e))),r}function xd(e){let t=e,r;for(;r=Dl(t);)t=r;return t}function Sd(e){let t=z.ownerDocument(e);if(!t)return!1;let r=xd(e);return z.contains(t,r)}function qs(e){let t=z.ownerDocument(e);return t?z.contains(t,e)||Sd(e):!1}var $=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e[e.Asset=7]="Asset",e[e.Annotation=8]="Annotation",e))($||{}),L=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(L||{}),Q=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(Q||{}),He=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(He||{}),Je=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Je||{}),et=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(et||{}),X=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Annotation="annotation",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e.Destroy="destroy",e))(X||{}),Ge=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Ge||{}),Ra=(e,t)=>`${e}@${t}`,Bs=class{constructor(){N(this,"frozen",!1),N(this,"locked",!1),N(this,"texts",[]),N(this,"attributes",[]),N(this,"attributeMap",new WeakMap),N(this,"removes",[]),N(this,"mapRemoves",[]),N(this,"movedMap",{}),N(this,"addedSet",new Set),N(this,"movedSet",new Set),N(this,"droppedSet",new Set),N(this,"removesSubTreeCache",new Set),N(this,"mutationCb"),N(this,"blockClass"),N(this,"blockSelector"),N(this,"maskTextClass"),N(this,"maskTextSelector"),N(this,"inlineStylesheet"),N(this,"maskInputOptions"),N(this,"maskTextFn"),N(this,"maskInputFn"),N(this,"keepIframeSrcFn"),N(this,"recordCanvas"),N(this,"inlineImages"),N(this,"slimDOMOptions"),N(this,"dataURLOptions"),N(this,"doc"),N(this,"mirror"),N(this,"iframeManager"),N(this,"stylesheetManager"),N(this,"shadowDomManager"),N(this,"processedNodeManager"),N(this,"unattachedDoc"),N(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),N(this,"emit",()=>{if(this.frozen||this.locked)return;let t=[],r=new Set;for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let p of this.movedSet){let d=z.parentNode(p);this.removesSubTreeCache.has(d)&&!this.movedSet.has(d)||this.addedSet.add(p)}let n=null,s=null,o=-1,i=null,a=!1,c=new Set,u=this.addedSet.values(),l=u.next();for(;this.addedSet.size;){if(n!==null&&this.addedSet.has(z.previousSibling(n)))i=n,n=z.previousSibling(n);else{for(this.addedSet.has(l.value)||(l=u.next()),n=l.value;;){if(s=z.parentNode(n),this.addedSet.has(s)){n=s;continue}break}if(c.has(s))s=null;else if(s){if(qs(s)?(a=ka(this.droppedSet,s)||this.removesSubTreeCache.has(s),a&&ka(this.movedSet,n)&&(a=!1)):a=!0,this.addedSet.has(z.lastChild(s)))n=z.lastChild(s),i=null;else for(;;){if(i=z.nextSibling(n),this.addedSet.has(i)){n=i;continue}break}if(o=Ht(s)?this.mirror.getId(Dl(n)):this.mirror.getId(s),o===-1&&s.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let f=z.host(s);o=this.mirror.getId(f)}}}if(this.addedSet.delete(n),!s||o===-1){c.add(n);continue}else if(a){this.droppedSet.add(n);continue}let p=!1;if(n.nodeType===Node.TEXT_NODE){let f=s.tagName;if(f==="TEXTAREA")continue;f==="STYLE"&&r.has(o)&&(p=!0)}let d=i?this.mirror.getId(i):null;for(;d===Mr;)i=i&&z.nextSibling(i),d=i&&this.mirror.getId(i);if(d===-1){console.warn("Couldn\'t record new node. Couldn\'t find mirror id for nextSibling:",i),n=null;continue}let m=vt(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:f=>{Jt(f,this.mirror)&&this.iframeManager.addIframe(f),Ol(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),at(n)&&this.shadowDomManager.addShadowRoot(z.shadowRoot(n),this.doc)},onIframeLoad:(f,y)=>{this.iframeManager.attachIframe(f,y),this.shadowDomManager.observeAttachShadow(f)},onStylesheetLoad:(f,y)=>{this.stylesheetManager.attachLinkElement(f,y)},cssCaptured:p});m&&(t.push({parentId:o,nextId:d,node:m}),r.add(m.id))}let h={texts:this.texts.map(p=>{let d=p.node,m=z.parentNode(d);return m&&m.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(m),{id:this.mirror.getId(d),value:p.value}}).filter(p=>!r.has(p.id)).filter(p=>this.mirror.has(p.id)),attributes:this.attributes.map(p=>{let{attributes:d}=p;if(typeof d.style=="string"){let m=JSON.stringify(p.styleDiff),f=JSON.stringify(p._unchangedStyles);m.length<d.style.length&&(m+f).split("var(").length===d.style.split("var(").length&&(d.style=p.styleDiff)}return{id:this.mirror.getId(p.node),attributes:d}}).filter(p=>!r.has(p.id)).filter(p=>this.mirror.has(p.id)),removes:this.removes,adds:t};!h.texts.length&&!h.attributes.length&&!h.removes.length&&!h.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(h))}),N(this,"genTextAreaValueMutation",t=>{let r=this.attributeMap.get(t);r||(r={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(t,r));let n=Array.from(z.childNodes(t),s=>z.textContent(s)||"").join("");r.attributes.value=Er({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Rr(t),value:n,maskInputFn:this.maskInputFn})}),N(this,"processMutation",t=>{if(!bs(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{let r=z.textContent(t.target);!Se(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:Ka(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,Rl(t.target)):r.replace(/[\\S]/g,"*"):r,node:t.target});break}case"attributes":{let r=t.target,n=Ye(r.tagName),s=t.attributeName,o=t.target.getAttribute(s);if(s==="value"){let a=Rr(r);o=Er({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:a,value:o,maskInputFn:this.maskInputFn})}if(Se(t.target,this.blockClass,this.blockSelector,!1)||o===t.oldValue)return;let i=this.attributeMap.get(t.target);if(n==="iframe"&&s==="src"&&!this.keepIframeSrcFn(o))if(!r.contentDocument)s="rr_src";else return;if(i||(i={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(t.target,i)),s==="type"&&n==="input"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!Ja(n,s))if(i.attributes[s]=Ya(this.doc,n,Ye(s),o),s==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let a=this.unattachedDoc.createElement("span");t.oldValue&&a.setAttribute("style",t.oldValue);for(let c of Array.from(r.style)){let u=r.style.getPropertyValue(c),l=r.style.getPropertyPriority(c);u!==a.style.getPropertyValue(c)||l!==a.style.getPropertyPriority(c)?l===""?i.styleDiff[c]=u:i.styleDiff[c]=[u,l]:i._unchangedStyles[c]=[u,l]}for(let c of Array.from(a.style))r.style.getPropertyValue(c)===""&&(i.styleDiff[c]=!1)}else s==="open"&&r.tagName==="DIALOG"&&(r.matches("dialog:modal")?i.attributes.rr_open_mode="modal":i.attributes.rr_open_mode="non-modal");break}case"childList":{if(Se(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{qs(r)||this.shadowDomManager.removeShadowRootsIn(r);let n=this.mirror.getId(r),s=Ht(t.target)?this.mirror.getId(z.host(t.target)):this.mirror.getId(t.target);Se(t.target,this.blockClass,this.blockSelector,!1)||bs(r,this.mirror,this.slimDOMOptions)||!vd(r,this.mirror)||(this.addedSet.has(r)?(js(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||kl(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Ra(n,s)]?js(this.movedSet,r):(this.removes.push({parentId:s,id:n,isShadow:Ht(t.target)&&Gt(t.target)?!0:void 0}),Cd(r,this.removesSubTreeCache))),this.mapRemoves.push(r))});break}}}),N(this,"genAdds",(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(bs(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[Ra(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Se(t,this.blockClass,this.blockSelector,!1)||(z.childNodes(t).forEach(n=>this.genAdds(n)),at(t)&&z.childNodes(z.shadowRoot(t)).forEach(n=>{this.processedNodeManager.add(n,this),this.genAdds(n,t)}))}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","processedNodeManager"].forEach(r=>{this[r]=t[r]})}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1,this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0}unlock(){this.locked=!1,this.emit()}};function js(e,t){e.delete(t),z.childNodes(t).forEach(r=>js(e,r))}function Cd(e,t){let r=[e];for(;r.length;){let n=r.pop();t.has(n)||(t.add(n),z.childNodes(n).forEach(s=>r.push(s)))}}function ka(e,t){return e.size===0?!1:Al(e,t)}function Al(e,t){if(e.has(t))return!0;let r=z.parentNode(t);return r?Al(e,r):!1}var Kt;function Ed(e){Kt=e}function Rd(){Kt=void 0}var K=e=>Kt?(...r)=>{try{return e(...r)}catch(n){if(Kt&&Kt(n)===!0)return;throw n}}:e,xt=new Set;function nr(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Tl(e,t){let r=new Bs;xt.add(r),r.init(e);let[n,s]=xl(),o=new n(K(r.processMutations.bind(r)));return o.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),()=>{o.disconnect(),xt.delete(r),s()}}function kd({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};let s=typeof t.mousemove=="number"?t.mousemove:50,o=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,i=[],a,c=Zt(K(h=>{let p=Date.now()-a;e(i.map(d=>(d.timeOffset-=p,d)),h),i=[],a=null}),o),u=K(Zt(K(h=>{let p=nr(h),{clientX:d,clientY:m}=Us(h)?h.changedTouches[0]:h;a||(a=Qt()),i.push({x:d,y:m,id:n.getId(p),timeOffset:Qt()-a}),c(typeof DragEvent<"u"&&h instanceof DragEvent?L.Drag:h instanceof MouseEvent?L.MouseMove:L.TouchMove)}),s,{trailing:!1})),l=[be("mousemove",u,r),be("touchmove",u,r),be("drag",u,r)];return K(()=>{l.forEach(h=>h())})}function Md({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:o}){if(o.mouseInteraction===!1)return()=>{};let i=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[],c=null,u=l=>h=>{let p=nr(h);if(Se(p,n,s,!0))return;let d=null,m=l;if("pointerType"in h){switch(h.pointerType){case"mouse":d=He.Mouse;break;case"touch":d=He.Touch;break;case"pen":d=He.Pen;break}d===He.Touch?Q[l]===Q.MouseDown?m="TouchStart":Q[l]===Q.MouseUp&&(m="TouchEnd"):He.Pen}else Us(h)&&(d=He.Touch);d!==null?(c=d,(m.startsWith("Touch")&&d===He.Touch||m.startsWith("Mouse")&&d===He.Mouse)&&(d=null)):Q[l]===Q.Click&&(d=c,c=null);let f=Us(h)?h.changedTouches[0]:h;if(!f)return;let y=r.getId(p),{clientX:b,clientY:w}=f;K(e)({type:Q[m],id:y,x:b,y:w,...d!==null&&{pointerType:d}})};return Object.keys(Q).filter(l=>Number.isNaN(Number(l))&&!l.endsWith("_Departed")&&i[l]!==!1).forEach(l=>{let h=Ye(l),p=u(l);if(window.PointerEvent)switch(Q[l]){case Q.MouseDown:case Q.MouseUp:h=h.replace("mouse","pointer");break;case Q.TouchStart:case Q.TouchEnd:return}a.push(be(h,p,t))}),K(()=>{a.forEach(l=>l())})}function Ll({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:o}){let i=K(Zt(K(a=>{let c=nr(a);if(!c||Se(c,n,s,!0))return;let u=r.getId(c);if(c===t&&t.defaultView){let l=Sl(t.defaultView);e({id:u,x:l.left,y:l.top})}else e({id:u,x:c.scrollLeft,y:c.scrollTop})}),o.scroll||100));return be("scroll",i,t)}function Nd({viewportResizeCb:e},{win:t}){let r=-1,n=-1,s=K(Zt(K(()=>{let o=Cl(),i=El();(r!==o||n!==i)&&(e({width:Number(i),height:Number(o)}),r=o,n=i)}),200));return be("resize",s,t)}var Od=["INPUT","TEXTAREA","SELECT"],Ma=new WeakMap;function Id({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,ignoreClass:o,ignoreSelector:i,maskInputOptions:a,maskInputFn:c,sampling:u,userTriggeredOnInput:l}){function h(w){let x=nr(w),E=w.isTrusted,S=x&&x.tagName;if(x&&S==="OPTION"&&(x=z.parentElement(x)),!x||!S||Od.indexOf(S)<0||Se(x,n,s,!0)||x.classList.contains(o)||i&&x.matches(i))return;let v=x.value,R=!1,k=Rr(x)||"";k==="radio"||k==="checkbox"?R=x.checked:(a[S.toLowerCase()]||a[k])&&(v=Er({element:x,maskInputOptions:a,tagName:S,type:k,value:v,maskInputFn:c})),p(x,l?{text:v,isChecked:R,userTriggered:E}:{text:v,isChecked:R});let O=x.name;k==="radio"&&O&&R&&t.querySelectorAll(`input[type="radio"][name="${O}"]`).forEach(M=>{if(M!==x){let _=M.value;p(M,l?{text:_,isChecked:!R,userTriggered:!1}:{text:_,isChecked:!R})}})}function p(w,x){let E=Ma.get(w);if(!E||E.text!==x.text||E.isChecked!==x.isChecked){Ma.set(w,x);let S=r.getId(w);K(e)({...x,id:S})}}let m=(u.input==="last"?["change"]:["input","change"]).map(w=>be(w,K(h),t)),f=t.defaultView;if(!f)return()=>{m.forEach(w=>w())};let y=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),b=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return y&&y.set&&m.push(...b.map(w=>Xr(w[0],w[1],{set(){K(h)({target:this,isTrusted:!1})}},!1,f))),K(()=>{m.forEach(w=>w())})}function _r(e){let t=[];function r(n,s){if(br("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||br("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||br("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||br("CSSConditionRule")&&n.parentRule instanceof CSSConditionRule){let i=Array.from(n.parentRule.cssRules).indexOf(n);return s.unshift(i),r(n.parentRule,s)}else if(n.parentStyleSheet){let i=Array.from(n.parentStyleSheet.cssRules).indexOf(n);s.unshift(i)}return s}return r(e,t)}function Ze(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function Dd({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};let s=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:K((l,h,p)=>{let[d,m]=p,{id:f,styleId:y}=Ze(h,t,r.styleMirror);return(f&&f!==-1||y&&y!==-1)&&e({id:f,styleId:y,adds:[{rule:d,index:m}]}),l.apply(h,p)})}),n.CSSStyleSheet.prototype.addRule=function(l,h,p=this.cssRules.length){let d=`${l} { ${h} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[d,p])};let o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:K((l,h,p)=>{let[d]=p,{id:m,styleId:f}=Ze(h,t,r.styleMirror);return(m&&m!==-1||f&&f!==-1)&&e({id:m,styleId:f,removes:[{index:d}]}),l.apply(h,p)})}),n.CSSStyleSheet.prototype.removeRule=function(l){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[l])};let i;n.CSSStyleSheet.prototype.replace&&(i=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(i,{apply:K((l,h,p)=>{let[d]=p,{id:m,styleId:f}=Ze(h,t,r.styleMirror);return(m&&m!==-1||f&&f!==-1)&&e({id:m,styleId:f,replace:d}),l.apply(h,p)})}));let a;n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:K((l,h,p)=>{let[d]=p,{id:m,styleId:f}=Ze(h,t,r.styleMirror);return(m&&m!==-1||f&&f!==-1)&&e({id:m,styleId:f,replaceSync:d}),l.apply(h,p)})}));let c={};wr("CSSGroupingRule")?c.CSSGroupingRule=n.CSSGroupingRule:(wr("CSSMediaRule")&&(c.CSSMediaRule=n.CSSMediaRule),wr("CSSConditionRule")&&(c.CSSConditionRule=n.CSSConditionRule),wr("CSSSupportsRule")&&(c.CSSSupportsRule=n.CSSSupportsRule));let u={};return Object.entries(c).forEach(([l,h])=>{u[l]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(u[l].insertRule,{apply:K((p,d,m)=>{let[f,y]=m,{id:b,styleId:w}=Ze(d.parentStyleSheet,t,r.styleMirror);return(b&&b!==-1||w&&w!==-1)&&e({id:b,styleId:w,adds:[{rule:f,index:[..._r(d),y||0]}]}),p.apply(d,m)})}),h.prototype.deleteRule=new Proxy(u[l].deleteRule,{apply:K((p,d,m)=>{let[f]=m,{id:y,styleId:b}=Ze(d.parentStyleSheet,t,r.styleMirror);return(y&&y!==-1||b&&b!==-1)&&e({id:y,styleId:b,removes:[{index:[..._r(d),f]}]}),p.apply(d,m)})})}),K(()=>{n.CSSStyleSheet.prototype.insertRule=s,n.CSSStyleSheet.prototype.deleteRule=o,i&&(n.CSSStyleSheet.prototype.replace=i),a&&(n.CSSStyleSheet.prototype.replaceSync=a),Object.entries(c).forEach(([l,h])=>{h.prototype.insertRule=u[l].insertRule,h.prototype.deleteRule=u[l].deleteRule})})}function Pl({mirror:e,stylesheetManager:t},r){var n,s,o;let i=null;r.nodeName==="#document"?i=e.getId(r):i=e.getId(z.host(r));let a=r.nodeName==="#document"?(n=r.defaultView)==null?void 0:n.Document:(o=(s=r.ownerDocument)==null?void 0:s.defaultView)==null?void 0:o.ShadowRoot,c=a?.prototype?Object.getOwnPropertyDescriptor(a?.prototype,"adoptedStyleSheets"):void 0;return i===null||i===-1||!a||!c?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var u;return(u=c.get)==null?void 0:u.call(this)},set(u){var l;let h=(l=c.set)==null?void 0:l.call(this,u);if(i!==null&&i!==-1)try{t.adoptStyleSheets(u,i)}catch{}return h}}),K(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))}function Ad({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:s}){let o=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:K((a,c,u)=>{var l;let[h,p,d]=u;if(r.has(h))return o.apply(c,[h,p,d]);let{id:m,styleId:f}=Ze((l=c.parentRule)==null?void 0:l.parentStyleSheet,t,n.styleMirror);return(m&&m!==-1||f&&f!==-1)&&e({id:m,styleId:f,set:{property:h,value:p,priority:d},index:_r(c.parentRule)}),a.apply(c,u)})});let i=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:K((a,c,u)=>{var l;let[h]=u;if(r.has(h))return i.apply(c,[h]);let{id:p,styleId:d}=Ze((l=c.parentRule)==null?void 0:l.parentStyleSheet,t,n.styleMirror);return(p&&p!==-1||d&&d!==-1)&&e({id:p,styleId:d,remove:{property:h},index:_r(c.parentRule)}),a.apply(c,u)})}),K(()=>{s.CSSStyleDeclaration.prototype.setProperty=o,s.CSSStyleDeclaration.prototype.removeProperty=i})}function Td({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:s,doc:o}){let i=K(c=>Zt(K(u=>{let l=nr(u);if(!l||Se(l,t,r,!0))return;let{currentTime:h,volume:p,muted:d,playbackRate:m,loop:f}=l;e({type:c,id:n.getId(l),currentTime:h,volume:p,muted:d,playbackRate:m,loop:f})}),s.media||500)),a=[be("play",i(et.Play),o),be("pause",i(et.Pause),o),be("seeked",i(et.Seeked),o),be("volumechange",i(et.VolumeChange),o),be("ratechange",i(et.RateChange),o)];return K(()=>{a.forEach(c=>c())})}function Ld({fontCb:e,doc:t}){let r=t.defaultView;if(!r)return()=>{};let n=[],s=new WeakMap,o=r.FontFace;r.FontFace=function(c,u,l){let h=new o(c,u,l);return s.set(h,{family:c,buffer:typeof u!="string",descriptors:l,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),h};let i=ut(t.fonts,"add",function(a){return function(c){return setTimeout(K(()=>{let u=s.get(c);u&&(e(u),s.delete(c))}),0),a.apply(this,[c])}});return n.push(()=>{r.FontFace=o}),n.push(i),K(()=>{n.forEach(a=>a())})}function Pd(e){let{doc:t,mirror:r,blockClass:n,blockSelector:s,selectionCb:o}=e,i=!0,a=K(()=>{let c=t.getSelection();if(!c||i&&c?.isCollapsed)return;i=c.isCollapsed||!1;let u=[],l=c.rangeCount||0;for(let h=0;h<l;h++){let p=c.getRangeAt(h),{startContainer:d,startOffset:m,endContainer:f,endOffset:y}=p;Se(d,n,s,!0)||Se(f,n,s,!0)||u.push({start:r.getId(d),startOffset:m,end:r.getId(f),endOffset:y})}o({ranges:u})});return a(),be("selectionchange",a)}function _d({doc:e,customElementCb:t}){let r=e.defaultView;return!r||!r.customElements?()=>{}:ut(r.customElements,"define",function(s){return function(o,i,a){try{t({define:{name:o}})}catch{console.warn(`Custom element callback failed for ${o}`)}return s.apply(this,[o,i,a])}})}function $d(e,t){let{mutationCb:r,mousemoveCb:n,mouseInteractionCb:s,scrollCb:o,viewportResizeCb:i,inputCb:a,mediaInteractionCb:c,styleSheetRuleCb:u,styleDeclarationCb:l,canvasMutationCb:h,fontCb:p,selectionCb:d,customElementCb:m}=e;e.mutationCb=(...f)=>{t.mutation&&t.mutation(...f),r(...f)},e.mousemoveCb=(...f)=>{t.mousemove&&t.mousemove(...f),n(...f)},e.mouseInteractionCb=(...f)=>{t.mouseInteraction&&t.mouseInteraction(...f),s(...f)},e.scrollCb=(...f)=>{t.scroll&&t.scroll(...f),o(...f)},e.viewportResizeCb=(...f)=>{t.viewportResize&&t.viewportResize(...f),i(...f)},e.inputCb=(...f)=>{t.input&&t.input(...f),a(...f)},e.mediaInteractionCb=(...f)=>{t.mediaInteaction&&t.mediaInteaction(...f),c(...f)},e.styleSheetRuleCb=(...f)=>{t.styleSheetRule&&t.styleSheetRule(...f),u(...f)},e.styleDeclarationCb=(...f)=>{t.styleDeclaration&&t.styleDeclaration(...f),l(...f)},e.canvasMutationCb=(...f)=>{t.canvasMutation&&t.canvasMutation(...f),h(...f)},e.fontCb=(...f)=>{t.font&&t.font(...f),p(...f)},e.selectionCb=(...f)=>{t.selection&&t.selection(...f),d(...f)},e.customElementCb=(...f)=>{t.customElement&&t.customElement(...f),m(...f)}}function Fd(e,t={}){let r=e.doc.defaultView;if(!r)return()=>{};$d(e,t);let n;e.recordDOM&&(n=Tl(e,e.doc));let s=kd(e),o=Md(e),i=Ll(e),a=Nd(e,{win:r}),c=Id(e),u=Td(e),l=()=>{},h=()=>{},p=()=>{},d=()=>{};e.recordDOM&&(l=Dd(e,{win:r}),h=Pl(e,e.doc),p=Ad(e,{win:r}),e.collectFonts&&(d=Ld(e)));let m=Pd(e),f=_d(e),y=[];for(let b of e.plugins)y.push(b.observer(b.callback,r,b.options));return K(()=>{n?.(),s(),o(),i(),a(),c(),u(),l(),h(),p(),d(),m(),f(),y.forEach(b=>b())})}function br(e){return typeof window[e]<"u"}function wr(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var $r=class{constructor(t){N(this,"iframeIdToRemoteIdMap",new WeakMap),N(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,r,n,s){let o=n||this.getIdToRemoteIdMap(t),i=s||this.getRemoteIdToIdMap(t),a=o.get(r);return a||(a=this.generateIdFn(),o.set(r,a),i.set(a,r)),a}getIds(t,r){let n=this.getIdToRemoteIdMap(t),s=this.getRemoteIdToIdMap(t);return r.map(o=>this.getId(t,o,n,s))}getRemoteId(t,r,n){let s=n||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;let o=s.get(r);return o||-1}getRemoteIds(t,r){let n=this.getRemoteIdToIdMap(t);return r.map(s=>this.getRemoteId(t,s,n))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}},zs=class{constructor(t){N(this,"iframes",new WeakMap),N(this,"crossOriginIframeMap",new WeakMap),N(this,"crossOriginIframeMirror",new $r(Ga)),N(this,"crossOriginIframeStyleMirror"),N(this,"crossOriginIframeRootIdMap",new WeakMap),N(this,"mirror"),N(this,"mutationCb"),N(this,"wrappedEmit"),N(this,"loadListener"),N(this,"unloadListener"),N(this,"attachedWindows",new Map),N(this,"messageHandler",r=>this.handleMessage(r)),N(this,"stylesheetManager"),N(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new $r(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}addUnloadListener(t){this.unloadListener=t}attachIframe(t,r){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.watchIframeWindow(t),(n=this.loadListener)==null||n.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}destroy(){window.removeEventListener("message",this.messageHandler),this.attachedWindows.forEach(t=>t())}watchIframeWindow(t){let r=t.contentWindow;if(!r||this.attachedWindows.has(r))return;let n=[],s=()=>{this.attachedWindows.delete(r),n.forEach(o=>{try{o()}catch{}})};this.attachedWindows.set(r,s),this.recordCrossOriginIframes&&n.push(be("message",this.messageHandler,r)),n.push(be("pagehide",o=>{var i;if(o.persisted)return;let a=r.document;s(),(i=this.unloadListener)==null||i.call(this,a)},r))}handleMessage(t){let r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin||!t.source)return;let s=this.crossOriginIframeMap.get(t.source);if(!s)return;let o=this.transformCrossOriginEvent(s,r.data.event);o&&this.wrappedEmit(o,r.data.isCheckout)}transformCrossOriginEvent(t,r){var n;switch(r.type){case $.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);let s=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,s),this.patchRootIdOnNode(r.data.node,s),{timestamp:r.timestamp,type:$.IncrementalSnapshot,data:{source:L.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case $.Meta:case $.Load:case $.DomContentLoaded:return!1;case $.Annotation:case $.Plugin:return r;case $.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case $.IncrementalSnapshot:switch(r.data.source){case L.Mutation:return r.data.adds.forEach(s=>{this.replaceIds(s,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(s.node,t);let o=this.crossOriginIframeRootIdMap.get(t);o&&this.patchRootIdOnNode(s.node,o)}),r.data.removes.forEach(s=>{this.replaceIds(s,t,["parentId","id"])}),r.data.attributes.forEach(s=>{this.replaceIds(s,t,["id"])}),r.data.texts.forEach(s=>{this.replaceIds(s,t,["id"])}),r;case L.Drag:case L.TouchMove:case L.MouseMove:return r.data.positions.forEach(s=>{this.replaceIds(s,t,["id"])}),r;case L.ViewportResize:return!1;case L.MediaInteraction:case L.MouseInteraction:case L.Scroll:case L.CanvasMutation:case L.Input:return this.replaceIds(r.data,t,["id"]),r;case L.StyleSheetRule:case L.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case L.Font:return r;case L.Selection:return r.data.ranges.forEach(s=>{this.replaceIds(s,t,["start","end"])}),r;case L.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)==null||n.forEach(s=>{this.replaceStyleIds(s,t,["styleId"])}),r}}return!1}replace(t,r,n,s){for(let o of s)!Array.isArray(r[o])&&typeof r[o]!="number"||(Array.isArray(r[o])?r[o]=t.getIds(n,r[o]):r[o]=t.getId(n,r[o]));return r}replaceIds(t,r,n){return this.replace(this.crossOriginIframeMirror,t,r,n)}replaceStyleIds(t,r,n){return this.replace(this.crossOriginIframeStyleMirror,t,r,n)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r)})}patchRootIdOnNode(t,r){t.type!==Ge.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r)})}},Ws=class{constructor(t){N(this,"shadowDoms",new Map),N(this,"mutationCb"),N(this,"scrollCb"),N(this,"bypassOptions"),N(this,"mirror"),N(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,r){if(!Gt(t)||this.shadowDoms.has(t))return;let n=[];this.shadowDoms.set(t,n);let s=Tl({...this.bypassOptions,doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);n.push(s),n.push(Ll({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),setTimeout(()=>{this.shadowDoms.get(t)===n&&(t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(z.host(t))),n.push(Pl({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)))},0)}removeShadowRootsIn(t){if(this.shadowDoms.size===0)return;let r=z.shadowRoot(t);r&&(this.shadowDoms.has(r)&&this.removeShadowRoot(r),this.removeShadowRootsIn(r)),z.childNodes(t).forEach(n=>this.removeShadowRootsIn(n))}removeShadowRoot(t){let r=this.shadowDoms.get(t);this.shadowDoms.delete(t),r?.forEach(ws)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,r){let n=this;this.restoreHandlers.push(ut(t.prototype,"attachShadow",function(s){return function(o){let i=s.call(this,o),a=z.shadowRoot(this);return a&&qs(this)&&n.addShadowRoot(a,r),i}}))}reset(){this.restoreHandlers.forEach(ws),this.restoreHandlers=[];let t=this.shadowDoms;this.shadowDoms=new Map,t.forEach(r=>r.forEach(ws))}};function ws(e){try{e()}catch{}}var bt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Vt=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(qt=0;qt<bt.length;qt++)Vt[bt.charCodeAt(qt)]=qt;var qt,Ud=function(e){var t=new Uint8Array(e),r,n=t.length,s="";for(r=0;r<n;r+=3)s+=bt[t[r]>>2],s+=bt[(t[r]&3)<<4|t[r+1]>>4],s+=bt[(t[r+1]&15)<<2|t[r+2]>>6],s+=bt[t[r+2]&63];return n%3===2?s=s.substring(0,s.length-1)+"=":n%3===1&&(s=s.substring(0,s.length-2)+"=="),s},qd=function(e){var t=e.length*.75,r=e.length,n,s=0,o,i,a,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var u=new ArrayBuffer(t),l=new Uint8Array(u);for(n=0;n<r;n+=4)o=Vt[e.charCodeAt(n)],i=Vt[e.charCodeAt(n+1)],a=Vt[e.charCodeAt(n+2)],c=Vt[e.charCodeAt(n+3)],l[s++]=o<<2|i>>4,l[s++]=(i&15)<<4|a>>2,l[s++]=(a&3)<<6|c&63;return u},Na=new Map;function Bd(e,t){let r=Na.get(e);return r||(r=new Map,Na.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}var _l=(e,t,r)=>{if(!e||!(Fl(e,t)||typeof e=="object"))return;let n=e.constructor.name,s=Bd(r,n),o=s.indexOf(e);return o===-1&&(o=s.length,s.push(e)),o};function Sr(e,t,r){if(e instanceof Array)return e.map(n=>Sr(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){let n=e.constructor.name,s=Ud(e);return{rr_type:n,base64:s}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Sr(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let n=e.constructor.name,{src:s}=e;return{rr_type:n,src:s}}else if(e instanceof HTMLCanvasElement){let n="HTMLImageElement",s=e.toDataURL();return{rr_type:n,src:s}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Sr(e.data,t,r),e.width,e.height]};if(Fl(e,t)||typeof e=="object"){let n=e.constructor.name,s=_l(e,t,r);return{rr_type:n,index:s}}}}return e}var $l=(e,t,r)=>e.map(n=>Sr(n,t,r)),Fl=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(s=>typeof t[s]=="function").find(s=>e instanceof t[s]);function jd(e,t,r,n){let s=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let i of o)try{if(typeof t.CanvasRenderingContext2D.prototype[i]!="function")continue;let a=ut(t.CanvasRenderingContext2D.prototype,i,function(c){return function(...u){return Se(this.canvas,r,n,!0)||setTimeout(()=>{let l=$l(u,t,this);e(this.canvas,{type:Je["2D"],property:i,args:l})},0),c.apply(this,u)}});s.push(a)}catch{let a=Xr(t.CanvasRenderingContext2D.prototype,i,{set(c){e(this.canvas,{type:Je["2D"],property:i,args:[c],setter:!0})}});s.push(a)}return()=>{s.forEach(i=>i())}}function zd(e){return e==="experimental-webgl"?"webgl":e}function Oa(e,t,r,n){let s=[];try{let o=ut(e.HTMLCanvasElement.prototype,"getContext",function(i){return function(a,...c){if(!Se(this,t,r,!0)){let u=zd(a);if("__context"in this||(this.__context=u),n&&["webgl","webgl2"].includes(u))if(c[0]&&typeof c[0]=="object"){let l=c[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else c.splice(0,1,{preserveDrawingBuffer:!0})}return i.apply(this,[a,...c])}});s.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(o=>o())}}function Ia(e,t,r,n,s,o){let i=[],a=Object.getOwnPropertyNames(e);for(let c of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(c))try{if(typeof e[c]!="function")continue;let u=ut(e,c,function(l){return function(...h){let p=l.apply(this,h);if(_l(p,o,this),"tagName"in this.canvas&&!Se(this.canvas,n,s,!0)){let d=$l(h,o,this),m={type:t,property:c,args:d};r(this.canvas,m)}return p}});i.push(u)}catch{let u=Xr(e,c,{set(l){r(this.canvas,{type:t,property:c,args:[l],setter:!0})}});i.push(u)}return i}function Wd(e,t,r,n){let s=[];return typeof t.WebGLRenderingContext<"u"&&s.push(...Ia(t.WebGLRenderingContext.prototype,Je.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext<"u"&&s.push(...Ia(t.WebGL2RenderingContext.prototype,Je.WebGL2,e,r,n,t)),()=>{s.forEach(o=>o())}}var Ul=`(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = \\`\\${width}-\\${height}\\`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n`,Da=typeof self<"u"&&self.Blob&&new Blob([Ul],{type:"text/javascript;charset=utf-8"});function Vd(e){let t;try{if(t=Da&&(self.URL||self.webkitURL).createObjectURL(Da),!t)throw"";let r=new Worker(t,{name:e?.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Ul),{name:e?.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var Vs=class{constructor(t){N(this,"pendingCanvasMutations",new Map),N(this,"rafStamps",{latestId:0,invokeId:null}),N(this,"mirror"),N(this,"mutationCb"),N(this,"resetObservers"),N(this,"frozen",!1),N(this,"locked",!1),N(this,"processMutation",(c,u)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(c)||this.pendingCanvasMutations.set(c,[]),this.pendingCanvasMutations.get(c).push(u)});let{sampling:r="all",win:n,blockClass:s,blockSelector:o,recordCanvas:i,dataURLOptions:a}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,i&&r==="all"&&this.initCanvasMutationObserver(n,s,o),i&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,s,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(t,r,n,s,o){let i=Oa(r,n,s,!0),a=new Map,c=new Vd;c.onmessage=m=>{let{id:f}=m.data;if(a.set(f,!1),!("base64"in m.data))return;let{base64:y,type:b,width:w,height:x}=m.data;this.mutationCb({id:f,type:Je["2D"],commands:[{property:"clearRect",args:[0,0,w,x]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:y}],type:b}]},0,0]}]})};let u=1e3/t,l=0,h,p=()=>{let m=[];return r.document.querySelectorAll("canvas").forEach(f=>{Se(f,n,s,!0)||m.push(f)}),m},d=m=>{if(l&&m-l<u){h=requestAnimationFrame(d);return}l=m,p().forEach(async f=>{var y;let b=this.mirror.getId(f);if(a.get(b)||f.width===0||f.height===0)return;if(a.set(b,!0),["webgl","webgl2"].includes(f.__context)){let x=f.getContext(f.__context);((y=x?.getContextAttributes())==null?void 0:y.preserveDrawingBuffer)===!1&&x.clear(x.COLOR_BUFFER_BIT)}let w=await createImageBitmap(f);c.postMessage({id:b,bitmap:w,width:f.width,height:f.height,dataURLOptions:o.dataURLOptions},[w])}),h=requestAnimationFrame(d)};h=requestAnimationFrame(d),this.resetObservers=()=>{i(),cancelAnimationFrame(h)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let s=Oa(t,r,n,!1),o=jd(this.processMutation.bind(this),t,r,n),i=Wd(this.processMutation.bind(this),t,r,n);this.resetObservers=()=>{s(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{let n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;let s=n.map(i=>{let{type:a,...c}=i;return c}),{type:o}=n[0];this.mutationCb({id:r,type:o,commands:s}),this.pendingCanvasMutations.delete(t)}},Hs=class{constructor(t){N(this,"trackedLinkElements",new WeakSet),N(this,"mutationCb"),N(this,"adoptedStyleSheetCb"),N(this,"styleMirror",new Pr),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;let n={id:r,styleIds:[]},s=[];for(let o of t){let i;this.styleMirror.has(o)?i=this.styleMirror.getId(o):(i=this.styleMirror.add(o),s.push({styleId:i,rules:Array.from(o.rules||CSSRule,(a,c)=>({rule:Wa(a,o.href),index:c}))})),n.styleIds.push(i)}s.length>0&&(n.styles=s),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}},Gs=class{constructor(){N(this,"nodeMap",new WeakMap),N(this,"active",!1)}inOtherBuffer(t,r){let n=this.nodeMap.get(t);return n&&Array.from(n).some(s=>s!==r)}add(t,r){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}destroy(){}},pe,Cr,Qe,er=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((Qi=e.contentWindow)==null?void 0:Qi.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var Te=Va();function rt(e={}){let{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:i="rr-ignore",ignoreSelector:a=null,maskTextClass:c="rr-mask",maskTextSelector:u=null,inlineStylesheet:l=!0,maskAllInputs:h,maskInputOptions:p,slimDOMOptions:d,maskInputFn:m,maskTextFn:f,hooks:y,packFn:b,sampling:w={},dataURLOptions:x={},mousemoveWait:E,recordDOM:S=!0,recordCanvas:v=!1,recordCrossOriginIframes:R=!1,recordAfter:k=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:O=!1,collectFonts:M=!1,inlineImages:_=!1,plugins:D,keepIframeSrcFn:C=()=>!1,ignoreCSSAttributes:A=new Set([]),errorHandler:G}=e;Ed(G);let F=R?window.parent===window:!0,P=!1;if(!F)try{window.parent.document&&(P=!1)}catch{P=!0}if(F&&!t)throw new Error("emit function is required");if(!F&&!P)return()=>{};E!==void 0&&w.mousemove===void 0&&(w.mousemove=E),Te.reset();let B=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}:p!==void 0?p:{password:!0},me=Xa(d);Ml();let ie,ee=0,Ke=j=>{for(let ge of D||[])ge.eventProcessor&&(j=ge.eventProcessor(j));return b&&!P&&(j=b(j)),j};pe=(j,ge)=>{let W=j;if(W.timestamp=Qt(),W.type!==$.FullSnapshot&&!(W.type===$.IncrementalSnapshot&&W.data.source===L.Mutation)){Qe.unfreeze();for(let Ce of xt)if(Ce.isFrozen())Ce.unfreeze();else break}if(F)t?.(Ke(W),ge);else if(P){let Ce={type:"rrweb",event:Ke(W),origin:window.location.origin,isCheckout:ge};window.parent.postMessage(Ce,"*")}if(W.type===$.FullSnapshot)ie=W,ee=0;else if(W.type===$.IncrementalSnapshot){if(W.data.source===L.Mutation&&W.data.isAttachIframe)return;ee++;let Ce=n&&ee>=n,Ae=r&&W.timestamp-ie.timestamp>r;(Ce||Ae)&&Cr(!0)}};let I=j=>{pe({type:$.IncrementalSnapshot,data:{source:L.Mutation,...j}})},qe=j=>pe({type:$.IncrementalSnapshot,data:{source:L.Scroll,...j}}),De=j=>pe({type:$.IncrementalSnapshot,data:{source:L.CanvasMutation,...j}}),kt=j=>pe({type:$.IncrementalSnapshot,data:{source:L.AdoptedStyleSheet,...j}}),xe=new Hs({mutationCb:I,adoptedStyleSheetCb:kt}),ke=new zs({mirror:Te,mutationCb:I,stylesheetManager:xe,recordCrossOriginIframes:R,wrappedEmit:pe});for(let j of D||[])j.getMirror&&j.getMirror({nodeMirror:Te,crossOriginIframeMirror:ke.crossOriginIframeMirror,crossOriginIframeStyleMirror:ke.crossOriginIframeStyleMirror});let nt=new Gs;Qe=new Vs({recordCanvas:v,mutationCb:De,win:window,blockClass:s,blockSelector:o,mirror:Te,sampling:w.canvas,dataURLOptions:x});let Be=new Ws({mutationCb:I,scrollCb:qe,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:c,maskTextSelector:u,inlineStylesheet:l,maskInputOptions:B,dataURLOptions:x,maskTextFn:f,maskInputFn:m,recordCanvas:v,inlineImages:_,sampling:w,slimDOMOptions:me,iframeManager:ke,stylesheetManager:xe,canvasManager:Qe,keepIframeSrcFn:C,processedNodeManager:nt},mirror:Te});Cr=(j=!1)=>{if(!S)return;pe({type:$.Meta,data:{href:window.location.href,width:El(),height:Cl()}},j),xe.reset(),Be.init(),Qe.lock(),xt.forEach(W=>W.lock());let ge=ku(document,{mirror:Te,blockClass:s,blockSelector:o,maskTextClass:c,maskTextSelector:u,inlineStylesheet:l,maskAllInputs:B,maskTextFn:f,maskInputFn:m,slimDOM:me,dataURLOptions:x,recordCanvas:v,inlineImages:_,onSerialize:W=>{Jt(W,Te)&&ke.addIframe(W),Ol(W,Te)&&xe.trackLinkElement(W),at(W)&&Be.addShadowRoot(z.shadowRoot(W),document)},onIframeLoad:(W,Ce)=>{ke.attachIframe(W,Ce),Be.observeAttachShadow(W)},onStylesheetLoad:(W,Ce)=>{xe.attachLinkElement(W,Ce)},keepIframeSrcFn:C});if(!ge)return console.warn("Failed to snapshot the document");pe({type:$.FullSnapshot,data:{node:ge,initialOffset:Sl(window)}},j),Qe.unlock(),xt.forEach(W=>W.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&xe.adoptStyleSheets(document.adoptedStyleSheets,Te.getId(document))};try{let j=[],ge=Ae=>{var Ee;return K(Fd)({mutationCb:I,mousemoveCb:(re,Zr)=>pe({type:$.IncrementalSnapshot,data:{source:Zr,positions:re}}),mouseInteractionCb:re=>pe({type:$.IncrementalSnapshot,data:{source:L.MouseInteraction,...re}}),scrollCb:qe,viewportResizeCb:re=>pe({type:$.IncrementalSnapshot,data:{source:L.ViewportResize,...re}}),inputCb:re=>pe({type:$.IncrementalSnapshot,data:{source:L.Input,...re}}),mediaInteractionCb:re=>pe({type:$.IncrementalSnapshot,data:{source:L.MediaInteraction,...re}}),styleSheetRuleCb:re=>pe({type:$.IncrementalSnapshot,data:{source:L.StyleSheetRule,...re}}),styleDeclarationCb:re=>pe({type:$.IncrementalSnapshot,data:{source:L.StyleDeclaration,...re}}),canvasMutationCb:De,fontCb:re=>pe({type:$.IncrementalSnapshot,data:{source:L.Font,...re}}),selectionCb:re=>{pe({type:$.IncrementalSnapshot,data:{source:L.Selection,...re}})},customElementCb:re=>{pe({type:$.IncrementalSnapshot,data:{source:L.CustomElement,...re}})},blockClass:s,ignoreClass:i,ignoreSelector:a,maskTextClass:c,maskTextSelector:u,maskInputOptions:B,inlineStylesheet:l,sampling:w,recordDOM:S,recordCanvas:v,inlineImages:_,userTriggeredOnInput:O,collectFonts:M,doc:Ae,maskInputFn:m,maskTextFn:f,keepIframeSrcFn:C,blockSelector:o,slimDOMOptions:me,dataURLOptions:x,mirror:Te,iframeManager:ke,stylesheetManager:xe,shadowDomManager:Be,processedNodeManager:nt,canvasManager:Qe,ignoreCSSAttributes:A,plugins:((Ee=D?.filter(re=>re.observer))==null?void 0:Ee.map(re=>({observer:re.observer,options:re.options,callback:Zr=>pe({type:$.Plugin,data:{plugin:re.name,payload:Zr}})})))||[]},y)},W=new Map;ke.addLoadListener(Ae=>{try{let Ee=Ae.contentDocument;if(W.has(Ee))return;W.set(Ee,ge(Ee))}catch(Ee){console.warn(Ee)}}),ke.addUnloadListener(Ae=>{let Ee=W.get(Ae);Ee&&(W.delete(Ae),Ee(),Be.removeShadowRootsIn(Ae),Te.removeNodeFromMap(Ae))});let Ce=()=>{Cr(),j.push(ge(document)),er=!0};return["interactive","complete"].includes(document.readyState)?Ce():(j.push(be("DOMContentLoaded",()=>{pe({type:$.DomContentLoaded,data:{}}),k==="DOMContentLoaded"&&Ce()})),j.push(be("load",()=>{pe({type:$.Load,data:{}}),k==="load"&&Ce()},window))),()=>{[...j,...W.values()].forEach(Ae=>{try{Ae()}catch(Ee){String(Ee).toLowerCase().includes("cross-origin")||console.warn(Ee)}}),W.clear(),ke.destroy(),nt.destroy(),Be.reset(),Qe.reset(),er=!1,Rd()}}catch(j){console.warn(j)}}rt.addCustomEvent=(e,t)=>{if(!er)throw new Error("please add custom event after start recording");pe({type:$.Custom,data:{tag:e,payload:t}})};rt.addAnnotation=e=>{if(!er)throw new Error("please add annotation after recording started");pe({type:$.Annotation,data:e})};rt.freezePage=()=>{Qe.freeze(),xt.forEach(e=>e.freeze())};rt.takeFullSnapshot=e=>{if(!er)throw new Error("please take full snapshot after start recording");Cr(e)};rt.mirror=Te;function Hd(e){return{all:e=e||new Map,on:function(t,r){var n=e.get(t);n?n.push(r):e.set(t,[r])},off:function(t,r){var n=e.get(t);n&&(r?n.splice(n.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var n=e.get(t);n&&n.slice().map(function(s){s(r)}),(n=e.get("*"))&&n.slice().map(function(s){s(t,r)})}}}function Gd(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;let r=e.HTMLElement||e.Element,n=468,s={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||c,scrollIntoView:r.prototype.scrollIntoView},o=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function i(b){let w=["MSIE ","Trident/","Edge/"];return new RegExp(w.join("|")).test(b)}let a=i(e.navigator.userAgent)?1:0;function c(b,w){this.scrollLeft=b,this.scrollTop=w}function u(b){return .5*(1-Math.cos(Math.PI*b))}function l(b){if(b===null||typeof b!="object"||b.behavior===void 0||b.behavior==="auto"||b.behavior==="instant")return!0;if(typeof b=="object"&&b.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+b.behavior+" is not a valid value for enumeration ScrollBehavior.")}function h(b,w){if(w==="Y")return b.clientHeight+a<b.scrollHeight;if(w==="X")return b.clientWidth+a<b.scrollWidth}function p(b,w){let x=e.getComputedStyle(b,null)["overflow"+w];return x==="auto"||x==="scroll"}function d(b){let w=h(b,"Y")&&p(b,"Y"),x=h(b,"X")&&p(b,"X");return w||x}function m(b){for(;b!==t.body&&d(b)===!1;)b=b.parentNode||b.host;return b}function f(b){let w=o(),x,E,S,v=(w-b.startTime)/n;v=v>1?1:v,x=u(v),E=b.startX+(b.x-b.startX)*x,S=b.startY+(b.y-b.startY)*x,b.method.call(b.scrollable,E,S),(E!==b.x||S!==b.y)&&e.requestAnimationFrame(f.bind(e,b))}function y(b,w,x){let E,S,v,R,k=o();b===t.body?(E=e,S=e.scrollX||e.pageXOffset,v=e.scrollY||e.pageYOffset,R=s.scroll):(E=b,S=b.scrollLeft,v=b.scrollTop,R=c),f({scrollable:E,method:R,startTime:k,startX:S,startY:v,x:w,y:x})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(l(arguments[0])===!0){s.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset);return}y.call(e,t.body,arguments[0].left!==void 0?~~arguments[0].left:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:e.scrollY||e.pageYOffset)}},e.scrollBy=function(){if(arguments[0]!==void 0){if(l(arguments[0])){s.scrollBy.call(e,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}y.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset))}},r.prototype.scroll=r.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(l(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");s.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}let b=arguments[0].left,w=arguments[0].top;y.call(this,this,typeof b>"u"?this.scrollLeft:~~b,typeof w>"u"?this.scrollTop:~~w)},r.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(l(arguments[0])===!0){s.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})}},r.prototype.scrollIntoView=function(){if(l(arguments[0])===!0){s.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}let b=m(this),w=b.getBoundingClientRect(),x=this.getBoundingClientRect();b!==t.body?(y.call(this,b,b.scrollLeft+x.left-w.left,b.scrollTop+x.top-w.top),e.getComputedStyle(b).position!=="fixed"&&e.scrollBy({left:w.left,top:w.top,behavior:"smooth"})):e.scrollBy({left:x.left,top:x.top,behavior:"smooth"})}}var Ys=class{constructor(t=[],r){N(this,"timeOffset",0),N(this,"speed"),N(this,"actions"),N(this,"raf",null),N(this,"lastTimestamp"),this.actions=t,this.speed=r.speed}addAction(t){let r=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=t.delay)this.actions.push(t);else{let n=this.findActionIndex(t);this.actions.splice(n,0,t)}r&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}updateLiveTime(){this.raf===!0&&this.rafCheck()}rafCheck(){let t=performance.now();for(this.timeOffset+=(t-this.lastTimestamp)*this.speed,this.lastTimestamp=t;this.actions.length;){let r=this.actions[0];if(this.timeOffset>=r.delay)this.actions.shift(),r.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(t){this.speed=t}isActive(){return this.raf!==null}findActionIndex(t){let r=0,n=this.actions.length-1;for(;r<=n;){let s=Math.floor((r+n)/2);if(this.actions[s].delay<t.delay)r=s+1;else if(this.actions[s].delay>t.delay)n=s-1;else return s+1}return r}};function Aa(e,t){if(e.type===$.IncrementalSnapshot&&e.data.source===L.MouseMove&&e.data.positions&&e.data.positions.length){let r=e.data.positions[0].timeOffset,n=e.timestamp+r;return e.delay=n-t,n-t}return e.delay=e.timestamp-t,e.delay}function Ta(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n,s,o=r.call(e),i=[];try{for(;(t===void 0||t-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(a){s={error:a}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(s)throw s.error}}return i}var wt;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(wt||(wt={}));var ql={type:"xstate.init"};function xs(e){return e===void 0?[]:[].concat(e)}function gt(e){return{type:"xstate.assign",assignment:e}}function La(e,t){return typeof(e=typeof e=="string"&&t&&t[e]?t[e]:e)=="string"?{type:e}:typeof e=="function"?{type:e.name,exec:e}:e}function Fr(e){return function(t){return e===t}}function Bl(e){return typeof e=="string"?{type:e}:e}function Pa(e,t){return{value:e,context:t,actions:[],changed:!1,matches:Fr(e)}}function _a(e,t,r){var n=t,s=!1;return[e.filter(function(o){if(o.type==="xstate.assign"){s=!0;var i=Object.assign({},n);return typeof o.assignment=="function"?i=o.assignment(n,r):Object.keys(o.assignment).forEach(function(a){i[a]=typeof o.assignment[a]=="function"?o.assignment[a](n,r):o.assignment[a]}),n=i,!1}return!0}),n,s]}function jl(e,t){t===void 0&&(t={});var r=Ta(_a(xs(e.states[e.initial].entry).map(function(i){return La(i,t.actions)}),e.context,ql),2),n=r[0],s=r[1],o={config:e,_options:t,initialState:{value:e.initial,actions:n,context:s,matches:Fr(e.initial)},transition:function(i,a){var c,u,l=typeof i=="string"?{value:i,context:e.context}:i,h=l.value,p=l.context,d=Bl(a),m=e.states[h];if(m.on){var f=xs(m.on[d.type]);try{for(var y=(function(P){var B=typeof Symbol=="function"&&Symbol.iterator,me=B&&P[B],ie=0;if(me)return me.call(P);if(P&&typeof P.length=="number")return{next:function(){return P&&ie>=P.length&&(P=void 0),{value:P&&P[ie++],done:!P}}};throw new TypeError(B?"Object is not iterable.":"Symbol.iterator is not defined.")})(f),b=y.next();!b.done;b=y.next()){var w=b.value;if(w===void 0)return Pa(h,p);var x=typeof w=="string"?{target:w}:w,E=x.target,S=x.actions,v=S===void 0?[]:S,R=x.cond,k=R===void 0?function(){return!0}:R,O=E===void 0,M=E??h,_=e.states[M];if(k(p,d)){var D=Ta(_a((O?xs(v):[].concat(m.exit,v,_.entry).filter(function(P){return P})).map(function(P){return La(P,o._options.actions)}),p,d),3),C=D[0],A=D[1],G=D[2],F=E??h;return{value:F,context:A,actions:C,changed:E!==h||C.length>0||G,matches:Fr(F)}}}}catch(P){c={error:P}}finally{try{b&&!b.done&&(u=y.return)&&u.call(y)}finally{if(c)throw c.error}}}return Pa(h,p)}};return o}var $a=function(e,t){return e.actions.forEach(function(r){var n=r.exec;return n&&n(e.context,t)})};function zl(e){var t=e.initialState,r=wt.NotStarted,n=new Set,s={_machine:e,send:function(o){r===wt.Running&&(t=e.transition(t,o),$a(t,Bl(o)),n.forEach(function(i){return i(t)}))},subscribe:function(o){return n.add(o),o(t),{unsubscribe:function(){return n.delete(o)}}},start:function(o){if(o){var i=typeof o=="object"?o:{context:e.config.context,value:o};t={value:i.value,actions:[],context:i.context,matches:Fr(i.value)}}return r=wt.Running,$a(t,ql),s},stop:function(){return r=wt.Stopped,n.clear(),s},get state(){return t},get status(){return r}};return s}function Yd(e,t){for(let r=e.length-1;r>=0;r--){let n=e[r];if(n.type===$.Meta&&n.timestamp<=t)return e.slice(r)}return e}function Jd(e,{getCastFn:t,applyEventsSynchronously:r,emitter:n}){let s=jl({id:"player",context:e,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:gt({lastPlayedEvent:(o,i)=>i.type==="CAST_EVENT"?i.payload.event:o.lastPlayedEvent}),recordTimeOffset:gt((o,i)=>{let a=o.timeOffset;return"payload"in i&&"timeOffset"in i.payload&&(a=i.payload.timeOffset),{...o,timeOffset:a,baselineTime:o.events[0].timestamp+a}}),play(o){var i;let{timer:a,events:c,baselineTime:u,lastPlayedEvent:l}=o;a.clear();for(let m of c)Aa(m,u);let h=Yd(c,u),p=l?.timestamp;l?.type===$.IncrementalSnapshot&&l.data.source===L.MouseMove&&(p=l.timestamp+((i=l.data.positions[0])==null?void 0:i.timeOffset)),u<(p||0)&&n.emit(X.PlayBack);let d=new Array;for(let m of h)if(!(p&&p<u&&(m.timestamp<=p||m===l)))if(m.timestamp<u)d.push(m);else{let f=t(m,!1);a.addAction({doAction:()=>{f()},delay:m.delay})}r(d),n.emit(X.Flush),a.start()},pause(o){o.timer.clear()},resetLastPlayedEvent:gt(o=>({...o,lastPlayedEvent:null})),startLive:gt({baselineTime:(o,i)=>(o.timer.start(),i.type==="TO_LIVE"&&i.payload.baselineTime?i.payload.baselineTime:Date.now())}),addEvent:gt((o,i)=>{let{baselineTime:a,timer:c,events:u}=o;if(i.type==="ADD_EVENT"){let{event:l}=i.payload;Aa(l,a);let h=u.length-1;if(!u[h]||u[h].timestamp<=l.timestamp)u.push(l);else{let m=-1,f=0;for(;f<=h;){let y=Math.floor((f+h)/2);u[y].timestamp<=l.timestamp?f=y+1:h=y-1}m===-1&&(m=f),u.splice(m,0,l)}let p=l.timestamp<a,d=t(l,p);p?d():c.isActive()&&c.addAction({doAction:()=>{d()},delay:l.delay})}return{...o,events:u}})}});return zl(s)}function Kd(e){let t=jl({id:"speed",context:e,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:(r,n)=>{"payload"in n&&r.timer.setSpeed(n.payload.speed)},recordSpeed:gt({normalSpeed:r=>r.timer.speed}),restoreSpeed:r=>{r.timer.setSpeed(r.normalSpeed)}}});return zl(t)}var Xd=e=>[`.${e} { background: currentColor }`,"noscript { display: none !important; }"],Fa=new Map;function Wl(e,t){let r=Fa.get(e);return r||(r=new Map,Fa.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}function tt(e,t,r){return async n=>{if(n&&typeof n=="object"&&"rr_type"in n)if(r&&(r.isUnchanged=!1),n.rr_type==="ImageBitmap"&&"args"in n){let s=await tt(e,t,r)(n.args);return await createImageBitmap.apply(null,s)}else if("index"in n){if(r||t===null)return n;let{rr_type:s,index:o}=n;return Wl(t,s)[o]}else if("args"in n){let{rr_type:s,args:o}=n,i=window[s];return new i(...await Promise.all(o.map(tt(e,t,r))))}else{if("base64"in n)return qd(n.base64);if("src"in n){let s=e.get(n.src);if(s)return s;{let o=new Image;return o.src=n.src,e.set(n.src,o),o}}else if("data"in n&&n.rr_type==="Blob"){let s=await Promise.all(n.data.map(tt(e,t,r)));return new Blob(s,{type:n.type})}}else if(Array.isArray(n))return await Promise.all(n.map(tt(e,t,r)));return n}}function Qd(e,t){try{return t===Je.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}var Zd=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function eh(e,t){if(!t?.constructor)return;let{name:r}=t.constructor;if(!Zd.includes(r))return;let n=Wl(e,r);n.includes(t)||n.push(t)}async function th({mutation:e,target:t,type:r,imageMap:n,errorHandler:s}){try{let o=Qd(t,r);if(!o)return;if(e.setter){o[e.property]=e.args[0];return}let i=o[e.property],a=await Promise.all(e.args.map(tt(n,o))),c=i.apply(o,a);eh(o,c);let u=!1}catch(o){s(e,o)}}async function rh({event:e,mutations:t,target:r,imageMap:n,errorHandler:s}){let o=r.getContext("2d");if(!o){s(t[0],new Error("Canvas context is null"));return}let i=t.map(async c=>Promise.all(c.args.map(tt(n,o))));(await Promise.all(i)).forEach((c,u)=>{let l=t[u];try{if(l.setter){o[l.property]=l.args[0];return}let h=o[l.property];l.property==="drawImage"&&typeof l.args[0]=="string"?(n.get(e),h.apply(o,l.args)):h.apply(o,c)}catch(h){s(l,h)}})}async function Ua({event:e,mutation:t,target:r,imageMap:n,canvasEventMap:s,errorHandler:o}){try{let i=s.get(e)||t,a="commands"in i?i.commands:[i];if([Je.WebGL,Je.WebGL2].includes(t.type)){for(let c=0;c<a.length;c++){let u=a[c];await th({mutation:u,type:t.type,target:r,imageMap:n,errorHandler:o})}return}await rh({event:e,mutations:a,target:r,imageMap:n,errorHandler:o})}catch(i){o(t,i)}}var Js=class{constructor(t){N(this,"mediaMap",new Map),N(this,"warn"),N(this,"service"),N(this,"speedService"),N(this,"emitter"),N(this,"getCurrentTime"),N(this,"metadataCallbackMap",new Map),this.warn=t.warn,this.service=t.service,this.speedService=t.speedService,this.emitter=t.emitter,this.getCurrentTime=t.getCurrentTime,this.emitter.on(X.Start,this.start.bind(this)),this.emitter.on(X.SkipStart,this.start.bind(this)),this.emitter.on(X.Pause,this.pause.bind(this)),this.emitter.on(X.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(t={pause:!1}){this.mediaMap.forEach((r,n)=>{this.syncTargetWithState(n),t.pause&&n.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:t,target:r,mediaState:n}){if(n.isPlaying){let o=(t-n.lastInteractionTimeOffset)/1e3*n.playbackRate,i="duration"in r&&r.duration;if(Number.isNaN(i)){this.waitForMetadata(r);return}let a=n.currentTimeAtLastInteraction+o;r.loop&&i!==!1&&(a=a%i),r.currentTime=a}else r.pause(),r.currentTime=n.currentTimeAtLastInteraction}waitForMetadata(t){if(this.metadataCallbackMap.has(t)||!("addEventListener"in t))return;let r=()=>{this.metadataCallbackMap.delete(t);let n=this.mediaMap.get(t);n&&this.seekTo({time:this.getCurrentTime(),target:t,mediaState:n})};this.metadataCallbackMap.set(t,r),t.addEventListener("loadedmetadata",r,{once:!0})}getMediaStateFromMutation({target:t,timeOffset:r,mutation:n}){let s=this.mediaMap.get(t),{type:o,playbackRate:i,currentTime:a,muted:c,volume:u,loop:l}=n;return{isPlaying:o===et.Play||o!==et.Pause&&(s?.isPlaying||t.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:a??s?.currentTimeAtLastInteraction??0,lastInteractionTimeOffset:r,playbackRate:i??s?.playbackRate??1,volume:u??s?.volume??1,muted:c??s?.muted??t.getAttribute("muted")===null,loop:l??s?.loop??t.getAttribute("loop")===null}}syncTargetWithState(t){let r=this.mediaMap.get(t);if(!r)return;let{muted:n,loop:s,volume:o,isPlaying:i}=r,a=this.service.state.matches("paused"),c=r.playbackRate*this.speedService.state.context.timer.speed;try{this.seekTo({time:this.getCurrentTime(),target:t,mediaState:r}),t.volume!==o&&(t.volume=o),t.muted=n,t.loop=s,t.playbackRate!==c&&(t.playbackRate=c),i&&!a?t.play():t.pause()}catch(u){this.warn(`Failed to replay media interactions: ${u.message||u}`)}}addMediaElements(t,r,n){if(!["AUDIO","VIDEO"].includes(t.nodeName))return;let s=t,o=n.getMeta(s);if(!o||!("attributes"in o))return;let i=this.service.state.matches("paused"),a=o.attributes,c=!1;a.rr_mediaState?c=a.rr_mediaState==="played":c=s.getAttribute("autoplay")!==null,c&&i&&s.pause();let u=1;typeof a.rr_mediaPlaybackRate=="number"&&(u=a.rr_mediaPlaybackRate);let l=!1;typeof a.rr_mediaMuted=="boolean"?l=a.rr_mediaMuted:l=s.getAttribute("muted")!==null;let h=!1;typeof a.rr_mediaLoop=="boolean"?h=a.rr_mediaLoop:h=s.getAttribute("loop")!==null;let p=1;typeof a.rr_mediaVolume=="number"&&(p=a.rr_mediaVolume);let d=0;typeof a.rr_mediaCurrentTime=="number"&&(d=a.rr_mediaCurrentTime),this.mediaMap.set(s,{isPlaying:c,currentTimeAtLastInteraction:d,lastInteractionTimeOffset:r,playbackRate:u,volume:p,muted:l,loop:h}),this.syncTargetWithState(s)}mediaMutation({target:t,timeOffset:r,mutation:n}){this.mediaMap.set(t,this.getMediaStateFromMutation({target:t,timeOffset:r,mutation:n})),this.syncTargetWithState(t)}isSupportedMediaElement(t){return["AUDIO","VIDEO"].includes(t.nodeName)}reset(){this.mediaMap.clear()}};function xr(e,t){if(e.nodeName!=="DIALOG"||e instanceof Ue)return;let r=e,n=r.open,s=n&&r.matches("dialog:modal"),o=r.getAttribute("rr_open_mode"),i=typeof t?.attributes.open=="string"||typeof r.getAttribute("open")=="string",a=o==="modal";if(!(n&&!(s&&o==="non-modal"||!s&&a))){if(!r.isConnected){console.warn("dialog is not attached to the dom",r);return}n&&r.close(),i&&(a?r.showModal():r.show())}}function nh(e,t){if(e.nodeName!=="DIALOG"||e instanceof Ue)return;let r=e;if(!r.isConnected){console.warn("dialog is not attached to the dom",r);return}t.attributes.open===null&&(r.removeAttribute("open"),r.removeAttribute("rr_open_mode"))}var sh=5*1e3,ih=Hd,qa="[replayer]",Ss={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Ba(e){return e.type==$.IncrementalSnapshot&&(e.data.source==L.TouchMove||e.data.source==L.MouseInteraction&&e.data.type==Q.TouchStart)}var Ur=class{constructor(t,r){if(N(this,"wrapper"),N(this,"iframe"),N(this,"UNSAFE_replayCanvas",!1),N(this,"service"),N(this,"speedService"),N(this,"config"),N(this,"usingVirtualDom",!1),N(this,"virtualDom",new Ct),N(this,"mouse"),N(this,"mouseTail",null),N(this,"tailPositions",[]),N(this,"emitter",ih()),N(this,"nextUserInteractionEvent"),N(this,"legacy_missingNodeRetryMap",{}),N(this,"cache",Fo()),N(this,"imageMap",new Map),N(this,"canvasEventMap",new Map),N(this,"mirror",Va()),N(this,"styleMirror",new Pr),N(this,"mediaManager"),N(this,"firstFullSnapshot",null),N(this,"newDocumentQueue",[]),N(this,"mousePos",null),N(this,"touchActive",null),N(this,"lastMouseDownEvent",null),N(this,"lastHoveredRootNode"),N(this,"lastSelectionData",null),N(this,"constructedStyleMutations",[]),N(this,"adoptedStyleSheets",[]),N(this,"handleResize",a=>{this.iframe.style.display="inherit";for(let c of[this.mouseTail,this.iframe])c&&(c.setAttribute("width",String(a.width)),c.setAttribute("height",String(a.height)))}),N(this,"applyEventsSynchronously",a=>{for(let c of a){switch(c.type){case $.DomContentLoaded:case $.Load:continue;case $.FullSnapshot:case $.Meta:case $.Plugin:case $.IncrementalSnapshot:break}this.getCastFn(c,!0)()}}),N(this,"getCastFn",(a,c=!1)=>{let u;switch(a.type){case $.DomContentLoaded:case $.Load:break;case $.Annotation:u=()=>this.emitter.emit(X.Annotation,a);break;case $.Custom:u=()=>{this.emitter.emit(X.CustomEvent,a)};break;case $.Meta:u=()=>this.emitter.emit(X.Resize,{width:a.data.width,height:a.data.height});break;case $.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,c),(h=this.iframe.contentWindow)==null||h.scrollTo(a.data.initialOffset)};break;case $.IncrementalSnapshot:u=()=>{if(this.applyIncremental(a,c),!c&&(a===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(let 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){let h=this.nextUserInteractionEvent.delay-a.delay,p={speed:Math.min(Math.round(h/sh),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:p}),this.emitter.emit(X.SkipStart,p)}}};break}return()=>{u&&u();for(let p of this.config.plugins||[])p.handler&&p.handler(a,c,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:a}});let h=this.service.state.context.events.length-1;if(!this.config.liveMode&&a===this.service.state.context.events[h]){let p=()=>{h<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(X.Finish))},d=50;a.type===$.IncrementalSnapshot&&a.data.source===L.MouseMove&&a.data.positions.length&&(d+=Math.max(0,-a.data.positions[0].timeOffset)),setTimeout(p,d)}this.emitter.emit(X.EventCast,a)}}),!r?.liveMode&&t.length<2)throw new Error("Replayer need at least 2 events.");let n={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:Ss,useVirtualDom:!0,logger:console};this.config=Object.assign({},n,r),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(X.Resize,this.handleResize),this.setupDom();for(let a of this.config.plugins||[])a.getMirror&&a.getMirror({nodeMirror:this.mirror});this.emitter.on(X.Flush,()=>{if(this.usingVirtualDom){let a={mirror:this.mirror,applyCanvas:(c,u,l)=>{Ua({event:c,mutation:u,target:l,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(c,u)=>{c.source===L.StyleSheetRule?this.applyStyleSheetRule(c,u):c.source===L.StyleDeclaration&&this.applyStyleDeclaration(c,u)},afterAppend:(c,u)=>{for(let l of this.config.plugins||[])l.onBuild&&l.onBuild(c,{id:u,replayer:this})}};if(this.iframe.contentDocument)try{Tr(this.iframe.contentDocument,this.virtualDom,a,this.virtualDom.mirror)}catch(c){this.warn(c)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(let c in this.legacy_missingNodeRetryMap)try{let u=this.legacy_missingNodeRetryMap[c],l=Lr(u.node,this.mirror,this.virtualDom.mirror);Tr(l,u.node,a,this.virtualDom.mirror),u.node=l}catch(u){this.warn(u)}this.constructedStyleMutations.forEach(c=>{this.applyStyleSheetMutation(c)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(c=>{this.applyAdoptedStyleSheet(c)}),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){let[a,c]=this.lastMouseDownEvent;a.dispatchEvent(c)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(X.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()});let s=new Ys([],{speed:this.config.speed});this.service=Jd({events:t.map(a=>r&&r.unpackFn?r.unpackFn(a):a).sort((a,c)=>a.timestamp-c.timestamp),timer:s,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(X.StateChange,{player:a})}),this.speedService=Kd({normalSpeed:-1,timer:s}),this.speedService.start(),this.speedService.subscribe(a=>{this.emitter.emit(X.StateChange,{speed:a})}),this.mediaManager=new Js({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});let o=this.service.state.context.events.find(a=>a.type===$.Meta),i=this.service.state.context.events.find(a=>a.type===$.FullSnapshot);if(o){let{width:a,height:c}=o.data;setTimeout(()=>{this.emitter.emit(X.Resize,{width:a,height:c})},0)}i&&setTimeout(()=>{var a;this.firstFullSnapshot||(this.firstFullSnapshot=i,this.rebuildFullSnapshot(i),(a=this.iframe.contentWindow)==null||a.scrollTo(i.data.initialOffset))},1),this.service.state.context.events.find(Ba)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(t,r){return this.emitter.on(t,r),this}off(t,r){return this.emitter.off(t,r),this}setConfig(t){Object.keys(t).forEach(r=>{t[r],this.config[r]=t[r]}),this.config.skipInactive||this.backToNormal(),typeof t.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:t.speed}}),typeof t.mouseTail<"u"&&(t.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(){let t=this.service.state.context.events[0],r=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:t.timestamp,endTime:r.timestamp,totalTime:r.timestamp-t.timestamp}}getCurrentTime(){return this.config.liveMode&&this.timer.updateLiveTime(),this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){let{baselineTime:t,events:r}=this.service.state.context;return t-r[0].timestamp}getMirror(){return this.mirror}play(t=0){var r,n;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:t}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:t}})),(n=(r=this.iframe.contentDocument)==null?void 0:r.getElementsByTagName("html")[0])==null||n.classList.remove("rrweb-paused"),this.emitter.emit(X.Start)}pause(t){var r,n;t===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof t=="number"&&(this.play(t),this.service.send({type:"PAUSE"})),(n=(r=this.iframe.contentDocument)==null?void 0:r.getElementsByTagName("html")[0])==null||n.classList.add("rrweb-paused"),this.emitter.emit(X.Pause)}resume(t=0){this.warn("The \'resume\' was deprecated in 1.0. Please use \'play\' method which has the same interface."),this.play(t),this.emitter.emit(X.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(X.Destroy)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){let r=this.config.unpackFn?this.config.unpackFn(t):t;Ba(r)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:r}}))}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=Fo()}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.config.UNSAFE_replayCanvas?(this.iframe=document.createElement("iframe"),this.iframe.setAttribute("sandbox","allow-same-origin allow-scripts"),this.wrapper.appendChild(this.iframe),this.UNSAFE_replayCanvas=!0):(this.iframe=Zu({root:this.wrapper}),this.UNSAFE_replayCanvas=!1),this.iframe.style.display="none",this.disableInteract(),this.iframe.contentWindow&&this.iframe.contentDocument&&(Gd(this.iframe.contentWindow,this.iframe.contentDocument),Ml(this.iframe.contentWindow))}rebuildFullSnapshot(t,r=!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={};let n=[],s=new Set,o=(c,u)=>{if(c.nodeName==="DIALOG"&&s.add(c),this.collectIframeAndAttachDocument(n,c),this.mediaManager.isSupportedMediaElement(c)){let{events:l}=this.service.state.context;this.mediaManager.addMediaElements(c,t.timestamp-l[0].timestamp,this.mirror)}for(let l of this.config.plugins||[])l.onBuild&&l.onBuild(c,{id:u,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),Qu(t.data.node,{doc:this.iframe.contentDocument,afterAppend:o,cache:this.cache,mirror:this.mirror,UNSAFE_allowUnprotectedRebuild:this.UNSAFE_replayCanvas}),o(this.iframe.contentDocument,t.data.node.id);for(let{mutationInQueue:c,builtNode:u}of n)this.attachDocumentToIframe(c,u),this.newDocumentQueue=this.newDocumentQueue.filter(l=>l!==c);let{documentElement:i,head:a}=this.iframe.contentDocument;this.insertStyleRules(i,a),s.forEach(c=>xr(c)),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(X.FullsnapshotRebuilded,t),r||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,r){var n;let s=Xd(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&s.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),!!s.length)if(this.usingVirtualDom){let o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,bl(o,this.virtualDom.unserializedId)),t.insertBefore(o,r),o.rules.push({source:L.StyleSheetRule,adds:s.map((i,a)=>({rule:i,index:a}))})}else{let o=document.createElement("style");t.insertBefore(o,r);for(let i=0;i<s.length;i++)(n=o.sheet)==null||n.insertRule(s[i],i)}}attachDocumentToIframe(t,r){let n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,s=[],o=new Set,i=(a,c)=>{a.nodeName==="DIALOG"&&o.add(a),this.collectIframeAndAttachDocument(s,a);let u=n.getMeta(a);if(u?.type===Ge.Element&&u?.tagName.toUpperCase()==="HTML"){let{documentElement:l,head:h}=r.contentDocument;this.insertStyleRules(l,h)}if(!this.usingVirtualDom)for(let l of this.config.plugins||[])l.onBuild&&l.onBuild(a,{id:c,replayer:this})};Yt(t.node,{doc:r.contentDocument,mirror:n,hackCss:!0,skipChild:!1,afterAppend:i,cache:this.cache}),i(r.contentDocument,t.node.id);for(let{mutationInQueue:a,builtNode:c}of s)this.attachDocumentToIframe(a,c),this.newDocumentQueue=this.newDocumentQueue.filter(u=>u!==a);o.forEach(a=>xr(a))}collectIframeAndAttachDocument(t,r){if(Jt(r,this.mirror)){let n=this.newDocumentQueue.find(s=>s.parentId===this.mirror.getId(r));n&&t.push({mutationInQueue:n,builtNode:r})}}waitForStylesheetLoad(){var t;let r=(t=this.iframe.contentDocument)==null?void 0:t.head;if(r){let n=new Set,s,o=this.service.state,i=()=>{o=this.service.state};this.emitter.on(X.Start,i),this.emitter.on(X.Pause,i);let a=()=>{this.emitter.off(X.Start,i),this.emitter.off(X.Pause,i)};r.querySelectorAll(\'link[rel="stylesheet"]\').forEach(c=>{c.sheet||(n.add(c),c.addEventListener("load",()=>{n.delete(c),n.size===0&&s!==-1&&(o.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(X.LoadStylesheetEnd),s&&clearTimeout(s),a())}))}),n.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(X.LoadStylesheetStart),s=setTimeout(()=>{o.matches("playing")&&this.play(this.getCurrentTime()),s=-1,a()},this.config.loadTimeout))}}async preloadAllImages(){let t=[];for(let r of this.service.state.context.events)r.type===$.IncrementalSnapshot&&r.data.source===L.CanvasMutation&&(t.push(this.deserializeAndPreloadCanvasEvents(r.data,r)),("commands"in r.data?r.data.commands:[r.data]).forEach(s=>{this.preloadImages(s,r)}));return Promise.all(t)}preloadImages(t,r){if(t.property==="drawImage"&&typeof t.args[0]=="string"&&!this.imageMap.has(r)){let n=document.createElement("canvas"),s=n.getContext("2d"),o=s?.createImageData(n.width,n.height);s?.putImageData(o,0,0)}}async deserializeAndPreloadCanvasEvents(t,r){if(!this.canvasEventMap.has(r)){let n={isUnchanged:!0};if("commands"in t){let s=await Promise.all(t.commands.map(async o=>{let i=await Promise.all(o.args.map(tt(this.imageMap,null,n)));return{...o,args:i}}));n.isUnchanged===!1&&this.canvasEventMap.set(r,{...t,commands:s})}else{let s=await Promise.all(t.args.map(tt(this.imageMap,null,n)));n.isUnchanged===!1&&this.canvasEventMap.set(r,{...t,args:s})}}}applyIncremental(t,r){var n,s,o;let{data:i}=t;switch(i.source){case L.Mutation:{try{this.applyMutation(i,r)}catch(a){this.warn(`Exception in mutation ${a.message||a}`,i)}break}case L.Drag:case L.TouchMove:case L.MouseMove:if(r){let a=i.positions[i.positions.length-1];this.mousePos={x:a.x,y:a.y,id:a.id,debugData:i}}else i.positions.forEach(a=>{let c={doAction:()=>{this.moveAndHover(a.x,a.y,a.id,r,i)},delay:a.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(c)}),this.timer.addAction({doAction(){},delay:t.delay-((n=i.positions[0])==null?void 0:n.timeOffset)});break;case L.MouseInteraction:{if(i.id===-1)break;let a=new Event(Ye(Q[i.type])),c=this.mirror.getNode(i.id);if(!c)return this.debugNodeNotFound(i,i.id);this.emitter.emit(X.MouseInteraction,{type:i.type,target:c});let{triggerFocus:u}=this.config;switch(i.type){case Q.Blur:"blur"in c&&c.blur();break;case Q.Focus:u&&c.focus&&c.focus({preventScroll:!0});break;case Q.Click:case Q.TouchStart:case Q.TouchEnd:case Q.MouseDown:case Q.MouseUp:r?(i.type===Q.TouchStart?this.touchActive=!0:i.type===Q.TouchEnd&&(this.touchActive=!1),i.type===Q.MouseDown?this.lastMouseDownEvent=[c,a]:i.type===Q.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:i.x||0,y:i.y||0,id:i.id,debugData:i}):(i.type===Q.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(i.x||0,i.y||0,i.id,r,i),i.type===Q.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):i.type===Q.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):i.type===Q.TouchEnd?this.mouse.classList.remove("touch-active"):c.dispatchEvent(a));break;case Q.TouchCancel:r?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:c.dispatchEvent(a)}break}case L.Scroll:{if(i.id===-1)break;if(this.usingVirtualDom){let a=this.virtualDom.mirror.getNode(i.id);if(!a)return this.debugNodeNotFound(i,i.id);a.scrollData=i;break}this.applyScroll(i,r);break}case L.ViewportResize:this.emitter.emit(X.Resize,{width:i.width,height:i.height});break;case L.Input:{if(i.id===-1)break;if(this.usingVirtualDom){let a=this.virtualDom.mirror.getNode(i.id);if(!a)return this.debugNodeNotFound(i,i.id);a.inputData=i;break}this.applyInput(i);break}case L.MediaInteraction:{let a=this.usingVirtualDom?this.virtualDom.mirror.getNode(i.id):this.mirror.getNode(i.id);if(!a)return this.debugNodeNotFound(i,i.id);let c=a,{events:u}=this.service.state.context;this.mediaManager.mediaMutation({target:c,timeOffset:t.timestamp-u[0].timestamp,mutation:i});break}case L.StyleSheetRule:case L.StyleDeclaration:{this.usingVirtualDom?i.styleId?this.constructedStyleMutations.push(i):i.id&&((s=this.virtualDom.mirror.getNode(i.id))==null||s.rules.push(i)):this.applyStyleSheetMutation(i);break}case L.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){let a=this.virtualDom.mirror.getNode(i.id);if(!a)return this.debugNodeNotFound(i,i.id);a.canvasMutations.push({event:t,mutation:i})}else{let a=this.mirror.getNode(i.id);if(!a)return this.debugNodeNotFound(i,i.id);Ua({event:t,mutation:i,target:a,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case L.Font:{try{let a=new FontFace(i.family,i.buffer?new Uint8Array(JSON.parse(i.fontSource)):i.fontSource,i.descriptors);(o=this.iframe.contentDocument)==null||o.fonts.add(a)}catch(a){this.warn(a)}break}case L.Selection:{if(r){this.lastSelectionData=i;break}this.applySelection(i);break}case L.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(i):this.applyAdoptedStyleSheet(i);break}}}applyMutation(t,r){if(this.config.useVirtualDom&&!this.usingVirtualDom&&r&&(this.usingVirtualDom=!0,Zp(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(let u in this.legacy_missingNodeRetryMap)try{let l=this.legacy_missingNodeRetryMap[u],h=vl(l.node,this.virtualDom,this.mirror);h&&(l.node=h)}catch(l){this.warn(l)}let n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;t.removes=t.removes.filter(u=>n.getNode(u.id)?!0:(this.warnNodeNotFound(t,u.id),!1)),t.removes.forEach(u=>{var l;let h=n.getNode(u.id);if(!h)return;let p=n.getNode(u.parentId);if(!p)return this.warnNodeNotFound(t,u.parentId);if(u.isShadow&&at(p)&&(p=p.shadowRoot),n.removeNodeFromMap(h),p)try{p.removeChild(h),this.usingVirtualDom&&h.nodeName==="#text"&&p.nodeName==="STYLE"&&((l=p.rules)==null?void 0:l.length)>0&&(p.rules=[])}catch(d){if(d instanceof DOMException)this.warn("parent could not remove child in mutation",p,h,t);else throw d}});let s={...this.legacy_missingNodeRetryMap},o=[],i=u=>{let l=null;return u.nextId&&(l=n.getNode(u.nextId)),u.nextId!==null&&u.nextId!==void 0&&u.nextId!==-1&&!l},a=u=>{var l,h;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let p=n.getNode(u.parentId);if(!p)return u.node.type===Ge.Document?this.newDocumentQueue.push(u):o.push(u);u.node.isShadow&&(at(p)||p.attachShadow({mode:"open"}),p=p.shadowRoot);let d=null,m=null;if(u.previousId&&(d=n.getNode(u.previousId)),u.nextId&&(m=n.getNode(u.nextId)),i(u))return o.push(u);if(u.node.rootId&&!n.getNode(u.node.rootId))return;let f=u.node.rootId?n.getNode(u.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Jt(p,n)){this.attachDocumentToIframe(u,p);return}let y=(x,E)=>{if(!this.usingVirtualDom){xr(x);for(let S of this.config.plugins||[])S.onBuild&&S.onBuild(x,{id:E,replayer:this})}},b=Yt(u.node,{doc:f,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:y});if(u.previousId===-1||u.nextId===-1){s[u.node.id]={node:b,mutation:u};return}let w=n.getMeta(p);if(w&&w.type===Ge.Element&&u.node.type===Ge.Text){let x=Array.isArray(p.childNodes)?p.childNodes:Array.from(p.childNodes);if(w.tagName==="textarea")for(let E of x)E.nodeType===p.TEXT_NODE&&p.removeChild(E);else if(w.tagName==="style"&&x.length===1)for(let E of x)E.nodeType===p.TEXT_NODE&&!n.hasNode(E)&&(b.textContent=E.textContent,p.removeChild(E))}else if(w?.type===Ge.Document){let x=p;u.node.type===Ge.DocumentType&&((l=x.childNodes[0])==null?void 0:l.nodeType)===Node.DOCUMENT_TYPE_NODE&&x.removeChild(x.childNodes[0]),b.nodeName==="HTML"&&x.documentElement&&x.removeChild(x.documentElement)}if(d&&d.nextSibling&&d.nextSibling.parentNode?p.insertBefore(b,d.nextSibling):m&&m.parentNode?p.contains(m)?p.insertBefore(b,m):p.insertBefore(b,null):p.appendChild(b),y(b,u.node.id),this.usingVirtualDom&&b.nodeName==="#text"&&p.nodeName==="STYLE"&&((h=p.rules)==null?void 0:h.length)>0&&(p.rules=[]),Jt(b,this.mirror)){let x=this.mirror.getId(b),E=this.newDocumentQueue.find(S=>S.parentId===x);E&&(this.attachDocumentToIframe(E,b),this.newDocumentQueue=this.newDocumentQueue.filter(S=>S!==E))}(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(s,p,b,u)};t.adds.forEach(u=>{a(u)});let c=Date.now();for(;o.length;){let u=bd(o);if(o.length=0,Date.now()-c>500){this.warn("Timeout in the loop, please check the resolve tree data:",u);break}for(let l of u)n.getNode(l.value.parentId)?Nl(l,p=>{a(p)}):this.debug("Drop resolve tree since there is no parent for the root node.",l)}Object.keys(s).length&&Object.assign(this.legacy_missingNodeRetryMap,s),wd(t.texts).forEach(u=>{var l;let h=n.getNode(u.id);if(!h)return t.removes.find(d=>d.id===u.id)?void 0:this.warnNodeNotFound(t,u.id);let p=h.parentElement;if(u.value&&p&&p.tagName==="STYLE"?h.textContent=Vr(u.value,this.cache):h.textContent=u.value,this.usingVirtualDom){let d=h.parentNode;((l=d?.rules)==null?void 0:l.length)>0&&(d.rules=[])}}),t.attributes.forEach(u=>{var l;let h=n.getNode(u.id);if(!h)return t.removes.find(p=>p.id===u.id)?void 0:this.warnNodeNotFound(t,u.id);for(let p in u.attributes)if(typeof p=="string"){let d=u.attributes[p];if(d===null)h.removeAttribute(p),p==="open"&&nh(h,u);else if(typeof d=="string")try{if(p==="_cssText"&&(h.nodeName==="LINK"||h.nodeName==="STYLE"))try{let m=n.getMeta(h),f=Yt({...m,attributes:{...m.attributes,...u.attributes}},{doc:h.ownerDocument,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache});Object.assign(m.attributes,u.attributes);let y=h.nextSibling,b=h.parentNode;if(f&&b){b.removeChild(h),b.insertBefore(f,y),n.replace(u.id,f);break}}catch{}if(p==="value"&&h.nodeName==="TEXTAREA"){let m=h;m.childNodes.forEach(y=>m.removeChild(y));let f=(l=h.ownerDocument)==null?void 0:l.createTextNode(d);f&&m.appendChild(f)}else h.setAttribute(p,d);p==="rr_open_mode"&&h.nodeName==="DIALOG"&&xr(h,u)}catch(m){this.warn("An error occurred may due to the checkout feature.",m)}else if(p==="style"){let m=d,f=h;for(let y in m)if(m[y]===!1)f.style.removeProperty(y);else if(m[y]instanceof Array){let b=m[y];f.style.setProperty(y,b[0],b[1])}else{let b=m[y];f.style.setProperty(y,b)}}}})}applyScroll(t,r){var n,s;let o=this.mirror.getNode(t.id);if(!o)return this.debugNodeNotFound(t,t.id);let i=this.mirror.getMeta(o);if(o===this.iframe.contentDocument)(n=this.iframe.contentWindow)==null||n.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else if(i?.type===Ge.Document)(s=o.defaultView)==null||s.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else try{o.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"})}catch{}}applyInput(t){let r=this.mirror.getNode(t.id);if(!r)return this.debugNodeNotFound(t,t.id);try{r.checked=t.isChecked,r.value=t.text}catch{}}applySelection(t){try{let r=new Set,n=t.ranges.map(({start:s,startOffset:o,end:i,endOffset:a})=>{let c=this.mirror.getNode(s),u=this.mirror.getNode(i);if(!c||!u)return;let l=new Range;l.setStart(c,o),l.setEnd(u,a);let h=c.ownerDocument,p=h?.getSelection();return p&&r.add(p),{range:l,selection:p}});r.forEach(s=>s.removeAllRanges()),n.forEach(s=>{var o;return s&&((o=s.selection)==null?void 0:o.addRange(s.range))})}catch{}}applyStyleSheetMutation(t){var r;let n=null;t.styleId?n=this.styleMirror.getStyle(t.styleId):t.id&&(n=((r=this.mirror.getNode(t.id))==null?void 0:r.sheet)||null),n&&(t.source===L.StyleSheetRule?this.applyStyleSheetRule(t,n):t.source===L.StyleDeclaration&&this.applyStyleDeclaration(t,n))}applyStyleSheetRule(t,r){var n,s,o,i;if((n=t.adds)==null||n.forEach(({rule:a,index:c})=>{try{if(Array.isArray(c)){let{positions:u,index:l}=Ea(c),h=Wt(r.cssRules,u);h?.insertRule(a,l)}else{let u=c===void 0?void 0:Math.min(c,r.cssRules.length);r?.insertRule(a,u)}}catch{}}),(s=t.removes)==null||s.forEach(({index:a})=>{try{if(Array.isArray(a)){let{positions:c,index:u}=Ea(a),l=Wt(r.cssRules,c);l?.deleteRule(u||0)}else r?.deleteRule(a)}catch{}}),typeof t.replace=="string")try{(o=r.replace)==null||o.call(r,t.replace)}catch{}if(typeof t.replaceSync=="string")try{(i=r.replaceSync)==null||i.call(r,t.replaceSync)}catch{}}applyStyleDeclaration(t,r){if(t.set){let n=Wt(r.rules,t.index);n?.style&&n.style.setProperty(t.set.property,t.set.value,t.set.priority)}if(t.remove){let n=Wt(r.rules,t.index);n?.style&&n.style.removeProperty(t.remove.property)}}applyAdoptedStyleSheet(t){var r;let n=this.mirror.getNode(t.id);if(!n)return;(r=t.styles)==null||r.forEach(a=>{var c;let u=null,l=null;if(at(n)?l=((c=n.ownerDocument)==null?void 0:c.defaultView)||null:n.nodeName==="#document"&&(l=n.defaultView),!!l)try{u=new l.CSSStyleSheet,this.styleMirror.add(u,a.styleId),this.applyStyleSheetRule({source:L.StyleSheetRule,adds:a.rules},u)}catch{}});let s=10,o=0,i=(a,c)=>{let u=c.map(l=>this.styleMirror.getStyle(l)).filter(l=>l!==null);at(a)?a.shadowRoot.adoptedStyleSheets=u:a.nodeName==="#document"&&(a.adoptedStyleSheets=u),u.length!==c.length&&o<s&&(setTimeout(()=>i(a,c),0+100*o),o++)};i(n,t.styleIds)}legacy_resolveMissingNode(t,r,n,s){let{previousId:o,nextId:i}=s,a=o&&t[o],c=i&&t[i];if(a){let{node:u,mutation:l}=a;r.insertBefore(u,n),delete t[l.node.id],delete this.legacy_missingNodeRetryMap[l.node.id],(l.previousId||l.nextId)&&this.legacy_resolveMissingNode(t,r,u,l)}if(c){let{node:u,mutation:l}=c;r.insertBefore(u,n.nextSibling),delete t[l.node.id],delete this.legacy_missingNodeRetryMap[l.node.id],(l.previousId||l.nextId)&&this.legacy_resolveMissingNode(t,r,u,l)}}moveAndHover(t,r,n,s,o){let i=this.mirror.getNode(n);if(!i)return this.debugNodeNotFound(o,n);let a=Il(i,this.iframe),c=t*a.absoluteScale+a.x,u=r*a.absoluteScale+a.y;this.mouse.style.left=`${c}px`,this.mouse.style.top=`${u}px`,s||this.drawMouseTail({x:c,y:u}),this.hoverElements(i)}drawMouseTail(t){if(!this.mouseTail)return;let{lineCap:r,lineWidth:n,strokeStyle:s,duration:o}=this.config.mouseTail===!0?Ss:Object.assign({},Ss,this.config.mouseTail),i=()=>{if(!this.mouseTail)return;let a=this.mouseTail.getContext("2d");!a||!this.tailPositions.length||(a.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),a.beginPath(),a.lineWidth=n,a.lineCap=r,a.strokeStyle=s,a.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(c=>a.lineTo(c.x,c.y)),a.stroke())};this.tailPositions.push(t),i(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(a=>a!==t),i()},o/this.speedService.state.context.timer.speed)}hoverElements(t){var r;(r=this.lastHoveredRootNode||this.iframe.contentDocument)==null||r.querySelectorAll(".\\\\:hover").forEach(s=>{s.classList.remove(":hover")}),this.lastHoveredRootNode=t.getRootNode();let n=t;for(;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement}isUserInteraction(t){return t.type!==$.IncrementalSnapshot?!1:t.data.source>L.Mutation&&t.data.source<=L.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(X.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(t,r){this.warn(`Node with id \'${r}\' not found. `,t)}warnCanvasMutationFailed(t,r){this.warn("Has error on canvas update",r,"canvas mutation:",t)}debugNodeNotFound(t,r){this.debug(`Node with id \'${r}\' not found. `,t)}warn(...t){this.config.showWarning&&this.config.logger.warn(qa,...t)}debug(...t){this.config.showDebug&&this.config.logger.log(qa,...t)}},{addCustomEvent:_f,addAnnotation:$f}=rt,{freezePage:Ff}=rt,{takeFullSnapshot:Uf}=rt;function oh(e){let t=e.params.get("errors")==="1",r=g("label",{class:"switch"},g("input",{type:"checkbox",checked:t,onchange:()=>de("replays",{errors:t?null:"1"})}),"Only sessions with errors");return[oe("Replays","Recorded sessions. Each one has a text transcript that agents can read.",r),he(async()=>{let n=await U.get("/api/replays",{project:Z().project,with_errors:t||void 0,limit:100});return n.enabled?n.replays.length===0?ne(t?"No recorded sessions with errors.":\'No recordings yet. Set data-replay-sample-rate="0.1" on the script tag to record 10% of sessions.\'):ye(["Started","Person","Length","Clicks","Errors","First page","Device"],n.replays.map(s=>[g("a",{href:ce(`replays/${s.session}`)},Pe(s.started)),g("a",{href:ce(`users/${encodeURIComponent(s.person)}`)},s.person.slice(0,16)),Ve(s.durationSeconds),String(s.clicks),s.errors?g("span",{class:"badge bad"},String(s.errors)):"0",g("span",{class:"muted"},s.url.replace(/^https?:\\/\\//,"")),g("span",{class:"muted"},s.device)]),{numeric:[3,4]}):ne("Session replay is not enabled on this deployment. Enable R2 in your Cloudflare account, then run glass upgrade.")})]}async function ah(e){e.isConnected||await new Promise(t=>{let r=()=>{e.isConnected?t():requestAnimationFrame(r)};requestAnimationFrame(r)})}function lh(e){let t=Z().project,r=g("div",{class:"replay-stage"}),n=g("div",{class:"player-bar"},st("Loading recording")),s=null;(async()=>{try{let i=await U.get(`/api/replays/${encodeURIComponent(e)}/events`,{project:t});if(i.events.length<2){q(n,ne("This recording has no playable events yet."));return}await ah(r),r.replaceChildren(),s=new Ur(i.events,{root:r,skipInactive:!0,showWarning:!1});let a=s.getMetaData(),c=!1,u=g("button",{type:"button",class:"primary"},"Play");u.addEventListener("click",()=>{s&&(c?s.pause():s.play(),c=!c,u.textContent=c?"Pause":"Play")}),q(n,u,g("span",{class:"muted"},Ve(a.totalTime/1e3)))}catch(i){q(n,Re(i))}})();let o=()=>{window.removeEventListener("hashchange",o);try{s?.pause()}catch{}s=null};return window.addEventListener("hashchange",o,{once:!0}),[oe("Replay",`Session ${e}`,we(`Using the Glass MCP tool summarise_replay, read session ${e} and tell me what went wrong.`,"Copy as agent prompt")),g("div",{class:"replay-layout"},J("Recording",[r,n],{class:"player"}),J("Transcript",he(async()=>{let i=await U.get(`/api/replays/${encodeURIComponent(e)}/summary`,{project:t});return g("pre",{class:"transcript"},i.transcript)},"Reading the session")))]}function Vl(e){return e.rest[0]?lh(e.rest[0]):oh(e)}var ch=()=>`${location.origin}${ir.base}`;function Qr(e){return g("div",{class:"code-block"},g("pre",{},g("code",{},e)),we(e))}function Hl(){let e=Z().project??"your-project",t=ch();return[oe("Settings","Install Glass on a site, connect an agent, manage projects."),g("div",{class:"grid-2"},J("Install on a site",[g("p",{},"Add this to the <head> of every page. Pageviews, clicks, errors and web vitals are captured automatically."),Qr(`<script defer src="${t}/s.js" data-project="${e}"><\\/script>`),g("p",{},"Then track what matters:"),Qr(`glass.capture(\'signup_completed\', { plan: \'pro\' });\nglass.identify(user.id, { plan: user.plan });`)]),J("Connect an agent",[g("p",{},"In a project set up with glass init, agents already have the MCP server. Elsewhere, add it by URL with your key:"),Qr(`claude mcp add --transport http glass ${t}/mcp \\\\\n --header "Authorization: Bearer $GLASS_API_KEY"`),g("p",{},"Agent instructions for this deployment:"),Qr(`${t}/llms.txt`)])),he(async()=>{let[r,n]=await Promise.all([U.get("/health"),U.get("/api/projects")]),s=g("input",{type:"text",required:!0,placeholder:"acme-docs",pattern:"[a-z0-9][a-z0-9_-]*"}),o=g("div",{}),i=g("form",{class:"inline-form"},s,g("button",{type:"submit",class:"ghost"},"Add project"),o);return i.addEventListener("submit",async a=>{a.preventDefault();try{await U.post("/api/projects",{id:s.value}),fe(`Project ${s.value} added`),location.reload()}catch(c){q(o,Re(c))}}),g("div",{class:"grid-2"},J("Projects",[ye(["Project","Created","Allowed origins"],n.projects.map(a=>[g("code",{},a.id),Pe(a.createdAt),a.allowedOrigins.join(", ")||g("span",{class:"muted"},"Any")])),i]),J("This deployment",[r.upgradeAvailable&&r.latest?g("p",{class:"notice"},`Glass ${r.latest} is available. Run `,g("code",{},r.upgradeCommand??"npx @glassanalytics/cli@latest upgrade")," in your project."):null,g("dl",{class:"props"},g("dt",{},"Version"),g("dd",{},r.latest&&r.latest!==r.version?`${r.version} (latest ${r.latest})`:r.version),g("dt",{},"Event store"),g("dd",{},r.store==="lake"?`Iceberg lake (data appears after about ${Math.round(r.freshnessSeconds/60)} min)`:"D1 (real time)"),g("dt",{},"Session replay"),g("dd",{},r.replay?"Enabled":"Disabled (no R2 bucket)"),g("dt",{},"Signed in with"),g("dd",{},g("button",{type:"button",class:"ghost small",onclick:()=>{le.key=null,location.reload()}},"Forget this key")))]))})]}function vi(e){let t=g("input",{type:"password",required:!0,autocomplete:"off",placeholder:"Paste your Glass API key","aria-label":"API key"}),r=g("div",{}),n=g("form",{class:"stack"},t,r,g("button",{type:"submit",class:"primary"},"Open dashboard"));return n.addEventListener("submit",async s=>{s.preventDefault(),le.key=t.value.trim();try{await U.get("/api"),e()}catch(o){le.key=null,q(r,Re(o))}}),g("main",{class:"key-screen"},g("h1",{},"Glass"),g("p",{},"Paste the API key created by glass init. Run ",g("code",{},"npx @glassanalytics/cli key")," in your project to print it."),n,g("p",{class:"muted small"},"The key stays in this browser. Use the read-only key to share the dashboard without letting people change flags."))}function Gl(){return Le().params.getAll("f").map(e=>{let t=e.indexOf(":");return t>0?{property:e.slice(0,t),value:e.slice(t+1)}:null}).filter(e=>e!==null)}function Yl(e,t){let r=Le(),n=new URLSearchParams(r.params);return n.append("f",`${e}:${t}`),`#/${[r.page,...r.rest].join("/")}?${n}`}function Jl(){return Gl().map(e=>({property:e.property,value:e.value}))}function Kl(){let e=Gl();if(e.length===0)return null;let t=Le();return g("div",{class:"chips","aria-label":"Active filters"},e.map(r=>g("button",{type:"button",class:"chip",title:"Remove filter",onclick:()=>{let n=new URLSearchParams(t.params),s=n.getAll("f").filter(o=>o!==`${r.property}:${r.value}`);n.delete("f");for(let o of s)n.append("f",o);de([t.page,...t.rest].join("/"),Object.fromEntries(n),!1)}},`${r.property} is ${r.value}`,g("span",{"aria-hidden":"true"}," \\xD7"))))}var uh={pages:"path",entry_pages:"path",exit_pages:"path",referrers:"referrer_host",utm_source:"utm_source",utm_medium:"utm_medium",utm_campaign:"utm_campaign",countries:"country",devices:"device",browsers:"browser",os:"os"};function Xl(e){let t=[{label:"Visitors",value:V(e.totals.visitors),now:e.totals.visitors,before:e.previous?.visitors},{label:"Pageviews",value:V(e.totals.pageviews),now:e.totals.pageviews,before:e.previous?.pageviews},{label:"Sessions",value:V(e.totals.sessions),now:e.totals.sessions,before:e.previous?.sessions},{label:"Bounce rate",value:te(e.totals.bounceRate,0),now:e.totals.bounceRate,before:e.previous?.bounceRate,lowerIsBetter:!0},{label:"Session length",value:Ve(e.totals.avgSessionSeconds),now:e.totals.avgSessionSeconds,before:e.previous?.avgSessionSeconds},{label:"Views per session",value:Ei(e.totals.viewsPerSession,1),now:e.totals.viewsPerSession,before:e.previous?.viewsPerSession}];return g("dl",{class:"kpis"},t.map(r=>{let n=Ri(r.now,r.before),s=n&&n.direction!=="flat"&&n.direction==="up"!=!!r.lowerIsBetter;return g("div",{class:"kpi"},g("dt",{},r.label),g("dd",{},r.value,n?g("span",{class:`delta ${n.direction==="flat"?"":s?"good":"bad"}`,title:"vs previous period"},n.text):null))}))}function Rt(e,t,r,n){let s=g("div",{}),o=r[0].key,i=()=>{let a=e.breakdowns[o]??[],c=uh[o];q(s,r.length>1?It(r.map(u=>({value:u.key,label:u.label})),o,u=>{o=u,i()}):null,a.length?Di(a.map(u=>({label:u.value,value:o==="errors"?u.count:u.visitors,secondary:o==="errors"?u.visitors:u.count,href:c&&u.value!=="(none)"&&u.value!=="Direct / None"?Yl(c,u.value):void 0})),n):ne("Nothing here for this period."))};return i(),J(t,s,{sql:[e.sql[e.sql.length-2]]})}function ph(e){let t={LCP:[2500,4e3,n=>`${(n/1e3).toFixed(2)}s`],INP:[200,500,n=>`${Math.round(n)}ms`],CLS:[.1,.25,n=>n.toFixed(2)],FCP:[1800,3e3,n=>`${(n/1e3).toFixed(2)}s`],TTFB:[800,1800,n=>`${Math.round(n)}ms`]},r=Object.entries(e.vitals);return J("Web vitals (p75)",r.length?g("dl",{class:"vitals"},r.map(([n,s])=>{let[o,i,a]=t[n]??[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,u=>String(u)],c=s.p75<=o?"good":s.p75<=i?"ok":"poor";return g("div",{class:`vital ${c}`},g("dt",{},n),g("dd",{},a(s.p75)),g("span",{class:"muted small"},`${V(s.samples)} ${s.samples===1?"sample":"samples"}`))})):ne("No web vitals yet. They are sent when a visitor leaves a page."),{sql:[e.sql[e.sql.length-1]]})}function dh(e){return[Xl(e),J("Visitors and pageviews",ar(e.timeseries.buckets,[{label:"Visitors",values:e.timeseries.visitors},{label:"Pageviews",values:e.timeseries.pageviews}],e.interval),{sql:[e.sql[0],e.sql[e.previous?2:1]],class:"wide"}),g("div",{class:"grid-2"},Rt(e,"Pages",[{key:"pages",label:"Top"},{key:"entry_pages",label:"Entry"},{key:"exit_pages",label:"Exit"}],["Page","Visitors","Views"]),Rt(e,"Locations",[{key:"countries",label:"Countries"}],["Country","Visitors","Views"]),Rt(e,"Devices",[{key:"devices",label:"Device"},{key:"browsers",label:"Browser"},{key:"os",label:"OS"}],["Device","Visitors","Views"]))]}function hh(e){return[Xl(e),g("div",{class:"grid-2"},Rt(e,"Referrers",[{key:"referrers",label:"Referrers"}],["Referrer","Visitors","Visits"]),Rt(e,"Campaigns",[{key:"utm_source",label:"Source"},{key:"utm_medium",label:"Medium"},{key:"utm_campaign",label:"Campaign"}],["Value","Visitors","Visits"]))]}function fh(e){return[g("div",{class:"grid-2"},Rt(e,"JavaScript errors",[{key:"errors",label:"Errors"}],["Message","Times","Visitors"]),ph(e))]}var mh={web:"Traffic, pages, locations and devices. Click any row to filter.",marketing:"How people found you: referrers and UTM campaigns.",health:"Whether the site is broken or slow: JavaScript errors and Core Web Vitals."};function gh(e){let t=e[0]??"web";return t==="marketing"||t==="health"||t==="web"?t:"web"}function bi(e){let t=gh(e.rest),r=Z();return[oe("Reports",mh[t]),It([{value:"web",label:"Web"},{value:"marketing",label:"Marketing"},{value:"health",label:"Health"}],t,n=>de(n==="web"?"reports":`reports/${n}`)),Kl()??g("span",{}),he(async()=>{let n=await U.post("/api/query",{kind:"web",...r,filters:Jl()});return n.totals.pageviews===0&&!n.previous?.pageviews?ne("No pageviews yet. Add the script tag to your site, then visit a page.",g("a",{class:"button",href:"#/settings"},"Show the install snippet")):t==="marketing"?hh(n):t==="health"?fh(n):dh(n)})]}var wi={reports:{label:"Reports",render:bi},web:{label:"Reports",render:bi},insights:{label:"Insights",render:Ji},users:{label:"People",render:Xi},replays:{label:"Replays",render:Vl},flags:{label:"Flags",render:Ii},experiments:{label:"Experiments",render:Ni},events:{label:"Events",render:ki},sql:{label:"SQL",render:Mi},settings:{label:"Settings",render:Hl}},Ql=[["today","Today"],["-24h","Last 24 hours"],["-7d","Last 7 days"],["-30d","Last 30 days"],["-90d","Last 90 days"],["-12mo","Last 12 months"]],yh={m:["minute","minutes"],h:["hour","hours"],d:["day","days"],w:["week","weeks"],mo:["month","months"],y:["year","years"]};function vh(e){let t=/^-(\\d+)(mo|m|h|d|w|y)$/.exec(e);if(!t)return`Since ${e}`;let r=Number(t[1]),[n,s]=yh[t[2]];return r===1?`Last ${n}`:`Last ${r} ${s}`}var xi=document.getElementById("app"),pt=[],sr=null;function bh(e){let t=e.params.get("project")??le.project??pt[0]??"",r=g("select",{"aria-label":"Project"},pt.map(i=>g("option",{value:i,selected:i===t},i)));r.addEventListener("change",()=>{le.project=r.value,de(e.page,{project:r.value})});let n=e.params.get("from")??"-30d",s=g("select",{"aria-label":"Date range"},Ql.map(([i,a])=>g("option",{value:i,selected:i===n},a)));Ql.some(([i])=>i===n)||s.appendChild(g("option",{value:n,selected:!0},vh(n))),s.addEventListener("change",()=>de([e.page,...e.rest].join("/"),{from:s.value,to:null}));let o=g("input",{type:"checkbox",checked:le.showSql});return o.addEventListener("change",()=>{le.showSql=o.checked}),g("div",{class:"topbar"},pt.length>1?r:g("span",{class:"project-name"},t),s,g("label",{class:"switch sql-switch",title:"Show the SQL behind every panel (press s)"},o,"Show SQL"))}function wh(e){return g("nav",{class:"sidebar","aria-label":"Sections"},g("a",{class:"brand",href:"#/reports"},g("span",{class:"mark","aria-hidden":"true"}),"Glass"),g("ul",{},Object.entries(wi).filter(([t])=>t!=="web").map(([t,r])=>{let n=t===e.page||t==="reports"&&e.page==="web";return g("li",{},g("a",{href:`#/${t}`,class:n?"active":"","aria-current":n?"page":null},r.label))})))}function xh(){if(!sr)return null;let e=`upgrade-dismissed:${sr.latest}`;try{if(localStorage.getItem(`glass:${e}`)==="1")return null}catch{}let t=sr;return g("div",{class:"upgrade-banner",role:"status"},g("p",{},`Glass ${t.latest} is available (this deployment is ${t.version}). Run `,g("code",{},t.command)," in your project to upgrade."),g("button",{type:"button",class:"ghost small",onclick:()=>{try{localStorage.setItem(`glass:${e}`,"1")}catch{}sr=null,Si()}},"Dismiss"))}function Si(){let e=Le(),t=wi[e.page]??wi.reports,r=g("main",{class:"content",id:"content"});q(xi,g("div",{class:"shell"},wh(e),g("div",{class:"main"},xh(),bh(e),r))),q(r,t.render(e)),document.title=`Glass: ${t.label}`}async function Ci(){if(le.showSql=le.showSql,!le.key){q(xi,vi(()=>{Ci()}));return}try{let[e,t]=await Promise.all([U.get("/api/projects"),U.get("/health")]);pt=e.projects.map(r=>r.id),sr=t.upgradeAvailable&&t.latest?{version:t.version,latest:t.latest,command:t.upgradeCommand??"npx @glassanalytics/cli@latest upgrade"}:null}catch{if(!le.key)return}if(!Le().params.get("project")&&pt[0]){let e=le.project&&pt.includes(le.project)?le.project:pt[0];de(Le().page,{project:e});return}Si()}window.addEventListener("hashchange",()=>le.key?Si():void 0);window.addEventListener("glass:unauthorized",()=>{le.key=null,q(xi,vi(()=>{Ci()}))});window.addEventListener("keydown",e=>{let t=e.target;if(e.key==="s"&&!e.metaKey&&!e.ctrlKey&&!["INPUT","TEXTAREA","SELECT"].includes(t.tagName)){le.showSql=!le.showSql;let r=document.querySelector(".sql-switch input");r&&(r.checked=le.showSql)}});Ci();\n', dashboardCss: ':root{--field: #f6f8f7;--surface: #ffffff;--ink: #1e2925;--muted: #5f6f69;--hairline: #d9e3df;--pane: #eaf3f0;--pane-ink: #24453c;--glass-green: #2e7d6b;--glass-green-soft: #cfe7df;--glass-cobalt: #3159c4;--glass-amber: #b8791d;--glass-ruby: #b03a48;--glass-teal: #2b8a99;--smoke: #7b8a84;--good: #2e7d6b;--bad: #b03a48;--warn: #b8791d;--radius: 10px;--sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;--mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;color-scheme:light}@media(prefers-color-scheme:dark){:root{--field: #121917;--surface: #18211e;--ink: #e4ece9;--muted: #93a39d;--hairline: #2a3632;--pane: #1d2b27;--pane-ink: #b9dacf;--glass-green: #5fb59f;--glass-green-soft: #24453c;--glass-cobalt: #7d9bf0;--glass-amber: #e0a54f;--glass-ruby: #e07884;--glass-teal: #5cc0cf;--smoke: #93a39d;--good: #5fb59f;--bad: #e07884;--warn: #e0a54f;color-scheme:dark}}*{box-sizing:border-box}html,body{margin:0;background:var(--field);color:var(--ink);font:15px/1.5 var(--sans);-webkit-font-smoothing:antialiased}a{color:var(--glass-green);text-decoration-thickness:1px;text-underline-offset:2px}code,pre{font-family:var(--mono);font-size:.88em}:focus-visible{outline:2px solid var(--glass-cobalt);outline-offset:2px;border-radius:4px}.muted{color:var(--muted)}.small{font-size:.85em}.num{text-align:right;font-variant-numeric:tabular-nums}.shell{display:grid;grid-template-columns:208px minmax(0,1fr);min-height:100vh}.sidebar{border-right:1px solid var(--hairline);padding:20px 12px;position:sticky;top:0;height:100vh}.brand{display:flex;align-items:center;gap:10px;font-weight:700;font-size:18px;letter-spacing:-.01em;color:var(--ink);text-decoration:none;padding:0 10px 18px}.mark{width:22px;height:22px;border-radius:5px;background:linear-gradient(135deg,var(--surface) 0 58%,var(--glass-green-soft) 58% 78%,var(--glass-green) 78%);border:1.5px solid var(--glass-green)}.sidebar ul{list-style:none;margin:0;padding:0}.sidebar li a{display:block;padding:7px 10px;border-radius:7px;color:var(--muted);text-decoration:none;font-weight:500}.sidebar li a:hover{color:var(--ink);background:var(--surface)}.sidebar li a.active{color:var(--ink);background:var(--surface);box-shadow:inset 3px 0 0 var(--glass-green)}.main{min-width:0}.topbar{display:flex;align-items:center;gap:12px;padding:14px 32px;border-bottom:1px solid var(--hairline);background:var(--field);position:sticky;top:0;z-index:5}.project-name{font-weight:600;margin-right:auto}.topbar select:first-child{margin-right:auto}.sql-switch{margin-left:4px}.content{padding:28px 32px 64px;max-width:1240px}.page-head{display:flex;justify-content:space-between;align-items:flex-start;gap:24px;margin-bottom:20px}.page-head h1{margin:0;font-size:28px;line-height:1.15;letter-spacing:-.02em;font-weight:700;overflow-wrap:anywhere}.page-head p{margin:6px 0 0;max-width:70ch}.page-actions{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 16px}.page-head .page-actions{margin:0}.panel{background:var(--surface);border:1px solid var(--hairline);border-radius:var(--radius);margin-bottom:16px;overflow:hidden}.panel-head{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px 18px 0}.panel-head h2{margin:0;font-size:15px;font-weight:650}.panel-actions{display:flex;gap:6px;align-items:center}.panel-body{padding:12px 18px 16px}.sql-pane{display:none;background:var(--pane);border-top:1px solid var(--hairline);padding:10px 18px 14px;color:var(--pane-ink)}.show-sql .sql-pane{display:block}.sql-pane-head{display:flex;justify-content:space-between;align-items:center;font-size:13px;font-weight:600;margin-bottom:6px}pre.sql{margin:0 0 8px;white-space:pre-wrap;word-break:break-word;max-height:260px;overflow:auto;font-size:12.5px;line-height:1.5}.grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.grid-2>.panel{margin-bottom:0}.grid-2+.panel,.grid-2+.grid-2{margin-top:16px}.kpis{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));margin:0 0 16px;background:var(--surface);border:1px solid var(--hairline);border-radius:var(--radius)}.kpi{padding:14px 18px;border-left:1px solid var(--hairline)}.kpi:first-child{border-left:0}.kpi dt{color:var(--muted);font-size:13px}.kpi dd{margin:2px 0 0;font-size:24px;font-weight:700;letter-spacing:-.02em;font-variant-numeric:tabular-nums;display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}.delta{font-size:13px;font-weight:600;letter-spacing:0;color:var(--muted)}.delta.good{color:var(--good)}.delta.bad{color:var(--bad)}.chart-wrap{position:relative}svg.chart{width:100%;height:auto;display:block;overflow:visible}.chart .grid{stroke:var(--hairline);stroke-width:1}.chart .axis{fill:var(--muted);font-size:11px;font-family:var(--sans)}.chart .line{fill:none;stroke-width:2;stroke-linejoin:round;stroke-linecap:round}.chart .area{opacity:.1}.chart .cursor{stroke:var(--muted);stroke-dasharray:3 3}.readout{position:absolute;top:0;transform:translate(-50%);background:var(--surface);border:1px solid var(--hairline);border-radius:8px;padding:6px 10px;font-size:12.5px;display:grid;gap:2px;pointer-events:none;white-space:nowrap;box-shadow:0 6px 20px #1e292514}.readout[hidden]{display:none}.legend{display:flex;gap:16px;list-style:none;padding:0;margin:8px 0 0;font-size:13px;color:var(--muted)}.swatch{display:inline-block;width:10px;height:10px;border-radius:2px;margin-right:6px;vertical-align:-1px}.bar-list{font-size:14px}.bar-head,.bar-row{display:grid;grid-template-columns:minmax(0,1fr) 72px 64px;gap:8px;align-items:center}.bar-head{color:var(--muted);font-size:12.5px;padding:0 8px 6px}.bar-row{position:relative;padding:5px 8px;border-radius:6px}.bar-fill{position:absolute;inset:2px auto 2px 0;background:var(--glass-green-soft);border-radius:5px;z-index:0}.bar-row>:not(.bar-fill){position:relative;z-index:1}.bar-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink);text-decoration:none}a.bar-label:hover{text-decoration:underline}.insight-result{display:grid;gap:16px}.funnel-view{display:grid;gap:18px}.funnel-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:10px 16px;padding:4px 0 8px;border-bottom:1px solid var(--hairline)}.funnel-kpi-value{font-size:28px;font-weight:700;letter-spacing:-.03em;line-height:1.1;color:var(--ink)}.funnel-kpi-label{margin-top:4px;font-size:13px;font-weight:600;color:var(--ink)}.funnel-kpi-hint{margin-top:2px;font-size:12px}.funnel-steps{list-style:none;margin:0;padding:0;display:grid;gap:0}.funnel-step{display:grid;grid-template-columns:36px minmax(0,1fr);gap:12px;align-items:start;padding:10px 0}.funnel-step-index{width:28px;height:28px;margin-top:2px;border-radius:999px;background:var(--glass-green-soft);color:var(--pane-ink);display:grid;place-items:center;font-size:13px;font-weight:700}.funnel-step-main{display:grid;gap:8px;min-width:0}.funnel-step-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;flex-wrap:wrap}.funnel-step-title{display:flex;flex-wrap:wrap;align-items:baseline;gap:10px;min-width:0}.step-name{font-weight:650;font-size:15px}.funnel-step-count{font-size:22px;font-weight:700;letter-spacing:-.02em;font-variant-numeric:tabular-nums}.funnel-step-rates{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 10px;font-size:13px}.funnel-rate-primary{font-size:18px;font-weight:700;font-variant-numeric:tabular-nums;color:var(--glass-green)}.funnel-rate-prev{font-size:12px}.funnel-track{background:var(--field);border-radius:8px;height:34px;overflow:hidden;border:1px solid var(--hairline)}.funnel-bar{height:100%;background:linear-gradient(90deg,var(--glass-green),color-mix(in srgb,var(--glass-green) 70%,var(--glass-teal)));border-radius:7px;min-width:0;transition:width .25s ease}.funnel-bridge{list-style:none;display:grid;grid-template-columns:36px minmax(0,1fr);gap:12px;padding:0}.funnel-bridge-rail{grid-column:2;display:flex;flex-wrap:wrap;gap:8px 14px;align-items:center;margin:0 0 0 4px;padding:6px 0 6px 14px;border-left:2px dashed color-mix(in srgb,var(--hairline) 80%,var(--glass-green));font-size:12px}.funnel-bridge-convert{color:var(--glass-green);font-weight:650}.funnel-bridge-drop{color:var(--bad);font-weight:550}.funnel-breakdowns{display:grid;gap:10px;padding-top:8px;border-top:1px solid var(--hairline)}.funnel-breakdowns-title{margin:0;font-size:14px;font-weight:650}.funnel-breakdown-table th,.funnel-breakdown-table td{vertical-align:top}.funnel-bd-count{font-weight:600;font-variant-numeric:tabular-nums}.funnel-bd-conv{position:relative;display:grid;align-items:center;min-width:88px;font-weight:650;font-variant-numeric:tabular-nums}.funnel-bd-conv-bar{position:absolute;inset:0 auto 0 0;background:color-mix(in srgb,var(--glass-green) 18%,transparent);border-radius:4px;max-width:100%}.funnel-bd-conv>span:last-child{position:relative;padding:2px 6px}table.retention td.heat{background:color-mix(in srgb,var(--glass-green) calc(var(--heat) * .85%),transparent)}table.retention tr.average td{font-weight:600}.vitals{display:grid;grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:12px;margin:0}.vital{border:1px solid var(--hairline);border-radius:8px;padding:10px 12px}.vital dt{font-weight:600}.vital dd{margin:2px 0;font-size:20px;font-weight:700;font-variant-numeric:tabular-nums}.vital.good dd{color:var(--good)}.vital.ok dd{color:var(--warn)}.vital.poor dd{color:var(--bad)}.table-wrap{overflow-x:auto}table{width:100%;border-collapse:collapse;font-size:14px}th{text-align:left;font-weight:600;color:var(--muted);font-size:12.5px;padding:6px 10px;border-bottom:1px solid var(--hairline)}td{padding:8px 10px;border-bottom:1px solid var(--hairline);vertical-align:top}tr:last-child td{border-bottom:0}td input{width:100%}button,.button{font:inherit;font-weight:600;font-size:14px;border-radius:8px;padding:7px 14px;border:1px solid var(--hairline);background:var(--surface);color:var(--ink);cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;gap:6px}button:hover,.button:hover{border-color:var(--muted)}.primary{background:var(--glass-green);border-color:var(--glass-green);color:#fff}.primary:hover{filter:brightness(1.08);border-color:var(--glass-green)}.ghost{background:transparent}button.small{padding:3px 9px;font-size:12.5px}input[type=text],input[type=search],input[type=password],select,textarea{font:inherit;color:var(--ink);background:var(--surface);border:1px solid var(--hairline);border-radius:8px;padding:7px 10px;min-width:0}textarea{width:100%;font-family:var(--mono);font-size:13px}.sql-editor{min-height:180px}.field{display:grid;gap:4px;font-size:13px;font-weight:600;color:var(--muted)}.field input,.field select,.field textarea{font-weight:400;font-size:15px}.switch{display:inline-flex;align-items:center;gap:8px;font-size:14px;font-weight:500;cursor:pointer;white-space:nowrap}.switch input{accent-color:var(--glass-green);width:16px;height:16px}.range{display:flex;gap:12px;align-items:center}.range input{flex:1;accent-color:var(--glass-green)}.stack{display:grid;gap:14px;max-width:560px}.row-actions{display:inline-flex;gap:.4rem;flex-wrap:wrap;align-items:center}.cohort-form{margin-top:1rem;padding-top:1rem;border-top:1px solid var(--hairline)}.form-row{display:flex;flex-wrap:wrap;gap:12px 16px;align-items:flex-end}.series-row{display:flex;gap:12px;align-items:flex-end;flex-wrap:wrap;width:100%}.steps-editor{width:100%;margin:0;padding-left:22px;display:grid;gap:8px}.steps-editor li input{width:min(360px,70%);margin-right:8px}.steps-editor .step-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.steps-editor .picker{flex:1;min-width:min(280px,100%)}.builder{background:var(--surface);border:1px solid var(--hairline);border-radius:var(--radius);padding:16px 18px;margin:12px 0 16px}.insight-library{display:grid;gap:12px;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));margin-top:8px}.insight-card{display:grid;gap:8px;padding:16px 18px;background:var(--surface);border:1px solid var(--hairline);border-radius:var(--radius);text-decoration:none;color:inherit;transition:border-color .15s ease,transform .15s ease}.insight-card:hover{border-color:var(--glass-green);transform:translateY(-1px)}.insight-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.insight-card-head h2{margin:0;font-size:16px;font-weight:600;line-height:1.3}.insight-card .muted{margin:0;font-size:13px}.save-insight textarea{resize:vertical;min-height:56px}.form-actions{display:flex;gap:12px;align-items:center;margin-top:14px}.inline-form{display:flex;gap:8px;margin-top:12px;flex-wrap:wrap}.search{display:flex;gap:8px;margin-bottom:16px;max-width:520px}.search input{flex:1}.tabs{display:inline-flex;gap:2px;background:var(--field);border:1px solid var(--hairline);border-radius:9px;padding:2px;margin-bottom:10px}.tab{border:0;background:transparent;padding:4px 11px;font-size:13px;color:var(--muted);border-radius:7px}.tab.active{background:var(--surface);color:var(--ink);box-shadow:0 0 0 1px var(--hairline)}.chips{display:flex;gap:8px;flex-wrap:wrap;margin:-6px 0 16px}.chip{font-size:13px;font-weight:500;padding:3px 10px;border-radius:999px;background:var(--glass-green-soft);border-color:transparent}.badge{display:inline-block;font-size:12px;font-weight:600;padding:1px 8px;border-radius:999px;background:var(--field);border:1px solid var(--hairline);margin-left:6px}.badge:first-child{margin-left:0}.badge.good{background:var(--glass-green-soft);border-color:transparent}.badge.bad{background:color-mix(in srgb,var(--glass-ruby) 15%,transparent);color:var(--bad);border-color:transparent}.good{color:var(--good)}.state{padding:18px;border-radius:var(--radius)}.state.loading{color:var(--muted)}.state.empty{border:1px dashed var(--hairline);color:var(--muted);text-align:center}.state.empty p{margin:0 0 10px}.state.error{background:color-mix(in srgb,var(--glass-ruby) 10%,transparent);color:var(--bad)}.state.error p{margin:0}.state .hint{margin-top:6px;color:var(--ink)}.notice{background:color-mix(in srgb,var(--glass-amber) 12%,transparent);padding:8px 12px;border-radius:8px}.upgrade-banner{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:12px 16px 0;padding:10px 14px;background:color-mix(in srgb,var(--glass-amber) 16%,transparent);border:1px solid color-mix(in srgb,var(--glass-amber) 45%,transparent);border-radius:10px;font-size:14px}.upgrade-banner p{margin:0;line-height:1.4}.upgrade-banner code{font-size:13px}.summary{margin:0 0 14px;font-size:15px}.toast{position:fixed;bottom:24px;right:24px;background:var(--ink);color:var(--field);padding:10px 16px;border-radius:8px;font-weight:600;z-index:50}.toast.error{background:var(--bad);color:#fff}dl.props{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:6px 16px;margin:0}dl.props dt{color:var(--muted)}dl.props dd{margin:0;overflow-wrap:anywhere}ul.plain{list-style:none;padding:0;margin:0;display:grid;gap:6px}.code-block{position:relative;background:var(--pane);color:var(--pane-ink);border-radius:8px;padding:10px 12px;margin:8px 0 14px}.code-block pre{margin:0;white-space:pre-wrap;word-break:break-all;padding-right:64px}.code-block button{position:absolute;top:8px;right:8px}.replay-layout{display:grid;grid-template-columns:minmax(0,3fr) minmax(280px,2fr);gap:16px}.replay-stage{background:var(--field);border-radius:8px;overflow:auto;min-height:320px;max-height:560px}.player-bar{display:flex;gap:12px;align-items:center;margin-top:10px}pre.transcript{margin:0;white-space:pre-wrap;font-size:13px;line-height:1.6;max-height:600px;overflow:auto}.key-screen{max-width:420px;margin:14vh auto;padding:0 20px}.key-screen h1{font-size:32px;letter-spacing:-.02em;margin:0 0 8px}@media(max-width:980px){.kpis{grid-template-columns:repeat(3,minmax(0,1fr))}.kpi:nth-child(4){border-left:0}.kpi:nth-child(n+4){border-top:1px solid var(--hairline)}.grid-2,.replay-layout{grid-template-columns:minmax(0,1fr)}}@media(max-width:720px){.shell{grid-template-columns:minmax(0,1fr)}.sidebar{position:static;height:auto;border-right:0;border-bottom:1px solid var(--hairline);padding:12px}.sidebar ul{display:flex;flex-wrap:wrap;gap:2px}.brand{padding-bottom:10px}.topbar,.content{padding-left:16px;padding-right:16px}.topbar{flex-wrap:wrap}.kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.kpi:nth-child(odd){border-left:0}.kpi:nth-child(n+3){border-top:1px solid var(--hairline)}.page-head{flex-direction:column}}.picker{position:relative;min-width:200px}.picker-trigger{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:38px;padding:6px 10px;background:var(--field);border:1px solid var(--hairline);border-radius:8px;color:var(--ink);font:inherit;text-align:left;cursor:pointer}.picker-trigger:hover,.picker.open .picker-trigger{border-color:var(--glass-green)}.picker-trigger.empty .picker-trigger-value{color:var(--muted)}.picker-trigger-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--mono);font-size:13px}.picker-chevron{color:var(--muted);font-size:11px}.picker-pop{position:fixed;z-index:80;display:grid;grid-template-rows:auto 1fr;max-height:min(420px,calc(100vh - 24px));background:var(--surface);border:1px solid var(--hairline);border-radius:12px;box-shadow:0 12px 40px color-mix(in srgb,var(--ink) 18%,transparent);overflow:hidden}.picker-search{width:100%;margin:0;padding:12px 14px;border:0;border-bottom:1px solid var(--hairline);border-radius:0;background:transparent;font:inherit}.picker-body{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);min-height:280px;max-height:340px}.picker-list{overflow:auto;border-right:1px solid var(--hairline);padding:6px 0}.picker-group-label{padding:10px 14px 4px;font-size:11px;font-weight:650;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}.picker-item{display:flex;align-items:baseline;justify-content:space-between;gap:10px;width:100%;padding:8px 14px;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}.picker-item:hover,.picker-item.active{background:color-mix(in srgb,var(--glass-green) 10%,transparent)}.picker-item.selected{background:color-mix(in srgb,var(--glass-green) 16%,transparent)}.picker-item-name{font-family:var(--mono);font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.picker-item-meta{flex:none;font-size:12px;color:var(--muted)}.picker-empty{margin:16px 14px}.picker-detail{overflow:auto;padding:14px 16px;background:color-mix(in srgb,var(--pane) 55%,var(--surface))}.picker-detail-empty,.picker-detail-loading{margin:0;font-size:13px}.picker-detail-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-bottom:8px}.picker-detail-head h3{margin:0;font-family:var(--mono);font-size:14px;font-weight:650;overflow-wrap:anywhere}.picker-detail-desc{margin:0 0 12px;font-size:13px;line-height:1.45}.picker-detail-props h4{margin:0 0 6px;font-size:12px;font-weight:650;text-transform:uppercase;letter-spacing:.03em;color:var(--muted)}.picker-detail-props ul{list-style:none;margin:0;padding:0;display:grid;gap:8px}.picker-detail-props li{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 10px;font-size:12px}.picker-detail-props code{font-size:12px}.picker-detail-prop-desc{grid-column:1 / -1;color:var(--muted)}.picker-detail-link{display:inline-block;margin-top:14px;font-size:13px}.muted.small,.small.muted{font-size:12px}.field .picker{font-weight:400}.builder-stack{display:grid;gap:14px;width:100%}.series-block,.step-block{display:grid;gap:8px;width:100%;padding-bottom:10px;border-bottom:1px solid var(--hairline)}.series-block:last-of-type,.step-block:last-of-type{border-bottom:0;padding-bottom:0}.filter-editor,.breakdown-editor{display:grid;gap:8px;width:100%}.filter-editor-label{font-size:12px;font-weight:650;letter-spacing:.03em;text-transform:uppercase;color:var(--muted)}.filter-row,.breakdown-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.filter-row .picker,.breakdown-row .picker{flex:1;min-width:min(200px,100%)}.filter-row select{min-width:110px}.filter-row input[type=text],.filter-row input[type=number]{flex:1;min-width:120px}.filter-joiner{flex:none;width:3.2em;font-size:12px;font-weight:650;color:var(--muted);text-align:right}.filter-row .value-input{flex:1.4;min-width:min(220px,100%)}.filter-remove{flex:none;font-size:16px;line-height:1}.filter-actions{display:flex;flex-wrap:wrap;gap:8px}.value-trigger{cursor:pointer}.value-trigger:focus-visible{outline:2px solid var(--glass-green);outline-offset:1px}.value-chips{display:flex;flex-wrap:wrap;gap:4px;min-width:0}.value-chip{display:inline-flex;align-items:center;gap:2px;max-width:100%;padding:1px 2px 1px 8px;border-radius:999px;background:var(--glass-green-soft);color:var(--pane-ink);font-family:var(--mono);font-size:12.5px}.value-chip-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.value-chip-remove{padding:0 6px;border:0;background:transparent;color:inherit;font-size:14px;line-height:1.2;cursor:pointer}.value-chip-remove:hover{color:var(--bad)}.value-pop{grid-template-rows:auto minmax(0,1fr) auto}.value-list{border-right:0;max-height:300px;min-height:120px}.value-item{justify-content:flex-start}.value-item .picker-item-name{flex:1}.value-check{flex:none;display:inline-grid;place-items:center;width:16px;height:16px;border:1px solid var(--hairline);border-radius:4px;font-size:11px;color:#fff}.value-check.on{background:var(--glass-green);border-color:var(--glass-green)}.value-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 14px;border-top:1px solid var(--hairline)}.cohort-form{display:grid;gap:14px}.cohort-form .field .picker,.cohort-filters{max-width:760px}.cohort-submit{align-items:center}.cohort-estimate{margin:0}@media(max-width:640px){.picker-body{grid-template-columns:1fr}.picker-list{border-right:0;border-bottom:1px solid var(--hairline);max-height:180px}}@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}.replayer-wrapper{position:relative}.replayer-mouse{position:absolute;width:20px;height:20px;transition:left .05s linear,top .05s linear;background-size:contain;background-position:center center;background-repeat:no-repeat;background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzMwMHB4JyB3aWR0aD0nMzAwcHgnICBmaWxsPSIjMDAwMDAwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGRhdGEtbmFtZT0iTGF5ZXIgMSIgdmlld0JveD0iMCAwIDUwIDUwIiB4PSIwcHgiIHk9IjBweCI+PHRpdGxlPkRlc2lnbl90bnA8L3RpdGxlPjxwYXRoIGQ9Ik00OC43MSw0Mi45MUwzNC4wOCwyOC4yOSw0NC4zMywxOEExLDEsMCwwLDAsNDQsMTYuMzlMMi4zNSwxLjA2QTEsMSwwLDAsMCwxLjA2LDIuMzVMMTYuMzksNDRhMSwxLDAsMCwwLDEuNjUuMzZMMjguMjksMzQuMDgsNDIuOTEsNDguNzFhMSwxLDAsMCwwLDEuNDEsMGw0LjM4LTQuMzhBMSwxLDAsMCwwLDQ4LjcxLDQyLjkxWm0tNS4wOSwzLjY3TDI5LDMyYTEsMSwwLDAsMC0xLjQxLDBsLTkuODUsOS44NUwzLjY5LDMuNjlsMzguMTIsMTRMMzIsMjcuNThBMSwxLDAsMCwwLDMyLDI5TDQ2LjU5LDQzLjYyWiI+PC9wYXRoPjwvc3ZnPg==);border-color:transparent}.replayer-mouse:after{content:"";display:inline-block;width:20px;height:20px;background:#4950f6;border-radius:100%;transform:translate(-50%,-50%);opacity:.3}.replayer-mouse.active:after{animation:click .2s ease-in-out 1}.replayer-mouse.touch-device{background-image:none;width:70px;height:70px;border-width:4px;border-style:solid;border-radius:100%;margin-left:-37px;margin-top:-37px;border-color:#4950f600;transition:left 0s linear,top 0s linear,border-color .2s ease-in-out}.replayer-mouse.touch-device.touch-active{border-color:#4950f6;transition:left .25s linear,top .25s linear,border-color .2s ease-in-out}.replayer-mouse.touch-device:after{opacity:0}.replayer-mouse.touch-device.active:after{animation:touch-click .2s ease-in-out 1}.replayer-mouse-tail{position:absolute;pointer-events:none}@keyframes click{0%{opacity:.3;width:20px;height:20px}50%{opacity:.5;width:10px;height:10px}}@keyframes touch-click{0%{opacity:0;width:20px;height:20px}50%{opacity:.5;width:10px;height:10px}}\n' };
9
9
 
10
10
  // packages/core/src/events.ts
11
11
  var SYSTEM_EVENTS = {
@@ -94,6 +94,7 @@ var FILTER_OPS = [
94
94
  "is_set",
95
95
  "is_not_set"
96
96
  ];
97
+ var COHORT_PROPERTY = "cohort";
97
98
  function parseProperty(input2) {
98
99
  const raw = input2.trim();
99
100
  if (!raw) throw new TypeError("Property name cannot be empty");
@@ -155,84 +156,6 @@ function toList(value) {
155
156
  return (Array.isArray(value) ? value : [value]).map(String);
156
157
  }
157
158
 
158
- // packages/core/src/sql/filters.ts
159
- var col = (name, alias) => alias ? `${alias}.${name}` : name;
160
- function propertyText(ref, d, alias) {
161
- const r = typeof ref === "string" ? parseProperty(ref) : ref;
162
- if (r.kind === "column") return col(r.column, alias);
163
- return d.jsonText(col(r.kind === "person" ? "person_props" : "props", alias), r.path);
164
- }
165
- function propertyNumber(ref, d, alias) {
166
- const r = typeof ref === "string" ? parseProperty(ref) : ref;
167
- if (r.kind === "column") {
168
- throw new TypeError(`"${r.column}" is a text column; numeric operations need an event or person property.`);
169
- }
170
- return d.jsonNumber(col(r.kind === "person" ? "person_props" : "props", alias), r.path);
171
- }
172
- function breakdownExpr(property, d, alias) {
173
- return `COALESCE(NULLIF(${propertyText(property, d, alias)}, ''), '(none)')`;
174
- }
175
- function filterSql(filter, d, alias) {
176
- const ref = parseProperty(filter.property);
177
- const op = filter.op ?? "eq";
178
- const value = filter.value;
179
- const text2 = propertyText(ref, d, alias);
180
- const isSet = ref.kind === "column" ? `(${text2} IS NOT NULL AND ${text2} <> '')` : d.jsonExists(col(ref.kind === "person" ? "person_props" : "props", alias), ref.path);
181
- const need = (what) => {
182
- if (value === void 0 || value === null) {
183
- throw new TypeError(`Filter on "${filter.property}" with op "${op}" needs a ${what} value.`);
184
- }
185
- };
186
- switch (op) {
187
- case "is_set":
188
- return isSet;
189
- case "is_not_set":
190
- return `NOT ${isSet}`;
191
- case "eq":
192
- case "neq": {
193
- need("value");
194
- let cond;
195
- if (typeof value === "boolean" && ref.kind !== "column") {
196
- cond = `${d.jsonBool(col(ref.kind === "person" ? "person_props" : "props", alias), ref.path)} = ${d.bool(value)}`;
197
- } else if (typeof value === "number" && ref.kind !== "column") {
198
- cond = `${propertyNumber(ref, d, alias)} = ${d.num(value)}`;
199
- } else {
200
- cond = `${text2} = ${d.str(String(value))}`;
201
- }
202
- return op === "eq" ? `(${cond})` : `(${text2} IS NULL OR NOT (${cond}))`;
203
- }
204
- case "contains":
205
- need("text");
206
- return d.containsIgnoreCase(text2, String(value));
207
- case "not_contains":
208
- need("text");
209
- return `(${text2} IS NULL OR NOT ${d.containsIgnoreCase(text2, String(value))})`;
210
- case "in":
211
- case "not_in": {
212
- const list = toList(value);
213
- if (list.length === 0) throw new TypeError(`Filter "${filter.property}" with op "${op}" needs a non-empty list.`);
214
- const inList = `${text2} IN (${list.map((v) => d.str(v)).join(", ")})`;
215
- return op === "in" ? `(${inList})` : `(${text2} IS NULL OR NOT ${inList})`;
216
- }
217
- case "gt":
218
- case "gte":
219
- case "lt":
220
- case "lte": {
221
- need("numeric");
222
- const n = Number(value);
223
- if (!Number.isFinite(n)) throw new TypeError(`Filter "${filter.property}" with op "${op}" needs a number.`);
224
- const sym = { gt: ">", gte: ">=", lt: "<", lte: "<=" }[op];
225
- return `(${propertyNumber(ref, d, alias)} ${sym} ${d.num(n)})`;
226
- }
227
- default:
228
- throw new TypeError(`Unknown filter op "${String(op)}".`);
229
- }
230
- }
231
- function filtersSql(filters, d, alias) {
232
- if (!filters || filters.length === 0) return "1 = 1";
233
- return filters.map((f) => filterSql(f, d, alias)).join(" AND ");
234
- }
235
-
236
159
  // packages/core/src/time.ts
237
160
  var HOUR_MS = 36e5;
238
161
  var DAY_MS = 864e5;
@@ -325,6 +248,23 @@ function iso(ms) {
325
248
 
326
249
  // packages/core/src/sql/source.ts
327
250
  function eventsCte(d, o) {
251
+ const cohort = (o.filters ?? []).filter((f) => f.property === COHORT_PROPERTY);
252
+ const rows = resolvedEvents(d, { ...o, filters: (o.filters ?? []).filter((f) => f.property !== COHORT_PROPERTY) });
253
+ if (cohort.length === 0) return `ev AS (
254
+ ${rows}
255
+ )`;
256
+ return `ev AS (
257
+ SELECT * FROM (
258
+ ${rows}
259
+ ) ev_all
260
+ WHERE ${filtersSql(cohort, d)}
261
+ )`;
262
+ }
263
+ function cohortMembersSql(d, c) {
264
+ const filters = c.filters.filter((f) => f.property !== COHORT_PROPERTY);
265
+ return `SELECT DISTINCT cm.pid FROM (${resolvedEvents(d, { project: c.project, from: c.from, to: c.to, events: c.events, filters })}) cm`;
266
+ }
267
+ function resolvedEvents(d, o) {
328
268
  const where = [
329
269
  `e.project = ${d.str(o.project)}`,
330
270
  `e.ts_ms >= ${d.num(Math.floor(o.from))}`,
@@ -335,8 +275,7 @@ function eventsCte(d, o) {
335
275
  where.push(`e.event IN (${unique.map((n) => d.str(n)).join(", ")})`);
336
276
  }
337
277
  if (o.filters && o.filters.length > 0) where.push(filtersSql(o.filters, d, "e"));
338
- return `ev AS (
339
- SELECT e.*,
278
+ return `SELECT e.*,
340
279
  CASE WHEN e.user_id IS NOT NULL AND e.user_id <> '' THEN e.user_id ELSE COALESCE(i.person_id, e.person_id) END AS pid
341
280
  FROM ${d.table("events")} e
342
281
  LEFT JOIN (
@@ -345,8 +284,7 @@ function eventsCte(d, o) {
345
284
  WHERE project = ${d.str(o.project)}
346
285
  GROUP BY distinct_id
347
286
  ) i ON i.distinct_id = e.distinct_id
348
- WHERE ${where.join("\n AND ")}
349
- )`;
287
+ WHERE ${where.join("\n AND ")}`;
350
288
  }
351
289
  function bucketExpr(d, tsMs, interval, utcOffsetMinutes = 0) {
352
290
  const off = utcOffsetMinutes * 6e4;
@@ -378,6 +316,108 @@ function text(value) {
378
316
  return value === null || value === void 0 ? "" : String(value);
379
317
  }
380
318
 
319
+ // packages/core/src/sql/filters.ts
320
+ var col = (name, alias) => alias ? `${alias}.${name}` : name;
321
+ function propertyText(ref, d, alias) {
322
+ const r = typeof ref === "string" ? parseProperty(ref) : ref;
323
+ if (r.kind === "column") return col(r.column, alias);
324
+ return d.jsonText(col(r.kind === "person" ? "person_props" : "props", alias), r.path);
325
+ }
326
+ function propertyNumber(ref, d, alias) {
327
+ const r = typeof ref === "string" ? parseProperty(ref) : ref;
328
+ if (r.kind === "column") {
329
+ throw new TypeError(`"${r.column}" is a text column; numeric operations need an event or person property.`);
330
+ }
331
+ return d.jsonNumber(col(r.kind === "person" ? "person_props" : "props", alias), r.path);
332
+ }
333
+ function breakdownExpr(property, d, alias) {
334
+ const props = (Array.isArray(property) ? property : [property]).map((p) => p.trim()).filter(Boolean);
335
+ if (props.length === 0) return `'(none)'`;
336
+ const parts = props.map((p) => `COALESCE(NULLIF(${propertyText(p, d, alias)}, ''), '(none)')`);
337
+ if (parts.length === 1) return parts[0];
338
+ return parts.join(` || ' \xB7 ' || `);
339
+ }
340
+ function breakdownProperties(breakdown) {
341
+ if (!breakdown) return [];
342
+ return (Array.isArray(breakdown) ? [...breakdown] : [breakdown]).map((p) => p.trim()).filter(Boolean);
343
+ }
344
+ function filterSql(filter, d, alias) {
345
+ if (filter.property === COHORT_PROPERTY) return cohortFilterSql(filter, d, alias);
346
+ const ref = parseProperty(filter.property);
347
+ const op = filter.op ?? "eq";
348
+ const value = filter.value;
349
+ const text2 = propertyText(ref, d, alias);
350
+ const isSet = ref.kind === "column" ? `(${text2} IS NOT NULL AND ${text2} <> '')` : d.jsonExists(col(ref.kind === "person" ? "person_props" : "props", alias), ref.path);
351
+ const need = (what) => {
352
+ if (value === void 0 || value === null) {
353
+ throw new TypeError(`Filter on "${filter.property}" with op "${op}" needs a ${what} value.`);
354
+ }
355
+ };
356
+ switch (op) {
357
+ case "is_set":
358
+ return isSet;
359
+ case "is_not_set":
360
+ return `NOT ${isSet}`;
361
+ case "eq":
362
+ case "neq": {
363
+ need("value");
364
+ let cond;
365
+ if (typeof value === "boolean" && ref.kind !== "column") {
366
+ cond = `${d.jsonBool(col(ref.kind === "person" ? "person_props" : "props", alias), ref.path)} = ${d.bool(value)}`;
367
+ } else if (typeof value === "number" && ref.kind !== "column") {
368
+ cond = `${propertyNumber(ref, d, alias)} = ${d.num(value)}`;
369
+ } else {
370
+ cond = `${text2} = ${d.str(String(value))}`;
371
+ }
372
+ return op === "eq" ? `(${cond})` : `(${text2} IS NULL OR NOT (${cond}))`;
373
+ }
374
+ case "contains":
375
+ need("text");
376
+ return d.containsIgnoreCase(text2, String(value));
377
+ case "not_contains":
378
+ need("text");
379
+ return `(${text2} IS NULL OR NOT ${d.containsIgnoreCase(text2, String(value))})`;
380
+ case "in":
381
+ case "not_in": {
382
+ const list = toList(value);
383
+ if (list.length === 0) throw new TypeError(`Filter "${filter.property}" with op "${op}" needs a non-empty list.`);
384
+ const inList = `${text2} IN (${list.map((v) => d.str(v)).join(", ")})`;
385
+ return op === "in" ? `(${inList})` : `(${text2} IS NULL OR NOT ${inList})`;
386
+ }
387
+ case "gt":
388
+ case "gte":
389
+ case "lt":
390
+ case "lte": {
391
+ need("numeric");
392
+ const n = Number(value);
393
+ if (!Number.isFinite(n)) throw new TypeError(`Filter "${filter.property}" with op "${op}" needs a number.`);
394
+ const sym = { gt: ">", gte: ">=", lt: "<", lte: "<=" }[op];
395
+ return `(${propertyNumber(ref, d, alias)} ${sym} ${d.num(n)})`;
396
+ }
397
+ default:
398
+ throw new TypeError(`Unknown filter op "${String(op)}".`);
399
+ }
400
+ }
401
+ function cohortFilterSql(filter, d, alias) {
402
+ const op = filter.op ?? "eq";
403
+ if (op !== "eq" && op !== "in" && op !== "neq" && op !== "not_in") {
404
+ throw new TypeError(`Cohort filters use "eq"/"in" or "neq"/"not_in", not "${op}".`);
405
+ }
406
+ const keys = toList(filter.value);
407
+ if (keys.length === 0) throw new TypeError("A cohort filter needs a cohort key as its value.");
408
+ const members2 = keys.map((key) => {
409
+ const c = filter.cohorts?.[key];
410
+ if (!c) throw new TypeError(`Cohort "${key}" was not resolved. Run the query through the Glass API, which loads saved cohorts.`);
411
+ return `${col("pid", alias)} IN (${cohortMembersSql(d, c)})`;
412
+ });
413
+ const any2 = `(${members2.join(" OR ")})`;
414
+ return op === "eq" || op === "in" ? any2 : `(NOT ${any2})`;
415
+ }
416
+ function filtersSql(filters, d, alias) {
417
+ if (!filters || filters.length === 0) return "1 = 1";
418
+ return filters.map((f) => filterSql(f, d, alias)).join(" AND ");
419
+ }
420
+
381
421
  // packages/core/src/insights/types.ts
382
422
  function fmt(n, kind = "count") {
383
423
  if (!Number.isFinite(n)) return "\u2013";
@@ -406,9 +446,10 @@ function compileFunnel(spec, ctx, range, windowMs) {
406
446
  WHERE event = ${d.str(first.event)} AND ts_ms < ${d.num(range.to)} AND ${filtersSql(first.filters, d)}
407
447
  GROUP BY pid
408
448
  )`);
409
- if (spec.breakdown) {
449
+ const breakdowns = breakdownProperties(spec.breakdown);
450
+ if (breakdowns.length) {
410
451
  ctes.push(`b AS (
411
- SELECT s1.pid, MIN(${breakdownExpr(spec.breakdown, d, "ev")}) AS bd
452
+ SELECT s1.pid, MIN(${breakdownExpr(breakdowns, d, "ev")}) AS bd
412
453
  FROM s1 JOIN ev ON ev.pid = s1.pid AND ev.ts_ms = s1.t1
413
454
  WHERE ev.event = ${d.str(first.event)} AND ${filtersSql(first.filters, d, "ev")}
414
455
  GROUP BY s1.pid
@@ -428,17 +469,24 @@ function compileFunnel(spec, ctx, range, windowMs) {
428
469
  GROUP BY ${prev}.pid, ${carried.join(", ")}
429
470
  )`);
430
471
  }
431
- const bdSelect = spec.breakdown ? `COALESCE(b.bd, '(none)')` : `''`;
432
- const bdJoin = (s) => spec.breakdown ? ` LEFT JOIN b ON b.pid = ${s}.pid` : "";
433
- const bdGroup = spec.breakdown ? ` GROUP BY COALESCE(b.bd, '(none)')` : "";
472
+ const bdSelect = breakdowns.length ? `COALESCE(b.bd, '(none)')` : `''`;
473
+ const bdJoin = (s) => breakdowns.length ? ` LEFT JOIN b ON b.pid = ${s}.pid` : "";
474
+ const bdGroup = breakdowns.length ? ` GROUP BY COALESCE(b.bd, '(none)')` : "";
434
475
  const selects = steps.map((_, i) => {
435
476
  const k = i + 1;
436
477
  const s = `s${k}`;
437
478
  const dt = k === 1 ? "0" : `SUM(${s}.t${k} - ${s}.t${k - 1})`;
438
479
  return `SELECT ${k} AS step, ${bdSelect} AS bd, COUNT(*) AS n, ${dt} AS dt_ms FROM ${s}${bdJoin(s)}${bdGroup}`;
439
480
  });
440
- return `WITH ${ctes.join(",\n")}
441
- ${selects.join("\nUNION ALL\n")}`;
481
+ const maxUnion = 5;
482
+ const head = `WITH ${ctes.join(",\n")}
483
+ `;
484
+ if (selects.length <= maxUnion) return [head + selects.join("\nUNION ALL\n")];
485
+ const chunks = [];
486
+ for (let i = 0; i < selects.length; i += maxUnion) {
487
+ chunks.push(head + selects.slice(i, i + maxUnion).join("\nUNION ALL\n"));
488
+ }
489
+ return chunks;
442
490
  }
443
491
  function shapeSteps(spec, counts) {
444
492
  const firstCount = counts.get(1)?.n ?? 0;
@@ -459,7 +507,7 @@ async function runFunnel(spec, ctx) {
459
507
  const range = resolveRange(spec.from, spec.to, ctx.now);
460
508
  const windowMs = parseDuration(spec.window ?? "7d");
461
509
  const sql = compileFunnel(spec, ctx, range, windowMs);
462
- const rows = await ctx.execute(sql);
510
+ const rows = (await Promise.all(sql.map((q) => ctx.execute(q)))).flat();
463
511
  const byValue = /* @__PURE__ */ new Map();
464
512
  for (const row of rows) {
465
513
  const value = text(row.bd);
@@ -478,11 +526,11 @@ async function runFunnel(spec, ctx) {
478
526
  kind: "funnel",
479
527
  windowSeconds: windowMs / 1e3,
480
528
  steps: shapeSteps(spec, total),
481
- sql: [sql],
529
+ sql,
482
530
  range: { from: iso(range.from), to: iso(range.to) },
483
531
  summary: ""
484
532
  };
485
- if (spec.breakdown) {
533
+ if (breakdownProperties(spec.breakdown).length) {
486
534
  const limit = spec.breakdownLimit ?? 10;
487
535
  const ranked = [...byValue.entries()].sort((a, b) => (b[1].get(1)?.n ?? 0) - (a[1].get(1)?.n ?? 0));
488
536
  const top = ranked.slice(0, limit).map(([value, steps]) => ({ value, steps: shapeSteps(spec, steps) }));
@@ -20088,21 +20136,21 @@ function visit(schema, fnOrHandlers) {
20088
20136
  const h = fnOrHandlers[node2._zod.def.type];
20089
20137
  return h ? h(node2, rewritten) : node2;
20090
20138
  };
20091
- const cache3 = /* @__PURE__ */ new Map();
20139
+ const cache4 = /* @__PURE__ */ new Map();
20092
20140
  function run(s) {
20093
- const cached2 = cache3.get(s);
20141
+ const cached2 = cache4.get(s);
20094
20142
  if (cached2 === RESOLVING) {
20095
20143
  return new $ZodLazy({
20096
20144
  type: "lazy",
20097
- getter: () => cache3.get(s)
20145
+ getter: () => cache4.get(s)
20098
20146
  });
20099
20147
  }
20100
20148
  if (cached2 !== void 0)
20101
20149
  return cached2;
20102
- cache3.set(s, RESOLVING);
20150
+ cache4.set(s, RESOLVING);
20103
20151
  const inner = mapInner(s);
20104
20152
  const mapped = fn(inner, inner !== s);
20105
- cache3.set(s, mapped);
20153
+ cache4.set(s, mapped);
20106
20154
  return mapped;
20107
20155
  }
20108
20156
  function mapInner(s) {
@@ -20307,7 +20355,7 @@ function date4(params2) {
20307
20355
  var time3 = external_exports.union([external_exports.string(), external_exports.number()]).describe('ISO date ("2026-10-01"), epoch ms, "now", "today", "yesterday", or a relative offset like "-30d", "-12h", "-3mo".');
20308
20356
  var filterSchema = external_exports.object({
20309
20357
  property: external_exports.string().describe(
20310
- 'Property to test. Built-in columns: path, url, host, referrer_host, utm_source, utm_medium, utm_campaign, country, region, city, device, browser, os, event, session_id, user_id. Anything else is an event property ("plan" or "props.plan"); prefix with "person." for person properties ("person.plan").'
20358
+ 'Property to test. Built-in columns: path, url, host, referrer_host, utm_source, utm_medium, utm_campaign, country, region, city, device, browser, os, event, session_id, user_id. Anything else is an event property ("plan" or "props.plan"); prefix with "person." for person properties ("person.plan"). Use "cohort" with a saved cohort key as the value (ops eq/in or neq/not_in) to keep only people in (or not in) that cohort; list keys with list_cohorts.'
20311
20359
  ),
20312
20360
  op: external_exports.enum(FILTER_OPS).optional().describe('Comparison operator. Defaults to "eq".'),
20313
20361
  value: external_exports.union([external_exports.string(), external_exports.number(), external_exports.boolean(), external_exports.array(external_exports.union([external_exports.string(), external_exports.number()]))]).optional().describe('Value to compare with. Lists for "in"/"not_in". Omit for "is_set"/"is_not_set".')
@@ -20336,14 +20384,18 @@ var trendsSpec = external_exports.object({
20336
20384
  })
20337
20385
  ).min(1).max(10).describe("One line per series."),
20338
20386
  interval: external_exports.enum(["hour", "day", "week", "month"]).optional().describe('Bucket size. Defaults to "day".'),
20339
- breakdown: external_exports.string().optional().describe('Split each series by this property, e.g. "browser" or "person.plan".'),
20387
+ breakdown: external_exports.union([external_exports.string(), external_exports.array(external_exports.string()).min(1).max(4)]).optional().describe(
20388
+ 'Split each series by one or more properties, e.g. "browser", "person.plan", or ["browser","utm_source"]. Multiple properties are joined with " \xB7 ".'
20389
+ ),
20340
20390
  breakdownLimit: external_exports.number().int().min(1).max(50).optional().describe("Top N breakdown values to keep. Default 10.")
20341
20391
  }).describe("Event counts or aggregates over time.");
20342
20392
  var funnelSpec = external_exports.object({
20343
20393
  ...common,
20344
20394
  steps: external_exports.array(stepSchema).min(2).max(10).describe("Ordered steps. A person converts by doing each step after the previous one."),
20345
20395
  window: external_exports.union([external_exports.string(), external_exports.number()]).optional().describe('Maximum time from the first step to the last, e.g. "1h", "7d". Seconds if a number. Default "7d".'),
20346
- breakdown: external_exports.string().optional().describe('Split by a property of the first step, e.g. "utm_source".'),
20396
+ breakdown: external_exports.union([external_exports.string(), external_exports.array(external_exports.string()).min(1).max(4)]).optional().describe(
20397
+ 'Split by one or more properties of the first step, e.g. "utm_source" or ["utm_source","device"]. Multiple properties are joined with " \xB7 ".'
20398
+ ),
20347
20399
  breakdownLimit: external_exports.number().int().min(1).max(50).optional()
20348
20400
  }).describe("Conversion through an ordered sequence of events.");
20349
20401
  var retentionSpec = external_exports.object({
@@ -20409,7 +20461,8 @@ function compileTrendsSeries(spec, series, ctx, range) {
20409
20461
  events: series.event === "*" ? void 0 : [series.event],
20410
20462
  filters: spec.filters
20411
20463
  });
20412
- const bd = spec.breakdown ? breakdownExpr(spec.breakdown, d) : "''";
20464
+ const breakdowns = breakdownProperties(spec.breakdown);
20465
+ const bd = breakdowns.length ? breakdownExpr(breakdowns, d) : "''";
20413
20466
  const val = series.property ? propertyNumber(series.property, d) : "NULL";
20414
20467
  const inner = `SELECT ${bucketExpr(d, "ts_ms", interval, spec.utcOffsetMinutes)} AS bucket, ${bd} AS bd, pid, session_id, ${val} AS val
20415
20468
  FROM ev WHERE ${filtersSql(series.filters, d)}`;
@@ -20461,11 +20514,12 @@ async function runTrends(spec, ctx) {
20461
20514
  byValue.set(key, values);
20462
20515
  }
20463
20516
  const totalFor = (key) => key === "Other" ? ranked.filter((r) => !keep.has(r.bd)).reduce((a, r) => a + r.value, 0) : ranked.find((r) => r.bd === key)?.value ?? 0;
20464
- const keys = spec.breakdown ? [...keep, ...byValue.has("Other") ? ["Other"] : []] : [""];
20517
+ const hasBreakdown = breakdownProperties(spec.breakdown).length > 0;
20518
+ const keys = hasBreakdown ? [...keep, ...byValue.has("Other") ? ["Other"] : []] : [""];
20465
20519
  for (const key of keys) {
20466
20520
  out.push({
20467
- label: spec.breakdown ? `${label} \xB7 ${key}` : label,
20468
- breakdown: spec.breakdown ? key : null,
20521
+ label: hasBreakdown ? `${label} \xB7 ${key}` : label,
20522
+ breakdown: hasBreakdown ? key : null,
20469
20523
  values: byValue.get(key) ?? new Array(buckets.length).fill(0),
20470
20524
  total: totalFor(key)
20471
20525
  });
@@ -20484,6 +20538,7 @@ async function runTrends(spec, ctx) {
20484
20538
  }
20485
20539
 
20486
20540
  // packages/core/src/insights/web.ts
20541
+ var MAX_UNION = 5;
20487
20542
  var WEB_BREAKDOWNS = {
20488
20543
  pages: "Top pages",
20489
20544
  entry_pages: "Entry pages",
@@ -20558,8 +20613,12 @@ function breakdownsSql(d, ctx, range, filters) {
20558
20613
  simple("os", none("os")),
20559
20614
  simple("errors", none(d.jsonText("props", ["message"])), SYSTEM_EVENTS.exception)
20560
20615
  ];
20561
- return `WITH ${cte}
20562
- ${parts.join("\nUNION ALL\n")}`;
20616
+ const chunks = [];
20617
+ for (let i = 0; i < parts.length; i += MAX_UNION) {
20618
+ chunks.push(`WITH ${cte}
20619
+ ${parts.slice(i, i + MAX_UNION).join("\nUNION ALL\n")}`);
20620
+ }
20621
+ return chunks;
20563
20622
  }
20564
20623
  function vitalsSql(d, ctx, range, filters) {
20565
20624
  return `WITH ${eventsCte(d, { project: ctx.project, ...range, events: [SYSTEM_EVENTS.webVitals], filters })}
@@ -20591,20 +20650,22 @@ async function runWeb(spec, ctx) {
20591
20650
  SELECT bucket, COUNT(DISTINCT distinct_id) AS visitors, COUNT(*) AS pageviews
20592
20651
  FROM (SELECT ${bucketExpr(d, "ts_ms", interval, spec.utcOffsetMinutes)} AS bucket, distinct_id FROM ev) t
20593
20652
  GROUP BY bucket ORDER BY bucket LIMIT 5000`;
20653
+ const breakdownQueries = breakdownsSql(d, ctx, range, spec.filters);
20594
20654
  const queries = {
20595
20655
  totals: totalsSql(d, ctx, range, spec.filters),
20596
20656
  previous: compare ? totalsSql(d, ctx, previous, spec.filters) : null,
20597
20657
  series: seriesSql,
20598
- breakdowns: breakdownsSql(d, ctx, range, spec.filters),
20658
+ breakdowns: breakdownQueries,
20599
20659
  vitals: vitalsSql(d, ctx, range, spec.filters)
20600
20660
  };
20601
- const [totalsRows, previousRows, seriesRows, breakdownRows, vitalRows] = await Promise.all([
20661
+ const [totalsRows, previousRows, seriesRows, breakdownChunks, vitalRows] = await Promise.all([
20602
20662
  ctx.execute(queries.totals),
20603
20663
  queries.previous ? ctx.execute(queries.previous) : Promise.resolve(null),
20604
20664
  ctx.execute(queries.series),
20605
- ctx.execute(queries.breakdowns),
20665
+ Promise.all(breakdownQueries.map((q) => ctx.execute(q))),
20606
20666
  ctx.execute(queries.vitals)
20607
20667
  ]);
20668
+ const breakdownRows = breakdownChunks.flat();
20608
20669
  const buckets = bucketsBetween(range, interval, spec.utcOffsetMinutes);
20609
20670
  const slot = new Map(buckets.map((b, i) => [b, i]));
20610
20671
  const visitors = new Array(buckets.length).fill(0);
@@ -20645,7 +20706,7 @@ GROUP BY bucket ORDER BY bucket LIMIT 5000`;
20645
20706
  timeseries: { buckets, visitors, pageviews },
20646
20707
  breakdowns,
20647
20708
  vitals,
20648
- sql: [queries.totals, ...queries.previous ? [queries.previous] : [], queries.series, queries.breakdowns, queries.vitals],
20709
+ sql: [queries.totals, ...queries.previous ? [queries.previous] : [], queries.series, ...queries.breakdowns, queries.vitals],
20649
20710
  range: { from: iso(range.from), to: iso(range.to) },
20650
20711
  summary: totals.pageviews === 0 ? "No pageviews in this range." : `${fmt(totals.visitors)} visitors${change(totals.visitors, prev?.visitors)}, ${fmt(totals.pageviews)} pageviews, ${fmt(totals.sessions)} sessions, bounce rate ${fmt(totals.bounceRate, "percent")}. ` + (topPage ? `Top page ${topPage.value} (${fmt(topPage.visitors)} visitors). ` : "") + (topRef ? `Top referrer ${topRef.value}.` : "")
20651
20712
  };
@@ -20961,7 +21022,26 @@ function isInsightKind(kind) {
20961
21022
  }
20962
21023
 
20963
21024
  // packages/core/src/version.ts
20964
- var GLASS_VERSION = "0.1.0";
21025
+ var GLASS_VERSION = "0.2.1";
21026
+ var UPGRADE_COMMAND = "npx @glassanalytics/cli@latest upgrade";
21027
+ function parseSemver(version2) {
21028
+ const m = /^(\d+)\.(\d+)\.(\d+)/.exec(version2.trim());
21029
+ if (!m) return null;
21030
+ return [Number(m[1]), Number(m[2]), Number(m[3])];
21031
+ }
21032
+ function isNewerThan(a, b) {
21033
+ const pa = parseSemver(a);
21034
+ const pb = parseSemver(b);
21035
+ if (!pa || !pb) return a !== b && a > b;
21036
+ for (let i = 0; i < 3; i++) {
21037
+ const d = pa[i] - pb[i];
21038
+ if (d) return d > 0;
21039
+ }
21040
+ return false;
21041
+ }
21042
+ function upgradeMessage(deployed, latest) {
21043
+ return `This Glass deployment is ${deployed}; ${latest} is available. Ask the user to run: ${UPGRADE_COMMAND}`;
21044
+ }
20965
21045
 
20966
21046
  // packages/core/src/hash.ts
20967
21047
  var encoder = new TextEncoder();
@@ -21171,6 +21251,7 @@ await fetch('${o.host}/e', {
21171
21251
  }
21172
21252
  };
21173
21253
  var EVENT_NAMING_GUIDE = 'Name events object_action in snake_case and past tense (signup_completed, plan_upgraded, invite_sent). Put variable details in properties ({ plan: "pro" }), never in the event name. Never send emails, names or other personal data as properties.';
21254
+ var EVENT_DOCUMENTATION_GUIDE = 'After a custom event is shipping, call define_event (or `glass events <name> --describe "\u2026"`). The description must say how and when the event is fired (which user action or code path). Document every property with what it means and which values to expect (e.g. description: "Fired when the user finishes checkout after payment succeeds."; properties: { plan: "Chosen plan id (free|pro|enterprise)", amount: "Charge in the account currency" }). list_events returns undocumented custom events \u2014 document those before relying on them in funnels or trends.';
21174
21255
 
21175
21256
  // packages/core/src/replay-summary.ts
21176
21257
  var EventType = { FullSnapshot: 2, IncrementalSnapshot: 3, Meta: 4 };
@@ -21401,6 +21482,36 @@ function assertReadOnlySql(sql) {
21401
21482
  return trimmed;
21402
21483
  }
21403
21484
 
21485
+ // packages/worker/src/latest.ts
21486
+ var NPM_LATEST = "https://registry.npmjs.org/@glassanalytics/cli/latest";
21487
+ var CACHE_MS = 60 * 60 * 1e3;
21488
+ var cache = null;
21489
+ var inflight = null;
21490
+ var fetcher = fetch;
21491
+ async function fetchLatestVersion() {
21492
+ if (cache && Date.now() - cache.at < CACHE_MS) return cache.latest;
21493
+ if (inflight) return inflight;
21494
+ inflight = (async () => {
21495
+ try {
21496
+ const res = await fetcher(NPM_LATEST, { headers: { Accept: "application/json" } });
21497
+ if (!res.ok) {
21498
+ cache = { at: Date.now(), latest: cache?.latest ?? null };
21499
+ return cache.latest;
21500
+ }
21501
+ const body = await res.json();
21502
+ const latest = typeof body.version === "string" ? body.version : null;
21503
+ cache = { at: Date.now(), latest };
21504
+ return latest;
21505
+ } catch {
21506
+ cache = { at: Date.now(), latest: cache?.latest ?? null };
21507
+ return cache.latest;
21508
+ } finally {
21509
+ inflight = null;
21510
+ }
21511
+ })();
21512
+ return inflight;
21513
+ }
21514
+
21404
21515
  // packages/core/src/flags.ts
21405
21516
  var FLAG_ON = "on";
21406
21517
  function bucketOf(flag, distinctId, purpose = "rollout") {
@@ -21550,14 +21661,14 @@ var toProject = (r) => ({
21550
21661
  allowedOrigins: r.allowed_origins ? JSON.parse(r.allowed_origins) : [],
21551
21662
  createdAt: r.created_at
21552
21663
  });
21553
- var cache = /* @__PURE__ */ new Map();
21664
+ var cache2 = /* @__PURE__ */ new Map();
21554
21665
  var TTL_MS = 3e4;
21555
21666
  async function getProject(db, id) {
21556
- const hit = cache.get(id);
21667
+ const hit = cache2.get(id);
21557
21668
  if (hit && hit.until > Date.now()) return hit.project;
21558
21669
  const row = await db.prepare("SELECT * FROM projects WHERE id = ?").bind(id).first();
21559
21670
  const project2 = row ? toProject(row) : null;
21560
- cache.set(id, { project: project2, until: Date.now() + TTL_MS });
21671
+ cache2.set(id, { project: project2, until: Date.now() + TTL_MS });
21561
21672
  return project2;
21562
21673
  }
21563
21674
  async function listProjects(db) {
@@ -21571,7 +21682,7 @@ async function createProject(db, input2) {
21571
21682
  }
21572
21683
  const now = Date.now();
21573
21684
  await db.prepare("INSERT INTO projects (id, name, allowed_origins, created_at) VALUES (?, ?, ?, ?) ON CONFLICT (id) DO UPDATE SET name = excluded.name, allowed_origins = excluded.allowed_origins").bind(input2.id, input2.name ?? input2.id, input2.allowedOrigins?.length ? JSON.stringify(input2.allowedOrigins) : null, now).run();
21574
- cache.delete(input2.id);
21685
+ cache2.delete(input2.id);
21575
21686
  return await getProject(db, input2.id);
21576
21687
  }
21577
21688
  async function resolveProject(db, requested) {
@@ -21757,14 +21868,14 @@ async function personProperties(ctx, persons) {
21757
21868
  }
21758
21869
 
21759
21870
  // packages/worker/src/flags.ts
21760
- var cache2 = /* @__PURE__ */ new Map();
21871
+ var cache3 = /* @__PURE__ */ new Map();
21761
21872
  var TTL_MS2 = 1e4;
21762
21873
  async function listFlags(db, project2, fresh = false) {
21763
- const hit = cache2.get(project2);
21874
+ const hit = cache3.get(project2);
21764
21875
  if (!fresh && hit && hit.until > Date.now()) return hit.flags;
21765
21876
  const { results } = await db.prepare("SELECT definition FROM flags WHERE project = ? ORDER BY key").bind(project2).all();
21766
21877
  const flags = results.map((r) => JSON.parse(r.definition));
21767
- cache2.set(project2, { flags, until: Date.now() + TTL_MS2 });
21878
+ cache3.set(project2, { flags, until: Date.now() + TTL_MS2 });
21768
21879
  return flags;
21769
21880
  }
21770
21881
  async function getFlag(db, project2, key) {
@@ -21789,7 +21900,7 @@ async function saveFlag(db, project2, input2) {
21789
21900
  `INSERT INTO flags (project, key, definition, created_at, updated_at) VALUES (?, ?, ?, ?, ?)
21790
21901
  ON CONFLICT (project, key) DO UPDATE SET definition = excluded.definition, updated_at = excluded.updated_at`
21791
21902
  ).bind(project2, flag.key, JSON.stringify(flag), now, now).run();
21792
- cache2.delete(project2);
21903
+ cache3.delete(project2);
21793
21904
  const changed = Object.keys(flag).filter(
21794
21905
  (k) => JSON.stringify(flag[k]) !== JSON.stringify(existing?.[k])
21795
21906
  );
@@ -21797,7 +21908,7 @@ async function saveFlag(db, project2, input2) {
21797
21908
  }
21798
21909
  async function deleteFlag(db, project2, key) {
21799
21910
  const res = await db.prepare("DELETE FROM flags WHERE project = ? AND key = ?").bind(project2, key).run();
21800
- cache2.delete(project2);
21911
+ cache3.delete(project2);
21801
21912
  return (res.meta.changes ?? 0) > 0;
21802
21913
  }
21803
21914
  async function flagContext(db, project2, distinctId, userId, request) {
@@ -21902,6 +22013,62 @@ async function transitionExperiment(db, project2, key, action, variant) {
21902
22013
  return { experiment: await getExperiment(db, project2, key), flag: await getFlag(db, project2, exp.flag) };
21903
22014
  }
21904
22015
 
22016
+ // packages/worker/src/insight-defaults.ts
22017
+ var DEFAULT_INSIGHTS = [
22018
+ {
22019
+ key: "dau",
22020
+ name: "Daily active users",
22021
+ description: "Unique people who viewed a page each day.",
22022
+ kind: "trends",
22023
+ spec: { series: [{ event: "$pageview", math: "unique_persons", label: "DAU" }], interval: "day" }
22024
+ },
22025
+ {
22026
+ key: "wau",
22027
+ name: "Weekly active users",
22028
+ description: "Unique people who viewed a page each week.",
22029
+ kind: "trends",
22030
+ spec: { series: [{ event: "$pageview", math: "unique_persons", label: "WAU" }], interval: "week" }
22031
+ },
22032
+ {
22033
+ key: "mau",
22034
+ name: "Monthly active users",
22035
+ description: "Unique people who viewed a page each month.",
22036
+ kind: "trends",
22037
+ spec: { series: [{ event: "$pageview", math: "unique_persons", label: "MAU" }], interval: "month" }
22038
+ },
22039
+ {
22040
+ key: "daily-pageviews",
22041
+ name: "Daily pageviews",
22042
+ description: "Total pageviews per day.",
22043
+ kind: "trends",
22044
+ spec: { series: [{ event: "$pageview", math: "total", label: "Pageviews" }], interval: "day" }
22045
+ },
22046
+ {
22047
+ key: "daily-retention",
22048
+ name: "Daily retention",
22049
+ description: "Of people who first viewed a page on a given day, how many came back on later days.",
22050
+ kind: "retention",
22051
+ spec: {
22052
+ cohortEvent: { event: "$pageview" },
22053
+ returnEvent: { event: "$pageview" },
22054
+ period: "day",
22055
+ periods: 14
22056
+ }
22057
+ },
22058
+ {
22059
+ key: "weekly-retention",
22060
+ name: "Weekly retention",
22061
+ description: "Of people who first viewed a page in a given week, how many came back in later weeks.",
22062
+ kind: "retention",
22063
+ spec: {
22064
+ cohortEvent: { event: "$pageview" },
22065
+ returnEvent: { event: "$pageview" },
22066
+ period: "week",
22067
+ periods: 8
22068
+ }
22069
+ }
22070
+ ];
22071
+
21905
22072
  // packages/worker/src/replays.ts
21906
22073
  var SAFE_ID = /^[A-Za-z0-9_.:-]{1,100}$/;
21907
22074
  var MAX_CHUNK_BYTES = 5e6;
@@ -22041,26 +22208,66 @@ async function deleteReplays(env, project2, where, args) {
22041
22208
 
22042
22209
  // packages/worker/src/service.ts
22043
22210
  var project = external_exports.string().optional();
22211
+ var insightKind = external_exports.enum(["trends", "funnel", "retention"]);
22044
22212
  var inputs = {
22045
22213
  overview: external_exports.object({ project, from: external_exports.union([external_exports.string(), external_exports.number()]).optional(), to: external_exports.union([external_exports.string(), external_exports.number()]).optional() }),
22046
22214
  listEvents: external_exports.object({ project, days: external_exports.number().int().min(1).max(365).optional().describe("Look-back window in days. Default 30.") }),
22047
22215
  describeEvent: external_exports.object({ project, event: external_exports.string().describe('Event name, e.g. "signup_completed".') }),
22048
22216
  defineEvent: external_exports.object({
22049
22217
  project,
22050
- event: external_exports.string(),
22051
- description: external_exports.string().optional(),
22052
- owner: external_exports.string().optional(),
22053
- properties: external_exports.record(external_exports.string(), external_exports.string()).optional().describe("Property name \u2192 what it means.")
22218
+ event: external_exports.string().describe('Event name, e.g. "signup_completed".'),
22219
+ description: external_exports.string().optional().describe(
22220
+ 'How and when this event is fired: the user action or code path that triggers capture. Example: "Fired when payment succeeds and the account is marked active."'
22221
+ ),
22222
+ owner: external_exports.string().optional().describe("Team or person responsible for this event."),
22223
+ properties: external_exports.record(external_exports.string(), external_exports.string()).optional().describe(
22224
+ 'Property name \u2192 what it means and which values to expect. Example: { "plan": "Chosen plan id (free|pro|enterprise)", "amount": "Charge in the account currency" }.'
22225
+ )
22226
+ }),
22227
+ propertyValues: external_exports.object({
22228
+ project,
22229
+ property: external_exports.string().describe('Property to list values of: a column ("utm_source"), event property ("plan") or person property ("person.plan"). "cohort" lists saved cohorts.'),
22230
+ event: external_exports.string().optional().describe("Only values seen on this event."),
22231
+ query: external_exports.string().optional().describe("Only values containing this text (case-insensitive)."),
22232
+ days: external_exports.number().int().min(1).max(365).optional().describe("Look-back window in days. Default 30."),
22233
+ limit: external_exports.number().int().min(1).max(200).optional().describe("Default 50.")
22054
22234
  }),
22235
+ listPersonProperties: external_exports.object({ project }),
22055
22236
  instrument: external_exports.object({
22056
22237
  event: external_exports.string().describe('Event name to track, snake_case past tense, e.g. "checkout_started".'),
22057
22238
  properties: external_exports.record(external_exports.string(), external_exports.unknown()).optional().describe("Example properties to send with it."),
22058
22239
  framework: external_exports.enum(Object.keys(FRAMEWORKS)).optional().describe("Defaults to plain HTML / script tag."),
22059
22240
  project
22060
22241
  }),
22061
- searchPersons: external_exports.object({ project, query: external_exports.string().optional().describe("Matches person id or any property value."), limit: external_exports.number().int().min(1).max(200).optional() }),
22242
+ searchPersons: external_exports.object({
22243
+ project,
22244
+ query: external_exports.string().optional().describe("Matches person id or any property value."),
22245
+ limit: external_exports.number().int().min(1).max(200).optional(),
22246
+ days: external_exports.number().int().min(1).max(365).optional().describe("Window for the anonymous-device count. Default 30.")
22247
+ }),
22062
22248
  getPerson: external_exports.object({ project, person_id: external_exports.string().describe("Your user id, or an anonymous device id.") }),
22063
22249
  setPersonProperties: external_exports.object({ project, person_id: external_exports.string(), properties: external_exports.record(external_exports.string(), external_exports.unknown()) }),
22250
+ cohortDefinition: external_exports.object({
22251
+ filters: external_exports.array(filterSchema).default([]).describe('Person/event filters, e.g. [{"property":"person.plan","value":"pro"}].'),
22252
+ didEvent: external_exports.string().optional().describe("Only people who did this event in the look-back window."),
22253
+ from: external_exports.union([external_exports.string(), external_exports.number()]).optional().describe("Look-back for membership. Default -90d.")
22254
+ }),
22255
+ listCohorts: external_exports.object({ project }),
22256
+ saveCohort: external_exports.object({
22257
+ project,
22258
+ key: external_exports.string().optional().describe("Stable id. Defaults to a slug of the name."),
22259
+ name: external_exports.string().min(1).describe('Human label, e.g. "Pro plan".'),
22260
+ filters: external_exports.array(filterSchema).default([]),
22261
+ didEvent: external_exports.string().optional(),
22262
+ from: external_exports.union([external_exports.string(), external_exports.number()]).optional()
22263
+ }),
22264
+ deleteCohort: external_exports.object({ project, key: external_exports.string() }),
22265
+ countCohort: external_exports.object({
22266
+ project,
22267
+ filters: external_exports.array(filterSchema).default([]),
22268
+ didEvent: external_exports.string().optional(),
22269
+ from: external_exports.union([external_exports.string(), external_exports.number()]).optional()
22270
+ }),
22064
22271
  listReplays: external_exports.object({
22065
22272
  project,
22066
22273
  person: external_exports.string().optional().describe("Only sessions of this person (user id or device id)."),
@@ -22099,7 +22306,18 @@ var inputs = {
22099
22306
  id: external_exports.string().describe('Lowercase id, e.g. "acme-web".'),
22100
22307
  name: external_exports.string().optional(),
22101
22308
  allowed_origins: external_exports.array(external_exports.string()).optional().describe("Restrict browser ingest to these origins.")
22102
- })
22309
+ }),
22310
+ listInsights: external_exports.object({ project }),
22311
+ getInsight: external_exports.object({ project, key: external_exports.string() }),
22312
+ saveInsight: external_exports.object({
22313
+ project,
22314
+ key: external_exports.string().optional().describe("Stable id. Defaults to a slug of the name."),
22315
+ name: external_exports.string().min(1).describe("Title shown in the Insights list."),
22316
+ description: external_exports.string().optional().describe("Short explanation of what this analysis answers."),
22317
+ kind: insightKind,
22318
+ spec: external_exports.record(external_exports.string(), external_exports.unknown()).describe("Query spec without kind/project (series, steps, cohortEvent, \u2026).")
22319
+ }),
22320
+ deleteInsight: external_exports.object({ project, key: external_exports.string() })
22103
22321
  };
22104
22322
  var GlassService = class {
22105
22323
  env;
@@ -22121,13 +22339,19 @@ var GlassService = class {
22121
22339
  ).toString();
22122
22340
  return `${this.baseUrl}/app#/${route}${q ? `?${q}` : ""}`;
22123
22341
  }
22124
- health() {
22342
+ async health() {
22343
+ const latest = await fetchLatestVersion();
22344
+ const upgradeAvailable = latest != null && isNewerThan(latest, GLASS_VERSION);
22125
22345
  return {
22126
22346
  ok: true,
22127
22347
  version: GLASS_VERSION,
22348
+ latest,
22349
+ upgradeAvailable,
22350
+ upgradeCommand: UPGRADE_COMMAND,
22128
22351
  store: this.store.kind,
22129
22352
  freshnessSeconds: this.store.freshnessSeconds,
22130
- replay: replaysEnabled(this.env)
22353
+ replay: replaysEnabled(this.env),
22354
+ ...upgradeAvailable && latest ? { summary: upgradeMessage(GLASS_VERSION, latest) } : {}
22131
22355
  };
22132
22356
  }
22133
22357
  // ── Queries ──────────────────────────────────────────────────────────────
@@ -22139,8 +22363,9 @@ var GlassService = class {
22139
22363
  const spec = def.schema.parse(input2);
22140
22364
  const ctx = await this.context(spec.project);
22141
22365
  const run = def.run;
22142
- const result = await run(spec, ctx);
22143
- return { ...result, project: ctx.project, dashboard: this.link(`insights/${kind}`, { project: ctx.project, spec: { ...spec, project: void 0 } }) };
22366
+ const result = await run(await this.resolveCohorts(ctx.project, spec), ctx);
22367
+ const route = kind === "web" ? "reports" : `insights/${kind}`;
22368
+ return { ...result, project: ctx.project, dashboard: this.link(route, { project: ctx.project, spec: { ...spec, project: void 0 } }) };
22144
22369
  }
22145
22370
  async sql(input2) {
22146
22371
  const spec = sqlSpec.parse(input2);
@@ -22156,7 +22381,7 @@ var GlassService = class {
22156
22381
  rows,
22157
22382
  sql: [wrapped],
22158
22383
  summary: `${rows.length} row${rows.length === 1 ? "" : "s"}${rows.length === limit ? ` (limit ${limit} reached)` : ""}.`,
22159
- tables: this.store.kind === "lake" ? `${this.store.dialect.table("events")}, ${this.store.dialect.table("identities")}` : "events, identities, persons, flags, experiments, replays, event_definitions",
22384
+ tables: this.store.kind === "lake" ? `${this.store.dialect.table("events")}, ${this.store.dialect.table("identities")}` : "events, identities, persons, cohorts, insights, flags, experiments, replays, event_definitions",
22160
22385
  dashboard: this.link("sql", { project: ctx.project, query: spec.query })
22161
22386
  };
22162
22387
  }
@@ -22182,6 +22407,8 @@ GROUP BY event ORDER BY cur DESC LIMIT 50`;
22182
22407
  });
22183
22408
  const movers = events.filter((e) => e.count + e.previous >= 20 && e.change !== null && Math.abs(e.change) >= 0.2).sort((a, b) => Math.abs(b.change) - Math.abs(a.change)).slice(0, 5);
22184
22409
  const top = (k) => web.breakdowns[k].slice(0, 5);
22410
+ const health = await this.health();
22411
+ const baseSummary = `${web.summary} ` + (movers.length ? `Biggest movers: ${movers.map((m) => `${m.event} ${m.change > 0 ? "+" : ""}${Math.round(m.change * 100)}%`).join(", ")}.` : "No events moved more than 20% vs the previous period.");
22185
22412
  return {
22186
22413
  project: ctx.project,
22187
22414
  range: web.range,
@@ -22191,9 +22418,11 @@ GROUP BY event ORDER BY cur DESC LIMIT 50`;
22191
22418
  topErrors: top("errors"),
22192
22419
  events: events.slice(0, 15),
22193
22420
  movers,
22194
- summary: `${web.summary} ` + (movers.length ? `Biggest movers: ${movers.map((m) => `${m.event} ${m.change > 0 ? "+" : ""}${Math.round(m.change * 100)}%`).join(", ")}.` : "No events moved more than 20% vs the previous period."),
22421
+ upgradeAvailable: health.upgradeAvailable,
22422
+ ...health.upgradeAvailable ? { upgrade: { version: health.version, latest: health.latest, command: health.upgradeCommand } } : {},
22423
+ summary: health.upgradeAvailable && health.latest ? `${baseSummary} ${upgradeMessage(health.version, health.latest)}` : baseSummary,
22195
22424
  sql: [...web.sql, sql],
22196
- dashboard: this.link("web", { project: ctx.project, from: spec.from, to: spec.to })
22425
+ dashboard: this.link("reports", { project: ctx.project, from: spec.from, to: spec.to })
22197
22426
  };
22198
22427
  }
22199
22428
  // ── Event taxonomy ───────────────────────────────────────────────────────
@@ -22225,6 +22454,7 @@ GROUP BY event ORDER BY n DESC LIMIT 500`;
22225
22454
  undocumented,
22226
22455
  summary: `${events.length} distinct events in the last ${spec.days ?? 30} days${undocumented.length ? `; ${undocumented.length} custom events have no description (use define_event)` : ""}.`,
22227
22456
  namingGuide: EVENT_NAMING_GUIDE,
22457
+ documentationGuide: EVENT_DOCUMENTATION_GUIDE,
22228
22458
  sql: [sql],
22229
22459
  dashboard: this.link("events", { project: ctx.project })
22230
22460
  };
@@ -22275,6 +22505,38 @@ ORDER BY ts_ms DESC LIMIT 500`;
22275
22505
  sql: [sql]
22276
22506
  };
22277
22507
  }
22508
+ /** Most common values of a property, for filter typeahead. Counts come from events, so they match what a filter would select. */
22509
+ async propertyValues(input2) {
22510
+ const spec = inputs.propertyValues.parse(input2);
22511
+ const ctx = await this.context(spec.project);
22512
+ const limit = spec.limit ?? 50;
22513
+ const q = spec.query?.trim().toLowerCase() ?? "";
22514
+ if (spec.property.trim() === COHORT_PROPERTY) {
22515
+ const cohorts = await this.env.DB.prepare("SELECT key, name FROM cohorts WHERE project = ? ORDER BY name COLLATE NOCASE").bind(ctx.project).all();
22516
+ const values2 = cohorts.results.filter((c) => !q || c.key.toLowerCase().includes(q) || c.name.toLowerCase().includes(q)).slice(0, limit).map((c) => ({ value: c.key, label: c.name, count: null, people: null }));
22517
+ return { project: ctx.project, property: COHORT_PROPERTY, values: values2, summary: `${values2.length} saved cohort${values2.length === 1 ? "" : "s"}.`, sql: [] };
22518
+ }
22519
+ const d = this.store.dialect;
22520
+ const now = Date.now();
22521
+ let expr;
22522
+ try {
22523
+ expr = propertyText(spec.property, d);
22524
+ } catch (err) {
22525
+ throw new HttpError(400, err instanceof Error ? err.message : `Invalid property "${spec.property}"`, "Use a column name, an event property, or person.<name>.");
22526
+ }
22527
+ const sql = `WITH ${eventsCte(d, { project: ctx.project, from: now - (spec.days ?? 30) * DAY_MS, to: now + 6e4, events: spec.event ? [spec.event] : void 0 })}
22528
+ SELECT v, COUNT(*) AS n, COUNT(DISTINCT pid) AS people FROM (SELECT ${expr} AS v, pid FROM ev) pv
22529
+ WHERE v IS NOT NULL AND v <> ''${q ? ` AND ${d.containsIgnoreCase("v", q)}` : ""}
22530
+ GROUP BY v ORDER BY n DESC LIMIT ${d.num(limit)}`;
22531
+ const values = (await this.store.query(sql)).map((r) => ({ value: text(r.v), label: text(r.v), count: num(r.n), people: num(r.people) }));
22532
+ return {
22533
+ project: ctx.project,
22534
+ property: spec.property,
22535
+ values,
22536
+ summary: values.length ? `Top ${values.length} values of "${spec.property}"${spec.event ? ` on "${spec.event}"` : ""}: ${values.slice(0, 5).map((v) => v.value).join(", ")}${values.length > 5 ? ", \u2026" : ""}.` : `No values of "${spec.property}"${spec.event ? ` on "${spec.event}"` : ""} in the last ${spec.days ?? 30} days.`,
22537
+ sql: [sql]
22538
+ };
22539
+ }
22278
22540
  async defineEvent(input2) {
22279
22541
  const spec = inputs.defineEvent.parse(input2);
22280
22542
  const ctx = await this.context(spec.project);
@@ -22282,7 +22544,15 @@ ORDER BY ts_ms DESC LIMIT 500`;
22282
22544
  `INSERT INTO event_definitions (project, event, description, owner, properties, updated_at) VALUES (?, ?, ?, ?, ?, ?)
22283
22545
  ON CONFLICT (project, event) DO UPDATE SET description = excluded.description, owner = excluded.owner, properties = excluded.properties, updated_at = excluded.updated_at`
22284
22546
  ).bind(ctx.project, spec.event, spec.description ?? "", spec.owner ?? "", JSON.stringify(spec.properties ?? {}), Date.now()).run();
22285
- return { project: ctx.project, event: spec.event, saved: true, summary: `Saved the definition of "${spec.event}".` };
22547
+ const hasDescription = Boolean(spec.description?.trim());
22548
+ const propCount = Object.keys(spec.properties ?? {}).length;
22549
+ return {
22550
+ project: ctx.project,
22551
+ event: spec.event,
22552
+ saved: true,
22553
+ summary: `Saved the definition of "${spec.event}".`,
22554
+ hint: !hasDescription ? "Add a how/when description (which user action or code path fires this event)." : propCount === 0 ? "If this event has properties, call define_event again with property meanings." : EVENT_DOCUMENTATION_GUIDE
22555
+ };
22286
22556
  }
22287
22557
  instrument(input2) {
22288
22558
  const spec = inputs.instrument.parse(input2);
@@ -22297,7 +22567,7 @@ ORDER BY ts_ms DESC LIMIT 500`;
22297
22567
  capture: snippet.capture(spec.event, spec.properties),
22298
22568
  declarative: `<button data-glass-event="${spec.event}"${Object.entries(spec.properties ?? {}).map(([k, v]) => ` data-glass-prop-${k.replace(/_/g, "-")}="${String(v)}"`).join("")}>\u2026</button>`,
22299
22569
  warnings,
22300
- summary: `Add the install snippet once, then call capture where "${spec.event}" happens. After deploying, check with describe_event.`
22570
+ summary: `Add the install snippet once, then call capture where "${spec.event}" happens. After deploying, check with describe_event, then define_event with how/when it fires and property meanings.`
22301
22571
  };
22302
22572
  }
22303
22573
  // ── Persons ──────────────────────────────────────────────────────────────
@@ -22305,11 +22575,15 @@ ORDER BY ts_ms DESC LIMIT 500`;
22305
22575
  const spec = inputs.searchPersons.parse(input2);
22306
22576
  const ctx = await this.context(spec.project);
22307
22577
  const q = spec.query?.trim();
22308
- const { results } = await this.env.DB.prepare(
22309
- `SELECT person_id, props, first_seen, last_seen FROM persons WHERE project = ?
22310
- ${q ? "AND (instr(lower(person_id), lower(?)) > 0 OR instr(lower(props), lower(?)) > 0)" : ""}
22311
- ORDER BY last_seen DESC LIMIT ?`
22312
- ).bind(ctx.project, ...q ? [q, q] : [], spec.limit ?? 50).all();
22578
+ const days = spec.days ?? 30;
22579
+ const [{ results }, stats] = await Promise.all([
22580
+ this.env.DB.prepare(
22581
+ `SELECT person_id, props, first_seen, last_seen FROM persons WHERE project = ?
22582
+ ${q ? "AND (instr(lower(person_id), lower(?)) > 0 OR instr(lower(props), lower(?)) > 0)" : ""}
22583
+ ORDER BY last_seen DESC LIMIT ?`
22584
+ ).bind(ctx.project, ...q ? [q, q] : [], spec.limit ?? 50).all(),
22585
+ this.peopleStats(ctx.project, days)
22586
+ ]);
22313
22587
  return {
22314
22588
  project: ctx.project,
22315
22589
  persons: results.map((r) => ({
@@ -22318,10 +22592,69 @@ ORDER BY ts_ms DESC LIMIT 500`;
22318
22592
  firstSeen: new Date(r.first_seen).toISOString(),
22319
22593
  lastSeen: new Date(r.last_seen).toISOString()
22320
22594
  })),
22321
- summary: `${results.length} identified ${results.length === 1 ? "person" : "people"}${q ? ` matching "${q}"` : ""}.`,
22595
+ stats,
22596
+ summary: `${stats.identified} identified ${stats.identified === 1 ? "person" : "people"}, ${stats.anonymousDevices} anonymous device${stats.anonymousDevices === 1 ? "" : "s"} active in the last ${days} days` + (q ? `; showing ${results.length} matching "${q}"` : results.length < stats.identified ? `; showing the ${results.length} most recently active` : "") + ".",
22597
+ sql: stats.sql,
22322
22598
  dashboard: this.link("users", { project: ctx.project, q })
22323
22599
  };
22324
22600
  }
22601
+ /** Identified people (persons table) plus anonymous devices active in the window. */
22602
+ async peopleStats(project2, days) {
22603
+ const from = Date.now() - days * DAY_MS;
22604
+ const identifiedRow = await this.env.DB.prepare("SELECT COUNT(*) AS n FROM persons WHERE project = ?").bind(project2).first();
22605
+ const identified = Number(identifiedRow?.n ?? 0);
22606
+ const d = this.store.dialect;
22607
+ let anonymousDevices;
22608
+ let sql;
22609
+ if (this.store.kind === "d1") {
22610
+ sql = `SELECT COUNT(DISTINCT e.distinct_id) AS n
22611
+ FROM ${d.table("events")} e
22612
+ WHERE e.project = ${d.str(project2)} AND e.ts_ms >= ${d.num(from)}
22613
+ AND e.distinct_id NOT IN (SELECT distinct_id FROM identities WHERE project = ${d.str(project2)})
22614
+ AND e.distinct_id NOT IN (SELECT person_id FROM persons WHERE project = ${d.str(project2)})`;
22615
+ anonymousDevices = num((await this.store.query(sql))[0]?.n);
22616
+ } else {
22617
+ sql = `SELECT DISTINCT distinct_id AS d FROM ${d.table("events")}
22618
+ WHERE project = ${d.str(project2)} AND ts_ms >= ${d.num(from)}`;
22619
+ const [devices, linked, people] = await Promise.all([
22620
+ this.store.query(sql),
22621
+ this.env.DB.prepare("SELECT distinct_id FROM identities WHERE project = ?").bind(project2).all(),
22622
+ this.env.DB.prepare("SELECT person_id FROM persons WHERE project = ?").bind(project2).all()
22623
+ ]);
22624
+ const skip = /* @__PURE__ */ new Set([...linked.results.map((r) => r.distinct_id), ...people.results.map((r) => r.person_id)]);
22625
+ anonymousDevices = devices.reduce((n, r) => n + (skip.has(text(r.d)) ? 0 : 1), 0);
22626
+ }
22627
+ return { identified, anonymousDevices, days, sql: [sql] };
22628
+ }
22629
+ /** Person property keys (sampled from the most recently active people), for filter pickers. */
22630
+ async listPersonProperties(input2) {
22631
+ const spec = inputs.listPersonProperties.parse(input2);
22632
+ const ctx = await this.context(spec.project);
22633
+ const { results } = await this.env.DB.prepare("SELECT props FROM persons WHERE project = ? ORDER BY last_seen DESC LIMIT 1000").bind(ctx.project).all();
22634
+ const props = /* @__PURE__ */ new Map();
22635
+ for (const row of results) {
22636
+ for (const [key, value] of Object.entries(safeParse3(row.props))) {
22637
+ const p = props.get(key) ?? { types: /* @__PURE__ */ new Set(), examples: /* @__PURE__ */ new Set(), seen: 0 };
22638
+ p.seen++;
22639
+ p.types.add(value === null ? "null" : Array.isArray(value) ? "array" : typeof value);
22640
+ if (p.examples.size < 5 && value !== null && typeof value !== "object") p.examples.add(String(value).slice(0, 80));
22641
+ props.set(key, p);
22642
+ }
22643
+ }
22644
+ const properties = [...props.entries()].sort((a, b) => b[1].seen - a[1].seen).map(([name, p]) => ({
22645
+ name: `person.${name}`,
22646
+ types: [...p.types],
22647
+ coverage: results.length ? p.seen / results.length : 0,
22648
+ examples: [...p.examples],
22649
+ description: ""
22650
+ }));
22651
+ return {
22652
+ project: ctx.project,
22653
+ sampled: results.length,
22654
+ properties,
22655
+ summary: properties.length ? `${properties.length} person properties across the ${results.length} most recently active people. Filter on them as "person.<name>".` : 'No person properties yet. Send them with glass.identify(userId, { plan: "pro" }).'
22656
+ };
22657
+ }
22325
22658
  async getPerson(input2) {
22326
22659
  const spec = inputs.getPerson.parse(input2);
22327
22660
  const ctx = await this.context(spec.project);
@@ -22387,6 +22720,155 @@ ORDER BY ts_ms DESC LIMIT 100`;
22387
22720
  summary: eventsDeleted ? `Deleted person "${spec.person_id}", ${devices.length} device links, their events and ${replays} replays.` : `Deleted person "${spec.person_id}", device links and ${replays} replays. Events in the lake must be removed separately (see docs/privacy.md).`
22388
22721
  };
22389
22722
  }
22723
+ // ── Cohorts ──────────────────────────────────────────────────────────────
22724
+ /** How many distinct people match a cohort definition in its look-back window. */
22725
+ async countCohort(input2) {
22726
+ const spec = inputs.countCohort.parse(input2);
22727
+ const ctx = await this.context(spec.project);
22728
+ const { count, sql, range } = await this.cohortMembership(ctx.project, {
22729
+ filters: spec.filters,
22730
+ didEvent: spec.didEvent,
22731
+ from: spec.from
22732
+ });
22733
+ return {
22734
+ project: ctx.project,
22735
+ count,
22736
+ range,
22737
+ summary: `${count} ${count === 1 ? "person" : "people"} match this cohort in the selected window.`,
22738
+ sql: [sql]
22739
+ };
22740
+ }
22741
+ async listCohorts(input2) {
22742
+ const spec = inputs.listCohorts.parse(input2);
22743
+ const ctx = await this.context(spec.project);
22744
+ const { results } = await this.env.DB.prepare(
22745
+ "SELECT key, name, definition, created_at, updated_at FROM cohorts WHERE project = ? ORDER BY name COLLATE NOCASE"
22746
+ ).bind(ctx.project).all();
22747
+ const cohorts = [];
22748
+ for (const row of results) {
22749
+ const definition = safeParse3(row.definition);
22750
+ const filters = Array.isArray(definition.filters) ? definition.filters : [];
22751
+ const parsed = inputs.cohortDefinition.parse({
22752
+ filters,
22753
+ didEvent: definition.didEvent,
22754
+ from: definition.from
22755
+ });
22756
+ const { count, sql } = await this.cohortMembership(ctx.project, parsed);
22757
+ cohorts.push({
22758
+ key: row.key,
22759
+ name: row.name,
22760
+ filters: parsed.filters,
22761
+ didEvent: parsed.didEvent ?? null,
22762
+ from: parsed.from ?? "-90d",
22763
+ count,
22764
+ updatedAt: new Date(row.updated_at).toISOString(),
22765
+ sql: [sql],
22766
+ retention: this.link("insights/retention", {
22767
+ project: ctx.project,
22768
+ spec: {
22769
+ cohortEvent: { event: parsed.didEvent || "$pageview", filters: parsed.filters },
22770
+ returnEvent: { event: "$pageview" },
22771
+ period: "week",
22772
+ periods: 8,
22773
+ filters: parsed.filters
22774
+ }
22775
+ })
22776
+ });
22777
+ }
22778
+ return {
22779
+ project: ctx.project,
22780
+ cohorts,
22781
+ summary: cohorts.length ? `${cohorts.length} cohort${cohorts.length === 1 ? "" : "s"}: ${cohorts.map((c) => `${c.name} (${c.count})`).join(", ")}.` : "No cohorts yet. Save a person filter from the People tab.",
22782
+ dashboard: this.link("users", { project: ctx.project })
22783
+ };
22784
+ }
22785
+ async saveCohort(input2) {
22786
+ const spec = inputs.saveCohort.parse(input2);
22787
+ if (spec.filters.some((f) => f.property === COHORT_PROPERTY)) {
22788
+ throw new HttpError(400, "A cohort cannot filter on another cohort", "Copy the other cohort's person filters into this one instead.");
22789
+ }
22790
+ const ctx = await this.context(spec.project);
22791
+ const key = (spec.key?.trim() || slugKey(spec.name)).slice(0, 64);
22792
+ if (!/^[a-z0-9][a-z0-9_-]*$/.test(key)) {
22793
+ throw new HttpError(400, `Invalid cohort key "${key}"`, "Use lowercase letters, numbers, hyphens or underscores.");
22794
+ }
22795
+ const definition = { filters: spec.filters, didEvent: spec.didEvent, from: spec.from ?? "-90d" };
22796
+ const now = Date.now();
22797
+ const existing = await this.env.DB.prepare("SELECT key FROM cohorts WHERE project = ? AND key = ?").bind(ctx.project, key).first();
22798
+ await this.env.DB.prepare(
22799
+ existing ? "UPDATE cohorts SET name = ?, definition = ?, updated_at = ? WHERE project = ? AND key = ?" : "INSERT INTO cohorts (project, key, name, definition, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?)"
22800
+ ).bind(
22801
+ ...existing ? [spec.name, JSON.stringify(definition), now, ctx.project, key] : [ctx.project, key, spec.name, JSON.stringify(definition), now, now]
22802
+ ).run();
22803
+ const { count, sql } = await this.cohortMembership(ctx.project, definition);
22804
+ return {
22805
+ project: ctx.project,
22806
+ key,
22807
+ name: spec.name,
22808
+ created: !existing,
22809
+ count,
22810
+ summary: `${existing ? "Updated" : "Created"} cohort "${spec.name}" (${count} people).`,
22811
+ sql: [sql],
22812
+ dashboard: this.link("users", { project: ctx.project })
22813
+ };
22814
+ }
22815
+ async deleteCohort(input2) {
22816
+ const spec = inputs.deleteCohort.parse(input2);
22817
+ const ctx = await this.context(spec.project);
22818
+ const result = await this.env.DB.prepare("DELETE FROM cohorts WHERE project = ? AND key = ?").bind(ctx.project, spec.key).run();
22819
+ if (!result.meta.changes) throw new HttpError(404, `No cohort "${spec.key}"`);
22820
+ return { project: ctx.project, deleted: spec.key, summary: `Deleted cohort "${spec.key}".` };
22821
+ }
22822
+ /**
22823
+ * Attach saved definitions to every `cohort` filter in a query spec, so core
22824
+ * can compile membership without reading the cohorts table. Returns a copy.
22825
+ */
22826
+ async resolveCohorts(project2, spec) {
22827
+ const refs = [];
22828
+ const copy = structuredClone(spec);
22829
+ const walk = (v) => {
22830
+ if (Array.isArray(v)) v.forEach(walk);
22831
+ else if (v && typeof v === "object") {
22832
+ const o = v;
22833
+ if (o.property === COHORT_PROPERTY) refs.push(o);
22834
+ else Object.values(o).forEach(walk);
22835
+ }
22836
+ };
22837
+ walk(copy);
22838
+ if (refs.length === 0) return copy;
22839
+ const { results } = await this.env.DB.prepare("SELECT key, definition FROM cohorts WHERE project = ?").bind(project2).all();
22840
+ const saved = new Map(results.map((r) => [r.key, r.definition]));
22841
+ const now = Date.now();
22842
+ for (const f of refs) {
22843
+ f.cohorts = {};
22844
+ for (const key of toList(f.value)) {
22845
+ const raw = saved.get(key);
22846
+ if (raw === void 0) {
22847
+ throw new HttpError(400, `No cohort "${key}" in project "${project2}"`, saved.size ? `Saved cohorts: ${[...saved.keys()].join(", ")}.` : "Save one with save_cohort or from the People tab first.");
22848
+ }
22849
+ const def = inputs.cohortDefinition.parse(safeParse3(raw));
22850
+ const range = resolveRange(def.from ?? "-90d", void 0, now);
22851
+ const members2 = { project: project2, from: range.from, to: range.to, filters: def.filters };
22852
+ if (def.didEvent) members2.events = [def.didEvent];
22853
+ f.cohorts[key] = members2;
22854
+ }
22855
+ }
22856
+ return copy;
22857
+ }
22858
+ async cohortMembership(project2, definition) {
22859
+ const range = resolveRange(definition.from ?? "-90d", void 0);
22860
+ const d = this.store.dialect;
22861
+ const sql = `WITH ${eventsCte(d, {
22862
+ project: project2,
22863
+ from: range.from,
22864
+ to: range.to,
22865
+ events: definition.didEvent ? [definition.didEvent] : void 0,
22866
+ filters: definition.filters
22867
+ })}
22868
+ SELECT COUNT(DISTINCT pid) AS n FROM ev`;
22869
+ const count = num((await this.store.query(sql))[0]?.n);
22870
+ return { count, sql, range };
22871
+ }
22390
22872
  // ── Replays ──────────────────────────────────────────────────────────────
22391
22873
  async listReplays(input2) {
22392
22874
  const spec = inputs.listReplays.parse(input2);
@@ -22555,8 +23037,102 @@ ORDER BY ts_ms LIMIT 2000`;
22555
23037
  async createProject(input2) {
22556
23038
  const spec = inputs.createProject.parse(input2);
22557
23039
  const created = await createProject(this.env.DB, { id: spec.id, name: spec.name, allowedOrigins: spec.allowed_origins });
23040
+ await this.seedDefaultInsights(created.id);
22558
23041
  return { project: created, summary: `Project "${created.id}" is ready. Use data-project="${created.id}" in the snippet.` };
22559
23042
  }
23043
+ // ── Saved insights ───────────────────────────────────────────────────────
23044
+ async listInsights(input2) {
23045
+ const spec = inputs.listInsights.parse(input2);
23046
+ const ctx = await this.context(spec.project);
23047
+ await this.seedDefaultInsights(ctx.project);
23048
+ const { results } = await this.env.DB.prepare(
23049
+ "SELECT key, name, description, kind, spec, created_at, updated_at FROM insights WHERE project = ? ORDER BY name COLLATE NOCASE"
23050
+ ).bind(ctx.project).all();
23051
+ const insights = results.map((r) => ({
23052
+ key: r.key,
23053
+ name: r.name,
23054
+ description: r.description,
23055
+ kind: r.kind,
23056
+ spec: safeParse3(r.spec),
23057
+ updatedAt: new Date(r.updated_at).toISOString(),
23058
+ dashboard: this.link(`insights/${r.key}`, { project: ctx.project })
23059
+ }));
23060
+ return {
23061
+ project: ctx.project,
23062
+ insights,
23063
+ summary: insights.length ? `${insights.length} saved analysis${insights.length === 1 ? "" : "es"}.` : "No saved analyses yet.",
23064
+ dashboard: this.link("insights", { project: ctx.project })
23065
+ };
23066
+ }
23067
+ async getInsight(input2) {
23068
+ const spec = inputs.getInsight.parse(input2);
23069
+ const ctx = await this.context(spec.project);
23070
+ await this.seedDefaultInsights(ctx.project);
23071
+ const row = await this.env.DB.prepare(
23072
+ "SELECT key, name, description, kind, spec, created_at, updated_at FROM insights WHERE project = ? AND key = ?"
23073
+ ).bind(ctx.project, spec.key).first();
23074
+ if (!row) throw new HttpError(404, `No saved analysis "${spec.key}"`);
23075
+ return {
23076
+ project: ctx.project,
23077
+ key: row.key,
23078
+ name: row.name,
23079
+ description: row.description,
23080
+ kind: row.kind,
23081
+ spec: safeParse3(row.spec),
23082
+ updatedAt: new Date(row.updated_at).toISOString(),
23083
+ dashboard: this.link(`insights/${row.key}`, { project: ctx.project })
23084
+ };
23085
+ }
23086
+ async saveInsight(input2) {
23087
+ const spec = inputs.saveInsight.parse(input2);
23088
+ const ctx = await this.context(spec.project);
23089
+ const key = (spec.key?.trim() || slugKey(spec.name)).slice(0, 64);
23090
+ if (!/^[a-z0-9][a-z0-9_-]*$/.test(key)) {
23091
+ throw new HttpError(400, `Invalid insight key "${key}"`, "Use lowercase letters, numbers, hyphens or underscores.");
23092
+ }
23093
+ if (key === "new" || insightKind.safeParse(key).success) {
23094
+ throw new HttpError(400, `Key "${key}" is reserved`, "Pick another name; trends, funnel, retention and new are used by the UI.");
23095
+ }
23096
+ const now = Date.now();
23097
+ const existing = await this.env.DB.prepare("SELECT key FROM insights WHERE project = ? AND key = ?").bind(ctx.project, key).first();
23098
+ const description = spec.description ?? "";
23099
+ const body = JSON.stringify(spec.spec);
23100
+ await this.env.DB.prepare(
23101
+ existing ? "UPDATE insights SET name = ?, description = ?, kind = ?, spec = ?, updated_at = ? WHERE project = ? AND key = ?" : "INSERT INTO insights (project, key, name, description, kind, spec, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?)"
23102
+ ).bind(
23103
+ ...existing ? [spec.name, description, spec.kind, body, now, ctx.project, key] : [ctx.project, key, spec.name, description, spec.kind, body, now, now]
23104
+ ).run();
23105
+ return {
23106
+ project: ctx.project,
23107
+ key,
23108
+ name: spec.name,
23109
+ description,
23110
+ kind: spec.kind,
23111
+ created: !existing,
23112
+ summary: `${existing ? "Updated" : "Saved"} analysis "${spec.name}".`,
23113
+ dashboard: this.link(`insights/${key}`, { project: ctx.project })
23114
+ };
23115
+ }
23116
+ async deleteInsight(input2) {
23117
+ const spec = inputs.deleteInsight.parse(input2);
23118
+ const ctx = await this.context(spec.project);
23119
+ const result = await this.env.DB.prepare("DELETE FROM insights WHERE project = ? AND key = ?").bind(ctx.project, spec.key).run();
23120
+ if (!result.meta.changes) throw new HttpError(404, `No saved analysis "${spec.key}"`);
23121
+ return { project: ctx.project, deleted: spec.key, summary: `Deleted analysis "${spec.key}".` };
23122
+ }
23123
+ /** Seed starter analyses once per project (new creates and empty existing projects). */
23124
+ async seedDefaultInsights(projectId) {
23125
+ const row = await this.env.DB.prepare("SELECT COUNT(*) AS n FROM insights WHERE project = ?").bind(projectId).first();
23126
+ if (Number(row?.n ?? 0) > 0) return;
23127
+ const now = Date.now();
23128
+ await this.env.DB.batch(
23129
+ DEFAULT_INSIGHTS.map(
23130
+ (insight) => this.env.DB.prepare(
23131
+ "INSERT OR IGNORE INTO insights (project, key, name, description, kind, spec, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?)"
23132
+ ).bind(projectId, insight.key, insight.name, insight.description, insight.kind, JSON.stringify(insight.spec), now, now)
23133
+ )
23134
+ );
23135
+ }
22560
23136
  };
22561
23137
  function safeParse3(value) {
22562
23138
  try {
@@ -22565,6 +23141,9 @@ function safeParse3(value) {
22565
23141
  return {};
22566
23142
  }
22567
23143
  }
23144
+ function slugKey(name) {
23145
+ return name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 64) || "cohort";
23146
+ }
22568
23147
 
22569
23148
  // packages/worker/src/mcp/tools.ts
22570
23149
  var projectOnly = external_exports.object({ project: external_exports.string().optional() });
@@ -22597,7 +23176,7 @@ var TOOLS = [
22597
23176
  {
22598
23177
  name: "list_events",
22599
23178
  title: "List tracked events",
22600
- description: "Every event name seen recently with counts, last-seen time and documentation status. Use before querying to get exact names.",
23179
+ description: "Every event name seen recently with counts, last-seen time and documentation status. Use before querying to get exact names. Clear the undocumented list with define_event before relying on custom events in funnels or trends.",
22601
23180
  input: inputs.listEvents,
22602
23181
  scope: "read",
22603
23182
  run: (s, a) => s.listEvents(a)
@@ -22605,7 +23184,7 @@ var TOOLS = [
22605
23184
  {
22606
23185
  name: "describe_event",
22607
23186
  title: "Describe an event",
22608
- description: "Properties sent with an event (sampled from recent events): types, coverage and example values.",
23187
+ description: "Properties sent with an event (sampled from recent events): types, coverage and example values, plus any saved documentation. Use after shipping capture, then define_event.",
22609
23188
  input: inputs.describeEvent,
22610
23189
  scope: "read",
22611
23190
  run: (s, a) => s.describeEvent(a)
@@ -22613,7 +23192,7 @@ var TOOLS = [
22613
23192
  {
22614
23193
  name: "define_event",
22615
23194
  title: "Document an event",
22616
- description: "Save a description, owner and property descriptions for an event so future agents and teammates understand it.",
23195
+ description: "Required after adding a custom event. Save a how/when description (which user action or code path fires it), owner, and a meaning for each property so future agents and teammates can query it safely.",
22617
23196
  input: inputs.defineEvent,
22618
23197
  scope: "admin",
22619
23198
  run: (s, a) => s.defineEvent(a)
@@ -22621,15 +23200,31 @@ var TOOLS = [
22621
23200
  {
22622
23201
  name: "instrument",
22623
23202
  title: "Get tracking code",
22624
- description: "The exact code to install Glass and capture a named event in a given framework, plus naming warnings.",
23203
+ description: "The exact code to install Glass and capture a named event in a given framework, plus naming warnings. After deploy, describe_event then define_event with how/when and property meanings.",
22625
23204
  input: inputs.instrument,
22626
23205
  scope: "read",
22627
23206
  run: (s, a) => s.instrument(a)
22628
23207
  },
23208
+ {
23209
+ name: "property_values",
23210
+ title: "List property values",
23211
+ description: 'Most common values of a property with event and people counts, optionally on one event or containing some text. Use before filtering so the value you filter on actually exists. property "cohort" lists saved cohort keys.',
23212
+ input: inputs.propertyValues,
23213
+ scope: "read",
23214
+ run: (s, a) => s.propertyValues(a)
23215
+ },
23216
+ {
23217
+ name: "list_person_properties",
23218
+ title: "List person properties",
23219
+ description: 'Person property names (sampled from recently active people) with types and example values. Filter on them as "person.<name>".',
23220
+ input: inputs.listPersonProperties,
23221
+ scope: "read",
23222
+ run: (s, a) => s.listPersonProperties(a)
23223
+ },
22629
23224
  {
22630
23225
  name: "search_persons",
22631
23226
  title: "Search people",
22632
- description: "Identified people, most recently active first, optionally matching an id or property value.",
23227
+ description: "Identified people (most recently active first) plus counts of identified people and anonymous devices active in the look-back window. Optionally filter by id or property value.",
22633
23228
  input: inputs.searchPersons,
22634
23229
  scope: "read",
22635
23230
  run: (s, a) => s.searchPersons(a)
@@ -22642,6 +23237,70 @@ var TOOLS = [
22642
23237
  scope: "read",
22643
23238
  run: (s, a) => s.getPerson(a)
22644
23239
  },
23240
+ {
23241
+ name: "list_insights",
23242
+ title: "List saved analyses",
23243
+ description: "Saved trends/funnel/retention analyses on the Insights tab. New projects are seeded with DAU, WAU, MAU, pageviews and retention defaults.",
23244
+ input: inputs.listInsights,
23245
+ scope: "read",
23246
+ run: (s, a) => s.listInsights(a)
23247
+ },
23248
+ {
23249
+ name: "get_insight",
23250
+ title: "Get a saved analysis",
23251
+ description: "One saved analysis by key, including its query spec.",
23252
+ input: inputs.getInsight,
23253
+ scope: "read",
23254
+ run: (s, a) => s.getInsight(a)
23255
+ },
23256
+ {
23257
+ name: "save_insight",
23258
+ title: "Save an analysis",
23259
+ description: "Create or update a named trends/funnel/retention analysis with a title and description.",
23260
+ input: inputs.saveInsight,
23261
+ scope: "admin",
23262
+ run: (s, a) => s.saveInsight(a)
23263
+ },
23264
+ {
23265
+ name: "delete_insight",
23266
+ title: "Delete a saved analysis",
23267
+ description: "Remove a saved analysis from the Insights tab.",
23268
+ input: inputs.deleteInsight,
23269
+ scope: "admin",
23270
+ run: (s, a) => s.deleteInsight(a)
23271
+ },
23272
+ {
23273
+ name: "list_cohorts",
23274
+ title: "List cohorts",
23275
+ description: 'Saved person cohorts with live membership counts. Filter any query to a cohort with {"property":"cohort","value":"<key>"} (op "neq" to exclude it).',
23276
+ input: inputs.listCohorts,
23277
+ scope: "read",
23278
+ run: (s, a) => s.listCohorts(a)
23279
+ },
23280
+ {
23281
+ name: "save_cohort",
23282
+ title: "Save a cohort",
23283
+ description: "Create or update a named person cohort from filters (and optional didEvent). Returns the live membership count.",
23284
+ input: inputs.saveCohort,
23285
+ scope: "admin",
23286
+ run: (s, a) => s.saveCohort(a)
23287
+ },
23288
+ {
23289
+ name: "count_cohort",
23290
+ title: "Count a cohort",
23291
+ description: "How many distinct people match filters (and optional didEvent) without saving.",
23292
+ input: inputs.countCohort,
23293
+ scope: "read",
23294
+ run: (s, a) => s.countCohort(a)
23295
+ },
23296
+ {
23297
+ name: "delete_cohort",
23298
+ title: "Delete a cohort",
23299
+ description: "Remove a saved cohort definition.",
23300
+ input: inputs.deleteCohort,
23301
+ scope: "admin",
23302
+ run: (s, a) => s.deleteCohort(a)
23303
+ },
22645
23304
  {
22646
23305
  name: "list_replays",
22647
23306
  title: "List session replays",
@@ -22760,17 +23419,29 @@ function apiRouter(service, env, request) {
22760
23419
  docs: `${service.baseUrl}/llms.txt`,
22761
23420
  schemas: `${service.baseUrl}/api/schema`,
22762
23421
  mcp: `${service.baseUrl}/mcp`,
23422
+ health: `${service.baseUrl}/health`,
22763
23423
  endpoints: {
22764
- "GET /api/overview?from=-30d": "Headline stats and movers",
23424
+ "GET /health": "Deployment version, latest release, upgradeAvailable",
23425
+ "GET /api/overview?from=-30d": "Headline stats and movers (includes upgrade notice when outdated)",
22765
23426
  "POST /api/query": `Run an insight: { "kind": ${Object.keys(INSIGHTS).map((k) => `"${k}"`).join(" | ")}, ...spec }`,
22766
23427
  "POST /api/sql": 'Read-only SQL: { "query": "SELECT ..." }',
22767
23428
  "GET /api/events": "Tracked events",
22768
23429
  "GET /api/events/:name": "Properties of an event",
22769
23430
  "PUT /api/events/:name": "Document an event (admin)",
22770
- "GET /api/persons?query=": "Search identified people",
23431
+ "GET /api/properties/values?property=&event=&query=": "Most common values of a property (filter typeahead)",
23432
+ "GET /api/person-properties": "Person property names with types and examples",
23433
+ "GET /api/persons?query=": "Search identified people (includes anonymous device count)",
22771
23434
  "GET /api/persons/:id": "One person with events and replays",
22772
23435
  "PATCH /api/persons/:id": "Set person properties (admin)",
22773
23436
  "DELETE /api/persons/:id": "Erase a person (admin)",
23437
+ "GET /api/cohorts": "Saved person cohorts with live counts",
23438
+ "POST /api/cohorts": "Create or update a cohort (admin)",
23439
+ "POST /api/cohorts/count": "Count people matching a cohort definition",
23440
+ "DELETE /api/cohorts/:key": "Delete a cohort (admin)",
23441
+ "GET /api/insights": "Saved analyses (seeded with DAU/WAU/retention defaults)",
23442
+ "GET /api/insights/:key": "One saved analysis",
23443
+ "POST /api/insights": "Create or update a saved analysis (admin)",
23444
+ "DELETE /api/insights/:key": "Delete a saved analysis (admin)",
22774
23445
  "GET /api/replays?with_errors=true": "Recorded sessions",
22775
23446
  "GET /api/replays/:session/summary": "Text transcript of a session",
22776
23447
  "GET /api/replays/:session/events": "Raw rrweb events",
@@ -22816,6 +23487,8 @@ function apiRouter(service, env, request) {
22816
23487
  admin();
22817
23488
  return json2(await service.defineEvent({ ...await body(), event: p.name }));
22818
23489
  });
23490
+ r.get("/api/properties/values", async ({ url: url2 }) => json2(await service.propertyValues(params(url2))));
23491
+ r.get("/api/person-properties", async ({ url: url2 }) => json2(await service.listPersonProperties(params(url2))));
22819
23492
  r.get("/api/persons", async ({ url: url2 }) => json2(await service.searchPersons(params(url2))));
22820
23493
  r.get("/api/persons/:id", async ({ url: url2, params: p }) => json2(await service.getPerson({ ...params(url2), person_id: p.id })));
22821
23494
  r.patch("/api/persons/:id", async ({ params: p }) => {
@@ -22827,6 +23500,26 @@ function apiRouter(service, env, request) {
22827
23500
  admin();
22828
23501
  return json2(await service.deletePerson({ ...params(url2), person_id: p.id }));
22829
23502
  });
23503
+ r.get("/api/cohorts", async ({ url: url2 }) => json2(await service.listCohorts(params(url2))));
23504
+ r.post("/api/cohorts/count", async () => json2(await service.countCohort(await body())));
23505
+ r.post("/api/cohorts", async () => {
23506
+ admin();
23507
+ return json2(await service.saveCohort(await body()), { status: 201 });
23508
+ });
23509
+ r.delete("/api/cohorts/:key", async ({ url: url2, params: p }) => {
23510
+ admin();
23511
+ return json2(await service.deleteCohort({ ...params(url2), key: p.key }));
23512
+ });
23513
+ r.get("/api/insights", async ({ url: url2 }) => json2(await service.listInsights(params(url2))));
23514
+ r.get("/api/insights/:key", async ({ url: url2, params: p }) => json2(await service.getInsight({ ...params(url2), key: p.key })));
23515
+ r.post("/api/insights", async () => {
23516
+ admin();
23517
+ return json2(await service.saveInsight(await body()), { status: 201 });
23518
+ });
23519
+ r.delete("/api/insights/:key", async ({ url: url2, params: p }) => {
23520
+ admin();
23521
+ return json2(await service.deleteInsight({ ...params(url2), key: p.key }));
23522
+ });
22830
23523
  r.get("/api/replays", async ({ url: url2 }) => json2(await service.listReplays(params(url2))));
22831
23524
  r.get("/api/replays/:id/summary", async ({ url: url2, params: p }) => json2(await service.summariseReplay({ ...params(url2), session_id: p.id })));
22832
23525
  r.get("/api/replays/:id/events", async ({ url: url2, params: p }) => json2(await service.replayEvents({ ...params(url2), session_id: p.id })));
@@ -22905,6 +23598,10 @@ Pageviews, clicks, errors and web vitals are captured automatically.
22905
23598
  Without JavaScript: \`<button data-glass-event="cta_clicked" data-glass-prop-plan="pro">\`.
22906
23599
  ${EVENT_NAMING_GUIDE}
22907
23600
 
23601
+ ## Document custom events
23602
+
23603
+ ${EVENT_DOCUMENTATION_GUIDE}
23604
+
22908
23605
  ## Query (MCP)
22909
23606
 
22910
23607
  MCP endpoint: ${base}/mcp (Streamable HTTP, header "Authorization: Bearer <key>").
@@ -22913,6 +23610,10 @@ stdio clients: \`npx @glassanalytics/cli mcp\` in a project set up with \`glass
22913
23610
  Tools:
22914
23611
  ${TOOLS.map((t) => `- ${t.name}: ${t.description}`).join("\n")}
22915
23612
 
23613
+ ## Keep Glass up to date
23614
+
23615
+ \`GET ${base}/health\` reports \`version\`, \`latest\` and \`upgradeAvailable\`. When \`upgradeAvailable\` is true (also surfaced on \`overview\` and in MCP initialize instructions), tell the user to run \`npx @glassanalytics/cli@latest upgrade\` \u2014 do not upgrade yourself.
23616
+
22916
23617
  ## Query (HTTP)
22917
23618
 
22918
23619
  All /api routes need "Authorization: Bearer <key>". \`GET ${base}/api\` lists them; \`GET ${base}/api/schema\` has JSON Schemas.
@@ -22925,7 +23626,7 @@ Insight kinds: ${Object.entries(INSIGHTS).map(([k, d]) => `
22925
23626
 
22926
23627
  ## Properties and filters
22927
23628
 
22928
- Filters are { "property", "op", "value" }. Properties: built-in columns (path, url, host, referrer_host, utm_source, utm_medium, utm_campaign, country, device, browser, os, session_id, user_id), event properties ("plan" or "props.plan"), person properties at event time ("person.plan").
23629
+ Filters are { "property", "op", "value" }. Properties: built-in columns (path, url, host, referrer_host, utm_source, utm_medium, utm_campaign, country, device, browser, os, session_id, user_id), event properties ("plan" or "props.plan"), person properties at event time ("person.plan"), and saved-cohort membership ("cohort" with a cohort key as value, op "eq"/"in" or "neq"/"not_in"). GET /api/properties/values?property=\u2026 lists the values that exist.
22929
23630
  Ops: eq, neq, contains, not_contains, in, not_in, gt, gte, lt, lte, is_set, is_not_set.
22930
23631
  Times: ISO dates, "today", "yesterday", or relative like "-30d", "-12h", "-3mo".
22931
23632
  `;
@@ -22940,7 +23641,8 @@ var INSTRUCTIONS = `Glass is the analytics for this product: web analytics, prod
22940
23641
  - Times: ISO dates or relative offsets like "-30d"; ranges end at "now" by default.
22941
23642
  - To debug a user problem: query_funnel or query_trends with a breakdown \u2192 list_replays (with_errors) \u2192 summarise_replay.
22942
23643
  - To add tracking: "instrument" returns the exact code. Name events object_action in snake_case past tense.
22943
- - Every result includes the SQL that ran and a dashboard link; quote them when reporting back.`;
23644
+ - Every result includes the SQL that ran and a dashboard link; quote them when reporting back.
23645
+ - If overview or /health reports upgradeAvailable, tell the user to run \`npx @glassanalytics/cli@latest upgrade\` \u2014 do not try to upgrade yourself.`;
22944
23646
  var rpcError = (id, code, message) => ({ jsonrpc: "2.0", id: id ?? null, error: { code, message } });
22945
23647
  var rpcResult = (id, result) => ({ jsonrpc: "2.0", id, result });
22946
23648
  var schemaCache = null;
@@ -22985,11 +23687,14 @@ async function handleMessage(msg, service, scope) {
22985
23687
  switch (msg.method) {
22986
23688
  case "initialize": {
22987
23689
  const requested = String(msg.params?.protocolVersion ?? "");
23690
+ const health = await service.health();
23691
+ const instructions = health.upgradeAvailable && health.latest ? `${INSTRUCTIONS}
23692
+ - UPGRADE NEEDED: ${upgradeMessage(health.version, health.latest)}` : INSTRUCTIONS;
22988
23693
  return rpcResult(msg.id, {
22989
23694
  protocolVersion: SUPPORTED_VERSIONS.includes(requested) ? requested : SUPPORTED_VERSIONS[0],
22990
23695
  capabilities: { tools: { listChanged: false } },
22991
23696
  serverInfo: { name: "glass", title: "Glass Analytics", version: GLASS_VERSION },
22992
- instructions: INSTRUCTIONS
23697
+ instructions
22993
23698
  });
22994
23699
  }
22995
23700
  case "ping":
@@ -23134,9 +23839,9 @@ var LakeStore = class {
23134
23839
  freshnessSeconds = 120;
23135
23840
  env;
23136
23841
  fetcher;
23137
- constructor(env, fetcher = fetch) {
23842
+ constructor(env, fetcher2 = fetch) {
23138
23843
  this.env = env;
23139
- this.fetcher = fetcher;
23844
+ this.fetcher = fetcher2;
23140
23845
  this.dialect = basin(env.LAKE_NAMESPACE ?? "glass");
23141
23846
  }
23142
23847
  async write(events) {
@@ -23245,7 +23950,7 @@ function createApp(options) {
23245
23950
  case "/":
23246
23951
  return Response.redirect(`${url2.origin}${prefix}/app`, 302);
23247
23952
  case "/health":
23248
- return withCors(json2(service.health()));
23953
+ return withCors(json2(await service.health()));
23249
23954
  case "/e":
23250
23955
  if (request.method !== "POST") break;
23251
23956
  await handleIngest(request, env, store, now);