@kalayanasundaram123/rrweb 2.0.3 → 2.0.5

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.
@@ -11,13 +11,13 @@
11
11
  }(this, () => {
12
12
  var exports = {};
13
13
  var module = { exports };
14
- "use strict";var To=Object.defineProperty,_o=Object.defineProperties;var ko=Object.getOwnPropertyDescriptors;var ut=Object.getOwnPropertySymbols;var qs=Object.prototype.hasOwnProperty,js=Object.prototype.propertyIsEnumerable;var Vs=(e,t,r)=>t in e?To(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,P=(e,t)=>{for(var r in t||(t={}))qs.call(t,r)&&Vs(e,r,t[r]);if(ut)for(var r of ut(t))js.call(t,r)&&Vs(e,r,t[r]);return e},se=(e,t)=>_o(e,ko(t));var Ue=(e,t)=>{var r={};for(var s in e)qs.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&ut)for(var s of ut(e))t.indexOf(s)<0&&js.call(e,s)&&(r[s]=e[s]);return r};var Po=Object.defineProperty,Lo=(e,t,r)=>t in e?Po(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,R=(e,t,r)=>Lo(e,typeof t!="symbol"?t+"":t,r),Gs;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Fo=Object.defineProperty,Uo=(e,t,r)=>t in e?Fo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Hs=(e,t,r)=>Uo(e,typeof t!="symbol"?t+"":t,r),U=(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))(U||{});const Ys={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Xs={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ct={},Dn={},Bo=()=>!!globalThis.Zone;function ls(e){if(ct[e])return ct[e];const t=globalThis[e],r=t.prototype,s=e in Ys?Ys[e]:void 0,i=!!(s&&s.every(u=>{var l,c;return!!((c=(l=Object.getOwnPropertyDescriptor(r,u))==null?void 0:l.get)!=null&&c.toString().includes("[native code]"))})),o=e in Xs?Xs[e]:void 0,a=!!(o&&o.every(u=>{var l;return typeof r[u]=="function"&&((l=r[u])==null?void 0:l.toString().includes("[native code]"))}));if(i&&a&&!Bo())return ct[e]=t.prototype,t.prototype;try{const u=document.createElement("iframe");u.style.display="none",document.body.appendChild(u);const l=u.contentWindow;if(!l)return t.prototype;const c=l[e].prototype;if(!c)return u.remove(),r;const n=navigator.userAgent;return n.includes("Safari")&&!n.includes("Chrome")?(u.classList.add("rr-block"),u.setAttribute("__rrwebUntaintedMutationObserver",""),Dn[e]=()=>u.remove()):u.remove(),ct[e]=c}catch(u){return r}}const Jt={};function Ee(e,t,r){var s;const i=`${e}.${String(r)}`;if(Jt[i])return Jt[i].call(t);const o=ls(e),a=(s=Object.getOwnPropertyDescriptor(o,r))==null?void 0:s.get;return a?(Jt[i]=a,a.call(t)):t[r]}const Qt={};function An(e,t,r){const s=`${e}.${String(r)}`;if(Qt[s])return Qt[s].bind(t);const o=ls(e)[r];return typeof o!="function"?t[r]:(Qt[s]=o,o.bind(t))}function Wo(e){return Ee("Node",e,"ownerDocument")}function $o(e){return Ee("Node",e,"childNodes")}function zo(e){return Ee("Node",e,"parentNode")}function Vo(e){return Ee("Node",e,"parentElement")}function qo(e){return Ee("Node",e,"textContent")}function jo(e,t){return An("Node",e,"contains")(t)}function Go(e){return An("Node",e,"getRootNode")()}function Ho(e){return!e||!("host"in e)?null:Ee("ShadowRoot",e,"host")}function Yo(e){return e.styleSheets}function Xo(e){return!e||!("shadowRoot"in e)?null:Ee("Element",e,"shadowRoot")}function Jo(e,t){return Ee("Element",e,"querySelector")(t)}function Qo(e,t){return Ee("Element",e,"querySelectorAll")(t)}function Zo(){var e;return[ls("MutationObserver").constructor,(e=Dn.MutationObserver)!=null?e:()=>{}]}let Tn=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Tn=()=>new Date().getTime());function Ko(e,t,r){try{if(!(t in e))return()=>{};const s=e[t],i=r(s);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:s}})),e[t]=i,()=>{e[t]=s}}catch(s){return()=>{}}}const ie={ownerDocument:Wo,childNodes:$o,parentNode:zo,parentElement:Vo,textContent:qo,contains:jo,getRootNode:Go,host:Ho,styleSheets:Yo,shadowRoot:Xo,querySelector:Jo,querySelectorAll:Qo,nowTimestamp:Tn,mutationObserverCtor:Zo,patch:Ko};function us(e){return e.nodeType===e.ELEMENT_NODE}function et(e){const t=e&&"host"in e&&"mode"in e&&ie.host(e)||null;return!!(t&&"shadowRoot"in t&&ie.shadowRoot(t)===e)}function tt(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function ea(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 ta(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const 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 rs(e){try{const t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);const s=Array.from(t,i=>_n(i,r)).join("");return ea(s)}catch(t){return null}}function _n(e,t){if(sa(e)){let r;try{r=rs(e.styleSheet)||ta(e)}catch(s){r=e.cssText}return e.styleSheet.href?Ot(r,e.styleSheet.href):r}else{let r=e.cssText;return ia(e)&&e.selectorText.includes(":")&&(r=ra(r)),t?Ot(r,t):r}}function ra(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function sa(e){return"styleSheet"in e}function ia(e){return"selectorText"in e}class cs{constructor(){Hs(this,"idNodeMap",new Map),Hs(this,"nodeMetaMap",new WeakMap)}getId(t){var r;if(!t)return-1;const s=(r=this.getMeta(t))==null?void 0:r.id;return s!=null?s:-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){const 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){const s=r.id;this.idNodeMap.set(s,t),this.nodeMetaMap.set(t,r)}replace(t,r){const s=this.getNode(t);if(s){const i=this.nodeMetaMap.get(s);i&&this.nodeMetaMap.set(r,i)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function kn(){return new cs}function Mt({element:e,maskInputOptions:t,tagName:r,type:s,value:i,maskInputFn:o}){let a=i||"";const u=s&&Ae(s);return(t[r.toLowerCase()]||u&&t[u])&&(o?a=o(a,e):a="*".repeat(a.length)),a}function Ae(e){return e.toLowerCase()}const Js="__rrweb_original__";function na(e){const t=e.getContext("2d");if(!t)return!0;const r=50;for(let s=0;s<e.width;s+=r)for(let i=0;i<e.height;i+=r){const o=t.getImageData,a=Js in o?o[Js]:o;if(new Uint32Array(a.call(t,s,i,Math.min(r,e.width-s),Math.min(r,e.height-i)).data.buffer).some(l=>l!==0))return!1}return!0}function oa(e,t){return!e||!t||e.type!==t.type?!1:e.type===U.Document?e.compatMode===t.compatMode:e.type===U.DocumentType?e.name===t.name&&e.publicId===t.publicId&&e.systemId===t.systemId:e.type===U.Comment||e.type===U.Text||e.type===U.CDATA?e.textContent===t.textContent:e.type===U.Element?e.tagName===t.tagName&&JSON.stringify(e.attributes)===JSON.stringify(t.attributes)&&e.isSVG===t.isSVG&&e.needBlock===t.needBlock:!1}function Nt(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ae(t):null}function hs(e,t){var o;let r;try{r=new URL(e,t!=null?t:window.location.href)}catch(a){return null}const s=/\.([0-9a-z]+)(?:$)/i,i=r.pathname.match(s);return(o=i==null?void 0:i[1])!=null?o:null}function aa(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}const la=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ua=/^(?:[a-z+]+:)?\/\//i,ca=/^www\..*/i,ha=/^(data:)([^,]*),(.*)/i;function Ot(e,t){return(e||"").replace(la,(r,s,i,o,a,u)=>{const l=i||a||u,c=s||o||"";if(!l)return r;if(ua.test(l)||ca.test(l))return`url(${c}${l}${c})`;if(ha.test(l))return`url(${c}${l}${c})`;if(l[0]==="/")return`url(${c}${aa(t)+l}${c})`;const n=l.split("#")[0],d=l.substring(n.length),h=t.split("#")[0].split("/"),f=n.split("/");h.pop();for(const m of f)m!=="."&&(m===".."?h.pop():h.push(m));return`url(${c}${h.join("/")}${d}${c})`})}function ht(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function fa(e,t,r=!1){const s=Array.from(t.childNodes),i=[];let o=0;if(s.length>1&&e&&typeof e=="string"){let a=ht(e,r);const u=a.length/e.length;for(let l=1;l<s.length;l++)if(s[l].textContent&&typeof s[l].textContent=="string"){const c=ht(s[l].textContent,r),n=100;let d=3;for(;d<c.length&&(c[d].match(/[a-zA-Z0-9]/)||c.indexOf(c.substring(0,d),1)!==-1);d++);for(;d<c.length;d++){let h=c.substring(0,d),f=a.split(h),m=-1;if(f.length===2)m=f[0].length;else if(f.length>2&&f[0]===""&&s[l-1].textContent!=="")m=a.indexOf(h,1);else if(f.length===1){if(h=h.substring(0,h.length-1),f=a.split(h),f.length<=1)return i.push(e),i;d=n+1}else d===c.length-1&&(m=a.indexOf(h));if(f.length>=2&&d>n){const p=s[l-1].textContent;if(p&&typeof p=="string"){const g=ht(p).length;m=a.indexOf(h,g)}m===-1&&(m=f[0].length)}if(m!==-1){let p=Math.floor(m/u);for(;p>0&&p<e.length;){if(o+=1,o>50*s.length)return i.push(e),i;const g=ht(e.substring(0,p),r);if(g.length===m){i.push(e.substring(0,p)),e=e.substring(p),a=a.substring(m);break}else g.length<m?p+=Math.max(1,Math.floor((m-g.length)/u)):p-=Math.max(1,Math.floor((g.length-m)*u))}break}}}}return i.push(e),i}function da(e,t){return fa(e,t).join("/* rr_split */")}let pa=1;const ma=new RegExp("[^a-z0-9-_:]"),it=-2;function Pn(){return pa++}function ga(e){if(e instanceof HTMLFormElement)return"form";const t=Ae(e.tagName);return ma.test(t)?"div":t}let Be,Qs;const ya=/^[^ \t\n\r\u000c]+/,wa=/^[, \t\n\r\u000c]+/;function va(e,t){if(t.trim()==="")return t;let r=0;function s(o){let a;const u=o.exec(t.substring(r));return u?(a=u[0],r+=a.length,a):""}const i=[];for(;s(wa),!(r>=t.length);){let o=s(ya);if(o.slice(-1)===",")o=Ve(e,o.substring(0,o.length-1)),i.push(o);else{let a="";o=Ve(e,o);let u=!1;for(;;){const l=t.charAt(r);if(l===""){i.push((o+a).trim());break}else if(u)l===")"&&(u=!1);else if(l===","){r+=1,i.push((o+a).trim());break}else l==="("&&(u=!0);a+=l,r+=1}}}return i.join(", ")}const Zs=new WeakMap;function Ve(e,t){return!t||t.trim()===""?t:fs(e,t)}function Sa(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function fs(e,t){let r=Zs.get(e);if(r||(r=e.createElement("a"),Zs.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function Ln(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)?Ve(e,s):r==="srcset"?va(e,s):r==="style"?Ot(s,fs(e)):t==="object"&&r==="data"?Ve(e,s):s)}function Fn(e,t,r){return["video","audio"].includes(e)&&t==="autoplay"}function ba(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let s=e.classList.length;s--;){const i=e.classList[s];if(t.test(i))return!0}if(r)return e.matches(r)}catch(s){}return!1}function It(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?It(ie.parentNode(e),t,r):!1;for(let s=e.classList.length;s--;){const i=e.classList[s];if(t.test(i))return!0}return r?It(ie.parentNode(e),t,r):!1}function Un(e,t,r,s){let i;if(us(e)){if(i=e,!ie.childNodes(i).length)return!1}else{if(ie.parentElement(e)===null)return!1;i=ie.parentElement(e)}try{if(typeof t=="string"){if(s){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(It(i,t,s))return!0;if(r){if(s){if(i.closest(r))return!0}else if(i.matches(r))return!0}}catch(o){}return!1}function Ca(e,t,r){const s=e.contentWindow;if(!s)return;let i=!1,o;try{o=s.document.readyState}catch(u){return}if(o!=="complete"){const u=setTimeout(()=>{i||(t(),i=!0)},r);e.addEventListener("load",()=>{clearTimeout(u),i=!0,t()});return}const a="about:blank";if(s.location.href!==a||e.src===a||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function Ea(e,t,r){let s=!1,i;try{i=e.sheet}catch(a){return}if(i)return;const o=setTimeout(()=>{s||(t(),s=!0)},r);e.addEventListener("load",()=>{clearTimeout(o),s=!0,t()})}function xa(e,t){const{doc:r,mirror:s,blockClass:i,blockSelector:o,needsMask:a,inlineStylesheet:u,maskInputOptions:l={},maskTextFn:c,maskInputFn:n,dataURLOptions:d={},inlineImages:h,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:p=!1,cssCaptured:g=!1}=t,v=Ra(r,s);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:U.Document,childNodes:[],compatMode:e.compatMode}:{type:U.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:U.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:return Na(e,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:u,maskInputOptions:l,maskInputFn:n,dataURLOptions:d,inlineImages:h,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:p,rootId:v});case e.TEXT_NODE:return Ma(e,{doc:r,needsMask:a,maskTextFn:c,rootId:v,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:U.CDATA,textContent:"",rootId:v};case e.COMMENT_NODE:return{type:U.Comment,textContent:ie.textContent(e)||"",rootId:v};default:return!1}}function Ra(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return r===1?void 0:r}function Ma(e,t){const{needsMask:r,maskTextFn:s,rootId:i,cssCaptured:o}=t,a=ie.parentNode(e),u=a&&a.tagName;let l="";const c=u==="STYLE"?!0:void 0,n=u==="SCRIPT"?!0:void 0;return n?l="SCRIPT_PLACEHOLDER":o||(l=ie.textContent(e),c&&l&&(l=Ot(l,fs(t.doc)))),!c&&!n&&l&&r&&(l=s?s(l,ie.parentElement(e)):l.replace(/[\S]/g,"*")),{type:U.Text,textContent:l||"",rootId:i}}function Na(e,t){const{doc:r,blockClass:s,blockSelector:i,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:u,dataURLOptions:l={},inlineImages:c,recordCanvas:n,keepIframeSrcFn:d,newlyAddedElement:h=!1,rootId:f}=t,m=ba(e,s,i),p=ga(e);let g={};const v=e.attributes.length;for(let w=0;w<v;w++){const C=e.attributes[w];Fn(p,C.name,C.value)||(g[C.name]=Ln(r,p,Ae(C.name),C.value))}if(p==="link"&&o){const w=Array.from(r.styleSheets).find(S=>S.href===e.href);let C=null;w&&(C=rs(w)),C&&(delete g.rel,delete g.href,g._cssText=C)}if(p==="style"&&e.sheet){let w=rs(e.sheet);w&&(e.childNodes.length>1&&(w=da(w,e)),g._cssText=w)}if(["input","textarea","select"].includes(p)){const w=e.value,C=e.checked;g.type!=="radio"&&g.type!=="checkbox"&&g.type!=="submit"&&g.type!=="button"&&w?g.value=Mt({element:e,type:Nt(e),tagName:p,value:w,maskInputOptions:a,maskInputFn:u}):C&&(g.checked=C)}if(p==="option"&&(e.selected&&!a.select?g.selected=!0:delete g.selected),p==="dialog"&&e.open&&(g.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),p==="canvas"&&n){if(e.__context==="2d")na(e)||(g.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){const w=e.toDataURL(l.type,l.quality),C=r.createElement("canvas");C.width=e.width,C.height=e.height;const S=C.toDataURL(l.type,l.quality);w!==S&&(g.rr_dataURL=w)}}if(p==="img"&&c){Be||(Be=r.createElement("canvas"),Qs=Be.getContext("2d"));const w=e,C=w.currentSrc||w.getAttribute("src")||"<unknown-src>",S=w.crossOrigin,b=()=>{w.removeEventListener("load",b);try{Be.width=w.naturalWidth,Be.height=w.naturalHeight,Qs.drawImage(w,0,0),g.rr_dataURL=Be.toDataURL(l.type,l.quality)}catch(E){if(w.crossOrigin!=="anonymous"){w.crossOrigin="anonymous",w.complete&&w.naturalWidth!==0?b():w.addEventListener("load",b);return}else console.warn(`Cannot inline img src=${C}! Error: ${E}`)}w.crossOrigin==="anonymous"&&(S?g.crossOrigin=S:w.removeAttribute("crossorigin"))};w.complete&&w.naturalWidth!==0?b():w.addEventListener("load",b)}if(["audio","video"].includes(p)){const w=g;w.rr_mediaState=e.paused?"paused":"played",w.rr_mediaCurrentTime=e.currentTime,w.rr_mediaPlaybackRate=e.playbackRate,w.rr_mediaMuted=e.muted,w.rr_mediaLoop=e.loop,w.rr_mediaVolume=e.volume}if(h||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop)),m){const{width:w,height:C}=e.getBoundingClientRect();g={class:g.class,rr_width:`${w}px`,rr_height:`${C}px`}}p==="iframe"&&!d(g.src)&&(e.contentDocument||(g.rr_src=g.src),delete g.src);let y;try{customElements.get(p)&&(y=!0)}catch(w){}return{type:U.Element,tagName:p,attributes:g,childNodes:[],isSVG:Sa(e)||void 0,needBlock:m,rootId:f,isCustom:y}}function Y(e){return e==null?"":e.toLowerCase()}function Bn(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 Oa(e,t){if(t.comment&&e.type===U.Comment)return!0;if(e.type===U.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"&&hs(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(Y(e.attributes.name).match(/^msapplication-tile(image|color)$/)||Y(e.attributes.name)==="application-name"||Y(e.attributes.rel)==="icon"||Y(e.attributes.rel)==="apple-touch-icon"||Y(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&Y(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Y(e.attributes.property).match(/^(og|twitter|fb):/)||Y(e.attributes.name).match(/^(og|twitter):/)||Y(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(Y(e.attributes.name)==="robots"||Y(e.attributes.name)==="googlebot"||Y(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(Y(e.attributes.name)==="author"||Y(e.attributes.name)==="generator"||Y(e.attributes.name)==="framework"||Y(e.attributes.name)==="publisher"||Y(e.attributes.name)==="progid"||Y(e.attributes.property).match(/^article:/)||Y(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(Y(e.attributes.name)==="google-site-verification"||Y(e.attributes.name)==="yandex-verification"||Y(e.attributes.name)==="csrf-token"||Y(e.attributes.name)==="p:domain_verify"||Y(e.attributes.name)==="verify-v1"||Y(e.attributes.name)==="verification"||Y(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function qe(e,t){const{doc:r,mirror:s,blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:u,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:n={},maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:m={},inlineImages:p=!1,recordCanvas:g=!1,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:w=5e3,onStylesheetLoad:C,stylesheetLoadTimeout:S=5e3,keepIframeSrcFn:b=()=>!1,newlyAddedElement:E=!1,cssCaptured:M=!1}=t;let{needsMask:I}=t,{preserveWhiteSpace:N=!0}=t;I||(I=Un(e,a,u,I===void 0));const F=xa(e,{doc:r,mirror:s,blockClass:i,blockSelector:o,needsMask:I,inlineStylesheet:c,maskInputOptions:n,maskTextFn:d,maskInputFn:h,dataURLOptions:m,inlineImages:p,recordCanvas:g,keepIframeSrcFn:b,newlyAddedElement:E,cssCaptured:M});if(!F)return console.warn(e,"not serialized"),null;let T;s.hasNode(e)?T=s.getId(e):Oa(F,f)||!N&&F.type===U.Text&&!F.textContent.replace(/^\s+|\s+$/gm,"").length?T=it:T=Pn();const x=Object.assign(F,{id:T});if(s.add(e,x),T===it)return null;v&&v(e);let ue=!l;if(x.type===U.Element){ue=ue&&!x.needBlock,delete x.needBlock;const q=ie.shadowRoot(e);q&&tt(q)&&(x.isShadowHost=!0)}if((x.type===U.Document||x.type===U.Element)&&ue){f.headWhitespace&&x.type===U.Element&&x.tagName==="head"&&(N=!1);const q={doc:r,mirror:s,blockClass:i,blockSelector:o,needsMask:I,maskTextClass:a,maskTextSelector:u,skipChild:l,inlineStylesheet:c,maskInputOptions:n,maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:m,inlineImages:p,recordCanvas:g,preserveWhiteSpace:N,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:C,stylesheetLoadTimeout:S,keepIframeSrcFn:b,cssCaptured:!1};if(!(x.type===U.Element&&x.tagName==="textarea"&&x.attributes.value!==void 0)){x.type===U.Element&&x.attributes._cssText!==void 0&&typeof x.attributes._cssText=="string"&&(q.cssCaptured=!0);for(const X of Array.from(ie.childNodes(e))){const te=qe(X,q);te&&x.childNodes.push(te)}}let k=null;if(us(e)&&(k=ie.shadowRoot(e)))for(const X of Array.from(ie.childNodes(k))){const te=qe(X,q);te&&(tt(k)&&(te.isShadow=!0),x.childNodes.push(te))}}const ae=ie.parentNode(e);return ae&&et(ae)&&tt(ae)&&(x.isShadow=!0),x.type===U.Element&&x.tagName==="iframe"&&Ca(e,()=>{const q=e.contentDocument;if(q&&y){const k=qe(q,{doc:q,mirror:s,blockClass:i,blockSelector:o,needsMask:I,maskTextClass:a,maskTextSelector:u,skipChild:!1,inlineStylesheet:c,maskInputOptions:n,maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:m,inlineImages:p,recordCanvas:g,preserveWhiteSpace:N,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:C,stylesheetLoadTimeout:S,keepIframeSrcFn:b});k&&y(e,k)}},w),x.type===U.Element&&x.tagName==="link"&&typeof x.attributes.rel=="string"&&(x.attributes.rel==="stylesheet"||x.attributes.rel==="preload"&&typeof x.attributes.href=="string"&&hs(x.attributes.href)==="css")&&Ea(e,()=>{if(C){const q=qe(e,{doc:r,mirror:s,blockClass:i,blockSelector:o,needsMask:I,maskTextClass:a,maskTextSelector:u,skipChild:!1,inlineStylesheet:c,maskInputOptions:n,maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:m,inlineImages:p,recordCanvas:g,preserveWhiteSpace:N,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:C,stylesheetLoadTimeout:S,keepIframeSrcFn:b});q&&C(e,q)}},S),x}function Ia(e,t){const{mirror:r=new cs,blockClass:s="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:a=null,inlineStylesheet:u=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:n=!1,maskTextFn:d,maskInputFn:h,slimDOM:f=!1,dataURLOptions:m,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:w,stylesheetLoadTimeout:C,keepIframeSrcFn:S=()=>!1}=t,b=n===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:n===!1?{password:!0}:n,E=Bn(f);return qe(e,{doc:e,mirror:r,blockClass:s,blockSelector:i,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:b,maskTextFn:d,maskInputFn:h,slimDOMOptions:E,dataURLOptions:m,inlineImages:l,recordCanvas:c,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:w,stylesheetLoadTimeout:C,keepIframeSrcFn:S,newlyAddedElement:!1})}const Da=/(max|min)-device-(width|height)/,Ks=new RegExp(Da.source,"g"),Aa={postcssPlugin:"postcss-custom-selectors",prepare(){return{postcssPlugin:"postcss-custom-selectors",AtRule:function(e){e.params.match(Ks)&&(e.params=e.params.replace(Ks,"$1-$2"))}}}},Ta={postcssPlugin:"postcss-hover-classes",prepare:function(){const e=[];return{Rule:function(t){e.indexOf(t)===-1&&(e.push(t),t.selectors.forEach(function(r){r.includes(":hover")&&(t.selector+=`,
15
- `+r.replace(/:hover/g,".\\:hover"))}))}}}};function _a(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ka(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 i=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(r,s,i.get?i:{enumerable:!0,get:function(){return e[s]}})}),r}var ft={exports:{}},ei;function Pa(){if(ei)return ft.exports;ei=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 ft.exports=t(),ft.exports.createColors=t,ft.exports}const La={},Fa=Object.freeze(Object.defineProperty({__proto__:null,default:La},Symbol.toStringTag,{value:"Module"})),me=ka(Fa);var Zt,ti;function ds(){if(ti)return Zt;ti=1;let e=Pa(),t=me;class r extends Error{constructor(i,o,a,u,l,c){super(i),this.name="CssSyntaxError",this.reason=i,l&&(this.file=l),u&&(this.source=u),c&&(this.plugin=c),typeof o!="undefined"&&typeof a!="undefined"&&(typeof o=="number"?(this.line=o,this.column=a):(this.line=o.line,this.column=o.column,this.endLine=a.line,this.endColumn=a.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!="undefined"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(i){if(!this.source)return"";let o=this.source;i==null&&(i=e.isColorSupported),t&&i&&(o=t(o));let a=o.split(/\r?\n/),u=Math.max(this.line-3,0),l=Math.min(this.line+2,a.length),c=String(l).length,n,d;if(i){let{bold:h,gray:f,red:m}=e.createColors(!0);n=p=>h(m(p)),d=p=>f(p)}else n=d=h=>h;return a.slice(u,l).map((h,f)=>{let m=u+1+f,p=" "+(" "+m).slice(-c)+" | ";if(m===this.line){let g=d(p.replace(/\d/g," "))+h.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+d(p)+h+`
14
+ "use strict";var jo=Object.defineProperty,qo=Object.defineProperties;var Go=Object.getOwnPropertyDescriptors;var pt=Object.getOwnPropertySymbols;var ti=Object.prototype.hasOwnProperty,ri=Object.prototype.propertyIsEnumerable;var ei=(e,t,r)=>t in e?jo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,k=(e,t)=>{for(var r in t||(t={}))ti.call(t,r)&&ei(e,r,t[r]);if(pt)for(var r of pt(t))ri.call(t,r)&&ei(e,r,t[r]);return e},se=(e,t)=>qo(e,Go(t));var $e=(e,t)=>{var r={};for(var s in e)ti.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&pt)for(var s of pt(e))t.indexOf(s)<0&&ri.call(e,s)&&(r[s]=e[s]);return r};var Ho=Object.defineProperty,Yo=(e,t,r)=>t in e?Ho(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,M=(e,t,r)=>Yo(e,typeof t!="symbol"?t+"":t,r),si;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Xo=Object.defineProperty,Jo=(e,t,r)=>t in e?Xo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ii=(e,t,r)=>Jo(e,typeof t!="symbol"?t+"":t,r),U=(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))(U||{});const ni={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[],EventTarget:[]},oi={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"],EventTarget:["addEventListener","removeEventListener"]},mt={},Vn={},Qo=()=>!!globalThis.Zone;function ws(e){if(mt[e])return mt[e];const t=globalThis[e],r=t.prototype,s=e in ni?ni[e]:void 0,i=!!(s&&s.every(u=>{var l,c;return!!((c=(l=Object.getOwnPropertyDescriptor(r,u))==null?void 0:l.get)!=null&&c.toString().includes("[native code]"))})),o=e in oi?oi[e]:void 0,a=!!(o&&o.every(u=>{var l;return typeof r[u]=="function"&&((l=r[u])==null?void 0:l.toString().includes("[native code]"))}));if(i&&a&&!Qo())return mt[e]=t.prototype,t.prototype;try{const u=document.createElement("iframe");u.style.display="none",document.body.appendChild(u);const l=u.contentWindow;if(!l)return t.prototype;const c=l[e].prototype;if(!c)return u.remove(),r;const n=navigator.userAgent;return n.includes("Safari")&&!n.includes("Chrome")?(u.classList.add("rr-block"),u.setAttribute("__rrwebUntaintedMutationObserver",""),Vn[e]=()=>u.remove()):u.remove(),mt[e]=c}catch(u){return r}}const nr={};function Le(e,t,r){var s;const i=`${e}.${String(r)}`;if(nr[i])return nr[i].call(t);const o=ws(e),a=(s=Object.getOwnPropertyDescriptor(o,r))==null?void 0:s.get;return a?(nr[i]=a,a.call(t)):t[r]}const or={};function qt(e,t,r){const s=`${e}.${String(r)}`;if(or[s])return or[s].bind(t);const o=ws(e)[r];return typeof o!="function"?t[r]:(or[s]=o,o.bind(t))}function Zo(e){return Le("Node",e,"ownerDocument")}function Ko(e){return Le("Node",e,"childNodes")}function ea(e){return Le("Node",e,"parentNode")}function ta(e){return Le("Node",e,"parentElement")}function ra(e){return Le("Node",e,"textContent")}function sa(e,t){return qt("Node",e,"contains")(t)}function ia(e){return qt("Node",e,"getRootNode")()}function na(e){return!e||!("host"in e)?null:Le("ShadowRoot",e,"host")}function oa(e){return e.styleSheets}function aa(e){return!e||!("shadowRoot"in e)?null:Le("Element",e,"shadowRoot")}function la(e,t){return qt("Element",e,"querySelector")(t)}function ua(e,t){return qt("Element",e,"querySelectorAll")(t)}function ca(){var e;return[ws("MutationObserver").constructor,(e=Vn.MutationObserver)!=null?e:()=>{}]}function ha(){var r;var e;let t=globalThis.Proxy;try{if(typeof t!="function"||!Function.prototype.toString.call(t).includes("[native code]")){const s=document.createElement("iframe");s.style.display="none",document.documentElement.appendChild(s),t=(r=(e=s.contentWindow)==null?void 0:e.Proxy)!=null?r:t,document.documentElement.removeChild(s)}}catch(s){}return t}let jn=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(jn=()=>new Date().getTime());const Tt=new WeakMap;let At="";(function(){var a;var t;const r=Function.prototype.toString;At=r.call(r);let s=globalThis.Proxy;try{if(typeof s!="function"||!r.call(s).includes("[native code]")){const u=document.createElement("iframe");u.style.display="none",document.documentElement.appendChild(u),s=(a=(t=u.contentWindow)==null?void 0:t.Proxy)!=null?a:s,document.documentElement.removeChild(u)}}catch(u){}const i=Object.getPrototypeOf(r),o=new s(r,{apply(u,l,c){const n=Tt.get(l);return n!==void 0?n:l!=null&&typeof l=="function"&&!i.isPrototypeOf(l.toString)?l.toString():u.apply(l,c)}});Tt.set(o,At),Object.defineProperty(Function.prototype,"toString",{value:o,configurable:!0,writable:!0})})();function fa(e,t){const r=e.name||t.name||"";return Tt.set(e,At.replace("toString",r)),e}function da(e,t,r){try{if(!(t in e))return()=>{};const s=e[t],i=r(s);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:s}}),Tt.set(i,At.replace("toString",t))),e[t]=i,()=>{e[t]=s}}catch(s){return()=>{}}}const ie={ownerDocument:Zo,childNodes:Ko,parentNode:ea,parentElement:ta,textContent:ra,contains:sa,getRootNode:ia,host:na,styleSheets:oa,shadowRoot:aa,querySelector:la,querySelectorAll:ua,nowTimestamp:jn,mutationObserverCtor:ca,patch:da,makeNativeFn:fa,getUntaintedProxy:ha};function vs(e){return e.nodeType===e.ELEMENT_NODE}function it(e){const t=e&&"host"in e&&"mode"in e&&ie.host(e)||null;return!!(t&&"shadowRoot"in t&&ie.shadowRoot(t)===e)}function nt(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function pa(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 ma(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const 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 hs(e){try{const t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);const s=Array.from(t,i=>qn(i,r)).join("");return pa(s)}catch(t){return null}}function qn(e,t){if(ya(e)){let r;try{r=hs(e.styleSheet)||ma(e)}catch(s){r=e.cssText}return e.styleSheet.href?kt(r,e.styleSheet.href):r}else{let r=e.cssText;return wa(e)&&e.selectorText.includes(":")&&(r=ga(r)),t?kt(r,t):r}}function ga(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function ya(e){return"styleSheet"in e}function wa(e){return"selectorText"in e}class Ss{constructor(){ii(this,"idNodeMap",new Map),ii(this,"nodeMetaMap",new WeakMap)}getId(t){var r;if(!t)return-1;const s=(r=this.getMeta(t))==null?void 0:r.id;return s!=null?s:-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){const 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){const s=r.id;this.idNodeMap.set(s,t),this.nodeMetaMap.set(t,r)}replace(t,r){const s=this.getNode(t);if(s){const i=this.nodeMetaMap.get(s);i&&this.nodeMetaMap.set(r,i)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Gn(){return new Ss}function _t({element:e,maskInputOptions:t,tagName:r,type:s,value:i,maskInputFn:o}){let a=i||"";const u=s&&Ae(s);return(t[r.toLowerCase()]||u&&t[u])&&(o?a=o(a,e):a="*".repeat(a.length)),a}function Ae(e){return e.toLowerCase()}const ai="__rrweb_original__";function va(e){const t=e.getContext("2d");if(!t)return!0;const r=50;for(let s=0;s<e.width;s+=r)for(let i=0;i<e.height;i+=r){const o=t.getImageData,a=ai in o?o[ai]:o;if(new Uint32Array(a.call(t,s,i,Math.min(r,e.width-s),Math.min(r,e.height-i)).data.buffer).some(l=>l!==0))return!1}return!0}function Sa(e,t){return!e||!t||e.type!==t.type?!1:e.type===U.Document?e.compatMode===t.compatMode:e.type===U.DocumentType?e.name===t.name&&e.publicId===t.publicId&&e.systemId===t.systemId:e.type===U.Comment||e.type===U.Text||e.type===U.CDATA?e.textContent===t.textContent:e.type===U.Element?e.tagName===t.tagName&&JSON.stringify(e.attributes)===JSON.stringify(t.attributes)&&e.isSVG===t.isSVG&&e.needBlock===t.needBlock:!1}function Pt(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ae(t):null}function bs(e,t){var o;let r;try{r=new URL(e,t!=null?t:window.location.href)}catch(a){return null}const s=/\.([0-9a-z]+)(?:$)/i,i=r.pathname.match(s);return(o=i==null?void 0:i[1])!=null?o:null}function ba(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}const Ca=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ea=/^(?:[a-z+]+:)?\/\//i,xa=/^www\..*/i,Ma=/^(data:)([^,]*),(.*)/i;function kt(e,t){return(e||"").replace(Ca,(r,s,i,o,a,u)=>{const l=i||a||u,c=s||o||"";if(!l)return r;if(Ea.test(l)||xa.test(l))return`url(${c}${l}${c})`;if(Ma.test(l))return`url(${c}${l}${c})`;if(l[0]==="/")return`url(${c}${ba(t)+l}${c})`;const n=l.split("#")[0],d=l.substring(n.length),h=t.split("#")[0].split("/"),f=n.split("/");h.pop();for(const m of f)m!=="."&&(m===".."?h.pop():h.push(m));return`url(${c}${h.join("/")}${d}${c})`})}function gt(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function Ra(e,t,r=!1){const s=Array.from(t.childNodes),i=[];let o=0;if(s.length>1&&e&&typeof e=="string"){let a=gt(e,r);const u=a.length/e.length;for(let l=1;l<s.length;l++)if(s[l].textContent&&typeof s[l].textContent=="string"){const c=gt(s[l].textContent,r),n=100;let d=3;for(;d<c.length&&(c[d].match(/[a-zA-Z0-9]/)||c.indexOf(c.substring(0,d),1)!==-1);d++);for(;d<c.length;d++){let h=c.substring(0,d),f=a.split(h),m=-1;if(f.length===2)m=f[0].length;else if(f.length>2&&f[0]===""&&s[l-1].textContent!=="")m=a.indexOf(h,1);else if(f.length===1){if(h=h.substring(0,h.length-1),f=a.split(h),f.length<=1)return i.push(e),i;d=n+1}else d===c.length-1&&(m=a.indexOf(h));if(f.length>=2&&d>n){const p=s[l-1].textContent;if(p&&typeof p=="string"){const g=gt(p).length;m=a.indexOf(h,g)}m===-1&&(m=f[0].length)}if(m!==-1){let p=Math.floor(m/u);for(;p>0&&p<e.length;){if(o+=1,o>50*s.length)return i.push(e),i;const g=gt(e.substring(0,p),r);if(g.length===m){i.push(e.substring(0,p)),e=e.substring(p),a=a.substring(m);break}else g.length<m?p+=Math.max(1,Math.floor((m-g.length)/u)):p-=Math.max(1,Math.floor((g.length-m)*u))}break}}}}return i.push(e),i}function Na(e,t){return Ra(e,t).join("/* rr_split */")}let Oa=1;const Ia=new RegExp("[^a-z0-9-_:]"),lt=-2;function Hn(){return Oa++}function Da(e){if(e instanceof HTMLFormElement)return"form";const t=Ae(e.tagName);return Ia.test(t)?"div":t}let ze,li;const Ta=/^[^ \t\n\r\u000c]+/,Aa=/^[, \t\n\r\u000c]+/;function _a(e,t){if(t.trim()==="")return t;let r=0;function s(o){let a;const u=o.exec(t.substring(r));return u?(a=u[0],r+=a.length,a):""}const i=[];for(;s(Aa),!(r>=t.length);){let o=s(Ta);if(o.slice(-1)===",")o=Ge(e,o.substring(0,o.length-1)),i.push(o);else{let a="";o=Ge(e,o);let u=!1;for(;;){const l=t.charAt(r);if(l===""){i.push((o+a).trim());break}else if(u)l===")"&&(u=!1);else if(l===","){r+=1,i.push((o+a).trim());break}else l==="("&&(u=!0);a+=l,r+=1}}}return i.join(", ")}const ui=new WeakMap;function Ge(e,t){return!t||t.trim()===""?t:Cs(e,t)}function Pa(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Cs(e,t){let r=ui.get(e);if(r||(r=e.createElement("a"),ui.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function Yn(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)?Ge(e,s):r==="srcset"?_a(e,s):r==="style"?kt(s,Cs(e)):t==="object"&&r==="data"?Ge(e,s):s)}function Xn(e,t,r){return["video","audio"].includes(e)&&t==="autoplay"}function ka(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let s=e.classList.length;s--;){const i=e.classList[s];if(t.test(i))return!0}if(r)return e.matches(r)}catch(s){}return!1}function Lt(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?Lt(ie.parentNode(e),t,r):!1;for(let s=e.classList.length;s--;){const i=e.classList[s];if(t.test(i))return!0}return r?Lt(ie.parentNode(e),t,r):!1}function Jn(e,t,r,s){let i;if(vs(e)){if(i=e,!ie.childNodes(i).length)return!1}else{if(ie.parentElement(e)===null)return!1;i=ie.parentElement(e)}try{if(typeof t=="string"){if(s){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(Lt(i,t,s))return!0;if(r){if(s){if(i.closest(r))return!0}else if(i.matches(r))return!0}}catch(o){}return!1}function La(e,t,r){const s=e.contentWindow;if(!s)return;let i=!1,o;try{o=s.document.readyState}catch(u){return}if(o!=="complete"){const u=setTimeout(()=>{i||(t(),i=!0)},r);e.addEventListener("load",()=>{clearTimeout(u),i=!0,t()});return}const a="about:blank";if(s.location.href!==a||e.src===a||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function Fa(e,t,r){let s=!1,i;try{i=e.sheet}catch(a){return}if(i)return;const o=setTimeout(()=>{s||(t(),s=!0)},r);e.addEventListener("load",()=>{clearTimeout(o),s=!0,t()})}function Ua(e,t){const{doc:r,mirror:s,blockClass:i,blockSelector:o,needsMask:a,inlineStylesheet:u,maskInputOptions:l={},maskTextFn:c,maskInputFn:n,dataURLOptions:d={},inlineImages:h,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:p=!1,cssCaptured:g=!1}=t,v=Wa(r,s);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:U.Document,childNodes:[],compatMode:e.compatMode}:{type:U.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:U.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:return $a(e,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:u,maskInputOptions:l,maskInputFn:n,dataURLOptions:d,inlineImages:h,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:p,rootId:v});case e.TEXT_NODE:return Ba(e,{doc:r,needsMask:a,maskTextFn:c,rootId:v,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:U.CDATA,textContent:"",rootId:v};case e.COMMENT_NODE:return{type:U.Comment,textContent:ie.textContent(e)||"",rootId:v};default:return!1}}function Wa(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return r===1?void 0:r}function Ba(e,t){const{needsMask:r,maskTextFn:s,rootId:i,cssCaptured:o}=t,a=ie.parentNode(e),u=a&&a.tagName;let l="";const c=u==="STYLE"?!0:void 0,n=u==="SCRIPT"?!0:void 0;return n?l="SCRIPT_PLACEHOLDER":o||(l=ie.textContent(e),c&&l&&(l=kt(l,Cs(t.doc)))),!c&&!n&&l&&r&&(l=s?s(l,ie.parentElement(e)):l.replace(/[\S]/g,"*")),{type:U.Text,textContent:l||"",rootId:i}}function $a(e,t){const{doc:r,blockClass:s,blockSelector:i,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:u,dataURLOptions:l={},inlineImages:c,recordCanvas:n,keepIframeSrcFn:d,newlyAddedElement:h=!1,rootId:f}=t,m=ka(e,s,i),p=Da(e);let g={};const v=e.attributes.length;for(let w=0;w<v;w++){const C=e.attributes[w];Xn(p,C.name,C.value)||(g[C.name]=Yn(r,p,Ae(C.name),C.value))}if(p==="link"&&o){const w=Array.from(r.styleSheets).find(S=>S.href===e.href);let C=null;w&&(C=hs(w)),C&&(delete g.rel,delete g.href,g._cssText=C)}if(p==="style"&&e.sheet){let w=hs(e.sheet);w&&(e.childNodes.length>1&&(w=Na(w,e)),g._cssText=w)}if(["input","textarea","select"].includes(p)){const w=e.value,C=e.checked;g.type!=="radio"&&g.type!=="checkbox"&&g.type!=="submit"&&g.type!=="button"&&w?g.value=_t({element:e,type:Pt(e),tagName:p,value:w,maskInputOptions:a,maskInputFn:u}):C&&(g.checked=C)}if(p==="option"&&(e.selected&&!a.select?g.selected=!0:delete g.selected),p==="dialog"&&e.open&&(g.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),p==="canvas"&&n){if(e.__context==="2d")va(e)||(g.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){const w=e.toDataURL(l.type,l.quality),C=r.createElement("canvas");C.width=e.width,C.height=e.height;const S=C.toDataURL(l.type,l.quality);w!==S&&(g.rr_dataURL=w)}}if(p==="img"&&c){ze||(ze=r.createElement("canvas"),li=ze.getContext("2d"));const w=e,C=w.currentSrc||w.getAttribute("src")||"<unknown-src>",S=w.crossOrigin,b=()=>{w.removeEventListener("load",b);try{ze.width=w.naturalWidth,ze.height=w.naturalHeight,li.drawImage(w,0,0),g.rr_dataURL=ze.toDataURL(l.type,l.quality)}catch(E){if(w.crossOrigin!=="anonymous"){w.crossOrigin="anonymous",w.complete&&w.naturalWidth!==0?b():w.addEventListener("load",b);return}else console.warn(`Cannot inline img src=${C}! Error: ${E}`)}w.crossOrigin==="anonymous"&&(S?g.crossOrigin=S:w.removeAttribute("crossorigin"))};w.complete&&w.naturalWidth!==0?b():w.addEventListener("load",b)}if(["audio","video"].includes(p)){const w=g;w.rr_mediaState=e.paused?"paused":"played",w.rr_mediaCurrentTime=e.currentTime,w.rr_mediaPlaybackRate=e.playbackRate,w.rr_mediaMuted=e.muted,w.rr_mediaLoop=e.loop,w.rr_mediaVolume=e.volume}if(h||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop)),m){const{width:w,height:C}=e.getBoundingClientRect();g={class:g.class,rr_width:`${w}px`,rr_height:`${C}px`}}p==="iframe"&&!d(g.src)&&(e.contentDocument||(g.rr_src=g.src),delete g.src);let y;try{customElements.get(p)&&(y=!0)}catch(w){}return{type:U.Element,tagName:p,attributes:g,childNodes:[],isSVG:Pa(e)||void 0,needBlock:m,rootId:f,isCustom:y}}function Y(e){return e==null?"":e.toLowerCase()}function Qn(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 za(e,t){if(t.comment&&e.type===U.Comment)return!0;if(e.type===U.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"&&bs(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(Y(e.attributes.name).match(/^msapplication-tile(image|color)$/)||Y(e.attributes.name)==="application-name"||Y(e.attributes.rel)==="icon"||Y(e.attributes.rel)==="apple-touch-icon"||Y(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&Y(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Y(e.attributes.property).match(/^(og|twitter|fb):/)||Y(e.attributes.name).match(/^(og|twitter):/)||Y(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(Y(e.attributes.name)==="robots"||Y(e.attributes.name)==="googlebot"||Y(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(Y(e.attributes.name)==="author"||Y(e.attributes.name)==="generator"||Y(e.attributes.name)==="framework"||Y(e.attributes.name)==="publisher"||Y(e.attributes.name)==="progid"||Y(e.attributes.property).match(/^article:/)||Y(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(Y(e.attributes.name)==="google-site-verification"||Y(e.attributes.name)==="yandex-verification"||Y(e.attributes.name)==="csrf-token"||Y(e.attributes.name)==="p:domain_verify"||Y(e.attributes.name)==="verify-v1"||Y(e.attributes.name)==="verification"||Y(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function He(e,t){const{doc:r,mirror:s,blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:u,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:n={},maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:m={},inlineImages:p=!1,recordCanvas:g=!1,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:w=5e3,onStylesheetLoad:C,stylesheetLoadTimeout:S=5e3,keepIframeSrcFn:b=()=>!1,newlyAddedElement:E=!1,cssCaptured:R=!1}=t;let{needsMask:I}=t,{preserveWhiteSpace:N=!0}=t;I||(I=Jn(e,a,u,I===void 0));const F=Ua(e,{doc:r,mirror:s,blockClass:i,blockSelector:o,needsMask:I,inlineStylesheet:c,maskInputOptions:n,maskTextFn:d,maskInputFn:h,dataURLOptions:m,inlineImages:p,recordCanvas:g,keepIframeSrcFn:b,newlyAddedElement:E,cssCaptured:R});if(!F)return console.warn(e,"not serialized"),null;let A;s.hasNode(e)?A=s.getId(e):za(F,f)||!N&&F.type===U.Text&&!F.textContent.replace(/^\s+|\s+$/gm,"").length?A=lt:A=Hn();const x=Object.assign(F,{id:A});if(s.add(e,x),A===lt)return null;v&&v(e);let ce=!l;if(x.type===U.Element){ce=ce&&!x.needBlock,delete x.needBlock;const j=ie.shadowRoot(e);j&&nt(j)&&(x.isShadowHost=!0)}if((x.type===U.Document||x.type===U.Element)&&ce){f.headWhitespace&&x.type===U.Element&&x.tagName==="head"&&(N=!1);const j={doc:r,mirror:s,blockClass:i,blockSelector:o,needsMask:I,maskTextClass:a,maskTextSelector:u,skipChild:l,inlineStylesheet:c,maskInputOptions:n,maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:m,inlineImages:p,recordCanvas:g,preserveWhiteSpace:N,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:C,stylesheetLoadTimeout:S,keepIframeSrcFn:b,cssCaptured:!1};if(!(x.type===U.Element&&x.tagName==="textarea"&&x.attributes.value!==void 0)){x.type===U.Element&&x.attributes._cssText!==void 0&&typeof x.attributes._cssText=="string"&&(j.cssCaptured=!0);for(const X of Array.from(ie.childNodes(e))){const te=He(X,j);te&&x.childNodes.push(te)}}let P=null;if(vs(e)&&(P=ie.shadowRoot(e)))for(const X of Array.from(ie.childNodes(P))){const te=He(X,j);te&&(nt(P)&&(te.isShadow=!0),x.childNodes.push(te))}}const ae=ie.parentNode(e);return ae&&it(ae)&&nt(ae)&&(x.isShadow=!0),x.type===U.Element&&x.tagName==="iframe"&&La(e,()=>{const j=e.contentDocument;if(j&&y){const P=He(j,{doc:j,mirror:s,blockClass:i,blockSelector:o,needsMask:I,maskTextClass:a,maskTextSelector:u,skipChild:!1,inlineStylesheet:c,maskInputOptions:n,maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:m,inlineImages:p,recordCanvas:g,preserveWhiteSpace:N,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:C,stylesheetLoadTimeout:S,keepIframeSrcFn:b});P&&y(e,P)}},w),x.type===U.Element&&x.tagName==="link"&&typeof x.attributes.rel=="string"&&(x.attributes.rel==="stylesheet"||x.attributes.rel==="preload"&&typeof x.attributes.href=="string"&&bs(x.attributes.href)==="css")&&Fa(e,()=>{if(C){const j=He(e,{doc:r,mirror:s,blockClass:i,blockSelector:o,needsMask:I,maskTextClass:a,maskTextSelector:u,skipChild:!1,inlineStylesheet:c,maskInputOptions:n,maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:m,inlineImages:p,recordCanvas:g,preserveWhiteSpace:N,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:C,stylesheetLoadTimeout:S,keepIframeSrcFn:b});j&&C(e,j)}},S),x}function Va(e,t){const{mirror:r=new Ss,blockClass:s="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:a=null,inlineStylesheet:u=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:n=!1,maskTextFn:d,maskInputFn:h,slimDOM:f=!1,dataURLOptions:m,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:w,stylesheetLoadTimeout:C,keepIframeSrcFn:S=()=>!1}=t,b=n===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:n===!1?{password:!0}:n,E=Qn(f);return He(e,{doc:e,mirror:r,blockClass:s,blockSelector:i,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:b,maskTextFn:d,maskInputFn:h,slimDOMOptions:E,dataURLOptions:m,inlineImages:l,recordCanvas:c,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:v,iframeLoadTimeout:y,onStylesheetLoad:w,stylesheetLoadTimeout:C,keepIframeSrcFn:S,newlyAddedElement:!1})}const ja=/(max|min)-device-(width|height)/,ci=new RegExp(ja.source,"g"),qa={postcssPlugin:"postcss-custom-selectors",prepare(){return{postcssPlugin:"postcss-custom-selectors",AtRule:function(e){e.params.match(ci)&&(e.params=e.params.replace(ci,"$1-$2"))}}}},Ga={postcssPlugin:"postcss-hover-classes",prepare:function(){const e=[];return{Rule:function(t){e.indexOf(t)===-1&&(e.push(t),t.selectors.forEach(function(r){r.includes(":hover")&&(t.selector+=`,
15
+ `+r.replace(/:hover/g,".\\:hover"))}))}}}};function Ha(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ya(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 i=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(r,s,i.get?i:{enumerable:!0,get:function(){return e[s]}})}),r}var yt={exports:{}},hi;function Xa(){if(hi)return yt.exports;hi=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 yt.exports=t(),yt.exports.createColors=t,yt.exports}const Ja={},Qa=Object.freeze(Object.defineProperty({__proto__:null,default:Ja},Symbol.toStringTag,{value:"Module"})),ye=Ya(Qa);var ar,fi;function Es(){if(fi)return ar;fi=1;let e=Xa(),t=ye;class r extends Error{constructor(i,o,a,u,l,c){super(i),this.name="CssSyntaxError",this.reason=i,l&&(this.file=l),u&&(this.source=u),c&&(this.plugin=c),typeof o!="undefined"&&typeof a!="undefined"&&(typeof o=="number"?(this.line=o,this.column=a):(this.line=o.line,this.column=o.column,this.endLine=a.line,this.endColumn=a.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!="undefined"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(i){if(!this.source)return"";let o=this.source;i==null&&(i=e.isColorSupported),t&&i&&(o=t(o));let a=o.split(/\r?\n/),u=Math.max(this.line-3,0),l=Math.min(this.line+2,a.length),c=String(l).length,n,d;if(i){let{bold:h,gray:f,red:m}=e.createColors(!0);n=p=>h(m(p)),d=p=>f(p)}else n=d=h=>h;return a.slice(u,l).map((h,f)=>{let m=u+1+f,p=" "+(" "+m).slice(-c)+" | ";if(m===this.line){let g=d(p.replace(/\d/g," "))+h.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+d(p)+h+`
16
16
  `+g+n("^")}return" "+d(p)+h}).join(`
17
17
  `)}toString(){let i=this.showSourceCode();return i&&(i=`
18
18
 
19
19
  `+i+`
20
- `),this.name+": "+this.message+i}}return Zt=r,r.default=r,Zt}var dt={},ri;function ps(){return ri||(ri=1,dt.isClean=Symbol("isClean"),dt.my=Symbol("my")),dt}var Kt,si;function Wn(){if(si)return Kt;si=1;const e={after:`
20
+ `),this.name+": "+this.message+i}}return ar=r,r.default=r,ar}var wt={},di;function xs(){return di||(di=1,wt.isClean=Symbol("isClean"),wt.my=Symbol("my")),wt}var lr,pi;function Zn(){if(pi)return lr;pi=1;const e={after:`
21
21
  `,beforeClose:`
22
22
  `,beforeComment:`
23
23
  `,beforeDecl:`
@@ -28,21 +28,21 @@ var module = { exports };
28
28
  `)&&(a=a.replace(/[^\n]+$/,"")),!1}),typeof a=="undefined"?a=this.raw(o,null,"beforeDecl"):a&&(a=a.replace(/\S/g,"")),a}rawBeforeDecl(i,o){let a;return i.walkDecls(u=>{if(typeof u.raws.before!="undefined")return a=u.raws.before,a.includes(`
29
29
  `)&&(a=a.replace(/[^\n]+$/,"")),!1}),typeof a=="undefined"?a=this.raw(o,null,"beforeRule"):a&&(a=a.replace(/\S/g,"")),a}rawBeforeOpen(i){let o;return i.walk(a=>{if(a.type!=="decl"&&(o=a.raws.between,typeof o!="undefined"))return!1}),o}rawBeforeRule(i){let o;return i.walk(a=>{if(a.nodes&&(a.parent!==i||i.first!==a)&&typeof a.raws.before!="undefined")return o=a.raws.before,o.includes(`
30
30
  `)&&(o=o.replace(/[^\n]+$/,"")),!1}),o&&(o=o.replace(/\S/g,"")),o}rawColon(i){let o;return i.walkDecls(a=>{if(typeof a.raws.between!="undefined")return o=a.raws.between.replace(/[^\s:]/g,""),!1}),o}rawEmptyBody(i){let o;return i.walk(a=>{if(a.nodes&&a.nodes.length===0&&(o=a.raws.after,typeof o!="undefined"))return!1}),o}rawIndent(i){if(i.raws.indent)return i.raws.indent;let o;return i.walk(a=>{let u=a.parent;if(u&&u!==i&&u.parent&&u.parent===i&&typeof a.raws.before!="undefined"){let l=a.raws.before.split(`
31
- `);return o=l[l.length-1],o=o.replace(/\S/g,""),!1}}),o}rawSemicolon(i){let o;return i.walk(a=>{if(a.nodes&&a.nodes.length&&a.last.type==="decl"&&(o=a.raws.semicolon,typeof o!="undefined"))return!1}),o}rawValue(i,o){let a=i[o],u=i.raws[o];return u&&u.value===a?u.raw:a}root(i){this.body(i),i.raws.after&&this.builder(i.raws.after)}rule(i){this.block(i,this.rawValue(i,"selector")),i.raws.ownSemicolon&&this.builder(i.raws.ownSemicolon,i,"end")}stringify(i,o){if(!this[i.type])throw new Error("Unknown AST node type "+i.type+". Maybe you need to change PostCSS stringifier.");this[i.type](i,o)}}return Kt=r,r.default=r,Kt}var er,ii;function Lt(){if(ii)return er;ii=1;let e=Wn();function t(r,s){new e(s).stringify(r)}return er=t,t.default=t,er}var tr,ni;function Ft(){if(ni)return tr;ni=1;let{isClean:e,my:t}=ps(),r=ds(),s=Wn(),i=Lt();function o(u,l){let c=new u.constructor;for(let n in u){if(!Object.prototype.hasOwnProperty.call(u,n)||n==="proxyCache")continue;let d=u[n],h=typeof d;n==="parent"&&h==="object"?l&&(c[n]=l):n==="source"?c[n]=d:Array.isArray(d)?c[n]=d.map(f=>o(f,c)):(h==="object"&&d!==null&&(d=o(d)),c[n]=d)}return c}class a{constructor(l={}){this.raws={},this[e]=!1,this[t]=!0;for(let c in l)if(c==="nodes"){this.nodes=[];for(let n of l[c])typeof n.clone=="function"?this.append(n.clone()):this.append(n)}else this[c]=l[c]}addToError(l){if(l.postcssNode=this,l.stack&&this.source&&/\n\s{4}at /.test(l.stack)){let c=this.source;l.stack=l.stack.replace(/\n\s{4}at /,`$&${c.input.from}:${c.start.line}:${c.start.column}$&`)}return l}after(l){return this.parent.insertAfter(this,l),this}assign(l={}){for(let c in l)this[c]=l[c];return this}before(l){return this.parent.insertBefore(this,l),this}cleanRaws(l){delete this.raws.before,delete this.raws.after,l||delete this.raws.between}clone(l={}){let c=o(this);for(let n in l)c[n]=l[n];return c}cloneAfter(l={}){let c=this.clone(l);return this.parent.insertAfter(this,c),c}cloneBefore(l={}){let c=this.clone(l);return this.parent.insertBefore(this,c),c}error(l,c={}){if(this.source){let{end:n,start:d}=this.rangeBy(c);return this.source.input.error(l,{column:d.column,line:d.line},{column:n.column,line:n.line},c)}return new r(l)}getProxyProcessor(){return{get(l,c){return c==="proxyOf"?l:c==="root"?()=>l.root().toProxy():l[c]},set(l,c,n){return l[c]===n||(l[c]=n,(c==="prop"||c==="value"||c==="name"||c==="params"||c==="important"||c==="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,c){let n=this.source.start;if(l.index)n=this.positionInside(l.index,c);else if(l.word){c=this.toString();let d=c.indexOf(l.word);d!==-1&&(n=this.positionInside(d,c))}return n}positionInside(l,c){let n=c||this.toString(),d=this.source.start.column,h=this.source.start.line;for(let f=0;f<l;f++)n[f]===`
32
- `?(d=1,h+=1):d+=1;return{column:d,line:h}}prev(){if(!this.parent)return;let l=this.parent.index(this);return this.parent.nodes[l-1]}rangeBy(l){let c={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:c.column+1,line:c.line};if(l.word){let d=this.toString(),h=d.indexOf(l.word);h!==-1&&(c=this.positionInside(h,d),n=this.positionInside(h+l.word.length,d))}else l.start?c={column:l.start.column,line:l.start.line}:l.index&&(c=this.positionInside(l.index)),l.end?n={column:l.end.column,line:l.end.line}:typeof l.endIndex=="number"?n=this.positionInside(l.endIndex):l.index&&(n=this.positionInside(l.index+1));return(n.line<c.line||n.line===c.line&&n.column<=c.column)&&(n={column:c.column+1,line:c.line}),{end:n,start:c}}raw(l,c){return new s().raw(this,l,c)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...l){if(this.parent){let c=this,n=!1;for(let d of l)d===this?n=!0:n?(this.parent.insertAfter(c,d),c=d):this.parent.insertBefore(c,d);n||this.remove()}return this}root(){let l=this;for(;l.parent&&l.parent.type!=="document";)l=l.parent;return l}toJSON(l,c){let n={},d=c==null;c=c||new Map;let h=0;for(let f in this){if(!Object.prototype.hasOwnProperty.call(this,f)||f==="parent"||f==="proxyCache")continue;let m=this[f];if(Array.isArray(m))n[f]=m.map(p=>typeof p=="object"&&p.toJSON?p.toJSON(null,c):p);else if(typeof m=="object"&&m.toJSON)n[f]=m.toJSON(null,c);else if(f==="source"){let p=c.get(m.input);p==null&&(p=h,c.set(m.input,h),h++),n[f]={end:m.end,inputId:p,start:m.start}}else n[f]=m}return d&&(n.inputs=[...c.keys()].map(f=>f.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(l=i){l.stringify&&(l=l.stringify);let c="";return l(this,n=>{c+=n}),c}warn(l,c,n){let d={node:this};for(let h in n)d[h]=n[h];return l.warn(c,d)}get proxyOf(){return this}}return tr=a,a.default=a,tr}var rr,oi;function Ut(){if(oi)return rr;oi=1;let e=Ft();class t extends e{constructor(s){s&&typeof s.value!="undefined"&&typeof s.value!="string"&&(s=se(P({},s),{value:String(s.value)})),super(s),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}}return rr=t,t.default=t,rr}var sr,ai;function Ua(){if(ai)return sr;ai=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return sr={nanoid:(s=21)=>{let i="",o=s;for(;o--;)i+=e[Math.random()*64|0];return i},customAlphabet:(s,i=21)=>(o=i)=>{let a="",u=o;for(;u--;)a+=s[Math.random()*s.length|0];return a}},sr}var ir,li;function $n(){if(li)return ir;li=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=me,{existsSync:r,readFileSync:s}=me,{dirname:i,join:o}=me;function a(l){return Buffer?Buffer.from(l,"base64").toString():window.atob(l)}class u{constructor(c,n){if(n.map===!1)return;this.loadAnnotation(c),this.inline=this.startWith(this.annotation,"data:");let d=n.map?n.map.prev:void 0,h=this.loadMap(n.from,d);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=i(this.mapFile)),h&&(this.text=h)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(c){let n=/^data:application\/json;charset=utf-?8;base64,/,d=/^data:application\/json;base64,/,h=/^data:application\/json;charset=utf-?8,/,f=/^data:application\/json,/;if(h.test(c)||f.test(c))return decodeURIComponent(c.substr(RegExp.lastMatch.length));if(n.test(c)||d.test(c))return a(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 n=c.match(/\/\*\s*# sourceMappingURL=/gm);if(!n)return;let d=c.lastIndexOf(n.pop()),h=c.indexOf("*/",d);d>-1&&h>-1&&(this.annotation=this.getAnnotationURL(c.substring(d,h)))}loadFile(c){if(this.root=i(c),r(c))return this.mapFile=c,s(c,"utf-8").toString().trim()}loadMap(c,n){if(n===!1)return!1;if(n){if(typeof n=="string")return n;if(typeof n=="function"){let d=n(c);if(d){let h=this.loadFile(d);if(!h)throw new Error("Unable to load previous source map: "+d.toString());return h}}else{if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let d=this.annotation;return c&&(d=o(i(c),d)),this.loadFile(d)}}}startWith(c,n){return c?c.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return ir=u,u.default=u,ir}var nr,ui;function Bt(){if(ui)return nr;ui=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=me,{fileURLToPath:r,pathToFileURL:s}=me,{isAbsolute:i,resolve:o}=me,{nanoid:a}=Ua(),u=me,l=ds(),c=$n(),n=Symbol("fromOffsetCache"),d=!!(e&&t),h=!!(o&&i);class f{constructor(p,g={}){if(p===null||typeof p=="undefined"||typeof p=="object"&&!p.toString)throw new Error(`PostCSS received ${p} instead of CSS string`);if(this.css=p.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,g.from&&(!h||/^\w+:\/\//.test(g.from)||i(g.from)?this.file=g.from:this.file=o(g.from)),h&&d){let v=new c(this.css,g);if(v.text){this.map=v;let y=v.consumer().file;!this.file&&y&&(this.file=this.mapResolve(y))}}this.file||(this.id="<input css "+a(6)+">"),this.map&&(this.map.file=this.from)}error(p,g,v,y={}){let w,C,S;if(g&&typeof g=="object"){let E=g,M=v;if(typeof E.offset=="number"){let I=this.fromOffset(E.offset);g=I.line,v=I.col}else g=E.line,v=E.column;if(typeof M.offset=="number"){let I=this.fromOffset(M.offset);C=I.line,S=I.col}else C=M.line,S=M.column}else if(!v){let E=this.fromOffset(g);g=E.line,v=E.col}let b=this.origin(g,v,C,S);return b?w=new l(p,b.endLine===void 0?b.line:{column:b.column,line:b.line},b.endLine===void 0?b.column:{column:b.endColumn,line:b.endLine},b.source,b.file,y.plugin):w=new l(p,C===void 0?g:{column:v,line:g},C===void 0?v:{column:S,line:C},this.css,this.file,y.plugin),w.input={column:v,endColumn:S,endLine:C,line:g,source:this.css},this.file&&(s&&(w.input.url=s(this.file).toString()),w.input.file=this.file),w}fromOffset(p){let g,v;if(this[n])v=this[n];else{let w=this.css.split(`
33
- `);v=new Array(w.length);let C=0;for(let S=0,b=w.length;S<b;S++)v[S]=C,C+=w[S].length+1;this[n]=v}g=v[v.length-1];let y=0;if(p>=g)y=v.length-1;else{let w=v.length-2,C;for(;y<w;)if(C=y+(w-y>>1),p<v[C])w=C-1;else if(p>=v[C+1])y=C+1;else{y=C;break}}return{col:p-v[y]+1,line:y+1}}mapResolve(p){return/^\w+:\/\//.test(p)?p:o(this.map.consumer().sourceRoot||this.map.root||".",p)}origin(p,g,v,y){if(!this.map)return!1;let w=this.map.consumer(),C=w.originalPositionFor({column:g,line:p});if(!C.source)return!1;let S;typeof v=="number"&&(S=w.originalPositionFor({column:y,line:v}));let b;i(C.source)?b=s(C.source):b=new URL(C.source,this.map.consumer().sourceRoot||s(this.map.mapFile));let E={column:C.column,endColumn:S&&S.column,endLine:S&&S.line,line:C.line,url:b.toString()};if(b.protocol==="file:")if(r)E.file=r(b);else throw new Error("file: protocol is not available in this PostCSS build");let M=w.sourceContentFor(C.source);return M&&(E.source=M),E}toJSON(){let p={};for(let g of["hasBOM","css","file","id"])this[g]!=null&&(p[g]=this[g]);return this.map&&(p.map=P({},this.map),p.map.consumerCache&&(p.map.consumerCache=void 0)),p}get from(){return this.file||this.id}}return nr=f,f.default=f,u&&u.registerInput&&u.registerInput(f),nr}var or,ci;function zn(){if(ci)return or;ci=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=me,{dirname:r,relative:s,resolve:i,sep:o}=me,{pathToFileURL:a}=me,u=Bt(),l=!!(e&&t),c=!!(r&&i&&s&&o);class n{constructor(h,f,m,p){this.stringify=h,this.mapOpts=m.map||{},this.root=f,this.opts=m,this.css=p,this.originalCSS=p,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let h;this.isInline()?h="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?h=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?h=this.mapOpts.annotation(this.opts.to,this.root):h=this.outputFile()+".map";let f=`
31
+ `);return o=l[l.length-1],o=o.replace(/\S/g,""),!1}}),o}rawSemicolon(i){let o;return i.walk(a=>{if(a.nodes&&a.nodes.length&&a.last.type==="decl"&&(o=a.raws.semicolon,typeof o!="undefined"))return!1}),o}rawValue(i,o){let a=i[o],u=i.raws[o];return u&&u.value===a?u.raw:a}root(i){this.body(i),i.raws.after&&this.builder(i.raws.after)}rule(i){this.block(i,this.rawValue(i,"selector")),i.raws.ownSemicolon&&this.builder(i.raws.ownSemicolon,i,"end")}stringify(i,o){if(!this[i.type])throw new Error("Unknown AST node type "+i.type+". Maybe you need to change PostCSS stringifier.");this[i.type](i,o)}}return lr=r,r.default=r,lr}var ur,mi;function Gt(){if(mi)return ur;mi=1;let e=Zn();function t(r,s){new e(s).stringify(r)}return ur=t,t.default=t,ur}var cr,gi;function Ht(){if(gi)return cr;gi=1;let{isClean:e,my:t}=xs(),r=Es(),s=Zn(),i=Gt();function o(u,l){let c=new u.constructor;for(let n in u){if(!Object.prototype.hasOwnProperty.call(u,n)||n==="proxyCache")continue;let d=u[n],h=typeof d;n==="parent"&&h==="object"?l&&(c[n]=l):n==="source"?c[n]=d:Array.isArray(d)?c[n]=d.map(f=>o(f,c)):(h==="object"&&d!==null&&(d=o(d)),c[n]=d)}return c}class a{constructor(l={}){this.raws={},this[e]=!1,this[t]=!0;for(let c in l)if(c==="nodes"){this.nodes=[];for(let n of l[c])typeof n.clone=="function"?this.append(n.clone()):this.append(n)}else this[c]=l[c]}addToError(l){if(l.postcssNode=this,l.stack&&this.source&&/\n\s{4}at /.test(l.stack)){let c=this.source;l.stack=l.stack.replace(/\n\s{4}at /,`$&${c.input.from}:${c.start.line}:${c.start.column}$&`)}return l}after(l){return this.parent.insertAfter(this,l),this}assign(l={}){for(let c in l)this[c]=l[c];return this}before(l){return this.parent.insertBefore(this,l),this}cleanRaws(l){delete this.raws.before,delete this.raws.after,l||delete this.raws.between}clone(l={}){let c=o(this);for(let n in l)c[n]=l[n];return c}cloneAfter(l={}){let c=this.clone(l);return this.parent.insertAfter(this,c),c}cloneBefore(l={}){let c=this.clone(l);return this.parent.insertBefore(this,c),c}error(l,c={}){if(this.source){let{end:n,start:d}=this.rangeBy(c);return this.source.input.error(l,{column:d.column,line:d.line},{column:n.column,line:n.line},c)}return new r(l)}getProxyProcessor(){return{get(l,c){return c==="proxyOf"?l:c==="root"?()=>l.root().toProxy():l[c]},set(l,c,n){return l[c]===n||(l[c]=n,(c==="prop"||c==="value"||c==="name"||c==="params"||c==="important"||c==="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,c){let n=this.source.start;if(l.index)n=this.positionInside(l.index,c);else if(l.word){c=this.toString();let d=c.indexOf(l.word);d!==-1&&(n=this.positionInside(d,c))}return n}positionInside(l,c){let n=c||this.toString(),d=this.source.start.column,h=this.source.start.line;for(let f=0;f<l;f++)n[f]===`
32
+ `?(d=1,h+=1):d+=1;return{column:d,line:h}}prev(){if(!this.parent)return;let l=this.parent.index(this);return this.parent.nodes[l-1]}rangeBy(l){let c={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:c.column+1,line:c.line};if(l.word){let d=this.toString(),h=d.indexOf(l.word);h!==-1&&(c=this.positionInside(h,d),n=this.positionInside(h+l.word.length,d))}else l.start?c={column:l.start.column,line:l.start.line}:l.index&&(c=this.positionInside(l.index)),l.end?n={column:l.end.column,line:l.end.line}:typeof l.endIndex=="number"?n=this.positionInside(l.endIndex):l.index&&(n=this.positionInside(l.index+1));return(n.line<c.line||n.line===c.line&&n.column<=c.column)&&(n={column:c.column+1,line:c.line}),{end:n,start:c}}raw(l,c){return new s().raw(this,l,c)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...l){if(this.parent){let c=this,n=!1;for(let d of l)d===this?n=!0:n?(this.parent.insertAfter(c,d),c=d):this.parent.insertBefore(c,d);n||this.remove()}return this}root(){let l=this;for(;l.parent&&l.parent.type!=="document";)l=l.parent;return l}toJSON(l,c){let n={},d=c==null;c=c||new Map;let h=0;for(let f in this){if(!Object.prototype.hasOwnProperty.call(this,f)||f==="parent"||f==="proxyCache")continue;let m=this[f];if(Array.isArray(m))n[f]=m.map(p=>typeof p=="object"&&p.toJSON?p.toJSON(null,c):p);else if(typeof m=="object"&&m.toJSON)n[f]=m.toJSON(null,c);else if(f==="source"){let p=c.get(m.input);p==null&&(p=h,c.set(m.input,h),h++),n[f]={end:m.end,inputId:p,start:m.start}}else n[f]=m}return d&&(n.inputs=[...c.keys()].map(f=>f.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(l=i){l.stringify&&(l=l.stringify);let c="";return l(this,n=>{c+=n}),c}warn(l,c,n){let d={node:this};for(let h in n)d[h]=n[h];return l.warn(c,d)}get proxyOf(){return this}}return cr=a,a.default=a,cr}var hr,yi;function Yt(){if(yi)return hr;yi=1;let e=Ht();class t extends e{constructor(s){s&&typeof s.value!="undefined"&&typeof s.value!="string"&&(s=se(k({},s),{value:String(s.value)})),super(s),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}}return hr=t,t.default=t,hr}var fr,wi;function Za(){if(wi)return fr;wi=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return fr={nanoid:(s=21)=>{let i="",o=s;for(;o--;)i+=e[Math.random()*64|0];return i},customAlphabet:(s,i=21)=>(o=i)=>{let a="",u=o;for(;u--;)a+=s[Math.random()*s.length|0];return a}},fr}var dr,vi;function Kn(){if(vi)return dr;vi=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=ye,{existsSync:r,readFileSync:s}=ye,{dirname:i,join:o}=ye;function a(l){return Buffer?Buffer.from(l,"base64").toString():window.atob(l)}class u{constructor(c,n){if(n.map===!1)return;this.loadAnnotation(c),this.inline=this.startWith(this.annotation,"data:");let d=n.map?n.map.prev:void 0,h=this.loadMap(n.from,d);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=i(this.mapFile)),h&&(this.text=h)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(c){let n=/^data:application\/json;charset=utf-?8;base64,/,d=/^data:application\/json;base64,/,h=/^data:application\/json;charset=utf-?8,/,f=/^data:application\/json,/;if(h.test(c)||f.test(c))return decodeURIComponent(c.substr(RegExp.lastMatch.length));if(n.test(c)||d.test(c))return a(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 n=c.match(/\/\*\s*# sourceMappingURL=/gm);if(!n)return;let d=c.lastIndexOf(n.pop()),h=c.indexOf("*/",d);d>-1&&h>-1&&(this.annotation=this.getAnnotationURL(c.substring(d,h)))}loadFile(c){if(this.root=i(c),r(c))return this.mapFile=c,s(c,"utf-8").toString().trim()}loadMap(c,n){if(n===!1)return!1;if(n){if(typeof n=="string")return n;if(typeof n=="function"){let d=n(c);if(d){let h=this.loadFile(d);if(!h)throw new Error("Unable to load previous source map: "+d.toString());return h}}else{if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let d=this.annotation;return c&&(d=o(i(c),d)),this.loadFile(d)}}}startWith(c,n){return c?c.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return dr=u,u.default=u,dr}var pr,Si;function Xt(){if(Si)return pr;Si=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=ye,{fileURLToPath:r,pathToFileURL:s}=ye,{isAbsolute:i,resolve:o}=ye,{nanoid:a}=Za(),u=ye,l=Es(),c=Kn(),n=Symbol("fromOffsetCache"),d=!!(e&&t),h=!!(o&&i);class f{constructor(p,g={}){if(p===null||typeof p=="undefined"||typeof p=="object"&&!p.toString)throw new Error(`PostCSS received ${p} instead of CSS string`);if(this.css=p.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,g.from&&(!h||/^\w+:\/\//.test(g.from)||i(g.from)?this.file=g.from:this.file=o(g.from)),h&&d){let v=new c(this.css,g);if(v.text){this.map=v;let y=v.consumer().file;!this.file&&y&&(this.file=this.mapResolve(y))}}this.file||(this.id="<input css "+a(6)+">"),this.map&&(this.map.file=this.from)}error(p,g,v,y={}){let w,C,S;if(g&&typeof g=="object"){let E=g,R=v;if(typeof E.offset=="number"){let I=this.fromOffset(E.offset);g=I.line,v=I.col}else g=E.line,v=E.column;if(typeof R.offset=="number"){let I=this.fromOffset(R.offset);C=I.line,S=I.col}else C=R.line,S=R.column}else if(!v){let E=this.fromOffset(g);g=E.line,v=E.col}let b=this.origin(g,v,C,S);return b?w=new l(p,b.endLine===void 0?b.line:{column:b.column,line:b.line},b.endLine===void 0?b.column:{column:b.endColumn,line:b.endLine},b.source,b.file,y.plugin):w=new l(p,C===void 0?g:{column:v,line:g},C===void 0?v:{column:S,line:C},this.css,this.file,y.plugin),w.input={column:v,endColumn:S,endLine:C,line:g,source:this.css},this.file&&(s&&(w.input.url=s(this.file).toString()),w.input.file=this.file),w}fromOffset(p){let g,v;if(this[n])v=this[n];else{let w=this.css.split(`
33
+ `);v=new Array(w.length);let C=0;for(let S=0,b=w.length;S<b;S++)v[S]=C,C+=w[S].length+1;this[n]=v}g=v[v.length-1];let y=0;if(p>=g)y=v.length-1;else{let w=v.length-2,C;for(;y<w;)if(C=y+(w-y>>1),p<v[C])w=C-1;else if(p>=v[C+1])y=C+1;else{y=C;break}}return{col:p-v[y]+1,line:y+1}}mapResolve(p){return/^\w+:\/\//.test(p)?p:o(this.map.consumer().sourceRoot||this.map.root||".",p)}origin(p,g,v,y){if(!this.map)return!1;let w=this.map.consumer(),C=w.originalPositionFor({column:g,line:p});if(!C.source)return!1;let S;typeof v=="number"&&(S=w.originalPositionFor({column:y,line:v}));let b;i(C.source)?b=s(C.source):b=new URL(C.source,this.map.consumer().sourceRoot||s(this.map.mapFile));let E={column:C.column,endColumn:S&&S.column,endLine:S&&S.line,line:C.line,url:b.toString()};if(b.protocol==="file:")if(r)E.file=r(b);else throw new Error("file: protocol is not available in this PostCSS build");let R=w.sourceContentFor(C.source);return R&&(E.source=R),E}toJSON(){let p={};for(let g of["hasBOM","css","file","id"])this[g]!=null&&(p[g]=this[g]);return this.map&&(p.map=k({},this.map),p.map.consumerCache&&(p.map.consumerCache=void 0)),p}get from(){return this.file||this.id}}return pr=f,f.default=f,u&&u.registerInput&&u.registerInput(f),pr}var mr,bi;function eo(){if(bi)return mr;bi=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=ye,{dirname:r,relative:s,resolve:i,sep:o}=ye,{pathToFileURL:a}=ye,u=Xt(),l=!!(e&&t),c=!!(r&&i&&s&&o);class n{constructor(h,f,m,p){this.stringify=h,this.mapOpts=m.map||{},this.root=f,this.opts=m,this.css=p,this.originalCSS=p,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let h;this.isInline()?h="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?h=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?h=this.mapOpts.annotation(this.opts.to,this.root):h=this.outputFile()+".map";let f=`
34
34
  `;this.css.includes(`\r
35
35
  `)&&(f=`\r
36
36
  `),this.css+=f+"/*# sourceMappingURL="+h+" */"}applyPrevMaps(){for(let h of this.previous()){let f=this.toUrl(this.path(h.file)),m=h.root||r(h.file),p;this.mapOpts.sourcesContent===!1?(p=new e(h.text),p.sourcesContent&&(p.sourcesContent=null)):p=h.consumer(),this.map.applySourceMap(p,f,this.toUrl(this.path(m)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let h;for(let f=this.root.nodes.length-1;f>=0;f--)h=this.root.nodes[f],h.type==="comment"&&h.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(f)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),c&&l&&this.isMap())return this.generateMap();{let h="";return this.stringify(this.root,f=>{h+=f}),[h]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let h=this.previous()[0].consumer();h.file=this.outputFile(),this.map=t.fromSourceMap(h,{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 h=1,f=1,m="<no source>",p={generated:{column:0,line:0},original:{column:0,line:0},source:""},g,v;this.stringify(this.root,(y,w,C)=>{if(this.css+=y,w&&C!=="end"&&(p.generated.line=h,p.generated.column=f-1,w.source&&w.source.start?(p.source=this.sourcePath(w),p.original.line=w.source.start.line,p.original.column=w.source.start.column-1,this.map.addMapping(p)):(p.source=m,p.original.line=1,p.original.column=0,this.map.addMapping(p))),g=y.match(/\n/g),g?(h+=g.length,v=y.lastIndexOf(`
37
- `),f=y.length-v):f+=y.length,w&&C!=="start"){let S=w.parent||{raws:{}};(!(w.type==="decl"||w.type==="atrule"&&!w.nodes)||w!==S.last||S.raws.semicolon)&&(w.source&&w.source.end?(p.source=this.sourcePath(w),p.original.line=w.source.end.line,p.original.column=w.source.end.column-1,p.generated.line=h,p.generated.column=f-2,this.map.addMapping(p)):(p.source=m,p.original.line=1,p.original.column=0,p.generated.line=h,p.generated.column=f-1,this.map.addMapping(p)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation!="undefined"?this.mapOpts.annotation:this.previous().length?this.previous().some(h=>h.annotation):!0}isInline(){if(typeof this.mapOpts.inline!="undefined")return this.mapOpts.inline;let h=this.mapOpts.annotation;return typeof h!="undefined"&&h!==!0?!1:this.previous().length?this.previous().some(f=>f.inline):!0}isMap(){return typeof this.opts.map!="undefined"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent!="undefined"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(h=>h.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(h){if(this.mapOpts.absolute||h.charCodeAt(0)===60||/^\w+:\/\//.test(h))return h;let f=this.memoizedPaths.get(h);if(f)return f;let m=this.opts.to?r(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(m=r(i(m,this.mapOpts.annotation)));let p=s(m,h);return this.memoizedPaths.set(h,p),p}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(h=>{if(h.source&&h.source.input.map){let f=h.source.input.map;this.previousMaps.includes(f)||this.previousMaps.push(f)}});else{let h=new u(this.originalCSS,this.opts);h.map&&this.previousMaps.push(h.map)}return this.previousMaps}setSourcesContent(){let h={};if(this.root)this.root.walk(f=>{if(f.source){let m=f.source.input.from;if(m&&!h[m]){h[m]=!0;let p=this.usesFileUrls?this.toFileUrl(m):this.toUrl(this.path(m));this.map.setSourceContent(p,f.source.input.css)}}});else if(this.css){let f=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(f,this.css)}}sourcePath(h){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(h.source.input.from):this.toUrl(this.path(h.source.input.from))}toBase64(h){return Buffer?Buffer.from(h).toString("base64"):window.btoa(unescape(encodeURIComponent(h)))}toFileUrl(h){let f=this.memoizedFileURLs.get(h);if(f)return f;if(a){let m=a(h).toString();return this.memoizedFileURLs.set(h,m),m}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(h){let f=this.memoizedURLs.get(h);if(f)return f;o==="\\"&&(h=h.replace(/\\/g,"/"));let m=encodeURI(h).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(h,m),m}}return or=n,or}var ar,hi;function Wt(){if(hi)return ar;hi=1;let e=Ft();class t extends e{constructor(s){super(s),this.type="comment"}}return ar=t,t.default=t,ar}var lr,fi;function Pe(){if(fi)return lr;fi=1;let{isClean:e,my:t}=ps(),r=Ut(),s=Wt(),i=Ft(),o,a,u,l;function c(h){return h.map(f=>(f.nodes&&(f.nodes=c(f.nodes)),delete f.source,f))}function n(h){if(h[e]=!1,h.proxyOf.nodes)for(let f of h.proxyOf.nodes)n(f)}class d extends i{append(...f){for(let m of f){let p=this.normalize(m,this.last);for(let g of p)this.proxyOf.nodes.push(g)}return this.markDirty(),this}cleanRaws(f){if(super.cleanRaws(f),this.nodes)for(let m of this.nodes)m.cleanRaws(f)}each(f){if(!this.proxyOf.nodes)return;let m=this.getIterator(),p,g;for(;this.indexes[m]<this.proxyOf.nodes.length&&(p=this.indexes[m],g=f(this.proxyOf.nodes[p],p),g!==!1);)this.indexes[m]+=1;return delete this.indexes[m],g}every(f){return this.nodes.every(f)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let f=this.lastEach;return this.indexes[f]=0,f}getProxyProcessor(){return{get(f,m){return m==="proxyOf"?f:f[m]?m==="each"||typeof m=="string"&&m.startsWith("walk")?(...p)=>f[m](...p.map(g=>typeof g=="function"?(v,y)=>g(v.toProxy(),y):g)):m==="every"||m==="some"?p=>f[m]((g,...v)=>p(g.toProxy(),...v)):m==="root"?()=>f.root().toProxy():m==="nodes"?f.nodes.map(p=>p.toProxy()):m==="first"||m==="last"?f[m].toProxy():f[m]:f[m]},set(f,m,p){return f[m]===p||(f[m]=p,(m==="name"||m==="params"||m==="selector")&&f.markDirty()),!0}}}index(f){return typeof f=="number"?f:(f.proxyOf&&(f=f.proxyOf),this.proxyOf.nodes.indexOf(f))}insertAfter(f,m){let p=this.index(f),g=this.normalize(m,this.proxyOf.nodes[p]).reverse();p=this.index(f);for(let y of g)this.proxyOf.nodes.splice(p+1,0,y);let v;for(let y in this.indexes)v=this.indexes[y],p<v&&(this.indexes[y]=v+g.length);return this.markDirty(),this}insertBefore(f,m){let p=this.index(f),g=p===0?"prepend":!1,v=this.normalize(m,this.proxyOf.nodes[p],g).reverse();p=this.index(f);for(let w of v)this.proxyOf.nodes.splice(p,0,w);let y;for(let w in this.indexes)y=this.indexes[w],p<=y&&(this.indexes[w]=y+v.length);return this.markDirty(),this}normalize(f,m){if(typeof f=="string")f=c(o(f).nodes);else if(typeof f=="undefined")f=[];else if(Array.isArray(f)){f=f.slice(0);for(let g of f)g.parent&&g.parent.removeChild(g,"ignore")}else if(f.type==="root"&&this.type!=="document"){f=f.nodes.slice(0);for(let g of f)g.parent&&g.parent.removeChild(g,"ignore")}else if(f.type)f=[f];else if(f.prop){if(typeof f.value=="undefined")throw new Error("Value field is missed in node creation");typeof f.value!="string"&&(f.value=String(f.value)),f=[new r(f)]}else if(f.selector)f=[new a(f)];else if(f.name)f=[new u(f)];else if(f.text)f=[new s(f)];else throw new Error("Unknown node type in node creation");return f.map(g=>(g[t]||d.rebuild(g),g=g.proxyOf,g.parent&&g.parent.removeChild(g),g[e]&&n(g),typeof g.raws.before=="undefined"&&m&&typeof m.raws.before!="undefined"&&(g.raws.before=m.raws.before.replace(/\S/g,"")),g.parent=this.proxyOf,g))}prepend(...f){f=f.reverse();for(let m of f){let p=this.normalize(m,this.first,"prepend").reverse();for(let g of p)this.proxyOf.nodes.unshift(g);for(let g in this.indexes)this.indexes[g]=this.indexes[g]+p.length}return this.markDirty(),this}push(f){return f.parent=this,this.proxyOf.nodes.push(f),this}removeAll(){for(let f of this.proxyOf.nodes)f.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(f){f=this.index(f),this.proxyOf.nodes[f].parent=void 0,this.proxyOf.nodes.splice(f,1);let m;for(let p in this.indexes)m=this.indexes[p],m>=f&&(this.indexes[p]=m-1);return this.markDirty(),this}replaceValues(f,m,p){return p||(p=m,m={}),this.walkDecls(g=>{m.props&&!m.props.includes(g.prop)||m.fast&&!g.value.includes(m.fast)||(g.value=g.value.replace(f,p))}),this.markDirty(),this}some(f){return this.nodes.some(f)}walk(f){return this.each((m,p)=>{let g;try{g=f(m,p)}catch(v){throw m.addToError(v)}return g!==!1&&m.walk&&(g=m.walk(f)),g})}walkAtRules(f,m){return m?f instanceof RegExp?this.walk((p,g)=>{if(p.type==="atrule"&&f.test(p.name))return m(p,g)}):this.walk((p,g)=>{if(p.type==="atrule"&&p.name===f)return m(p,g)}):(m=f,this.walk((p,g)=>{if(p.type==="atrule")return m(p,g)}))}walkComments(f){return this.walk((m,p)=>{if(m.type==="comment")return f(m,p)})}walkDecls(f,m){return m?f instanceof RegExp?this.walk((p,g)=>{if(p.type==="decl"&&f.test(p.prop))return m(p,g)}):this.walk((p,g)=>{if(p.type==="decl"&&p.prop===f)return m(p,g)}):(m=f,this.walk((p,g)=>{if(p.type==="decl")return m(p,g)}))}walkRules(f,m){return m?f instanceof RegExp?this.walk((p,g)=>{if(p.type==="rule"&&f.test(p.selector))return m(p,g)}):this.walk((p,g)=>{if(p.type==="rule"&&p.selector===f)return m(p,g)}):(m=f,this.walk((p,g)=>{if(p.type==="rule")return m(p,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 d.registerParse=h=>{o=h},d.registerRule=h=>{a=h},d.registerAtRule=h=>{u=h},d.registerRoot=h=>{l=h},lr=d,d.default=d,d.rebuild=h=>{h.type==="atrule"?Object.setPrototypeOf(h,u.prototype):h.type==="rule"?Object.setPrototypeOf(h,a.prototype):h.type==="decl"?Object.setPrototypeOf(h,r.prototype):h.type==="comment"?Object.setPrototypeOf(h,s.prototype):h.type==="root"&&Object.setPrototypeOf(h,l.prototype),h[t]=!0,h.nodes&&h.nodes.forEach(f=>{d.rebuild(f)})},lr}var ur,di;function ms(){if(di)return ur;di=1;let e=Pe(),t,r;class s extends e{constructor(o){super(P({type:"document"},o)),this.nodes||(this.nodes=[])}toResult(o={}){return new t(new r,this,o).stringify()}}return s.registerLazyResult=i=>{t=i},s.registerProcessor=i=>{r=i},ur=s,s.default=s,ur}var cr,pi;function Vn(){if(pi)return cr;pi=1;let e={};return cr=function(r){e[r]||(e[r]=!0,typeof console!="undefined"&&console.warn&&console.warn(r))},cr}var hr,mi;function qn(){if(mi)return hr;mi=1;class e{constructor(r,s={}){if(this.type="warning",this.text=r,s.node&&s.node.source){let i=s.node.rangeBy(s);this.line=i.start.line,this.column=i.start.column,this.endLine=i.end.line,this.endColumn=i.end.column}for(let i in s)this[i]=s[i]}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 hr=e,e.default=e,hr}var fr,gi;function gs(){if(gi)return fr;gi=1;let e=qn();class t{constructor(s,i,o){this.processor=s,this.messages=[],this.root=i,this.opts=o,this.css=void 0,this.map=void 0}toString(){return this.css}warn(s,i={}){i.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(i.plugin=this.lastPlugin.postcssPlugin);let o=new e(s,i);return this.messages.push(o),o}warnings(){return this.messages.filter(s=>s.type==="warning")}get content(){return this.css}}return fr=t,t.default=t,fr}var dr,yi;function Ba(){if(yi)return dr;yi=1;const e=39,t=34,r=92,s=47,i=10,o=32,a=12,u=9,l=13,c=91,n=93,d=40,h=41,f=123,m=125,p=59,g=42,v=58,y=64,w=/[\t\n\f\r "#'()/;[\\\]{}]/g,C=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,b=/[\da-f]/i;return dr=function(M,I={}){let N=M.css.valueOf(),F=I.ignoreErrors,T,x,ue,ae,q,k,X,te,Z,G,Re=N.length,O=0,we=[],fe=[];function Ze(){return O}function le(L){throw M.error("Unclosed "+L,O)}function de(){return fe.length===0&&O>=Re}function _e(L){if(fe.length)return fe.pop();if(O>=Re)return;let re=L?L.ignoreUnclosed:!1;switch(T=N.charCodeAt(O),T){case i:case o:case u:case l:case a:{x=O;do x+=1,T=N.charCodeAt(x);while(T===o||T===i||T===u||T===l||T===a);G=["space",N.slice(O,x)],O=x-1;break}case c:case n:case f:case m:case v:case p:case h:{let j=String.fromCharCode(T);G=[j,j,O];break}case d:{if(te=we.length?we.pop()[1]:"",Z=N.charCodeAt(O+1),te==="url"&&Z!==e&&Z!==t&&Z!==o&&Z!==i&&Z!==u&&Z!==a&&Z!==l){x=O;do{if(k=!1,x=N.indexOf(")",x+1),x===-1)if(F||re){x=O;break}else le("bracket");for(X=x;N.charCodeAt(X-1)===r;)X-=1,k=!k}while(k);G=["brackets",N.slice(O,x+1),O,x],O=x}else x=N.indexOf(")",O+1),ae=N.slice(O,x+1),x===-1||S.test(ae)?G=["(","(",O]:(G=["brackets",ae,O,x],O=x);break}case e:case t:{ue=T===e?"'":'"',x=O;do{if(k=!1,x=N.indexOf(ue,x+1),x===-1)if(F||re){x=O+1;break}else le("string");for(X=x;N.charCodeAt(X-1)===r;)X-=1,k=!k}while(k);G=["string",N.slice(O,x+1),O,x],O=x;break}case y:{w.lastIndex=O+1,w.test(N),w.lastIndex===0?x=N.length-1:x=w.lastIndex-2,G=["at-word",N.slice(O,x+1),O,x],O=x;break}case r:{for(x=O,q=!0;N.charCodeAt(x+1)===r;)x+=1,q=!q;if(T=N.charCodeAt(x+1),q&&T!==s&&T!==o&&T!==i&&T!==u&&T!==l&&T!==a&&(x+=1,b.test(N.charAt(x)))){for(;b.test(N.charAt(x+1));)x+=1;N.charCodeAt(x+1)===o&&(x+=1)}G=["word",N.slice(O,x+1),O,x],O=x;break}default:{T===s&&N.charCodeAt(O+1)===g?(x=N.indexOf("*/",O+2)+1,x===0&&(F||re?x=N.length:le("comment")),G=["comment",N.slice(O,x+1),O,x],O=x):(C.lastIndex=O+1,C.test(N),C.lastIndex===0?x=N.length-1:x=C.lastIndex-2,G=["word",N.slice(O,x+1),O,x],we.push(G),O=x);break}}return O++,G}function Me(L){fe.push(L)}return{back:Me,endOfFile:de,nextToken:_e,position:Ze}},dr}var pr,wi;function ys(){if(wi)return pr;wi=1;let e=Pe();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 pr=t,t.default=t,e.registerAtRule(t),pr}var mr,vi;function nt(){if(vi)return mr;vi=1;let e=Pe(),t,r;class s extends e{constructor(o){super(o),this.type="root",this.nodes||(this.nodes=[])}normalize(o,a,u){let l=super.normalize(o);if(a){if(u==="prepend")this.nodes.length>1?a.raws.before=this.nodes[1].raws.before:delete a.raws.before;else if(this.first!==a)for(let c of l)c.raws.before=a.raws.before}return l}removeChild(o,a){let u=this.index(o);return!a&&u===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[u].raws.before),super.removeChild(o)}toResult(o={}){return new t(new r,this,o).stringify()}}return s.registerLazyResult=i=>{t=i},s.registerProcessor=i=>{r=i},mr=s,s.default=s,e.registerRoot(s),mr}var gr,Si;function jn(){if(Si)return gr;Si=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let r=[" ",`
38
- `," "];return e.split(t,r)},split(t,r,s){let i=[],o="",a=!1,u=0,l=!1,c="",n=!1;for(let d of t)n?n=!1:d==="\\"?n=!0:l?d===c&&(l=!1):d==='"'||d==="'"?(l=!0,c=d):d==="("?u+=1:d===")"?u>0&&(u-=1):u===0&&r.includes(d)&&(a=!0),a?(o!==""&&i.push(o.trim()),o="",a=!1):o+=d;return(s||o!=="")&&i.push(o.trim()),i}};return gr=e,e.default=e,gr}var yr,bi;function ws(){if(bi)return yr;bi=1;let e=Pe(),t=jn();class r extends e{constructor(i){super(i),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(i){let o=this.selector?this.selector.match(/,\s*/):null,a=o?o[0]:","+this.raw("between","beforeOpen");this.selector=i.join(a)}}return yr=r,r.default=r,e.registerRule(r),yr}var wr,Ci;function Wa(){if(Ci)return wr;Ci=1;let e=Ut(),t=Ba(),r=Wt(),s=ys(),i=nt(),o=ws();const a={empty:!0,space:!0};function u(c){for(let n=c.length-1;n>=0;n--){let d=c[n],h=d[3]||d[2];if(h)return h}}class l{constructor(n){this.input=n,this.root=new i,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:n,start:{column:1,line:1,offset:0}}}atrule(n){let d=new s;d.name=n[1].slice(1),d.name===""&&this.unnamedAtrule(d,n),this.init(d,n[2]);let h,f,m,p=!1,g=!1,v=[],y=[];for(;!this.tokenizer.endOfFile();){if(n=this.tokenizer.nextToken(),h=n[0],h==="("||h==="["?y.push(h==="("?")":"]"):h==="{"&&y.length>0?y.push("}"):h===y[y.length-1]&&y.pop(),y.length===0)if(h===";"){d.source.end=this.getPosition(n[2]),d.source.end.offset++,this.semicolon=!0;break}else if(h==="{"){g=!0;break}else if(h==="}"){if(v.length>0){for(m=v.length-1,f=v[m];f&&f[0]==="space";)f=v[--m];f&&(d.source.end=this.getPosition(f[3]||f[2]),d.source.end.offset++)}this.end(n);break}else v.push(n);else v.push(n);if(this.tokenizer.endOfFile()){p=!0;break}}d.raws.between=this.spacesAndCommentsFromEnd(v),v.length?(d.raws.afterName=this.spacesAndCommentsFromStart(v),this.raw(d,"params",v),p&&(n=v[v.length-1],d.source.end=this.getPosition(n[3]||n[2]),d.source.end.offset++,this.spaces=d.raws.between,d.raws.between="")):(d.raws.afterName="",d.params=""),g&&(d.nodes=[],this.current=d)}checkMissedSemicolon(n){let d=this.colon(n);if(d===!1)return;let h=0,f;for(let m=d-1;m>=0&&(f=n[m],!(f[0]!=="space"&&(h+=1,h===2)));m--);throw this.input.error("Missed semicolon",f[0]==="word"?f[3]+1:f[2])}colon(n){let d=0,h,f,m;for(let[p,g]of n.entries()){if(h=g,f=h[0],f==="("&&(d+=1),f===")"&&(d-=1),d===0&&f===":")if(!m)this.doubleColon(h);else{if(m[0]==="word"&&m[1]==="progid")continue;return p}m=h}return!1}comment(n){let d=new r;this.init(d,n[2]),d.source.end=this.getPosition(n[3]||n[2]),d.source.end.offset++;let h=n[1].slice(2,-2);if(/^\s*$/.test(h))d.text="",d.raws.left=h,d.raws.right="";else{let f=h.match(/^(\s*)([^]*\S)(\s*)$/);d.text=f[2],d.raws.left=f[1],d.raws.right=f[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(n,d){let h=new e;this.init(h,n[0][2]);let f=n[n.length-1];for(f[0]===";"&&(this.semicolon=!0,n.pop()),h.source.end=this.getPosition(f[3]||f[2]||u(n)),h.source.end.offset++;n[0][0]!=="word";)n.length===1&&this.unknownWord(n),h.raws.before+=n.shift()[1];for(h.source.start=this.getPosition(n[0][2]),h.prop="";n.length;){let y=n[0][0];if(y===":"||y==="space"||y==="comment")break;h.prop+=n.shift()[1]}h.raws.between="";let m;for(;n.length;)if(m=n.shift(),m[0]===":"){h.raws.between+=m[1];break}else m[0]==="word"&&/\w/.test(m[1])&&this.unknownWord([m]),h.raws.between+=m[1];(h.prop[0]==="_"||h.prop[0]==="*")&&(h.raws.before+=h.prop[0],h.prop=h.prop.slice(1));let p=[],g;for(;n.length&&(g=n[0][0],!(g!=="space"&&g!=="comment"));)p.push(n.shift());this.precheckMissedSemicolon(n);for(let y=n.length-1;y>=0;y--){if(m=n[y],m[1].toLowerCase()==="!important"){h.important=!0;let w=this.stringFrom(n,y);w=this.spacesFromEnd(n)+w,w!==" !important"&&(h.raws.important=w);break}else if(m[1].toLowerCase()==="important"){let w=n.slice(0),C="";for(let S=y;S>0;S--){let b=w[S][0];if(C.trim().indexOf("!")===0&&b!=="space")break;C=w.pop()[1]+C}C.trim().indexOf("!")===0&&(h.important=!0,h.raws.important=C,n=w)}if(m[0]!=="space"&&m[0]!=="comment")break}n.some(y=>y[0]!=="space"&&y[0]!=="comment")&&(h.raws.between+=p.map(y=>y[1]).join(""),p=[]),this.raw(h,"value",p.concat(n),d),h.value.includes(":")&&!d&&this.checkMissedSemicolon(n)}doubleColon(n){throw this.input.error("Double colon",{offset:n[2]},{offset:n[2]+n[1].length})}emptyRule(n){let d=new o;this.init(d,n[2]),d.selector="",d.raws.between="",this.current=d}end(n){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(n[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(n)}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(n){if(this.spaces+=n[1],this.current.nodes){let d=this.current.nodes[this.current.nodes.length-1];d&&d.type==="rule"&&!d.raws.ownSemicolon&&(d.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(n){let d=this.input.fromOffset(n);return{column:d.col,line:d.line,offset:n}}init(n,d){this.current.push(n),n.source={input:this.input,start:this.getPosition(d)},n.raws.before=this.spaces,this.spaces="",n.type!=="comment"&&(this.semicolon=!1)}other(n){let d=!1,h=null,f=!1,m=null,p=[],g=n[1].startsWith("--"),v=[],y=n;for(;y;){if(h=y[0],v.push(y),h==="("||h==="[")m||(m=y),p.push(h==="("?")":"]");else if(g&&f&&h==="{")m||(m=y),p.push("}");else if(p.length===0)if(h===";")if(f){this.decl(v,g);return}else break;else if(h==="{"){this.rule(v);return}else if(h==="}"){this.tokenizer.back(v.pop()),d=!0;break}else h===":"&&(f=!0);else h===p[p.length-1]&&(p.pop(),p.length===0&&(m=null));y=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(d=!0),p.length>0&&this.unclosedBracket(m),d&&f){if(!g)for(;v.length&&(y=v[v.length-1][0],!(y!=="space"&&y!=="comment"));)this.tokenizer.back(v.pop());this.decl(v,g)}else this.unknownWord(v)}parse(){let n;for(;!this.tokenizer.endOfFile();)switch(n=this.tokenizer.nextToken(),n[0]){case"space":this.spaces+=n[1];break;case";":this.freeSemicolon(n);break;case"}":this.end(n);break;case"comment":this.comment(n);break;case"at-word":this.atrule(n);break;case"{":this.emptyRule(n);break;default:this.other(n);break}this.endFile()}precheckMissedSemicolon(){}raw(n,d,h,f){let m,p,g=h.length,v="",y=!0,w,C;for(let S=0;S<g;S+=1)m=h[S],p=m[0],p==="space"&&S===g-1&&!f?y=!1:p==="comment"?(C=h[S-1]?h[S-1][0]:"empty",w=h[S+1]?h[S+1][0]:"empty",!a[C]&&!a[w]?v.slice(-1)===","?y=!1:v+=m[1]:y=!1):v+=m[1];if(!y){let S=h.reduce((b,E)=>b+E[1],"");n.raws[d]={raw:S,value:v}}n[d]=v}rule(n){n.pop();let d=new o;this.init(d,n[0][2]),d.raws.between=this.spacesAndCommentsFromEnd(n),this.raw(d,"selector",n),this.current=d}spacesAndCommentsFromEnd(n){let d,h="";for(;n.length&&(d=n[n.length-1][0],!(d!=="space"&&d!=="comment"));)h=n.pop()[1]+h;return h}spacesAndCommentsFromStart(n){let d,h="";for(;n.length&&(d=n[0][0],!(d!=="space"&&d!=="comment"));)h+=n.shift()[1];return h}spacesFromEnd(n){let d,h="";for(;n.length&&(d=n[n.length-1][0],d==="space");)h=n.pop()[1]+h;return h}stringFrom(n,d){let h="";for(let f=d;f<n.length;f++)h+=n[f][1];return n.splice(d,n.length-d),h}unclosedBlock(){let n=this.current.source.start;throw this.input.error("Unclosed block",n.line,n.column)}unclosedBracket(n){throw this.input.error("Unclosed bracket",{offset:n[2]},{offset:n[2]+1})}unexpectedClose(n){throw this.input.error("Unexpected }",{offset:n[2]},{offset:n[2]+1})}unknownWord(n){throw this.input.error("Unknown word",{offset:n[0][2]},{offset:n[0][2]+n[0][1].length})}unnamedAtrule(n,d){throw this.input.error("At-rule without name",{offset:d[2]},{offset:d[2]+d[1].length})}}return wr=l,wr}var vr,Ei;function vs(){if(Ei)return vr;Ei=1;let e=Pe(),t=Wa(),r=Bt();function s(i,o){let a=new r(i,o),u=new t(a);try{u.parse()}catch(l){throw l}return u.root}return vr=s,s.default=s,e.registerParse(s),vr}var Sr,xi;function Gn(){if(xi)return Sr;xi=1;let{isClean:e,my:t}=ps(),r=zn(),s=Lt(),i=Pe(),o=ms(),a=Vn(),u=gs(),l=vs(),c=nt();const n={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},d={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},h={Once:!0,postcssPlugin:!0,prepare:!0},f=0;function m(C){return typeof C=="object"&&typeof C.then=="function"}function p(C){let S=!1,b=n[C.type];return C.type==="decl"?S=C.prop.toLowerCase():C.type==="atrule"&&(S=C.name.toLowerCase()),S&&C.append?[b,b+"-"+S,f,b+"Exit",b+"Exit-"+S]:S?[b,b+"-"+S,b+"Exit",b+"Exit-"+S]:C.append?[b,f,b+"Exit"]:[b,b+"Exit"]}function g(C){let S;return C.type==="document"?S=["Document",f,"DocumentExit"]:C.type==="root"?S=["Root",f,"RootExit"]:S=p(C),{eventIndex:0,events:S,iterator:0,node:C,visitorIndex:0,visitors:[]}}function v(C){return C[e]=!1,C.nodes&&C.nodes.forEach(S=>v(S)),C}let y={};class w{constructor(S,b,E){this.stringified=!1,this.processed=!1;let M;if(typeof b=="object"&&b!==null&&(b.type==="root"||b.type==="document"))M=v(b);else if(b instanceof w||b instanceof u)M=v(b.root),b.map&&(typeof E.map=="undefined"&&(E.map={}),E.map.inline||(E.map.inline=!1),E.map.prev=b.map);else{let I=l;E.syntax&&(I=E.syntax.parse),E.parser&&(I=E.parser),I.parse&&(I=I.parse);try{M=I(b,E)}catch(N){this.processed=!0,this.error=N}M&&!M[t]&&i.rebuild(M)}this.result=new u(S,M,E),this.helpers=se(P({},y),{postcss:y,result:this.result}),this.plugins=this.processor.plugins.map(I=>typeof I=="object"&&I.prepare?P(P({},I),I.prepare(this.result)):I)}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,b){let E=this.result.lastPlugin;try{b&&b.addToError(S),this.error=S,S.name==="CssSyntaxError"&&!S.plugin?(S.plugin=E.postcssPlugin,S.setMessage()):E.postcssVersion}catch(M){console&&console.error&&console.error(M)}return S}prepareVisitors(){this.listeners={};let S=(b,E,M)=>{this.listeners[E]||(this.listeners[E]=[]),this.listeners[E].push([b,M])};for(let b of this.plugins)if(typeof b=="object")for(let E in b){if(!d[E]&&/^[A-Z]/.test(E))throw new Error(`Unknown event ${E} in ${b.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!h[E])if(typeof b[E]=="object")for(let M in b[E])M==="*"?S(b,E,b[E][M]):S(b,E+"-"+M.toLowerCase(),b[E][M]);else typeof b[E]=="function"&&S(b,E,b[E])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let S=0;S<this.plugins.length;S++){let b=this.plugins[S],E=this.runOnRoot(b);if(m(E))try{await E}catch(M){throw this.handleError(M)}}if(this.prepareVisitors(),this.hasListener){let S=this.result.root;for(;!S[e];){S[e]=!0;let b=[g(S)];for(;b.length>0;){let E=this.visitTick(b);if(m(E))try{await E}catch(M){let I=b[b.length-1].node;throw this.handleError(M,I)}}}if(this.listeners.OnceExit)for(let[b,E]of this.listeners.OnceExit){this.result.lastPlugin=b;try{if(S.type==="document"){let M=S.nodes.map(I=>E(I,this.helpers));await Promise.all(M)}else await E(S,this.helpers)}catch(M){throw this.handleError(M)}}}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 b=this.result.root.nodes.map(E=>S.Once(E,this.helpers));return m(b[0])?Promise.all(b):b}return S.Once(this.result.root,this.helpers)}else if(typeof S=="function")return S(this.result.root,this.result)}catch(b){throw this.handleError(b)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let S=this.result.opts,b=s;S.syntax&&(b=S.syntax.stringify),S.stringifier&&(b=S.stringifier),b.stringify&&(b=b.stringify);let M=new r(b,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 S of this.plugins){let b=this.runOnRoot(S);if(m(b))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 b of S.nodes)this.visitSync(this.listeners.OnceExit,b);else this.visitSync(this.listeners.OnceExit,S)}return this.result}then(S,b){return this.async().then(S,b)}toString(){return this.css}visitSync(S,b){for(let[E,M]of S){this.result.lastPlugin=E;let I;try{I=M(b,this.helpers)}catch(N){throw this.handleError(N,b.proxyOf)}if(b.type!=="root"&&b.type!=="document"&&!b.parent)return!0;if(m(I))throw this.getAsyncError()}}visitTick(S){let b=S[S.length-1],{node:E,visitors:M}=b;if(E.type!=="root"&&E.type!=="document"&&!E.parent){S.pop();return}if(M.length>0&&b.visitorIndex<M.length){let[N,F]=M[b.visitorIndex];b.visitorIndex+=1,b.visitorIndex===M.length&&(b.visitors=[],b.visitorIndex=0),this.result.lastPlugin=N;try{return F(E.toProxy(),this.helpers)}catch(T){throw this.handleError(T,E)}}if(b.iterator!==0){let N=b.iterator,F;for(;F=E.nodes[E.indexes[N]];)if(E.indexes[N]+=1,!F[e]){F[e]=!0,S.push(g(F));return}b.iterator=0,delete E.indexes[N]}let I=b.events;for(;b.eventIndex<I.length;){let N=I[b.eventIndex];if(b.eventIndex+=1,N===f){E.nodes&&E.nodes.length&&(E[e]=!0,b.iterator=E.getIterator());return}else if(this.listeners[N]){b.visitors=this.listeners[N];return}}S.pop()}walkSync(S){S[e]=!0;let b=p(S);for(let E of b)if(E===f)S.nodes&&S.each(M=>{M[e]||this.walkSync(M)});else{let M=this.listeners[E];if(M&&this.visitSync(M,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 w.registerPostcss=C=>{y=C},Sr=w,w.default=w,c.registerLazyResult(w),o.registerLazyResult(w),Sr}var br,Ri;function $a(){if(Ri)return br;Ri=1;let e=zn(),t=Lt(),r=Vn(),s=vs();const i=gs();class o{constructor(u,l,c){l=l.toString(),this.stringified=!1,this._processor=u,this._css=l,this._opts=c,this._map=void 0;let n,d=t;this.result=new i(this._processor,n,this._opts),this.result.css=l;let h=this;Object.defineProperty(this.result,"root",{get(){return h.root}});let f=new e(d,n,this._opts,l);if(f.isMap()){let[m,p]=f.generate();m&&(this.result.css=m),p&&(this.result.map=p)}else f.clearAnnotation(),this.result.css=f.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(u){return this.async().catch(u)}finally(u){return this.async().then(u,u)}sync(){if(this.error)throw this.error;return this.result}then(u,l){return this.async().then(u,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 u,l=s;try{u=l(this._css,this._opts)}catch(c){this.error=c}if(this.error)throw this.error;return this._root=u,u}get[Symbol.toStringTag](){return"NoWorkResult"}}return br=o,o.default=o,br}var Cr,Mi;function za(){if(Mi)return Cr;Mi=1;let e=$a(),t=Gn(),r=ms(),s=nt();class i{constructor(a=[]){this.version="8.4.38",this.plugins=this.normalize(a)}normalize(a){let u=[];for(let l of a)if(l.postcss===!0?l=l():l.postcss&&(l=l.postcss),typeof l=="object"&&Array.isArray(l.plugins))u=u.concat(l.plugins);else if(typeof l=="object"&&l.postcssPlugin)u.push(l);else if(typeof l=="function")u.push(l);else if(!(typeof l=="object"&&(l.parse||l.stringify)))throw new Error(l+" is not a PostCSS plugin");return u}process(a,u={}){return!this.plugins.length&&!u.parser&&!u.stringifier&&!u.syntax?new e(this,a,u):new t(this,a,u)}use(a){return this.plugins=this.plugins.concat(this.normalize([a])),this}}return Cr=i,i.default=i,s.registerProcessor(i),r.registerProcessor(i),Cr}var Er,Ni;function Va(){if(Ni)return Er;Ni=1;let e=Ut(),t=$n(),r=Wt(),s=ys(),i=Bt(),o=nt(),a=ws();function u(l,c){if(Array.isArray(l))return l.map(m=>u(m));let h=l,{inputs:n}=h,d=Ue(h,["inputs"]);if(n){c=[];for(let m of n){let p=se(P({},m),{__proto__:i.prototype});p.map&&(p.map=se(P({},p.map),{__proto__:t.prototype})),c.push(p)}}if(d.nodes&&(d.nodes=l.nodes.map(m=>u(m,c))),d.source){let f=d.source,{inputId:m}=f,p=Ue(f,["inputId"]);d.source=p,m!=null&&(d.source.input=c[m])}if(d.type==="root")return new o(d);if(d.type==="decl")return new e(d);if(d.type==="rule")return new a(d);if(d.type==="comment")return new r(d);if(d.type==="atrule")return new s(d);throw new Error("Unknown node type: "+l.type)}return Er=u,u.default=u,Er}var xr,Oi;function qa(){if(Oi)return xr;Oi=1;let e=ds(),t=Ut(),r=Gn(),s=Pe(),i=za(),o=Lt(),a=Va(),u=ms(),l=qn(),c=Wt(),n=ys(),d=gs(),h=Bt(),f=vs(),m=jn(),p=ws(),g=nt(),v=Ft();function y(...w){return w.length===1&&Array.isArray(w[0])&&(w=w[0]),new i(w)}return y.plugin=function(C,S){let b=!1;function E(...I){console&&console.warn&&!b&&(b=!0,console.warn(C+`: postcss.plugin was deprecated. Migration guide:
37
+ `),f=y.length-v):f+=y.length,w&&C!=="start"){let S=w.parent||{raws:{}};(!(w.type==="decl"||w.type==="atrule"&&!w.nodes)||w!==S.last||S.raws.semicolon)&&(w.source&&w.source.end?(p.source=this.sourcePath(w),p.original.line=w.source.end.line,p.original.column=w.source.end.column-1,p.generated.line=h,p.generated.column=f-2,this.map.addMapping(p)):(p.source=m,p.original.line=1,p.original.column=0,p.generated.line=h,p.generated.column=f-1,this.map.addMapping(p)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation!="undefined"?this.mapOpts.annotation:this.previous().length?this.previous().some(h=>h.annotation):!0}isInline(){if(typeof this.mapOpts.inline!="undefined")return this.mapOpts.inline;let h=this.mapOpts.annotation;return typeof h!="undefined"&&h!==!0?!1:this.previous().length?this.previous().some(f=>f.inline):!0}isMap(){return typeof this.opts.map!="undefined"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent!="undefined"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(h=>h.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(h){if(this.mapOpts.absolute||h.charCodeAt(0)===60||/^\w+:\/\//.test(h))return h;let f=this.memoizedPaths.get(h);if(f)return f;let m=this.opts.to?r(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(m=r(i(m,this.mapOpts.annotation)));let p=s(m,h);return this.memoizedPaths.set(h,p),p}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(h=>{if(h.source&&h.source.input.map){let f=h.source.input.map;this.previousMaps.includes(f)||this.previousMaps.push(f)}});else{let h=new u(this.originalCSS,this.opts);h.map&&this.previousMaps.push(h.map)}return this.previousMaps}setSourcesContent(){let h={};if(this.root)this.root.walk(f=>{if(f.source){let m=f.source.input.from;if(m&&!h[m]){h[m]=!0;let p=this.usesFileUrls?this.toFileUrl(m):this.toUrl(this.path(m));this.map.setSourceContent(p,f.source.input.css)}}});else if(this.css){let f=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(f,this.css)}}sourcePath(h){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(h.source.input.from):this.toUrl(this.path(h.source.input.from))}toBase64(h){return Buffer?Buffer.from(h).toString("base64"):window.btoa(unescape(encodeURIComponent(h)))}toFileUrl(h){let f=this.memoizedFileURLs.get(h);if(f)return f;if(a){let m=a(h).toString();return this.memoizedFileURLs.set(h,m),m}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(h){let f=this.memoizedURLs.get(h);if(f)return f;o==="\\"&&(h=h.replace(/\\/g,"/"));let m=encodeURI(h).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(h,m),m}}return mr=n,mr}var gr,Ci;function Jt(){if(Ci)return gr;Ci=1;let e=Ht();class t extends e{constructor(s){super(s),this.type="comment"}}return gr=t,t.default=t,gr}var yr,Ei;function Fe(){if(Ei)return yr;Ei=1;let{isClean:e,my:t}=xs(),r=Yt(),s=Jt(),i=Ht(),o,a,u,l;function c(h){return h.map(f=>(f.nodes&&(f.nodes=c(f.nodes)),delete f.source,f))}function n(h){if(h[e]=!1,h.proxyOf.nodes)for(let f of h.proxyOf.nodes)n(f)}class d extends i{append(...f){for(let m of f){let p=this.normalize(m,this.last);for(let g of p)this.proxyOf.nodes.push(g)}return this.markDirty(),this}cleanRaws(f){if(super.cleanRaws(f),this.nodes)for(let m of this.nodes)m.cleanRaws(f)}each(f){if(!this.proxyOf.nodes)return;let m=this.getIterator(),p,g;for(;this.indexes[m]<this.proxyOf.nodes.length&&(p=this.indexes[m],g=f(this.proxyOf.nodes[p],p),g!==!1);)this.indexes[m]+=1;return delete this.indexes[m],g}every(f){return this.nodes.every(f)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let f=this.lastEach;return this.indexes[f]=0,f}getProxyProcessor(){return{get(f,m){return m==="proxyOf"?f:f[m]?m==="each"||typeof m=="string"&&m.startsWith("walk")?(...p)=>f[m](...p.map(g=>typeof g=="function"?(v,y)=>g(v.toProxy(),y):g)):m==="every"||m==="some"?p=>f[m]((g,...v)=>p(g.toProxy(),...v)):m==="root"?()=>f.root().toProxy():m==="nodes"?f.nodes.map(p=>p.toProxy()):m==="first"||m==="last"?f[m].toProxy():f[m]:f[m]},set(f,m,p){return f[m]===p||(f[m]=p,(m==="name"||m==="params"||m==="selector")&&f.markDirty()),!0}}}index(f){return typeof f=="number"?f:(f.proxyOf&&(f=f.proxyOf),this.proxyOf.nodes.indexOf(f))}insertAfter(f,m){let p=this.index(f),g=this.normalize(m,this.proxyOf.nodes[p]).reverse();p=this.index(f);for(let y of g)this.proxyOf.nodes.splice(p+1,0,y);let v;for(let y in this.indexes)v=this.indexes[y],p<v&&(this.indexes[y]=v+g.length);return this.markDirty(),this}insertBefore(f,m){let p=this.index(f),g=p===0?"prepend":!1,v=this.normalize(m,this.proxyOf.nodes[p],g).reverse();p=this.index(f);for(let w of v)this.proxyOf.nodes.splice(p,0,w);let y;for(let w in this.indexes)y=this.indexes[w],p<=y&&(this.indexes[w]=y+v.length);return this.markDirty(),this}normalize(f,m){if(typeof f=="string")f=c(o(f).nodes);else if(typeof f=="undefined")f=[];else if(Array.isArray(f)){f=f.slice(0);for(let g of f)g.parent&&g.parent.removeChild(g,"ignore")}else if(f.type==="root"&&this.type!=="document"){f=f.nodes.slice(0);for(let g of f)g.parent&&g.parent.removeChild(g,"ignore")}else if(f.type)f=[f];else if(f.prop){if(typeof f.value=="undefined")throw new Error("Value field is missed in node creation");typeof f.value!="string"&&(f.value=String(f.value)),f=[new r(f)]}else if(f.selector)f=[new a(f)];else if(f.name)f=[new u(f)];else if(f.text)f=[new s(f)];else throw new Error("Unknown node type in node creation");return f.map(g=>(g[t]||d.rebuild(g),g=g.proxyOf,g.parent&&g.parent.removeChild(g),g[e]&&n(g),typeof g.raws.before=="undefined"&&m&&typeof m.raws.before!="undefined"&&(g.raws.before=m.raws.before.replace(/\S/g,"")),g.parent=this.proxyOf,g))}prepend(...f){f=f.reverse();for(let m of f){let p=this.normalize(m,this.first,"prepend").reverse();for(let g of p)this.proxyOf.nodes.unshift(g);for(let g in this.indexes)this.indexes[g]=this.indexes[g]+p.length}return this.markDirty(),this}push(f){return f.parent=this,this.proxyOf.nodes.push(f),this}removeAll(){for(let f of this.proxyOf.nodes)f.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(f){f=this.index(f),this.proxyOf.nodes[f].parent=void 0,this.proxyOf.nodes.splice(f,1);let m;for(let p in this.indexes)m=this.indexes[p],m>=f&&(this.indexes[p]=m-1);return this.markDirty(),this}replaceValues(f,m,p){return p||(p=m,m={}),this.walkDecls(g=>{m.props&&!m.props.includes(g.prop)||m.fast&&!g.value.includes(m.fast)||(g.value=g.value.replace(f,p))}),this.markDirty(),this}some(f){return this.nodes.some(f)}walk(f){return this.each((m,p)=>{let g;try{g=f(m,p)}catch(v){throw m.addToError(v)}return g!==!1&&m.walk&&(g=m.walk(f)),g})}walkAtRules(f,m){return m?f instanceof RegExp?this.walk((p,g)=>{if(p.type==="atrule"&&f.test(p.name))return m(p,g)}):this.walk((p,g)=>{if(p.type==="atrule"&&p.name===f)return m(p,g)}):(m=f,this.walk((p,g)=>{if(p.type==="atrule")return m(p,g)}))}walkComments(f){return this.walk((m,p)=>{if(m.type==="comment")return f(m,p)})}walkDecls(f,m){return m?f instanceof RegExp?this.walk((p,g)=>{if(p.type==="decl"&&f.test(p.prop))return m(p,g)}):this.walk((p,g)=>{if(p.type==="decl"&&p.prop===f)return m(p,g)}):(m=f,this.walk((p,g)=>{if(p.type==="decl")return m(p,g)}))}walkRules(f,m){return m?f instanceof RegExp?this.walk((p,g)=>{if(p.type==="rule"&&f.test(p.selector))return m(p,g)}):this.walk((p,g)=>{if(p.type==="rule"&&p.selector===f)return m(p,g)}):(m=f,this.walk((p,g)=>{if(p.type==="rule")return m(p,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 d.registerParse=h=>{o=h},d.registerRule=h=>{a=h},d.registerAtRule=h=>{u=h},d.registerRoot=h=>{l=h},yr=d,d.default=d,d.rebuild=h=>{h.type==="atrule"?Object.setPrototypeOf(h,u.prototype):h.type==="rule"?Object.setPrototypeOf(h,a.prototype):h.type==="decl"?Object.setPrototypeOf(h,r.prototype):h.type==="comment"?Object.setPrototypeOf(h,s.prototype):h.type==="root"&&Object.setPrototypeOf(h,l.prototype),h[t]=!0,h.nodes&&h.nodes.forEach(f=>{d.rebuild(f)})},yr}var wr,xi;function Ms(){if(xi)return wr;xi=1;let e=Fe(),t,r;class s extends e{constructor(o){super(k({type:"document"},o)),this.nodes||(this.nodes=[])}toResult(o={}){return new t(new r,this,o).stringify()}}return s.registerLazyResult=i=>{t=i},s.registerProcessor=i=>{r=i},wr=s,s.default=s,wr}var vr,Mi;function to(){if(Mi)return vr;Mi=1;let e={};return vr=function(r){e[r]||(e[r]=!0,typeof console!="undefined"&&console.warn&&console.warn(r))},vr}var Sr,Ri;function ro(){if(Ri)return Sr;Ri=1;class e{constructor(r,s={}){if(this.type="warning",this.text=r,s.node&&s.node.source){let i=s.node.rangeBy(s);this.line=i.start.line,this.column=i.start.column,this.endLine=i.end.line,this.endColumn=i.end.column}for(let i in s)this[i]=s[i]}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 Sr=e,e.default=e,Sr}var br,Ni;function Rs(){if(Ni)return br;Ni=1;let e=ro();class t{constructor(s,i,o){this.processor=s,this.messages=[],this.root=i,this.opts=o,this.css=void 0,this.map=void 0}toString(){return this.css}warn(s,i={}){i.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(i.plugin=this.lastPlugin.postcssPlugin);let o=new e(s,i);return this.messages.push(o),o}warnings(){return this.messages.filter(s=>s.type==="warning")}get content(){return this.css}}return br=t,t.default=t,br}var Cr,Oi;function Ka(){if(Oi)return Cr;Oi=1;const e=39,t=34,r=92,s=47,i=10,o=32,a=12,u=9,l=13,c=91,n=93,d=40,h=41,f=123,m=125,p=59,g=42,v=58,y=64,w=/[\t\n\f\r "#'()/;[\\\]{}]/g,C=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,b=/[\da-f]/i;return Cr=function(R,I={}){let N=R.css.valueOf(),F=I.ignoreErrors,A,x,ce,ae,j,P,X,te,Z,G,Me=N.length,O=0,Se=[],fe=[];function rt(){return O}function le(L){throw R.error("Unclosed "+L,O)}function pe(){return fe.length===0&&O>=Me}function Pe(L){if(fe.length)return fe.pop();if(O>=Me)return;let re=L?L.ignoreUnclosed:!1;switch(A=N.charCodeAt(O),A){case i:case o:case u:case l:case a:{x=O;do x+=1,A=N.charCodeAt(x);while(A===o||A===i||A===u||A===l||A===a);G=["space",N.slice(O,x)],O=x-1;break}case c:case n:case f:case m:case v:case p:case h:{let q=String.fromCharCode(A);G=[q,q,O];break}case d:{if(te=Se.length?Se.pop()[1]:"",Z=N.charCodeAt(O+1),te==="url"&&Z!==e&&Z!==t&&Z!==o&&Z!==i&&Z!==u&&Z!==a&&Z!==l){x=O;do{if(P=!1,x=N.indexOf(")",x+1),x===-1)if(F||re){x=O;break}else le("bracket");for(X=x;N.charCodeAt(X-1)===r;)X-=1,P=!P}while(P);G=["brackets",N.slice(O,x+1),O,x],O=x}else x=N.indexOf(")",O+1),ae=N.slice(O,x+1),x===-1||S.test(ae)?G=["(","(",O]:(G=["brackets",ae,O,x],O=x);break}case e:case t:{ce=A===e?"'":'"',x=O;do{if(P=!1,x=N.indexOf(ce,x+1),x===-1)if(F||re){x=O+1;break}else le("string");for(X=x;N.charCodeAt(X-1)===r;)X-=1,P=!P}while(P);G=["string",N.slice(O,x+1),O,x],O=x;break}case y:{w.lastIndex=O+1,w.test(N),w.lastIndex===0?x=N.length-1:x=w.lastIndex-2,G=["at-word",N.slice(O,x+1),O,x],O=x;break}case r:{for(x=O,j=!0;N.charCodeAt(x+1)===r;)x+=1,j=!j;if(A=N.charCodeAt(x+1),j&&A!==s&&A!==o&&A!==i&&A!==u&&A!==l&&A!==a&&(x+=1,b.test(N.charAt(x)))){for(;b.test(N.charAt(x+1));)x+=1;N.charCodeAt(x+1)===o&&(x+=1)}G=["word",N.slice(O,x+1),O,x],O=x;break}default:{A===s&&N.charCodeAt(O+1)===g?(x=N.indexOf("*/",O+2)+1,x===0&&(F||re?x=N.length:le("comment")),G=["comment",N.slice(O,x+1),O,x],O=x):(C.lastIndex=O+1,C.test(N),C.lastIndex===0?x=N.length-1:x=C.lastIndex-2,G=["word",N.slice(O,x+1),O,x],Se.push(G),O=x);break}}return O++,G}function Re(L){fe.push(L)}return{back:Re,endOfFile:pe,nextToken:Pe,position:rt}},Cr}var Er,Ii;function Ns(){if(Ii)return Er;Ii=1;let e=Fe();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 Er=t,t.default=t,e.registerAtRule(t),Er}var xr,Di;function ut(){if(Di)return xr;Di=1;let e=Fe(),t,r;class s extends e{constructor(o){super(o),this.type="root",this.nodes||(this.nodes=[])}normalize(o,a,u){let l=super.normalize(o);if(a){if(u==="prepend")this.nodes.length>1?a.raws.before=this.nodes[1].raws.before:delete a.raws.before;else if(this.first!==a)for(let c of l)c.raws.before=a.raws.before}return l}removeChild(o,a){let u=this.index(o);return!a&&u===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[u].raws.before),super.removeChild(o)}toResult(o={}){return new t(new r,this,o).stringify()}}return s.registerLazyResult=i=>{t=i},s.registerProcessor=i=>{r=i},xr=s,s.default=s,e.registerRoot(s),xr}var Mr,Ti;function so(){if(Ti)return Mr;Ti=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let r=[" ",`
38
+ `," "];return e.split(t,r)},split(t,r,s){let i=[],o="",a=!1,u=0,l=!1,c="",n=!1;for(let d of t)n?n=!1:d==="\\"?n=!0:l?d===c&&(l=!1):d==='"'||d==="'"?(l=!0,c=d):d==="("?u+=1:d===")"?u>0&&(u-=1):u===0&&r.includes(d)&&(a=!0),a?(o!==""&&i.push(o.trim()),o="",a=!1):o+=d;return(s||o!=="")&&i.push(o.trim()),i}};return Mr=e,e.default=e,Mr}var Rr,Ai;function Os(){if(Ai)return Rr;Ai=1;let e=Fe(),t=so();class r extends e{constructor(i){super(i),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(i){let o=this.selector?this.selector.match(/,\s*/):null,a=o?o[0]:","+this.raw("between","beforeOpen");this.selector=i.join(a)}}return Rr=r,r.default=r,e.registerRule(r),Rr}var Nr,_i;function el(){if(_i)return Nr;_i=1;let e=Yt(),t=Ka(),r=Jt(),s=Ns(),i=ut(),o=Os();const a={empty:!0,space:!0};function u(c){for(let n=c.length-1;n>=0;n--){let d=c[n],h=d[3]||d[2];if(h)return h}}class l{constructor(n){this.input=n,this.root=new i,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:n,start:{column:1,line:1,offset:0}}}atrule(n){let d=new s;d.name=n[1].slice(1),d.name===""&&this.unnamedAtrule(d,n),this.init(d,n[2]);let h,f,m,p=!1,g=!1,v=[],y=[];for(;!this.tokenizer.endOfFile();){if(n=this.tokenizer.nextToken(),h=n[0],h==="("||h==="["?y.push(h==="("?")":"]"):h==="{"&&y.length>0?y.push("}"):h===y[y.length-1]&&y.pop(),y.length===0)if(h===";"){d.source.end=this.getPosition(n[2]),d.source.end.offset++,this.semicolon=!0;break}else if(h==="{"){g=!0;break}else if(h==="}"){if(v.length>0){for(m=v.length-1,f=v[m];f&&f[0]==="space";)f=v[--m];f&&(d.source.end=this.getPosition(f[3]||f[2]),d.source.end.offset++)}this.end(n);break}else v.push(n);else v.push(n);if(this.tokenizer.endOfFile()){p=!0;break}}d.raws.between=this.spacesAndCommentsFromEnd(v),v.length?(d.raws.afterName=this.spacesAndCommentsFromStart(v),this.raw(d,"params",v),p&&(n=v[v.length-1],d.source.end=this.getPosition(n[3]||n[2]),d.source.end.offset++,this.spaces=d.raws.between,d.raws.between="")):(d.raws.afterName="",d.params=""),g&&(d.nodes=[],this.current=d)}checkMissedSemicolon(n){let d=this.colon(n);if(d===!1)return;let h=0,f;for(let m=d-1;m>=0&&(f=n[m],!(f[0]!=="space"&&(h+=1,h===2)));m--);throw this.input.error("Missed semicolon",f[0]==="word"?f[3]+1:f[2])}colon(n){let d=0,h,f,m;for(let[p,g]of n.entries()){if(h=g,f=h[0],f==="("&&(d+=1),f===")"&&(d-=1),d===0&&f===":")if(!m)this.doubleColon(h);else{if(m[0]==="word"&&m[1]==="progid")continue;return p}m=h}return!1}comment(n){let d=new r;this.init(d,n[2]),d.source.end=this.getPosition(n[3]||n[2]),d.source.end.offset++;let h=n[1].slice(2,-2);if(/^\s*$/.test(h))d.text="",d.raws.left=h,d.raws.right="";else{let f=h.match(/^(\s*)([^]*\S)(\s*)$/);d.text=f[2],d.raws.left=f[1],d.raws.right=f[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(n,d){let h=new e;this.init(h,n[0][2]);let f=n[n.length-1];for(f[0]===";"&&(this.semicolon=!0,n.pop()),h.source.end=this.getPosition(f[3]||f[2]||u(n)),h.source.end.offset++;n[0][0]!=="word";)n.length===1&&this.unknownWord(n),h.raws.before+=n.shift()[1];for(h.source.start=this.getPosition(n[0][2]),h.prop="";n.length;){let y=n[0][0];if(y===":"||y==="space"||y==="comment")break;h.prop+=n.shift()[1]}h.raws.between="";let m;for(;n.length;)if(m=n.shift(),m[0]===":"){h.raws.between+=m[1];break}else m[0]==="word"&&/\w/.test(m[1])&&this.unknownWord([m]),h.raws.between+=m[1];(h.prop[0]==="_"||h.prop[0]==="*")&&(h.raws.before+=h.prop[0],h.prop=h.prop.slice(1));let p=[],g;for(;n.length&&(g=n[0][0],!(g!=="space"&&g!=="comment"));)p.push(n.shift());this.precheckMissedSemicolon(n);for(let y=n.length-1;y>=0;y--){if(m=n[y],m[1].toLowerCase()==="!important"){h.important=!0;let w=this.stringFrom(n,y);w=this.spacesFromEnd(n)+w,w!==" !important"&&(h.raws.important=w);break}else if(m[1].toLowerCase()==="important"){let w=n.slice(0),C="";for(let S=y;S>0;S--){let b=w[S][0];if(C.trim().indexOf("!")===0&&b!=="space")break;C=w.pop()[1]+C}C.trim().indexOf("!")===0&&(h.important=!0,h.raws.important=C,n=w)}if(m[0]!=="space"&&m[0]!=="comment")break}n.some(y=>y[0]!=="space"&&y[0]!=="comment")&&(h.raws.between+=p.map(y=>y[1]).join(""),p=[]),this.raw(h,"value",p.concat(n),d),h.value.includes(":")&&!d&&this.checkMissedSemicolon(n)}doubleColon(n){throw this.input.error("Double colon",{offset:n[2]},{offset:n[2]+n[1].length})}emptyRule(n){let d=new o;this.init(d,n[2]),d.selector="",d.raws.between="",this.current=d}end(n){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(n[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(n)}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(n){if(this.spaces+=n[1],this.current.nodes){let d=this.current.nodes[this.current.nodes.length-1];d&&d.type==="rule"&&!d.raws.ownSemicolon&&(d.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(n){let d=this.input.fromOffset(n);return{column:d.col,line:d.line,offset:n}}init(n,d){this.current.push(n),n.source={input:this.input,start:this.getPosition(d)},n.raws.before=this.spaces,this.spaces="",n.type!=="comment"&&(this.semicolon=!1)}other(n){let d=!1,h=null,f=!1,m=null,p=[],g=n[1].startsWith("--"),v=[],y=n;for(;y;){if(h=y[0],v.push(y),h==="("||h==="[")m||(m=y),p.push(h==="("?")":"]");else if(g&&f&&h==="{")m||(m=y),p.push("}");else if(p.length===0)if(h===";")if(f){this.decl(v,g);return}else break;else if(h==="{"){this.rule(v);return}else if(h==="}"){this.tokenizer.back(v.pop()),d=!0;break}else h===":"&&(f=!0);else h===p[p.length-1]&&(p.pop(),p.length===0&&(m=null));y=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(d=!0),p.length>0&&this.unclosedBracket(m),d&&f){if(!g)for(;v.length&&(y=v[v.length-1][0],!(y!=="space"&&y!=="comment"));)this.tokenizer.back(v.pop());this.decl(v,g)}else this.unknownWord(v)}parse(){let n;for(;!this.tokenizer.endOfFile();)switch(n=this.tokenizer.nextToken(),n[0]){case"space":this.spaces+=n[1];break;case";":this.freeSemicolon(n);break;case"}":this.end(n);break;case"comment":this.comment(n);break;case"at-word":this.atrule(n);break;case"{":this.emptyRule(n);break;default:this.other(n);break}this.endFile()}precheckMissedSemicolon(){}raw(n,d,h,f){let m,p,g=h.length,v="",y=!0,w,C;for(let S=0;S<g;S+=1)m=h[S],p=m[0],p==="space"&&S===g-1&&!f?y=!1:p==="comment"?(C=h[S-1]?h[S-1][0]:"empty",w=h[S+1]?h[S+1][0]:"empty",!a[C]&&!a[w]?v.slice(-1)===","?y=!1:v+=m[1]:y=!1):v+=m[1];if(!y){let S=h.reduce((b,E)=>b+E[1],"");n.raws[d]={raw:S,value:v}}n[d]=v}rule(n){n.pop();let d=new o;this.init(d,n[0][2]),d.raws.between=this.spacesAndCommentsFromEnd(n),this.raw(d,"selector",n),this.current=d}spacesAndCommentsFromEnd(n){let d,h="";for(;n.length&&(d=n[n.length-1][0],!(d!=="space"&&d!=="comment"));)h=n.pop()[1]+h;return h}spacesAndCommentsFromStart(n){let d,h="";for(;n.length&&(d=n[0][0],!(d!=="space"&&d!=="comment"));)h+=n.shift()[1];return h}spacesFromEnd(n){let d,h="";for(;n.length&&(d=n[n.length-1][0],d==="space");)h=n.pop()[1]+h;return h}stringFrom(n,d){let h="";for(let f=d;f<n.length;f++)h+=n[f][1];return n.splice(d,n.length-d),h}unclosedBlock(){let n=this.current.source.start;throw this.input.error("Unclosed block",n.line,n.column)}unclosedBracket(n){throw this.input.error("Unclosed bracket",{offset:n[2]},{offset:n[2]+1})}unexpectedClose(n){throw this.input.error("Unexpected }",{offset:n[2]},{offset:n[2]+1})}unknownWord(n){throw this.input.error("Unknown word",{offset:n[0][2]},{offset:n[0][2]+n[0][1].length})}unnamedAtrule(n,d){throw this.input.error("At-rule without name",{offset:d[2]},{offset:d[2]+d[1].length})}}return Nr=l,Nr}var Or,Pi;function Is(){if(Pi)return Or;Pi=1;let e=Fe(),t=el(),r=Xt();function s(i,o){let a=new r(i,o),u=new t(a);try{u.parse()}catch(l){throw l}return u.root}return Or=s,s.default=s,e.registerParse(s),Or}var Ir,ki;function io(){if(ki)return Ir;ki=1;let{isClean:e,my:t}=xs(),r=eo(),s=Gt(),i=Fe(),o=Ms(),a=to(),u=Rs(),l=Is(),c=ut();const n={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},d={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},h={Once:!0,postcssPlugin:!0,prepare:!0},f=0;function m(C){return typeof C=="object"&&typeof C.then=="function"}function p(C){let S=!1,b=n[C.type];return C.type==="decl"?S=C.prop.toLowerCase():C.type==="atrule"&&(S=C.name.toLowerCase()),S&&C.append?[b,b+"-"+S,f,b+"Exit",b+"Exit-"+S]:S?[b,b+"-"+S,b+"Exit",b+"Exit-"+S]:C.append?[b,f,b+"Exit"]:[b,b+"Exit"]}function g(C){let S;return C.type==="document"?S=["Document",f,"DocumentExit"]:C.type==="root"?S=["Root",f,"RootExit"]:S=p(C),{eventIndex:0,events:S,iterator:0,node:C,visitorIndex:0,visitors:[]}}function v(C){return C[e]=!1,C.nodes&&C.nodes.forEach(S=>v(S)),C}let y={};class w{constructor(S,b,E){this.stringified=!1,this.processed=!1;let R;if(typeof b=="object"&&b!==null&&(b.type==="root"||b.type==="document"))R=v(b);else if(b instanceof w||b instanceof u)R=v(b.root),b.map&&(typeof E.map=="undefined"&&(E.map={}),E.map.inline||(E.map.inline=!1),E.map.prev=b.map);else{let I=l;E.syntax&&(I=E.syntax.parse),E.parser&&(I=E.parser),I.parse&&(I=I.parse);try{R=I(b,E)}catch(N){this.processed=!0,this.error=N}R&&!R[t]&&i.rebuild(R)}this.result=new u(S,R,E),this.helpers=se(k({},y),{postcss:y,result:this.result}),this.plugins=this.processor.plugins.map(I=>typeof I=="object"&&I.prepare?k(k({},I),I.prepare(this.result)):I)}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,b){let E=this.result.lastPlugin;try{b&&b.addToError(S),this.error=S,S.name==="CssSyntaxError"&&!S.plugin?(S.plugin=E.postcssPlugin,S.setMessage()):E.postcssVersion}catch(R){console&&console.error&&console.error(R)}return S}prepareVisitors(){this.listeners={};let S=(b,E,R)=>{this.listeners[E]||(this.listeners[E]=[]),this.listeners[E].push([b,R])};for(let b of this.plugins)if(typeof b=="object")for(let E in b){if(!d[E]&&/^[A-Z]/.test(E))throw new Error(`Unknown event ${E} in ${b.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!h[E])if(typeof b[E]=="object")for(let R in b[E])R==="*"?S(b,E,b[E][R]):S(b,E+"-"+R.toLowerCase(),b[E][R]);else typeof b[E]=="function"&&S(b,E,b[E])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let S=0;S<this.plugins.length;S++){let b=this.plugins[S],E=this.runOnRoot(b);if(m(E))try{await E}catch(R){throw this.handleError(R)}}if(this.prepareVisitors(),this.hasListener){let S=this.result.root;for(;!S[e];){S[e]=!0;let b=[g(S)];for(;b.length>0;){let E=this.visitTick(b);if(m(E))try{await E}catch(R){let I=b[b.length-1].node;throw this.handleError(R,I)}}}if(this.listeners.OnceExit)for(let[b,E]of this.listeners.OnceExit){this.result.lastPlugin=b;try{if(S.type==="document"){let R=S.nodes.map(I=>E(I,this.helpers));await Promise.all(R)}else await E(S,this.helpers)}catch(R){throw this.handleError(R)}}}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 b=this.result.root.nodes.map(E=>S.Once(E,this.helpers));return m(b[0])?Promise.all(b):b}return S.Once(this.result.root,this.helpers)}else if(typeof S=="function")return S(this.result.root,this.result)}catch(b){throw this.handleError(b)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let S=this.result.opts,b=s;S.syntax&&(b=S.syntax.stringify),S.stringifier&&(b=S.stringifier),b.stringify&&(b=b.stringify);let R=new r(b,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 S of this.plugins){let b=this.runOnRoot(S);if(m(b))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 b of S.nodes)this.visitSync(this.listeners.OnceExit,b);else this.visitSync(this.listeners.OnceExit,S)}return this.result}then(S,b){return this.async().then(S,b)}toString(){return this.css}visitSync(S,b){for(let[E,R]of S){this.result.lastPlugin=E;let I;try{I=R(b,this.helpers)}catch(N){throw this.handleError(N,b.proxyOf)}if(b.type!=="root"&&b.type!=="document"&&!b.parent)return!0;if(m(I))throw this.getAsyncError()}}visitTick(S){let b=S[S.length-1],{node:E,visitors:R}=b;if(E.type!=="root"&&E.type!=="document"&&!E.parent){S.pop();return}if(R.length>0&&b.visitorIndex<R.length){let[N,F]=R[b.visitorIndex];b.visitorIndex+=1,b.visitorIndex===R.length&&(b.visitors=[],b.visitorIndex=0),this.result.lastPlugin=N;try{return F(E.toProxy(),this.helpers)}catch(A){throw this.handleError(A,E)}}if(b.iterator!==0){let N=b.iterator,F;for(;F=E.nodes[E.indexes[N]];)if(E.indexes[N]+=1,!F[e]){F[e]=!0,S.push(g(F));return}b.iterator=0,delete E.indexes[N]}let I=b.events;for(;b.eventIndex<I.length;){let N=I[b.eventIndex];if(b.eventIndex+=1,N===f){E.nodes&&E.nodes.length&&(E[e]=!0,b.iterator=E.getIterator());return}else if(this.listeners[N]){b.visitors=this.listeners[N];return}}S.pop()}walkSync(S){S[e]=!0;let b=p(S);for(let E of b)if(E===f)S.nodes&&S.each(R=>{R[e]||this.walkSync(R)});else{let R=this.listeners[E];if(R&&this.visitSync(R,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 w.registerPostcss=C=>{y=C},Ir=w,w.default=w,c.registerLazyResult(w),o.registerLazyResult(w),Ir}var Dr,Li;function tl(){if(Li)return Dr;Li=1;let e=eo(),t=Gt(),r=to(),s=Is();const i=Rs();class o{constructor(u,l,c){l=l.toString(),this.stringified=!1,this._processor=u,this._css=l,this._opts=c,this._map=void 0;let n,d=t;this.result=new i(this._processor,n,this._opts),this.result.css=l;let h=this;Object.defineProperty(this.result,"root",{get(){return h.root}});let f=new e(d,n,this._opts,l);if(f.isMap()){let[m,p]=f.generate();m&&(this.result.css=m),p&&(this.result.map=p)}else f.clearAnnotation(),this.result.css=f.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(u){return this.async().catch(u)}finally(u){return this.async().then(u,u)}sync(){if(this.error)throw this.error;return this.result}then(u,l){return this.async().then(u,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 u,l=s;try{u=l(this._css,this._opts)}catch(c){this.error=c}if(this.error)throw this.error;return this._root=u,u}get[Symbol.toStringTag](){return"NoWorkResult"}}return Dr=o,o.default=o,Dr}var Tr,Fi;function rl(){if(Fi)return Tr;Fi=1;let e=tl(),t=io(),r=Ms(),s=ut();class i{constructor(a=[]){this.version="8.4.38",this.plugins=this.normalize(a)}normalize(a){let u=[];for(let l of a)if(l.postcss===!0?l=l():l.postcss&&(l=l.postcss),typeof l=="object"&&Array.isArray(l.plugins))u=u.concat(l.plugins);else if(typeof l=="object"&&l.postcssPlugin)u.push(l);else if(typeof l=="function")u.push(l);else if(!(typeof l=="object"&&(l.parse||l.stringify)))throw new Error(l+" is not a PostCSS plugin");return u}process(a,u={}){return!this.plugins.length&&!u.parser&&!u.stringifier&&!u.syntax?new e(this,a,u):new t(this,a,u)}use(a){return this.plugins=this.plugins.concat(this.normalize([a])),this}}return Tr=i,i.default=i,s.registerProcessor(i),r.registerProcessor(i),Tr}var Ar,Ui;function sl(){if(Ui)return Ar;Ui=1;let e=Yt(),t=Kn(),r=Jt(),s=Ns(),i=Xt(),o=ut(),a=Os();function u(l,c){if(Array.isArray(l))return l.map(m=>u(m));let h=l,{inputs:n}=h,d=$e(h,["inputs"]);if(n){c=[];for(let m of n){let p=se(k({},m),{__proto__:i.prototype});p.map&&(p.map=se(k({},p.map),{__proto__:t.prototype})),c.push(p)}}if(d.nodes&&(d.nodes=l.nodes.map(m=>u(m,c))),d.source){let f=d.source,{inputId:m}=f,p=$e(f,["inputId"]);d.source=p,m!=null&&(d.source.input=c[m])}if(d.type==="root")return new o(d);if(d.type==="decl")return new e(d);if(d.type==="rule")return new a(d);if(d.type==="comment")return new r(d);if(d.type==="atrule")return new s(d);throw new Error("Unknown node type: "+l.type)}return Ar=u,u.default=u,Ar}var _r,Wi;function il(){if(Wi)return _r;Wi=1;let e=Es(),t=Yt(),r=io(),s=Fe(),i=rl(),o=Gt(),a=sl(),u=Ms(),l=ro(),c=Jt(),n=Ns(),d=Rs(),h=Xt(),f=Is(),m=so(),p=Os(),g=ut(),v=Ht();function y(...w){return w.length===1&&Array.isArray(w[0])&&(w=w[0]),new i(w)}return y.plugin=function(C,S){let b=!1;function E(...I){console&&console.warn&&!b&&(b=!0,console.warn(C+`: postcss.plugin was deprecated. Migration guide:
39
39
  https://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:
40
- https://www.w3ctech.com/topic/2226`));let N=S(...I);return N.postcssPlugin=C,N.postcssVersion=new i().version,N}let M;return Object.defineProperty(E,"postcss",{get(){return M||(M=E()),M}}),E.process=function(I,N,F){return y([E(F)]).process(I,N)},E},y.stringify=o,y.parse=f,y.fromJSON=a,y.list=m,y.comment=w=>new c(w),y.atRule=w=>new n(w),y.decl=w=>new t(w),y.rule=w=>new p(w),y.root=w=>new g(w),y.document=w=>new u(w),y.CssSyntaxError=e,y.Declaration=t,y.Container=s,y.Processor=i,y.Document=u,y.Comment=c,y.Warning=l,y.AtRule=n,y.Result=d,y.Input=h,y.Rule=p,y.Root=g,y.Node=v,r.registerPostcss(y),xr=y,y.default=y,xr}var ja=qa();const J=_a(ja);J.stringify;J.fromJSON;J.plugin;J.parse;J.list;J.document;J.comment;J.atRule;J.rule;J.decl;J.root;J.CssSyntaxError;J.Declaration;J.Container;J.Processor;J.Document;J.Comment;J.Warning;J.AtRule;J.Result;J.Input;J.Rule;J.Root;J.Node;const Ii={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 Ga(e){let t=Ii[e.tagName]?Ii[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function $t(e,t){const r=t==null?void 0:t.stylesWithHoverClass.get(e);if(r)return r;let s=e;try{s=J([Aa,Ta]).process(e).css}catch(i){console.warn("Failed to adapt css for replay",i)}return t==null||t.stylesWithHoverClass.set(e,s),s}function Di(){return{stylesWithHoverClass:new Map}}const Ha="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.",Ai="rrweb-snapshot.createSandboxedIframe() requires root to be connected to a document before creating a sandboxed iframe.",Hn=new WeakSet;function Ya(e){if(!e||e.tagName!=="IFRAME"||!("sandbox"in e))return!1;const t=Array.from(e.sandbox);return t.length===1&&t[0]==="allow-same-origin"}function Xa(e){if(e.UNSAFE_allowUnprotectedRebuild)return;const t=e.doc.defaultView;if(t&&!(Hn.has(e.doc)&&Ya(t.frameElement)))throw new Error(Ha)}function Ja(e,t,r,s){const i=[];for(const l of e.childNodes)l.type===U.Text&&i.push(l);const o=t.split("/* rr_split */");for(;o.length>1&&o.length>i.length;)o.splice(-2,2,o.slice(-2).join(""));let a="";r&&(a=$t(o.join(""),s));let u=0;for(let l=0;l<i.length&&l!==o.length;l++){const c=i[l];if(!r)c.textContent=o[l];else if(l<o.length-1){let n=u,d=o[l+1].length;d=Math.min(d,30);let h=!1;for(;d>2;d--){const f=o[l+1].substring(0,d),m=a.substring(u).indexOf(f);if(h=m!==-1,h){n+=m;break}}h||(n+=o[l].length),c.textContent=a.substring(u,n),u=n}else c.textContent=a.substring(u)}}function Qa(e,t,r,s){const{doc:i,hackCss:o,cache:a}=s;e.childNodes.length?Ja(e,r,o,a):(o&&(r=$t(r,a)),t.appendChild(i.createTextNode(r)))}function Za(e,t){var r;const{doc:s,hackCss:i,cache:o}=t;switch(e.type){case U.Document:return s.implementation.createDocument(null,"",null);case U.DocumentType:return s.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case U.Element:{const a=Ga(e);let u;e.isSVG?u=s.createElementNS("http://www.w3.org/2000/svg",a):(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{}),u=s.createElement(a));const l={};for(const c in e.attributes){if(!Object.prototype.hasOwnProperty.call(e.attributes,c))continue;let n=e.attributes[c];if(!(a==="option"&&c==="selected"&&n===!1)&&n!==null){if(n===!0&&(n=""),c.startsWith("rr_")){l[c]=n;continue}if(typeof n=="string"){if(a==="style"&&c==="_cssText"){Qa(e,u,n,t);continue}else if(a==="textarea"&&c==="value"){u.appendChild(s.createTextNode(n)),e.childNodes=[];continue}}try{if(e.isSVG&&c==="xlink:href")u.setAttributeNS("http://www.w3.org/1999/xlink",c,n.toString());else if(c==="onload"||c==="onclick"||c.substring(0,7)==="onmouse")u.setAttribute("_"+c,n.toString());else if(a==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&c==="content"){u.setAttribute("csp-content",n.toString());continue}else a==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||a==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&hs(e.attributes.href)==="js"||(a==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?u.setAttribute("rrweb-original-srcset",e.attributes.srcset):u.setAttribute(c,n.toString()))}catch(d){}}}for(const c in l){const n=l[c];if(a==="canvas"&&c==="rr_dataURL"){const d=s.createElement("img");d.onload=()=>{const h=u.getContext("2d");h&&h.drawImage(d,0,0,d.width,d.height)},d.src=n.toString(),u.RRNodeType&&(u.rr_dataURL=n.toString())}else if(a==="img"&&c==="rr_dataURL"){const d=u;d.currentSrc.startsWith("data:")||(d.setAttribute("rrweb-original-src",e.attributes.src),d.src=n.toString())}if(c==="rr_width")u.style.setProperty("width",n.toString());else if(c==="rr_height")u.style.setProperty("height",n.toString());else if(c==="rr_mediaCurrentTime"&&typeof n=="number")u.currentTime=n;else if(c==="rr_mediaState")switch(n){case"played":u.play().catch(d=>console.warn("media playback error",d));break;case"paused":u.pause();break}else c==="rr_mediaPlaybackRate"&&typeof n=="number"?u.playbackRate=n:c==="rr_mediaMuted"&&typeof n=="boolean"?u.muted=n:c==="rr_mediaLoop"&&typeof n=="boolean"?u.loop=n:c==="rr_mediaVolume"&&typeof n=="number"?u.volume=n:c==="rr_open_mode"&&u.setAttribute("rr_open_mode",n)}if(e.isShadowHost)if(!u.shadowRoot)u.attachShadow({mode:"open"});else for(;u.shadowRoot.firstChild;)u.shadowRoot.removeChild(u.shadowRoot.firstChild);return u}case U.Text:return e.isStyle&&i?s.createTextNode($t(e.textContent,o)):s.createTextNode(e.textContent);case U.CDATA:return s.createCDATASection(e.textContent);case U.Comment:return s.createComment(e.textContent);default:return null}}function rt(e,t){const{doc:r,mirror:s,skipChild:i=!1,hackCss:o=!0,afterAppend:a,cache:u}=t;if(s.has(e.id)){const c=s.getNode(e.id),n=s.getMeta(c);if(oa(n,e))return s.getNode(e.id)}let l=Za(e,{doc:r,hackCss:o,cache:u});if(!l)return null;if(e.rootId&&s.getNode(e.rootId)!==r&&s.replace(e.rootId,r),e.type===U.Document&&(r.close(),r.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==U.DocumentType&&(e.childNodes[0].type===U.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" "">')),l=r),s.add(l,e),(e.type===U.Document||e.type===U.Element)&&!i)for(const c of e.childNodes){const n=rt(c,{doc:r,mirror:s,skipChild:!1,hackCss:o,afterAppend:a,cache:u});if(!n){console.warn("Failed to rebuild",c);continue}if(c.isShadow&&us(l)&&l.shadowRoot)l.shadowRoot.appendChild(n);else if(e.type===U.Document&&c.type==U.Element){const d=n;let h=null;d.childNodes.forEach(f=>{f.nodeName==="BODY"&&(h=f)}),h?(d.removeChild(h),l.appendChild(n),d.appendChild(h)):l.appendChild(n)}else l.appendChild(n);a&&a(n,c.id)}return l}function Ka(e,t){function r(s){t(s)}for(const s of e.getIds())e.has(s)&&r(e.getNode(s))}function el(e,t){const r=t.getMeta(e);if((r==null?void 0:r.type)!==U.Element)return;const s=e;for(const i in r.attributes){if(!(Object.prototype.hasOwnProperty.call(r.attributes,i)&&i.startsWith("rr_")))continue;const o=r.attributes[i];i==="rr_scrollLeft"&&(s.scrollLeft=o),i==="rr_scrollTop"&&(s.scrollTop=o)}}function tl(e,t){Xa(t);const{doc:r,onVisit:s,hackCss:i=!0,afterAppend:o,cache:a,mirror:u=new cs}=t,l=rt(e,{doc:r,mirror:u,skipChild:!1,hackCss:i,afterAppend:o,cache:a});return Ka(u,c=>{s&&s(c),el(c,u)}),l}function rl(e){var t;if(!e.root.isConnected)throw new Error(Ai);const r=e.root.ownerDocument.createElement("iframe");for(const[i,o]of Object.entries(e.iframeAttributes||{}))i!=="sandbox"&&r.setAttribute(i,o);r.setAttribute("sandbox","allow-same-origin"),e.root.appendChild(r);const s=r.contentDocument;if(!s||!r.contentWindow)throw(t=r.parentNode)==null||t.removeChild(r),new Error(Ai);return Hn.add(s),r}var sl=Object.defineProperty,il=(e,t,r)=>t in e?sl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,D=(e,t,r)=>il(e,typeof t!="symbol"?t+"":t,r),nl=Object.defineProperty,ol=(e,t,r)=>t in e?nl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ti=(e,t,r)=>ol(e,typeof t!="symbol"?t+"":t,r);Date.now().toString();let al=class{constructor(){Ti(this,"idNodeMap",new Map),Ti(this,"nodeMetaMap",new WeakMap)}getId(t){var r;if(!t)return-1;const s=(r=this.getMeta(t))==null?void 0:r.id;return s!=null?s:-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){const 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){const s=r.id;this.idNodeMap.set(s,t),this.nodeMetaMap.set(t,r)}replace(t,r){const s=this.getNode(t);if(s){const i=this.nodeMetaMap.get(s);i&&this.nodeMetaMap.set(r,i)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function ll(){return new al}function ul(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function cl(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 i=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(r,s,i.get?i:{enumerable:!0,get:function(){return e[s]}})}),r}var pt={exports:{}},_i;function hl(){if(_i)return pt.exports;_i=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 pt.exports=t(),pt.exports.createColors=t,pt.exports}const fl={},dl=Object.freeze(Object.defineProperty({__proto__:null,default:fl},Symbol.toStringTag,{value:"Module"})),ge=cl(dl);var Rr,ki;function Ss(){if(ki)return Rr;ki=1;let e=hl(),t=ge;class r extends Error{constructor(i,o,a,u,l,c){super(i),this.name="CssSyntaxError",this.reason=i,l&&(this.file=l),u&&(this.source=u),c&&(this.plugin=c),typeof o!="undefined"&&typeof a!="undefined"&&(typeof o=="number"?(this.line=o,this.column=a):(this.line=o.line,this.column=o.column,this.endLine=a.line,this.endColumn=a.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!="undefined"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(i){if(!this.source)return"";let o=this.source;i==null&&(i=e.isColorSupported),t&&i&&(o=t(o));let a=o.split(/\r?\n/),u=Math.max(this.line-3,0),l=Math.min(this.line+2,a.length),c=String(l).length,n,d;if(i){let{bold:h,gray:f,red:m}=e.createColors(!0);n=p=>h(m(p)),d=p=>f(p)}else n=d=h=>h;return a.slice(u,l).map((h,f)=>{let m=u+1+f,p=" "+(" "+m).slice(-c)+" | ";if(m===this.line){let g=d(p.replace(/\d/g," "))+h.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+d(p)+h+`
40
+ https://www.w3ctech.com/topic/2226`));let N=S(...I);return N.postcssPlugin=C,N.postcssVersion=new i().version,N}let R;return Object.defineProperty(E,"postcss",{get(){return R||(R=E()),R}}),E.process=function(I,N,F){return y([E(F)]).process(I,N)},E},y.stringify=o,y.parse=f,y.fromJSON=a,y.list=m,y.comment=w=>new c(w),y.atRule=w=>new n(w),y.decl=w=>new t(w),y.rule=w=>new p(w),y.root=w=>new g(w),y.document=w=>new u(w),y.CssSyntaxError=e,y.Declaration=t,y.Container=s,y.Processor=i,y.Document=u,y.Comment=c,y.Warning=l,y.AtRule=n,y.Result=d,y.Input=h,y.Rule=p,y.Root=g,y.Node=v,r.registerPostcss(y),_r=y,y.default=y,_r}var nl=il();const J=Ha(nl);J.stringify;J.fromJSON;J.plugin;J.parse;J.list;J.document;J.comment;J.atRule;J.rule;J.decl;J.root;J.CssSyntaxError;J.Declaration;J.Container;J.Processor;J.Document;J.Comment;J.Warning;J.AtRule;J.Result;J.Input;J.Rule;J.Root;J.Node;const Bi={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 ol(e){let t=Bi[e.tagName]?Bi[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function Qt(e,t){const r=t==null?void 0:t.stylesWithHoverClass.get(e);if(r)return r;let s=e;try{s=J([qa,Ga]).process(e).css}catch(i){console.warn("Failed to adapt css for replay",i)}return t==null||t.stylesWithHoverClass.set(e,s),s}function $i(){return{stylesWithHoverClass:new Map}}const al="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.",zi="rrweb-snapshot.createSandboxedIframe() requires root to be connected to a document before creating a sandboxed iframe.",no=new WeakSet;function ll(e){if(!e||e.tagName!=="IFRAME"||!("sandbox"in e))return!1;const t=Array.from(e.sandbox);return t.length===1&&t[0]==="allow-same-origin"}function ul(e){if(e.UNSAFE_allowUnprotectedRebuild)return;const t=e.doc.defaultView;if(t&&!(no.has(e.doc)&&ll(t.frameElement)))throw new Error(al)}function cl(e,t,r,s){const i=[];for(const l of e.childNodes)l.type===U.Text&&i.push(l);const o=t.split("/* rr_split */");for(;o.length>1&&o.length>i.length;)o.splice(-2,2,o.slice(-2).join(""));let a="";r&&(a=Qt(o.join(""),s));let u=0;for(let l=0;l<i.length&&l!==o.length;l++){const c=i[l];if(!r)c.textContent=o[l];else if(l<o.length-1){let n=u,d=o[l+1].length;d=Math.min(d,30);let h=!1;for(;d>2;d--){const f=o[l+1].substring(0,d),m=a.substring(u).indexOf(f);if(h=m!==-1,h){n+=m;break}}h||(n+=o[l].length),c.textContent=a.substring(u,n),u=n}else c.textContent=a.substring(u)}}function hl(e,t,r,s){const{doc:i,hackCss:o,cache:a}=s;e.childNodes.length?cl(e,r,o,a):(o&&(r=Qt(r,a)),t.appendChild(i.createTextNode(r)))}function fl(e,t){var r;const{doc:s,hackCss:i,cache:o}=t;switch(e.type){case U.Document:return s.implementation.createDocument(null,"",null);case U.DocumentType:return s.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case U.Element:{const a=ol(e);let u;e.isSVG?u=s.createElementNS("http://www.w3.org/2000/svg",a):(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{}),u=s.createElement(a));const l={};for(const c in e.attributes){if(!Object.prototype.hasOwnProperty.call(e.attributes,c))continue;let n=e.attributes[c];if(!(a==="option"&&c==="selected"&&n===!1)&&n!==null){if(n===!0&&(n=""),c.startsWith("rr_")){l[c]=n;continue}if(typeof n=="string"){if(a==="style"&&c==="_cssText"){hl(e,u,n,t);continue}else if(a==="textarea"&&c==="value"){u.appendChild(s.createTextNode(n)),e.childNodes=[];continue}}try{if(e.isSVG&&c==="xlink:href")u.setAttributeNS("http://www.w3.org/1999/xlink",c,n.toString());else if(c==="onload"||c==="onclick"||c.substring(0,7)==="onmouse")u.setAttribute("_"+c,n.toString());else if(a==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&c==="content"){u.setAttribute("csp-content",n.toString());continue}else a==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||a==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&bs(e.attributes.href)==="js"||(a==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?u.setAttribute("rrweb-original-srcset",e.attributes.srcset):u.setAttribute(c,n.toString()))}catch(d){}}}for(const c in l){const n=l[c];if(a==="canvas"&&c==="rr_dataURL"){const d=s.createElement("img");d.onload=()=>{const h=u.getContext("2d");h&&h.drawImage(d,0,0,d.width,d.height)},d.src=n.toString(),u.RRNodeType&&(u.rr_dataURL=n.toString())}else if(a==="img"&&c==="rr_dataURL"){const d=u;d.currentSrc.startsWith("data:")||(d.setAttribute("rrweb-original-src",e.attributes.src),d.src=n.toString())}if(c==="rr_width")u.style.setProperty("width",n.toString());else if(c==="rr_height")u.style.setProperty("height",n.toString());else if(c==="rr_mediaCurrentTime"&&typeof n=="number")u.currentTime=n;else if(c==="rr_mediaState")switch(n){case"played":u.play().catch(d=>console.warn("media playback error",d));break;case"paused":u.pause();break}else c==="rr_mediaPlaybackRate"&&typeof n=="number"?u.playbackRate=n:c==="rr_mediaMuted"&&typeof n=="boolean"?u.muted=n:c==="rr_mediaLoop"&&typeof n=="boolean"?u.loop=n:c==="rr_mediaVolume"&&typeof n=="number"?u.volume=n:c==="rr_open_mode"&&u.setAttribute("rr_open_mode",n)}if(e.isShadowHost)if(!u.shadowRoot)u.attachShadow({mode:"open"});else for(;u.shadowRoot.firstChild;)u.shadowRoot.removeChild(u.shadowRoot.firstChild);return u}case U.Text:return e.isStyle&&i?s.createTextNode(Qt(e.textContent,o)):s.createTextNode(e.textContent);case U.CDATA:return s.createCDATASection(e.textContent);case U.Comment:return s.createComment(e.textContent);default:return null}}function ot(e,t){const{doc:r,mirror:s,skipChild:i=!1,hackCss:o=!0,afterAppend:a,cache:u}=t;if(s.has(e.id)){const c=s.getNode(e.id),n=s.getMeta(c);if(Sa(n,e))return s.getNode(e.id)}let l=fl(e,{doc:r,hackCss:o,cache:u});if(!l)return null;if(e.rootId&&s.getNode(e.rootId)!==r&&s.replace(e.rootId,r),e.type===U.Document&&(r.close(),r.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==U.DocumentType&&(e.childNodes[0].type===U.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" "">')),l=r),s.add(l,e),(e.type===U.Document||e.type===U.Element)&&!i)for(const c of e.childNodes){const n=ot(c,{doc:r,mirror:s,skipChild:!1,hackCss:o,afterAppend:a,cache:u});if(!n){console.warn("Failed to rebuild",c);continue}if(c.isShadow&&vs(l)&&l.shadowRoot)l.shadowRoot.appendChild(n);else if(e.type===U.Document&&c.type==U.Element){const d=n;let h=null;d.childNodes.forEach(f=>{f.nodeName==="BODY"&&(h=f)}),h?(d.removeChild(h),l.appendChild(n),d.appendChild(h)):l.appendChild(n)}else l.appendChild(n);a&&a(n,c.id)}return l}function dl(e,t){function r(s){t(s)}for(const s of e.getIds())e.has(s)&&r(e.getNode(s))}function pl(e,t){const r=t.getMeta(e);if((r==null?void 0:r.type)!==U.Element)return;const s=e;for(const i in r.attributes){if(!(Object.prototype.hasOwnProperty.call(r.attributes,i)&&i.startsWith("rr_")))continue;const o=r.attributes[i];i==="rr_scrollLeft"&&(s.scrollLeft=o),i==="rr_scrollTop"&&(s.scrollTop=o)}}function ml(e,t){ul(t);const{doc:r,onVisit:s,hackCss:i=!0,afterAppend:o,cache:a,mirror:u=new Ss}=t,l=ot(e,{doc:r,mirror:u,skipChild:!1,hackCss:i,afterAppend:o,cache:a});return dl(u,c=>{s&&s(c),pl(c,u)}),l}function gl(e){var t;if(!e.root.isConnected)throw new Error(zi);const r=e.root.ownerDocument.createElement("iframe");for(const[i,o]of Object.entries(e.iframeAttributes||{}))i!=="sandbox"&&r.setAttribute(i,o);r.setAttribute("sandbox","allow-same-origin"),e.root.appendChild(r);const s=r.contentDocument;if(!s||!r.contentWindow)throw(t=r.parentNode)==null||t.removeChild(r),new Error(zi);return no.add(s),r}var yl=Object.defineProperty,wl=(e,t,r)=>t in e?yl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,D=(e,t,r)=>wl(e,typeof t!="symbol"?t+"":t,r),vl=Object.defineProperty,Sl=(e,t,r)=>t in e?vl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Vi=(e,t,r)=>Sl(e,typeof t!="symbol"?t+"":t,r);Date.now().toString();const ji=new WeakMap;let qi="";(function(){var a;var t;const r=Function.prototype.toString;qi=r.call(r);let s=globalThis.Proxy;try{if(typeof s!="function"||!r.call(s).includes("[native code]")){const u=document.createElement("iframe");u.style.display="none",document.documentElement.appendChild(u),s=(a=(t=u.contentWindow)==null?void 0:t.Proxy)!=null?a:s,document.documentElement.removeChild(u)}}catch(u){}const i=Object.getPrototypeOf(r),o=new s(r,{apply(u,l,c){const n=ji.get(l);return n!==void 0?n:l!=null&&typeof l=="function"&&!i.isPrototypeOf(l.toString)?l.toString():u.apply(l,c)}});ji.set(o,qi),Object.defineProperty(Function.prototype,"toString",{value:o,configurable:!0,writable:!0})})();let bl=class{constructor(){Vi(this,"idNodeMap",new Map),Vi(this,"nodeMetaMap",new WeakMap)}getId(t){var r;if(!t)return-1;const s=(r=this.getMeta(t))==null?void 0:r.id;return s!=null?s:-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){const 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){const s=r.id;this.idNodeMap.set(s,t),this.nodeMetaMap.set(t,r)}replace(t,r){const s=this.getNode(t);if(s){const i=this.nodeMetaMap.get(s);i&&this.nodeMetaMap.set(r,i)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Cl(){return new bl}function El(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function xl(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 i=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(r,s,i.get?i:{enumerable:!0,get:function(){return e[s]}})}),r}var vt={exports:{}},Gi;function Ml(){if(Gi)return vt.exports;Gi=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 vt.exports=t(),vt.exports.createColors=t,vt.exports}const Rl={},Nl=Object.freeze(Object.defineProperty({__proto__:null,default:Rl},Symbol.toStringTag,{value:"Module"})),we=xl(Nl);var Pr,Hi;function Ds(){if(Hi)return Pr;Hi=1;let e=Ml(),t=we;class r extends Error{constructor(i,o,a,u,l,c){super(i),this.name="CssSyntaxError",this.reason=i,l&&(this.file=l),u&&(this.source=u),c&&(this.plugin=c),typeof o!="undefined"&&typeof a!="undefined"&&(typeof o=="number"?(this.line=o,this.column=a):(this.line=o.line,this.column=o.column,this.endLine=a.line,this.endColumn=a.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!="undefined"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(i){if(!this.source)return"";let o=this.source;i==null&&(i=e.isColorSupported),t&&i&&(o=t(o));let a=o.split(/\r?\n/),u=Math.max(this.line-3,0),l=Math.min(this.line+2,a.length),c=String(l).length,n,d;if(i){let{bold:h,gray:f,red:m}=e.createColors(!0);n=p=>h(m(p)),d=p=>f(p)}else n=d=h=>h;return a.slice(u,l).map((h,f)=>{let m=u+1+f,p=" "+(" "+m).slice(-c)+" | ";if(m===this.line){let g=d(p.replace(/\d/g," "))+h.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+d(p)+h+`
41
41
  `+g+n("^")}return" "+d(p)+h}).join(`
42
42
  `)}toString(){let i=this.showSourceCode();return i&&(i=`
43
43
 
44
44
  `+i+`
45
- `),this.name+": "+this.message+i}}return Rr=r,r.default=r,Rr}var mt={},Pi;function bs(){return Pi||(Pi=1,mt.isClean=Symbol("isClean"),mt.my=Symbol("my")),mt}var Mr,Li;function Yn(){if(Li)return Mr;Li=1;const e={after:`
45
+ `),this.name+": "+this.message+i}}return Pr=r,r.default=r,Pr}var St={},Yi;function Ts(){return Yi||(Yi=1,St.isClean=Symbol("isClean"),St.my=Symbol("my")),St}var kr,Xi;function oo(){if(Xi)return kr;Xi=1;const e={after:`
46
46
  `,beforeClose:`
47
47
  `,beforeComment:`
48
48
  `,beforeDecl:`
@@ -53,18 +53,37 @@ https://www.w3ctech.com/topic/2226`));let N=S(...I);return N.postcssPlugin=C,N.p
53
53
  `)&&(a=a.replace(/[^\n]+$/,"")),!1}),typeof a=="undefined"?a=this.raw(o,null,"beforeDecl"):a&&(a=a.replace(/\S/g,"")),a}rawBeforeDecl(i,o){let a;return i.walkDecls(u=>{if(typeof u.raws.before!="undefined")return a=u.raws.before,a.includes(`
54
54
  `)&&(a=a.replace(/[^\n]+$/,"")),!1}),typeof a=="undefined"?a=this.raw(o,null,"beforeRule"):a&&(a=a.replace(/\S/g,"")),a}rawBeforeOpen(i){let o;return i.walk(a=>{if(a.type!=="decl"&&(o=a.raws.between,typeof o!="undefined"))return!1}),o}rawBeforeRule(i){let o;return i.walk(a=>{if(a.nodes&&(a.parent!==i||i.first!==a)&&typeof a.raws.before!="undefined")return o=a.raws.before,o.includes(`
55
55
  `)&&(o=o.replace(/[^\n]+$/,"")),!1}),o&&(o=o.replace(/\S/g,"")),o}rawColon(i){let o;return i.walkDecls(a=>{if(typeof a.raws.between!="undefined")return o=a.raws.between.replace(/[^\s:]/g,""),!1}),o}rawEmptyBody(i){let o;return i.walk(a=>{if(a.nodes&&a.nodes.length===0&&(o=a.raws.after,typeof o!="undefined"))return!1}),o}rawIndent(i){if(i.raws.indent)return i.raws.indent;let o;return i.walk(a=>{let u=a.parent;if(u&&u!==i&&u.parent&&u.parent===i&&typeof a.raws.before!="undefined"){let l=a.raws.before.split(`
56
- `);return o=l[l.length-1],o=o.replace(/\S/g,""),!1}}),o}rawSemicolon(i){let o;return i.walk(a=>{if(a.nodes&&a.nodes.length&&a.last.type==="decl"&&(o=a.raws.semicolon,typeof o!="undefined"))return!1}),o}rawValue(i,o){let a=i[o],u=i.raws[o];return u&&u.value===a?u.raw:a}root(i){this.body(i),i.raws.after&&this.builder(i.raws.after)}rule(i){this.block(i,this.rawValue(i,"selector")),i.raws.ownSemicolon&&this.builder(i.raws.ownSemicolon,i,"end")}stringify(i,o){if(!this[i.type])throw new Error("Unknown AST node type "+i.type+". Maybe you need to change PostCSS stringifier.");this[i.type](i,o)}}return Mr=r,r.default=r,Mr}var Nr,Fi;function zt(){if(Fi)return Nr;Fi=1;let e=Yn();function t(r,s){new e(s).stringify(r)}return Nr=t,t.default=t,Nr}var Or,Ui;function Vt(){if(Ui)return Or;Ui=1;let{isClean:e,my:t}=bs(),r=Ss(),s=Yn(),i=zt();function o(u,l){let c=new u.constructor;for(let n in u){if(!Object.prototype.hasOwnProperty.call(u,n)||n==="proxyCache")continue;let d=u[n],h=typeof d;n==="parent"&&h==="object"?l&&(c[n]=l):n==="source"?c[n]=d:Array.isArray(d)?c[n]=d.map(f=>o(f,c)):(h==="object"&&d!==null&&(d=o(d)),c[n]=d)}return c}class a{constructor(l={}){this.raws={},this[e]=!1,this[t]=!0;for(let c in l)if(c==="nodes"){this.nodes=[];for(let n of l[c])typeof n.clone=="function"?this.append(n.clone()):this.append(n)}else this[c]=l[c]}addToError(l){if(l.postcssNode=this,l.stack&&this.source&&/\n\s{4}at /.test(l.stack)){let c=this.source;l.stack=l.stack.replace(/\n\s{4}at /,`$&${c.input.from}:${c.start.line}:${c.start.column}$&`)}return l}after(l){return this.parent.insertAfter(this,l),this}assign(l={}){for(let c in l)this[c]=l[c];return this}before(l){return this.parent.insertBefore(this,l),this}cleanRaws(l){delete this.raws.before,delete this.raws.after,l||delete this.raws.between}clone(l={}){let c=o(this);for(let n in l)c[n]=l[n];return c}cloneAfter(l={}){let c=this.clone(l);return this.parent.insertAfter(this,c),c}cloneBefore(l={}){let c=this.clone(l);return this.parent.insertBefore(this,c),c}error(l,c={}){if(this.source){let{end:n,start:d}=this.rangeBy(c);return this.source.input.error(l,{column:d.column,line:d.line},{column:n.column,line:n.line},c)}return new r(l)}getProxyProcessor(){return{get(l,c){return c==="proxyOf"?l:c==="root"?()=>l.root().toProxy():l[c]},set(l,c,n){return l[c]===n||(l[c]=n,(c==="prop"||c==="value"||c==="name"||c==="params"||c==="important"||c==="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,c){let n=this.source.start;if(l.index)n=this.positionInside(l.index,c);else if(l.word){c=this.toString();let d=c.indexOf(l.word);d!==-1&&(n=this.positionInside(d,c))}return n}positionInside(l,c){let n=c||this.toString(),d=this.source.start.column,h=this.source.start.line;for(let f=0;f<l;f++)n[f]===`
57
- `?(d=1,h+=1):d+=1;return{column:d,line:h}}prev(){if(!this.parent)return;let l=this.parent.index(this);return this.parent.nodes[l-1]}rangeBy(l){let c={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:c.column+1,line:c.line};if(l.word){let d=this.toString(),h=d.indexOf(l.word);h!==-1&&(c=this.positionInside(h,d),n=this.positionInside(h+l.word.length,d))}else l.start?c={column:l.start.column,line:l.start.line}:l.index&&(c=this.positionInside(l.index)),l.end?n={column:l.end.column,line:l.end.line}:typeof l.endIndex=="number"?n=this.positionInside(l.endIndex):l.index&&(n=this.positionInside(l.index+1));return(n.line<c.line||n.line===c.line&&n.column<=c.column)&&(n={column:c.column+1,line:c.line}),{end:n,start:c}}raw(l,c){return new s().raw(this,l,c)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...l){if(this.parent){let c=this,n=!1;for(let d of l)d===this?n=!0:n?(this.parent.insertAfter(c,d),c=d):this.parent.insertBefore(c,d);n||this.remove()}return this}root(){let l=this;for(;l.parent&&l.parent.type!=="document";)l=l.parent;return l}toJSON(l,c){let n={},d=c==null;c=c||new Map;let h=0;for(let f in this){if(!Object.prototype.hasOwnProperty.call(this,f)||f==="parent"||f==="proxyCache")continue;let m=this[f];if(Array.isArray(m))n[f]=m.map(p=>typeof p=="object"&&p.toJSON?p.toJSON(null,c):p);else if(typeof m=="object"&&m.toJSON)n[f]=m.toJSON(null,c);else if(f==="source"){let p=c.get(m.input);p==null&&(p=h,c.set(m.input,h),h++),n[f]={end:m.end,inputId:p,start:m.start}}else n[f]=m}return d&&(n.inputs=[...c.keys()].map(f=>f.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(l=i){l.stringify&&(l=l.stringify);let c="";return l(this,n=>{c+=n}),c}warn(l,c,n){let d={node:this};for(let h in n)d[h]=n[h];return l.warn(c,d)}get proxyOf(){return this}}return Or=a,a.default=a,Or}var Ir,Bi;function qt(){if(Bi)return Ir;Bi=1;let e=Vt();class t extends e{constructor(s){s&&typeof s.value!="undefined"&&typeof s.value!="string"&&(s=se(P({},s),{value:String(s.value)})),super(s),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}}return Ir=t,t.default=t,Ir}var Dr,Wi;function pl(){if(Wi)return Dr;Wi=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return Dr={nanoid:(s=21)=>{let i="",o=s;for(;o--;)i+=e[Math.random()*64|0];return i},customAlphabet:(s,i=21)=>(o=i)=>{let a="",u=o;for(;u--;)a+=s[Math.random()*s.length|0];return a}},Dr}var Ar,$i;function Xn(){if($i)return Ar;$i=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=ge,{existsSync:r,readFileSync:s}=ge,{dirname:i,join:o}=ge;function a(l){return Buffer?Buffer.from(l,"base64").toString():window.atob(l)}class u{constructor(c,n){if(n.map===!1)return;this.loadAnnotation(c),this.inline=this.startWith(this.annotation,"data:");let d=n.map?n.map.prev:void 0,h=this.loadMap(n.from,d);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=i(this.mapFile)),h&&(this.text=h)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(c){let n=/^data:application\/json;charset=utf-?8;base64,/,d=/^data:application\/json;base64,/,h=/^data:application\/json;charset=utf-?8,/,f=/^data:application\/json,/;if(h.test(c)||f.test(c))return decodeURIComponent(c.substr(RegExp.lastMatch.length));if(n.test(c)||d.test(c))return a(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 n=c.match(/\/\*\s*# sourceMappingURL=/gm);if(!n)return;let d=c.lastIndexOf(n.pop()),h=c.indexOf("*/",d);d>-1&&h>-1&&(this.annotation=this.getAnnotationURL(c.substring(d,h)))}loadFile(c){if(this.root=i(c),r(c))return this.mapFile=c,s(c,"utf-8").toString().trim()}loadMap(c,n){if(n===!1)return!1;if(n){if(typeof n=="string")return n;if(typeof n=="function"){let d=n(c);if(d){let h=this.loadFile(d);if(!h)throw new Error("Unable to load previous source map: "+d.toString());return h}}else{if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let d=this.annotation;return c&&(d=o(i(c),d)),this.loadFile(d)}}}startWith(c,n){return c?c.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Ar=u,u.default=u,Ar}var Tr,zi;function jt(){if(zi)return Tr;zi=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=ge,{fileURLToPath:r,pathToFileURL:s}=ge,{isAbsolute:i,resolve:o}=ge,{nanoid:a}=pl(),u=ge,l=Ss(),c=Xn(),n=Symbol("fromOffsetCache"),d=!!(e&&t),h=!!(o&&i);class f{constructor(p,g={}){if(p===null||typeof p=="undefined"||typeof p=="object"&&!p.toString)throw new Error(`PostCSS received ${p} instead of CSS string`);if(this.css=p.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,g.from&&(!h||/^\w+:\/\//.test(g.from)||i(g.from)?this.file=g.from:this.file=o(g.from)),h&&d){let v=new c(this.css,g);if(v.text){this.map=v;let y=v.consumer().file;!this.file&&y&&(this.file=this.mapResolve(y))}}this.file||(this.id="<input css "+a(6)+">"),this.map&&(this.map.file=this.from)}error(p,g,v,y={}){let w,C,S;if(g&&typeof g=="object"){let E=g,M=v;if(typeof E.offset=="number"){let I=this.fromOffset(E.offset);g=I.line,v=I.col}else g=E.line,v=E.column;if(typeof M.offset=="number"){let I=this.fromOffset(M.offset);C=I.line,S=I.col}else C=M.line,S=M.column}else if(!v){let E=this.fromOffset(g);g=E.line,v=E.col}let b=this.origin(g,v,C,S);return b?w=new l(p,b.endLine===void 0?b.line:{column:b.column,line:b.line},b.endLine===void 0?b.column:{column:b.endColumn,line:b.endLine},b.source,b.file,y.plugin):w=new l(p,C===void 0?g:{column:v,line:g},C===void 0?v:{column:S,line:C},this.css,this.file,y.plugin),w.input={column:v,endColumn:S,endLine:C,line:g,source:this.css},this.file&&(s&&(w.input.url=s(this.file).toString()),w.input.file=this.file),w}fromOffset(p){let g,v;if(this[n])v=this[n];else{let w=this.css.split(`
58
- `);v=new Array(w.length);let C=0;for(let S=0,b=w.length;S<b;S++)v[S]=C,C+=w[S].length+1;this[n]=v}g=v[v.length-1];let y=0;if(p>=g)y=v.length-1;else{let w=v.length-2,C;for(;y<w;)if(C=y+(w-y>>1),p<v[C])w=C-1;else if(p>=v[C+1])y=C+1;else{y=C;break}}return{col:p-v[y]+1,line:y+1}}mapResolve(p){return/^\w+:\/\//.test(p)?p:o(this.map.consumer().sourceRoot||this.map.root||".",p)}origin(p,g,v,y){if(!this.map)return!1;let w=this.map.consumer(),C=w.originalPositionFor({column:g,line:p});if(!C.source)return!1;let S;typeof v=="number"&&(S=w.originalPositionFor({column:y,line:v}));let b;i(C.source)?b=s(C.source):b=new URL(C.source,this.map.consumer().sourceRoot||s(this.map.mapFile));let E={column:C.column,endColumn:S&&S.column,endLine:S&&S.line,line:C.line,url:b.toString()};if(b.protocol==="file:")if(r)E.file=r(b);else throw new Error("file: protocol is not available in this PostCSS build");let M=w.sourceContentFor(C.source);return M&&(E.source=M),E}toJSON(){let p={};for(let g of["hasBOM","css","file","id"])this[g]!=null&&(p[g]=this[g]);return this.map&&(p.map=P({},this.map),p.map.consumerCache&&(p.map.consumerCache=void 0)),p}get from(){return this.file||this.id}}return Tr=f,f.default=f,u&&u.registerInput&&u.registerInput(f),Tr}var _r,Vi;function Jn(){if(Vi)return _r;Vi=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=ge,{dirname:r,relative:s,resolve:i,sep:o}=ge,{pathToFileURL:a}=ge,u=jt(),l=!!(e&&t),c=!!(r&&i&&s&&o);class n{constructor(h,f,m,p){this.stringify=h,this.mapOpts=m.map||{},this.root=f,this.opts=m,this.css=p,this.originalCSS=p,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let h;this.isInline()?h="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?h=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?h=this.mapOpts.annotation(this.opts.to,this.root):h=this.outputFile()+".map";let f=`
56
+ `);return o=l[l.length-1],o=o.replace(/\S/g,""),!1}}),o}rawSemicolon(i){let o;return i.walk(a=>{if(a.nodes&&a.nodes.length&&a.last.type==="decl"&&(o=a.raws.semicolon,typeof o!="undefined"))return!1}),o}rawValue(i,o){let a=i[o],u=i.raws[o];return u&&u.value===a?u.raw:a}root(i){this.body(i),i.raws.after&&this.builder(i.raws.after)}rule(i){this.block(i,this.rawValue(i,"selector")),i.raws.ownSemicolon&&this.builder(i.raws.ownSemicolon,i,"end")}stringify(i,o){if(!this[i.type])throw new Error("Unknown AST node type "+i.type+". Maybe you need to change PostCSS stringifier.");this[i.type](i,o)}}return kr=r,r.default=r,kr}var Lr,Ji;function Zt(){if(Ji)return Lr;Ji=1;let e=oo();function t(r,s){new e(s).stringify(r)}return Lr=t,t.default=t,Lr}var Fr,Qi;function Kt(){if(Qi)return Fr;Qi=1;let{isClean:e,my:t}=Ts(),r=Ds(),s=oo(),i=Zt();function o(u,l){let c=new u.constructor;for(let n in u){if(!Object.prototype.hasOwnProperty.call(u,n)||n==="proxyCache")continue;let d=u[n],h=typeof d;n==="parent"&&h==="object"?l&&(c[n]=l):n==="source"?c[n]=d:Array.isArray(d)?c[n]=d.map(f=>o(f,c)):(h==="object"&&d!==null&&(d=o(d)),c[n]=d)}return c}class a{constructor(l={}){this.raws={},this[e]=!1,this[t]=!0;for(let c in l)if(c==="nodes"){this.nodes=[];for(let n of l[c])typeof n.clone=="function"?this.append(n.clone()):this.append(n)}else this[c]=l[c]}addToError(l){if(l.postcssNode=this,l.stack&&this.source&&/\n\s{4}at /.test(l.stack)){let c=this.source;l.stack=l.stack.replace(/\n\s{4}at /,`$&${c.input.from}:${c.start.line}:${c.start.column}$&`)}return l}after(l){return this.parent.insertAfter(this,l),this}assign(l={}){for(let c in l)this[c]=l[c];return this}before(l){return this.parent.insertBefore(this,l),this}cleanRaws(l){delete this.raws.before,delete this.raws.after,l||delete this.raws.between}clone(l={}){let c=o(this);for(let n in l)c[n]=l[n];return c}cloneAfter(l={}){let c=this.clone(l);return this.parent.insertAfter(this,c),c}cloneBefore(l={}){let c=this.clone(l);return this.parent.insertBefore(this,c),c}error(l,c={}){if(this.source){let{end:n,start:d}=this.rangeBy(c);return this.source.input.error(l,{column:d.column,line:d.line},{column:n.column,line:n.line},c)}return new r(l)}getProxyProcessor(){return{get(l,c){return c==="proxyOf"?l:c==="root"?()=>l.root().toProxy():l[c]},set(l,c,n){return l[c]===n||(l[c]=n,(c==="prop"||c==="value"||c==="name"||c==="params"||c==="important"||c==="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,c){let n=this.source.start;if(l.index)n=this.positionInside(l.index,c);else if(l.word){c=this.toString();let d=c.indexOf(l.word);d!==-1&&(n=this.positionInside(d,c))}return n}positionInside(l,c){let n=c||this.toString(),d=this.source.start.column,h=this.source.start.line;for(let f=0;f<l;f++)n[f]===`
57
+ `?(d=1,h+=1):d+=1;return{column:d,line:h}}prev(){if(!this.parent)return;let l=this.parent.index(this);return this.parent.nodes[l-1]}rangeBy(l){let c={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:c.column+1,line:c.line};if(l.word){let d=this.toString(),h=d.indexOf(l.word);h!==-1&&(c=this.positionInside(h,d),n=this.positionInside(h+l.word.length,d))}else l.start?c={column:l.start.column,line:l.start.line}:l.index&&(c=this.positionInside(l.index)),l.end?n={column:l.end.column,line:l.end.line}:typeof l.endIndex=="number"?n=this.positionInside(l.endIndex):l.index&&(n=this.positionInside(l.index+1));return(n.line<c.line||n.line===c.line&&n.column<=c.column)&&(n={column:c.column+1,line:c.line}),{end:n,start:c}}raw(l,c){return new s().raw(this,l,c)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...l){if(this.parent){let c=this,n=!1;for(let d of l)d===this?n=!0:n?(this.parent.insertAfter(c,d),c=d):this.parent.insertBefore(c,d);n||this.remove()}return this}root(){let l=this;for(;l.parent&&l.parent.type!=="document";)l=l.parent;return l}toJSON(l,c){let n={},d=c==null;c=c||new Map;let h=0;for(let f in this){if(!Object.prototype.hasOwnProperty.call(this,f)||f==="parent"||f==="proxyCache")continue;let m=this[f];if(Array.isArray(m))n[f]=m.map(p=>typeof p=="object"&&p.toJSON?p.toJSON(null,c):p);else if(typeof m=="object"&&m.toJSON)n[f]=m.toJSON(null,c);else if(f==="source"){let p=c.get(m.input);p==null&&(p=h,c.set(m.input,h),h++),n[f]={end:m.end,inputId:p,start:m.start}}else n[f]=m}return d&&(n.inputs=[...c.keys()].map(f=>f.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(l=i){l.stringify&&(l=l.stringify);let c="";return l(this,n=>{c+=n}),c}warn(l,c,n){let d={node:this};for(let h in n)d[h]=n[h];return l.warn(c,d)}get proxyOf(){return this}}return Fr=a,a.default=a,Fr}var Ur,Zi;function er(){if(Zi)return Ur;Zi=1;let e=Kt();class t extends e{constructor(s){s&&typeof s.value!="undefined"&&typeof s.value!="string"&&(s=se(k({},s),{value:String(s.value)})),super(s),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}}return Ur=t,t.default=t,Ur}var Wr,Ki;function Ol(){if(Ki)return Wr;Ki=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return Wr={nanoid:(s=21)=>{let i="",o=s;for(;o--;)i+=e[Math.random()*64|0];return i},customAlphabet:(s,i=21)=>(o=i)=>{let a="",u=o;for(;u--;)a+=s[Math.random()*s.length|0];return a}},Wr}var Br,en;function ao(){if(en)return Br;en=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=we,{existsSync:r,readFileSync:s}=we,{dirname:i,join:o}=we;function a(l){return Buffer?Buffer.from(l,"base64").toString():window.atob(l)}class u{constructor(c,n){if(n.map===!1)return;this.loadAnnotation(c),this.inline=this.startWith(this.annotation,"data:");let d=n.map?n.map.prev:void 0,h=this.loadMap(n.from,d);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=i(this.mapFile)),h&&(this.text=h)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(c){let n=/^data:application\/json;charset=utf-?8;base64,/,d=/^data:application\/json;base64,/,h=/^data:application\/json;charset=utf-?8,/,f=/^data:application\/json,/;if(h.test(c)||f.test(c))return decodeURIComponent(c.substr(RegExp.lastMatch.length));if(n.test(c)||d.test(c))return a(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 n=c.match(/\/\*\s*# sourceMappingURL=/gm);if(!n)return;let d=c.lastIndexOf(n.pop()),h=c.indexOf("*/",d);d>-1&&h>-1&&(this.annotation=this.getAnnotationURL(c.substring(d,h)))}loadFile(c){if(this.root=i(c),r(c))return this.mapFile=c,s(c,"utf-8").toString().trim()}loadMap(c,n){if(n===!1)return!1;if(n){if(typeof n=="string")return n;if(typeof n=="function"){let d=n(c);if(d){let h=this.loadFile(d);if(!h)throw new Error("Unable to load previous source map: "+d.toString());return h}}else{if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let d=this.annotation;return c&&(d=o(i(c),d)),this.loadFile(d)}}}startWith(c,n){return c?c.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Br=u,u.default=u,Br}var $r,tn;function tr(){if(tn)return $r;tn=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=we,{fileURLToPath:r,pathToFileURL:s}=we,{isAbsolute:i,resolve:o}=we,{nanoid:a}=Ol(),u=we,l=Ds(),c=ao(),n=Symbol("fromOffsetCache"),d=!!(e&&t),h=!!(o&&i);class f{constructor(p,g={}){if(p===null||typeof p=="undefined"||typeof p=="object"&&!p.toString)throw new Error(`PostCSS received ${p} instead of CSS string`);if(this.css=p.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,g.from&&(!h||/^\w+:\/\//.test(g.from)||i(g.from)?this.file=g.from:this.file=o(g.from)),h&&d){let v=new c(this.css,g);if(v.text){this.map=v;let y=v.consumer().file;!this.file&&y&&(this.file=this.mapResolve(y))}}this.file||(this.id="<input css "+a(6)+">"),this.map&&(this.map.file=this.from)}error(p,g,v,y={}){let w,C,S;if(g&&typeof g=="object"){let E=g,R=v;if(typeof E.offset=="number"){let I=this.fromOffset(E.offset);g=I.line,v=I.col}else g=E.line,v=E.column;if(typeof R.offset=="number"){let I=this.fromOffset(R.offset);C=I.line,S=I.col}else C=R.line,S=R.column}else if(!v){let E=this.fromOffset(g);g=E.line,v=E.col}let b=this.origin(g,v,C,S);return b?w=new l(p,b.endLine===void 0?b.line:{column:b.column,line:b.line},b.endLine===void 0?b.column:{column:b.endColumn,line:b.endLine},b.source,b.file,y.plugin):w=new l(p,C===void 0?g:{column:v,line:g},C===void 0?v:{column:S,line:C},this.css,this.file,y.plugin),w.input={column:v,endColumn:S,endLine:C,line:g,source:this.css},this.file&&(s&&(w.input.url=s(this.file).toString()),w.input.file=this.file),w}fromOffset(p){let g,v;if(this[n])v=this[n];else{let w=this.css.split(`
58
+ `);v=new Array(w.length);let C=0;for(let S=0,b=w.length;S<b;S++)v[S]=C,C+=w[S].length+1;this[n]=v}g=v[v.length-1];let y=0;if(p>=g)y=v.length-1;else{let w=v.length-2,C;for(;y<w;)if(C=y+(w-y>>1),p<v[C])w=C-1;else if(p>=v[C+1])y=C+1;else{y=C;break}}return{col:p-v[y]+1,line:y+1}}mapResolve(p){return/^\w+:\/\//.test(p)?p:o(this.map.consumer().sourceRoot||this.map.root||".",p)}origin(p,g,v,y){if(!this.map)return!1;let w=this.map.consumer(),C=w.originalPositionFor({column:g,line:p});if(!C.source)return!1;let S;typeof v=="number"&&(S=w.originalPositionFor({column:y,line:v}));let b;i(C.source)?b=s(C.source):b=new URL(C.source,this.map.consumer().sourceRoot||s(this.map.mapFile));let E={column:C.column,endColumn:S&&S.column,endLine:S&&S.line,line:C.line,url:b.toString()};if(b.protocol==="file:")if(r)E.file=r(b);else throw new Error("file: protocol is not available in this PostCSS build");let R=w.sourceContentFor(C.source);return R&&(E.source=R),E}toJSON(){let p={};for(let g of["hasBOM","css","file","id"])this[g]!=null&&(p[g]=this[g]);return this.map&&(p.map=k({},this.map),p.map.consumerCache&&(p.map.consumerCache=void 0)),p}get from(){return this.file||this.id}}return $r=f,f.default=f,u&&u.registerInput&&u.registerInput(f),$r}var zr,rn;function lo(){if(rn)return zr;rn=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=we,{dirname:r,relative:s,resolve:i,sep:o}=we,{pathToFileURL:a}=we,u=tr(),l=!!(e&&t),c=!!(r&&i&&s&&o);class n{constructor(h,f,m,p){this.stringify=h,this.mapOpts=m.map||{},this.root=f,this.opts=m,this.css=p,this.originalCSS=p,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let h;this.isInline()?h="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?h=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?h=this.mapOpts.annotation(this.opts.to,this.root):h=this.outputFile()+".map";let f=`
59
59
  `;this.css.includes(`\r
60
60
  `)&&(f=`\r
61
61
  `),this.css+=f+"/*# sourceMappingURL="+h+" */"}applyPrevMaps(){for(let h of this.previous()){let f=this.toUrl(this.path(h.file)),m=h.root||r(h.file),p;this.mapOpts.sourcesContent===!1?(p=new e(h.text),p.sourcesContent&&(p.sourcesContent=null)):p=h.consumer(),this.map.applySourceMap(p,f,this.toUrl(this.path(m)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let h;for(let f=this.root.nodes.length-1;f>=0;f--)h=this.root.nodes[f],h.type==="comment"&&h.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(f)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),c&&l&&this.isMap())return this.generateMap();{let h="";return this.stringify(this.root,f=>{h+=f}),[h]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let h=this.previous()[0].consumer();h.file=this.outputFile(),this.map=t.fromSourceMap(h,{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 h=1,f=1,m="<no source>",p={generated:{column:0,line:0},original:{column:0,line:0},source:""},g,v;this.stringify(this.root,(y,w,C)=>{if(this.css+=y,w&&C!=="end"&&(p.generated.line=h,p.generated.column=f-1,w.source&&w.source.start?(p.source=this.sourcePath(w),p.original.line=w.source.start.line,p.original.column=w.source.start.column-1,this.map.addMapping(p)):(p.source=m,p.original.line=1,p.original.column=0,this.map.addMapping(p))),g=y.match(/\n/g),g?(h+=g.length,v=y.lastIndexOf(`
62
- `),f=y.length-v):f+=y.length,w&&C!=="start"){let S=w.parent||{raws:{}};(!(w.type==="decl"||w.type==="atrule"&&!w.nodes)||w!==S.last||S.raws.semicolon)&&(w.source&&w.source.end?(p.source=this.sourcePath(w),p.original.line=w.source.end.line,p.original.column=w.source.end.column-1,p.generated.line=h,p.generated.column=f-2,this.map.addMapping(p)):(p.source=m,p.original.line=1,p.original.column=0,p.generated.line=h,p.generated.column=f-1,this.map.addMapping(p)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation!="undefined"?this.mapOpts.annotation:this.previous().length?this.previous().some(h=>h.annotation):!0}isInline(){if(typeof this.mapOpts.inline!="undefined")return this.mapOpts.inline;let h=this.mapOpts.annotation;return typeof h!="undefined"&&h!==!0?!1:this.previous().length?this.previous().some(f=>f.inline):!0}isMap(){return typeof this.opts.map!="undefined"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent!="undefined"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(h=>h.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(h){if(this.mapOpts.absolute||h.charCodeAt(0)===60||/^\w+:\/\//.test(h))return h;let f=this.memoizedPaths.get(h);if(f)return f;let m=this.opts.to?r(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(m=r(i(m,this.mapOpts.annotation)));let p=s(m,h);return this.memoizedPaths.set(h,p),p}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(h=>{if(h.source&&h.source.input.map){let f=h.source.input.map;this.previousMaps.includes(f)||this.previousMaps.push(f)}});else{let h=new u(this.originalCSS,this.opts);h.map&&this.previousMaps.push(h.map)}return this.previousMaps}setSourcesContent(){let h={};if(this.root)this.root.walk(f=>{if(f.source){let m=f.source.input.from;if(m&&!h[m]){h[m]=!0;let p=this.usesFileUrls?this.toFileUrl(m):this.toUrl(this.path(m));this.map.setSourceContent(p,f.source.input.css)}}});else if(this.css){let f=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(f,this.css)}}sourcePath(h){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(h.source.input.from):this.toUrl(this.path(h.source.input.from))}toBase64(h){return Buffer?Buffer.from(h).toString("base64"):window.btoa(unescape(encodeURIComponent(h)))}toFileUrl(h){let f=this.memoizedFileURLs.get(h);if(f)return f;if(a){let m=a(h).toString();return this.memoizedFileURLs.set(h,m),m}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(h){let f=this.memoizedURLs.get(h);if(f)return f;o==="\\"&&(h=h.replace(/\\/g,"/"));let m=encodeURI(h).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(h,m),m}}return _r=n,_r}var kr,qi;function Gt(){if(qi)return kr;qi=1;let e=Vt();class t extends e{constructor(s){super(s),this.type="comment"}}return kr=t,t.default=t,kr}var Pr,ji;function Le(){if(ji)return Pr;ji=1;let{isClean:e,my:t}=bs(),r=qt(),s=Gt(),i=Vt(),o,a,u,l;function c(h){return h.map(f=>(f.nodes&&(f.nodes=c(f.nodes)),delete f.source,f))}function n(h){if(h[e]=!1,h.proxyOf.nodes)for(let f of h.proxyOf.nodes)n(f)}class d extends i{append(...f){for(let m of f){let p=this.normalize(m,this.last);for(let g of p)this.proxyOf.nodes.push(g)}return this.markDirty(),this}cleanRaws(f){if(super.cleanRaws(f),this.nodes)for(let m of this.nodes)m.cleanRaws(f)}each(f){if(!this.proxyOf.nodes)return;let m=this.getIterator(),p,g;for(;this.indexes[m]<this.proxyOf.nodes.length&&(p=this.indexes[m],g=f(this.proxyOf.nodes[p],p),g!==!1);)this.indexes[m]+=1;return delete this.indexes[m],g}every(f){return this.nodes.every(f)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let f=this.lastEach;return this.indexes[f]=0,f}getProxyProcessor(){return{get(f,m){return m==="proxyOf"?f:f[m]?m==="each"||typeof m=="string"&&m.startsWith("walk")?(...p)=>f[m](...p.map(g=>typeof g=="function"?(v,y)=>g(v.toProxy(),y):g)):m==="every"||m==="some"?p=>f[m]((g,...v)=>p(g.toProxy(),...v)):m==="root"?()=>f.root().toProxy():m==="nodes"?f.nodes.map(p=>p.toProxy()):m==="first"||m==="last"?f[m].toProxy():f[m]:f[m]},set(f,m,p){return f[m]===p||(f[m]=p,(m==="name"||m==="params"||m==="selector")&&f.markDirty()),!0}}}index(f){return typeof f=="number"?f:(f.proxyOf&&(f=f.proxyOf),this.proxyOf.nodes.indexOf(f))}insertAfter(f,m){let p=this.index(f),g=this.normalize(m,this.proxyOf.nodes[p]).reverse();p=this.index(f);for(let y of g)this.proxyOf.nodes.splice(p+1,0,y);let v;for(let y in this.indexes)v=this.indexes[y],p<v&&(this.indexes[y]=v+g.length);return this.markDirty(),this}insertBefore(f,m){let p=this.index(f),g=p===0?"prepend":!1,v=this.normalize(m,this.proxyOf.nodes[p],g).reverse();p=this.index(f);for(let w of v)this.proxyOf.nodes.splice(p,0,w);let y;for(let w in this.indexes)y=this.indexes[w],p<=y&&(this.indexes[w]=y+v.length);return this.markDirty(),this}normalize(f,m){if(typeof f=="string")f=c(o(f).nodes);else if(typeof f=="undefined")f=[];else if(Array.isArray(f)){f=f.slice(0);for(let g of f)g.parent&&g.parent.removeChild(g,"ignore")}else if(f.type==="root"&&this.type!=="document"){f=f.nodes.slice(0);for(let g of f)g.parent&&g.parent.removeChild(g,"ignore")}else if(f.type)f=[f];else if(f.prop){if(typeof f.value=="undefined")throw new Error("Value field is missed in node creation");typeof f.value!="string"&&(f.value=String(f.value)),f=[new r(f)]}else if(f.selector)f=[new a(f)];else if(f.name)f=[new u(f)];else if(f.text)f=[new s(f)];else throw new Error("Unknown node type in node creation");return f.map(g=>(g[t]||d.rebuild(g),g=g.proxyOf,g.parent&&g.parent.removeChild(g),g[e]&&n(g),typeof g.raws.before=="undefined"&&m&&typeof m.raws.before!="undefined"&&(g.raws.before=m.raws.before.replace(/\S/g,"")),g.parent=this.proxyOf,g))}prepend(...f){f=f.reverse();for(let m of f){let p=this.normalize(m,this.first,"prepend").reverse();for(let g of p)this.proxyOf.nodes.unshift(g);for(let g in this.indexes)this.indexes[g]=this.indexes[g]+p.length}return this.markDirty(),this}push(f){return f.parent=this,this.proxyOf.nodes.push(f),this}removeAll(){for(let f of this.proxyOf.nodes)f.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(f){f=this.index(f),this.proxyOf.nodes[f].parent=void 0,this.proxyOf.nodes.splice(f,1);let m;for(let p in this.indexes)m=this.indexes[p],m>=f&&(this.indexes[p]=m-1);return this.markDirty(),this}replaceValues(f,m,p){return p||(p=m,m={}),this.walkDecls(g=>{m.props&&!m.props.includes(g.prop)||m.fast&&!g.value.includes(m.fast)||(g.value=g.value.replace(f,p))}),this.markDirty(),this}some(f){return this.nodes.some(f)}walk(f){return this.each((m,p)=>{let g;try{g=f(m,p)}catch(v){throw m.addToError(v)}return g!==!1&&m.walk&&(g=m.walk(f)),g})}walkAtRules(f,m){return m?f instanceof RegExp?this.walk((p,g)=>{if(p.type==="atrule"&&f.test(p.name))return m(p,g)}):this.walk((p,g)=>{if(p.type==="atrule"&&p.name===f)return m(p,g)}):(m=f,this.walk((p,g)=>{if(p.type==="atrule")return m(p,g)}))}walkComments(f){return this.walk((m,p)=>{if(m.type==="comment")return f(m,p)})}walkDecls(f,m){return m?f instanceof RegExp?this.walk((p,g)=>{if(p.type==="decl"&&f.test(p.prop))return m(p,g)}):this.walk((p,g)=>{if(p.type==="decl"&&p.prop===f)return m(p,g)}):(m=f,this.walk((p,g)=>{if(p.type==="decl")return m(p,g)}))}walkRules(f,m){return m?f instanceof RegExp?this.walk((p,g)=>{if(p.type==="rule"&&f.test(p.selector))return m(p,g)}):this.walk((p,g)=>{if(p.type==="rule"&&p.selector===f)return m(p,g)}):(m=f,this.walk((p,g)=>{if(p.type==="rule")return m(p,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 d.registerParse=h=>{o=h},d.registerRule=h=>{a=h},d.registerAtRule=h=>{u=h},d.registerRoot=h=>{l=h},Pr=d,d.default=d,d.rebuild=h=>{h.type==="atrule"?Object.setPrototypeOf(h,u.prototype):h.type==="rule"?Object.setPrototypeOf(h,a.prototype):h.type==="decl"?Object.setPrototypeOf(h,r.prototype):h.type==="comment"?Object.setPrototypeOf(h,s.prototype):h.type==="root"&&Object.setPrototypeOf(h,l.prototype),h[t]=!0,h.nodes&&h.nodes.forEach(f=>{d.rebuild(f)})},Pr}var Lr,Gi;function Cs(){if(Gi)return Lr;Gi=1;let e=Le(),t,r;class s extends e{constructor(o){super(P({type:"document"},o)),this.nodes||(this.nodes=[])}toResult(o={}){return new t(new r,this,o).stringify()}}return s.registerLazyResult=i=>{t=i},s.registerProcessor=i=>{r=i},Lr=s,s.default=s,Lr}var Fr,Hi;function Qn(){if(Hi)return Fr;Hi=1;let e={};return Fr=function(r){e[r]||(e[r]=!0,typeof console!="undefined"&&console.warn&&console.warn(r))},Fr}var Ur,Yi;function Zn(){if(Yi)return Ur;Yi=1;class e{constructor(r,s={}){if(this.type="warning",this.text=r,s.node&&s.node.source){let i=s.node.rangeBy(s);this.line=i.start.line,this.column=i.start.column,this.endLine=i.end.line,this.endColumn=i.end.column}for(let i in s)this[i]=s[i]}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 Ur=e,e.default=e,Ur}var Br,Xi;function Es(){if(Xi)return Br;Xi=1;let e=Zn();class t{constructor(s,i,o){this.processor=s,this.messages=[],this.root=i,this.opts=o,this.css=void 0,this.map=void 0}toString(){return this.css}warn(s,i={}){i.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(i.plugin=this.lastPlugin.postcssPlugin);let o=new e(s,i);return this.messages.push(o),o}warnings(){return this.messages.filter(s=>s.type==="warning")}get content(){return this.css}}return Br=t,t.default=t,Br}var Wr,Ji;function ml(){if(Ji)return Wr;Ji=1;const e=39,t=34,r=92,s=47,i=10,o=32,a=12,u=9,l=13,c=91,n=93,d=40,h=41,f=123,m=125,p=59,g=42,v=58,y=64,w=/[\t\n\f\r "#'()/;[\\\]{}]/g,C=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,b=/[\da-f]/i;return Wr=function(M,I={}){let N=M.css.valueOf(),F=I.ignoreErrors,T,x,ue,ae,q,k,X,te,Z,G,Re=N.length,O=0,we=[],fe=[];function Ze(){return O}function le(L){throw M.error("Unclosed "+L,O)}function de(){return fe.length===0&&O>=Re}function _e(L){if(fe.length)return fe.pop();if(O>=Re)return;let re=L?L.ignoreUnclosed:!1;switch(T=N.charCodeAt(O),T){case i:case o:case u:case l:case a:{x=O;do x+=1,T=N.charCodeAt(x);while(T===o||T===i||T===u||T===l||T===a);G=["space",N.slice(O,x)],O=x-1;break}case c:case n:case f:case m:case v:case p:case h:{let j=String.fromCharCode(T);G=[j,j,O];break}case d:{if(te=we.length?we.pop()[1]:"",Z=N.charCodeAt(O+1),te==="url"&&Z!==e&&Z!==t&&Z!==o&&Z!==i&&Z!==u&&Z!==a&&Z!==l){x=O;do{if(k=!1,x=N.indexOf(")",x+1),x===-1)if(F||re){x=O;break}else le("bracket");for(X=x;N.charCodeAt(X-1)===r;)X-=1,k=!k}while(k);G=["brackets",N.slice(O,x+1),O,x],O=x}else x=N.indexOf(")",O+1),ae=N.slice(O,x+1),x===-1||S.test(ae)?G=["(","(",O]:(G=["brackets",ae,O,x],O=x);break}case e:case t:{ue=T===e?"'":'"',x=O;do{if(k=!1,x=N.indexOf(ue,x+1),x===-1)if(F||re){x=O+1;break}else le("string");for(X=x;N.charCodeAt(X-1)===r;)X-=1,k=!k}while(k);G=["string",N.slice(O,x+1),O,x],O=x;break}case y:{w.lastIndex=O+1,w.test(N),w.lastIndex===0?x=N.length-1:x=w.lastIndex-2,G=["at-word",N.slice(O,x+1),O,x],O=x;break}case r:{for(x=O,q=!0;N.charCodeAt(x+1)===r;)x+=1,q=!q;if(T=N.charCodeAt(x+1),q&&T!==s&&T!==o&&T!==i&&T!==u&&T!==l&&T!==a&&(x+=1,b.test(N.charAt(x)))){for(;b.test(N.charAt(x+1));)x+=1;N.charCodeAt(x+1)===o&&(x+=1)}G=["word",N.slice(O,x+1),O,x],O=x;break}default:{T===s&&N.charCodeAt(O+1)===g?(x=N.indexOf("*/",O+2)+1,x===0&&(F||re?x=N.length:le("comment")),G=["comment",N.slice(O,x+1),O,x],O=x):(C.lastIndex=O+1,C.test(N),C.lastIndex===0?x=N.length-1:x=C.lastIndex-2,G=["word",N.slice(O,x+1),O,x],we.push(G),O=x);break}}return O++,G}function Me(L){fe.push(L)}return{back:Me,endOfFile:de,nextToken:_e,position:Ze}},Wr}var $r,Qi;function xs(){if(Qi)return $r;Qi=1;let e=Le();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 $r=t,t.default=t,e.registerAtRule(t),$r}var zr,Zi;function ot(){if(Zi)return zr;Zi=1;let e=Le(),t,r;class s extends e{constructor(o){super(o),this.type="root",this.nodes||(this.nodes=[])}normalize(o,a,u){let l=super.normalize(o);if(a){if(u==="prepend")this.nodes.length>1?a.raws.before=this.nodes[1].raws.before:delete a.raws.before;else if(this.first!==a)for(let c of l)c.raws.before=a.raws.before}return l}removeChild(o,a){let u=this.index(o);return!a&&u===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[u].raws.before),super.removeChild(o)}toResult(o={}){return new t(new r,this,o).stringify()}}return s.registerLazyResult=i=>{t=i},s.registerProcessor=i=>{r=i},zr=s,s.default=s,e.registerRoot(s),zr}var Vr,Ki;function Kn(){if(Ki)return Vr;Ki=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let r=[" ",`
63
- `," "];return e.split(t,r)},split(t,r,s){let i=[],o="",a=!1,u=0,l=!1,c="",n=!1;for(let d of t)n?n=!1:d==="\\"?n=!0:l?d===c&&(l=!1):d==='"'||d==="'"?(l=!0,c=d):d==="("?u+=1:d===")"?u>0&&(u-=1):u===0&&r.includes(d)&&(a=!0),a?(o!==""&&i.push(o.trim()),o="",a=!1):o+=d;return(s||o!=="")&&i.push(o.trim()),i}};return Vr=e,e.default=e,Vr}var qr,en;function Rs(){if(en)return qr;en=1;let e=Le(),t=Kn();class r extends e{constructor(i){super(i),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(i){let o=this.selector?this.selector.match(/,\s*/):null,a=o?o[0]:","+this.raw("between","beforeOpen");this.selector=i.join(a)}}return qr=r,r.default=r,e.registerRule(r),qr}var jr,tn;function gl(){if(tn)return jr;tn=1;let e=qt(),t=ml(),r=Gt(),s=xs(),i=ot(),o=Rs();const a={empty:!0,space:!0};function u(c){for(let n=c.length-1;n>=0;n--){let d=c[n],h=d[3]||d[2];if(h)return h}}class l{constructor(n){this.input=n,this.root=new i,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:n,start:{column:1,line:1,offset:0}}}atrule(n){let d=new s;d.name=n[1].slice(1),d.name===""&&this.unnamedAtrule(d,n),this.init(d,n[2]);let h,f,m,p=!1,g=!1,v=[],y=[];for(;!this.tokenizer.endOfFile();){if(n=this.tokenizer.nextToken(),h=n[0],h==="("||h==="["?y.push(h==="("?")":"]"):h==="{"&&y.length>0?y.push("}"):h===y[y.length-1]&&y.pop(),y.length===0)if(h===";"){d.source.end=this.getPosition(n[2]),d.source.end.offset++,this.semicolon=!0;break}else if(h==="{"){g=!0;break}else if(h==="}"){if(v.length>0){for(m=v.length-1,f=v[m];f&&f[0]==="space";)f=v[--m];f&&(d.source.end=this.getPosition(f[3]||f[2]),d.source.end.offset++)}this.end(n);break}else v.push(n);else v.push(n);if(this.tokenizer.endOfFile()){p=!0;break}}d.raws.between=this.spacesAndCommentsFromEnd(v),v.length?(d.raws.afterName=this.spacesAndCommentsFromStart(v),this.raw(d,"params",v),p&&(n=v[v.length-1],d.source.end=this.getPosition(n[3]||n[2]),d.source.end.offset++,this.spaces=d.raws.between,d.raws.between="")):(d.raws.afterName="",d.params=""),g&&(d.nodes=[],this.current=d)}checkMissedSemicolon(n){let d=this.colon(n);if(d===!1)return;let h=0,f;for(let m=d-1;m>=0&&(f=n[m],!(f[0]!=="space"&&(h+=1,h===2)));m--);throw this.input.error("Missed semicolon",f[0]==="word"?f[3]+1:f[2])}colon(n){let d=0,h,f,m;for(let[p,g]of n.entries()){if(h=g,f=h[0],f==="("&&(d+=1),f===")"&&(d-=1),d===0&&f===":")if(!m)this.doubleColon(h);else{if(m[0]==="word"&&m[1]==="progid")continue;return p}m=h}return!1}comment(n){let d=new r;this.init(d,n[2]),d.source.end=this.getPosition(n[3]||n[2]),d.source.end.offset++;let h=n[1].slice(2,-2);if(/^\s*$/.test(h))d.text="",d.raws.left=h,d.raws.right="";else{let f=h.match(/^(\s*)([^]*\S)(\s*)$/);d.text=f[2],d.raws.left=f[1],d.raws.right=f[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(n,d){let h=new e;this.init(h,n[0][2]);let f=n[n.length-1];for(f[0]===";"&&(this.semicolon=!0,n.pop()),h.source.end=this.getPosition(f[3]||f[2]||u(n)),h.source.end.offset++;n[0][0]!=="word";)n.length===1&&this.unknownWord(n),h.raws.before+=n.shift()[1];for(h.source.start=this.getPosition(n[0][2]),h.prop="";n.length;){let y=n[0][0];if(y===":"||y==="space"||y==="comment")break;h.prop+=n.shift()[1]}h.raws.between="";let m;for(;n.length;)if(m=n.shift(),m[0]===":"){h.raws.between+=m[1];break}else m[0]==="word"&&/\w/.test(m[1])&&this.unknownWord([m]),h.raws.between+=m[1];(h.prop[0]==="_"||h.prop[0]==="*")&&(h.raws.before+=h.prop[0],h.prop=h.prop.slice(1));let p=[],g;for(;n.length&&(g=n[0][0],!(g!=="space"&&g!=="comment"));)p.push(n.shift());this.precheckMissedSemicolon(n);for(let y=n.length-1;y>=0;y--){if(m=n[y],m[1].toLowerCase()==="!important"){h.important=!0;let w=this.stringFrom(n,y);w=this.spacesFromEnd(n)+w,w!==" !important"&&(h.raws.important=w);break}else if(m[1].toLowerCase()==="important"){let w=n.slice(0),C="";for(let S=y;S>0;S--){let b=w[S][0];if(C.trim().indexOf("!")===0&&b!=="space")break;C=w.pop()[1]+C}C.trim().indexOf("!")===0&&(h.important=!0,h.raws.important=C,n=w)}if(m[0]!=="space"&&m[0]!=="comment")break}n.some(y=>y[0]!=="space"&&y[0]!=="comment")&&(h.raws.between+=p.map(y=>y[1]).join(""),p=[]),this.raw(h,"value",p.concat(n),d),h.value.includes(":")&&!d&&this.checkMissedSemicolon(n)}doubleColon(n){throw this.input.error("Double colon",{offset:n[2]},{offset:n[2]+n[1].length})}emptyRule(n){let d=new o;this.init(d,n[2]),d.selector="",d.raws.between="",this.current=d}end(n){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(n[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(n)}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(n){if(this.spaces+=n[1],this.current.nodes){let d=this.current.nodes[this.current.nodes.length-1];d&&d.type==="rule"&&!d.raws.ownSemicolon&&(d.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(n){let d=this.input.fromOffset(n);return{column:d.col,line:d.line,offset:n}}init(n,d){this.current.push(n),n.source={input:this.input,start:this.getPosition(d)},n.raws.before=this.spaces,this.spaces="",n.type!=="comment"&&(this.semicolon=!1)}other(n){let d=!1,h=null,f=!1,m=null,p=[],g=n[1].startsWith("--"),v=[],y=n;for(;y;){if(h=y[0],v.push(y),h==="("||h==="[")m||(m=y),p.push(h==="("?")":"]");else if(g&&f&&h==="{")m||(m=y),p.push("}");else if(p.length===0)if(h===";")if(f){this.decl(v,g);return}else break;else if(h==="{"){this.rule(v);return}else if(h==="}"){this.tokenizer.back(v.pop()),d=!0;break}else h===":"&&(f=!0);else h===p[p.length-1]&&(p.pop(),p.length===0&&(m=null));y=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(d=!0),p.length>0&&this.unclosedBracket(m),d&&f){if(!g)for(;v.length&&(y=v[v.length-1][0],!(y!=="space"&&y!=="comment"));)this.tokenizer.back(v.pop());this.decl(v,g)}else this.unknownWord(v)}parse(){let n;for(;!this.tokenizer.endOfFile();)switch(n=this.tokenizer.nextToken(),n[0]){case"space":this.spaces+=n[1];break;case";":this.freeSemicolon(n);break;case"}":this.end(n);break;case"comment":this.comment(n);break;case"at-word":this.atrule(n);break;case"{":this.emptyRule(n);break;default:this.other(n);break}this.endFile()}precheckMissedSemicolon(){}raw(n,d,h,f){let m,p,g=h.length,v="",y=!0,w,C;for(let S=0;S<g;S+=1)m=h[S],p=m[0],p==="space"&&S===g-1&&!f?y=!1:p==="comment"?(C=h[S-1]?h[S-1][0]:"empty",w=h[S+1]?h[S+1][0]:"empty",!a[C]&&!a[w]?v.slice(-1)===","?y=!1:v+=m[1]:y=!1):v+=m[1];if(!y){let S=h.reduce((b,E)=>b+E[1],"");n.raws[d]={raw:S,value:v}}n[d]=v}rule(n){n.pop();let d=new o;this.init(d,n[0][2]),d.raws.between=this.spacesAndCommentsFromEnd(n),this.raw(d,"selector",n),this.current=d}spacesAndCommentsFromEnd(n){let d,h="";for(;n.length&&(d=n[n.length-1][0],!(d!=="space"&&d!=="comment"));)h=n.pop()[1]+h;return h}spacesAndCommentsFromStart(n){let d,h="";for(;n.length&&(d=n[0][0],!(d!=="space"&&d!=="comment"));)h+=n.shift()[1];return h}spacesFromEnd(n){let d,h="";for(;n.length&&(d=n[n.length-1][0],d==="space");)h=n.pop()[1]+h;return h}stringFrom(n,d){let h="";for(let f=d;f<n.length;f++)h+=n[f][1];return n.splice(d,n.length-d),h}unclosedBlock(){let n=this.current.source.start;throw this.input.error("Unclosed block",n.line,n.column)}unclosedBracket(n){throw this.input.error("Unclosed bracket",{offset:n[2]},{offset:n[2]+1})}unexpectedClose(n){throw this.input.error("Unexpected }",{offset:n[2]},{offset:n[2]+1})}unknownWord(n){throw this.input.error("Unknown word",{offset:n[0][2]},{offset:n[0][2]+n[0][1].length})}unnamedAtrule(n,d){throw this.input.error("At-rule without name",{offset:d[2]},{offset:d[2]+d[1].length})}}return jr=l,jr}var Gr,rn;function Ms(){if(rn)return Gr;rn=1;let e=Le(),t=gl(),r=jt();function s(i,o){let a=new r(i,o),u=new t(a);try{u.parse()}catch(l){throw l}return u.root}return Gr=s,s.default=s,e.registerParse(s),Gr}var Hr,sn;function eo(){if(sn)return Hr;sn=1;let{isClean:e,my:t}=bs(),r=Jn(),s=zt(),i=Le(),o=Cs(),a=Qn(),u=Es(),l=Ms(),c=ot();const n={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},d={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},h={Once:!0,postcssPlugin:!0,prepare:!0},f=0;function m(C){return typeof C=="object"&&typeof C.then=="function"}function p(C){let S=!1,b=n[C.type];return C.type==="decl"?S=C.prop.toLowerCase():C.type==="atrule"&&(S=C.name.toLowerCase()),S&&C.append?[b,b+"-"+S,f,b+"Exit",b+"Exit-"+S]:S?[b,b+"-"+S,b+"Exit",b+"Exit-"+S]:C.append?[b,f,b+"Exit"]:[b,b+"Exit"]}function g(C){let S;return C.type==="document"?S=["Document",f,"DocumentExit"]:C.type==="root"?S=["Root",f,"RootExit"]:S=p(C),{eventIndex:0,events:S,iterator:0,node:C,visitorIndex:0,visitors:[]}}function v(C){return C[e]=!1,C.nodes&&C.nodes.forEach(S=>v(S)),C}let y={};class w{constructor(S,b,E){this.stringified=!1,this.processed=!1;let M;if(typeof b=="object"&&b!==null&&(b.type==="root"||b.type==="document"))M=v(b);else if(b instanceof w||b instanceof u)M=v(b.root),b.map&&(typeof E.map=="undefined"&&(E.map={}),E.map.inline||(E.map.inline=!1),E.map.prev=b.map);else{let I=l;E.syntax&&(I=E.syntax.parse),E.parser&&(I=E.parser),I.parse&&(I=I.parse);try{M=I(b,E)}catch(N){this.processed=!0,this.error=N}M&&!M[t]&&i.rebuild(M)}this.result=new u(S,M,E),this.helpers=se(P({},y),{postcss:y,result:this.result}),this.plugins=this.processor.plugins.map(I=>typeof I=="object"&&I.prepare?P(P({},I),I.prepare(this.result)):I)}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,b){let E=this.result.lastPlugin;try{b&&b.addToError(S),this.error=S,S.name==="CssSyntaxError"&&!S.plugin?(S.plugin=E.postcssPlugin,S.setMessage()):E.postcssVersion}catch(M){console&&console.error&&console.error(M)}return S}prepareVisitors(){this.listeners={};let S=(b,E,M)=>{this.listeners[E]||(this.listeners[E]=[]),this.listeners[E].push([b,M])};for(let b of this.plugins)if(typeof b=="object")for(let E in b){if(!d[E]&&/^[A-Z]/.test(E))throw new Error(`Unknown event ${E} in ${b.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!h[E])if(typeof b[E]=="object")for(let M in b[E])M==="*"?S(b,E,b[E][M]):S(b,E+"-"+M.toLowerCase(),b[E][M]);else typeof b[E]=="function"&&S(b,E,b[E])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let S=0;S<this.plugins.length;S++){let b=this.plugins[S],E=this.runOnRoot(b);if(m(E))try{await E}catch(M){throw this.handleError(M)}}if(this.prepareVisitors(),this.hasListener){let S=this.result.root;for(;!S[e];){S[e]=!0;let b=[g(S)];for(;b.length>0;){let E=this.visitTick(b);if(m(E))try{await E}catch(M){let I=b[b.length-1].node;throw this.handleError(M,I)}}}if(this.listeners.OnceExit)for(let[b,E]of this.listeners.OnceExit){this.result.lastPlugin=b;try{if(S.type==="document"){let M=S.nodes.map(I=>E(I,this.helpers));await Promise.all(M)}else await E(S,this.helpers)}catch(M){throw this.handleError(M)}}}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 b=this.result.root.nodes.map(E=>S.Once(E,this.helpers));return m(b[0])?Promise.all(b):b}return S.Once(this.result.root,this.helpers)}else if(typeof S=="function")return S(this.result.root,this.result)}catch(b){throw this.handleError(b)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let S=this.result.opts,b=s;S.syntax&&(b=S.syntax.stringify),S.stringifier&&(b=S.stringifier),b.stringify&&(b=b.stringify);let M=new r(b,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 S of this.plugins){let b=this.runOnRoot(S);if(m(b))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 b of S.nodes)this.visitSync(this.listeners.OnceExit,b);else this.visitSync(this.listeners.OnceExit,S)}return this.result}then(S,b){return this.async().then(S,b)}toString(){return this.css}visitSync(S,b){for(let[E,M]of S){this.result.lastPlugin=E;let I;try{I=M(b,this.helpers)}catch(N){throw this.handleError(N,b.proxyOf)}if(b.type!=="root"&&b.type!=="document"&&!b.parent)return!0;if(m(I))throw this.getAsyncError()}}visitTick(S){let b=S[S.length-1],{node:E,visitors:M}=b;if(E.type!=="root"&&E.type!=="document"&&!E.parent){S.pop();return}if(M.length>0&&b.visitorIndex<M.length){let[N,F]=M[b.visitorIndex];b.visitorIndex+=1,b.visitorIndex===M.length&&(b.visitors=[],b.visitorIndex=0),this.result.lastPlugin=N;try{return F(E.toProxy(),this.helpers)}catch(T){throw this.handleError(T,E)}}if(b.iterator!==0){let N=b.iterator,F;for(;F=E.nodes[E.indexes[N]];)if(E.indexes[N]+=1,!F[e]){F[e]=!0,S.push(g(F));return}b.iterator=0,delete E.indexes[N]}let I=b.events;for(;b.eventIndex<I.length;){let N=I[b.eventIndex];if(b.eventIndex+=1,N===f){E.nodes&&E.nodes.length&&(E[e]=!0,b.iterator=E.getIterator());return}else if(this.listeners[N]){b.visitors=this.listeners[N];return}}S.pop()}walkSync(S){S[e]=!0;let b=p(S);for(let E of b)if(E===f)S.nodes&&S.each(M=>{M[e]||this.walkSync(M)});else{let M=this.listeners[E];if(M&&this.visitSync(M,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 w.registerPostcss=C=>{y=C},Hr=w,w.default=w,c.registerLazyResult(w),o.registerLazyResult(w),Hr}var Yr,nn;function yl(){if(nn)return Yr;nn=1;let e=Jn(),t=zt(),r=Qn(),s=Ms();const i=Es();class o{constructor(u,l,c){l=l.toString(),this.stringified=!1,this._processor=u,this._css=l,this._opts=c,this._map=void 0;let n,d=t;this.result=new i(this._processor,n,this._opts),this.result.css=l;let h=this;Object.defineProperty(this.result,"root",{get(){return h.root}});let f=new e(d,n,this._opts,l);if(f.isMap()){let[m,p]=f.generate();m&&(this.result.css=m),p&&(this.result.map=p)}else f.clearAnnotation(),this.result.css=f.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(u){return this.async().catch(u)}finally(u){return this.async().then(u,u)}sync(){if(this.error)throw this.error;return this.result}then(u,l){return this.async().then(u,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 u,l=s;try{u=l(this._css,this._opts)}catch(c){this.error=c}if(this.error)throw this.error;return this._root=u,u}get[Symbol.toStringTag](){return"NoWorkResult"}}return Yr=o,o.default=o,Yr}var Xr,on;function wl(){if(on)return Xr;on=1;let e=yl(),t=eo(),r=Cs(),s=ot();class i{constructor(a=[]){this.version="8.4.38",this.plugins=this.normalize(a)}normalize(a){let u=[];for(let l of a)if(l.postcss===!0?l=l():l.postcss&&(l=l.postcss),typeof l=="object"&&Array.isArray(l.plugins))u=u.concat(l.plugins);else if(typeof l=="object"&&l.postcssPlugin)u.push(l);else if(typeof l=="function")u.push(l);else if(!(typeof l=="object"&&(l.parse||l.stringify)))throw new Error(l+" is not a PostCSS plugin");return u}process(a,u={}){return!this.plugins.length&&!u.parser&&!u.stringifier&&!u.syntax?new e(this,a,u):new t(this,a,u)}use(a){return this.plugins=this.plugins.concat(this.normalize([a])),this}}return Xr=i,i.default=i,s.registerProcessor(i),r.registerProcessor(i),Xr}var Jr,an;function vl(){if(an)return Jr;an=1;let e=qt(),t=Xn(),r=Gt(),s=xs(),i=jt(),o=ot(),a=Rs();function u(l,c){if(Array.isArray(l))return l.map(m=>u(m));let h=l,{inputs:n}=h,d=Ue(h,["inputs"]);if(n){c=[];for(let m of n){let p=se(P({},m),{__proto__:i.prototype});p.map&&(p.map=se(P({},p.map),{__proto__:t.prototype})),c.push(p)}}if(d.nodes&&(d.nodes=l.nodes.map(m=>u(m,c))),d.source){let f=d.source,{inputId:m}=f,p=Ue(f,["inputId"]);d.source=p,m!=null&&(d.source.input=c[m])}if(d.type==="root")return new o(d);if(d.type==="decl")return new e(d);if(d.type==="rule")return new a(d);if(d.type==="comment")return new r(d);if(d.type==="atrule")return new s(d);throw new Error("Unknown node type: "+l.type)}return Jr=u,u.default=u,Jr}var Qr,ln;function Sl(){if(ln)return Qr;ln=1;let e=Ss(),t=qt(),r=eo(),s=Le(),i=wl(),o=zt(),a=vl(),u=Cs(),l=Zn(),c=Gt(),n=xs(),d=Es(),h=jt(),f=Ms(),m=Kn(),p=Rs(),g=ot(),v=Vt();function y(...w){return w.length===1&&Array.isArray(w[0])&&(w=w[0]),new i(w)}return y.plugin=function(C,S){let b=!1;function E(...I){console&&console.warn&&!b&&(b=!0,console.warn(C+`: postcss.plugin was deprecated. Migration guide:
62
+ `),f=y.length-v):f+=y.length,w&&C!=="start"){let S=w.parent||{raws:{}};(!(w.type==="decl"||w.type==="atrule"&&!w.nodes)||w!==S.last||S.raws.semicolon)&&(w.source&&w.source.end?(p.source=this.sourcePath(w),p.original.line=w.source.end.line,p.original.column=w.source.end.column-1,p.generated.line=h,p.generated.column=f-2,this.map.addMapping(p)):(p.source=m,p.original.line=1,p.original.column=0,p.generated.line=h,p.generated.column=f-1,this.map.addMapping(p)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation!="undefined"?this.mapOpts.annotation:this.previous().length?this.previous().some(h=>h.annotation):!0}isInline(){if(typeof this.mapOpts.inline!="undefined")return this.mapOpts.inline;let h=this.mapOpts.annotation;return typeof h!="undefined"&&h!==!0?!1:this.previous().length?this.previous().some(f=>f.inline):!0}isMap(){return typeof this.opts.map!="undefined"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent!="undefined"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(h=>h.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(h){if(this.mapOpts.absolute||h.charCodeAt(0)===60||/^\w+:\/\//.test(h))return h;let f=this.memoizedPaths.get(h);if(f)return f;let m=this.opts.to?r(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(m=r(i(m,this.mapOpts.annotation)));let p=s(m,h);return this.memoizedPaths.set(h,p),p}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(h=>{if(h.source&&h.source.input.map){let f=h.source.input.map;this.previousMaps.includes(f)||this.previousMaps.push(f)}});else{let h=new u(this.originalCSS,this.opts);h.map&&this.previousMaps.push(h.map)}return this.previousMaps}setSourcesContent(){let h={};if(this.root)this.root.walk(f=>{if(f.source){let m=f.source.input.from;if(m&&!h[m]){h[m]=!0;let p=this.usesFileUrls?this.toFileUrl(m):this.toUrl(this.path(m));this.map.setSourceContent(p,f.source.input.css)}}});else if(this.css){let f=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(f,this.css)}}sourcePath(h){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(h.source.input.from):this.toUrl(this.path(h.source.input.from))}toBase64(h){return Buffer?Buffer.from(h).toString("base64"):window.btoa(unescape(encodeURIComponent(h)))}toFileUrl(h){let f=this.memoizedFileURLs.get(h);if(f)return f;if(a){let m=a(h).toString();return this.memoizedFileURLs.set(h,m),m}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(h){let f=this.memoizedURLs.get(h);if(f)return f;o==="\\"&&(h=h.replace(/\\/g,"/"));let m=encodeURI(h).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(h,m),m}}return zr=n,zr}var Vr,sn;function rr(){if(sn)return Vr;sn=1;let e=Kt();class t extends e{constructor(s){super(s),this.type="comment"}}return Vr=t,t.default=t,Vr}var jr,nn;function Ue(){if(nn)return jr;nn=1;let{isClean:e,my:t}=Ts(),r=er(),s=rr(),i=Kt(),o,a,u,l;function c(h){return h.map(f=>(f.nodes&&(f.nodes=c(f.nodes)),delete f.source,f))}function n(h){if(h[e]=!1,h.proxyOf.nodes)for(let f of h.proxyOf.nodes)n(f)}class d extends i{append(...f){for(let m of f){let p=this.normalize(m,this.last);for(let g of p)this.proxyOf.nodes.push(g)}return this.markDirty(),this}cleanRaws(f){if(super.cleanRaws(f),this.nodes)for(let m of this.nodes)m.cleanRaws(f)}each(f){if(!this.proxyOf.nodes)return;let m=this.getIterator(),p,g;for(;this.indexes[m]<this.proxyOf.nodes.length&&(p=this.indexes[m],g=f(this.proxyOf.nodes[p],p),g!==!1);)this.indexes[m]+=1;return delete this.indexes[m],g}every(f){return this.nodes.every(f)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let f=this.lastEach;return this.indexes[f]=0,f}getProxyProcessor(){return{get(f,m){return m==="proxyOf"?f:f[m]?m==="each"||typeof m=="string"&&m.startsWith("walk")?(...p)=>f[m](...p.map(g=>typeof g=="function"?(v,y)=>g(v.toProxy(),y):g)):m==="every"||m==="some"?p=>f[m]((g,...v)=>p(g.toProxy(),...v)):m==="root"?()=>f.root().toProxy():m==="nodes"?f.nodes.map(p=>p.toProxy()):m==="first"||m==="last"?f[m].toProxy():f[m]:f[m]},set(f,m,p){return f[m]===p||(f[m]=p,(m==="name"||m==="params"||m==="selector")&&f.markDirty()),!0}}}index(f){return typeof f=="number"?f:(f.proxyOf&&(f=f.proxyOf),this.proxyOf.nodes.indexOf(f))}insertAfter(f,m){let p=this.index(f),g=this.normalize(m,this.proxyOf.nodes[p]).reverse();p=this.index(f);for(let y of g)this.proxyOf.nodes.splice(p+1,0,y);let v;for(let y in this.indexes)v=this.indexes[y],p<v&&(this.indexes[y]=v+g.length);return this.markDirty(),this}insertBefore(f,m){let p=this.index(f),g=p===0?"prepend":!1,v=this.normalize(m,this.proxyOf.nodes[p],g).reverse();p=this.index(f);for(let w of v)this.proxyOf.nodes.splice(p,0,w);let y;for(let w in this.indexes)y=this.indexes[w],p<=y&&(this.indexes[w]=y+v.length);return this.markDirty(),this}normalize(f,m){if(typeof f=="string")f=c(o(f).nodes);else if(typeof f=="undefined")f=[];else if(Array.isArray(f)){f=f.slice(0);for(let g of f)g.parent&&g.parent.removeChild(g,"ignore")}else if(f.type==="root"&&this.type!=="document"){f=f.nodes.slice(0);for(let g of f)g.parent&&g.parent.removeChild(g,"ignore")}else if(f.type)f=[f];else if(f.prop){if(typeof f.value=="undefined")throw new Error("Value field is missed in node creation");typeof f.value!="string"&&(f.value=String(f.value)),f=[new r(f)]}else if(f.selector)f=[new a(f)];else if(f.name)f=[new u(f)];else if(f.text)f=[new s(f)];else throw new Error("Unknown node type in node creation");return f.map(g=>(g[t]||d.rebuild(g),g=g.proxyOf,g.parent&&g.parent.removeChild(g),g[e]&&n(g),typeof g.raws.before=="undefined"&&m&&typeof m.raws.before!="undefined"&&(g.raws.before=m.raws.before.replace(/\S/g,"")),g.parent=this.proxyOf,g))}prepend(...f){f=f.reverse();for(let m of f){let p=this.normalize(m,this.first,"prepend").reverse();for(let g of p)this.proxyOf.nodes.unshift(g);for(let g in this.indexes)this.indexes[g]=this.indexes[g]+p.length}return this.markDirty(),this}push(f){return f.parent=this,this.proxyOf.nodes.push(f),this}removeAll(){for(let f of this.proxyOf.nodes)f.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(f){f=this.index(f),this.proxyOf.nodes[f].parent=void 0,this.proxyOf.nodes.splice(f,1);let m;for(let p in this.indexes)m=this.indexes[p],m>=f&&(this.indexes[p]=m-1);return this.markDirty(),this}replaceValues(f,m,p){return p||(p=m,m={}),this.walkDecls(g=>{m.props&&!m.props.includes(g.prop)||m.fast&&!g.value.includes(m.fast)||(g.value=g.value.replace(f,p))}),this.markDirty(),this}some(f){return this.nodes.some(f)}walk(f){return this.each((m,p)=>{let g;try{g=f(m,p)}catch(v){throw m.addToError(v)}return g!==!1&&m.walk&&(g=m.walk(f)),g})}walkAtRules(f,m){return m?f instanceof RegExp?this.walk((p,g)=>{if(p.type==="atrule"&&f.test(p.name))return m(p,g)}):this.walk((p,g)=>{if(p.type==="atrule"&&p.name===f)return m(p,g)}):(m=f,this.walk((p,g)=>{if(p.type==="atrule")return m(p,g)}))}walkComments(f){return this.walk((m,p)=>{if(m.type==="comment")return f(m,p)})}walkDecls(f,m){return m?f instanceof RegExp?this.walk((p,g)=>{if(p.type==="decl"&&f.test(p.prop))return m(p,g)}):this.walk((p,g)=>{if(p.type==="decl"&&p.prop===f)return m(p,g)}):(m=f,this.walk((p,g)=>{if(p.type==="decl")return m(p,g)}))}walkRules(f,m){return m?f instanceof RegExp?this.walk((p,g)=>{if(p.type==="rule"&&f.test(p.selector))return m(p,g)}):this.walk((p,g)=>{if(p.type==="rule"&&p.selector===f)return m(p,g)}):(m=f,this.walk((p,g)=>{if(p.type==="rule")return m(p,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 d.registerParse=h=>{o=h},d.registerRule=h=>{a=h},d.registerAtRule=h=>{u=h},d.registerRoot=h=>{l=h},jr=d,d.default=d,d.rebuild=h=>{h.type==="atrule"?Object.setPrototypeOf(h,u.prototype):h.type==="rule"?Object.setPrototypeOf(h,a.prototype):h.type==="decl"?Object.setPrototypeOf(h,r.prototype):h.type==="comment"?Object.setPrototypeOf(h,s.prototype):h.type==="root"&&Object.setPrototypeOf(h,l.prototype),h[t]=!0,h.nodes&&h.nodes.forEach(f=>{d.rebuild(f)})},jr}var qr,on;function As(){if(on)return qr;on=1;let e=Ue(),t,r;class s extends e{constructor(o){super(k({type:"document"},o)),this.nodes||(this.nodes=[])}toResult(o={}){return new t(new r,this,o).stringify()}}return s.registerLazyResult=i=>{t=i},s.registerProcessor=i=>{r=i},qr=s,s.default=s,qr}var Gr,an;function uo(){if(an)return Gr;an=1;let e={};return Gr=function(r){e[r]||(e[r]=!0,typeof console!="undefined"&&console.warn&&console.warn(r))},Gr}var Hr,ln;function co(){if(ln)return Hr;ln=1;class e{constructor(r,s={}){if(this.type="warning",this.text=r,s.node&&s.node.source){let i=s.node.rangeBy(s);this.line=i.start.line,this.column=i.start.column,this.endLine=i.end.line,this.endColumn=i.end.column}for(let i in s)this[i]=s[i]}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 Hr=e,e.default=e,Hr}var Yr,un;function _s(){if(un)return Yr;un=1;let e=co();class t{constructor(s,i,o){this.processor=s,this.messages=[],this.root=i,this.opts=o,this.css=void 0,this.map=void 0}toString(){return this.css}warn(s,i={}){i.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(i.plugin=this.lastPlugin.postcssPlugin);let o=new e(s,i);return this.messages.push(o),o}warnings(){return this.messages.filter(s=>s.type==="warning")}get content(){return this.css}}return Yr=t,t.default=t,Yr}var Xr,cn;function Il(){if(cn)return Xr;cn=1;const e=39,t=34,r=92,s=47,i=10,o=32,a=12,u=9,l=13,c=91,n=93,d=40,h=41,f=123,m=125,p=59,g=42,v=58,y=64,w=/[\t\n\f\r "#'()/;[\\\]{}]/g,C=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,b=/[\da-f]/i;return Xr=function(R,I={}){let N=R.css.valueOf(),F=I.ignoreErrors,A,x,ce,ae,j,P,X,te,Z,G,Me=N.length,O=0,Se=[],fe=[];function rt(){return O}function le(L){throw R.error("Unclosed "+L,O)}function pe(){return fe.length===0&&O>=Me}function Pe(L){if(fe.length)return fe.pop();if(O>=Me)return;let re=L?L.ignoreUnclosed:!1;switch(A=N.charCodeAt(O),A){case i:case o:case u:case l:case a:{x=O;do x+=1,A=N.charCodeAt(x);while(A===o||A===i||A===u||A===l||A===a);G=["space",N.slice(O,x)],O=x-1;break}case c:case n:case f:case m:case v:case p:case h:{let q=String.fromCharCode(A);G=[q,q,O];break}case d:{if(te=Se.length?Se.pop()[1]:"",Z=N.charCodeAt(O+1),te==="url"&&Z!==e&&Z!==t&&Z!==o&&Z!==i&&Z!==u&&Z!==a&&Z!==l){x=O;do{if(P=!1,x=N.indexOf(")",x+1),x===-1)if(F||re){x=O;break}else le("bracket");for(X=x;N.charCodeAt(X-1)===r;)X-=1,P=!P}while(P);G=["brackets",N.slice(O,x+1),O,x],O=x}else x=N.indexOf(")",O+1),ae=N.slice(O,x+1),x===-1||S.test(ae)?G=["(","(",O]:(G=["brackets",ae,O,x],O=x);break}case e:case t:{ce=A===e?"'":'"',x=O;do{if(P=!1,x=N.indexOf(ce,x+1),x===-1)if(F||re){x=O+1;break}else le("string");for(X=x;N.charCodeAt(X-1)===r;)X-=1,P=!P}while(P);G=["string",N.slice(O,x+1),O,x],O=x;break}case y:{w.lastIndex=O+1,w.test(N),w.lastIndex===0?x=N.length-1:x=w.lastIndex-2,G=["at-word",N.slice(O,x+1),O,x],O=x;break}case r:{for(x=O,j=!0;N.charCodeAt(x+1)===r;)x+=1,j=!j;if(A=N.charCodeAt(x+1),j&&A!==s&&A!==o&&A!==i&&A!==u&&A!==l&&A!==a&&(x+=1,b.test(N.charAt(x)))){for(;b.test(N.charAt(x+1));)x+=1;N.charCodeAt(x+1)===o&&(x+=1)}G=["word",N.slice(O,x+1),O,x],O=x;break}default:{A===s&&N.charCodeAt(O+1)===g?(x=N.indexOf("*/",O+2)+1,x===0&&(F||re?x=N.length:le("comment")),G=["comment",N.slice(O,x+1),O,x],O=x):(C.lastIndex=O+1,C.test(N),C.lastIndex===0?x=N.length-1:x=C.lastIndex-2,G=["word",N.slice(O,x+1),O,x],Se.push(G),O=x);break}}return O++,G}function Re(L){fe.push(L)}return{back:Re,endOfFile:pe,nextToken:Pe,position:rt}},Xr}var Jr,hn;function Ps(){if(hn)return Jr;hn=1;let e=Ue();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 Jr=t,t.default=t,e.registerAtRule(t),Jr}var Qr,fn;function ct(){if(fn)return Qr;fn=1;let e=Ue(),t,r;class s extends e{constructor(o){super(o),this.type="root",this.nodes||(this.nodes=[])}normalize(o,a,u){let l=super.normalize(o);if(a){if(u==="prepend")this.nodes.length>1?a.raws.before=this.nodes[1].raws.before:delete a.raws.before;else if(this.first!==a)for(let c of l)c.raws.before=a.raws.before}return l}removeChild(o,a){let u=this.index(o);return!a&&u===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[u].raws.before),super.removeChild(o)}toResult(o={}){return new t(new r,this,o).stringify()}}return s.registerLazyResult=i=>{t=i},s.registerProcessor=i=>{r=i},Qr=s,s.default=s,e.registerRoot(s),Qr}var Zr,dn;function ho(){if(dn)return Zr;dn=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let r=[" ",`
63
+ `," "];return e.split(t,r)},split(t,r,s){let i=[],o="",a=!1,u=0,l=!1,c="",n=!1;for(let d of t)n?n=!1:d==="\\"?n=!0:l?d===c&&(l=!1):d==='"'||d==="'"?(l=!0,c=d):d==="("?u+=1:d===")"?u>0&&(u-=1):u===0&&r.includes(d)&&(a=!0),a?(o!==""&&i.push(o.trim()),o="",a=!1):o+=d;return(s||o!=="")&&i.push(o.trim()),i}};return Zr=e,e.default=e,Zr}var Kr,pn;function ks(){if(pn)return Kr;pn=1;let e=Ue(),t=ho();class r extends e{constructor(i){super(i),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(i){let o=this.selector?this.selector.match(/,\s*/):null,a=o?o[0]:","+this.raw("between","beforeOpen");this.selector=i.join(a)}}return Kr=r,r.default=r,e.registerRule(r),Kr}var es,mn;function Dl(){if(mn)return es;mn=1;let e=er(),t=Il(),r=rr(),s=Ps(),i=ct(),o=ks();const a={empty:!0,space:!0};function u(c){for(let n=c.length-1;n>=0;n--){let d=c[n],h=d[3]||d[2];if(h)return h}}class l{constructor(n){this.input=n,this.root=new i,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:n,start:{column:1,line:1,offset:0}}}atrule(n){let d=new s;d.name=n[1].slice(1),d.name===""&&this.unnamedAtrule(d,n),this.init(d,n[2]);let h,f,m,p=!1,g=!1,v=[],y=[];for(;!this.tokenizer.endOfFile();){if(n=this.tokenizer.nextToken(),h=n[0],h==="("||h==="["?y.push(h==="("?")":"]"):h==="{"&&y.length>0?y.push("}"):h===y[y.length-1]&&y.pop(),y.length===0)if(h===";"){d.source.end=this.getPosition(n[2]),d.source.end.offset++,this.semicolon=!0;break}else if(h==="{"){g=!0;break}else if(h==="}"){if(v.length>0){for(m=v.length-1,f=v[m];f&&f[0]==="space";)f=v[--m];f&&(d.source.end=this.getPosition(f[3]||f[2]),d.source.end.offset++)}this.end(n);break}else v.push(n);else v.push(n);if(this.tokenizer.endOfFile()){p=!0;break}}d.raws.between=this.spacesAndCommentsFromEnd(v),v.length?(d.raws.afterName=this.spacesAndCommentsFromStart(v),this.raw(d,"params",v),p&&(n=v[v.length-1],d.source.end=this.getPosition(n[3]||n[2]),d.source.end.offset++,this.spaces=d.raws.between,d.raws.between="")):(d.raws.afterName="",d.params=""),g&&(d.nodes=[],this.current=d)}checkMissedSemicolon(n){let d=this.colon(n);if(d===!1)return;let h=0,f;for(let m=d-1;m>=0&&(f=n[m],!(f[0]!=="space"&&(h+=1,h===2)));m--);throw this.input.error("Missed semicolon",f[0]==="word"?f[3]+1:f[2])}colon(n){let d=0,h,f,m;for(let[p,g]of n.entries()){if(h=g,f=h[0],f==="("&&(d+=1),f===")"&&(d-=1),d===0&&f===":")if(!m)this.doubleColon(h);else{if(m[0]==="word"&&m[1]==="progid")continue;return p}m=h}return!1}comment(n){let d=new r;this.init(d,n[2]),d.source.end=this.getPosition(n[3]||n[2]),d.source.end.offset++;let h=n[1].slice(2,-2);if(/^\s*$/.test(h))d.text="",d.raws.left=h,d.raws.right="";else{let f=h.match(/^(\s*)([^]*\S)(\s*)$/);d.text=f[2],d.raws.left=f[1],d.raws.right=f[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(n,d){let h=new e;this.init(h,n[0][2]);let f=n[n.length-1];for(f[0]===";"&&(this.semicolon=!0,n.pop()),h.source.end=this.getPosition(f[3]||f[2]||u(n)),h.source.end.offset++;n[0][0]!=="word";)n.length===1&&this.unknownWord(n),h.raws.before+=n.shift()[1];for(h.source.start=this.getPosition(n[0][2]),h.prop="";n.length;){let y=n[0][0];if(y===":"||y==="space"||y==="comment")break;h.prop+=n.shift()[1]}h.raws.between="";let m;for(;n.length;)if(m=n.shift(),m[0]===":"){h.raws.between+=m[1];break}else m[0]==="word"&&/\w/.test(m[1])&&this.unknownWord([m]),h.raws.between+=m[1];(h.prop[0]==="_"||h.prop[0]==="*")&&(h.raws.before+=h.prop[0],h.prop=h.prop.slice(1));let p=[],g;for(;n.length&&(g=n[0][0],!(g!=="space"&&g!=="comment"));)p.push(n.shift());this.precheckMissedSemicolon(n);for(let y=n.length-1;y>=0;y--){if(m=n[y],m[1].toLowerCase()==="!important"){h.important=!0;let w=this.stringFrom(n,y);w=this.spacesFromEnd(n)+w,w!==" !important"&&(h.raws.important=w);break}else if(m[1].toLowerCase()==="important"){let w=n.slice(0),C="";for(let S=y;S>0;S--){let b=w[S][0];if(C.trim().indexOf("!")===0&&b!=="space")break;C=w.pop()[1]+C}C.trim().indexOf("!")===0&&(h.important=!0,h.raws.important=C,n=w)}if(m[0]!=="space"&&m[0]!=="comment")break}n.some(y=>y[0]!=="space"&&y[0]!=="comment")&&(h.raws.between+=p.map(y=>y[1]).join(""),p=[]),this.raw(h,"value",p.concat(n),d),h.value.includes(":")&&!d&&this.checkMissedSemicolon(n)}doubleColon(n){throw this.input.error("Double colon",{offset:n[2]},{offset:n[2]+n[1].length})}emptyRule(n){let d=new o;this.init(d,n[2]),d.selector="",d.raws.between="",this.current=d}end(n){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(n[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(n)}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(n){if(this.spaces+=n[1],this.current.nodes){let d=this.current.nodes[this.current.nodes.length-1];d&&d.type==="rule"&&!d.raws.ownSemicolon&&(d.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(n){let d=this.input.fromOffset(n);return{column:d.col,line:d.line,offset:n}}init(n,d){this.current.push(n),n.source={input:this.input,start:this.getPosition(d)},n.raws.before=this.spaces,this.spaces="",n.type!=="comment"&&(this.semicolon=!1)}other(n){let d=!1,h=null,f=!1,m=null,p=[],g=n[1].startsWith("--"),v=[],y=n;for(;y;){if(h=y[0],v.push(y),h==="("||h==="[")m||(m=y),p.push(h==="("?")":"]");else if(g&&f&&h==="{")m||(m=y),p.push("}");else if(p.length===0)if(h===";")if(f){this.decl(v,g);return}else break;else if(h==="{"){this.rule(v);return}else if(h==="}"){this.tokenizer.back(v.pop()),d=!0;break}else h===":"&&(f=!0);else h===p[p.length-1]&&(p.pop(),p.length===0&&(m=null));y=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(d=!0),p.length>0&&this.unclosedBracket(m),d&&f){if(!g)for(;v.length&&(y=v[v.length-1][0],!(y!=="space"&&y!=="comment"));)this.tokenizer.back(v.pop());this.decl(v,g)}else this.unknownWord(v)}parse(){let n;for(;!this.tokenizer.endOfFile();)switch(n=this.tokenizer.nextToken(),n[0]){case"space":this.spaces+=n[1];break;case";":this.freeSemicolon(n);break;case"}":this.end(n);break;case"comment":this.comment(n);break;case"at-word":this.atrule(n);break;case"{":this.emptyRule(n);break;default:this.other(n);break}this.endFile()}precheckMissedSemicolon(){}raw(n,d,h,f){let m,p,g=h.length,v="",y=!0,w,C;for(let S=0;S<g;S+=1)m=h[S],p=m[0],p==="space"&&S===g-1&&!f?y=!1:p==="comment"?(C=h[S-1]?h[S-1][0]:"empty",w=h[S+1]?h[S+1][0]:"empty",!a[C]&&!a[w]?v.slice(-1)===","?y=!1:v+=m[1]:y=!1):v+=m[1];if(!y){let S=h.reduce((b,E)=>b+E[1],"");n.raws[d]={raw:S,value:v}}n[d]=v}rule(n){n.pop();let d=new o;this.init(d,n[0][2]),d.raws.between=this.spacesAndCommentsFromEnd(n),this.raw(d,"selector",n),this.current=d}spacesAndCommentsFromEnd(n){let d,h="";for(;n.length&&(d=n[n.length-1][0],!(d!=="space"&&d!=="comment"));)h=n.pop()[1]+h;return h}spacesAndCommentsFromStart(n){let d,h="";for(;n.length&&(d=n[0][0],!(d!=="space"&&d!=="comment"));)h+=n.shift()[1];return h}spacesFromEnd(n){let d,h="";for(;n.length&&(d=n[n.length-1][0],d==="space");)h=n.pop()[1]+h;return h}stringFrom(n,d){let h="";for(let f=d;f<n.length;f++)h+=n[f][1];return n.splice(d,n.length-d),h}unclosedBlock(){let n=this.current.source.start;throw this.input.error("Unclosed block",n.line,n.column)}unclosedBracket(n){throw this.input.error("Unclosed bracket",{offset:n[2]},{offset:n[2]+1})}unexpectedClose(n){throw this.input.error("Unexpected }",{offset:n[2]},{offset:n[2]+1})}unknownWord(n){throw this.input.error("Unknown word",{offset:n[0][2]},{offset:n[0][2]+n[0][1].length})}unnamedAtrule(n,d){throw this.input.error("At-rule without name",{offset:d[2]},{offset:d[2]+d[1].length})}}return es=l,es}var ts,gn;function Ls(){if(gn)return ts;gn=1;let e=Ue(),t=Dl(),r=tr();function s(i,o){let a=new r(i,o),u=new t(a);try{u.parse()}catch(l){throw l}return u.root}return ts=s,s.default=s,e.registerParse(s),ts}var rs,yn;function fo(){if(yn)return rs;yn=1;let{isClean:e,my:t}=Ts(),r=lo(),s=Zt(),i=Ue(),o=As(),a=uo(),u=_s(),l=Ls(),c=ct();const n={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},d={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},h={Once:!0,postcssPlugin:!0,prepare:!0},f=0;function m(C){return typeof C=="object"&&typeof C.then=="function"}function p(C){let S=!1,b=n[C.type];return C.type==="decl"?S=C.prop.toLowerCase():C.type==="atrule"&&(S=C.name.toLowerCase()),S&&C.append?[b,b+"-"+S,f,b+"Exit",b+"Exit-"+S]:S?[b,b+"-"+S,b+"Exit",b+"Exit-"+S]:C.append?[b,f,b+"Exit"]:[b,b+"Exit"]}function g(C){let S;return C.type==="document"?S=["Document",f,"DocumentExit"]:C.type==="root"?S=["Root",f,"RootExit"]:S=p(C),{eventIndex:0,events:S,iterator:0,node:C,visitorIndex:0,visitors:[]}}function v(C){return C[e]=!1,C.nodes&&C.nodes.forEach(S=>v(S)),C}let y={};class w{constructor(S,b,E){this.stringified=!1,this.processed=!1;let R;if(typeof b=="object"&&b!==null&&(b.type==="root"||b.type==="document"))R=v(b);else if(b instanceof w||b instanceof u)R=v(b.root),b.map&&(typeof E.map=="undefined"&&(E.map={}),E.map.inline||(E.map.inline=!1),E.map.prev=b.map);else{let I=l;E.syntax&&(I=E.syntax.parse),E.parser&&(I=E.parser),I.parse&&(I=I.parse);try{R=I(b,E)}catch(N){this.processed=!0,this.error=N}R&&!R[t]&&i.rebuild(R)}this.result=new u(S,R,E),this.helpers=se(k({},y),{postcss:y,result:this.result}),this.plugins=this.processor.plugins.map(I=>typeof I=="object"&&I.prepare?k(k({},I),I.prepare(this.result)):I)}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,b){let E=this.result.lastPlugin;try{b&&b.addToError(S),this.error=S,S.name==="CssSyntaxError"&&!S.plugin?(S.plugin=E.postcssPlugin,S.setMessage()):E.postcssVersion}catch(R){console&&console.error&&console.error(R)}return S}prepareVisitors(){this.listeners={};let S=(b,E,R)=>{this.listeners[E]||(this.listeners[E]=[]),this.listeners[E].push([b,R])};for(let b of this.plugins)if(typeof b=="object")for(let E in b){if(!d[E]&&/^[A-Z]/.test(E))throw new Error(`Unknown event ${E} in ${b.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!h[E])if(typeof b[E]=="object")for(let R in b[E])R==="*"?S(b,E,b[E][R]):S(b,E+"-"+R.toLowerCase(),b[E][R]);else typeof b[E]=="function"&&S(b,E,b[E])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let S=0;S<this.plugins.length;S++){let b=this.plugins[S],E=this.runOnRoot(b);if(m(E))try{await E}catch(R){throw this.handleError(R)}}if(this.prepareVisitors(),this.hasListener){let S=this.result.root;for(;!S[e];){S[e]=!0;let b=[g(S)];for(;b.length>0;){let E=this.visitTick(b);if(m(E))try{await E}catch(R){let I=b[b.length-1].node;throw this.handleError(R,I)}}}if(this.listeners.OnceExit)for(let[b,E]of this.listeners.OnceExit){this.result.lastPlugin=b;try{if(S.type==="document"){let R=S.nodes.map(I=>E(I,this.helpers));await Promise.all(R)}else await E(S,this.helpers)}catch(R){throw this.handleError(R)}}}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 b=this.result.root.nodes.map(E=>S.Once(E,this.helpers));return m(b[0])?Promise.all(b):b}return S.Once(this.result.root,this.helpers)}else if(typeof S=="function")return S(this.result.root,this.result)}catch(b){throw this.handleError(b)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let S=this.result.opts,b=s;S.syntax&&(b=S.syntax.stringify),S.stringifier&&(b=S.stringifier),b.stringify&&(b=b.stringify);let R=new r(b,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 S of this.plugins){let b=this.runOnRoot(S);if(m(b))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 b of S.nodes)this.visitSync(this.listeners.OnceExit,b);else this.visitSync(this.listeners.OnceExit,S)}return this.result}then(S,b){return this.async().then(S,b)}toString(){return this.css}visitSync(S,b){for(let[E,R]of S){this.result.lastPlugin=E;let I;try{I=R(b,this.helpers)}catch(N){throw this.handleError(N,b.proxyOf)}if(b.type!=="root"&&b.type!=="document"&&!b.parent)return!0;if(m(I))throw this.getAsyncError()}}visitTick(S){let b=S[S.length-1],{node:E,visitors:R}=b;if(E.type!=="root"&&E.type!=="document"&&!E.parent){S.pop();return}if(R.length>0&&b.visitorIndex<R.length){let[N,F]=R[b.visitorIndex];b.visitorIndex+=1,b.visitorIndex===R.length&&(b.visitors=[],b.visitorIndex=0),this.result.lastPlugin=N;try{return F(E.toProxy(),this.helpers)}catch(A){throw this.handleError(A,E)}}if(b.iterator!==0){let N=b.iterator,F;for(;F=E.nodes[E.indexes[N]];)if(E.indexes[N]+=1,!F[e]){F[e]=!0,S.push(g(F));return}b.iterator=0,delete E.indexes[N]}let I=b.events;for(;b.eventIndex<I.length;){let N=I[b.eventIndex];if(b.eventIndex+=1,N===f){E.nodes&&E.nodes.length&&(E[e]=!0,b.iterator=E.getIterator());return}else if(this.listeners[N]){b.visitors=this.listeners[N];return}}S.pop()}walkSync(S){S[e]=!0;let b=p(S);for(let E of b)if(E===f)S.nodes&&S.each(R=>{R[e]||this.walkSync(R)});else{let R=this.listeners[E];if(R&&this.visitSync(R,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 w.registerPostcss=C=>{y=C},rs=w,w.default=w,c.registerLazyResult(w),o.registerLazyResult(w),rs}var ss,wn;function Tl(){if(wn)return ss;wn=1;let e=lo(),t=Zt(),r=uo(),s=Ls();const i=_s();class o{constructor(u,l,c){l=l.toString(),this.stringified=!1,this._processor=u,this._css=l,this._opts=c,this._map=void 0;let n,d=t;this.result=new i(this._processor,n,this._opts),this.result.css=l;let h=this;Object.defineProperty(this.result,"root",{get(){return h.root}});let f=new e(d,n,this._opts,l);if(f.isMap()){let[m,p]=f.generate();m&&(this.result.css=m),p&&(this.result.map=p)}else f.clearAnnotation(),this.result.css=f.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(u){return this.async().catch(u)}finally(u){return this.async().then(u,u)}sync(){if(this.error)throw this.error;return this.result}then(u,l){return this.async().then(u,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 u,l=s;try{u=l(this._css,this._opts)}catch(c){this.error=c}if(this.error)throw this.error;return this._root=u,u}get[Symbol.toStringTag](){return"NoWorkResult"}}return ss=o,o.default=o,ss}var is,vn;function Al(){if(vn)return is;vn=1;let e=Tl(),t=fo(),r=As(),s=ct();class i{constructor(a=[]){this.version="8.4.38",this.plugins=this.normalize(a)}normalize(a){let u=[];for(let l of a)if(l.postcss===!0?l=l():l.postcss&&(l=l.postcss),typeof l=="object"&&Array.isArray(l.plugins))u=u.concat(l.plugins);else if(typeof l=="object"&&l.postcssPlugin)u.push(l);else if(typeof l=="function")u.push(l);else if(!(typeof l=="object"&&(l.parse||l.stringify)))throw new Error(l+" is not a PostCSS plugin");return u}process(a,u={}){return!this.plugins.length&&!u.parser&&!u.stringifier&&!u.syntax?new e(this,a,u):new t(this,a,u)}use(a){return this.plugins=this.plugins.concat(this.normalize([a])),this}}return is=i,i.default=i,s.registerProcessor(i),r.registerProcessor(i),is}var ns,Sn;function _l(){if(Sn)return ns;Sn=1;let e=er(),t=ao(),r=rr(),s=Ps(),i=tr(),o=ct(),a=ks();function u(l,c){if(Array.isArray(l))return l.map(m=>u(m));let h=l,{inputs:n}=h,d=$e(h,["inputs"]);if(n){c=[];for(let m of n){let p=se(k({},m),{__proto__:i.prototype});p.map&&(p.map=se(k({},p.map),{__proto__:t.prototype})),c.push(p)}}if(d.nodes&&(d.nodes=l.nodes.map(m=>u(m,c))),d.source){let f=d.source,{inputId:m}=f,p=$e(f,["inputId"]);d.source=p,m!=null&&(d.source.input=c[m])}if(d.type==="root")return new o(d);if(d.type==="decl")return new e(d);if(d.type==="rule")return new a(d);if(d.type==="comment")return new r(d);if(d.type==="atrule")return new s(d);throw new Error("Unknown node type: "+l.type)}return ns=u,u.default=u,ns}var os,bn;function Pl(){if(bn)return os;bn=1;let e=Ds(),t=er(),r=fo(),s=Ue(),i=Al(),o=Zt(),a=_l(),u=As(),l=co(),c=rr(),n=Ps(),d=_s(),h=tr(),f=Ls(),m=ho(),p=ks(),g=ct(),v=Kt();function y(...w){return w.length===1&&Array.isArray(w[0])&&(w=w[0]),new i(w)}return y.plugin=function(C,S){let b=!1;function E(...I){console&&console.warn&&!b&&(b=!0,console.warn(C+`: postcss.plugin was deprecated. Migration guide:
64
64
  https://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:
65
- https://www.w3ctech.com/topic/2226`));let N=S(...I);return N.postcssPlugin=C,N.postcssVersion=new i().version,N}let M;return Object.defineProperty(E,"postcss",{get(){return M||(M=E()),M}}),E.process=function(I,N,F){return y([E(F)]).process(I,N)},E},y.stringify=o,y.parse=f,y.fromJSON=a,y.list=m,y.comment=w=>new c(w),y.atRule=w=>new n(w),y.decl=w=>new t(w),y.rule=w=>new p(w),y.root=w=>new g(w),y.document=w=>new u(w),y.CssSyntaxError=e,y.Declaration=t,y.Container=s,y.Processor=i,y.Document=u,y.Comment=c,y.Warning=l,y.AtRule=n,y.Result=d,y.Input=h,y.Rule=p,y.Root=g,y.Node=v,r.registerPostcss(y),Qr=y,y.default=y,Qr}var bl=Sl();const Q=ul(bl);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 W=(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))(W||{});function Cl(e){const t={},r=/;(?![^(]*\))/g,s=/:(.+)/,i=/\/\*.*?\*\//g;return e.replace(i,"").split(r).forEach(function(o){if(o){const a=o.split(s);a.length>1&&(t[ss(a[0].trim())]=a[1].trim())}}),t}function un(e){const t=[];for(const r in e){const s=e[r];if(typeof s!="string")continue;const i=Ml(r);t.push(`${i}: ${s};`)}return t.join(" ")}const El=/-([a-z])/g,xl=/^--[a-zA-Z0-9-]+$/,ss=e=>xl.test(e)?e:e.replace(El,(t,r)=>r?r.toUpperCase():""),Rl=/\B([A-Z])/g,Ml=e=>e.replace(Rl,"-$1").toLowerCase();class ye{constructor(...t){D(this,"parentElement",null),D(this,"parentNode",null),D(this,"ownerDocument"),D(this,"firstChild",null),D(this,"lastChild",null),D(this,"previousSibling",null),D(this,"nextSibling",null),D(this,"ELEMENT_NODE",1),D(this,"TEXT_NODE",3),D(this,"nodeType"),D(this,"nodeName"),D(this,"RRNodeType")}get childNodes(){const t=[];let r=this.firstChild;for(;r;)t.push(r),r=r.nextSibling;return t}contains(t){if(t instanceof ye){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"}}class Ns extends ye{constructor(...t){super(t),D(this,"nodeType",9),D(this,"nodeName","#document"),D(this,"compatMode","CSS1Compat"),D(this,"RRNodeType",W.Document),D(this,"textContent",null),this.ownerDocument=this}get documentElement(){return this.childNodes.find(t=>t.RRNodeType===W.Element&&t.tagName==="HTML")||null}get body(){var t;return((t=this.documentElement)==null?void 0:t.childNodes.find(r=>r.RRNodeType===W.Element&&r.tagName==="BODY"))||null}get head(){var t;return((t=this.documentElement)==null?void 0:t.childNodes.find(r=>r.RRNodeType===W.Element&&r.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(t){const r=t.RRNodeType;if((r===W.Element||r===W.DocumentType)&&this.childNodes.some(i=>i.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${r===W.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const s=Os(this,t);return s.parentElement=null,s}insertBefore(t,r){const s=t.RRNodeType;if((s===W.Element||s===W.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===s))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${s===W.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const i=no(this,t,r);return i.parentElement=null,i}removeChild(t){return oo(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){const s=this.createDocumentType("html",r,"");this.open(),this.appendChild(s)}}createDocument(t,r,s){return new Ns}createDocumentType(t,r,s){const i=new to(t,r,s);return i.ownerDocument=this,i}createElement(t){const r=new Ht(t);return r.ownerDocument=this,r}createElementNS(t,r){return this.createElement(r)}createTextNode(t){const r=new ro(t);return r.ownerDocument=this,r}createComment(t){const r=new so(t);return r.ownerDocument=this,r}createCDATASection(t){const r=new io(t);return r.ownerDocument=this,r}toString(){return"RRDocument"}}class to extends ye{constructor(t,r,s){super(),D(this,"nodeType",10),D(this,"RRNodeType",W.DocumentType),D(this,"name"),D(this,"publicId"),D(this,"systemId"),D(this,"textContent",null),this.name=t,this.publicId=r,this.systemId=s,this.nodeName=t}toString(){return"RRDocumentType"}}class Ht extends ye{constructor(t){super(),D(this,"nodeType",1),D(this,"RRNodeType",W.Element),D(this,"tagName"),D(this,"attributes",{}),D(this,"shadowRoot",null),D(this,"scrollLeft"),D(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 Il(this.attributes.class,t=>{this.attributes.class=t})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const t=this.attributes.style?Cl(this.attributes.style):{},r=/\B([A-Z])/g;return t.setProperty=(s,i,o)=>{if(r.test(s))return;const a=ss(s);i?t[a]=i:delete t[a],o==="important"&&(t[a]+=" !important"),this.attributes.style=un(t)},t.removeProperty=s=>{if(r.test(s))return"";const i=ss(s),o=t[i]||"";return delete t[i],this.attributes.style=un(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,s){this.setAttribute(r,s)}removeAttribute(t){delete this.attributes[t]}appendChild(t){return Os(this,t)}insertBefore(t,r){return no(this,t,r)}removeChild(t){return oo(this,t)}attachShadow(t){const r=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=r,r}dispatchEvent(t){return!0}toString(){let t="";for(const r in this.attributes)t+=`${r}="${this.attributes[r]}" `;return`${this.tagName} ${t}`}}class Nl extends Ht{constructor(){super(...arguments),D(this,"currentTime"),D(this,"volume"),D(this,"paused"),D(this,"muted"),D(this,"playbackRate"),D(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}}class Ol extends Ht{constructor(){super(...arguments),D(this,"tagName","DIALOG"),D(this,"nodeName","DIALOG")}get isModal(){return this.getAttribute("rr_open_mode")==="modal"}get open(){return this.getAttribute("open")!==null}close(){this.removeAttribute("open"),this.removeAttribute("rr_open_mode")}show(){this.setAttribute("open",""),this.setAttribute("rr_open_mode","non-modal")}showModal(){this.setAttribute("open",""),this.setAttribute("rr_open_mode","modal")}}class ro extends ye{constructor(t){super(),D(this,"nodeType",3),D(this,"nodeName","#text"),D(this,"RRNodeType",W.Text),D(this,"data"),this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRText text=${JSON.stringify(this.data)}`}}class so extends ye{constructor(t){super(),D(this,"nodeType",8),D(this,"nodeName","#comment"),D(this,"RRNodeType",W.Comment),D(this,"data"),this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}class io extends ye{constructor(t){super(),D(this,"nodeName","#cdata-section"),D(this,"nodeType",4),D(this,"RRNodeType",W.CDATA),D(this,"data"),this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}class Il{constructor(t,r){if(D(this,"onChange"),D(this,"classes",[]),D(this,"add",(...s)=>{for(const i of s){const o=String(i);this.classes.indexOf(o)>=0||this.classes.push(o)}this.onChange&&this.onChange(this.classes.join(" "))}),D(this,"remove",(...s)=>{this.classes=this.classes.filter(i=>s.indexOf(i)===-1),this.onChange&&this.onChange(this.classes.join(" "))}),t){const s=t.trim().split(/\s+/);this.classes.push(...s)}this.onChange=r}}function Os(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 no(e,t,r){if(!r)return Os(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 oo(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 he=(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))(he||{});const is={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},Dl={altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};let ve=null;function Dt(e,t,r,s=t.mirror||t.ownerDocument.mirror){e=Al(e,t,r,s),ao(e,t,r,s),Tl(e,t,r)}function Al(e,t,r,s){var i;if(r.afterAppend&&!ve&&(ve=new WeakSet,setTimeout(()=>{ve=null},0)),!Is(e,t)){const o=At(t,r.mirror,s);(i=e.parentNode)==null||i.replaceChild(o,e),e=o}switch(t.RRNodeType){case W.Document:{if(!We(e,t,r.mirror,s)){const o=s.getMeta(t);o&&(r.mirror.removeNodeFromMap(e),e.close(),e.open(),r.mirror.add(e,o),ve==null||ve.add(e))}break}case W.Element:{const o=e,a=t;switch(a.tagName){case"IFRAME":{const u=e.contentDocument;if(!u)break;Dt(u,t.contentDocument,r,s);break}}a.shadowRoot&&(o.shadowRoot||o.attachShadow({mode:"open"}),ao(o.shadowRoot,a.shadowRoot,r,s)),_l(o,a,s);break}}return e}function Tl(e,t,r){var s;switch(t.RRNodeType){case W.Document:{const i=t.scrollData;i&&r.applyScroll(i,!0);break}case W.Element:{const i=e,o=t;switch(o.scrollData&&r.applyScroll(o.scrollData,!0),o.inputData&&r.applyInput(o.inputData),o.tagName){case"AUDIO":case"VIDEO":{const a=e,u=o;u.paused!==void 0&&(u.paused?a.pause():a.play()),u.muted!==void 0&&(a.muted=u.muted),u.volume!==void 0&&(a.volume=u.volume),u.currentTime!==void 0&&(a.currentTime=u.currentTime),u.playbackRate!==void 0&&(a.playbackRate=u.playbackRate),u.loop!==void 0&&(a.loop=u.loop);break}case"CANVAS":{const a=t;if(a.rr_dataURL!==null){const u=document.createElement("img");u.onload=()=>{const l=i.getContext("2d");l&&l.drawImage(u,0,0,u.width,u.height)},u.src=a.rr_dataURL}a.canvasMutations.forEach(u=>r.applyCanvas(u.event,u.mutation,e));break}case"STYLE":{const a=i.sheet;a&&t.rules.forEach(u=>r.applyStyleSheetMutation(u,a));break}case"DIALOG":{const a=i,u=o,l=a.open,c=a.matches("dialog:modal"),n=u.open,d=u.isModal,h=c!==d,f=l!==n;if((h||l&&f)&&a.close(),n&&(f||h))try{d?a.showModal():a.show()}catch(m){console.warn(m)}break}}break}case W.Text:case W.Comment:case W.CDATA:{e.textContent!==t.data&&(e.textContent=t.data);break}}ve!=null&&ve.has(e)&&(ve.delete(e),(s=r.afterAppend)==null||s.call(r,e,r.mirror.getId(e)))}function _l(e,t,r){const s=e.attributes,i=t.attributes;for(const o in i){const a=i[o],u=r.getMeta(t);if(u!=null&&u.isSVG&&is[o])e.setAttributeNS(is[o],o,a);else if(t.tagName==="CANVAS"&&o==="rr_dataURL"){const l=document.createElement("img");l.src=a,l.onload=()=>{const c=e.getContext("2d");c&&c.drawImage(l,0,0,l.width,l.height)}}else{if(t.tagName==="IFRAME"&&o==="srcdoc")continue;try{e.setAttribute(o,a)}catch(l){console.warn(l)}}}for(const{name:o}of Array.from(s))o in i||e.removeAttribute(o);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function ao(e,t,r,s){const i=Array.from(e.childNodes),o=t.childNodes;if(i.length===0&&o.length===0)return;let a=0,u=i.length-1,l=0,c=o.length-1,n=i[a],d=i[u],h=o[l],f=o[c],m,p;for(;a<=u&&l<=c;)if(n===void 0)n=i[++a];else if(d===void 0)d=i[--u];else if(We(n,h,r.mirror,s))n=i[++a],h=o[++l];else if(We(d,f,r.mirror,s))d=i[--u],f=o[--c];else if(We(n,f,r.mirror,s)){try{e.insertBefore(n,d.nextSibling)}catch(y){console.warn(y)}n=i[++a],f=o[--c]}else if(We(d,h,r.mirror,s)){try{e.insertBefore(d,n)}catch(y){console.warn(y)}d=i[--u],h=o[++l]}else{if(!m){m={};for(let w=a;w<=u;w++){const C=i[w];C&&r.mirror.hasNode(C)&&(m[r.mirror.getId(C)]=w)}}p=m[s.getId(h)];const y=i[p];if(p!==void 0&&y&&We(y,h,r.mirror,s)){try{e.insertBefore(y,n)}catch(w){console.warn(w)}i[p]=void 0}else{const w=At(h,r.mirror,s);e.nodeName==="#document"&&n&&(w.nodeType===w.DOCUMENT_TYPE_NODE&&n.nodeType===n.DOCUMENT_TYPE_NODE||w.nodeType===w.ELEMENT_NODE&&n.nodeType===n.ELEMENT_NODE)&&(e.removeChild(n),r.mirror.removeNodeFromMap(n),n=i[++a]);try{e.insertBefore(w,n||null)}catch(C){console.warn(C)}}h=o[++l]}if(a>u){const y=o[c+1];let w=null;for(y&&(w=r.mirror.getNode(s.getId(y)));l<=c;++l){const C=At(o[l],r.mirror,s);try{e.insertBefore(C,w)}catch(S){console.warn(S)}}}else if(l>c)for(;a<=u;a++){const y=i[a];if(!(!y||y.parentNode!==e))try{e.removeChild(y),r.mirror.removeNodeFromMap(y)}catch(w){console.warn(w)}}let g=e.firstChild,v=t.firstChild;for(;g!==null&&v!==null;)Dt(g,v,r,s),g=g.nextSibling,v=v.nextSibling}function At(e,t,r){const s=r.getId(e),i=r.getMeta(e);let o=null;if(s>-1&&(o=t.getNode(s)),o!==null&&Is(o,e))return o;switch(e.RRNodeType){case W.Document:o=new Document;break;case W.DocumentType:o=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case W.Element:{let a=e.tagName.toLowerCase();a=Dl[a]||a,i&&"isSVG"in i&&(i!=null&&i.isSVG)?o=document.createElementNS(is.svg,a):o=document.createElement(e.tagName);break}case W.Text:o=document.createTextNode(e.data);break;case W.Comment:o=document.createComment(e.data);break;case W.CDATA:o=document.createCDATASection(e.data);break}i&&t.add(o,P({},i));try{ve==null||ve.add(o)}catch(a){}return o}function Is(e,t){return e.nodeType!==t.nodeType?!1:e.nodeType!==e.ELEMENT_NODE||e.tagName.toUpperCase()===t.tagName}function We(e,t,r,s){const i=r.getId(e),o=s.getId(t);return i===-1||i!==o?!1:Is(e,t)}class Qe extends Ns{constructor(t){super(),D(this,"UNSERIALIZED_STARTING_ID",-2),D(this,"_unserializedId",this.UNSERIALIZED_STARTING_ID),D(this,"mirror",jl()),D(this,"scrollData",null),t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,r,s){return new Qe}createDocumentType(t,r,s){const i=new kl(t,r,s);return i.ownerDocument=this,i}createElement(t){const r=t.toUpperCase();let s;switch(r){case"AUDIO":case"VIDEO":s=new Pl(r);break;case"IFRAME":s=new Bl(r,this.mirror);break;case"CANVAS":s=new Fl(r);break;case"STYLE":s=new Ul(r);break;case"DIALOG":s=new Ll(r);break;default:s=new Yt(r);break}return s.ownerDocument=this,s}createComment(t){const r=new $l(t);return r.ownerDocument=this,r}createCDATASection(t){const r=new zl(t);return r.ownerDocument=this,r}createTextNode(t){const r=new Wl(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}}const kl=to;class Yt extends Ht{constructor(){super(...arguments),D(this,"inputData",null),D(this,"scrollData",null)}}class Pl extends Nl{}class Ll extends Ol{}class Fl extends Yt{constructor(){super(...arguments),D(this,"rr_dataURL",null),D(this,"canvasMutations",[])}getContext(){return null}}class Ul extends Yt{constructor(){super(...arguments),D(this,"rules",[])}}class Bl extends Yt{constructor(t,r){super(t),D(this,"contentDocument",new Qe),this.contentDocument.mirror=r}}const Wl=ro,$l=so,zl=io;function Vl(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function lo(e,t,r,s){let i;switch(e.nodeType){case he.DOCUMENT_NODE:s&&s.nodeName==="IFRAME"?i=s.contentDocument:(i=t,i.compatMode=e.compatMode);break;case he.DOCUMENT_TYPE_NODE:{const a=e;i=t.createDocumentType(a.name,a.publicId,a.systemId);break}case he.ELEMENT_NODE:{const a=e,u=Vl(a);i=t.createElement(u);const l=i;for(const{name:c,value:n}of Array.from(a.attributes))l.attributes[c]=n;a.scrollLeft&&(l.scrollLeft=a.scrollLeft),a.scrollTop&&(l.scrollTop=a.scrollTop);break}case he.TEXT_NODE:i=t.createTextNode(e.textContent||"");break;case he.CDATA_SECTION_NODE:i=t.createCDATASection(e.data);break;case he.COMMENT_NODE:i=t.createComment(e.textContent||"");break;case he.DOCUMENT_FRAGMENT_NODE:i=s.attachShadow({mode:"open"});break;default:return null}let o=r.getMeta(e);return t instanceof Qe&&(o||(o=uo(i,t.unserializedId),r.add(e,o)),t.mirror.add(i,P({},o))),i}function ql(e,t=ll(),r=new Qe){function s(i,o){const a=lo(i,r,t,o);if(a!==null)if((o==null?void 0:o.nodeName)!=="IFRAME"&&i.nodeType!==he.DOCUMENT_FRAGMENT_NODE&&(o==null||o.appendChild(a),a.parentNode=o,a.parentElement=o),i.nodeName==="IFRAME"){const u=i.contentDocument;u&&s(u,a)}else(i.nodeType===he.DOCUMENT_NODE||i.nodeType===he.ELEMENT_NODE||i.nodeType===he.DOCUMENT_FRAGMENT_NODE)&&(i.nodeType===he.ELEMENT_NODE&&i.shadowRoot&&s(i.shadowRoot,a),i.childNodes.forEach(u=>s(u,a)))}return s(e,null),r}function jl(){return new Gl}class Gl{constructor(){D(this,"idNodeMap",new Map),D(this,"nodeMetaMap",new WeakMap)}getId(t){var r;if(!t)return-1;const s=(r=this.getMeta(t))==null?void 0:r.id;return s!=null?s:-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){const 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){const s=r.id;this.idNodeMap.set(s,t),this.nodeMetaMap.set(t,r)}replace(t,r){const s=this.getNode(t);if(s){const i=this.nodeMetaMap.get(s);i&&this.nodeMetaMap.set(r,i)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function uo(e,t){switch(e.RRNodeType){case W.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case W.DocumentType:{const r=e;return{id:t,type:e.RRNodeType,name:r.name,publicId:r.publicId,systemId:r.systemId}}case W.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case W.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case W.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case W.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}const cn={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},hn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},gt={},co={},Hl=()=>!!globalThis.Zone;function Ds(e){if(gt[e])return gt[e];const t=globalThis[e],r=t.prototype,s=e in cn?cn[e]:void 0,i=!!(s&&s.every(u=>{var l,c;return!!((c=(l=Object.getOwnPropertyDescriptor(r,u))==null?void 0:l.get)!=null&&c.toString().includes("[native code]"))})),o=e in hn?hn[e]:void 0,a=!!(o&&o.every(u=>{var l;return typeof r[u]=="function"&&((l=r[u])==null?void 0:l.toString().includes("[native code]"))}));if(i&&a&&!Hl())return gt[e]=t.prototype,t.prototype;try{const u=document.createElement("iframe");u.style.display="none",document.body.appendChild(u);const l=u.contentWindow;if(!l)return t.prototype;const c=l[e].prototype;if(!c)return u.remove(),r;const n=navigator.userAgent;return n.includes("Safari")&&!n.includes("Chrome")?(u.classList.add("rr-block"),u.setAttribute("__rrwebUntaintedMutationObserver",""),co[e]=()=>u.remove()):u.remove(),gt[e]=c}catch(u){return r}}const Zr={};function xe(e,t,r){var s;const i=`${e}.${String(r)}`;if(Zr[i])return Zr[i].call(t);const o=Ds(e),a=(s=Object.getOwnPropertyDescriptor(o,r))==null?void 0:s.get;return a?(Zr[i]=a,a.call(t)):t[r]}const Kr={};function ho(e,t,r){const s=`${e}.${String(r)}`;if(Kr[s])return Kr[s].bind(t);const o=Ds(e)[r];return typeof o!="function"?t[r]:(Kr[s]=o,o.bind(t))}function Yl(e){return xe("Node",e,"ownerDocument")}function Xl(e){return xe("Node",e,"childNodes")}function Jl(e){return xe("Node",e,"parentNode")}function Ql(e){return xe("Node",e,"parentElement")}function Zl(e){return xe("Node",e,"textContent")}function Kl(e,t){return ho("Node",e,"contains")(t)}function eu(e){return ho("Node",e,"getRootNode")()}function tu(e){return!e||!("host"in e)?null:xe("ShadowRoot",e,"host")}function ru(e){return e.styleSheets}function su(e){return!e||!("shadowRoot"in e)?null:xe("Element",e,"shadowRoot")}function iu(e,t){return xe("Element",e,"querySelector")(t)}function nu(e,t){return xe("Element",e,"querySelectorAll")(t)}function fo(){var e;return[Ds("MutationObserver").constructor,(e=co.MutationObserver)!=null?e:()=>{}]}let Xe=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Xe=()=>new Date().getTime());function Fe(e,t,r){try{if(!(t in e))return()=>{};const s=e[t],i=r(s);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:s}})),e[t]=i,()=>{e[t]=s}}catch(s){return()=>{}}}const B={ownerDocument:Yl,childNodes:Xl,parentNode:Jl,parentElement:Ql,textContent:Zl,contains:Kl,getRootNode:eu,host:tu,styleSheets:ru,shadowRoot:su,querySelector:iu,querySelectorAll:nu,nowTimestamp:Xe,mutationObserverCtor:fo,patch:Fe};function ne(e,t,r=document){const s={capture:!0,passive:!0};return r.addEventListener(e,t,s),()=>r.removeEventListener(e,t,s)}const $e=`Please stop import mirror directly. Instead of that,\r
65
+ https://www.w3ctech.com/topic/2226`));let N=S(...I);return N.postcssPlugin=C,N.postcssVersion=new i().version,N}let R;return Object.defineProperty(E,"postcss",{get(){return R||(R=E()),R}}),E.process=function(I,N,F){return y([E(F)]).process(I,N)},E},y.stringify=o,y.parse=f,y.fromJSON=a,y.list=m,y.comment=w=>new c(w),y.atRule=w=>new n(w),y.decl=w=>new t(w),y.rule=w=>new p(w),y.root=w=>new g(w),y.document=w=>new u(w),y.CssSyntaxError=e,y.Declaration=t,y.Container=s,y.Processor=i,y.Document=u,y.Comment=c,y.Warning=l,y.AtRule=n,y.Result=d,y.Input=h,y.Rule=p,y.Root=g,y.Node=v,r.registerPostcss(y),os=y,y.default=y,os}var kl=Pl();const Q=El(kl);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 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||{});function Ll(e){const t={},r=/;(?![^(]*\))/g,s=/:(.+)/,i=/\/\*.*?\*\//g;return e.replace(i,"").split(r).forEach(function(o){if(o){const a=o.split(s);a.length>1&&(t[fs(a[0].trim())]=a[1].trim())}}),t}function Cn(e){const t=[];for(const r in e){const s=e[r];if(typeof s!="string")continue;const i=Bl(r);t.push(`${i}: ${s};`)}return t.join(" ")}const Fl=/-([a-z])/g,Ul=/^--[a-zA-Z0-9-]+$/,fs=e=>Ul.test(e)?e:e.replace(Fl,(t,r)=>r?r.toUpperCase():""),Wl=/\B([A-Z])/g,Bl=e=>e.replace(Wl,"-$1").toLowerCase();class ve{constructor(...t){D(this,"parentElement",null),D(this,"parentNode",null),D(this,"ownerDocument"),D(this,"firstChild",null),D(this,"lastChild",null),D(this,"previousSibling",null),D(this,"nextSibling",null),D(this,"ELEMENT_NODE",1),D(this,"TEXT_NODE",3),D(this,"nodeType"),D(this,"nodeName"),D(this,"RRNodeType")}get childNodes(){const t=[];let r=this.firstChild;for(;r;)t.push(r),r=r.nextSibling;return t}contains(t){if(t instanceof ve){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"}}class Fs extends ve{constructor(...t){super(t),D(this,"nodeType",9),D(this,"nodeName","#document"),D(this,"compatMode","CSS1Compat"),D(this,"RRNodeType",B.Document),D(this,"textContent",null),this.ownerDocument=this}get documentElement(){return this.childNodes.find(t=>t.RRNodeType===B.Element&&t.tagName==="HTML")||null}get body(){var t;return((t=this.documentElement)==null?void 0:t.childNodes.find(r=>r.RRNodeType===B.Element&&r.tagName==="BODY"))||null}get head(){var t;return((t=this.documentElement)==null?void 0:t.childNodes.find(r=>r.RRNodeType===B.Element&&r.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(t){const r=t.RRNodeType;if((r===B.Element||r===B.DocumentType)&&this.childNodes.some(i=>i.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${r===B.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const s=Us(this,t);return s.parentElement=null,s}insertBefore(t,r){const s=t.RRNodeType;if((s===B.Element||s===B.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===s))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${s===B.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const i=wo(this,t,r);return i.parentElement=null,i}removeChild(t){return vo(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){const s=this.createDocumentType("html",r,"");this.open(),this.appendChild(s)}}createDocument(t,r,s){return new Fs}createDocumentType(t,r,s){const i=new po(t,r,s);return i.ownerDocument=this,i}createElement(t){const r=new sr(t);return r.ownerDocument=this,r}createElementNS(t,r){return this.createElement(r)}createTextNode(t){const r=new mo(t);return r.ownerDocument=this,r}createComment(t){const r=new go(t);return r.ownerDocument=this,r}createCDATASection(t){const r=new yo(t);return r.ownerDocument=this,r}toString(){return"RRDocument"}}class po extends ve{constructor(t,r,s){super(),D(this,"nodeType",10),D(this,"RRNodeType",B.DocumentType),D(this,"name"),D(this,"publicId"),D(this,"systemId"),D(this,"textContent",null),this.name=t,this.publicId=r,this.systemId=s,this.nodeName=t}toString(){return"RRDocumentType"}}class sr extends ve{constructor(t){super(),D(this,"nodeType",1),D(this,"RRNodeType",B.Element),D(this,"tagName"),D(this,"attributes",{}),D(this,"shadowRoot",null),D(this,"scrollLeft"),D(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 Vl(this.attributes.class,t=>{this.attributes.class=t})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const t=this.attributes.style?Ll(this.attributes.style):{},r=/\B([A-Z])/g;return t.setProperty=(s,i,o)=>{if(r.test(s))return;const a=fs(s);i?t[a]=i:delete t[a],o==="important"&&(t[a]+=" !important"),this.attributes.style=Cn(t)},t.removeProperty=s=>{if(r.test(s))return"";const i=fs(s),o=t[i]||"";return delete t[i],this.attributes.style=Cn(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,s){this.setAttribute(r,s)}removeAttribute(t){delete this.attributes[t]}appendChild(t){return Us(this,t)}insertBefore(t,r){return wo(this,t,r)}removeChild(t){return vo(this,t)}attachShadow(t){const r=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=r,r}dispatchEvent(t){return!0}toString(){let t="";for(const r in this.attributes)t+=`${r}="${this.attributes[r]}" `;return`${this.tagName} ${t}`}}class $l extends sr{constructor(){super(...arguments),D(this,"currentTime"),D(this,"volume"),D(this,"paused"),D(this,"muted"),D(this,"playbackRate"),D(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}}class zl extends sr{constructor(){super(...arguments),D(this,"tagName","DIALOG"),D(this,"nodeName","DIALOG")}get isModal(){return this.getAttribute("rr_open_mode")==="modal"}get open(){return this.getAttribute("open")!==null}close(){this.removeAttribute("open"),this.removeAttribute("rr_open_mode")}show(){this.setAttribute("open",""),this.setAttribute("rr_open_mode","non-modal")}showModal(){this.setAttribute("open",""),this.setAttribute("rr_open_mode","modal")}}class mo extends ve{constructor(t){super(),D(this,"nodeType",3),D(this,"nodeName","#text"),D(this,"RRNodeType",B.Text),D(this,"data"),this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRText text=${JSON.stringify(this.data)}`}}class go extends ve{constructor(t){super(),D(this,"nodeType",8),D(this,"nodeName","#comment"),D(this,"RRNodeType",B.Comment),D(this,"data"),this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}class yo extends ve{constructor(t){super(),D(this,"nodeName","#cdata-section"),D(this,"nodeType",4),D(this,"RRNodeType",B.CDATA),D(this,"data"),this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}class Vl{constructor(t,r){if(D(this,"onChange"),D(this,"classes",[]),D(this,"add",(...s)=>{for(const i of s){const o=String(i);this.classes.indexOf(o)>=0||this.classes.push(o)}this.onChange&&this.onChange(this.classes.join(" "))}),D(this,"remove",(...s)=>{this.classes=this.classes.filter(i=>s.indexOf(i)===-1),this.onChange&&this.onChange(this.classes.join(" "))}),t){const s=t.trim().split(/\s+/);this.classes.push(...s)}this.onChange=r}}function Us(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 wo(e,t,r){if(!r)return Us(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 vo(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 he=(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))(he||{});const ds={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},jl={altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};let be=null;function Ft(e,t,r,s=t.mirror||t.ownerDocument.mirror){e=ql(e,t,r,s),So(e,t,r,s),Gl(e,t,r)}function ql(e,t,r,s){var i;if(r.afterAppend&&!be&&(be=new WeakSet,setTimeout(()=>{be=null},0)),!Ws(e,t)){const o=Ut(t,r.mirror,s);(i=e.parentNode)==null||i.replaceChild(o,e),e=o}switch(t.RRNodeType){case B.Document:{if(!Ve(e,t,r.mirror,s)){const o=s.getMeta(t);o&&(r.mirror.removeNodeFromMap(e),e.close(),e.open(),r.mirror.add(e,o),be==null||be.add(e))}break}case B.Element:{const o=e,a=t;switch(a.tagName){case"IFRAME":{const u=e.contentDocument;if(!u)break;Ft(u,t.contentDocument,r,s);break}}a.shadowRoot&&(o.shadowRoot||o.attachShadow({mode:"open"}),So(o.shadowRoot,a.shadowRoot,r,s)),Hl(o,a,s);break}}return e}function Gl(e,t,r){var s;switch(t.RRNodeType){case B.Document:{const i=t.scrollData;i&&r.applyScroll(i,!0);break}case B.Element:{const i=e,o=t;switch(o.scrollData&&r.applyScroll(o.scrollData,!0),o.inputData&&r.applyInput(o.inputData),o.tagName){case"AUDIO":case"VIDEO":{const a=e,u=o;u.paused!==void 0&&(u.paused?a.pause():a.play()),u.muted!==void 0&&(a.muted=u.muted),u.volume!==void 0&&(a.volume=u.volume),u.currentTime!==void 0&&(a.currentTime=u.currentTime),u.playbackRate!==void 0&&(a.playbackRate=u.playbackRate),u.loop!==void 0&&(a.loop=u.loop);break}case"CANVAS":{const a=t;if(a.rr_dataURL!==null){const u=document.createElement("img");u.onload=()=>{const l=i.getContext("2d");l&&l.drawImage(u,0,0,u.width,u.height)},u.src=a.rr_dataURL}a.canvasMutations.forEach(u=>r.applyCanvas(u.event,u.mutation,e));break}case"STYLE":{const a=i.sheet;a&&t.rules.forEach(u=>r.applyStyleSheetMutation(u,a));break}case"DIALOG":{const a=i,u=o,l=a.open,c=a.matches("dialog:modal"),n=u.open,d=u.isModal,h=c!==d,f=l!==n;if((h||l&&f)&&a.close(),n&&(f||h))try{d?a.showModal():a.show()}catch(m){console.warn(m)}break}}break}case B.Text:case B.Comment:case B.CDATA:{e.textContent!==t.data&&(e.textContent=t.data);break}}be!=null&&be.has(e)&&(be.delete(e),(s=r.afterAppend)==null||s.call(r,e,r.mirror.getId(e)))}function Hl(e,t,r){const s=e.attributes,i=t.attributes;for(const o in i){const a=i[o],u=r.getMeta(t);if(u!=null&&u.isSVG&&ds[o])e.setAttributeNS(ds[o],o,a);else if(t.tagName==="CANVAS"&&o==="rr_dataURL"){const l=document.createElement("img");l.src=a,l.onload=()=>{const c=e.getContext("2d");c&&c.drawImage(l,0,0,l.width,l.height)}}else{if(t.tagName==="IFRAME"&&o==="srcdoc")continue;try{e.setAttribute(o,a)}catch(l){console.warn(l)}}}for(const{name:o}of Array.from(s))o in i||e.removeAttribute(o);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function So(e,t,r,s){const i=Array.from(e.childNodes),o=t.childNodes;if(i.length===0&&o.length===0)return;let a=0,u=i.length-1,l=0,c=o.length-1,n=i[a],d=i[u],h=o[l],f=o[c],m,p;for(;a<=u&&l<=c;)if(n===void 0)n=i[++a];else if(d===void 0)d=i[--u];else if(Ve(n,h,r.mirror,s))n=i[++a],h=o[++l];else if(Ve(d,f,r.mirror,s))d=i[--u],f=o[--c];else if(Ve(n,f,r.mirror,s)){try{e.insertBefore(n,d.nextSibling)}catch(y){console.warn(y)}n=i[++a],f=o[--c]}else if(Ve(d,h,r.mirror,s)){try{e.insertBefore(d,n)}catch(y){console.warn(y)}d=i[--u],h=o[++l]}else{if(!m){m={};for(let w=a;w<=u;w++){const C=i[w];C&&r.mirror.hasNode(C)&&(m[r.mirror.getId(C)]=w)}}p=m[s.getId(h)];const y=i[p];if(p!==void 0&&y&&Ve(y,h,r.mirror,s)){try{e.insertBefore(y,n)}catch(w){console.warn(w)}i[p]=void 0}else{const w=Ut(h,r.mirror,s);e.nodeName==="#document"&&n&&(w.nodeType===w.DOCUMENT_TYPE_NODE&&n.nodeType===n.DOCUMENT_TYPE_NODE||w.nodeType===w.ELEMENT_NODE&&n.nodeType===n.ELEMENT_NODE)&&(e.removeChild(n),r.mirror.removeNodeFromMap(n),n=i[++a]);try{e.insertBefore(w,n||null)}catch(C){console.warn(C)}}h=o[++l]}if(a>u){const y=o[c+1];let w=null;for(y&&(w=r.mirror.getNode(s.getId(y)));l<=c;++l){const C=Ut(o[l],r.mirror,s);try{e.insertBefore(C,w)}catch(S){console.warn(S)}}}else if(l>c)for(;a<=u;a++){const y=i[a];if(!(!y||y.parentNode!==e))try{e.removeChild(y),r.mirror.removeNodeFromMap(y)}catch(w){console.warn(w)}}let g=e.firstChild,v=t.firstChild;for(;g!==null&&v!==null;)Ft(g,v,r,s),g=g.nextSibling,v=v.nextSibling}function Ut(e,t,r){const s=r.getId(e),i=r.getMeta(e);let o=null;if(s>-1&&(o=t.getNode(s)),o!==null&&Ws(o,e))return o;switch(e.RRNodeType){case B.Document:o=new Document;break;case B.DocumentType:o=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case B.Element:{let a=e.tagName.toLowerCase();a=jl[a]||a,i&&"isSVG"in i&&(i!=null&&i.isSVG)?o=document.createElementNS(ds.svg,a):o=document.createElement(e.tagName);break}case B.Text:o=document.createTextNode(e.data);break;case B.Comment:o=document.createComment(e.data);break;case B.CDATA:o=document.createCDATASection(e.data);break}i&&t.add(o,k({},i));try{be==null||be.add(o)}catch(a){}return o}function Ws(e,t){return e.nodeType!==t.nodeType?!1:e.nodeType!==e.ELEMENT_NODE||e.tagName.toUpperCase()===t.tagName}function Ve(e,t,r,s){const i=r.getId(e),o=s.getId(t);return i===-1||i!==o?!1:Ws(e,t)}class tt extends Fs{constructor(t){super(),D(this,"UNSERIALIZED_STARTING_ID",-2),D(this,"_unserializedId",this.UNSERIALIZED_STARTING_ID),D(this,"mirror",nu()),D(this,"scrollData",null),t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,r,s){return new tt}createDocumentType(t,r,s){const i=new Yl(t,r,s);return i.ownerDocument=this,i}createElement(t){const r=t.toUpperCase();let s;switch(r){case"AUDIO":case"VIDEO":s=new Xl(r);break;case"IFRAME":s=new Kl(r,this.mirror);break;case"CANVAS":s=new Ql(r);break;case"STYLE":s=new Zl(r);break;case"DIALOG":s=new Jl(r);break;default:s=new ir(r);break}return s.ownerDocument=this,s}createComment(t){const r=new tu(t);return r.ownerDocument=this,r}createCDATASection(t){const r=new ru(t);return r.ownerDocument=this,r}createTextNode(t){const r=new eu(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}}const Yl=po;class ir extends sr{constructor(){super(...arguments),D(this,"inputData",null),D(this,"scrollData",null)}}class Xl extends $l{}class Jl extends zl{}class Ql extends ir{constructor(){super(...arguments),D(this,"rr_dataURL",null),D(this,"canvasMutations",[])}getContext(){return null}}class Zl extends ir{constructor(){super(...arguments),D(this,"rules",[])}}class Kl extends ir{constructor(t,r){super(t),D(this,"contentDocument",new tt),this.contentDocument.mirror=r}}const eu=mo,tu=go,ru=yo;function su(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function bo(e,t,r,s){let i;switch(e.nodeType){case he.DOCUMENT_NODE:s&&s.nodeName==="IFRAME"?i=s.contentDocument:(i=t,i.compatMode=e.compatMode);break;case he.DOCUMENT_TYPE_NODE:{const a=e;i=t.createDocumentType(a.name,a.publicId,a.systemId);break}case he.ELEMENT_NODE:{const a=e,u=su(a);i=t.createElement(u);const l=i;for(const{name:c,value:n}of Array.from(a.attributes))l.attributes[c]=n;a.scrollLeft&&(l.scrollLeft=a.scrollLeft),a.scrollTop&&(l.scrollTop=a.scrollTop);break}case he.TEXT_NODE:i=t.createTextNode(e.textContent||"");break;case he.CDATA_SECTION_NODE:i=t.createCDATASection(e.data);break;case he.COMMENT_NODE:i=t.createComment(e.textContent||"");break;case he.DOCUMENT_FRAGMENT_NODE:i=s.attachShadow({mode:"open"});break;default:return null}let o=r.getMeta(e);return t instanceof tt&&(o||(o=Co(i,t.unserializedId),r.add(e,o)),t.mirror.add(i,k({},o))),i}function iu(e,t=Cl(),r=new tt){function s(i,o){const a=bo(i,r,t,o);if(a!==null)if((o==null?void 0:o.nodeName)!=="IFRAME"&&i.nodeType!==he.DOCUMENT_FRAGMENT_NODE&&(o==null||o.appendChild(a),a.parentNode=o,a.parentElement=o),i.nodeName==="IFRAME"){const u=i.contentDocument;u&&s(u,a)}else(i.nodeType===he.DOCUMENT_NODE||i.nodeType===he.ELEMENT_NODE||i.nodeType===he.DOCUMENT_FRAGMENT_NODE)&&(i.nodeType===he.ELEMENT_NODE&&i.shadowRoot&&s(i.shadowRoot,a),i.childNodes.forEach(u=>s(u,a)))}return s(e,null),r}function nu(){return new ou}class ou{constructor(){D(this,"idNodeMap",new Map),D(this,"nodeMetaMap",new WeakMap)}getId(t){var r;if(!t)return-1;const s=(r=this.getMeta(t))==null?void 0:r.id;return s!=null?s:-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){const 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){const s=r.id;this.idNodeMap.set(s,t),this.nodeMetaMap.set(t,r)}replace(t,r){const s=this.getNode(t);if(s){const i=this.nodeMetaMap.get(s);i&&this.nodeMetaMap.set(r,i)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Co(e,t){switch(e.RRNodeType){case B.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case B.DocumentType:{const r=e;return{id:t,type:e.RRNodeType,name:r.name,publicId:r.publicId,systemId:r.systemId}}case B.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case B.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case B.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case B.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}const En={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[],EventTarget:[]},xn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"],EventTarget:["addEventListener","removeEventListener"]},bt={},Eo={},au=()=>!!globalThis.Zone;function Bs(e){if(bt[e])return bt[e];const t=globalThis[e],r=t.prototype,s=e in En?En[e]:void 0,i=!!(s&&s.every(u=>{var l,c;return!!((c=(l=Object.getOwnPropertyDescriptor(r,u))==null?void 0:l.get)!=null&&c.toString().includes("[native code]"))})),o=e in xn?xn[e]:void 0,a=!!(o&&o.every(u=>{var l;return typeof r[u]=="function"&&((l=r[u])==null?void 0:l.toString().includes("[native code]"))}));if(i&&a&&!au())return bt[e]=t.prototype,t.prototype;try{const u=document.createElement("iframe");u.style.display="none",document.body.appendChild(u);const l=u.contentWindow;if(!l)return t.prototype;const c=l[e].prototype;if(!c)return u.remove(),r;const n=navigator.userAgent;return n.includes("Safari")&&!n.includes("Chrome")?(u.classList.add("rr-block"),u.setAttribute("__rrwebUntaintedMutationObserver",""),Eo[e]=()=>u.remove()):u.remove(),bt[e]=c}catch(u){return r}}const as={};function We(e,t,r){var s;const i=`${e}.${String(r)}`;if(as[i])return as[i].call(t);const o=Bs(e),a=(s=Object.getOwnPropertyDescriptor(o,r))==null?void 0:s.get;return a?(as[i]=a,a.call(t)):t[r]}const ls={};function Ze(e,t,r){const s=`${e}.${String(r)}`;if(ls[s])return ls[s].bind(t);const o=Bs(e)[r];return typeof o!="function"?t[r]:(ls[s]=o,o.bind(t))}function lu(e){return We("Node",e,"ownerDocument")}function uu(e){return We("Node",e,"childNodes")}function cu(e){return We("Node",e,"parentNode")}function hu(e){return We("Node",e,"parentElement")}function fu(e){return We("Node",e,"textContent")}function du(e,t){return Ze("Node",e,"contains")(t)}function pu(e){return Ze("Node",e,"getRootNode")()}function mu(e){return!e||!("host"in e)?null:We("ShadowRoot",e,"host")}function gu(e){return e.styleSheets}function yu(e){return!e||!("shadowRoot"in e)?null:We("Element",e,"shadowRoot")}function wu(e,t){return Ze("Element",e,"querySelector")(t)}function vu(e,t){return Ze("Element",e,"querySelectorAll")(t)}function xo(){var e;return[Bs("MutationObserver").constructor,(e=Eo.MutationObserver)!=null?e:()=>{}]}function Mo(){var r;var e;let t=globalThis.Proxy;try{if(typeof t!="function"||!Function.prototype.toString.call(t).includes("[native code]")){const s=document.createElement("iframe");s.style.display="none",document.documentElement.appendChild(s),t=(r=(e=s.contentWindow)==null?void 0:e.Proxy)!=null?r:t,document.documentElement.removeChild(s)}}catch(s){}return t}let Ke=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Ke=()=>new Date().getTime());const Wt=new WeakMap;let Bt="";(function(){var a;var t;const r=Function.prototype.toString;Bt=r.call(r);let s=globalThis.Proxy;try{if(typeof s!="function"||!r.call(s).includes("[native code]")){const u=document.createElement("iframe");u.style.display="none",document.documentElement.appendChild(u),s=(a=(t=u.contentWindow)==null?void 0:t.Proxy)!=null?a:s,document.documentElement.removeChild(u)}}catch(u){}const i=Object.getPrototypeOf(r),o=new s(r,{apply(u,l,c){const n=Wt.get(l);return n!==void 0?n:l!=null&&typeof l=="function"&&!i.isPrototypeOf(l.toString)?l.toString():u.apply(l,c)}});Wt.set(o,Bt),Object.defineProperty(Function.prototype,"toString",{value:o,configurable:!0,writable:!0})})();function ge(e,t){const r=e.name||t.name||"";return Wt.set(e,Bt.replace("toString",r)),e}function Be(e,t,r){try{if(!(t in e))return()=>{};const s=e[t],i=r(s);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:s}}),Wt.set(i,Bt.replace("toString",t))),e[t]=i,()=>{e[t]=s}}catch(s){return()=>{}}}const W={ownerDocument:lu,childNodes:uu,parentNode:cu,parentElement:hu,textContent:fu,contains:du,getRootNode:pu,host:mu,styleSheets:gu,shadowRoot:yu,querySelector:wu,querySelectorAll:vu,nowTimestamp:Ke,mutationObserverCtor:xo,patch:Be,makeNativeFn:ge,getUntaintedProxy:Mo};function ne(e,t,r=document){const s={capture:!0,passive:!0},i=r;return Ze("EventTarget",i,"addEventListener")(e,t,s),()=>Ze("EventTarget",i,"removeEventListener")(e,t,s)}const je=`Please stop import mirror directly. Instead of that,\r
66
66
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
67
- or you can use record.mirror to access the mirror instance during recording.`;exports.mirror={map:{},getId(){return console.error($e),-1},getNode(){return console.error($e),null},removeNodeFromMap(){console.error($e)},has(){return console.error($e),!1},reset(){console.error($e)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(exports.mirror=new Proxy(exports.mirror,{get(e,t,r){return t==="map"&&console.error($e),Reflect.get(e,t,r)}}));function Je(e,t,r={}){let s=null,i=0;return function(...o){const a=Date.now();!i&&r.leading===!1&&(i=a);const u=t-(a-i),l=this;u<=0||u>t?(s&&(clearTimeout(s),s=null),i=a,e.apply(l,o)):!s&&r.trailing!==!1&&(s=setTimeout(()=>{i=r.leading===!1?0:Date.now(),s=null,e.apply(l,o)},u))}}function at(e,t,r,s,i=window){const o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,s?r:{set(a){setTimeout(()=>{r.set.call(this,a)},0),o&&o.set&&o.set.call(this,a)}}),()=>at(e,t,o||{},!0)}function As(e){var t,r,s,i;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:o.documentElement.scrollLeft||(o==null?void 0:o.body)&&((t=B.parentElement(o.body))==null?void 0:t.scrollLeft)||((r=o==null?void 0:o.body)==null?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:(o==null?void 0:o.documentElement.scrollTop)||(o==null?void 0:o.body)&&((s=B.parentElement(o.body))==null?void 0:s.scrollTop)||((i=o==null?void 0:o.body)==null?void 0:i.scrollTop)||0}}function Ts(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function _s(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ks(e){return e?e.nodeType===e.ELEMENT_NODE?e:B.parentElement(e):null}function oe(e,t,r,s){if(!e)return!1;const i=ks(e);if(!i)return!1;try{if(typeof t=="string"){if(i.classList.contains(t)||s&&i.closest("."+t)!==null)return!0}else if(It(i,t,s))return!0}catch(o){}return!!(r&&(i.matches(r)||s&&i.closest(r)!==null))}function po(e,t){return t.getId(e)!==-1}function Et(e,t,r){return e.tagName==="TITLE"&&r.headTitleMutations?!0:t.getId(e)===it}function Ps(e,t){if(et(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const s=B.parentNode(e);return s&&s.nodeType===e.DOCUMENT_NODE?!1:s?Ps(s,t):!0}function Tt(e){return!!e.changedTouches}function Ls(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 mo(e){const t={},r=(i,o)=>{const a={value:i,parent:o,children:[]};return t[i.node.id]=a,a},s=[];for(const i of e){const{nextId:o,parentId:a}=i;if(o&&o in t){const u=t[o];if(u.parent){const l=u.parent.children.indexOf(u);u.parent.children.splice(l,0,r(i,u.parent))}else{const l=s.indexOf(u);s.splice(l,0,r(i,null))}continue}if(a in t){const u=t[a];u.children.push(r(i,u));continue}s.push(r(i,null))}return s}function Fs(e,t){t(e.value);for(let r=e.children.length-1;r>=0;r--)Fs(e.children[r],t)}function Ye(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Us(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Bs(e,t){var r,s;const i=(s=(r=e.ownerDocument)==null?void 0:r.defaultView)==null?void 0:s.frameElement;if(!i||i===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const o=i.getBoundingClientRect(),a=Bs(i,t),u=o.height/i.clientHeight;return{x:o.x*a.relativeScale+a.x,y:o.y*a.relativeScale+a.y,relativeScale:u,absoluteScale:a.absoluteScale*u}}function Ie(e){return e?e instanceof ye&&"shadowRoot"in e?!!e.shadowRoot:!!B.shadowRoot(e):!1}function je(e,t){const r=e==null?void 0:e[t[0]];return r?t.length===1?r:je(r.cssRules,t.slice(1)):null}function ns(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function go(e){const t=new Set,r=[];for(let s=e.length;s--;){const i=e[s];t.has(i.id)||(r.push(i),t.add(i.id))}return r}class Ws{constructor(){R(this,"id",1),R(this,"styleIDMap",new WeakMap),R(this,"idStyleMap",new Map)}getId(t){var r;return(r=this.styleIDMap.get(t))!=null?r:-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 $s(e){var t;let r=null;return"getRootNode"in e&&((t=B.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&B.host(B.getRootNode(e))&&(r=B.host(B.getRootNode(e))),r}function yo(e){let t=e,r;for(;r=$s(t);)t=r;return t}function wo(e){const t=B.ownerDocument(e);if(!t)return!1;const r=yo(e);return B.contains(t,r)}function zs(e){const t=B.ownerDocument(e);return t?B.contains(t,e)||wo(e):!1}const ou=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:Ws,get _mirror(){return exports.mirror},closestElementOfNode:ks,getBaseDimension:Bs,getNestedRule:je,getPositionsAndIndex:ns,getRootShadowHost:yo,getShadowHost:$s,getWindowHeight:Ts,getWindowScroll:As,getWindowWidth:_s,hasShadowRoot:Ie,hookSetter:at,inDom:zs,isAncestorRemoved:Ps,isBlocked:oe,isIgnored:Et,isSerialized:po,isSerializedIframe:Ye,isSerializedStylesheet:Us,iterateResolveTree:Fs,legacy_isTouchEvent:Tt,get nowTimestamp(){return Xe},on:ne,polyfill:Ls,queueToResolveTrees:mo,shadowHostInDom:wo,throttle:Je,uniqueTextMutations:go},Symbol.toStringTag,{value:"Module"}));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))(_||{}),A=(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))(A||{}),V=(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))(V||{}),Se=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Se||{}),Ce=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Ce||{}),Oe=(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))(Oe||{}),z=(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.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e.Destroy="destroy",e))(z||{}),be=(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))(be||{});function fn(e){return"__ln"in e}class au{constructor(){R(this,"length",0),R(this,"head",null),R(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let s=0;s<t;s++)r=(r==null?void 0:r.next)||null;return r}addNode(t){const r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&fn(t.previousSibling)){const s=t.previousSibling.__ln.next;r.next=s,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,s&&(s.previous=r)}else if(t.nextSibling&&fn(t.nextSibling)&&t.nextSibling.__ln.previous){const s=t.nextSibling.__ln.previous;r.previous=s,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,s&&(s.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;r.next===null&&(this.tail=r),this.length++}removeNode(t){const r=t.__ln;this.head&&(r.previous?(r.previous.next=r.next,r.next?r.next.previous=r.previous:this.tail=r.previous):(this.head=r.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}const dn=(e,t)=>`${e}@${t}`;class lu{constructor(){R(this,"frozen",!1),R(this,"locked",!1),R(this,"texts",[]),R(this,"attributes",[]),R(this,"attributeMap",new WeakMap),R(this,"removes",[]),R(this,"mapRemoves",[]),R(this,"movedMap",{}),R(this,"addedSet",new Set),R(this,"movedSet",new Set),R(this,"droppedSet",new Set),R(this,"removesSubTreeCache",new Set),R(this,"mutationCb"),R(this,"blockClass"),R(this,"blockSelector"),R(this,"maskTextClass"),R(this,"maskTextSelector"),R(this,"inlineStylesheet"),R(this,"maskInputOptions"),R(this,"maskTextFn"),R(this,"maskInputFn"),R(this,"keepIframeSrcFn"),R(this,"recordCanvas"),R(this,"inlineImages"),R(this,"slimDOMOptions"),R(this,"dataURLOptions"),R(this,"doc"),R(this,"mirror"),R(this,"iframeManager"),R(this,"stylesheetManager"),R(this,"shadowDomManager"),R(this,"canvasManager"),R(this,"processedNodeManager"),R(this,"unattachedDoc"),R(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),R(this,"emit",()=>{if(this.frozen||this.locked)return;const t=[],r=new Set,s=new au,i=l=>{let c=l,n=it;for(;n===it;)c=c&&c.nextSibling,n=c&&this.mirror.getId(c);return n},o=l=>{const c=B.parentNode(l);if(!c||!zs(l))return;let n=!1;if(l.nodeType===Node.TEXT_NODE){const m=c.tagName;if(m==="TEXTAREA")return;m==="STYLE"&&this.addedSet.has(c)&&(n=!0)}const d=et(c)?this.mirror.getId($s(l)):this.mirror.getId(c),h=i(l);if(d===-1||h===-1)return s.addNode(l);const f=qe(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:m=>{Ye(m,this.mirror)&&this.iframeManager.addIframe(m),Us(m,this.mirror)&&this.stylesheetManager.trackLinkElement(m),Ie(l)&&this.shadowDomManager.addShadowRoot(B.shadowRoot(l),this.doc)},onIframeLoad:(m,p)=>{this.iframeManager.attachIframe(m,p),this.shadowDomManager.observeAttachShadow(m)},onStylesheetLoad:(m,p)=>{this.stylesheetManager.attachLinkElement(m,p)},cssCaptured:n});f&&(t.push({parentId:d,nextId:h,node:f}),r.add(f.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const l of this.movedSet)pn(this.removesSubTreeCache,l,this.mirror)&&!this.movedSet.has(B.parentNode(l))||o(l);for(const l of this.addedSet)!mn(this.droppedSet,l)&&!pn(this.removesSubTreeCache,l,this.mirror)||mn(this.movedSet,l)?o(l):this.droppedSet.add(l);let a=null;for(;s.length;){let l=null;if(a){const c=this.mirror.getId(B.parentNode(a.value)),n=i(a.value);c!==-1&&n!==-1&&(l=a)}if(!l){let c=s.tail;for(;c;){const n=c;if(c=c.previous,n){const d=this.mirror.getId(B.parentNode(n.value));if(i(n.value)===-1)continue;if(d!==-1){l=n;break}else{const f=n.value,m=B.parentNode(f);if(m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const p=B.host(m);if(this.mirror.getId(p)!==-1){l=n;break}}}}}}if(!l){for(;s.head;)s.removeNode(s.head.value);break}a=l.previous,s.removeNode(l.value),o(l.value)}const u={texts:this.texts.map(l=>{const c=l.node,n=B.parentNode(c);return n&&n.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(n),{id:this.mirror.getId(c),value:l.value}}).filter(l=>!r.has(l.id)).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>{const{attributes:c}=l;if(typeof c.style=="string"){const n=JSON.stringify(l.styleDiff),d=JSON.stringify(l._unchangedStyles);n.length<c.style.length&&(n+d).split("var(").length===c.style.split("var(").length&&(c.style=l.styleDiff)}return{id:this.mirror.getId(l.node),attributes:c}}).filter(l=>!r.has(l.id)).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:t};!u.texts.length&&!u.attributes.length&&!u.removes.length&&!u.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(u))}),R(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));const s=Array.from(B.childNodes(t),i=>B.textContent(i)||"").join("");r.attributes.value=Mt({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Nt(t),value:s,maskInputFn:this.maskInputFn})}),R(this,"processMutation",t=>{if(!Et(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{const r=B.textContent(t.target);!oe(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:Un(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,ks(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let s=t.attributeName,i=t.target.getAttribute(s);if(s==="value"){const a=Nt(r);i=Mt({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:a,value:i,maskInputFn:this.maskInputFn})}if(oe(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue)return;let o=this.attributeMap.get(t.target);if(r.tagName==="IFRAME"&&s==="src"&&!this.keepIframeSrcFn(i))if(!r.contentDocument)s="rr_src";else return;if(o||(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(t.target,o)),s==="type"&&r.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!Fn(r.tagName,s))if(o.attributes[s]=Ln(this.doc,Ae(r.tagName),Ae(s),i),s==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(u){this.unattachedDoc=this.doc}const a=this.unattachedDoc.createElement("span");t.oldValue&&a.setAttribute("style",t.oldValue);for(const u of Array.from(r.style)){const l=r.style.getPropertyValue(u),c=r.style.getPropertyPriority(u);l!==a.style.getPropertyValue(u)||c!==a.style.getPropertyPriority(u)?c===""?o.styleDiff[u]=l:o.styleDiff[u]=[l,c]:o._unchangedStyles[u]=[l,c]}for(const u of Array.from(a.style))r.style.getPropertyValue(u)===""&&(o.styleDiff[u]=!1)}else s==="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(oe(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=>{const s=this.mirror.getId(r),i=et(t.target)?this.mirror.getId(B.host(t.target)):this.mirror.getId(t.target);oe(t.target,this.blockClass,this.blockSelector,!1)||Et(r,this.mirror,this.slimDOMOptions)||!po(r,this.mirror)||(this.addedSet.has(r)?(os(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&s===-1||Ps(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[dn(s,i)]?os(this.movedSet,r):(this.removes.push({parentId:i,id:s,isShadow:et(t.target)&&tt(t.target)?!0:void 0}),uu(r,this.removesSubTreeCache))),this.mapRemoves.push(r))});break}}}),R(this,"genAdds",(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Et(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[dn(this.mirror.getId(t),s)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);oe(t,this.blockClass,this.blockSelector,!1)||(B.childNodes(t).forEach(s=>this.genAdds(s)),Ie(t)&&B.childNodes(B.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","canvasManager","processedNodeManager"].forEach(r=>{this[r]=t[r]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function os(e,t){e.delete(t),B.childNodes(t).forEach(r=>os(e,r))}function uu(e,t){const r=[e];for(;r.length;){const s=r.pop();t.has(s)||(t.add(s),B.childNodes(s).forEach(i=>r.push(i)))}}function pn(e,t,r){return e.size===0?!1:cu(e,t)}function cu(e,t,r){const s=B.parentNode(t);return s?e.has(s):!1}function mn(e,t){return e.size===0?!1:vo(e,t)}function vo(e,t){const r=B.parentNode(t);return r?e.has(r)?!0:vo(e,r):!1}let st;function hu(e){st=e}function fu(){st=void 0}const $=e=>st?(...r)=>{try{return e(...r)}catch(s){if(st&&st(s)===!0)return;throw s}}:e,ke=[];function lt(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(t){}return e&&e.target}function So(e,t){const r=new lu;ke.push(r),r.init(e);const[s,i]=fo(),o=new s($(r.processMutations.bind(r)));return o.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[o,i]}function du({mousemoveCb:e,sampling:t,doc:r,mirror:s}){if(t.mousemove===!1)return()=>{};const i=typeof t.mousemove=="number"?t.mousemove:50,o=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let a=[],u;const l=Je($(d=>{const h=Date.now()-u;e(a.map(f=>(f.timeOffset-=h,f)),d),a=[],u=null}),o),c=$(Je($(d=>{const h=lt(d),{clientX:f,clientY:m}=Tt(d)?d.changedTouches[0]:d;u||(u=Xe()),a.push({x:f,y:m,id:s.getId(h),timeOffset:Xe()-u}),l(typeof DragEvent!="undefined"&&d instanceof DragEvent?A.Drag:d instanceof MouseEvent?A.MouseMove:A.TouchMove)}),i,{trailing:!1})),n=[ne("mousemove",c,r),ne("touchmove",c,r),ne("drag",c,r)];return $(()=>{n.forEach(d=>d())})}function pu({mouseInteractionCb:e,doc:t,mirror:r,blockClass:s,blockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const a=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,u=[];let l=null;const c=n=>d=>{const h=lt(d);if(oe(h,s,i,!0))return;let f=null,m=n;if("pointerType"in d){switch(d.pointerType){case"mouse":f=Se.Mouse;break;case"touch":f=Se.Touch;break;case"pen":f=Se.Pen;break}f===Se.Touch?V[n]===V.MouseDown?m="TouchStart":V[n]===V.MouseUp&&(m="TouchEnd"):Se.Pen}else Tt(d)&&(f=Se.Touch);f!==null?(l=f,(m.startsWith("Touch")&&f===Se.Touch||m.startsWith("Mouse")&&f===Se.Mouse)&&(f=null)):V[n]===V.Click&&(f=l,l=null);const p=Tt(d)?d.changedTouches[0]:d;if(!p)return;const g=r.getId(h),{clientX:v,clientY:y}=p;$(e)(P({type:V[m],id:g,x:v,y},f!==null&&{pointerType:f}))};return Object.keys(V).filter(n=>Number.isNaN(Number(n))&&!n.endsWith("_Departed")&&a[n]!==!1).forEach(n=>{let d=Ae(n);const h=c(n);if(window.PointerEvent)switch(V[n]){case V.MouseDown:case V.MouseUp:d=d.replace("mouse","pointer");break;case V.TouchStart:case V.TouchEnd:return}u.push(ne(d,h,t))}),$(()=>{u.forEach(n=>n())})}function bo({scrollCb:e,doc:t,mirror:r,blockClass:s,blockSelector:i,sampling:o}){const a=$(Je($(u=>{const l=lt(u);if(!l||oe(l,s,i,!0))return;const c=r.getId(l);if(l===t&&t.defaultView){const n=As(t.defaultView);e({id:c,x:n.left,y:n.top})}else e({id:c,x:l.scrollLeft,y:l.scrollTop})}),o.scroll||100));return ne("scroll",a,t)}function mu({viewportResizeCb:e},{win:t}){let r=-1,s=-1;const i=$(Je($(()=>{const o=Ts(),a=_s();(r!==o||s!==a)&&(e({width:Number(a),height:Number(o)}),r=o,s=a)}),200));return ne("resize",i,t)}const gu=["INPUT","TEXTAREA","SELECT"],gn=new WeakMap;function yu({inputCb:e,doc:t,mirror:r,blockClass:s,blockSelector:i,ignoreClass:o,ignoreSelector:a,maskInputOptions:u,maskInputFn:l,sampling:c,userTriggeredOnInput:n}){function d(y){let w=lt(y);const C=y.isTrusted,S=w&&w.tagName;if(w&&S==="OPTION"&&(w=B.parentElement(w)),!w||!S||gu.indexOf(S)<0||oe(w,s,i,!0)||w.classList.contains(o)||a&&w.matches(a))return;let b=w.value,E=!1;const M=Nt(w)||"";M==="radio"||M==="checkbox"?E=w.checked:(u[S.toLowerCase()]||u[M])&&(b=Mt({element:w,maskInputOptions:u,tagName:S,type:M,value:b,maskInputFn:l})),h(w,n?{text:b,isChecked:E,userTriggered:C}:{text:b,isChecked:E});const I=w.name;M==="radio"&&I&&E&&t.querySelectorAll(`input[type="radio"][name="${I}"]`).forEach(N=>{if(N!==w){const F=N.value;h(N,n?{text:F,isChecked:!E,userTriggered:!1}:{text:F,isChecked:!E})}})}function h(y,w){const C=gn.get(y);if(!C||C.text!==w.text||C.isChecked!==w.isChecked){gn.set(y,w);const S=r.getId(y);$(e)(se(P({},w),{id:S}))}}const m=(c.input==="last"?["change"]:["input","change"]).map(y=>ne(y,$(d),t)),p=t.defaultView;if(!p)return()=>{m.forEach(y=>y())};const g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value"),v=[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&m.push(...v.map(y=>at(y[0],y[1],{set(){$(d)({target:this,isTrusted:!1})}},!1,p))),$(()=>{m.forEach(y=>y())})}function _t(e){const t=[];function r(s,i){if(yt("CSSGroupingRule")&&s.parentRule instanceof CSSGroupingRule||yt("CSSMediaRule")&&s.parentRule instanceof CSSMediaRule||yt("CSSSupportsRule")&&s.parentRule instanceof CSSSupportsRule||yt("CSSConditionRule")&&s.parentRule instanceof CSSConditionRule){const a=Array.from(s.parentRule.cssRules).indexOf(s);return i.unshift(a),r(s.parentRule,i)}else if(s.parentStyleSheet){const a=Array.from(s.parentStyleSheet.cssRules).indexOf(s);i.unshift(a)}return i}return r(e,t)}function Ne(e,t,r){let s,i;return e?(e.ownerNode?s=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:s}):{}}function wu({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:s}){if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};const i=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:$((n,d,h)=>{const[f,m]=h,{id:p,styleId:g}=Ne(d,t,r.styleMirror);return(p&&p!==-1||g&&g!==-1)&&e({id:p,styleId:g,adds:[{rule:f,index:m}]}),n.apply(d,h)})}),s.CSSStyleSheet.prototype.addRule=function(n,d,h=this.cssRules.length){const f=`${n} { ${d} }`;return s.CSSStyleSheet.prototype.insertRule.apply(this,[f,h])};const o=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:$((n,d,h)=>{const[f]=h,{id:m,styleId:p}=Ne(d,t,r.styleMirror);return(m&&m!==-1||p&&p!==-1)&&e({id:m,styleId:p,removes:[{index:f}]}),n.apply(d,h)})}),s.CSSStyleSheet.prototype.removeRule=function(n){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[n])};let a;s.CSSStyleSheet.prototype.replace&&(a=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:$((n,d,h)=>{const[f]=h,{id:m,styleId:p}=Ne(d,t,r.styleMirror);return(m&&m!==-1||p&&p!==-1)&&e({id:m,styleId:p,replace:f}),n.apply(d,h)})}));let u;s.CSSStyleSheet.prototype.replaceSync&&(u=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:$((n,d,h)=>{const[f]=h,{id:m,styleId:p}=Ne(d,t,r.styleMirror);return(m&&m!==-1||p&&p!==-1)&&e({id:m,styleId:p,replaceSync:f}),n.apply(d,h)})}));const l={};wt("CSSGroupingRule")?l.CSSGroupingRule=s.CSSGroupingRule:(wt("CSSMediaRule")&&(l.CSSMediaRule=s.CSSMediaRule),wt("CSSConditionRule")&&(l.CSSConditionRule=s.CSSConditionRule),wt("CSSSupportsRule")&&(l.CSSSupportsRule=s.CSSSupportsRule));const c={};return Object.entries(l).forEach(([n,d])=>{c[n]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=new Proxy(c[n].insertRule,{apply:$((h,f,m)=>{const[p,g]=m,{id:v,styleId:y}=Ne(f.parentStyleSheet,t,r.styleMirror);return(v&&v!==-1||y&&y!==-1)&&e({id:v,styleId:y,adds:[{rule:p,index:[..._t(f),g||0]}]}),h.apply(f,m)})}),d.prototype.deleteRule=new Proxy(c[n].deleteRule,{apply:$((h,f,m)=>{const[p]=m,{id:g,styleId:v}=Ne(f.parentStyleSheet,t,r.styleMirror);return(g&&g!==-1||v&&v!==-1)&&e({id:g,styleId:v,removes:[{index:[..._t(f),p]}]}),h.apply(f,m)})})}),$(()=>{s.CSSStyleSheet.prototype.insertRule=i,s.CSSStyleSheet.prototype.deleteRule=o,a&&(s.CSSStyleSheet.prototype.replace=a),u&&(s.CSSStyleSheet.prototype.replaceSync=u),Object.entries(l).forEach(([n,d])=>{d.prototype.insertRule=c[n].insertRule,d.prototype.deleteRule=c[n].deleteRule})})}function Co({mirror:e,stylesheetManager:t},r){var s,i,o;let a=null;r.nodeName==="#document"?a=e.getId(r):a=e.getId(B.host(r));const u=r.nodeName==="#document"?(s=r.defaultView)==null?void 0:s.Document:(o=(i=r.ownerDocument)==null?void 0:i.defaultView)==null?void 0:o.ShadowRoot,l=u!=null&&u.prototype?Object.getOwnPropertyDescriptor(u==null?void 0:u.prototype,"adoptedStyleSheets"):void 0;return a===null||a===-1||!u||!l?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var c;return(c=l.get)==null?void 0:c.call(this)},set(c){var n;const d=(n=l.set)==null?void 0:n.call(this,c);if(a!==null&&a!==-1)try{t.adoptStyleSheets(c,a)}catch(h){}return d}}),$(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function vu({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:s},{win:i}){const o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:$((u,l,c)=>{var n;const[d,h,f]=c;if(r.has(d))return o.apply(l,[d,h,f]);const{id:m,styleId:p}=Ne((n=l.parentRule)==null?void 0:n.parentStyleSheet,t,s.styleMirror);return(m&&m!==-1||p&&p!==-1)&&e({id:m,styleId:p,set:{property:d,value:h,priority:f},index:_t(l.parentRule)}),u.apply(l,c)})});const a=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:$((u,l,c)=>{var n;const[d]=c;if(r.has(d))return a.apply(l,[d]);const{id:h,styleId:f}=Ne((n=l.parentRule)==null?void 0:n.parentStyleSheet,t,s.styleMirror);return(h&&h!==-1||f&&f!==-1)&&e({id:h,styleId:f,remove:{property:d},index:_t(l.parentRule)}),u.apply(l,c)})}),$(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=a})}function Su({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:s,sampling:i,doc:o}){const a=$(l=>Je($(c=>{const n=lt(c);if(!n||oe(n,t,r,!0))return;const{currentTime:d,volume:h,muted:f,playbackRate:m,loop:p}=n;e({type:l,id:s.getId(n),currentTime:d,volume:h,muted:f,playbackRate:m,loop:p})}),i.media||500)),u=[ne("play",a(Oe.Play),o),ne("pause",a(Oe.Pause),o),ne("seeked",a(Oe.Seeked),o),ne("volumechange",a(Oe.VolumeChange),o),ne("ratechange",a(Oe.RateChange),o)];return $(()=>{u.forEach(l=>l())})}function bu({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const s=[],i=new WeakMap,o=r.FontFace;r.FontFace=function(l,c,n){const d=new o(l,c,n);return i.set(d,{family:l,buffer:typeof c!="string",descriptors:n,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),d};const a=Fe(t.fonts,"add",function(u){return function(l){return setTimeout($(()=>{const c=i.get(l);c&&(e(c),i.delete(l))}),0),u.apply(this,[l])}});return s.push(()=>{r.FontFace=o}),s.push(a),$(()=>{s.forEach(u=>u())})}function Cu(e){const{doc:t,mirror:r,blockClass:s,blockSelector:i,selectionCb:o}=e;let a=!0;const u=$(()=>{const l=t.getSelection();if(!l||a&&(l!=null&&l.isCollapsed))return;a=l.isCollapsed||!1;const c=[],n=l.rangeCount||0;for(let d=0;d<n;d++){const h=l.getRangeAt(d),{startContainer:f,startOffset:m,endContainer:p,endOffset:g}=h;oe(f,s,i,!0)||oe(p,s,i,!0)||c.push({start:r.getId(f),startOffset:m,end:r.getId(p),endOffset:g})}o({ranges:c})});return u(),ne("selectionchange",u)}function Eu({doc:e,customElementCb:t}){const r=e.defaultView;return!r||!r.customElements?()=>{}:Fe(r.customElements,"define",function(i){return function(o,a,u){try{t({define:{name:o}})}catch(l){console.warn(`Custom element callback failed for ${o}`)}return i.apply(this,[o,a,u])}})}function xu(e,t){const{mutationCb:r,mousemoveCb:s,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:a,inputCb:u,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:n,canvasMutationCb:d,fontCb:h,selectionCb:f,customElementCb:m}=e;e.mutationCb=(...p)=>{t.mutation&&t.mutation(...p),r(...p)},e.mousemoveCb=(...p)=>{t.mousemove&&t.mousemove(...p),s(...p)},e.mouseInteractionCb=(...p)=>{t.mouseInteraction&&t.mouseInteraction(...p),i(...p)},e.scrollCb=(...p)=>{t.scroll&&t.scroll(...p),o(...p)},e.viewportResizeCb=(...p)=>{t.viewportResize&&t.viewportResize(...p),a(...p)},e.inputCb=(...p)=>{t.input&&t.input(...p),u(...p)},e.mediaInteractionCb=(...p)=>{t.mediaInteaction&&t.mediaInteaction(...p),l(...p)},e.styleSheetRuleCb=(...p)=>{t.styleSheetRule&&t.styleSheetRule(...p),c(...p)},e.styleDeclarationCb=(...p)=>{t.styleDeclaration&&t.styleDeclaration(...p),n(...p)},e.canvasMutationCb=(...p)=>{t.canvasMutation&&t.canvasMutation(...p),d(...p)},e.fontCb=(...p)=>{t.font&&t.font(...p),h(...p)},e.selectionCb=(...p)=>{t.selection&&t.selection(...p),f(...p)},e.customElementCb=(...p)=>{t.customElement&&t.customElement(...p),m(...p)}}function Ru(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};xu(e,t);let s,i=()=>{};e.recordDOM&&([s,i]=So(e,e.doc));const o=du(e),a=pu(e),u=bo(e),l=mu(e,{win:r}),c=yu(e),n=Su(e);let d=()=>{},h=()=>{},f=()=>{},m=()=>{};e.recordDOM&&(d=wu(e,{win:r}),h=Co(e,e.doc),f=vu(e,{win:r}),e.collectFonts&&(m=bu(e)));const p=Cu(e),g=Eu(e),v=[];for(const y of e.plugins)v.push(y.observer(y.callback,r,y.options));return $(()=>{ke.forEach(y=>y.reset()),s==null||s.disconnect(),i(),o(),a(),u(),l(),c(),n(),d(),h(),f(),m(),p(),g(),v.forEach(y=>y())})}function yt(e){return typeof window[e]!="undefined"}function wt(e){return!!(typeof window[e]!="undefined"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class yn{constructor(t){R(this,"iframeIdToRemoteIdMap",new WeakMap),R(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,r,s,i){const o=s||this.getIdToRemoteIdMap(t),a=i||this.getRemoteIdToIdMap(t);let u=o.get(r);return u||(u=this.generateIdFn(),o.set(r,u),a.set(u,r)),u}getIds(t,r){const s=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return r.map(o=>this.getId(t,o,s,i))}getRemoteId(t,r,s){const i=s||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;const o=i.get(r);return o||-1}getRemoteIds(t,r){const s=this.getRemoteIdToIdMap(t);return r.map(i=>this.getRemoteId(t,i,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}}class Mu{constructor(t){R(this,"iframes",new WeakMap),R(this,"crossOriginIframeMap",new WeakMap),R(this,"crossOriginIframeMirror",new yn(Pn)),R(this,"crossOriginIframeStyleMirror"),R(this,"crossOriginIframeRootIdMap",new WeakMap),R(this,"mirror"),R(this,"mutationCb"),R(this,"wrappedEmit"),R(this,"loadListener"),R(this,"stylesheetManager"),R(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new yn(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,r){var s,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((s=t.contentWindow)==null||s.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){const r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin||!t.source)return;const i=this.crossOriginIframeMap.get(t.source);if(!i)return;const o=this.transformCrossOriginEvent(i,r.data.event);o&&this.wrappedEmit(o,r.data.isCheckout)}transformCrossOriginEvent(t,r){var s;switch(r.type){case _.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);const i=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(r.data.node,i),{timestamp:r.timestamp,type:_.IncrementalSnapshot,data:{source:A.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 _.Plugin:return r;case _.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case _.IncrementalSnapshot:switch(r.data.source){case A.Mutation:return r.data.adds.forEach(i=>{this.replaceIds(i,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,t);const o=this.crossOriginIframeRootIdMap.get(t);o&&this.patchRootIdOnNode(i.node,o)}),r.data.removes.forEach(i=>{this.replaceIds(i,t,["parentId","id"])}),r.data.attributes.forEach(i=>{this.replaceIds(i,t,["id"])}),r.data.texts.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case A.Drag:case A.TouchMove:case A.MouseMove:return r.data.positions.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case A.ViewportResize:return!1;case A.MediaInteraction:case A.MouseInteraction:case A.Scroll:case A.CanvasMutation:case A.Input:return this.replaceIds(r.data,t,["id"]),r;case A.StyleSheetRule:case A.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case A.Font:return r;case A.Selection:return r.data.ranges.forEach(i=>{this.replaceIds(i,t,["start","end"])}),r;case A.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(s=r.data.styles)==null||s.forEach(i=>{this.replaceStyleIds(i,t,["styleId"])}),r}}return!1}replace(t,r,s,i){for(const o of i)!Array.isArray(r[o])&&typeof r[o]!="number"||(Array.isArray(r[o])?r[o]=t.getIds(s,r[o]):r[o]=t.getId(s,r[o]));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!==be.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(s=>{this.patchRootIdOnNode(s,r)})}}class Nu{constructor(t){R(this,"shadowDoms",new WeakSet),R(this,"mutationCb"),R(this,"scrollCb"),R(this,"bypassOptions"),R(this,"mirror"),R(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(!tt(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t),this.bypassOptions.canvasManager.addShadowRoot(t);const[s]=So(se(P({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push(()=>s.disconnect()),this.restoreHandlers.push(bo(se(P({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(B.host(t))),this.restoreHandlers.push(Co({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,r){const s=this;this.restoreHandlers.push(Fe(t.prototype,"attachShadow",function(i){return function(o){const a=i.call(this,o),u=B.shadowRoot(this);return u&&zs(this)&&s.addShadowRoot(u,r),a}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch(r){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}var Ge="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ke=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var vt=0;vt<Ge.length;vt++)Ke[Ge.charCodeAt(vt)]=vt;var Eo=function(e){var t=new Uint8Array(e),r,s=t.length,i="";for(r=0;r<s;r+=3)i+=Ge[t[r]>>2],i+=Ge[(t[r]&3)<<4|t[r+1]>>4],i+=Ge[(t[r+1]&15)<<2|t[r+2]>>6],i+=Ge[t[r+2]&63];return s%3===2?i=i.substring(0,i.length-1)+"=":s%3===1&&(i=i.substring(0,i.length-2)+"=="),i},Ou=function(e){var t=e.length*.75,r=e.length,s,i=0,o,a,u,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var c=new ArrayBuffer(t),n=new Uint8Array(c);for(s=0;s<r;s+=4)o=Ke[e.charCodeAt(s)],a=Ke[e.charCodeAt(s+1)],u=Ke[e.charCodeAt(s+2)],l=Ke[e.charCodeAt(s+3)],n[i++]=o<<2|a>>4,n[i++]=(a&15)<<4|u>>2,n[i++]=(u&3)<<6|l&63;return c};const wn=new Map;function Iu(e,t){let r=wn.get(e);return r||(r=new Map,wn.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}const xo=(e,t,r)=>{if(!e||!(Mo(e,t)||typeof e=="object"))return;const s=e.constructor.name,i=Iu(r,s);let o=i.indexOf(e);return o===-1&&(o=i.length,i.push(e)),o},St=new Map;function Du(e){var t;const r=e.src;try{if(!e.complete||!e.naturalWidth||typeof r!="string"||r.startsWith("data:"))return r;const s=St.get(r);if(s)return s;const i=(e.ownerDocument||document).createElement("canvas");i.width=e.naturalWidth,i.height=e.naturalHeight,(t=i.getContext("2d"))==null||t.drawImage(e,0,0);const o=i.toDataURL();return St.size>100&&St.clear(),St.set(r,o),o}catch(s){return r}}const Au=new Set(["[object Float32Array]","[object Float64Array]","[object Int32Array]","[object Uint32Array]","[object Uint8Array]","[object Uint16Array]","[object Int16Array]","[object Int8Array]","[object Uint8ClampedArray]"]);function Tu(e){return Au.has(Object.prototype.toString.call(e))}function _u(e,t){return typeof e=="object"&&e!==null&&(e.tagName==="IMG"||typeof t.HTMLImageElement=="function"&&e instanceof t.HTMLImageElement)}function ku(e,t){return typeof e=="object"&&e!==null&&(e.tagName==="CANVAS"||typeof t.HTMLCanvasElement=="function"&&e instanceof t.HTMLCanvasElement)}function Pu(e,t){return typeof e=="object"&&e!==null&&(Object.prototype.toString.call(e)==="[object ImageData]"||typeof t.ImageData=="function"&&e instanceof t.ImageData)}function xt(e,t,r){if(e instanceof Array)return e.map(s=>xt(s,t,r));if(e===null)return e;if(Tu(e)){const s=e;return{rr_type:s.constructor.name,args:[Object.values(s)]}}else if(e instanceof ArrayBuffer){const s=e.constructor.name,i=Eo(e);return{rr_type:s,base64:i}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[xt(e.buffer,t,r),e.byteOffset,e.byteLength]};if(_u(e,t)){const s="HTMLImageElement",i=Du(e);return{rr_type:s,src:i}}else if(ku(e,t)){const s="HTMLImageElement",i=e.toDataURL();return{rr_type:s,src:i}}else{if(Pu(e,t))return{rr_type:"ImageData",args:[xt(e.data,t,r),e.width,e.height]};if(Mo(e,t)||typeof e=="object"){const s=e.constructor.name,i=xo(e,t,r);return{rr_type:s,index:i}}}}return e}const Ro=(e,t,r)=>e.map(s=>xt(s,t,r)),Mo=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof t[i]=="function").find(i=>e instanceof t[i]);function Lu(e,t,r,s){const i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of o)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;const u=Fe(t.CanvasRenderingContext2D.prototype,a,function(l){return function(...c){return oe(this.canvas,r,s,!0)||setTimeout(()=>{const n=Ro(c,t,this);e(this.canvas,{type:Ce["2D"],property:a,args:n})},0),l.apply(this,c)}});i.push(u)}catch(u){const l=at(t.CanvasRenderingContext2D.prototype,a,{set(c){e(this.canvas,{type:Ce["2D"],property:a,args:[c],setter:!0})}});i.push(l)}return()=>{i.forEach(a=>a())}}function Fu(e){return e==="experimental-webgl"?"webgl":e}function vn(e,t,r,s){const i=[];try{const o=Fe(e.HTMLCanvasElement.prototype,"getContext",function(a){return function(u,...l){if(!oe(this,t,r,!0)){const c=Fu(u);if("__context"in this||(this.__context=c),s&&["webgl","webgl2"].includes(c))if(l[0]&&typeof l[0]=="object"){const n=l[0];n.preserveDrawingBuffer||(n.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return a.apply(this,[u,...l])}});i.push(o)}catch(o){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(o=>o())}}function Sn(e,t,r,s,i,o){const a=[],u=Object.getOwnPropertyNames(e);for(const l of u)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof e[l]!="function")continue;const c=Fe(e,l,function(n){return function(...d){const h=n.apply(this,d);if(xo(h,o,this),"tagName"in this.canvas&&!oe(this.canvas,s,i,!0)){const f=Ro(d,o,this),m={type:t,property:l,args:f};r(this.canvas,m)}return h}});a.push(c)}catch(c){const n=at(e,l,{set(d){r(this.canvas,{type:t,property:l,args:[d],setter:!0})}});a.push(n)}return a}function Uu(e,t,r,s){const i=[];return typeof t.WebGLRenderingContext!="undefined"&&i.push(...Sn(t.WebGLRenderingContext.prototype,Ce.WebGL,e,r,s,t)),typeof t.WebGL2RenderingContext!="undefined"&&i.push(...Sn(t.WebGL2RenderingContext.prototype,Ce.WebGL2,e,r,s,t)),()=>{i.forEach(o=>o())}}function Bu(e){const t=new Uint8Array(e);let r=2166136261;for(let s=0;s<t.length;s++)r^=t[s],r=r*16777619|0;return(r>>>0).toString(16)}function Wu(){return typeof OffscreenCanvas!="undefined"}class $u{constructor(t){R(this,"pendingCanvasMutations",new Map),R(this,"rafStamps",{latestId:0,invokeId:null}),R(this,"options"),R(this,"mirror"),R(this,"shadowDoms",new Set),R(this,"windowsSet",new WeakSet),R(this,"windows",[]),R(this,"mutationCb"),R(this,"restoreHandlers",[]),R(this,"frozen",!1),R(this,"locked",!1),R(this,"snapshotInProgressMap",new Map),R(this,"lastFingerprintMap",new Map),R(this,"snapshotCanvas",null),R(this,"snapshotCtx",null),R(this,"lastSnapshotTime",0),R(this,"processMutation",(o,a)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(o)||this.pendingCanvasMutations.set(o,[]),this.pendingCanvasMutations.get(o).push(a)});const{sampling:r="all",win:s,recordCanvas:i}=t;t.sampling=r,this.mutationCb=t.mutationCb,this.mirror=t.mirror,this.options=t,this.addWindow(s),i&&r==="all"&&(this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher()),i&&typeof r=="number"&&Wu()&&this.initCanvasFPSObserver()}reset(){this.pendingCanvasMutations.clear(),this.restoreHandlers.forEach(t=>{try{t()}catch(r){}}),this.restoreHandlers=[],this.windowsSet=new WeakSet,this.windows=[],this.shadowDoms=new Set,this.snapshotInProgressMap=new Map,this.lastFingerprintMap=new Map,this.snapshotCanvas=null,this.snapshotCtx=null}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}addWindow(t){const{sampling:r="all",blockClass:s,blockSelector:i,recordCanvas:o}=this.options;if(!this.windowsSet.has(t)){if(o&&r==="all"&&this.initCanvasMutationObserver(t,s,i),o&&typeof r=="number"){const a=vn(t,s,i,!0);this.restoreHandlers.push(()=>{a()})}this.windowsSet.add(t),this.windows.push(new WeakRef(t))}}addShadowRoot(t){this.shadowDoms.add(new WeakRef(t))}resetShadowRoots(){this.shadowDoms=new Set}async snapshotImageBitmap(t,r,s,i,o){try{let a=this.snapshotCanvas;(!a||a.width!==s||a.height!==i)&&(a=new OffscreenCanvas(s,i),this.snapshotCanvas=a,this.snapshotCtx=a.getContext("2d"));const u=this.snapshotCtx;if(!u)return;u.clearRect(0,0,s,i),u.drawImage(r,0,0);const l=await a.convertToBlob(o),c=await l.arrayBuffer(),n=Bu(c);if(this.lastFingerprintMap.get(t)===n)return;this.lastFingerprintMap.set(t,n),this.emitCanvasSnapshot(t,Eo(c),l.type,s,i)}catch(a){}finally{r.close(),this.snapshotInProgressMap.set(t,!1)}}emitCanvasSnapshot(t,r,s,i,o){this.mutationCb({id:t,type:Ce["2D"],commands:[{property:"clearRect",args:[0,0,i,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:s}]},0,0]}]})}initCanvasFPSObserver(){let t;if(!this.windows.length&&!this.shadowDoms.size)return;const r=s=>{this.takeSnapshot(s),t=requestAnimationFrame(r)};t=requestAnimationFrame(r),this.restoreHandlers.push(()=>{t&&cancelAnimationFrame(t)})}initCanvasMutationObserver(t,r,s){const i=vn(t,r,s,!1),o=Lu(this.processMutation.bind(this),t,r,s),a=Uu(this.processMutation.bind(this),t,r,s);this.restoreHandlers.push(()=>{i(),o(),a()})}getCanvasElements(t,r){const s=[],i=o=>{o.querySelectorAll("canvas").forEach(a=>{oe(a,t,r,!0)||s.push(a)})};for(const o of this.windows){const a=o.deref();let u;try{u=a&&a.document}catch(l){}u&&i(u)}for(const o of this.shadowDoms){const a=o.deref();a&&i(a)}return s}takeSnapshot(t){const{sampling:r,blockClass:s,blockSelector:i,dataURLOptions:o}=this.options,u=1e3/(typeof r=="number"?r:2);if(this.lastSnapshotTime&&t-this.lastSnapshotTime<u)return;this.lastSnapshotTime=t,this.getCanvasElements(s,i).forEach(c=>{var n;const d=this.mirror.getId(c);if(this.snapshotInProgressMap.get(d)||!this.mirror.hasNode(c)||c.width===0||c.height===0)return;if(this.snapshotInProgressMap.set(d,!0),["webgl","webgl2"].includes(c.__context)){const m=c.getContext(c.__context);((n=m==null?void 0:m.getContextAttributes())==null?void 0:n.preserveDrawingBuffer)===!1&&m.clear(m.COLOR_BUFFER_BIT)}const h=c.width,f=c.height;createImageBitmap(c).then(m=>this.snapshotImageBitmap(d,m,h,f,o)).catch(()=>{this.snapshotInProgressMap.set(d,!1)})})}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const s=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,s)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const s=this.pendingCanvasMutations.get(t);if(!s||r===-1)return;const i=s.map(a=>{const c=a,{type:u}=c;return Ue(c,["type"])}),{type:o}=s[0];this.mutationCb({id:r,type:o,commands:i}),this.pendingCanvasMutations.delete(t)}}class zu{constructor(t){R(this,"trackedLinkElements",new WeakSet),R(this,"mutationCb"),R(this,"adoptedStyleSheetCb"),R(this,"styleMirror",new Ws),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;const s={id:r,styleIds:[]},i=[];for(const o of t){let a;this.styleMirror.has(o)?a=this.styleMirror.getId(o):(a=this.styleMirror.add(o),i.push({styleId:a,rules:Array.from(o.rules||CSSRule,(u,l)=>({rule:_n(u,o.href),index:l}))})),s.styleIds.push(a)}i.length>0&&(s.styles=i),this.adoptedStyleSheetCb(s)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Vu{constructor(){R(this,"nodeMap",new WeakMap),R(this,"active",!1)}inOtherBuffer(t,r){const s=this.nodeMap.get(t);return s&&Array.from(s).some(i=>i!==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(){}}let ee,Rt,bt,kt=!1;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=((Gs=e.contentWindow)==null?void 0:Gs.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const pe=kn();function Te(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:s,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:u=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:n=!0,maskAllInputs:d,maskInputOptions:h,slimDOMOptions:f,maskInputFn:m,maskTextFn:p,hooks:g,packFn:v,sampling:y={},dataURLOptions:w={},mousemoveWait:C,recordDOM:S=!0,recordCanvas:b=!1,recordCrossOriginIframes:E=!1,recordAfter:M=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:I=!1,collectFonts:N=!1,inlineImages:F=!1,plugins:T,keepIframeSrcFn:x=()=>!1,ignoreCSSAttributes:ue=new Set([]),errorHandler:ae}=e;hu(ae);const q=E?window.parent===window:!0;let k=!1;if(!q)try{window.parent.document&&(k=!1)}catch(L){k=!0}if(q&&!t)throw new Error("emit function is required");if(!q&&!k)return()=>{};C!==void 0&&y.mousemove===void 0&&(y.mousemove=C),pe.reset();const X=d===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:h!==void 0?h:{password:!0},te=Bn(f);Ls();let Z,G=0;const Re=L=>{for(const re of T||[])re.eventProcessor&&(L=re.eventProcessor(L));return v&&!k&&(L=v(L)),L};ee=(L,re)=>{var j;const K=L;if(K.timestamp=Xe(),(j=ke[0])!=null&&j.isFrozen()&&K.type!==_.FullSnapshot&&!(K.type===_.IncrementalSnapshot&&K.data.source===A.Mutation)&&ke.forEach(ce=>ce.unfreeze()),q)t==null||t(Re(K),re);else if(k){const ce={type:"rrweb",event:Re(K),origin:window.location.origin,isCheckout:re};window.parent.postMessage(ce,"*")}if(K.type===_.FullSnapshot)Z=K,G=0;else if(K.type===_.IncrementalSnapshot){if(K.data.source===A.Mutation&&K.data.isAttachIframe)return;G++;const ce=s&&G>=s,H=r&&K.timestamp-Z.timestamp>r;(ce||H)&&Rt(!0)}};const O=L=>{ee({type:_.IncrementalSnapshot,data:P({source:A.Mutation},L)})},we=L=>ee({type:_.IncrementalSnapshot,data:P({source:A.Scroll},L)}),fe=L=>ee({type:_.IncrementalSnapshot,data:P({source:A.CanvasMutation},L)}),Ze=L=>ee({type:_.IncrementalSnapshot,data:P({source:A.AdoptedStyleSheet},L)}),le=new zu({mutationCb:O,adoptedStyleSheetCb:Ze}),de=new Mu({mirror:pe,mutationCb:O,stylesheetManager:le,recordCrossOriginIframes:E,wrappedEmit:ee});for(const L of T||[])L.getMirror&&L.getMirror({nodeMirror:pe,crossOriginIframeMirror:de.crossOriginIframeMirror,crossOriginIframeStyleMirror:de.crossOriginIframeStyleMirror});const _e=new Vu;bt=new $u({recordCanvas:b,mutationCb:fe,win:window,blockClass:i,blockSelector:o,mirror:pe,sampling:y.canvas,dataURLOptions:w});const Me=new Nu({mutationCb:O,scrollCb:we,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:n,maskInputOptions:X,dataURLOptions:w,maskTextFn:p,maskInputFn:m,recordCanvas:b,inlineImages:F,sampling:y,slimDOMOptions:te,iframeManager:de,stylesheetManager:le,canvasManager:bt,keepIframeSrcFn:x,processedNodeManager:_e},mirror:pe});Rt=(L=!1)=>{if(!S)return;ee({type:_.Meta,data:{href:window.location.href,width:_s(),height:Ts()}},L),le.reset(),Me.init(),ke.forEach(j=>j.lock());const re=Ia(document,{mirror:pe,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:n,maskAllInputs:X,maskTextFn:p,maskInputFn:m,slimDOM:te,dataURLOptions:w,recordCanvas:b,inlineImages:F,onSerialize:j=>{Ye(j,pe)&&de.addIframe(j),Us(j,pe)&&le.trackLinkElement(j),Ie(j)&&Me.addShadowRoot(B.shadowRoot(j),document)},onIframeLoad:(j,K)=>{de.attachIframe(j,K),j.contentWindow&&bt.addWindow(j.contentWindow),Me.observeAttachShadow(j)},onStylesheetLoad:(j,K)=>{le.attachLinkElement(j,K)},keepIframeSrcFn:x});if(!re)return console.warn("Failed to snapshot the document");ee({type:_.FullSnapshot,data:{node:re,initialOffset:As(window)}},L),ke.forEach(j=>j.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&le.adoptStyleSheets(document.adoptedStyleSheets,pe.getId(document))};try{const L=[],re=K=>{var ce;return $(Ru)({mutationCb:O,mousemoveCb:(H,Xt)=>ee({type:_.IncrementalSnapshot,data:{source:Xt,positions:H}}),mouseInteractionCb:H=>ee({type:_.IncrementalSnapshot,data:P({source:A.MouseInteraction},H)}),scrollCb:we,viewportResizeCb:H=>ee({type:_.IncrementalSnapshot,data:P({source:A.ViewportResize},H)}),inputCb:H=>ee({type:_.IncrementalSnapshot,data:P({source:A.Input},H)}),mediaInteractionCb:H=>ee({type:_.IncrementalSnapshot,data:P({source:A.MediaInteraction},H)}),styleSheetRuleCb:H=>ee({type:_.IncrementalSnapshot,data:P({source:A.StyleSheetRule},H)}),styleDeclarationCb:H=>ee({type:_.IncrementalSnapshot,data:P({source:A.StyleDeclaration},H)}),canvasMutationCb:fe,fontCb:H=>ee({type:_.IncrementalSnapshot,data:P({source:A.Font},H)}),selectionCb:H=>{ee({type:_.IncrementalSnapshot,data:P({source:A.Selection},H)})},customElementCb:H=>{ee({type:_.IncrementalSnapshot,data:P({source:A.CustomElement},H)})},blockClass:i,ignoreClass:a,ignoreSelector:u,maskTextClass:l,maskTextSelector:c,maskInputOptions:X,inlineStylesheet:n,sampling:y,recordDOM:S,recordCanvas:b,inlineImages:F,userTriggeredOnInput:I,collectFonts:N,doc:K,maskInputFn:m,maskTextFn:p,keepIframeSrcFn:x,blockSelector:o,slimDOMOptions:te,dataURLOptions:w,mirror:pe,iframeManager:de,stylesheetManager:le,shadowDomManager:Me,processedNodeManager:_e,canvasManager:bt,ignoreCSSAttributes:ue,plugins:((ce=T==null?void 0:T.filter(H=>H.observer))==null?void 0:ce.map(H=>({observer:H.observer,options:H.options,callback:Xt=>ee({type:_.Plugin,data:{plugin:H.name,payload:Xt}})})))||[]},g)};de.addLoadListener(K=>{try{L.push(re(K.contentDocument))}catch(ce){console.warn(ce)}});const j=()=>{Rt(),L.push(re(document)),kt=!0};return["interactive","complete"].includes(document.readyState)?j():(L.push(ne("DOMContentLoaded",()=>{ee({type:_.DomContentLoaded,data:{}}),M==="DOMContentLoaded"&&j()})),L.push(ne("load",()=>{ee({type:_.Load,data:{}}),M==="load"&&j()},window))),()=>{L.forEach(K=>{try{K()}catch(ce){String(ce).toLowerCase().includes("cross-origin")||console.warn(ce)}}),_e.destroy(),kt=!1,fu()}}catch(L){console.warn(L)}}Te.addCustomEvent=(e,t)=>{if(!kt)throw new Error("please add custom event after start recording");ee({type:_.Custom,data:{tag:e,payload:t}})};Te.freezePage=()=>{ke.forEach(e=>e.freeze())};Te.takeFullSnapshot=e=>{if(!kt)throw new Error("please take full snapshot after start recording");Rt(e)};Te.mirror=pe;function qu(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(i){i(r)}),(s=e.get("*"))&&s.slice().map(function(i){i(t,r)})}}}function ju(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;const r=e.HTMLElement||e.Element,s=468,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||l,scrollIntoView:r.prototype.scrollIntoView},o=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function a(v){const y=["MSIE ","Trident/","Edge/"];return new RegExp(y.join("|")).test(v)}const u=a(e.navigator.userAgent)?1:0;function l(v,y){this.scrollLeft=v,this.scrollTop=y}function c(v){return .5*(1-Math.cos(Math.PI*v))}function n(v){if(v===null||typeof v!="object"||v.behavior===void 0||v.behavior==="auto"||v.behavior==="instant")return!0;if(typeof v=="object"&&v.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+v.behavior+" is not a valid value for enumeration ScrollBehavior.")}function d(v,y){if(y==="Y")return v.clientHeight+u<v.scrollHeight;if(y==="X")return v.clientWidth+u<v.scrollWidth}function h(v,y){const w=e.getComputedStyle(v,null)["overflow"+y];return w==="auto"||w==="scroll"}function f(v){const y=d(v,"Y")&&h(v,"Y"),w=d(v,"X")&&h(v,"X");return y||w}function m(v){for(;v!==t.body&&f(v)===!1;)v=v.parentNode||v.host;return v}function p(v){const y=o();let w,C,S,b=(y-v.startTime)/s;b=b>1?1:b,w=c(b),C=v.startX+(v.x-v.startX)*w,S=v.startY+(v.y-v.startY)*w,v.method.call(v.scrollable,C,S),(C!==v.x||S!==v.y)&&e.requestAnimationFrame(p.bind(e,v))}function g(v,y,w){let C,S,b,E;const M=o();v===t.body?(C=e,S=e.scrollX||e.pageXOffset,b=e.scrollY||e.pageYOffset,E=i.scroll):(C=v,S=v.scrollLeft,b=v.scrollTop,E=l),p({scrollable:C,method:E,startTime:M,startX:S,startY:b,x:y,y:w})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(n(arguments[0])===!0){i.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(n(arguments[0])){i.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(n(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const v=arguments[0].left,y=arguments[0].top;g.call(this,this,typeof v=="undefined"?this.scrollLeft:~~v,typeof y=="undefined"?this.scrollTop:~~y)},r.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(n(arguments[0])===!0){i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},r.prototype.scrollIntoView=function(){if(n(arguments[0])===!0){i.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const v=m(this),y=v.getBoundingClientRect(),w=this.getBoundingClientRect();v!==t.body?(g.call(this,v,v.scrollLeft+w.left-y.left,v.scrollTop+w.top-y.top),e.getComputedStyle(v).position!=="fixed"&&e.scrollBy({left:y.left,top:y.top,behavior:"smooth"})):e.scrollBy({left:w.left,top:w.top,behavior:"smooth"})}}class Gu{constructor(t=[],r){R(this,"timeOffset",0),R(this,"speed"),R(this,"actions"),R(this,"raf",null),R(this,"lastTimestamp"),this.actions=t,this.speed=r.speed}addAction(t){const r=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=t.delay)this.actions.push(t);else{const 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(){const t=performance.now();for(this.timeOffset+=(t-this.lastTimestamp)*this.speed,this.lastTimestamp=t;this.actions.length;){const 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;){const i=Math.floor((r+s)/2);if(this.actions[i].delay<t.delay)r=i+1;else if(this.actions[i].delay>t.delay)s=i-1;else return i+1}return r}}function bn(e,t){if(e.type===_.IncrementalSnapshot&&e.data.source===A.MouseMove&&e.data.positions&&e.data.positions.length){const 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}/*! *****************************************************************************
67
+ or you can use record.mirror to access the mirror instance during recording.`;exports.mirror={map:{},getId(){return console.error(je),-1},getNode(){return console.error(je),null},removeNodeFromMap(){console.error(je)},has(){return console.error(je),!1},reset(){console.error(je)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(exports.mirror=new Proxy(exports.mirror,{get(e,t,r){return t==="map"&&console.error(je),Reflect.get(e,t,r)}}));function et(e,t,r={}){let s=null,i=0;return function(...o){const a=Date.now();!i&&r.leading===!1&&(i=a);const u=t-(a-i),l=this;u<=0||u>t?(s&&(clearTimeout(s),s=null),i=a,e.apply(l,o)):!s&&r.trailing!==!1&&(s=setTimeout(()=>{i=r.leading===!1?0:Date.now(),s=null,e.apply(l,o)},u))}}function ht(e,t,r,s,i=window){const o=i.Object.getOwnPropertyDescriptor(e,t);if(!s&&(o!=null&&o.set)){const a=function(u){setTimeout(()=>{r.set.call(this,u)},0),o.set.call(this,u)};ge(a,o.set),i.Object.defineProperty(e,t,{set:a})}else i.Object.defineProperty(e,t,s?r:{set(a){setTimeout(()=>{r.set.call(this,a)},0),o&&o.set&&o.set.call(this,a)}});return()=>ht(e,t,o||{},!0)}function $s(e){var t,r,s,i;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:o.documentElement.scrollLeft||(o==null?void 0:o.body)&&((t=W.parentElement(o.body))==null?void 0:t.scrollLeft)||((r=o==null?void 0:o.body)==null?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:(o==null?void 0:o.documentElement.scrollTop)||(o==null?void 0:o.body)&&((s=W.parentElement(o.body))==null?void 0:s.scrollTop)||((i=o==null?void 0:o.body)==null?void 0:i.scrollTop)||0}}function zs(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Vs(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function js(e){return e?e.nodeType===e.ELEMENT_NODE?e:W.parentElement(e):null}function oe(e,t,r,s){if(!e)return!1;const i=js(e);if(!i)return!1;try{if(typeof t=="string"){if(i.classList.contains(t)||s&&i.closest("."+t)!==null)return!0}else if(Lt(i,t,s))return!0}catch(o){}return!!(r&&(i.matches(r)||s&&i.closest(r)!==null))}function Ro(e,t){return t.getId(e)!==-1}function Ot(e,t,r){return e.tagName==="TITLE"&&r.headTitleMutations?!0:t.getId(e)===lt}function qs(e,t){if(it(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const s=W.parentNode(e);return s&&s.nodeType===e.DOCUMENT_NODE?!1:s?qs(s,t):!0}function $t(e){return!!e.changedTouches}function Gs(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 No(e){const t={},r=(i,o)=>{const a={value:i,parent:o,children:[]};return t[i.node.id]=a,a},s=[];for(const i of e){const{nextId:o,parentId:a}=i;if(o&&o in t){const u=t[o];if(u.parent){const l=u.parent.children.indexOf(u);u.parent.children.splice(l,0,r(i,u.parent))}else{const l=s.indexOf(u);s.splice(l,0,r(i,null))}continue}if(a in t){const u=t[a];u.children.push(r(i,u));continue}s.push(r(i,null))}return s}function Hs(e,t){t(e.value);for(let r=e.children.length-1;r>=0;r--)Hs(e.children[r],t)}function Qe(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Ys(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Xs(e,t){var r,s;const i=(s=(r=e.ownerDocument)==null?void 0:r.defaultView)==null?void 0:s.frameElement;if(!i||i===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const o=i.getBoundingClientRect(),a=Xs(i,t),u=o.height/i.clientHeight;return{x:o.x*a.relativeScale+a.x,y:o.y*a.relativeScale+a.y,relativeScale:u,absoluteScale:a.absoluteScale*u}}function De(e){return e?e instanceof ve&&"shadowRoot"in e?!!e.shadowRoot:!!W.shadowRoot(e):!1}function Ye(e,t){const r=e==null?void 0:e[t[0]];return r?t.length===1?r:Ye(r.cssRules,t.slice(1)):null}function ps(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function Oo(e){const t=new Set,r=[];for(let s=e.length;s--;){const i=e[s];t.has(i.id)||(r.push(i),t.add(i.id))}return r}class Js{constructor(){M(this,"id",1),M(this,"styleIDMap",new WeakMap),M(this,"idStyleMap",new Map)}getId(t){var r;return(r=this.styleIDMap.get(t))!=null?r:-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 Qs(e){var t;let r=null;return"getRootNode"in e&&((t=W.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&W.host(W.getRootNode(e))&&(r=W.host(W.getRootNode(e))),r}function Io(e){let t=e,r;for(;r=Qs(t);)t=r;return t}function Do(e){const t=W.ownerDocument(e);if(!t)return!1;const r=Io(e);return W.contains(t,r)}function Zs(e){const t=W.ownerDocument(e);return t?W.contains(t,e)||Do(e):!1}const Su=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:Js,get _mirror(){return exports.mirror},closestElementOfNode:js,getBaseDimension:Xs,getNestedRule:Ye,getPositionsAndIndex:ps,getRootShadowHost:Io,getShadowHost:Qs,getWindowHeight:zs,getWindowScroll:$s,getWindowWidth:Vs,hasShadowRoot:De,hookSetter:ht,inDom:Zs,isAncestorRemoved:qs,isBlocked:oe,isIgnored:Ot,isSerialized:Ro,isSerializedIframe:Qe,isSerializedStylesheet:Ys,iterateResolveTree:Hs,legacy_isTouchEvent:$t,get nowTimestamp(){return Ke},on:ne,polyfill:Gs,queueToResolveTrees:No,shadowHostInDom:Do,throttle:et,uniqueTextMutations:Oo},Symbol.toStringTag,{value:"Module"}));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))(_||{}),T=(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))(T||{}),V=(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))(V||{}),Ce=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Ce||{}),xe=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(xe||{}),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||{}),z=(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.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e.Destroy="destroy",e))(z||{}),Ee=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Ee||{});function Mn(e){return"__ln"in e}class bu{constructor(){M(this,"length",0),M(this,"head",null),M(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let s=0;s<t;s++)r=(r==null?void 0:r.next)||null;return r}addNode(t){const r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&Mn(t.previousSibling)){const s=t.previousSibling.__ln.next;r.next=s,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,s&&(s.previous=r)}else if(t.nextSibling&&Mn(t.nextSibling)&&t.nextSibling.__ln.previous){const s=t.nextSibling.__ln.previous;r.previous=s,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,s&&(s.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;r.next===null&&(this.tail=r),this.length++}removeNode(t){const r=t.__ln;this.head&&(r.previous?(r.previous.next=r.next,r.next?r.next.previous=r.previous:this.tail=r.previous):(this.head=r.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}const Rn=(e,t)=>`${e}@${t}`;class Cu{constructor(){M(this,"frozen",!1),M(this,"locked",!1),M(this,"texts",[]),M(this,"attributes",[]),M(this,"attributeMap",new WeakMap),M(this,"removes",[]),M(this,"mapRemoves",[]),M(this,"movedMap",{}),M(this,"addedSet",new Set),M(this,"movedSet",new Set),M(this,"droppedSet",new Set),M(this,"removesSubTreeCache",new Set),M(this,"mutationCb"),M(this,"blockClass"),M(this,"blockSelector"),M(this,"maskTextClass"),M(this,"maskTextSelector"),M(this,"inlineStylesheet"),M(this,"maskInputOptions"),M(this,"maskTextFn"),M(this,"maskInputFn"),M(this,"keepIframeSrcFn"),M(this,"recordCanvas"),M(this,"inlineImages"),M(this,"slimDOMOptions"),M(this,"dataURLOptions"),M(this,"doc"),M(this,"mirror"),M(this,"iframeManager"),M(this,"stylesheetManager"),M(this,"shadowDomManager"),M(this,"canvasManager"),M(this,"processedNodeManager"),M(this,"unattachedDoc"),M(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),M(this,"emit",()=>{if(this.frozen||this.locked)return;const t=[],r=new Set,s=new bu,i=l=>{let c=l,n=lt;for(;n===lt;)c=c&&c.nextSibling,n=c&&this.mirror.getId(c);return n},o=l=>{const c=W.parentNode(l);if(!c||!Zs(l))return;let n=!1;if(l.nodeType===Node.TEXT_NODE){const m=c.tagName;if(m==="TEXTAREA")return;m==="STYLE"&&this.addedSet.has(c)&&(n=!0)}const d=it(c)?this.mirror.getId(Qs(l)):this.mirror.getId(c),h=i(l);if(d===-1||h===-1)return s.addNode(l);const f=He(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:m=>{Qe(m,this.mirror)&&this.iframeManager.addIframe(m),Ys(m,this.mirror)&&this.stylesheetManager.trackLinkElement(m),De(l)&&this.shadowDomManager.addShadowRoot(W.shadowRoot(l),this.doc)},onIframeLoad:(m,p)=>{this.iframeManager.attachIframe(m,p),this.shadowDomManager.observeAttachShadow(m)},onStylesheetLoad:(m,p)=>{this.stylesheetManager.attachLinkElement(m,p)},cssCaptured:n});f&&(t.push({parentId:d,nextId:h,node:f}),r.add(f.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const l of this.movedSet)Nn(this.removesSubTreeCache,l,this.mirror)&&!this.movedSet.has(W.parentNode(l))||o(l);for(const l of this.addedSet)!On(this.droppedSet,l)&&!Nn(this.removesSubTreeCache,l,this.mirror)||On(this.movedSet,l)?o(l):this.droppedSet.add(l);let a=null;for(;s.length;){let l=null;if(a){const c=this.mirror.getId(W.parentNode(a.value)),n=i(a.value);c!==-1&&n!==-1&&(l=a)}if(!l){let c=s.tail;for(;c;){const n=c;if(c=c.previous,n){const d=this.mirror.getId(W.parentNode(n.value));if(i(n.value)===-1)continue;if(d!==-1){l=n;break}else{const f=n.value,m=W.parentNode(f);if(m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const p=W.host(m);if(this.mirror.getId(p)!==-1){l=n;break}}}}}}if(!l){for(;s.head;)s.removeNode(s.head.value);break}a=l.previous,s.removeNode(l.value),o(l.value)}const u={texts:this.texts.map(l=>{const c=l.node,n=W.parentNode(c);return n&&n.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(n),{id:this.mirror.getId(c),value:l.value}}).filter(l=>!r.has(l.id)).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>{const{attributes:c}=l;if(typeof c.style=="string"){const n=JSON.stringify(l.styleDiff),d=JSON.stringify(l._unchangedStyles);n.length<c.style.length&&(n+d).split("var(").length===c.style.split("var(").length&&(c.style=l.styleDiff)}return{id:this.mirror.getId(l.node),attributes:c}}).filter(l=>!r.has(l.id)).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:t};!u.texts.length&&!u.attributes.length&&!u.removes.length&&!u.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(u))}),M(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));const s=Array.from(W.childNodes(t),i=>W.textContent(i)||"").join("");r.attributes.value=_t({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Pt(t),value:s,maskInputFn:this.maskInputFn})}),M(this,"processMutation",t=>{if(!Ot(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{const r=W.textContent(t.target);!oe(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:Jn(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,js(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let s=t.attributeName,i=t.target.getAttribute(s);if(s==="value"){const a=Pt(r);i=_t({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:a,value:i,maskInputFn:this.maskInputFn})}if(oe(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue)return;let o=this.attributeMap.get(t.target);if(r.tagName==="IFRAME"&&s==="src"&&!this.keepIframeSrcFn(i))if(!r.contentDocument)s="rr_src";else return;if(o||(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(t.target,o)),s==="type"&&r.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!Xn(r.tagName,s))if(o.attributes[s]=Yn(this.doc,Ae(r.tagName),Ae(s),i),s==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(u){this.unattachedDoc=this.doc}const a=this.unattachedDoc.createElement("span");t.oldValue&&a.setAttribute("style",t.oldValue);for(const u of Array.from(r.style)){const l=r.style.getPropertyValue(u),c=r.style.getPropertyPriority(u);l!==a.style.getPropertyValue(u)||c!==a.style.getPropertyPriority(u)?c===""?o.styleDiff[u]=l:o.styleDiff[u]=[l,c]:o._unchangedStyles[u]=[l,c]}for(const u of Array.from(a.style))r.style.getPropertyValue(u)===""&&(o.styleDiff[u]=!1)}else s==="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(oe(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=>{const s=this.mirror.getId(r),i=it(t.target)?this.mirror.getId(W.host(t.target)):this.mirror.getId(t.target);oe(t.target,this.blockClass,this.blockSelector,!1)||Ot(r,this.mirror,this.slimDOMOptions)||!Ro(r,this.mirror)||(this.addedSet.has(r)?(ms(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&s===-1||qs(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Rn(s,i)]?ms(this.movedSet,r):(this.removes.push({parentId:i,id:s,isShadow:it(t.target)&&nt(t.target)?!0:void 0}),Eu(r,this.removesSubTreeCache))),this.mapRemoves.push(r))});break}}}),M(this,"genAdds",(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Ot(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[Rn(this.mirror.getId(t),s)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);oe(t,this.blockClass,this.blockSelector,!1)||(W.childNodes(t).forEach(s=>this.genAdds(s)),De(t)&&W.childNodes(W.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","canvasManager","processedNodeManager"].forEach(r=>{this[r]=t[r]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function ms(e,t){e.delete(t),W.childNodes(t).forEach(r=>ms(e,r))}function Eu(e,t){const r=[e];for(;r.length;){const s=r.pop();t.has(s)||(t.add(s),W.childNodes(s).forEach(i=>r.push(i)))}}function Nn(e,t,r){return e.size===0?!1:xu(e,t)}function xu(e,t,r){const s=W.parentNode(t);return s?e.has(s):!1}function On(e,t){return e.size===0?!1:To(e,t)}function To(e,t){const r=W.parentNode(t);return r?e.has(r)?!0:To(e,r):!1}let at;function Mu(e){at=e}function Ru(){at=void 0}const $=e=>at?(...r)=>{try{return e(...r)}catch(s){if(at&&at(s)===!0)return;throw s}}:e,Ne=Mo(),ke=[];function ft(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(t){}return e&&e.target}function Ao(e,t){const r=new Cu;ke.push(r),r.init(e);const[s,i]=xo(),o=new s($(r.processMutations.bind(r)));return o.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[o,i]}function Nu({mousemoveCb:e,sampling:t,doc:r,mirror:s}){if(t.mousemove===!1)return()=>{};const i=typeof t.mousemove=="number"?t.mousemove:50,o=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let a=[],u;const l=et($(d=>{const h=Date.now()-u;e(a.map(f=>(f.timeOffset-=h,f)),d),a=[],u=null}),o),c=$(et($(d=>{const h=ft(d),{clientX:f,clientY:m}=$t(d)?d.changedTouches[0]:d;u||(u=Ke()),a.push({x:f,y:m,id:s.getId(h),timeOffset:Ke()-u}),l(typeof DragEvent!="undefined"&&d instanceof DragEvent?T.Drag:d instanceof MouseEvent?T.MouseMove:T.TouchMove)}),i,{trailing:!1})),n=[ne("mousemove",c,r),ne("touchmove",c,r),ne("drag",c,r)];return $(()=>{n.forEach(d=>d())})}function Ou({mouseInteractionCb:e,doc:t,mirror:r,blockClass:s,blockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const a=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,u=[];let l=null;const c=n=>d=>{const h=ft(d);if(oe(h,s,i,!0))return;let f=null,m=n;if("pointerType"in d){switch(d.pointerType){case"mouse":f=Ce.Mouse;break;case"touch":f=Ce.Touch;break;case"pen":f=Ce.Pen;break}f===Ce.Touch?V[n]===V.MouseDown?m="TouchStart":V[n]===V.MouseUp&&(m="TouchEnd"):Ce.Pen}else $t(d)&&(f=Ce.Touch);f!==null?(l=f,(m.startsWith("Touch")&&f===Ce.Touch||m.startsWith("Mouse")&&f===Ce.Mouse)&&(f=null)):V[n]===V.Click&&(f=l,l=null);const p=$t(d)?d.changedTouches[0]:d;if(!p)return;const g=r.getId(h),{clientX:v,clientY:y}=p;$(e)(k({type:V[m],id:g,x:v,y},f!==null&&{pointerType:f}))};return Object.keys(V).filter(n=>Number.isNaN(Number(n))&&!n.endsWith("_Departed")&&a[n]!==!1).forEach(n=>{let d=Ae(n);const h=c(n);if(window.PointerEvent)switch(V[n]){case V.MouseDown:case V.MouseUp:d=d.replace("mouse","pointer");break;case V.TouchStart:case V.TouchEnd:return}u.push(ne(d,h,t))}),$(()=>{u.forEach(n=>n())})}function _o({scrollCb:e,doc:t,mirror:r,blockClass:s,blockSelector:i,sampling:o}){const a=$(et($(u=>{const l=ft(u);if(!l||oe(l,s,i,!0))return;const c=r.getId(l);if(l===t&&t.defaultView){const n=$s(t.defaultView);e({id:c,x:n.left,y:n.top})}else e({id:c,x:l.scrollLeft,y:l.scrollTop})}),o.scroll||100));return ne("scroll",a,t)}function Iu({viewportResizeCb:e},{win:t}){let r=-1,s=-1;const i=$(et($(()=>{const o=zs(),a=Vs();(r!==o||s!==a)&&(e({width:Number(a),height:Number(o)}),r=o,s=a)}),200));return ne("resize",i,t)}const Du=["INPUT","TEXTAREA","SELECT"],In=new WeakMap;function Tu({inputCb:e,doc:t,mirror:r,blockClass:s,blockSelector:i,ignoreClass:o,ignoreSelector:a,maskInputOptions:u,maskInputFn:l,sampling:c,userTriggeredOnInput:n}){function d(y){let w=ft(y);const C=y.isTrusted,S=w&&w.tagName;if(w&&S==="OPTION"&&(w=W.parentElement(w)),!w||!S||Du.indexOf(S)<0||oe(w,s,i,!0)||w.classList.contains(o)||a&&w.matches(a))return;let b=w.value,E=!1;const R=Pt(w)||"";R==="radio"||R==="checkbox"?E=w.checked:(u[S.toLowerCase()]||u[R])&&(b=_t({element:w,maskInputOptions:u,tagName:S,type:R,value:b,maskInputFn:l})),h(w,n?{text:b,isChecked:E,userTriggered:C}:{text:b,isChecked:E});const I=w.name;R==="radio"&&I&&E&&t.querySelectorAll(`input[type="radio"][name="${I}"]`).forEach(N=>{if(N!==w){const F=N.value;h(N,n?{text:F,isChecked:!E,userTriggered:!1}:{text:F,isChecked:!E})}})}function h(y,w){const C=In.get(y);if(!C||C.text!==w.text||C.isChecked!==w.isChecked){In.set(y,w);const S=r.getId(y);$(e)(se(k({},w),{id:S}))}}const m=(c.input==="last"?["change"]:["input","change"]).map(y=>ne(y,$(d),t)),p=t.defaultView;if(!p)return()=>{m.forEach(y=>y())};const g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value"),v=[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&m.push(...v.map(y=>ht(y[0],y[1],{set(){$(d)({target:this,isTrusted:!1})}},!1,p))),$(()=>{m.forEach(y=>y())})}function zt(e){const t=[];function r(s,i){if(Ct("CSSGroupingRule")&&s.parentRule instanceof CSSGroupingRule||Ct("CSSMediaRule")&&s.parentRule instanceof CSSMediaRule||Ct("CSSSupportsRule")&&s.parentRule instanceof CSSSupportsRule||Ct("CSSConditionRule")&&s.parentRule instanceof CSSConditionRule){const a=Array.from(s.parentRule.cssRules).indexOf(s);return i.unshift(a),r(s.parentRule,i)}else if(s.parentStyleSheet){const a=Array.from(s.parentStyleSheet.cssRules).indexOf(s);i.unshift(a)}return i}return r(e,t)}function Oe(e,t,r){let s,i;return e?(e.ownerNode?s=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:s}):{}}function Au({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:s}){if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};const i=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=ge(new Ne(i,{apply:$((n,d,h)=>{const[f,m]=h,{id:p,styleId:g}=Oe(d,t,r.styleMirror);return(p&&p!==-1||g&&g!==-1)&&e({id:p,styleId:g,adds:[{rule:f,index:m}]}),n.apply(d,h)})}),i),s.CSSStyleSheet.prototype.addRule=ge(function(n,d,h=this.cssRules.length){const f=`${n} { ${d} }`;return s.CSSStyleSheet.prototype.insertRule.apply(this,[f,h])},i);const o=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=ge(new Ne(o,{apply:$((n,d,h)=>{const[f]=h,{id:m,styleId:p}=Oe(d,t,r.styleMirror);return(m&&m!==-1||p&&p!==-1)&&e({id:m,styleId:p,removes:[{index:f}]}),n.apply(d,h)})}),o),s.CSSStyleSheet.prototype.removeRule=ge(function(n){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[n])},o);let a;s.CSSStyleSheet.prototype.replace&&(a=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=ge(new Ne(a,{apply:$((n,d,h)=>{const[f]=h,{id:m,styleId:p}=Oe(d,t,r.styleMirror);return(m&&m!==-1||p&&p!==-1)&&e({id:m,styleId:p,replace:f}),n.apply(d,h)})}),a));let u;s.CSSStyleSheet.prototype.replaceSync&&(u=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=ge(new Ne(u,{apply:$((n,d,h)=>{const[f]=h,{id:m,styleId:p}=Oe(d,t,r.styleMirror);return(m&&m!==-1||p&&p!==-1)&&e({id:m,styleId:p,replaceSync:f}),n.apply(d,h)})}),u));const l={};Et("CSSGroupingRule")?l.CSSGroupingRule=s.CSSGroupingRule:(Et("CSSMediaRule")&&(l.CSSMediaRule=s.CSSMediaRule),Et("CSSConditionRule")&&(l.CSSConditionRule=s.CSSConditionRule),Et("CSSSupportsRule")&&(l.CSSSupportsRule=s.CSSSupportsRule));const c={};return Object.entries(l).forEach(([n,d])=>{c[n]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=ge(new Ne(c[n].insertRule,{apply:$((h,f,m)=>{const[p,g]=m,{id:v,styleId:y}=Oe(f.parentStyleSheet,t,r.styleMirror);return(v&&v!==-1||y&&y!==-1)&&e({id:v,styleId:y,adds:[{rule:p,index:[...zt(f),g||0]}]}),h.apply(f,m)})}),c[n].insertRule),d.prototype.deleteRule=ge(new Ne(c[n].deleteRule,{apply:$((h,f,m)=>{const[p]=m,{id:g,styleId:v}=Oe(f.parentStyleSheet,t,r.styleMirror);return(g&&g!==-1||v&&v!==-1)&&e({id:g,styleId:v,removes:[{index:[...zt(f),p]}]}),h.apply(f,m)})}),c[n].deleteRule)}),$(()=>{s.CSSStyleSheet.prototype.insertRule=i,s.CSSStyleSheet.prototype.deleteRule=o,a&&(s.CSSStyleSheet.prototype.replace=a),u&&(s.CSSStyleSheet.prototype.replaceSync=u),Object.entries(l).forEach(([n,d])=>{d.prototype.insertRule=c[n].insertRule,d.prototype.deleteRule=c[n].deleteRule})})}function Po({mirror:e,stylesheetManager:t},r){var s,i,o;let a=null;r.nodeName==="#document"?a=e.getId(r):a=e.getId(W.host(r));const u=r.nodeName==="#document"?(s=r.defaultView)==null?void 0:s.Document:(o=(i=r.ownerDocument)==null?void 0:i.defaultView)==null?void 0:o.ShadowRoot,l=u!=null&&u.prototype?Object.getOwnPropertyDescriptor(u==null?void 0:u.prototype,"adoptedStyleSheets"):void 0;return a===null||a===-1||!u||!l?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var c;return(c=l.get)==null?void 0:c.call(this)},set(c){var n;const d=(n=l.set)==null?void 0:n.call(this,c);if(a!==null&&a!==-1)try{t.adoptStyleSheets(c,a)}catch(h){}return d}}),$(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function _u({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:s},{win:i}){const o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Ne(o,{apply:$((u,l,c)=>{var n;const[d,h,f]=c;if(r.has(d))return o.apply(l,[d,h,f]);const{id:m,styleId:p}=Oe((n=l.parentRule)==null?void 0:n.parentStyleSheet,t,s.styleMirror);return(m&&m!==-1||p&&p!==-1)&&e({id:m,styleId:p,set:{property:d,value:h,priority:f},index:zt(l.parentRule)}),u.apply(l,c)})});const a=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Ne(a,{apply:$((u,l,c)=>{var n;const[d]=c;if(r.has(d))return a.apply(l,[d]);const{id:h,styleId:f}=Oe((n=l.parentRule)==null?void 0:n.parentStyleSheet,t,s.styleMirror);return(h&&h!==-1||f&&f!==-1)&&e({id:h,styleId:f,remove:{property:d},index:zt(l.parentRule)}),u.apply(l,c)})}),$(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=a})}function Pu({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:s,sampling:i,doc:o}){const a=$(l=>et($(c=>{const n=ft(c);if(!n||oe(n,t,r,!0))return;const{currentTime:d,volume:h,muted:f,playbackRate:m,loop:p}=n;e({type:l,id:s.getId(n),currentTime:d,volume:h,muted:f,playbackRate:m,loop:p})}),i.media||500)),u=[ne("play",a(Ie.Play),o),ne("pause",a(Ie.Pause),o),ne("seeked",a(Ie.Seeked),o),ne("volumechange",a(Ie.VolumeChange),o),ne("ratechange",a(Ie.RateChange),o)];return $(()=>{u.forEach(l=>l())})}function ku({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const s=[],i=new WeakMap,o=r.FontFace;r.FontFace=ge(function(l,c,n){const d=new o(l,c,n);return i.set(d,{family:l,buffer:typeof c!="string",descriptors:n,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),d},o);const a=Be(t.fonts,"add",function(u){return function(l){return setTimeout($(()=>{const c=i.get(l);c&&(e(c),i.delete(l))}),0),u.apply(this,[l])}});return s.push(()=>{r.FontFace=o}),s.push(a),$(()=>{s.forEach(u=>u())})}function Lu(e){const{doc:t,mirror:r,blockClass:s,blockSelector:i,selectionCb:o}=e;let a=!0;const u=$(()=>{const l=t.getSelection();if(!l||a&&(l!=null&&l.isCollapsed))return;a=l.isCollapsed||!1;const c=[],n=l.rangeCount||0;for(let d=0;d<n;d++){const h=l.getRangeAt(d),{startContainer:f,startOffset:m,endContainer:p,endOffset:g}=h;oe(f,s,i,!0)||oe(p,s,i,!0)||c.push({start:r.getId(f),startOffset:m,end:r.getId(p),endOffset:g})}o({ranges:c})});return u(),ne("selectionchange",u)}function Fu({doc:e,customElementCb:t}){const r=e.defaultView;return!r||!r.customElements?()=>{}:Be(r.customElements,"define",function(i){return function(o,a,u){try{t({define:{name:o}})}catch(l){console.warn(`Custom element callback failed for ${o}`)}return i.apply(this,[o,a,u])}})}function Uu(e,t){const{mutationCb:r,mousemoveCb:s,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:a,inputCb:u,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:n,canvasMutationCb:d,fontCb:h,selectionCb:f,customElementCb:m}=e;e.mutationCb=(...p)=>{t.mutation&&t.mutation(...p),r(...p)},e.mousemoveCb=(...p)=>{t.mousemove&&t.mousemove(...p),s(...p)},e.mouseInteractionCb=(...p)=>{t.mouseInteraction&&t.mouseInteraction(...p),i(...p)},e.scrollCb=(...p)=>{t.scroll&&t.scroll(...p),o(...p)},e.viewportResizeCb=(...p)=>{t.viewportResize&&t.viewportResize(...p),a(...p)},e.inputCb=(...p)=>{t.input&&t.input(...p),u(...p)},e.mediaInteractionCb=(...p)=>{t.mediaInteaction&&t.mediaInteaction(...p),l(...p)},e.styleSheetRuleCb=(...p)=>{t.styleSheetRule&&t.styleSheetRule(...p),c(...p)},e.styleDeclarationCb=(...p)=>{t.styleDeclaration&&t.styleDeclaration(...p),n(...p)},e.canvasMutationCb=(...p)=>{t.canvasMutation&&t.canvasMutation(...p),d(...p)},e.fontCb=(...p)=>{t.font&&t.font(...p),h(...p)},e.selectionCb=(...p)=>{t.selection&&t.selection(...p),f(...p)},e.customElementCb=(...p)=>{t.customElement&&t.customElement(...p),m(...p)}}function Wu(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};Uu(e,t);let s,i=()=>{};e.recordDOM&&([s,i]=Ao(e,e.doc));const o=Nu(e),a=Ou(e),u=_o(e),l=Iu(e,{win:r}),c=Tu(e),n=Pu(e);let d=()=>{},h=()=>{},f=()=>{},m=()=>{};e.recordDOM&&(d=Au(e,{win:r}),h=Po(e,e.doc),f=_u(e,{win:r}),e.collectFonts&&(m=ku(e)));const p=Lu(e),g=Fu(e),v=[];for(const y of e.plugins)v.push(y.observer(y.callback,r,y.options));return $(()=>{ke.forEach(y=>y.reset()),s==null||s.disconnect(),i(),o(),a(),u(),l(),c(),n(),d(),h(),f(),m(),p(),g(),v.forEach(y=>y())})}function Ct(e){return typeof window[e]!="undefined"}function Et(e){return!!(typeof window[e]!="undefined"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Dn{constructor(t){M(this,"iframeIdToRemoteIdMap",new WeakMap),M(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,r,s,i){const o=s||this.getIdToRemoteIdMap(t),a=i||this.getRemoteIdToIdMap(t);let u=o.get(r);return u||(u=this.generateIdFn(),o.set(r,u),a.set(u,r)),u}getIds(t,r){const s=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return r.map(o=>this.getId(t,o,s,i))}getRemoteId(t,r,s){const i=s||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;const o=i.get(r);return o||-1}getRemoteIds(t,r){const s=this.getRemoteIdToIdMap(t);return r.map(i=>this.getRemoteId(t,i,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}}const Ks=class gs{constructor(t){M(this,"iframes",new WeakMap),M(this,"crossOriginIframeMap",new WeakMap),M(this,"crossOriginIframeMirror",new Dn(Hn)),M(this,"crossOriginIframeStyleMirror"),M(this,"crossOriginIframeRootIdMap",new WeakMap),M(this,"mirror"),M(this,"mutationCb"),M(this,"wrappedEmit"),M(this,"loadListener"),M(this,"stylesheetManager"),M(this,"recordCrossOriginIframes"),M(this,"iframeNavStats",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Dn(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}isIframeLooping(t){const r=Date.now(),s=this.iframeNavStats.get(t);return!s||r-s.windowStart>gs.LOOP_NAV_WINDOW_MS?(this.iframeNavStats.set(t,{count:1,windowStart:r}),!1):(s.count++,s.count>gs.LOOP_NAV_LIMIT?(s.windowStart=r,s.count=0,!0):!1)}attachIframe(t,r){var s,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((s=t.contentWindow)==null||s.addEventListener("message",this.handleMessage.bind(this))),this.isIframeLooping(t)||(i=this.loadListener)==null||i.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){const r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin||!t.source)return;const i=this.crossOriginIframeMap.get(t.source);if(!i)return;const o=this.transformCrossOriginEvent(i,r.data.event);o&&this.wrappedEmit(o,r.data.isCheckout)}transformCrossOriginEvent(t,r){var s;switch(r.type){case _.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);const i=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(r.data.node,i),{timestamp:r.timestamp,type:_.IncrementalSnapshot,data:{source:T.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 _.Plugin:return r;case _.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case _.IncrementalSnapshot:switch(r.data.source){case T.Mutation:return r.data.adds.forEach(i=>{this.replaceIds(i,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,t);const o=this.crossOriginIframeRootIdMap.get(t);o&&this.patchRootIdOnNode(i.node,o)}),r.data.removes.forEach(i=>{this.replaceIds(i,t,["parentId","id"])}),r.data.attributes.forEach(i=>{this.replaceIds(i,t,["id"])}),r.data.texts.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case T.Drag:case T.TouchMove:case T.MouseMove:return r.data.positions.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case T.ViewportResize:return!1;case T.MediaInteraction:case T.MouseInteraction:case T.Scroll:case T.CanvasMutation:case T.Input:return this.replaceIds(r.data,t,["id"]),r;case T.StyleSheetRule:case T.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case T.Font:return r;case T.Selection:return r.data.ranges.forEach(i=>{this.replaceIds(i,t,["start","end"])}),r;case T.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(s=r.data.styles)==null||s.forEach(i=>{this.replaceStyleIds(i,t,["styleId"])}),r}}return!1}replace(t,r,s,i){for(const o of i)!Array.isArray(r[o])&&typeof r[o]!="number"||(Array.isArray(r[o])?r[o]=t.getIds(s,r[o]):r[o]=t.getId(s,r[o]));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!==Ee.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(s=>{this.patchRootIdOnNode(s,r)})}};M(Ks,"LOOP_NAV_LIMIT",5);M(Ks,"LOOP_NAV_WINDOW_MS",3e3);let Bu=Ks;class $u{constructor(t){M(this,"shadowDoms",new WeakSet),M(this,"mutationCb"),M(this,"scrollCb"),M(this,"bypassOptions"),M(this,"mirror"),M(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(!nt(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t),this.bypassOptions.canvasManager.addShadowRoot(t);const[s]=Ao(se(k({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push(()=>s.disconnect()),this.restoreHandlers.push(_o(se(k({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(W.host(t))),this.restoreHandlers.push(Po({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,r){const s=this;this.restoreHandlers.push(Be(t.prototype,"attachShadow",function(i){return function(o){const a=i.call(this,o),u=W.shadowRoot(this);return u&&Zs(this)&&s.addShadowRoot(u,r),a}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch(r){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}var Xe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",st=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var xt=0;xt<Xe.length;xt++)st[Xe.charCodeAt(xt)]=xt;var ko=function(e){var t=new Uint8Array(e),r,s=t.length,i="";for(r=0;r<s;r+=3)i+=Xe[t[r]>>2],i+=Xe[(t[r]&3)<<4|t[r+1]>>4],i+=Xe[(t[r+1]&15)<<2|t[r+2]>>6],i+=Xe[t[r+2]&63];return s%3===2?i=i.substring(0,i.length-1)+"=":s%3===1&&(i=i.substring(0,i.length-2)+"=="),i},zu=function(e){var t=e.length*.75,r=e.length,s,i=0,o,a,u,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var c=new ArrayBuffer(t),n=new Uint8Array(c);for(s=0;s<r;s+=4)o=st[e.charCodeAt(s)],a=st[e.charCodeAt(s+1)],u=st[e.charCodeAt(s+2)],l=st[e.charCodeAt(s+3)],n[i++]=o<<2|a>>4,n[i++]=(a&15)<<4|u>>2,n[i++]=(u&3)<<6|l&63;return c};const Tn=new Map;function Vu(e,t){let r=Tn.get(e);return r||(r=new Map,Tn.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}const Lo=(e,t,r)=>{if(!e||!(Uo(e,t)||typeof e=="object"))return;const s=e.constructor.name,i=Vu(r,s);let o=i.indexOf(e);return o===-1&&(o=i.length,i.push(e)),o},Mt=new Map;function ju(e){var t;const r=e.src;try{if(!e.complete||!e.naturalWidth||typeof r!="string"||r.startsWith("data:"))return r;const s=Mt.get(r);if(s)return s;const i=(e.ownerDocument||document).createElement("canvas");i.width=e.naturalWidth,i.height=e.naturalHeight,(t=i.getContext("2d"))==null||t.drawImage(e,0,0);const o=i.toDataURL();return Mt.size>100&&Mt.clear(),Mt.set(r,o),o}catch(s){return r}}const qu=new Set(["[object Float32Array]","[object Float64Array]","[object Int32Array]","[object Uint32Array]","[object Uint8Array]","[object Uint16Array]","[object Int16Array]","[object Int8Array]","[object Uint8ClampedArray]"]);function Gu(e){return qu.has(Object.prototype.toString.call(e))}function Hu(e,t){return typeof e=="object"&&e!==null&&(e.tagName==="IMG"||typeof t.HTMLImageElement=="function"&&e instanceof t.HTMLImageElement)}function Yu(e,t){return typeof e=="object"&&e!==null&&(e.tagName==="CANVAS"||typeof t.HTMLCanvasElement=="function"&&e instanceof t.HTMLCanvasElement)}function Xu(e,t){return typeof e=="object"&&e!==null&&(Object.prototype.toString.call(e)==="[object ImageData]"||typeof t.ImageData=="function"&&e instanceof t.ImageData)}function It(e,t,r){if(e instanceof Array)return e.map(s=>It(s,t,r));if(e===null)return e;if(Gu(e)){const s=e;return{rr_type:s.constructor.name,args:[Object.values(s)]}}else if(e instanceof ArrayBuffer){const s=e.constructor.name,i=ko(e);return{rr_type:s,base64:i}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[It(e.buffer,t,r),e.byteOffset,e.byteLength]};if(Hu(e,t)){const s="HTMLImageElement",i=ju(e);return{rr_type:s,src:i}}else if(Yu(e,t)){const s="HTMLImageElement",i=e.toDataURL();return{rr_type:s,src:i}}else{if(Xu(e,t))return{rr_type:"ImageData",args:[It(e.data,t,r),e.width,e.height]};if(Uo(e,t)||typeof e=="object"){const s=e.constructor.name,i=Lo(e,t,r);return{rr_type:s,index:i}}}}return e}const Fo=(e,t,r)=>e.map(s=>It(s,t,r)),Uo=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof t[i]=="function").find(i=>e instanceof t[i]);function Ju(e,t,r,s){const i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of o)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;const u=Be(t.CanvasRenderingContext2D.prototype,a,function(l){return function(...c){return oe(this.canvas,r,s,!0)||setTimeout(()=>{const n=Fo(c,t,this);e(this.canvas,{type:xe["2D"],property:a,args:n})},0),l.apply(this,c)}});i.push(u)}catch(u){const l=ht(t.CanvasRenderingContext2D.prototype,a,{set(c){e(this.canvas,{type:xe["2D"],property:a,args:[c],setter:!0})}});i.push(l)}return()=>{i.forEach(a=>a())}}function Qu(e){return e==="experimental-webgl"?"webgl":e}function An(e,t,r,s){const i=[];try{const o=Be(e.HTMLCanvasElement.prototype,"getContext",function(a){return function(u,...l){if(!oe(this,t,r,!0)){const c=Qu(u);if("__context"in this||(this.__context=c),s&&["webgl","webgl2"].includes(c))if(l[0]&&typeof l[0]=="object"){const n=l[0];n.preserveDrawingBuffer||(n.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return a.apply(this,[u,...l])}});i.push(o)}catch(o){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(o=>o())}}function _n(e,t,r,s,i,o){const a=[],u=Object.getOwnPropertyNames(e);for(const l of u)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof e[l]!="function")continue;const c=Be(e,l,function(n){return function(...d){const h=n.apply(this,d);if(Lo(h,o,this),"tagName"in this.canvas&&!oe(this.canvas,s,i,!0)){const f=Fo(d,o,this),m={type:t,property:l,args:f};r(this.canvas,m)}return h}});a.push(c)}catch(c){const n=ht(e,l,{set(d){r(this.canvas,{type:t,property:l,args:[d],setter:!0})}});a.push(n)}return a}function Zu(e,t,r,s){const i=[];return typeof t.WebGLRenderingContext!="undefined"&&i.push(..._n(t.WebGLRenderingContext.prototype,xe.WebGL,e,r,s,t)),typeof t.WebGL2RenderingContext!="undefined"&&i.push(..._n(t.WebGL2RenderingContext.prototype,xe.WebGL2,e,r,s,t)),()=>{i.forEach(o=>o())}}function Ku(e){const t=new Uint8Array(e);let r=2166136261;for(let s=0;s<t.length;s++)r^=t[s],r=r*16777619|0;return(r>>>0).toString(16)}function ec(){return typeof OffscreenCanvas!="undefined"}const tc=`
68
+ var _C='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
69
+ function _enc(ab){var b=new Uint8Array(ab),i,n=b.length,o='';for(i=0;i<n;i+=3){o+=_C[b[i]>>2];o+=_C[(b[i]&3)<<4|b[i+1]>>4];o+=_C[(b[i+1]&15)<<2|b[i+2]>>6];o+=_C[b[i+2]&63];}if(n%3===2){o=o.substring(0,o.length-1)+'=';}else if(n%3===1){o=o.substring(0,o.length-2)+'==';}return o;}
70
+ function _fp(ab){var v=new Uint8Array(ab),h=0x811c9dc5;for(var i=0;i<v.length;i++){h^=v[i];h=(h*0x01000193)|0;}return (h>>>0).toString(16);}
71
+ var _last=new Map(),_cv=null,_ctx=null;
72
+ self.onmessage=async function(e){
73
+ var d=e.data,id=d.id,bm=d.bitmap,w=d.width,h=d.height,opt=d.dataURLOptions;
74
+ try{
75
+ if(!('OffscreenCanvas' in self)){bm.close();return self.postMessage({id:id});}
76
+ if(!_cv||_cv.width!==w||_cv.height!==h){_cv=new OffscreenCanvas(w,h);_ctx=_cv.getContext('2d');}
77
+ _ctx.clearRect(0,0,w,h);_ctx.drawImage(bm,0,0);bm.close();
78
+ var blob=await _cv.convertToBlob(opt);
79
+ var buf=await blob.arrayBuffer();
80
+ var fp=_fp(buf);
81
+ if(_last.get(id)===fp)return self.postMessage({id:id});
82
+ _last.set(id,fp);
83
+ self.postMessage({id:id,type:blob.type,base64:_enc(buf),width:w,height:h});
84
+ }catch(err){try{bm.close();}catch(_){}self.postMessage({id:id});}
85
+ };
86
+ `;class rc{constructor(t){M(this,"pendingCanvasMutations",new Map),M(this,"rafStamps",{latestId:0,invokeId:null}),M(this,"options"),M(this,"mirror"),M(this,"shadowDoms",new Set),M(this,"windowsSet",new WeakSet),M(this,"windows",[]),M(this,"mutationCb"),M(this,"restoreHandlers",[]),M(this,"frozen",!1),M(this,"locked",!1),M(this,"snapshotInProgressMap",new Map),M(this,"lastFingerprintMap",new Map),M(this,"snapshotCanvas",null),M(this,"snapshotCtx",null),M(this,"worker",null),M(this,"lastSnapshotTime",0),M(this,"processMutation",(o,a)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(o)||this.pendingCanvasMutations.set(o,[]),this.pendingCanvasMutations.get(o).push(a)});const{sampling:r="all",win:s,recordCanvas:i}=t;t.sampling=r,this.mutationCb=t.mutationCb,this.mirror=t.mirror,this.options=t,this.addWindow(s),i&&r==="all"&&(this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher()),i&&typeof r=="number"&&ec()&&(this.worker=this.initFPSWorker(),this.initCanvasFPSObserver())}reset(){var t;this.pendingCanvasMutations.clear(),this.restoreHandlers.forEach(r=>{try{r()}catch(s){}}),this.restoreHandlers=[],this.windowsSet=new WeakSet,this.windows=[],this.shadowDoms=new Set,this.snapshotInProgressMap=new Map,this.lastFingerprintMap=new Map,this.snapshotCanvas=null,this.snapshotCtx=null,(t=this.worker)==null||t.terminate(),this.worker=null}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initFPSWorker(){try{const t=new Worker("data:application/javascript;charset=utf-8,"+encodeURIComponent(tc));return t.onmessage=r=>{const s=r.data,{id:i}=s;this.snapshotInProgressMap.set(i,!1),s.base64!==void 0&&this.emitCanvasSnapshot(i,s.base64,s.type||"image/png",s.width||0,s.height||0)},t}catch(t){return null}}addWindow(t){const{sampling:r="all",blockClass:s,blockSelector:i,recordCanvas:o}=this.options;if(!this.windowsSet.has(t)){if(o&&r==="all"&&this.initCanvasMutationObserver(t,s,i),o&&typeof r=="number"){const a=An(t,s,i,!0);this.restoreHandlers.push(()=>{a()})}this.windowsSet.add(t),this.windows.push(new WeakRef(t))}}addShadowRoot(t){this.shadowDoms.add(new WeakRef(t))}resetShadowRoots(){this.shadowDoms=new Set}async snapshotImageBitmap(t,r,s,i,o){try{let a=this.snapshotCanvas;(!a||a.width!==s||a.height!==i)&&(a=new OffscreenCanvas(s,i),this.snapshotCanvas=a,this.snapshotCtx=a.getContext("2d"));const u=this.snapshotCtx;if(!u)return;u.clearRect(0,0,s,i),u.drawImage(r,0,0);const l=await a.convertToBlob(o),c=await l.arrayBuffer(),n=Ku(c);if(this.lastFingerprintMap.get(t)===n)return;this.lastFingerprintMap.set(t,n),this.emitCanvasSnapshot(t,ko(c),l.type,s,i)}catch(a){}finally{r.close(),this.snapshotInProgressMap.set(t,!1)}}emitCanvasSnapshot(t,r,s,i,o){this.mutationCb({id:t,type:xe["2D"],commands:[{property:"clearRect",args:[0,0,i,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:s}]},0,0]}]})}initCanvasFPSObserver(){let t;if(!this.windows.length&&!this.shadowDoms.size)return;const r=s=>{this.takeSnapshot(s),t=requestAnimationFrame(r)};t=requestAnimationFrame(r),this.restoreHandlers.push(()=>{t&&cancelAnimationFrame(t)})}initCanvasMutationObserver(t,r,s){const i=An(t,r,s,!1),o=Ju(this.processMutation.bind(this),t,r,s),a=Zu(this.processMutation.bind(this),t,r,s);this.restoreHandlers.push(()=>{i(),o(),a()})}getCanvasElements(t,r){const s=[],i=o=>{o.querySelectorAll("canvas").forEach(a=>{oe(a,t,r,!0)||s.push(a)})};for(const o of this.windows){const a=o.deref();let u;try{u=a&&a.document}catch(l){}u&&i(u)}for(const o of this.shadowDoms){const a=o.deref();a&&i(a)}return s}takeSnapshot(t){const{sampling:r,blockClass:s,blockSelector:i,dataURLOptions:o}=this.options,u=1e3/(typeof r=="number"?r:2);if(this.lastSnapshotTime&&t-this.lastSnapshotTime<u)return;this.lastSnapshotTime=t,this.getCanvasElements(s,i).forEach(c=>{var n;const d=this.mirror.getId(c);if(this.snapshotInProgressMap.get(d)||!this.mirror.hasNode(c)||c.width===0||c.height===0)return;if(this.snapshotInProgressMap.set(d,!0),["webgl","webgl2"].includes(c.__context)){const m=c.getContext(c.__context);((n=m==null?void 0:m.getContextAttributes())==null?void 0:n.preserveDrawingBuffer)===!1&&m.clear(m.COLOR_BUFFER_BIT)}const h=c.width,f=c.height;createImageBitmap(c).then(m=>{this.worker?this.worker.postMessage({id:d,bitmap:m,width:h,height:f,dataURLOptions:o},[m]):this.snapshotImageBitmap(d,m,h,f,o)}).catch(()=>{this.snapshotInProgressMap.set(d,!1)})})}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const s=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,s)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const s=this.pendingCanvasMutations.get(t);if(!s||r===-1)return;const i=s.map(a=>{const c=a,{type:u}=c;return $e(c,["type"])}),{type:o}=s[0];this.mutationCb({id:r,type:o,commands:i}),this.pendingCanvasMutations.delete(t)}}class sc{constructor(t){M(this,"trackedLinkElements",new WeakSet),M(this,"mutationCb"),M(this,"adoptedStyleSheetCb"),M(this,"styleMirror",new Js),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;const s={id:r,styleIds:[]},i=[];for(const o of t){let a;this.styleMirror.has(o)?a=this.styleMirror.getId(o):(a=this.styleMirror.add(o),i.push({styleId:a,rules:Array.from(o.rules||CSSRule,(u,l)=>({rule:qn(u,o.href),index:l}))})),s.styleIds.push(a)}i.length>0&&(s.styles=i),this.adoptedStyleSheetCb(s)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class ic{constructor(){M(this,"nodeMap",new WeakMap),M(this,"active",!1)}inOtherBuffer(t,r){const s=this.nodeMap.get(t);return s&&Array.from(s).some(i=>i!==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(){}}let K,Dt,Rt,Vt=!1;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=((si=e.contentWindow)==null?void 0:si.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const me=Gn();function _e(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:s,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:u=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:n=!0,maskAllInputs:d,maskInputOptions:h,slimDOMOptions:f,maskInputFn:m,maskTextFn:p,hooks:g,packFn:v,sampling:y={},dataURLOptions:w={},mousemoveWait:C,recordDOM:S=!0,recordCanvas:b=!1,recordCrossOriginIframes:E=!1,recordAfter:R=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:I=!1,collectFonts:N=!1,inlineImages:F=!1,plugins:A,keepIframeSrcFn:x=()=>!1,ignoreCSSAttributes:ce=new Set([]),errorHandler:ae}=e;Mu(ae);const j=E?window.parent===window:!0;let P=!1;if(!j)try{window.parent.document&&(P=!1)}catch(L){P=!0}if(j&&!t)throw new Error("emit function is required");if(!j&&!P)return()=>{};C!==void 0&&y.mousemove===void 0&&(y.mousemove=C),me.reset();const X=d===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:h!==void 0?h:{password:!0},te=Qn(f);Gs();let Z,G=0;const Me=L=>{for(const re of A||[])re.eventProcessor&&(L=re.eventProcessor(L));return v&&!P&&(L=v(L)),L};K=(L,re)=>{var q;const ee=L;if(ee.timestamp=Ke(),(q=ke[0])!=null&&q.isFrozen()&&ee.type!==_.FullSnapshot&&!(ee.type===_.IncrementalSnapshot&&ee.data.source===T.Mutation)&&ke.forEach(ue=>ue.unfreeze()),j)t==null||t(Me(ee),re);else if(P){const ue={type:"rrweb",event:Me(ee),origin:window.location.origin,isCheckout:re};window.parent.postMessage(ue,"*")}if(ee.type===_.FullSnapshot)Z=ee,G=0;else if(ee.type===_.IncrementalSnapshot){if(ee.data.source===T.Mutation&&ee.data.isAttachIframe)return;G++;const ue=s&&G>=s,de=r&&ee.timestamp-Z.timestamp>r;(ue||de)&&Dt(!0)}};const O=L=>{K({type:_.IncrementalSnapshot,data:k({source:T.Mutation},L)})},Se=L=>K({type:_.IncrementalSnapshot,data:k({source:T.Scroll},L)}),fe=L=>K({type:_.IncrementalSnapshot,data:k({source:T.CanvasMutation},L)}),rt=L=>K({type:_.IncrementalSnapshot,data:k({source:T.AdoptedStyleSheet},L)}),le=new sc({mutationCb:O,adoptedStyleSheetCb:rt}),pe=new Bu({mirror:me,mutationCb:O,stylesheetManager:le,recordCrossOriginIframes:E,wrappedEmit:K});for(const L of A||[])L.getMirror&&L.getMirror({nodeMirror:me,crossOriginIframeMirror:pe.crossOriginIframeMirror,crossOriginIframeStyleMirror:pe.crossOriginIframeStyleMirror});const Pe=new ic;Rt=new rc({recordCanvas:b,mutationCb:fe,win:window,blockClass:i,blockSelector:o,mirror:me,sampling:y.canvas,dataURLOptions:w});const Re=new $u({mutationCb:O,scrollCb:Se,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:n,maskInputOptions:X,dataURLOptions:w,maskTextFn:p,maskInputFn:m,recordCanvas:b,inlineImages:F,sampling:y,slimDOMOptions:te,iframeManager:pe,stylesheetManager:le,canvasManager:Rt,keepIframeSrcFn:x,processedNodeManager:Pe},mirror:me});Dt=(L=!1)=>{if(!S)return;K({type:_.Meta,data:{href:window.location.href,width:Vs(),height:zs()}},L),le.reset(),Re.init(),ke.forEach(q=>q.lock());const re=Va(document,{mirror:me,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:n,maskAllInputs:X,maskTextFn:p,maskInputFn:m,slimDOM:te,dataURLOptions:w,recordCanvas:b,inlineImages:F,onSerialize:q=>{Qe(q,me)&&pe.addIframe(q),Ys(q,me)&&le.trackLinkElement(q),De(q)&&Re.addShadowRoot(W.shadowRoot(q),document)},onIframeLoad:(q,ee)=>{pe.attachIframe(q,ee),q.contentWindow&&Rt.addWindow(q.contentWindow),Re.observeAttachShadow(q)},onStylesheetLoad:(q,ee)=>{le.attachLinkElement(q,ee)},keepIframeSrcFn:x});if(!re)return console.warn("Failed to snapshot the document");K({type:_.FullSnapshot,data:{node:re,initialOffset:$s(window)}},L),ke.forEach(q=>q.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&le.adoptStyleSheets(document.adoptedStyleSheets,me.getId(document))};try{const L=[],re=ue=>{var de;return $(Wu)({mutationCb:O,mousemoveCb:(H,dt)=>K({type:_.IncrementalSnapshot,data:{source:dt,positions:H}}),mouseInteractionCb:H=>K({type:_.IncrementalSnapshot,data:k({source:T.MouseInteraction},H)}),scrollCb:Se,viewportResizeCb:H=>K({type:_.IncrementalSnapshot,data:k({source:T.ViewportResize},H)}),inputCb:H=>K({type:_.IncrementalSnapshot,data:k({source:T.Input},H)}),mediaInteractionCb:H=>K({type:_.IncrementalSnapshot,data:k({source:T.MediaInteraction},H)}),styleSheetRuleCb:H=>K({type:_.IncrementalSnapshot,data:k({source:T.StyleSheetRule},H)}),styleDeclarationCb:H=>K({type:_.IncrementalSnapshot,data:k({source:T.StyleDeclaration},H)}),canvasMutationCb:fe,fontCb:H=>K({type:_.IncrementalSnapshot,data:k({source:T.Font},H)}),selectionCb:H=>{K({type:_.IncrementalSnapshot,data:k({source:T.Selection},H)})},customElementCb:H=>{K({type:_.IncrementalSnapshot,data:k({source:T.CustomElement},H)})},blockClass:i,ignoreClass:a,ignoreSelector:u,maskTextClass:l,maskTextSelector:c,maskInputOptions:X,inlineStylesheet:n,sampling:y,recordDOM:S,recordCanvas:b,inlineImages:F,userTriggeredOnInput:I,collectFonts:N,doc:ue,maskInputFn:m,maskTextFn:p,keepIframeSrcFn:x,blockSelector:o,slimDOMOptions:te,dataURLOptions:w,mirror:me,iframeManager:pe,stylesheetManager:le,shadowDomManager:Re,processedNodeManager:Pe,canvasManager:Rt,ignoreCSSAttributes:ce,plugins:((de=A==null?void 0:A.filter(H=>H.observer))==null?void 0:de.map(H=>({observer:H.observer,options:H.options,callback:dt=>K({type:_.Plugin,data:{plugin:H.name,payload:dt}})})))||[]},g)},q=new Map;pe.addLoadListener(ue=>{try{const de=q.get(ue);if(de){try{de()}catch(dt){}q.delete(ue)}const H=re(ue.contentDocument);L.push(H),q.set(ue,H)}catch(de){console.warn(de)}});const ee=()=>{Dt(),L.push(re(document)),Vt=!0};return["interactive","complete"].includes(document.readyState)?ee():(L.push(ne("DOMContentLoaded",()=>{K({type:_.DomContentLoaded,data:{}}),R==="DOMContentLoaded"&&ee()})),L.push(ne("load",()=>{K({type:_.Load,data:{}}),R==="load"&&ee()},window))),()=>{L.forEach(ue=>{try{ue()}catch(de){String(de).toLowerCase().includes("cross-origin")||console.warn(de)}}),Pe.destroy(),Vt=!1,Ru()}}catch(L){console.warn(L)}}_e.addCustomEvent=(e,t)=>{if(!Vt)throw new Error("please add custom event after start recording");K({type:_.Custom,data:{tag:e,payload:t}})};_e.freezePage=()=>{ke.forEach(e=>e.freeze())};_e.takeFullSnapshot=e=>{if(!Vt)throw new Error("please take full snapshot after start recording");Dt(e)};_e.mirror=me;function nc(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(i){i(r)}),(s=e.get("*"))&&s.slice().map(function(i){i(t,r)})}}}function oc(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;const r=e.HTMLElement||e.Element,s=468,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||l,scrollIntoView:r.prototype.scrollIntoView},o=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function a(v){const y=["MSIE ","Trident/","Edge/"];return new RegExp(y.join("|")).test(v)}const u=a(e.navigator.userAgent)?1:0;function l(v,y){this.scrollLeft=v,this.scrollTop=y}function c(v){return .5*(1-Math.cos(Math.PI*v))}function n(v){if(v===null||typeof v!="object"||v.behavior===void 0||v.behavior==="auto"||v.behavior==="instant")return!0;if(typeof v=="object"&&v.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+v.behavior+" is not a valid value for enumeration ScrollBehavior.")}function d(v,y){if(y==="Y")return v.clientHeight+u<v.scrollHeight;if(y==="X")return v.clientWidth+u<v.scrollWidth}function h(v,y){const w=e.getComputedStyle(v,null)["overflow"+y];return w==="auto"||w==="scroll"}function f(v){const y=d(v,"Y")&&h(v,"Y"),w=d(v,"X")&&h(v,"X");return y||w}function m(v){for(;v!==t.body&&f(v)===!1;)v=v.parentNode||v.host;return v}function p(v){const y=o();let w,C,S,b=(y-v.startTime)/s;b=b>1?1:b,w=c(b),C=v.startX+(v.x-v.startX)*w,S=v.startY+(v.y-v.startY)*w,v.method.call(v.scrollable,C,S),(C!==v.x||S!==v.y)&&e.requestAnimationFrame(p.bind(e,v))}function g(v,y,w){let C,S,b,E;const R=o();v===t.body?(C=e,S=e.scrollX||e.pageXOffset,b=e.scrollY||e.pageYOffset,E=i.scroll):(C=v,S=v.scrollLeft,b=v.scrollTop,E=l),p({scrollable:C,method:E,startTime:R,startX:S,startY:b,x:y,y:w})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(n(arguments[0])===!0){i.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(n(arguments[0])){i.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(n(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const v=arguments[0].left,y=arguments[0].top;g.call(this,this,typeof v=="undefined"?this.scrollLeft:~~v,typeof y=="undefined"?this.scrollTop:~~y)},r.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(n(arguments[0])===!0){i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},r.prototype.scrollIntoView=function(){if(n(arguments[0])===!0){i.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const v=m(this),y=v.getBoundingClientRect(),w=this.getBoundingClientRect();v!==t.body?(g.call(this,v,v.scrollLeft+w.left-y.left,v.scrollTop+w.top-y.top),e.getComputedStyle(v).position!=="fixed"&&e.scrollBy({left:y.left,top:y.top,behavior:"smooth"})):e.scrollBy({left:w.left,top:w.top,behavior:"smooth"})}}class ac{constructor(t=[],r){M(this,"timeOffset",0),M(this,"speed"),M(this,"actions"),M(this,"raf",null),M(this,"lastTimestamp"),this.actions=t,this.speed=r.speed}addAction(t){const r=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=t.delay)this.actions.push(t);else{const 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(){const t=performance.now();for(this.timeOffset+=(t-this.lastTimestamp)*this.speed,this.lastTimestamp=t;this.actions.length;){const 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;){const i=Math.floor((r+s)/2);if(this.actions[i].delay<t.delay)r=i+1;else if(this.actions[i].delay>t.delay)s=i-1;else return i+1}return r}}function Pn(e,t){if(e.type===_.IncrementalSnapshot&&e.data.source===T.MouseMove&&e.data.positions&&e.data.positions.length){const 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}/*! *****************************************************************************
68
87
  Copyright (c) Microsoft Corporation.
69
88
 
70
89
  Permission to use, copy, modify, and/or distribute this software for any
@@ -77,7 +96,7 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
77
96
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
78
97
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
79
98
  PERFORMANCE OF THIS SOFTWARE.
80
- ***************************************************************************** */function Cn(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var s,i,o=r.call(e),a=[];try{for(;(t===void 0||t-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(u){i={error:u}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}var He;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(He||(He={}));var No={type:"xstate.init"};function es(e){return e===void 0?[]:[].concat(e)}function ze(e){return{type:"xstate.assign",assignment:e}}function En(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 Pt(e){return function(t){return e===t}}function Oo(e){return typeof e=="string"?{type:e}:e}function xn(e,t){return{value:e,context:t,actions:[],changed:!1,matches:Pt(e)}}function Rn(e,t,r){var s=t,i=!1;return[e.filter(function(o){if(o.type==="xstate.assign"){i=!0;var a=Object.assign({},s);return typeof o.assignment=="function"?a=o.assignment(s,r):Object.keys(o.assignment).forEach(function(u){a[u]=typeof o.assignment[u]=="function"?o.assignment[u](s,r):o.assignment[u]}),s=a,!1}return!0}),s,i]}function Io(e,t){t===void 0&&(t={});var r=Cn(Rn(es(e.states[e.initial].entry).map(function(a){return En(a,t.actions)}),e.context,No),2),s=r[0],i=r[1],o={config:e,_options:t,initialState:{value:e.initial,actions:s,context:i,matches:Pt(e.initial)},transition:function(a,u){var l,c,n=typeof a=="string"?{value:a,context:e.context}:a,d=n.value,h=n.context,f=Oo(u),m=e.states[d];if(m.on){var p=es(m.on[f.type]);try{for(var g=function(k){var X=typeof Symbol=="function"&&Symbol.iterator,te=X&&k[X],Z=0;if(te)return te.call(k);if(k&&typeof k.length=="number")return{next:function(){return k&&Z>=k.length&&(k=void 0),{value:k&&k[Z++],done:!k}}};throw new TypeError(X?"Object is not iterable.":"Symbol.iterator is not defined.")}(p),v=g.next();!v.done;v=g.next()){var y=v.value;if(y===void 0)return xn(d,h);var w=typeof y=="string"?{target:y}:y,C=w.target,S=w.actions,b=S===void 0?[]:S,E=w.cond,M=E===void 0?function(){return!0}:E,I=C===void 0,N=C!=null?C:d,F=e.states[N];if(M(h,f)){var T=Cn(Rn((I?es(b):[].concat(m.exit,b,F.entry).filter(function(k){return k})).map(function(k){return En(k,o._options.actions)}),h,f),3),x=T[0],ue=T[1],ae=T[2],q=C!=null?C:d;return{value:q,context:ue,actions:x,changed:C!==d||x.length>0||ae,matches:Pt(q)}}}}catch(k){l={error:k}}finally{try{v&&!v.done&&(c=g.return)&&c.call(g)}finally{if(l)throw l.error}}}return xn(d,h)}};return o}var Mn=function(e,t){return e.actions.forEach(function(r){var s=r.exec;return s&&s(e.context,t)})};function Do(e){var t=e.initialState,r=He.NotStarted,s=new Set,i={_machine:e,send:function(o){r===He.Running&&(t=e.transition(t,o),Mn(t,Oo(o)),s.forEach(function(a){return a(t)}))},subscribe:function(o){return s.add(o),o(t),{unsubscribe:function(){return s.delete(o)}}},start:function(o){if(o){var a=typeof o=="object"?o:{context:e.config.context,value:o};t={value:a.value,actions:[],context:a.context,matches:Pt(a.value)}}return r=He.Running,Mn(t,No),i},stop:function(){return r=He.Stopped,s.clear(),i},get state(){return t},get status(){return r}};return i}function Hu(e,t){for(let r=e.length-1;r>=0;r--){const s=e[r];if(s.type===_.Meta&&s.timestamp<=t)return e.slice(r)}return e}function Yu(e,{getCastFn:t,applyEventsSynchronously:r,emitter:s}){const i=Io({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:ze({lastPlayedEvent:(o,a)=>a.type==="CAST_EVENT"?a.payload.event:o.lastPlayedEvent}),recordTimeOffset:ze((o,a)=>{let u=o.timeOffset;return"payload"in a&&"timeOffset"in a.payload&&(u=a.payload.timeOffset),se(P({},o),{timeOffset:u,baselineTime:o.events[0].timestamp+u})}),play(o){var a;const{timer:u,events:l,baselineTime:c,lastPlayedEvent:n}=o;u.clear();for(const m of l)bn(m,c);const d=Hu(l,c);let h=n==null?void 0:n.timestamp;(n==null?void 0:n.type)===_.IncrementalSnapshot&&n.data.source===A.MouseMove&&(h=n.timestamp+((a=n.data.positions[0])==null?void 0:a.timeOffset)),c<(h||0)&&s.emit(z.PlayBack);const f=new Array;for(const m of d)if(!(h&&h<c&&(m.timestamp<=h||m===n)))if(m.timestamp<c)f.push(m);else{const p=t(m,!1);u.addAction({doAction:()=>{p()},delay:m.delay})}r(f),s.emit(z.Flush),u.start()},pause(o){o.timer.clear()},resetLastPlayedEvent:ze(o=>se(P({},o),{lastPlayedEvent:null})),startLive:ze({baselineTime:(o,a)=>(o.timer.start(),a.type==="TO_LIVE"&&a.payload.baselineTime?a.payload.baselineTime:Date.now())}),addEvent:ze((o,a)=>{const{baselineTime:u,timer:l,events:c}=o;if(a.type==="ADD_EVENT"){const{event:n}=a.payload;bn(n,u);let d=c.length-1;if(!c[d]||c[d].timestamp<=n.timestamp)c.push(n);else{let m=-1,p=0;for(;p<=d;){const g=Math.floor((p+d)/2);c[g].timestamp<=n.timestamp?p=g+1:d=g-1}m===-1&&(m=p),c.splice(m,0,n)}const h=n.timestamp<u,f=t(n,h);h?f():l.isActive()&&l.addAction({doAction:()=>{f()},delay:n.delay})}return se(P({},o),{events:c})})}});return Do(i)}function Xu(e){const t=Io({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:ze({normalSpeed:r=>r.timer.speed}),restoreSpeed:r=>{r.timer.setSpeed(r.normalSpeed)}}});return Do(t)}const Ju=e=>[`.${e} { background: currentColor }`,"noscript { display: none !important; }"],Nn=new Map;function Ao(e,t){let r=Nn.get(e);return r||(r=new Map,Nn.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}function De(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){const i=await De(e,t,r)(s.args);return await createImageBitmap.apply(null,i)}else if("index"in s){if(r||t===null)return s;const{rr_type:i,index:o}=s;return Ao(t,i)[o]}else if("args"in s){const{rr_type:i,args:o}=s,a=window[i];return new a(...await Promise.all(o.map(De(e,t,r))))}else{if("base64"in s)return Ou(s.base64);if("src"in s){const i=e.get(s.src);if(i)return i;{const o=new Image;return o.src=s.src,e.set(s.src,o),o}}else if("data"in s&&s.rr_type==="Blob"){const i=await Promise.all(s.data.map(De(e,t,r)));return new Blob(i,{type:s.type})}}else if(Array.isArray(s))return await Promise.all(s.map(De(e,t,r)));return s}}function Qu(e,t){try{return t===Ce.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch(r){return null}}const Zu=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function Ku(e,t){if(!(t!=null&&t.constructor))return;const{name:r}=t.constructor;if(!Zu.includes(r))return;const s=Ao(e,r);s.includes(t)||s.push(t)}async function ec({mutation:e,target:t,type:r,imageMap:s,errorHandler:i}){try{const o=Qu(t,r);if(!o)return;if(e.setter){o[e.property]=e.args[0];return}const a=o[e.property],u=await Promise.all(e.args.map(De(s,o))),l=a.apply(o,u);Ku(o,l);const c=!1}catch(o){i(e,o)}}async function tc({event:e,mutations:t,target:r,imageMap:s,errorHandler:i}){const o=r.getContext("2d");if(!o){i(t[0],new Error("Canvas context is null"));return}const a=t.map(async l=>Promise.all(l.args.map(De(s,o))));(await Promise.all(a)).forEach((l,c)=>{const n=t[c];try{if(n.setter){o[n.property]=n.args[0];return}const d=o[n.property];n.property==="drawImage"&&typeof n.args[0]=="string"?(s.get(e),d.apply(o,n.args)):d.apply(o,l)}catch(d){i(n,d)}})}async function as({event:e,mutation:t,target:r,imageMap:s,canvasEventMap:i,errorHandler:o}){try{const a=i.get(e)||t,u="commands"in a?a.commands:[a];if([Ce.WebGL,Ce.WebGL2].includes(t.type)){for(let l=0;l<u.length;l++){const c=u[l];await ec({mutation:c,type:t.type,target:r,imageMap:s,errorHandler:o})}return}await tc({event:e,mutations:u,target:r,imageMap:s,errorHandler:o})}catch(a){o(t,a)}}class rc{constructor(t){R(this,"mediaMap",new Map),R(this,"warn"),R(this,"service"),R(this,"speedService"),R(this,"emitter"),R(this,"getCurrentTime"),R(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(z.Start,this.start.bind(this)),this.emitter.on(z.SkipStart,this.start.bind(this)),this.emitter.on(z.Pause,this.pause.bind(this)),this.emitter.on(z.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){const o=(t-s.lastInteractionTimeOffset)/1e3*s.playbackRate,a="duration"in r&&r.duration;if(Number.isNaN(a)){this.waitForMetadata(r);return}let u=s.currentTimeAtLastInteraction+o;r.loop&&a!==!1&&(u=u%a),r.currentTime=u}else r.pause(),r.currentTime=s.currentTimeAtLastInteraction}waitForMetadata(t){if(this.metadataCallbackMap.has(t)||!("addEventListener"in t))return;const r=()=>{this.metadataCallbackMap.delete(t);const 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}){var f,m,p,g,v;const i=this.mediaMap.get(t),{type:o,playbackRate:a,currentTime:u,muted:l,volume:c,loop:n}=s;return{isPlaying:o===Oe.Play||o!==Oe.Pause&&((i==null?void 0:i.isPlaying)||t.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:(f=u!=null?u:i==null?void 0:i.currentTimeAtLastInteraction)!=null?f:0,lastInteractionTimeOffset:r,playbackRate:(m=a!=null?a:i==null?void 0:i.playbackRate)!=null?m:1,volume:(p=c!=null?c:i==null?void 0:i.volume)!=null?p:1,muted:(g=l!=null?l:i==null?void 0:i.muted)!=null?g:t.getAttribute("muted")===null,loop:(v=n!=null?n:i==null?void 0:i.loop)!=null?v:t.getAttribute("loop")===null}}syncTargetWithState(t){const r=this.mediaMap.get(t);if(!r)return;const{muted:s,loop:i,volume:o,isPlaying:a}=r,u=this.service.state.matches("paused"),l=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=s,t.loop=i,t.playbackRate!==l&&(t.playbackRate=l),a&&!u?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;const i=t,o=s.getMeta(i);if(!o||!("attributes"in o))return;const a=this.service.state.matches("paused"),u=o.attributes;let l=!1;u.rr_mediaState?l=u.rr_mediaState==="played":l=i.getAttribute("autoplay")!==null,l&&a&&i.pause();let c=1;typeof u.rr_mediaPlaybackRate=="number"&&(c=u.rr_mediaPlaybackRate);let n=!1;typeof u.rr_mediaMuted=="boolean"?n=u.rr_mediaMuted:n=i.getAttribute("muted")!==null;let d=!1;typeof u.rr_mediaLoop=="boolean"?d=u.rr_mediaLoop:d=i.getAttribute("loop")!==null;let h=1;typeof u.rr_mediaVolume=="number"&&(h=u.rr_mediaVolume);let f=0;typeof u.rr_mediaCurrentTime=="number"&&(f=u.rr_mediaCurrentTime),this.mediaMap.set(i,{isPlaying:l,currentTimeAtLastInteraction:f,lastInteractionTimeOffset:r,playbackRate:c,volume:h,muted:n,loop:d}),this.syncTargetWithState(i)}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 Ct(e,t){if(e.nodeName!=="DIALOG"||e instanceof ye)return;const r=e,s=r.open,i=s&&r.matches("dialog:modal"),o=r.getAttribute("rr_open_mode"),a=typeof(t==null?void 0:t.attributes.open)=="string"||typeof r.getAttribute("open")=="string",u=o==="modal";if(!(s&&!(i&&o==="non-modal"||!i&&u))){if(!r.isConnected){console.warn("dialog is not attached to the dom",r);return}s&&r.close(),a&&(u?r.showModal():r.show())}}function sc(e,t){if(e.nodeName!=="DIALOG"||e instanceof ye)return;const 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"))}const ic=5*1e3,nc=qu,On="[replayer]",ts={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function In(e){return e.type==_.IncrementalSnapshot&&(e.data.source==A.TouchMove||e.data.source==A.MouseInteraction&&e.data.type==V.TouchStart)}class oc{constructor(t,r){if(R(this,"wrapper"),R(this,"iframe"),R(this,"UNSAFE_replayCanvas",!1),R(this,"service"),R(this,"speedService"),R(this,"config"),R(this,"usingVirtualDom",!1),R(this,"virtualDom",new Qe),R(this,"mouse"),R(this,"mouseTail",null),R(this,"tailPositions",[]),R(this,"emitter",nc()),R(this,"nextUserInteractionEvent"),R(this,"legacy_missingNodeRetryMap",{}),R(this,"cache",Di()),R(this,"imageMap",new Map),R(this,"canvasEventMap",new Map),R(this,"mirror",kn()),R(this,"styleMirror",new Ws),R(this,"mediaManager"),R(this,"firstFullSnapshot",null),R(this,"newDocumentQueue",[]),R(this,"mousePos",null),R(this,"touchActive",null),R(this,"lastMouseDownEvent",null),R(this,"lastHoveredRootNode"),R(this,"lastSelectionData",null),R(this,"constructedStyleMutations",[]),R(this,"adoptedStyleSheets",[]),R(this,"handleResize",u=>{this.iframe.style.display="inherit";for(const l of[this.mouseTail,this.iframe])l&&(l.setAttribute("width",String(u.width)),l.setAttribute("height",String(u.height)))}),R(this,"applyEventsSynchronously",u=>{for(const l of u){switch(l.type){case _.DomContentLoaded:case _.Load:case _.Custom:continue;case _.FullSnapshot:case _.Meta:case _.Plugin:case _.IncrementalSnapshot:break}this.getCastFn(l,!0)()}}),R(this,"getCastFn",(u,l=!1)=>{let c;switch(u.type){case _.DomContentLoaded:case _.Load:break;case _.Custom:c=()=>{this.emitter.emit(z.CustomEvent,u)};break;case _.Meta:c=()=>this.emitter.emit(z.Resize,{width:u.data.width,height:u.data.height});break;case _.FullSnapshot:c=()=>{var d;if(this.firstFullSnapshot){if(this.firstFullSnapshot===u){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(u,l),(d=this.iframe.contentWindow)==null||d.scrollTo(u.data.initialOffset)};break;case _.IncrementalSnapshot:c=()=>{if(this.applyIncremental(u,l),!l&&(u===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const d of this.service.state.context.events)if(!(d.timestamp<=u.timestamp)&&this.isUserInteraction(d)){d.delay-u.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=d);break}if(this.nextUserInteractionEvent){const d=this.nextUserInteractionEvent.delay-u.delay,h={speed:Math.min(Math.round(d/ic),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:h}),this.emitter.emit(z.SkipStart,h)}}};break}return()=>{c&&c();for(const h of this.config.plugins||[])h.handler&&h.handler(u,l,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:u}});const d=this.service.state.context.events.length-1;if(!this.config.liveMode&&u===this.service.state.context.events[d]){const h=()=>{d<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(z.Finish))};let f=50;u.type===_.IncrementalSnapshot&&u.data.source===A.MouseMove&&u.data.positions.length&&(f+=Math.max(0,-u.data.positions[0].timeOffset)),setTimeout(h,f)}this.emitter.emit(z.EventCast,u)}}),!(r!=null&&r.liveMode)&&t.length<2)throw new Error("Replayer need at least 2 events.");const 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:ts,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(z.Resize,this.handleResize),this.setupDom();for(const u of this.config.plugins||[])u.getMirror&&u.getMirror({nodeMirror:this.mirror});this.emitter.on(z.Flush,()=>{if(this.usingVirtualDom){const u={mirror:this.mirror,applyCanvas:(l,c,n)=>{as({event:l,mutation:c,target:n,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(l,c)=>{l.source===A.StyleSheetRule?this.applyStyleSheetRule(l,c):l.source===A.StyleDeclaration&&this.applyStyleDeclaration(l,c)},afterAppend:(l,c)=>{for(const n of this.config.plugins||[])n.onBuild&&n.onBuild(l,{id:c,replayer:this})}};if(this.iframe.contentDocument)try{Dt(this.iframe.contentDocument,this.virtualDom,u,this.virtualDom.mirror)}catch(l){console.warn(l)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const l in this.legacy_missingNodeRetryMap)try{const c=this.legacy_missingNodeRetryMap[l],n=At(c.node,this.mirror,this.virtualDom.mirror);Dt(n,c.node,u,this.virtualDom.mirror),c.node=n}catch(c){this.warn(c)}this.constructedStyleMutations.forEach(l=>{this.applyStyleSheetMutation(l)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(l=>{this.applyAdoptedStyleSheet(l)}),this.adoptedStyleSheets=[]}if(this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null,this.lastMouseDownEvent){const[u,l]=this.lastMouseDownEvent;u.dispatchEvent(l)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(z.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()});const i=new Gu([],{speed:this.config.speed});this.service=Yu({events:t.map(u=>r&&r.unpackFn?r.unpackFn(u):u).sort((u,l)=>u.timestamp-l.timestamp),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(u=>{this.emitter.emit(z.StateChange,{player:u})}),this.speedService=Xu({normalSpeed:-1,timer:i}),this.speedService.start(),this.speedService.subscribe(u=>{this.emitter.emit(z.StateChange,{speed:u})}),this.mediaManager=new rc({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});const o=this.service.state.context.events.find(u=>u.type===_.Meta),a=this.service.state.context.events.find(u=>u.type===_.FullSnapshot);if(o){const{width:u,height:l}=o.data;setTimeout(()=>{this.emitter.emit(z.Resize,{width:u,height:l})},0)}a&&setTimeout(()=>{var u;this.firstFullSnapshot||(this.firstFullSnapshot=a,this.rebuildFullSnapshot(a),(u=this.iframe.contentWindow)==null||u.scrollTo(a.data.initialOffset))},1),this.service.state.context.events.find(In)&&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!="undefined"&&this.speedService.send({type:"SET_SPEED",payload:{speed:t.speed}}),typeof t.mouseTail!="undefined"&&(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(){const 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(){const{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(z.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(z.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(z.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(z.Destroy)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){const r=this.config.unpackFn?this.config.unpackFn(t):t;In(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=Di()}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=rl({root:this.wrapper}),this.UNSAFE_replayCanvas=!1),this.iframe.style.display="none",this.disableInteract(),this.iframe.contentWindow&&this.iframe.contentDocument&&(ju(this.iframe.contentWindow,this.iframe.contentDocument),Ls(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={};const s=[],i=new Set,o=(l,c)=>{if(l.nodeName==="DIALOG"&&i.add(l),this.collectIframeAndAttachDocument(s,l),this.mediaManager.isSupportedMediaElement(l)){const{events:n}=this.service.state.context;this.mediaManager.addMediaElements(l,t.timestamp-n[0].timestamp,this.mirror)}for(const n of this.config.plugins||[])n.onBuild&&n.onBuild(l,{id:c,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),tl(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(const{mutationInQueue:l,builtNode:c}of s)this.attachDocumentToIframe(l,c),this.newDocumentQueue=this.newDocumentQueue.filter(n=>n!==l);const{documentElement:a,head:u}=this.iframe.contentDocument;this.insertStyleRules(a,u),i.forEach(l=>Ct(l)),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(z.FullsnapshotRebuilded,t),r||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,r){var s;const i=Ju(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),!!i.length)if(this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,uo(o,this.virtualDom.unserializedId)),t.insertBefore(o,r),o.rules.push({source:A.StyleSheetRule,adds:i.map((a,u)=>({rule:a,index:u}))})}else{const o=document.createElement("style");t.insertBefore(o,r);for(let a=0;a<i.length;a++)(s=o.sheet)==null||s.insertRule(i[a],a)}}attachDocumentToIframe(t,r){const s=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[],o=new Set,a=(u,l)=>{u.nodeName==="DIALOG"&&o.add(u),this.collectIframeAndAttachDocument(i,u);const c=s.getMeta(u);if((c==null?void 0:c.type)===be.Element&&(c==null?void 0:c.tagName.toUpperCase())==="HTML"){const{documentElement:n,head:d}=r.contentDocument;this.insertStyleRules(n,d)}if(!this.usingVirtualDom)for(const n of this.config.plugins||[])n.onBuild&&n.onBuild(u,{id:l,replayer:this})};rt(t.node,{doc:r.contentDocument,mirror:s,hackCss:!0,skipChild:!1,afterAppend:a,cache:this.cache}),a(r.contentDocument,t.node.id);for(const{mutationInQueue:u,builtNode:l}of i)this.attachDocumentToIframe(u,l),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==u);o.forEach(u=>Ct(u))}collectIframeAndAttachDocument(t,r){if(Ye(r,this.mirror)){const s=this.newDocumentQueue.find(i=>i.parentId===this.mirror.getId(r));s&&t.push({mutationInQueue:s,builtNode:r})}}waitForStylesheetLoad(){var t;const r=(t=this.iframe.contentDocument)==null?void 0:t.head;if(r){const s=new Set;let i,o=this.service.state;const a=()=>{o=this.service.state};this.emitter.on(z.Start,a),this.emitter.on(z.Pause,a);const u=()=>{this.emitter.off(z.Start,a),this.emitter.off(z.Pause,a)};r.querySelectorAll('link[rel="stylesheet"]').forEach(l=>{l.sheet||(s.add(l),l.addEventListener("load",()=>{s.delete(l),s.size===0&&i!==-1&&(o.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(z.LoadStylesheetEnd),i&&clearTimeout(i),u())}))}),s.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(z.LoadStylesheetStart),i=setTimeout(()=>{o.matches("playing")&&this.play(this.getCurrentTime()),i=-1,u()},this.config.loadTimeout))}}async preloadAllImages(){const t=[];for(const r of this.service.state.context.events)r.type===_.IncrementalSnapshot&&r.data.source===A.CanvasMutation&&(t.push(this.deserializeAndPreloadCanvasEvents(r.data,r)),("commands"in r.data?r.data.commands:[r.data]).forEach(i=>{this.preloadImages(i,r)}));return Promise.all(t)}preloadImages(t,r){if(t.property==="drawImage"&&typeof t.args[0]=="string"&&!this.imageMap.has(r)){const s=document.createElement("canvas"),i=s.getContext("2d"),o=i==null?void 0:i.createImageData(s.width,s.height);i==null||i.putImageData(o,0,0)}}async deserializeAndPreloadCanvasEvents(t,r){if(!this.canvasEventMap.has(r)){const s={isUnchanged:!0};if("commands"in t){const i=await Promise.all(t.commands.map(async o=>{const a=await Promise.all(o.args.map(De(this.imageMap,null,s)));return se(P({},o),{args:a})}));s.isUnchanged===!1&&this.canvasEventMap.set(r,se(P({},t),{commands:i}))}else{const i=await Promise.all(t.args.map(De(this.imageMap,null,s)));s.isUnchanged===!1&&this.canvasEventMap.set(r,se(P({},t),{args:i}))}}}applyIncremental(t,r){var s,i,o;const{data:a}=t;switch(a.source){case A.Mutation:{try{this.applyMutation(a,r)}catch(u){this.warn(`Exception in mutation ${u.message||u}`,a)}break}case A.Drag:case A.TouchMove:case A.MouseMove:if(r){const u=a.positions[a.positions.length-1];this.mousePos={x:u.x,y:u.y,id:u.id,debugData:a}}else a.positions.forEach(u=>{const l={doAction:()=>{this.moveAndHover(u.x,u.y,u.id,r,a)},delay:u.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(l)}),this.timer.addAction({doAction(){},delay:t.delay-((s=a.positions[0])==null?void 0:s.timeOffset)});break;case A.MouseInteraction:{if(a.id===-1)break;const u=new Event(Ae(V[a.type])),l=this.mirror.getNode(a.id);if(!l)return this.debugNodeNotFound(a,a.id);this.emitter.emit(z.MouseInteraction,{type:a.type,target:l});const{triggerFocus:c}=this.config;switch(a.type){case V.Blur:"blur"in l&&l.blur();break;case V.Focus:c&&l.focus&&l.focus({preventScroll:!0});break;case V.Click:case V.TouchStart:case V.TouchEnd:case V.MouseDown:case V.MouseUp:r?(a.type===V.TouchStart?this.touchActive=!0:a.type===V.TouchEnd&&(this.touchActive=!1),a.type===V.MouseDown?this.lastMouseDownEvent=[l,u]:a.type===V.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:a.x||0,y:a.y||0,id:a.id,debugData:a}):(a.type===V.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(a.x||0,a.y||0,a.id,r,a),a.type===V.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):a.type===V.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):a.type===V.TouchEnd?this.mouse.classList.remove("touch-active"):l.dispatchEvent(u));break;case V.TouchCancel:r?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:l.dispatchEvent(u)}break}case A.Scroll:{if(a.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(a.id);if(!u)return this.debugNodeNotFound(a,a.id);u.scrollData=a;break}this.applyScroll(a,r);break}case A.ViewportResize:this.emitter.emit(z.Resize,{width:a.width,height:a.height});break;case A.Input:{if(a.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(a.id);if(!u)return this.debugNodeNotFound(a,a.id);u.inputData=a;break}this.applyInput(a);break}case A.MediaInteraction:{const u=this.usingVirtualDom?this.virtualDom.mirror.getNode(a.id):this.mirror.getNode(a.id);if(!u)return this.debugNodeNotFound(a,a.id);const l=u,{events:c}=this.service.state.context;this.mediaManager.mediaMutation({target:l,timeOffset:t.timestamp-c[0].timestamp,mutation:a});break}case A.StyleSheetRule:case A.StyleDeclaration:{this.usingVirtualDom?a.styleId?this.constructedStyleMutations.push(a):a.id&&((i=this.virtualDom.mirror.getNode(a.id))==null||i.rules.push(a)):this.applyStyleSheetMutation(a);break}case A.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(a.id);if(!u)return this.debugNodeNotFound(a,a.id);u.canvasMutations.push({event:t,mutation:a})}else{const u=this.mirror.getNode(a.id);if(!u)return this.debugNodeNotFound(a,a.id);as({event:t,mutation:a,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case A.Font:{try{const u=new FontFace(a.family,a.buffer?new Uint8Array(JSON.parse(a.fontSource)):a.fontSource,a.descriptors);(o=this.iframe.contentDocument)==null||o.fonts.add(u)}catch(u){this.warn(u)}break}case A.Selection:{if(r){this.lastSelectionData=a;break}this.applySelection(a);break}case A.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(a):this.applyAdoptedStyleSheet(a);break}}}applyMutation(t,r){if(this.config.useVirtualDom&&!this.usingVirtualDom&&r&&(this.usingVirtualDom=!0,ql(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const c in this.legacy_missingNodeRetryMap)try{const n=this.legacy_missingNodeRetryMap[c],d=lo(n.node,this.virtualDom,this.mirror);d&&(n.node=d)}catch(n){this.warn(n)}const 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 n;const d=s.getNode(c.id);if(!d)return;let h=s.getNode(c.parentId);if(!h)return this.warnNodeNotFound(t,c.parentId);if(c.isShadow&&Ie(h)&&(h=h.shadowRoot),s.removeNodeFromMap(d),h)try{h.removeChild(d),this.usingVirtualDom&&d.nodeName==="#text"&&h.nodeName==="STYLE"&&((n=h.rules)==null?void 0:n.length)>0&&(h.rules=[])}catch(f){if(f instanceof DOMException)this.warn("parent could not remove child in mutation",h,d,t);else throw f}});const i=P({},this.legacy_missingNodeRetryMap),o=[],a=c=>{let n=null;return c.nextId&&(n=s.getNode(c.nextId)),c.nextId!==null&&c.nextId!==void 0&&c.nextId!==-1&&!n},u=c=>{var n,d;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let h=s.getNode(c.parentId);if(!h)return c.node.type===be.Document?this.newDocumentQueue.push(c):o.push(c);c.node.isShadow&&(Ie(h)||h.attachShadow({mode:"open"}),h=h.shadowRoot);let f=null,m=null;if(c.previousId&&(f=s.getNode(c.previousId)),c.nextId&&(m=s.getNode(c.nextId)),a(c))return o.push(c);if(c.node.rootId&&!s.getNode(c.node.rootId))return;const p=c.node.rootId?s.getNode(c.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Ye(h,s)){this.attachDocumentToIframe(c,h);return}const g=(w,C)=>{if(!this.usingVirtualDom){Ct(w);for(const S of this.config.plugins||[])S.onBuild&&S.onBuild(w,{id:C,replayer:this})}},v=rt(c.node,{doc:p,mirror:s,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:g});if(c.previousId===-1||c.nextId===-1){i[c.node.id]={node:v,mutation:c};return}const y=s.getMeta(h);if(y&&y.type===be.Element&&c.node.type===be.Text){const w=Array.isArray(h.childNodes)?h.childNodes:Array.from(h.childNodes);if(y.tagName==="textarea")for(const C of w)C.nodeType===h.TEXT_NODE&&h.removeChild(C);else if(y.tagName==="style"&&w.length===1)for(const C of w)C.nodeType===h.TEXT_NODE&&!s.hasNode(C)&&(v.textContent=C.textContent,h.removeChild(C))}else if((y==null?void 0:y.type)===be.Document){const w=h;c.node.type===be.DocumentType&&((n=w.childNodes[0])==null?void 0:n.nodeType)===Node.DOCUMENT_TYPE_NODE&&w.removeChild(w.childNodes[0]),v.nodeName==="HTML"&&w.documentElement&&w.removeChild(w.documentElement)}if(f&&f.nextSibling&&f.nextSibling.parentNode?h.insertBefore(v,f.nextSibling):m&&m.parentNode?h.contains(m)?h.insertBefore(v,m):h.insertBefore(v,null):h.appendChild(v),g(v,c.node.id),this.usingVirtualDom&&v.nodeName==="#text"&&h.nodeName==="STYLE"&&((d=h.rules)==null?void 0:d.length)>0&&(h.rules=[]),Ye(v,this.mirror)){const w=this.mirror.getId(v),C=this.newDocumentQueue.find(S=>S.parentId===w);C&&(this.attachDocumentToIframe(C,v),this.newDocumentQueue=this.newDocumentQueue.filter(S=>S!==C))}(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(i,h,v,c)};t.adds.forEach(c=>{u(c)});const l=Date.now();for(;o.length;){const c=mo(o);if(o.length=0,Date.now()-l>500){this.warn("Timeout in the loop, please check the resolve tree data:",c);break}for(const n of c)s.getNode(n.value.parentId)?Fs(n,h=>{u(h)}):this.debug("Drop resolve tree since there is no parent for the root node.",n)}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),go(t.texts).forEach(c=>{var n;const d=s.getNode(c.id);if(!d)return t.removes.find(f=>f.id===c.id)?void 0:this.warnNodeNotFound(t,c.id);const h=d.parentElement;if(c.value&&h&&h.tagName==="STYLE"?d.textContent=$t(c.value,this.cache):d.textContent=c.value,this.usingVirtualDom){const f=d.parentNode;((n=f==null?void 0:f.rules)==null?void 0:n.length)>0&&(f.rules=[])}}),t.attributes.forEach(c=>{var n;const d=s.getNode(c.id);if(!d)return t.removes.find(h=>h.id===c.id)?void 0:this.warnNodeNotFound(t,c.id);for(const h in c.attributes)if(typeof h=="string"){const f=c.attributes[h];if(f===null)d.removeAttribute(h),h==="open"&&sc(d,c);else if(typeof f=="string")try{if(h==="_cssText"&&(d.nodeName==="LINK"||d.nodeName==="STYLE"))try{const m=s.getMeta(d),p=rt(se(P({},m),{attributes:P(P({},m.attributes),c.attributes)}),{doc:d.ownerDocument,mirror:s,skipChild:!0,hackCss:!0,cache:this.cache});Object.assign(m.attributes,c.attributes);const g=d.nextSibling,v=d.parentNode;if(p&&v){v.removeChild(d),v.insertBefore(p,g),s.replace(c.id,p);break}}catch(m){}if(h==="value"&&d.nodeName==="TEXTAREA"){const m=d;m.childNodes.forEach(g=>m.removeChild(g));const p=(n=d.ownerDocument)==null?void 0:n.createTextNode(f);p&&m.appendChild(p)}else d.setAttribute(h,f);h==="rr_open_mode"&&d.nodeName==="DIALOG"&&Ct(d,c)}catch(m){this.warn("An error occurred may due to the checkout feature.",m)}else if(h==="style"){const m=f,p=d;for(const g in m)if(m[g]===!1)p.style.removeProperty(g);else if(m[g]instanceof Array){const v=m[g];p.style.setProperty(g,v[0],v[1])}else{const v=m[g];p.style.setProperty(g,v)}}}})}applyScroll(t,r){var s,i;const o=this.mirror.getNode(t.id);if(!o)return this.debugNodeNotFound(t,t.id);const a=this.mirror.getMeta(o);if(o===this.iframe.contentDocument)(s=this.iframe.contentWindow)==null||s.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else if((a==null?void 0:a.type)===be.Document)(i=o.defaultView)==null||i.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(u){}}applyInput(t){const r=this.mirror.getNode(t.id);if(!r)return this.debugNodeNotFound(t,t.id);try{r.checked=t.isChecked,r.value=t.text}catch(s){}}applySelection(t){try{const r=new Set,s=t.ranges.map(({start:i,startOffset:o,end:a,endOffset:u})=>{const l=this.mirror.getNode(i),c=this.mirror.getNode(a);if(!l||!c)return;const n=new Range;n.setStart(l,o),n.setEnd(c,u);const d=l.ownerDocument,h=d==null?void 0:d.getSelection();return h&&r.add(h),{range:n,selection:h}});r.forEach(i=>i.removeAllRanges()),s.forEach(i=>{var o;return i&&((o=i.selection)==null?void 0:o.addRange(i.range))})}catch(r){}}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===A.StyleSheetRule?this.applyStyleSheetRule(t,s):t.source===A.StyleDeclaration&&this.applyStyleDeclaration(t,s))}applyStyleSheetRule(t,r){var s,i,o,a;if((s=t.adds)==null||s.forEach(({rule:u,index:l})=>{try{if(Array.isArray(l)){const{positions:c,index:n}=ns(l),d=je(r.cssRules,c);d==null||d.insertRule(u,n)}else{const c=l===void 0?void 0:Math.min(l,r.cssRules.length);r==null||r.insertRule(u,c)}}catch(c){}}),(i=t.removes)==null||i.forEach(({index:u})=>{try{if(Array.isArray(u)){const{positions:l,index:c}=ns(u),n=je(r.cssRules,l);n==null||n.deleteRule(c||0)}else r==null||r.deleteRule(u)}catch(l){}}),typeof t.replace=="string")try{(o=r.replace)==null||o.call(r,t.replace)}catch(u){}if(typeof t.replaceSync=="string")try{(a=r.replaceSync)==null||a.call(r,t.replaceSync)}catch(u){}}applyStyleDeclaration(t,r){if(t.set){const s=je(r.rules,t.index);s!=null&&s.style&&s.style.setProperty(t.set.property,t.set.value,t.set.priority)}if(t.remove){const s=je(r.rules,t.index);s!=null&&s.style&&s.style.removeProperty(t.remove.property)}}applyAdoptedStyleSheet(t){var r;const s=this.mirror.getNode(t.id);if(!s)return;(r=t.styles)==null||r.forEach(u=>{var l;let c=null,n=null;if(Ie(s)?n=((l=s.ownerDocument)==null?void 0:l.defaultView)||null:s.nodeName==="#document"&&(n=s.defaultView),!!n)try{c=new n.CSSStyleSheet,this.styleMirror.add(c,u.styleId),this.applyStyleSheetRule({source:A.StyleSheetRule,adds:u.rules},c)}catch(d){}});const i=10;let o=0;const a=(u,l)=>{const c=l.map(n=>this.styleMirror.getStyle(n)).filter(n=>n!==null);Ie(u)?u.shadowRoot.adoptedStyleSheets=c:u.nodeName==="#document"&&(u.adoptedStyleSheets=c),c.length!==l.length&&o<i&&(setTimeout(()=>a(u,l),0+100*o),o++)};a(s,t.styleIds)}legacy_resolveMissingNode(t,r,s,i){const{previousId:o,nextId:a}=i,u=o&&t[o],l=a&&t[a];if(u){const{node:c,mutation:n}=u;r.insertBefore(c,s),delete t[n.node.id],delete this.legacy_missingNodeRetryMap[n.node.id],(n.previousId||n.nextId)&&this.legacy_resolveMissingNode(t,r,c,n)}if(l){const{node:c,mutation:n}=l;r.insertBefore(c,s.nextSibling),delete t[n.node.id],delete this.legacy_missingNodeRetryMap[n.node.id],(n.previousId||n.nextId)&&this.legacy_resolveMissingNode(t,r,c,n)}}moveAndHover(t,r,s,i,o){const a=this.mirror.getNode(s);if(!a)return this.debugNodeNotFound(o,s);const u=Bs(a,this.iframe),l=t*u.absoluteScale+u.x,c=r*u.absoluteScale+u.y;this.mouse.style.left=`${l}px`,this.mouse.style.top=`${c}px`,i||this.drawMouseTail({x:l,y:c}),this.hoverElements(a)}drawMouseTail(t){if(!this.mouseTail)return;const{lineCap:r,lineWidth:s,strokeStyle:i,duration:o}=this.config.mouseTail===!0?ts:Object.assign({},ts,this.config.mouseTail),a=()=>{if(!this.mouseTail)return;const u=this.mouseTail.getContext("2d");!u||!this.tailPositions.length||(u.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),u.beginPath(),u.lineWidth=s,u.lineCap=r,u.strokeStyle=i,u.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(l=>u.lineTo(l.x,l.y)),u.stroke())};this.tailPositions.push(t),a(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(u=>u!==t),a()},o/this.speedService.state.context.timer.speed)}hoverElements(t){var r;(r=this.lastHoveredRootNode||this.iframe.contentDocument)==null||r.querySelectorAll(".\\:hover").forEach(i=>{i.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!==_.IncrementalSnapshot?!1:t.data.source>A.Mutation&&t.data.source<=A.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(z.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(On,...t)}debug(...t){this.config.showDebug&&this.config.logger.log(On,...t)}}const{addCustomEvent:ac}=Te,{freezePage:lc}=Te,{takeFullSnapshot:uc}=Te;exports.EventType=_;exports.IncrementalSource=A;exports.MouseInteractions=V;exports.Replayer=oc;exports.ReplayerEvents=z;exports.addCustomEvent=ac;exports.canvasMutation=as;exports.freezePage=lc;exports.record=Te;exports.takeFullSnapshot=uc;exports.utils=ou;
99
+ ***************************************************************************** */function kn(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var s,i,o=r.call(e),a=[];try{for(;(t===void 0||t-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(u){i={error:u}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}var Je;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Je||(Je={}));var Wo={type:"xstate.init"};function us(e){return e===void 0?[]:[].concat(e)}function qe(e){return{type:"xstate.assign",assignment:e}}function Ln(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 jt(e){return function(t){return e===t}}function Bo(e){return typeof e=="string"?{type:e}:e}function Fn(e,t){return{value:e,context:t,actions:[],changed:!1,matches:jt(e)}}function Un(e,t,r){var s=t,i=!1;return[e.filter(function(o){if(o.type==="xstate.assign"){i=!0;var a=Object.assign({},s);return typeof o.assignment=="function"?a=o.assignment(s,r):Object.keys(o.assignment).forEach(function(u){a[u]=typeof o.assignment[u]=="function"?o.assignment[u](s,r):o.assignment[u]}),s=a,!1}return!0}),s,i]}function $o(e,t){t===void 0&&(t={});var r=kn(Un(us(e.states[e.initial].entry).map(function(a){return Ln(a,t.actions)}),e.context,Wo),2),s=r[0],i=r[1],o={config:e,_options:t,initialState:{value:e.initial,actions:s,context:i,matches:jt(e.initial)},transition:function(a,u){var l,c,n=typeof a=="string"?{value:a,context:e.context}:a,d=n.value,h=n.context,f=Bo(u),m=e.states[d];if(m.on){var p=us(m.on[f.type]);try{for(var g=function(P){var X=typeof Symbol=="function"&&Symbol.iterator,te=X&&P[X],Z=0;if(te)return te.call(P);if(P&&typeof P.length=="number")return{next:function(){return P&&Z>=P.length&&(P=void 0),{value:P&&P[Z++],done:!P}}};throw new TypeError(X?"Object is not iterable.":"Symbol.iterator is not defined.")}(p),v=g.next();!v.done;v=g.next()){var y=v.value;if(y===void 0)return Fn(d,h);var w=typeof y=="string"?{target:y}:y,C=w.target,S=w.actions,b=S===void 0?[]:S,E=w.cond,R=E===void 0?function(){return!0}:E,I=C===void 0,N=C!=null?C:d,F=e.states[N];if(R(h,f)){var A=kn(Un((I?us(b):[].concat(m.exit,b,F.entry).filter(function(P){return P})).map(function(P){return Ln(P,o._options.actions)}),h,f),3),x=A[0],ce=A[1],ae=A[2],j=C!=null?C:d;return{value:j,context:ce,actions:x,changed:C!==d||x.length>0||ae,matches:jt(j)}}}}catch(P){l={error:P}}finally{try{v&&!v.done&&(c=g.return)&&c.call(g)}finally{if(l)throw l.error}}}return Fn(d,h)}};return o}var Wn=function(e,t){return e.actions.forEach(function(r){var s=r.exec;return s&&s(e.context,t)})};function zo(e){var t=e.initialState,r=Je.NotStarted,s=new Set,i={_machine:e,send:function(o){r===Je.Running&&(t=e.transition(t,o),Wn(t,Bo(o)),s.forEach(function(a){return a(t)}))},subscribe:function(o){return s.add(o),o(t),{unsubscribe:function(){return s.delete(o)}}},start:function(o){if(o){var a=typeof o=="object"?o:{context:e.config.context,value:o};t={value:a.value,actions:[],context:a.context,matches:jt(a.value)}}return r=Je.Running,Wn(t,Wo),i},stop:function(){return r=Je.Stopped,s.clear(),i},get state(){return t},get status(){return r}};return i}function lc(e,t){for(let r=e.length-1;r>=0;r--){const s=e[r];if(s.type===_.Meta&&s.timestamp<=t)return e.slice(r)}return e}function uc(e,{getCastFn:t,applyEventsSynchronously:r,emitter:s}){const i=$o({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:qe({lastPlayedEvent:(o,a)=>a.type==="CAST_EVENT"?a.payload.event:o.lastPlayedEvent}),recordTimeOffset:qe((o,a)=>{let u=o.timeOffset;return"payload"in a&&"timeOffset"in a.payload&&(u=a.payload.timeOffset),se(k({},o),{timeOffset:u,baselineTime:o.events[0].timestamp+u})}),play(o){var a;const{timer:u,events:l,baselineTime:c,lastPlayedEvent:n}=o;u.clear();for(const m of l)Pn(m,c);const d=lc(l,c);let h=n==null?void 0:n.timestamp;(n==null?void 0:n.type)===_.IncrementalSnapshot&&n.data.source===T.MouseMove&&(h=n.timestamp+((a=n.data.positions[0])==null?void 0:a.timeOffset)),c<(h||0)&&s.emit(z.PlayBack);const f=new Array;for(const m of d)if(!(h&&h<c&&(m.timestamp<=h||m===n)))if(m.timestamp<c)f.push(m);else{const p=t(m,!1);u.addAction({doAction:()=>{p()},delay:m.delay})}r(f),s.emit(z.Flush),u.start()},pause(o){o.timer.clear()},resetLastPlayedEvent:qe(o=>se(k({},o),{lastPlayedEvent:null})),startLive:qe({baselineTime:(o,a)=>(o.timer.start(),a.type==="TO_LIVE"&&a.payload.baselineTime?a.payload.baselineTime:Date.now())}),addEvent:qe((o,a)=>{const{baselineTime:u,timer:l,events:c}=o;if(a.type==="ADD_EVENT"){const{event:n}=a.payload;Pn(n,u);let d=c.length-1;if(!c[d]||c[d].timestamp<=n.timestamp)c.push(n);else{let m=-1,p=0;for(;p<=d;){const g=Math.floor((p+d)/2);c[g].timestamp<=n.timestamp?p=g+1:d=g-1}m===-1&&(m=p),c.splice(m,0,n)}const h=n.timestamp<u,f=t(n,h);h?f():l.isActive()&&l.addAction({doAction:()=>{f()},delay:n.delay})}return se(k({},o),{events:c})})}});return zo(i)}function cc(e){const t=$o({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:qe({normalSpeed:r=>r.timer.speed}),restoreSpeed:r=>{r.timer.setSpeed(r.normalSpeed)}}});return zo(t)}const hc=e=>[`.${e} { background: currentColor }`,"noscript { display: none !important; }"],Bn=new Map;function Vo(e,t){let r=Bn.get(e);return r||(r=new Map,Bn.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}function Te(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){const i=await Te(e,t,r)(s.args);return await createImageBitmap.apply(null,i)}else if("index"in s){if(r||t===null)return s;const{rr_type:i,index:o}=s;return Vo(t,i)[o]}else if("args"in s){const{rr_type:i,args:o}=s,a=window[i];return new a(...await Promise.all(o.map(Te(e,t,r))))}else{if("base64"in s)return zu(s.base64);if("src"in s){const i=e.get(s.src);if(i)return i;{const o=new Image;return o.src=s.src,e.set(s.src,o),o}}else if("data"in s&&s.rr_type==="Blob"){const i=await Promise.all(s.data.map(Te(e,t,r)));return new Blob(i,{type:s.type})}}else if(Array.isArray(s))return await Promise.all(s.map(Te(e,t,r)));return s}}function fc(e,t){try{return t===xe.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch(r){return null}}const dc=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function pc(e,t){if(!(t!=null&&t.constructor))return;const{name:r}=t.constructor;if(!dc.includes(r))return;const s=Vo(e,r);s.includes(t)||s.push(t)}async function mc({mutation:e,target:t,type:r,imageMap:s,errorHandler:i}){try{const o=fc(t,r);if(!o)return;if(e.setter){o[e.property]=e.args[0];return}const a=o[e.property],u=await Promise.all(e.args.map(Te(s,o))),l=a.apply(o,u);pc(o,l);const c=!1}catch(o){i(e,o)}}async function gc({event:e,mutations:t,target:r,imageMap:s,errorHandler:i}){const o=r.getContext("2d");if(!o){i(t[0],new Error("Canvas context is null"));return}const a=t.map(async l=>Promise.all(l.args.map(Te(s,o))));(await Promise.all(a)).forEach((l,c)=>{const n=t[c];try{if(n.setter){o[n.property]=n.args[0];return}const d=o[n.property];n.property==="drawImage"&&typeof n.args[0]=="string"?(s.get(e),d.apply(o,n.args)):d.apply(o,l)}catch(d){i(n,d)}})}async function ys({event:e,mutation:t,target:r,imageMap:s,canvasEventMap:i,errorHandler:o}){try{const a=i.get(e)||t,u="commands"in a?a.commands:[a];if([xe.WebGL,xe.WebGL2].includes(t.type)){for(let l=0;l<u.length;l++){const c=u[l];await mc({mutation:c,type:t.type,target:r,imageMap:s,errorHandler:o})}return}await gc({event:e,mutations:u,target:r,imageMap:s,errorHandler:o})}catch(a){o(t,a)}}class yc{constructor(t){M(this,"mediaMap",new Map),M(this,"warn"),M(this,"service"),M(this,"speedService"),M(this,"emitter"),M(this,"getCurrentTime"),M(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(z.Start,this.start.bind(this)),this.emitter.on(z.SkipStart,this.start.bind(this)),this.emitter.on(z.Pause,this.pause.bind(this)),this.emitter.on(z.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){const o=(t-s.lastInteractionTimeOffset)/1e3*s.playbackRate,a="duration"in r&&r.duration;if(Number.isNaN(a)){this.waitForMetadata(r);return}let u=s.currentTimeAtLastInteraction+o;r.loop&&a!==!1&&(u=u%a),r.currentTime=u}else r.pause(),r.currentTime=s.currentTimeAtLastInteraction}waitForMetadata(t){if(this.metadataCallbackMap.has(t)||!("addEventListener"in t))return;const r=()=>{this.metadataCallbackMap.delete(t);const 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}){var f,m,p,g,v;const i=this.mediaMap.get(t),{type:o,playbackRate:a,currentTime:u,muted:l,volume:c,loop:n}=s;return{isPlaying:o===Ie.Play||o!==Ie.Pause&&((i==null?void 0:i.isPlaying)||t.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:(f=u!=null?u:i==null?void 0:i.currentTimeAtLastInteraction)!=null?f:0,lastInteractionTimeOffset:r,playbackRate:(m=a!=null?a:i==null?void 0:i.playbackRate)!=null?m:1,volume:(p=c!=null?c:i==null?void 0:i.volume)!=null?p:1,muted:(g=l!=null?l:i==null?void 0:i.muted)!=null?g:t.getAttribute("muted")===null,loop:(v=n!=null?n:i==null?void 0:i.loop)!=null?v:t.getAttribute("loop")===null}}syncTargetWithState(t){const r=this.mediaMap.get(t);if(!r)return;const{muted:s,loop:i,volume:o,isPlaying:a}=r,u=this.service.state.matches("paused"),l=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=s,t.loop=i,t.playbackRate!==l&&(t.playbackRate=l),a&&!u?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;const i=t,o=s.getMeta(i);if(!o||!("attributes"in o))return;const a=this.service.state.matches("paused"),u=o.attributes;let l=!1;u.rr_mediaState?l=u.rr_mediaState==="played":l=i.getAttribute("autoplay")!==null,l&&a&&i.pause();let c=1;typeof u.rr_mediaPlaybackRate=="number"&&(c=u.rr_mediaPlaybackRate);let n=!1;typeof u.rr_mediaMuted=="boolean"?n=u.rr_mediaMuted:n=i.getAttribute("muted")!==null;let d=!1;typeof u.rr_mediaLoop=="boolean"?d=u.rr_mediaLoop:d=i.getAttribute("loop")!==null;let h=1;typeof u.rr_mediaVolume=="number"&&(h=u.rr_mediaVolume);let f=0;typeof u.rr_mediaCurrentTime=="number"&&(f=u.rr_mediaCurrentTime),this.mediaMap.set(i,{isPlaying:l,currentTimeAtLastInteraction:f,lastInteractionTimeOffset:r,playbackRate:c,volume:h,muted:n,loop:d}),this.syncTargetWithState(i)}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 Nt(e,t){if(e.nodeName!=="DIALOG"||e instanceof ve)return;const r=e,s=r.open,i=s&&r.matches("dialog:modal"),o=r.getAttribute("rr_open_mode"),a=typeof(t==null?void 0:t.attributes.open)=="string"||typeof r.getAttribute("open")=="string",u=o==="modal";if(!(s&&!(i&&o==="non-modal"||!i&&u))){if(!r.isConnected){console.warn("dialog is not attached to the dom",r);return}s&&r.close(),a&&(u?r.showModal():r.show())}}function wc(e,t){if(e.nodeName!=="DIALOG"||e instanceof ve)return;const 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"))}const vc=5*1e3,Sc=nc,$n="[replayer]",cs={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function zn(e){return e.type==_.IncrementalSnapshot&&(e.data.source==T.TouchMove||e.data.source==T.MouseInteraction&&e.data.type==V.TouchStart)}class bc{constructor(t,r){if(M(this,"wrapper"),M(this,"iframe"),M(this,"UNSAFE_replayCanvas",!1),M(this,"service"),M(this,"speedService"),M(this,"config"),M(this,"usingVirtualDom",!1),M(this,"virtualDom",new tt),M(this,"mouse"),M(this,"mouseTail",null),M(this,"tailPositions",[]),M(this,"emitter",Sc()),M(this,"nextUserInteractionEvent"),M(this,"legacy_missingNodeRetryMap",{}),M(this,"cache",$i()),M(this,"imageMap",new Map),M(this,"canvasEventMap",new Map),M(this,"mirror",Gn()),M(this,"styleMirror",new Js),M(this,"mediaManager"),M(this,"firstFullSnapshot",null),M(this,"newDocumentQueue",[]),M(this,"mousePos",null),M(this,"touchActive",null),M(this,"lastMouseDownEvent",null),M(this,"lastHoveredRootNode"),M(this,"lastSelectionData",null),M(this,"constructedStyleMutations",[]),M(this,"adoptedStyleSheets",[]),M(this,"handleResize",u=>{this.iframe.style.display="inherit";for(const l of[this.mouseTail,this.iframe])l&&(l.setAttribute("width",String(u.width)),l.setAttribute("height",String(u.height)))}),M(this,"applyEventsSynchronously",u=>{for(const l of u){switch(l.type){case _.DomContentLoaded:case _.Load:case _.Custom:continue;case _.FullSnapshot:case _.Meta:case _.Plugin:case _.IncrementalSnapshot:break}this.getCastFn(l,!0)()}}),M(this,"getCastFn",(u,l=!1)=>{let c;switch(u.type){case _.DomContentLoaded:case _.Load:break;case _.Custom:c=()=>{this.emitter.emit(z.CustomEvent,u)};break;case _.Meta:c=()=>this.emitter.emit(z.Resize,{width:u.data.width,height:u.data.height});break;case _.FullSnapshot:c=()=>{var d;if(this.firstFullSnapshot){if(this.firstFullSnapshot===u){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(u,l),(d=this.iframe.contentWindow)==null||d.scrollTo(u.data.initialOffset)};break;case _.IncrementalSnapshot:c=()=>{if(this.applyIncremental(u,l),!l&&(u===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const d of this.service.state.context.events)if(!(d.timestamp<=u.timestamp)&&this.isUserInteraction(d)){d.delay-u.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=d);break}if(this.nextUserInteractionEvent){const d=this.nextUserInteractionEvent.delay-u.delay,h={speed:Math.min(Math.round(d/vc),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:h}),this.emitter.emit(z.SkipStart,h)}}};break}return()=>{c&&c();for(const h of this.config.plugins||[])h.handler&&h.handler(u,l,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:u}});const d=this.service.state.context.events.length-1;if(!this.config.liveMode&&u===this.service.state.context.events[d]){const h=()=>{d<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(z.Finish))};let f=50;u.type===_.IncrementalSnapshot&&u.data.source===T.MouseMove&&u.data.positions.length&&(f+=Math.max(0,-u.data.positions[0].timeOffset)),setTimeout(h,f)}this.emitter.emit(z.EventCast,u)}}),!(r!=null&&r.liveMode)&&t.length<2)throw new Error("Replayer need at least 2 events.");const 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:cs,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(z.Resize,this.handleResize),this.setupDom();for(const u of this.config.plugins||[])u.getMirror&&u.getMirror({nodeMirror:this.mirror});this.emitter.on(z.Flush,()=>{if(this.usingVirtualDom){const u={mirror:this.mirror,applyCanvas:(l,c,n)=>{ys({event:l,mutation:c,target:n,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(l,c)=>{l.source===T.StyleSheetRule?this.applyStyleSheetRule(l,c):l.source===T.StyleDeclaration&&this.applyStyleDeclaration(l,c)},afterAppend:(l,c)=>{for(const n of this.config.plugins||[])n.onBuild&&n.onBuild(l,{id:c,replayer:this})}};if(this.iframe.contentDocument)try{Ft(this.iframe.contentDocument,this.virtualDom,u,this.virtualDom.mirror)}catch(l){console.warn(l)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const l in this.legacy_missingNodeRetryMap)try{const c=this.legacy_missingNodeRetryMap[l],n=Ut(c.node,this.mirror,this.virtualDom.mirror);Ft(n,c.node,u,this.virtualDom.mirror),c.node=n}catch(c){this.warn(c)}this.constructedStyleMutations.forEach(l=>{this.applyStyleSheetMutation(l)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(l=>{this.applyAdoptedStyleSheet(l)}),this.adoptedStyleSheets=[]}if(this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null,this.lastMouseDownEvent){const[u,l]=this.lastMouseDownEvent;u.dispatchEvent(l)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(z.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()});const i=new ac([],{speed:this.config.speed});this.service=uc({events:t.map(u=>r&&r.unpackFn?r.unpackFn(u):u).sort((u,l)=>u.timestamp-l.timestamp),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(u=>{this.emitter.emit(z.StateChange,{player:u})}),this.speedService=cc({normalSpeed:-1,timer:i}),this.speedService.start(),this.speedService.subscribe(u=>{this.emitter.emit(z.StateChange,{speed:u})}),this.mediaManager=new yc({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});const o=this.service.state.context.events.find(u=>u.type===_.Meta),a=this.service.state.context.events.find(u=>u.type===_.FullSnapshot);if(o){const{width:u,height:l}=o.data;setTimeout(()=>{this.emitter.emit(z.Resize,{width:u,height:l})},0)}a&&setTimeout(()=>{var u;this.firstFullSnapshot||(this.firstFullSnapshot=a,this.rebuildFullSnapshot(a),(u=this.iframe.contentWindow)==null||u.scrollTo(a.data.initialOffset))},1),this.service.state.context.events.find(zn)&&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!="undefined"&&this.speedService.send({type:"SET_SPEED",payload:{speed:t.speed}}),typeof t.mouseTail!="undefined"&&(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(){const 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(){const{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(z.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(z.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(z.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(z.Destroy)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){const r=this.config.unpackFn?this.config.unpackFn(t):t;zn(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=$i()}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=gl({root:this.wrapper}),this.UNSAFE_replayCanvas=!1),this.iframe.style.display="none",this.disableInteract(),this.iframe.contentWindow&&this.iframe.contentDocument&&(oc(this.iframe.contentWindow,this.iframe.contentDocument),Gs(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={};const s=[],i=new Set,o=(l,c)=>{if(l.nodeName==="DIALOG"&&i.add(l),this.collectIframeAndAttachDocument(s,l),this.mediaManager.isSupportedMediaElement(l)){const{events:n}=this.service.state.context;this.mediaManager.addMediaElements(l,t.timestamp-n[0].timestamp,this.mirror)}for(const n of this.config.plugins||[])n.onBuild&&n.onBuild(l,{id:c,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),ml(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(const{mutationInQueue:l,builtNode:c}of s)this.attachDocumentToIframe(l,c),this.newDocumentQueue=this.newDocumentQueue.filter(n=>n!==l);const{documentElement:a,head:u}=this.iframe.contentDocument;this.insertStyleRules(a,u),i.forEach(l=>Nt(l)),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(z.FullsnapshotRebuilded,t),r||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,r){var s;const i=hc(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),!!i.length)if(this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,Co(o,this.virtualDom.unserializedId)),t.insertBefore(o,r),o.rules.push({source:T.StyleSheetRule,adds:i.map((a,u)=>({rule:a,index:u}))})}else{const o=document.createElement("style");t.insertBefore(o,r);for(let a=0;a<i.length;a++)(s=o.sheet)==null||s.insertRule(i[a],a)}}attachDocumentToIframe(t,r){const s=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[],o=new Set,a=(u,l)=>{u.nodeName==="DIALOG"&&o.add(u),this.collectIframeAndAttachDocument(i,u);const c=s.getMeta(u);if((c==null?void 0:c.type)===Ee.Element&&(c==null?void 0:c.tagName.toUpperCase())==="HTML"){const{documentElement:n,head:d}=r.contentDocument;this.insertStyleRules(n,d)}if(!this.usingVirtualDom)for(const n of this.config.plugins||[])n.onBuild&&n.onBuild(u,{id:l,replayer:this})};ot(t.node,{doc:r.contentDocument,mirror:s,hackCss:!0,skipChild:!1,afterAppend:a,cache:this.cache}),a(r.contentDocument,t.node.id);for(const{mutationInQueue:u,builtNode:l}of i)this.attachDocumentToIframe(u,l),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==u);o.forEach(u=>Nt(u))}collectIframeAndAttachDocument(t,r){if(Qe(r,this.mirror)){const s=this.newDocumentQueue.find(i=>i.parentId===this.mirror.getId(r));s&&t.push({mutationInQueue:s,builtNode:r})}}waitForStylesheetLoad(){var t;const r=(t=this.iframe.contentDocument)==null?void 0:t.head;if(r){const s=new Set;let i,o=this.service.state;const a=()=>{o=this.service.state};this.emitter.on(z.Start,a),this.emitter.on(z.Pause,a);const u=()=>{this.emitter.off(z.Start,a),this.emitter.off(z.Pause,a)};r.querySelectorAll('link[rel="stylesheet"]').forEach(l=>{l.sheet||(s.add(l),l.addEventListener("load",()=>{s.delete(l),s.size===0&&i!==-1&&(o.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(z.LoadStylesheetEnd),i&&clearTimeout(i),u())}))}),s.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(z.LoadStylesheetStart),i=setTimeout(()=>{o.matches("playing")&&this.play(this.getCurrentTime()),i=-1,u()},this.config.loadTimeout))}}async preloadAllImages(){const t=[];for(const r of this.service.state.context.events)r.type===_.IncrementalSnapshot&&r.data.source===T.CanvasMutation&&(t.push(this.deserializeAndPreloadCanvasEvents(r.data,r)),("commands"in r.data?r.data.commands:[r.data]).forEach(i=>{this.preloadImages(i,r)}));return Promise.all(t)}preloadImages(t,r){if(t.property==="drawImage"&&typeof t.args[0]=="string"&&!this.imageMap.has(r)){const s=document.createElement("canvas"),i=s.getContext("2d"),o=i==null?void 0:i.createImageData(s.width,s.height);i==null||i.putImageData(o,0,0)}}async deserializeAndPreloadCanvasEvents(t,r){if(!this.canvasEventMap.has(r)){const s={isUnchanged:!0};if("commands"in t){const i=await Promise.all(t.commands.map(async o=>{const a=await Promise.all(o.args.map(Te(this.imageMap,null,s)));return se(k({},o),{args:a})}));s.isUnchanged===!1&&this.canvasEventMap.set(r,se(k({},t),{commands:i}))}else{const i=await Promise.all(t.args.map(Te(this.imageMap,null,s)));s.isUnchanged===!1&&this.canvasEventMap.set(r,se(k({},t),{args:i}))}}}applyIncremental(t,r){var s,i,o;const{data:a}=t;switch(a.source){case T.Mutation:{try{this.applyMutation(a,r)}catch(u){this.warn(`Exception in mutation ${u.message||u}`,a)}break}case T.Drag:case T.TouchMove:case T.MouseMove:if(r){const u=a.positions[a.positions.length-1];this.mousePos={x:u.x,y:u.y,id:u.id,debugData:a}}else a.positions.forEach(u=>{const l={doAction:()=>{this.moveAndHover(u.x,u.y,u.id,r,a)},delay:u.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(l)}),this.timer.addAction({doAction(){},delay:t.delay-((s=a.positions[0])==null?void 0:s.timeOffset)});break;case T.MouseInteraction:{if(a.id===-1)break;const u=new Event(Ae(V[a.type])),l=this.mirror.getNode(a.id);if(!l)return this.debugNodeNotFound(a,a.id);this.emitter.emit(z.MouseInteraction,{type:a.type,target:l});const{triggerFocus:c}=this.config;switch(a.type){case V.Blur:"blur"in l&&l.blur();break;case V.Focus:c&&l.focus&&l.focus({preventScroll:!0});break;case V.Click:case V.TouchStart:case V.TouchEnd:case V.MouseDown:case V.MouseUp:r?(a.type===V.TouchStart?this.touchActive=!0:a.type===V.TouchEnd&&(this.touchActive=!1),a.type===V.MouseDown?this.lastMouseDownEvent=[l,u]:a.type===V.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:a.x||0,y:a.y||0,id:a.id,debugData:a}):(a.type===V.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(a.x||0,a.y||0,a.id,r,a),a.type===V.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):a.type===V.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):a.type===V.TouchEnd?this.mouse.classList.remove("touch-active"):l.dispatchEvent(u));break;case V.TouchCancel:r?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:l.dispatchEvent(u)}break}case T.Scroll:{if(a.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(a.id);if(!u)return this.debugNodeNotFound(a,a.id);u.scrollData=a;break}this.applyScroll(a,r);break}case T.ViewportResize:this.emitter.emit(z.Resize,{width:a.width,height:a.height});break;case T.Input:{if(a.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(a.id);if(!u)return this.debugNodeNotFound(a,a.id);u.inputData=a;break}this.applyInput(a);break}case T.MediaInteraction:{const u=this.usingVirtualDom?this.virtualDom.mirror.getNode(a.id):this.mirror.getNode(a.id);if(!u)return this.debugNodeNotFound(a,a.id);const l=u,{events:c}=this.service.state.context;this.mediaManager.mediaMutation({target:l,timeOffset:t.timestamp-c[0].timestamp,mutation:a});break}case T.StyleSheetRule:case T.StyleDeclaration:{this.usingVirtualDom?a.styleId?this.constructedStyleMutations.push(a):a.id&&((i=this.virtualDom.mirror.getNode(a.id))==null||i.rules.push(a)):this.applyStyleSheetMutation(a);break}case T.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(a.id);if(!u)return this.debugNodeNotFound(a,a.id);u.canvasMutations.push({event:t,mutation:a})}else{const u=this.mirror.getNode(a.id);if(!u)return this.debugNodeNotFound(a,a.id);ys({event:t,mutation:a,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case T.Font:{try{const u=new FontFace(a.family,a.buffer?new Uint8Array(JSON.parse(a.fontSource)):a.fontSource,a.descriptors);(o=this.iframe.contentDocument)==null||o.fonts.add(u)}catch(u){this.warn(u)}break}case T.Selection:{if(r){this.lastSelectionData=a;break}this.applySelection(a);break}case T.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(a):this.applyAdoptedStyleSheet(a);break}}}applyMutation(t,r){if(this.config.useVirtualDom&&!this.usingVirtualDom&&r&&(this.usingVirtualDom=!0,iu(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const c in this.legacy_missingNodeRetryMap)try{const n=this.legacy_missingNodeRetryMap[c],d=bo(n.node,this.virtualDom,this.mirror);d&&(n.node=d)}catch(n){this.warn(n)}const 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 n;const d=s.getNode(c.id);if(!d)return;let h=s.getNode(c.parentId);if(!h)return this.warnNodeNotFound(t,c.parentId);if(c.isShadow&&De(h)&&(h=h.shadowRoot),s.removeNodeFromMap(d),h)try{h.removeChild(d),this.usingVirtualDom&&d.nodeName==="#text"&&h.nodeName==="STYLE"&&((n=h.rules)==null?void 0:n.length)>0&&(h.rules=[])}catch(f){if(f instanceof DOMException)this.warn("parent could not remove child in mutation",h,d,t);else throw f}});const i=k({},this.legacy_missingNodeRetryMap),o=[],a=c=>{let n=null;return c.nextId&&(n=s.getNode(c.nextId)),c.nextId!==null&&c.nextId!==void 0&&c.nextId!==-1&&!n},u=c=>{var n,d;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let h=s.getNode(c.parentId);if(!h)return c.node.type===Ee.Document?this.newDocumentQueue.push(c):o.push(c);c.node.isShadow&&(De(h)||h.attachShadow({mode:"open"}),h=h.shadowRoot);let f=null,m=null;if(c.previousId&&(f=s.getNode(c.previousId)),c.nextId&&(m=s.getNode(c.nextId)),a(c))return o.push(c);if(c.node.rootId&&!s.getNode(c.node.rootId))return;const p=c.node.rootId?s.getNode(c.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Qe(h,s)){this.attachDocumentToIframe(c,h);return}const g=(w,C)=>{if(!this.usingVirtualDom){Nt(w);for(const S of this.config.plugins||[])S.onBuild&&S.onBuild(w,{id:C,replayer:this})}},v=ot(c.node,{doc:p,mirror:s,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:g});if(c.previousId===-1||c.nextId===-1){i[c.node.id]={node:v,mutation:c};return}const y=s.getMeta(h);if(y&&y.type===Ee.Element&&c.node.type===Ee.Text){const w=Array.isArray(h.childNodes)?h.childNodes:Array.from(h.childNodes);if(y.tagName==="textarea")for(const C of w)C.nodeType===h.TEXT_NODE&&h.removeChild(C);else if(y.tagName==="style"&&w.length===1)for(const C of w)C.nodeType===h.TEXT_NODE&&!s.hasNode(C)&&(v.textContent=C.textContent,h.removeChild(C))}else if((y==null?void 0:y.type)===Ee.Document){const w=h;c.node.type===Ee.DocumentType&&((n=w.childNodes[0])==null?void 0:n.nodeType)===Node.DOCUMENT_TYPE_NODE&&w.removeChild(w.childNodes[0]),v.nodeName==="HTML"&&w.documentElement&&w.removeChild(w.documentElement)}if(f&&f.nextSibling&&f.nextSibling.parentNode?h.insertBefore(v,f.nextSibling):m&&m.parentNode?h.contains(m)?h.insertBefore(v,m):h.insertBefore(v,null):h.appendChild(v),g(v,c.node.id),this.usingVirtualDom&&v.nodeName==="#text"&&h.nodeName==="STYLE"&&((d=h.rules)==null?void 0:d.length)>0&&(h.rules=[]),Qe(v,this.mirror)){const w=this.mirror.getId(v),C=this.newDocumentQueue.find(S=>S.parentId===w);C&&(this.attachDocumentToIframe(C,v),this.newDocumentQueue=this.newDocumentQueue.filter(S=>S!==C))}(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(i,h,v,c)};t.adds.forEach(c=>{u(c)});const l=Date.now();for(;o.length;){const c=No(o);if(o.length=0,Date.now()-l>500){this.warn("Timeout in the loop, please check the resolve tree data:",c);break}for(const n of c)s.getNode(n.value.parentId)?Hs(n,h=>{u(h)}):this.debug("Drop resolve tree since there is no parent for the root node.",n)}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),Oo(t.texts).forEach(c=>{var n;const d=s.getNode(c.id);if(!d)return t.removes.find(f=>f.id===c.id)?void 0:this.warnNodeNotFound(t,c.id);const h=d.parentElement;if(c.value&&h&&h.tagName==="STYLE"?d.textContent=Qt(c.value,this.cache):d.textContent=c.value,this.usingVirtualDom){const f=d.parentNode;((n=f==null?void 0:f.rules)==null?void 0:n.length)>0&&(f.rules=[])}}),t.attributes.forEach(c=>{var n;const d=s.getNode(c.id);if(!d)return t.removes.find(h=>h.id===c.id)?void 0:this.warnNodeNotFound(t,c.id);for(const h in c.attributes)if(typeof h=="string"){const f=c.attributes[h];if(f===null)d.removeAttribute(h),h==="open"&&wc(d,c);else if(typeof f=="string")try{if(h==="_cssText"&&(d.nodeName==="LINK"||d.nodeName==="STYLE"))try{const m=s.getMeta(d),p=ot(se(k({},m),{attributes:k(k({},m.attributes),c.attributes)}),{doc:d.ownerDocument,mirror:s,skipChild:!0,hackCss:!0,cache:this.cache});Object.assign(m.attributes,c.attributes);const g=d.nextSibling,v=d.parentNode;if(p&&v){v.removeChild(d),v.insertBefore(p,g),s.replace(c.id,p);break}}catch(m){}if(h==="value"&&d.nodeName==="TEXTAREA"){const m=d;m.childNodes.forEach(g=>m.removeChild(g));const p=(n=d.ownerDocument)==null?void 0:n.createTextNode(f);p&&m.appendChild(p)}else d.setAttribute(h,f);h==="rr_open_mode"&&d.nodeName==="DIALOG"&&Nt(d,c)}catch(m){this.warn("An error occurred may due to the checkout feature.",m)}else if(h==="style"){const m=f,p=d;for(const g in m)if(m[g]===!1)p.style.removeProperty(g);else if(m[g]instanceof Array){const v=m[g];p.style.setProperty(g,v[0],v[1])}else{const v=m[g];p.style.setProperty(g,v)}}}})}applyScroll(t,r){var s,i;const o=this.mirror.getNode(t.id);if(!o)return this.debugNodeNotFound(t,t.id);const a=this.mirror.getMeta(o);if(o===this.iframe.contentDocument)(s=this.iframe.contentWindow)==null||s.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else if((a==null?void 0:a.type)===Ee.Document)(i=o.defaultView)==null||i.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(u){}}applyInput(t){const r=this.mirror.getNode(t.id);if(!r)return this.debugNodeNotFound(t,t.id);try{r.checked=t.isChecked,r.value=t.text}catch(s){}}applySelection(t){try{const r=new Set,s=t.ranges.map(({start:i,startOffset:o,end:a,endOffset:u})=>{const l=this.mirror.getNode(i),c=this.mirror.getNode(a);if(!l||!c)return;const n=new Range;n.setStart(l,o),n.setEnd(c,u);const d=l.ownerDocument,h=d==null?void 0:d.getSelection();return h&&r.add(h),{range:n,selection:h}});r.forEach(i=>i.removeAllRanges()),s.forEach(i=>{var o;return i&&((o=i.selection)==null?void 0:o.addRange(i.range))})}catch(r){}}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===T.StyleSheetRule?this.applyStyleSheetRule(t,s):t.source===T.StyleDeclaration&&this.applyStyleDeclaration(t,s))}applyStyleSheetRule(t,r){var s,i,o,a;if((s=t.adds)==null||s.forEach(({rule:u,index:l})=>{try{if(Array.isArray(l)){const{positions:c,index:n}=ps(l),d=Ye(r.cssRules,c);d==null||d.insertRule(u,n)}else{const c=l===void 0?void 0:Math.min(l,r.cssRules.length);r==null||r.insertRule(u,c)}}catch(c){}}),(i=t.removes)==null||i.forEach(({index:u})=>{try{if(Array.isArray(u)){const{positions:l,index:c}=ps(u),n=Ye(r.cssRules,l);n==null||n.deleteRule(c||0)}else r==null||r.deleteRule(u)}catch(l){}}),typeof t.replace=="string")try{(o=r.replace)==null||o.call(r,t.replace)}catch(u){}if(typeof t.replaceSync=="string")try{(a=r.replaceSync)==null||a.call(r,t.replaceSync)}catch(u){}}applyStyleDeclaration(t,r){if(t.set){const s=Ye(r.rules,t.index);s!=null&&s.style&&s.style.setProperty(t.set.property,t.set.value,t.set.priority)}if(t.remove){const s=Ye(r.rules,t.index);s!=null&&s.style&&s.style.removeProperty(t.remove.property)}}applyAdoptedStyleSheet(t){var r;const s=this.mirror.getNode(t.id);if(!s)return;(r=t.styles)==null||r.forEach(u=>{var l;let c=null,n=null;if(De(s)?n=((l=s.ownerDocument)==null?void 0:l.defaultView)||null:s.nodeName==="#document"&&(n=s.defaultView),!!n)try{c=new n.CSSStyleSheet,this.styleMirror.add(c,u.styleId),this.applyStyleSheetRule({source:T.StyleSheetRule,adds:u.rules},c)}catch(d){}});const i=10;let o=0;const a=(u,l)=>{const c=l.map(n=>this.styleMirror.getStyle(n)).filter(n=>n!==null);De(u)?u.shadowRoot.adoptedStyleSheets=c:u.nodeName==="#document"&&(u.adoptedStyleSheets=c),c.length!==l.length&&o<i&&(setTimeout(()=>a(u,l),0+100*o),o++)};a(s,t.styleIds)}legacy_resolveMissingNode(t,r,s,i){const{previousId:o,nextId:a}=i,u=o&&t[o],l=a&&t[a];if(u){const{node:c,mutation:n}=u;r.insertBefore(c,s),delete t[n.node.id],delete this.legacy_missingNodeRetryMap[n.node.id],(n.previousId||n.nextId)&&this.legacy_resolveMissingNode(t,r,c,n)}if(l){const{node:c,mutation:n}=l;r.insertBefore(c,s.nextSibling),delete t[n.node.id],delete this.legacy_missingNodeRetryMap[n.node.id],(n.previousId||n.nextId)&&this.legacy_resolveMissingNode(t,r,c,n)}}moveAndHover(t,r,s,i,o){const a=this.mirror.getNode(s);if(!a)return this.debugNodeNotFound(o,s);const u=Xs(a,this.iframe),l=t*u.absoluteScale+u.x,c=r*u.absoluteScale+u.y;this.mouse.style.left=`${l}px`,this.mouse.style.top=`${c}px`,i||this.drawMouseTail({x:l,y:c}),this.hoverElements(a)}drawMouseTail(t){if(!this.mouseTail)return;const{lineCap:r,lineWidth:s,strokeStyle:i,duration:o}=this.config.mouseTail===!0?cs:Object.assign({},cs,this.config.mouseTail),a=()=>{if(!this.mouseTail)return;const u=this.mouseTail.getContext("2d");!u||!this.tailPositions.length||(u.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),u.beginPath(),u.lineWidth=s,u.lineCap=r,u.strokeStyle=i,u.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(l=>u.lineTo(l.x,l.y)),u.stroke())};this.tailPositions.push(t),a(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(u=>u!==t),a()},o/this.speedService.state.context.timer.speed)}hoverElements(t){var r;(r=this.lastHoveredRootNode||this.iframe.contentDocument)==null||r.querySelectorAll(".\\:hover").forEach(i=>{i.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!==_.IncrementalSnapshot?!1:t.data.source>T.Mutation&&t.data.source<=T.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(z.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($n,...t)}debug(...t){this.config.showDebug&&this.config.logger.log($n,...t)}}const{addCustomEvent:Cc}=_e,{freezePage:Ec}=_e,{takeFullSnapshot:xc}=_e;exports.EventType=_;exports.IncrementalSource=T;exports.MouseInteractions=V;exports.Replayer=bc;exports.ReplayerEvents=z;exports.addCustomEvent=Cc;exports.canvasMutation=ys;exports.freezePage=Ec;exports.record=_e;exports.takeFullSnapshot=xc;exports.utils=Su;
81
100
  if (typeof module.exports == "object" && typeof exports == "object") {
82
101
  var __cp = (to, from, except, desc) => {
83
102
  if ((from && typeof from === "object") || typeof from === "function") {