@mrrocket/sdk 0.28.0 → 0.29.0
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.
- package/CHANGELOG.md +9 -0
- package/README.md +4 -2
- package/dist/browser/mrrocket-messenger.js +3 -3
- package/dist/browser/mrrocket-replay.js +3 -3
- package/dist/browser/mrrocket.js +2 -2
- package/dist/client.d.ts +7 -1
- package/dist/client.js +3 -1
- package/dist/client.js.map +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +1 -1
- package/dist/core.js.map +1 -1
- package/dist/messenger-ui.js +22 -0
- package/dist/messenger-ui.js.map +1 -1
- package/dist/react-native/index.d.cts +1 -1
- package/dist/react-native/index.d.ts +1 -1
- package/dist/react-native/index.js +1 -1
- package/dist/react-native/index.js.map +1 -1
- package/dist/replay-core.d.ts +61 -2
- package/dist/replay-core.js +15 -2
- package/dist/replay-core.js.map +1 -1
- package/dist/replay.d.ts +5 -0
- package/dist/replay.js +10 -1
- package/dist/replay.js.map +1 -1
- package/dist/user-hash.d.ts +1 -1
- package/dist/user-hash.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(){'use strict';var St=Object.defineProperty;var Mr=(e,t,r)=>t in e?St(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r;var Ir=(e,t)=>()=>(e&&(t=e(e=0)),t);var xr=(e,t)=>{for(var r in t)St(e,r,{get:t[r],enumerable:true});};var Ee=(e,t,r)=>Mr(e,typeof t!="symbol"?t+"":t,r);var Sr={};xr(Sr,{record:()=>Ie});function ht(e){if(Oe[e])return Oe[e];let t=globalThis[e],r=t.prototype,n=e in _t?_t[e]:void 0,s=!!(n&&n.every(c=>{var i,p;return !!((p=(i=Object.getOwnPropertyDescriptor(r,c))==null?void 0:i.get)!=null&&p.toString().includes("[native code]"))})),o=e in Lt?Lt[e]:void 0,a=!!(o&&o.every(c=>{var i;return typeof r[c]=="function"&&((i=r[c])==null?void 0:i.toString().includes("[native code]"))}));if(s&&a&&!Dr())return Oe[e]=t.prototype,t.prototype;try{let c=document.createElement("iframe");c.style.display="none",document.body.appendChild(c);let i=c.contentWindow;if(!i)return t.prototype;let p=i[e].prototype;if(!p)return c.remove(),r;let u=navigator.userAgent;return u.includes("Safari")&&!u.includes("Chrome")?(c.classList.add("rr-block"),c.setAttribute("__rrwebUntaintedMutationObserver",""),zt[e]=()=>c.remove()):c.remove(),Oe[e]=p}catch(c){return r}}function J(e,t,r){var n,s;let o=(n=Je[e])==null?void 0:n[r];if(o)return o.call(t);let a=ht(e),c=(s=Object.getOwnPropertyDescriptor(a,r))==null?void 0:s.get;return c?((Je[e]||(Je[e]={}))[r]=c,c.call(t)):t[r]}function Gt(e,t,r){let n=`${e}.${String(r)}`;if(Qe[n])return Qe[n].bind(t);let o=ht(e)[r];return typeof o!="function"?t[r]:(Qe[n]=o,o.bind(t))}function Ar(e){return J("Node",e,"ownerDocument")}function Fr(e){return J("Node",e,"childNodes")}function Pr(e){return J("Node",e,"parentNode")}function Ur(e){return J("Node",e,"parentElement")}function Wr(e){return J("Node",e,"textContent")}function Hr(e){return J("Node",e,"firstChild")}function Br(e){return J("Node",e,"lastChild")}function $r(e){return J("Node",e,"nextSibling")}function Vr(e){return J("Node",e,"previousSibling")}function jr(e,t){return Gt("Node",e,"contains")(t)}function zr(e){return Gt("Node",e,"getRootNode")()}function Gr(e){return !e||!("host"in e)?null:J("ShadowRoot",e,"host")}function qr(e){return e.styleSheets}function Kr(e){return !e||!("shadowRoot"in e)?null:J("Element",e,"shadowRoot")}function Xr(e,t){return J("Element",e,"querySelector")(t)}function Yr(e,t){return J("Element",e,"querySelectorAll")(t)}function qt(){var e;return [ht("MutationObserver").constructor,(e=zt.MutationObserver)!=null?e:(()=>{})]}function ce(e,t,r){try{if(!(t in e))return ()=>{};let n=e[t],s=r(n);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=s,()=>{e[t]=n;}}catch(n){return ()=>{}}}function Kt(e){return e.nodeType===e.ELEMENT_NODE}function be(e){let t=e&&"host"in e&&"mode"in e&&C.host(e)||null;return !!(t&&"shadowRoot"in t&&C.shadowRoot(t)===e)}function Se(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Jr(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 Qr(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let r=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function tt(e){try{let t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);let n=Array.from(t,s=>Xt(s,r)).join("");return Jr(n)}catch(t){return null}}function Xt(e,t){if(en(e)){let r;try{r=tt(e.styleSheet)||Qr(e);}catch(n){r=e.cssText;}return e.styleSheet.href?Ue(r,e.styleSheet.href):r}else {let r=e.cssText;return tn(e)&&e.selectorText.includes(":")&&(r=Zr(r)),t?Ue(r,t):r}}function Zr(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function en(e){return "styleSheet"in e}function tn(e){return "selectorText"in e}function rn(){return new Ae}function Fe({element:e,maskInputOptions:t,tagName:r,type:n,value:s,maskInputFn:o}){let a=s||"",c=n&&ne(n);return (t[r.toLowerCase()]||c&&t[c])&&(o?a=o(a,e):a="*".repeat(a.length)),a}function ne(e){return e.toLowerCase()}function nn(e){let t=e.getContext("2d");if(!t)return true;let r=50;for(let n=0;n<e.width;n+=r)for(let s=0;s<e.height;s+=r){let o=t.getImageData,a=Dt in o?o[Dt]:o;if(new Uint32Array(a.call(t,n,s,Math.min(r,e.width-n),Math.min(r,e.height-s)).data.buffer).some(i=>i!==0))return false}return true}function Pe(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?ne(t):null}function Yt(e,t){var o;let r;try{r=new URL(e,t!=null?t:window.location.href);}catch(a){return null}let n=/\.([0-9a-z]+)(?:$)/i,s=r.pathname.match(n);return (o=s==null?void 0:s[1])!=null?o:null}function sn(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}function Ue(e,t){return (e||"").replace(on,(r,n,s,o,a,c)=>{let i=s||a||c,p=n||o||"";if(!i)return r;if(an.test(i)||ln.test(i))return `url(${p}${i}${p})`;if(cn.test(i))return `url(${p}${i}${p})`;if(i[0]==="/")return `url(${p}${sn(t)+i}${p})`;let u=i.split("#")[0],d=i.substring(u.length),f=t.split("#")[0].split("/"),h=u.split("/");f.pop();for(let m of h)m!=="."&&(m===".."?f.pop():f.push(m));return `url(${p}${f.join("/")}${d}${p})`})}function Te(e,t=false){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function un(e,t,r=false){let n=Array.from(t.childNodes),s=[],o=0;if(n.length>1&&e&&typeof e=="string"){let a=Te(e,r),c=a.length/e.length;for(let i=1;i<n.length;i++)if(n[i].textContent&&typeof n[i].textContent=="string"){let p=Te(n[i].textContent,r),u=100,d=3;for(;d<p.length&&(p[d].match(/[a-zA-Z0-9]/)||p.indexOf(p.substring(0,d),1)!==-1);d++);for(;d<p.length;d++){let f=p.substring(0,d),h=a.split(f),m=-1;if(h.length===2)m=h[0].length;else if(h.length>2&&h[0]===""&&n[i-1].textContent!=="")m=a.indexOf(f,1);else if(h.length===1){if(f=f.substring(0,f.length-1),h=a.split(f),h.length<=1)return s.push(e),s;d=u+1;}else d===p.length-1&&(m=a.indexOf(f));if(h.length>=2&&d>u){let l=n[i-1].textContent;if(l&&typeof l=="string"){let b=Te(l).length;m=a.indexOf(f,b);}m===-1&&(m=h[0].length);}if(m!==-1){let l=Math.floor(m/c);for(;l>0&&l<e.length;){if(o+=1,o>50*n.length)return s.push(e),s;let b=Te(e.substring(0,l),r);if(b.length===m){s.push(e.substring(0,l)),e=e.substring(l),a=a.substring(m);break}else b.length<m?l+=Math.max(1,Math.floor((m-b.length)/c)):l-=Math.max(1,Math.floor((b.length-m)*c));}break}}}}return s.push(e),s}function dn(e,t){return un(e,t).join("/* rr_split */")}function Jt(){return pn++}function fn(e){if(e instanceof HTMLFormElement)return "form";let t=ne(e.tagName);return hn.test(t)?"div":t}function yn(e,t){if(t.trim()==="")return t;let r=0;function n(o){let a,c=o.exec(t.substring(r));return c?(a=c[0],r+=a.length,a):""}let s=[];for(;n(gn),!(r>=t.length);){let o=n(mn);if(o.slice(-1)===",")o=he(e,o.substring(0,o.length-1)),s.push(o);else {let a="";o=he(e,o);let c=false;for(;;){let i=t.charAt(r);if(i===""){s.push((o+a).trim());break}else if(c)i===")"&&(c=false);else if(i===","){r+=1,s.push((o+a).trim());break}else i==="("&&(c=true);a+=i,r+=1;}}}return s.join(", ")}function he(e,t){return !t||t.trim()===""?t:ft(e,t)}function bn(e){return !!(e.tagName==="svg"||e.ownerSVGElement)}function ft(e,t){let r=Ft.get(e);if(r||(r=e.createElement("a"),Ft.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function Qt(e,t,r,n){return n&&(r==="src"||r==="href"&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&["table","td","th"].includes(t)?he(e,n):r==="srcset"?yn(e,n):r==="style"?Ue(n,ft(e)):t==="object"&&r==="data"?he(e,n):n)}function Zt(e,t,r){return ["video","audio"].includes(e)&&ne(t)==="autoplay"}function Sn(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return !0}else for(let n=e.classList.length;n--;){let s=e.classList[n];if(t.test(s))return !0}if(r)return e.matches(r)}catch(n){}return false}function He(e,t,r){if(!e)return false;if(e.nodeType!==e.ELEMENT_NODE)return r?He(C.parentNode(e),t,r):false;for(let n=e.classList.length;n--;){let s=e.classList[n];if(t.test(s))return true}return r?He(C.parentNode(e),t,r):false}function er(e,t,r,n){let s;if(Kt(e)){if(s=e,!C.childNodes(s).length)return false}else {if(C.parentElement(e)===null)return false;s=C.parentElement(e);}try{if(typeof t=="string"){if(n){if(s.closest(`.${t}`))return !0}else if(s.classList.contains(t))return !0}else if(He(s,t,n))return !0;if(r){if(n){if(s.closest(r))return !0}else if(s.matches(r))return !0}}catch(o){}return false}function wn(e,t,r){let n=e.contentWindow;if(!n)return;let s=false,o;try{o=n.document.readyState;}catch(c){return}if(o!=="complete"){let c=setTimeout(()=>{s||(t(),s=true);},r);e.addEventListener("load",()=>{clearTimeout(c),s=true,t();});return}let a="about:blank";if(n.location.href!==a||e.src===a||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t);}function Cn(e,t,r){let n=false,s;try{s=e.sheet;}catch(a){return}if(s)return;let o=setTimeout(()=>{n||(t(),n=true);},r);e.addEventListener("load",()=>{clearTimeout(o),n=true,t();});}function vn(e,t){let{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:a,inlineStylesheet:c,maskInputOptions:i={},maskTextFn:p,maskInputFn:u,dataURLOptions:d={},inlineImages:f,recordCanvas:h,keepIframeSrcFn:m,newlyAddedElement:l=false,cssCaptured:b=false}=t,I=Mn(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:W.Document,childNodes:[],compatMode:e.compatMode}:{type:W.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return {type:W.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:I};case e.ELEMENT_NODE:return xn(e,{doc:r,blockClass:s,blockSelector:o,inlineStylesheet:c,maskInputOptions:i,maskInputFn:u,dataURLOptions:d,inlineImages:f,recordCanvas:h,keepIframeSrcFn:m,newlyAddedElement:l,rootId:I});case e.TEXT_NODE:return In(e,{doc:r,needsMask:a,maskTextFn:p,rootId:I,cssCaptured:b});case e.CDATA_SECTION_NODE:return {type:W.CDATA,textContent:"",rootId:I};case e.COMMENT_NODE:return {type:W.Comment,textContent:C.textContent(e)||"",rootId:I};default:return false}}function Mn(e,t){if(!t.hasNode(e))return;let r=t.getId(e);return r===1?void 0:r}function In(e,t){let{needsMask:r,maskTextFn:n,rootId:s,cssCaptured:o}=t,a=C.parentNode(e),c=a&&a.tagName,i="",p=c==="STYLE"?true:void 0,u=c==="SCRIPT"?true:void 0;return u?i="SCRIPT_PLACEHOLDER":o||(i=C.textContent(e),p&&i&&(i=Ue(i,ft(t.doc)))),!p&&!u&&i&&r&&(i=n?n(i,C.parentElement(e)):i.replace(/[\S]/g,"*")),{type:W.Text,textContent:i||"",rootId:s}}function xn(e,t){let{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:c,dataURLOptions:i={},inlineImages:p,recordCanvas:u,keepIframeSrcFn:d,newlyAddedElement:f=false,rootId:h}=t,m=Sn(e,n,s),l=fn(e),b={},I=e.attributes.length;for(let g=0;g<I;g++){let M=e.attributes[g];Zt(l,M.name,M.value)||(b[M.name]=Qt(r,l,ne(M.name),M.value));}if(l==="link"&&o){let g=Array.from(r.styleSheets).find(T=>T.href===e.href),M=null;g&&(M=tt(g)),M&&(delete b.rel,delete b.href,b._cssText=M);}if(l==="style"&&e.sheet){let g=tt(e.sheet);g&&(e.childNodes.length>1&&(g=dn(g,e)),b._cssText=g);}if(["input","textarea","select"].includes(l)){let g=e.value,M=e.checked;b.type!=="radio"&&b.type!=="checkbox"&&b.type!=="submit"&&b.type!=="button"&&g?b.value=Fe({element:e,type:Pe(e),tagName:l,value:g,maskInputOptions:a,maskInputFn:c}):M&&(b.checked=M);}if(l==="option"&&(e.selected&&!a.select?b.selected=true:delete b.selected),l==="dialog"&&e.open&&(b.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),l==="canvas"&&u){if(e.__context==="2d")nn(e)||(b.rr_dataURL=e.toDataURL(i.type,i.quality));else if(!("__context"in e)){let g=e.toDataURL(i.type,i.quality),M=r.createElement("canvas");M.width=e.width,M.height=e.height;let T=M.toDataURL(i.type,i.quality);g!==T&&(b.rr_dataURL=g);}}if(l==="img"&&p){ue||(ue=r.createElement("canvas"),At=ue.getContext("2d"));let g=e,M=g.currentSrc||g.getAttribute("src")||"<unknown-src>",T=g.crossOrigin,A=()=>{g.removeEventListener("load",A);try{ue.width=g.naturalWidth,ue.height=g.naturalHeight,At.drawImage(g,0,0),b.rr_dataURL=ue.toDataURL(i.type,i.quality);}catch(H){if(g.crossOrigin!=="anonymous"){g.crossOrigin="anonymous",g.complete&&g.naturalWidth!==0?A():g.addEventListener("load",A);return}else console.warn(`Cannot inline img src=${M}! Error: ${H}`);}g.crossOrigin==="anonymous"&&(T?b.crossOrigin=T:g.removeAttribute("crossorigin"));};g.complete&&g.naturalWidth!==0?A():g.addEventListener("load",A);}if(["audio","video"].includes(l)){let g=b;g.rr_mediaState=e.paused?"paused":"played",g.rr_mediaCurrentTime=e.currentTime,g.rr_mediaPlaybackRate=e.playbackRate,g.rr_mediaMuted=e.muted,g.rr_mediaLoop=e.loop,g.rr_mediaVolume=e.volume;}if(f||(e.scrollLeft&&(b.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(b.rr_scrollTop=e.scrollTop)),m){let{width:g,height:M}=e.getBoundingClientRect();b={class:b.class,rr_width:`${g}px`,rr_height:`${M}px`};}l==="iframe"&&!d(b.src)&&(e.contentDocument||(b.rr_src=b.src),delete b.src);let w;try{customElements.get(l)&&(w=!0);}catch(g){}return {type:W.Element,tagName:l,attributes:b,childNodes:[],isSVG:bn(e)||void 0,needBlock:m,rootId:h,isCustom:w}}function L(e){return e==null?"":e.toLowerCase()}function tr(e){return e===true||e==="all"?{script:true,comment:true,headFavicon:true,headWhitespace:true,headMetaSocial:true,headMetaRobots:true,headMetaHttpEquiv:true,headMetaVerification:true,headMetaAuthorship:e==="all",headMetaDescKeywords:e==="all",headTitleMutations:e==="all"}:e||{}}function Rn(e,t){if(t.comment&&e.type===W.Comment)return true;if(e.type===W.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"&&Yt(e.attributes.href)==="js"))return true;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(L(e.attributes.name).match(/^msapplication-tile(image|color)$/)||L(e.attributes.name)==="application-name"||L(e.attributes.rel)==="icon"||L(e.attributes.rel)==="apple-touch-icon"||L(e.attributes.rel)==="shortcut icon")))return true;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&L(e.attributes.name).match(/^description|keywords$/))return true;if(t.headMetaSocial&&(L(e.attributes.property).match(/^(og|twitter|fb):/)||L(e.attributes.name).match(/^(og|twitter):/)||L(e.attributes.name)==="pinterest"))return true;if(t.headMetaRobots&&(L(e.attributes.name)==="robots"||L(e.attributes.name)==="googlebot"||L(e.attributes.name)==="bingbot"))return true;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return true;if(t.headMetaAuthorship&&(L(e.attributes.name)==="author"||L(e.attributes.name)==="generator"||L(e.attributes.name)==="framework"||L(e.attributes.name)==="publisher"||L(e.attributes.name)==="progid"||L(e.attributes.property).match(/^article:/)||L(e.attributes.property).match(/^product:/)))return true;if(t.headMetaVerification&&(L(e.attributes.name)==="google-site-verification"||L(e.attributes.name)==="yandex-verification"||L(e.attributes.name)==="csrf-token"||L(e.attributes.name)==="p:domain_verify"||L(e.attributes.name)==="verify-v1"||L(e.attributes.name)==="verification"||L(e.attributes.name)==="shopify-checkout-api-token"))return true}}return false}function fe(e,t){let{doc:r,mirror:n,blockClass:s,blockSelector:o,maskTextClass:a,maskTextSelector:c,skipChild:i=false,inlineStylesheet:p=true,maskInputOptions:u={},maskTextFn:d,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m={},inlineImages:l=false,recordCanvas:b=false,onSerialize:I,onIframeLoad:w,iframeLoadTimeout:g=5e3,onStylesheetLoad:M,stylesheetLoadTimeout:T=5e3,keepIframeSrcFn:A=()=>false,newlyAddedElement:H=false,cssCaptured:K=false}=t,{needsMask:$}=t,{preserveWhiteSpace:G=true}=t;$||($=er(e,a,c,$===void 0));let V=vn(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:$,inlineStylesheet:p,maskInputOptions:u,maskTextFn:d,maskInputFn:f,dataURLOptions:m,inlineImages:l,recordCanvas:b,keepIframeSrcFn:A,newlyAddedElement:H,cssCaptured:K});if(!V)return console.warn(e,"not serialized"),null;let X;n.hasNode(e)?X=n.getId(e):Rn(V,h)||!G&&V.type===W.Text&&!V.textContent.replace(/^\s+|\s+$/gm,"").length?X=We:X=Jt();let x=Object.assign(V,{id:X});if(n.add(e,x),X===We)return null;I&&I(e);let se=!i;if(x.type===W.Element){se=se&&!x.needBlock,delete x.needBlock;let S=C.shadowRoot(e);S&&Se(S)&&(x.isShadowHost=true);}if((x.type===W.Document||x.type===W.Element)&&se){h.headWhitespace&&x.type===W.Element&&x.tagName==="head"&&(G=false);let S={doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:$,maskTextClass:a,maskTextSelector:c,skipChild:i,inlineStylesheet:p,maskInputOptions:u,maskTextFn:d,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m,inlineImages:l,recordCanvas:b,preserveWhiteSpace:G,onSerialize:I,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:M,stylesheetLoadTimeout:T,keepIframeSrcFn:A,cssCaptured:false};if(!(x.type===W.Element&&x.tagName==="textarea"&&x.attributes.value!==void 0)){x.type===W.Element&&x.attributes._cssText!==void 0&&typeof x.attributes._cssText=="string"&&(S.cssCaptured=true);for(let D of Array.from(C.childNodes(e))){let _=fe(D,S);_&&x.childNodes.push(_);}}let v=null;if(Kt(e)&&(v=C.shadowRoot(e)))for(let D of Array.from(C.childNodes(v))){let _=fe(D,S);_&&(Se(v)&&(_.isShadow=true),x.childNodes.push(_));}}let te=C.parentNode(e);return te&&be(te)&&Se(te)&&(x.isShadow=true),x.type===W.Element&&x.tagName==="iframe"&&wn(e,()=>{let S=e.contentDocument;if(S&&w){let v=fe(S,{doc:S,mirror:n,blockClass:s,blockSelector:o,needsMask:$,maskTextClass:a,maskTextSelector:c,skipChild:false,inlineStylesheet:p,maskInputOptions:u,maskTextFn:d,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m,inlineImages:l,recordCanvas:b,preserveWhiteSpace:G,onSerialize:I,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:M,stylesheetLoadTimeout:T,keepIframeSrcFn:A});v&&w(e,v);}},g),x.type===W.Element&&x.tagName==="link"&&typeof x.attributes.rel=="string"&&(x.attributes.rel==="stylesheet"||x.attributes.rel==="preload"&&typeof x.attributes.href=="string"&&Yt(x.attributes.href)==="css")&&Cn(e,()=>{if(M){let S=fe(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:$,maskTextClass:a,maskTextSelector:c,skipChild:false,inlineStylesheet:p,maskInputOptions:u,maskTextFn:d,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m,inlineImages:l,recordCanvas:b,preserveWhiteSpace:G,onSerialize:I,onIframeLoad:w,iframeLoadTimeout:g,onStylesheetLoad:M,stylesheetLoadTimeout:T,keepIframeSrcFn:A});S&&M(e,S);}},T),x}function En(e,t){let{mirror:r=new Ae,blockClass:n="rr-block",blockSelector:s=null,maskTextClass:o="rr-mask",maskTextSelector:a=null,inlineStylesheet:c=true,inlineImages:i=false,recordCanvas:p=false,maskAllInputs:u=false,maskTextFn:d,maskInputFn:f,slimDOM:h=false,dataURLOptions:m,preserveWhiteSpace:l,onSerialize:b,onIframeLoad:I,iframeLoadTimeout:w,onStylesheetLoad:g,stylesheetLoadTimeout:M,keepIframeSrcFn:T=()=>false}=t,A=u===true?{color:true,date:true,"datetime-local":true,email:true,month:true,number:true,range:true,search:true,tel:true,text:true,time:true,url:true,week:true,textarea:true,select:true,password:true}:u===false?{password:true}:u,H=tr(h);return fe(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:false,inlineStylesheet:c,maskInputOptions:A,maskTextFn:d,maskInputFn:f,slimDOMOptions:H,dataURLOptions:m,inlineImages:i,recordCanvas:p,preserveWhiteSpace:l,onSerialize:b,onIframeLoad:I,iframeLoadTimeout:w,onStylesheetLoad:g,stylesheetLoadTimeout:M,keepIframeSrcFn:T,newlyAddedElement:false})}function j(e,t,r=document){let n={capture:true,passive:true};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}function ve(e,t,r={}){let n=null,s=0;return function(...o){let a=Date.now();!s&&r.leading===false&&(s=a);let c=t-(a-s),i=this;c<=0||c>t?(n&&(clearTimeout(n),n=null),s=a,e.apply(i,o)):!n&&r.trailing!==false&&(n=setTimeout(()=>{s=r.leading===false?0:Date.now(),n=null,e.apply(i,o);},c));}}function je(e,t,r,n,s=window){let o=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,n?r:{set(a){setTimeout(()=>{r.set.call(this,a);},0),o&&o.set&&o.set.call(this,a);}}),()=>je(e,t,o||{},true)}function rr(e){var t,r,n,s;let o=e.document;return {left:o.scrollingElement?o.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:o.documentElement.scrollLeft||(o==null?void 0:o.body)&&((t=C.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)&&((n=C.parentElement(o.body))==null?void 0:n.scrollTop)||((s=o==null?void 0:o.body)==null?void 0:s.scrollTop)||0}}function nr(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function sr(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function or(e){return e?e.nodeType===e.ELEMENT_NODE?e:C.parentElement(e):null}function z(e,t,r,n){if(!e)return false;let s=or(e);if(!s)return false;try{if(typeof t=="string"){if(s.classList.contains(t)||n&&s.closest("."+t)!==null)return !0}else if(He(s,t,n))return !0}catch(o){}return !!(r&&(s.matches(r)||n&&s.closest(r)!==null))}function kn(e,t){return t.getId(e)!==-1}function Ze(e,t,r){return e.tagName==="TITLE"&&r.headTitleMutations?true:t.getId(e)===We}function ir(e,t){if(be(e))return false;let r=t.getId(e);if(!t.has(r))return true;let n=C.parentNode(e);return n&&n.nodeType===e.DOCUMENT_NODE?false:n?ir(n,t):true}function nt(e){return !!e.changedTouches}function On(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 ar(e,t){return !!(e.nodeName==="IFRAME"&&t.getMeta(e))}function lr(e,t){return !!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function st(e){return e?e instanceof rt&&"shadowRoot"in e?!!e.shadowRoot:!!C.shadowRoot(e):false}function cr(e){var t;let r=null;return "getRootNode"in e&&((t=C.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&C.host(C.getRootNode(e))&&(r=C.host(C.getRootNode(e))),r}function Tn(e){let t=e,r;for(;r=cr(t);)t=r;return t}function Nn(e){let t=C.ownerDocument(e);if(!t)return false;let r=Tn(e);return C.contains(t,r)}function ur(e){let t=C.ownerDocument(e);return t?C.contains(t,e)||Nn(e):false}function at(e,t){e.delete(t),C.childNodes(t).forEach(r=>at(e,r));}function _n(e,t){let r=[e];for(;r.length;){let n=r.pop();t.has(n)||(t.add(n),C.childNodes(n).forEach(s=>r.push(s)));}}function Wt(e,t){return e.size===0?false:dr(e,t)}function dr(e,t){if(e.has(t))return true;let r=C.parentNode(t);return r?dr(e,r):false}function Ln(e){we=e;}function Dn(){we=void 0;}function Me(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(t){}return e&&e.target}function pr(e,t){let r=new it;le.push(r),r.init(e);let[n,s]=qt(),o=new n(E(r.processMutations.bind(r)));return o.observe(t,{attributes:true,attributeOldValue:true,characterData:true,characterDataOldValue:true,childList:true,subtree:true}),[o,s]}function An({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===false)return ()=>{};let s=typeof t.mousemove=="number"?t.mousemove:50,o=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,a=[],c,i=ve(E(d=>{let f=Date.now()-c;e(a.map(h=>(h.timeOffset-=f,h)),d),a=[],c=null;}),o),p=E(ve(E(d=>{let f=Me(d),{clientX:h,clientY:m}=nt(d)?d.changedTouches[0]:d;c||(c=Ce()),a.push({x:h,y:m,id:n.getId(f),timeOffset:Ce()-c}),i(typeof DragEvent!="undefined"&&d instanceof DragEvent?R.Drag:d instanceof MouseEvent?R.MouseMove:R.TouchMove);}),s,{trailing:!1})),u=[j("mousemove",p,r),j("touchmove",p,r),j("drag",p,r)];return E(()=>{u.forEach(d=>d());})}function Fn({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:o}){if(o.mouseInteraction===false)return ()=>{};let a=o.mouseInteraction===true||o.mouseInteraction===void 0?{}:o.mouseInteraction,c=[],i=null,p=u=>d=>{let f=Me(d);if(z(f,n,s,true))return;let h=null,m=u;if("pointerType"in d){switch(d.pointerType){case "mouse":h=ee.Mouse;break;case "touch":h=ee.Touch;break;case "pen":h=ee.Pen;break}h===ee.Touch?q[u]===q.MouseDown?m="TouchStart":q[u]===q.MouseUp&&(m="TouchEnd"):ee.Pen;}else nt(d)&&(h=ee.Touch);h!==null?(i=h,(m.startsWith("Touch")&&h===ee.Touch||m.startsWith("Mouse")&&h===ee.Mouse)&&(h=null)):q[u]===q.Click&&(h=i,i=null);let l=nt(d)?d.changedTouches[0]:d;if(!l)return;let b=r.getId(f),{clientX:I,clientY:w}=l;E(e)({type:q[m],id:b,x:I,y:w,...h!==null&&{pointerType:h}});};return Object.keys(q).filter(u=>Number.isNaN(Number(u))&&!u.endsWith("_Departed")&&a[u]!==false).forEach(u=>{let d=ne(u),f=p(u);if(window.PointerEvent)switch(q[u]){case q.MouseDown:case q.MouseUp:d=d.replace("mouse","pointer");break;case q.TouchStart:case q.TouchEnd:return}c.push(j(d,f,t));}),E(()=>{c.forEach(u=>u());})}function hr({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:o}){let a=E(ve(E(c=>{let i=Me(c);if(!i||z(i,n,s,!0))return;let p=r.getId(i);if(i===t&&t.defaultView){let u=rr(t.defaultView);e({id:p,x:u.left,y:u.top});}else e({id:p,x:i.scrollLeft,y:i.scrollTop});}),o.scroll||100));return j("scroll",a,t)}function Pn({viewportResizeCb:e},{win:t}){let r=-1,n=-1,s=E(ve(E(()=>{let o=nr(),a=sr();(r!==o||n!==a)&&(e({width:Number(a),height:Number(o)}),r=o,n=a);}),200));return j("resize",s,t)}function Wn({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,ignoreClass:o,ignoreSelector:a,maskInputOptions:c,maskInputFn:i,sampling:p,userTriggeredOnInput:u}){function d(w){let g=Me(w),M=w.isTrusted,T=g&&g.tagName;if(g&&T==="OPTION"&&(g=C.parentElement(g)),!g||!T||Un.indexOf(T)<0||z(g,n,s,true)||g.classList.contains(o)||a&&g.matches(a))return;let A=g.value,H=false,K=Pe(g)||"";K==="radio"||K==="checkbox"?H=g.checked:(c[T.toLowerCase()]||c[K])&&(A=Fe({element:g,maskInputOptions:c,tagName:T,type:K,value:A,maskInputFn:i})),f(g,u?{text:A,isChecked:H,userTriggered:M}:{text:A,isChecked:H});let $=g.name;K==="radio"&&$&&H&&t.querySelectorAll(`input[type="radio"][name="${$}"]`).forEach(G=>{if(G!==g){let V=G.value;f(G,u?{text:V,isChecked:!H,userTriggered:false}:{text:V,isChecked:!H});}});}function f(w,g){let M=Ht.get(w);if(!M||M.text!==g.text||M.isChecked!==g.isChecked){Ht.set(w,g);let T=r.getId(w);E(e)({...g,id:T});}}let m=(p.input==="last"?["change"]:["input","change"]).map(w=>j(w,E(d),t)),l=t.defaultView;if(!l)return ()=>{m.forEach(w=>w());};let b=l.Object.getOwnPropertyDescriptor(l.HTMLInputElement.prototype,"value"),I=[[l.HTMLInputElement.prototype,"value"],[l.HTMLInputElement.prototype,"checked"],[l.HTMLSelectElement.prototype,"value"],[l.HTMLTextAreaElement.prototype,"value"],[l.HTMLSelectElement.prototype,"selectedIndex"],[l.HTMLOptionElement.prototype,"selected"]];return b&&b.set&&m.push(...I.map(w=>je(w[0],w[1],{set(){E(d)({target:this,isTrusted:false});}},false,l))),E(()=>{m.forEach(w=>w());})}function Be(e){let t=[];function r(n,s){if(Ne("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||Ne("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||Ne("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||Ne("CSSConditionRule")&&n.parentRule instanceof CSSConditionRule){let a=Array.from(n.parentRule.cssRules).indexOf(n);return s.unshift(a),r(n.parentRule,s)}else if(n.parentStyleSheet){let a=Array.from(n.parentStyleSheet.cssRules).indexOf(n);s.unshift(a);}return s}return r(e,t)}function re(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function Hn({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return ()=>{};let s=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:E((u,d,f)=>{let[h,m]=f,{id:l,styleId:b}=re(d,t,r.styleMirror);return (l&&l!==-1||b&&b!==-1)&&e({id:l,styleId:b,adds:[{rule:h,index:m}]}),u.apply(d,f)})}),n.CSSStyleSheet.prototype.addRule=function(u,d,f=this.cssRules.length){let h=`${u} { ${d} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[h,f])};let o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:E((u,d,f)=>{let[h]=f,{id:m,styleId:l}=re(d,t,r.styleMirror);return (m&&m!==-1||l&&l!==-1)&&e({id:m,styleId:l,removes:[{index:h}]}),u.apply(d,f)})}),n.CSSStyleSheet.prototype.removeRule=function(u){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[u])};let a;n.CSSStyleSheet.prototype.replace&&(a=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:E((u,d,f)=>{let[h]=f,{id:m,styleId:l}=re(d,t,r.styleMirror);return (m&&m!==-1||l&&l!==-1)&&e({id:m,styleId:l,replace:h}),u.apply(d,f)})}));let c;n.CSSStyleSheet.prototype.replaceSync&&(c=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:E((u,d,f)=>{let[h]=f,{id:m,styleId:l}=re(d,t,r.styleMirror);return (m&&m!==-1||l&&l!==-1)&&e({id:m,styleId:l,replaceSync:h}),u.apply(d,f)})}));let i={};_e("CSSGroupingRule")?i.CSSGroupingRule=n.CSSGroupingRule:(_e("CSSMediaRule")&&(i.CSSMediaRule=n.CSSMediaRule),_e("CSSConditionRule")&&(i.CSSConditionRule=n.CSSConditionRule),_e("CSSSupportsRule")&&(i.CSSSupportsRule=n.CSSSupportsRule));let p={};return Object.entries(i).forEach(([u,d])=>{p[u]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=new Proxy(p[u].insertRule,{apply:E((f,h,m)=>{let[l,b]=m,{id:I,styleId:w}=re(h.parentStyleSheet,t,r.styleMirror);return (I&&I!==-1||w&&w!==-1)&&e({id:I,styleId:w,adds:[{rule:l,index:[...Be(h),b||0]}]}),f.apply(h,m)})}),d.prototype.deleteRule=new Proxy(p[u].deleteRule,{apply:E((f,h,m)=>{let[l]=m,{id:b,styleId:I}=re(h.parentStyleSheet,t,r.styleMirror);return (b&&b!==-1||I&&I!==-1)&&e({id:b,styleId:I,removes:[{index:[...Be(h),l]}]}),f.apply(h,m)})});}),E(()=>{n.CSSStyleSheet.prototype.insertRule=s,n.CSSStyleSheet.prototype.deleteRule=o,a&&(n.CSSStyleSheet.prototype.replace=a),c&&(n.CSSStyleSheet.prototype.replaceSync=c),Object.entries(i).forEach(([u,d])=>{d.prototype.insertRule=p[u].insertRule,d.prototype.deleteRule=p[u].deleteRule;});})}function fr({mirror:e,stylesheetManager:t},r){var n,s,o;let a=null;r.nodeName==="#document"?a=e.getId(r):a=e.getId(C.host(r));let c=r.nodeName==="#document"?(n=r.defaultView)==null?void 0:n.Document:(o=(s=r.ownerDocument)==null?void 0:s.defaultView)==null?void 0:o.ShadowRoot,i=c!=null&&c.prototype?Object.getOwnPropertyDescriptor(c==null?void 0:c.prototype,"adoptedStyleSheets"):void 0;return a===null||a===-1||!c||!i?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){var p;return (p=i.get)==null?void 0:p.call(this)},set(p){var u;let d=(u=i.set)==null?void 0:u.call(this,p);if(a!==null&&a!==-1)try{t.adoptStyleSheets(p,a);}catch(f){}return d}}),E(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set});}))}function Bn({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:s}){let o=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:E((c,i,p)=>{var u;let[d,f,h]=p;if(r.has(d))return o.apply(i,[d,f,h]);let{id:m,styleId:l}=re((u=i.parentRule)==null?void 0:u.parentStyleSheet,t,n.styleMirror);return (m&&m!==-1||l&&l!==-1)&&e({id:m,styleId:l,set:{property:d,value:f,priority:h},index:Be(i.parentRule)}),c.apply(i,p)})});let a=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:E((c,i,p)=>{var u;let[d]=p;if(r.has(d))return a.apply(i,[d]);let{id:f,styleId:h}=re((u=i.parentRule)==null?void 0:u.parentStyleSheet,t,n.styleMirror);return (f&&f!==-1||h&&h!==-1)&&e({id:f,styleId:h,remove:{property:d},index:Be(i.parentRule)}),c.apply(i,p)})}),E(()=>{s.CSSStyleDeclaration.prototype.setProperty=o,s.CSSStyleDeclaration.prototype.removeProperty=a;})}function $n({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:s,doc:o}){let a=E(i=>ve(E(p=>{let u=Me(p);if(!u||z(u,t,r,!0))return;let{currentTime:d,volume:f,muted:h,playbackRate:m,loop:l}=u;e({type:i,id:n.getId(u),currentTime:d,volume:f,muted:h,playbackRate:m,loop:l});}),s.media||500)),c=[j("play",a(de.Play),o),j("pause",a(de.Pause),o),j("seeked",a(de.Seeked),o),j("volumechange",a(de.VolumeChange),o),j("ratechange",a(de.RateChange),o)];return E(()=>{c.forEach(i=>i());})}function Vn({fontCb:e,doc:t}){let r=t.defaultView;if(!r)return ()=>{};let n=[],s=new WeakMap,o=r.FontFace;r.FontFace=function(i,p,u){let d=new o(i,p,u);return s.set(d,{family:i,buffer:typeof p!="string",descriptors:u,fontSource:typeof p=="string"?p:JSON.stringify(Array.from(new Uint8Array(p)))}),d};let a=ce(t.fonts,"add",function(c){return function(i){return setTimeout(E(()=>{let p=s.get(i);p&&(e(p),s.delete(i));}),0),c.apply(this,[i])}});return n.push(()=>{r.FontFace=o;}),n.push(a),E(()=>{n.forEach(c=>c());})}function jn(e){let{doc:t,mirror:r,blockClass:n,blockSelector:s,selectionCb:o}=e,a=true,c=E(()=>{let i=t.getSelection();if(!i||a&&(i!=null&&i.isCollapsed))return;a=i.isCollapsed||false;let p=[],u=i.rangeCount||0;for(let d=0;d<u;d++){let f=i.getRangeAt(d),{startContainer:h,startOffset:m,endContainer:l,endOffset:b}=f;z(h,n,s,!0)||z(l,n,s,!0)||p.push({start:r.getId(h),startOffset:m,end:r.getId(l),endOffset:b});}o({ranges:p});});return c(),j("selectionchange",c)}function zn({doc:e,customElementCb:t}){let r=e.defaultView;return !r||!r.customElements?()=>{}:ce(r.customElements,"define",function(s){return function(o,a,c){try{t({define:{name:o}});}catch(i){console.warn(`Custom element callback failed for ${o}`);}return s.apply(this,[o,a,c])}})}function Gn(e,t){let{mutationCb:r,mousemoveCb:n,mouseInteractionCb:s,scrollCb:o,viewportResizeCb:a,inputCb:c,mediaInteractionCb:i,styleSheetRuleCb:p,styleDeclarationCb:u,canvasMutationCb:d,fontCb:f,selectionCb:h,customElementCb:m}=e;e.mutationCb=(...l)=>{t.mutation&&t.mutation(...l),r(...l);},e.mousemoveCb=(...l)=>{t.mousemove&&t.mousemove(...l),n(...l);},e.mouseInteractionCb=(...l)=>{t.mouseInteraction&&t.mouseInteraction(...l),s(...l);},e.scrollCb=(...l)=>{t.scroll&&t.scroll(...l),o(...l);},e.viewportResizeCb=(...l)=>{t.viewportResize&&t.viewportResize(...l),a(...l);},e.inputCb=(...l)=>{t.input&&t.input(...l),c(...l);},e.mediaInteractionCb=(...l)=>{t.mediaInteaction&&t.mediaInteaction(...l),i(...l);},e.styleSheetRuleCb=(...l)=>{t.styleSheetRule&&t.styleSheetRule(...l),p(...l);},e.styleDeclarationCb=(...l)=>{t.styleDeclaration&&t.styleDeclaration(...l),u(...l);},e.canvasMutationCb=(...l)=>{t.canvasMutation&&t.canvasMutation(...l),d(...l);},e.fontCb=(...l)=>{t.font&&t.font(...l),f(...l);},e.selectionCb=(...l)=>{t.selection&&t.selection(...l),h(...l);},e.customElementCb=(...l)=>{t.customElement&&t.customElement(...l),m(...l);};}function qn(e,t={}){let r=e.doc.defaultView;if(!r)return ()=>{};Gn(e,t);let n,s=()=>{};e.recordDOM&&([n,s]=pr(e,e.doc));let o=An(e),a=Fn(e),c=hr(e),i=Pn(e,{win:r}),p=Wn(e),u=$n(e),d=()=>{},f=()=>{},h=()=>{},m=()=>{};e.recordDOM&&(d=Hn(e,{win:r}),f=fr(e,e.doc),h=Bn(e,{win:r}),e.collectFonts&&(m=Vn(e)));let l=jn(e),b=zn(e),I=[];for(let w of e.plugins)I.push(w.observer(w.callback,r,w.options));return E(()=>{le.forEach(w=>w.reset()),n==null||n.disconnect(),s(),o(),a(),c(),i(),p(),u(),d(),f(),h(),m(),l(),b(),I.forEach(w=>w());})}function Ne(e){return typeof window[e]!="undefined"}function _e(e){return !!(typeof window[e]!="undefined"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}function Yn(e,t){let r=Bt.get(e);return r||(r=new Map,Bt.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}function Le(e,t,r){if(e instanceof Array)return e.map(n=>Le(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return {rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){let n=e.constructor.name,s=Xn(e);return {rr_type:n,base64:s}}else {if(e instanceof DataView)return {rr_type:e.constructor.name,args:[Le(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let n=e.constructor.name,{src:s}=e;return {rr_type:n,src:s}}else if(e instanceof HTMLCanvasElement){let n="HTMLImageElement",s=e.toDataURL();return {rr_type:n,src:s}}else {if(e instanceof ImageData)return {rr_type:e.constructor.name,args:[Le(e.data,t,r),e.width,e.height]};if(yr(e,t)||typeof e=="object"){let n=e.constructor.name,s=mr(e,t,r);return {rr_type:n,index:s}}}}return e}function Jn(e,t,r,n){let s=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let a of o)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;let c=ce(t.CanvasRenderingContext2D.prototype,a,function(i){return function(...p){return z(this.canvas,r,n,!0)||setTimeout(()=>{let u=gr(p,t,this);e(this.canvas,{type:ge["2D"],property:a,args:u});},0),i.apply(this,p)}});s.push(c);}catch(c){let i=je(t.CanvasRenderingContext2D.prototype,a,{set(p){e(this.canvas,{type:ge["2D"],property:a,args:[p],setter:true});}});s.push(i);}return ()=>{s.forEach(a=>a());}}function Qn(e){return e==="experimental-webgl"?"webgl":e}function $t(e,t,r,n){let s=[];try{let o=ce(e.HTMLCanvasElement.prototype,"getContext",function(a){return function(c,...i){if(!z(this,t,r,!0)){let p=Qn(c);if("__context"in this||(this.__context=p),n&&["webgl","webgl2"].includes(p))if(i[0]&&typeof i[0]=="object"){let u=i[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0);}else i.splice(0,1,{preserveDrawingBuffer:!0});}return a.apply(this,[c,...i])}});s.push(o);}catch(o){console.error("failed to patch HTMLCanvasElement.prototype.getContext");}return ()=>{s.forEach(o=>o());}}function Vt(e,t,r,n,s,o){let a=[],c=Object.getOwnPropertyNames(e);for(let i of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(i))try{if(typeof e[i]!="function")continue;let p=ce(e,i,function(u){return function(...d){let f=u.apply(this,d);if(mr(f,o,this),"tagName"in this.canvas&&!z(this.canvas,n,s,!0)){let h=gr(d,o,this),m={type:t,property:i,args:h};r(this.canvas,m);}return f}});a.push(p);}catch(p){let u=je(e,i,{set(d){r(this.canvas,{type:t,property:i,args:[d],setter:true});}});a.push(u);}return a}function Zn(e,t,r,n){let s=[];return typeof t.WebGLRenderingContext!="undefined"&&s.push(...Vt(t.WebGLRenderingContext.prototype,ge.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext!="undefined"&&s.push(...Vt(t.WebGL2RenderingContext.prototype,ge.WebGL2,e,r,n,t)),()=>{s.forEach(o=>o());}}function es(e){let t;try{if(t=jt&&(self.URL||self.webkitURL).createObjectURL(jt),!t)throw "";let r=new Worker(t,{name:e==null?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t);}),r}catch(r){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(br),{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t);}}function Ie(e={}){let{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,maskTextClass:i="rr-mask",maskTextSelector:p=null,inlineStylesheet:u=true,maskAllInputs:d,maskInputOptions:f,slimDOMOptions:h,maskInputFn:m,maskTextFn:l,hooks:b,packFn:I,sampling:w={},dataURLOptions:g={},mousemoveWait:M,recordDOM:T=true,recordCanvas:A=false,recordCrossOriginIframes:H=false,recordAfter:K=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:$=false,collectFonts:G=false,inlineImages:V=false,plugins:X,keepIframeSrcFn:x=()=>false,ignoreCSSAttributes:se=new Set([]),errorHandler:te}=e;Ln(te);let S=H?window.parent===window:true,v=false;if(!S)try{window.parent.document&&(v=!1);}catch(O){v=true;}if(S&&!t)throw new Error("emit function is required");if(!S&&!v)return ()=>{};M!==void 0&&w.mousemove===void 0&&(w.mousemove=M),Z.reset();let D=d===true?{color:true,date:true,"datetime-local":true,email:true,month:true,number:true,range:true,search:true,tel:true,text:true,time:true,url:true,week:true,textarea:true,select:true,password:true}:f!==void 0?f:{password:true},_=tr(h);On();let B,oe=0,gt=O=>{for(let Q of X||[])Q.eventProcessor&&(O=Q.eventProcessor(O));return I&&!v&&(O=I(O)),O};U=(O,Q)=>{var F;let P=O;if(P.timestamp=Ce(),(F=le[0])!=null&&F.isFrozen()&&P.type!==k.FullSnapshot&&!(P.type===k.IncrementalSnapshot&&P.data.source===R.Mutation)&&le.forEach(Y=>Y.unfreeze()),S)t==null||t(gt(P),Q);else if(v){let Y={type:"rrweb",event:gt(P),origin:window.location.origin,isCheckout:Q};window.parent.postMessage(Y,"*");}if(P.type===k.FullSnapshot)B=P,oe=0;else if(P.type===k.IncrementalSnapshot){if(P.data.source===R.Mutation&&P.data.isAttachIframe)return;oe++;let Y=n&&oe>=n,N=r&&P.timestamp-B.timestamp>r;(Y||N)&&De(true);}};let xe=O=>{U({type:k.IncrementalSnapshot,data:{source:R.Mutation,...O}});},yt=O=>U({type:k.IncrementalSnapshot,data:{source:R.Scroll,...O}}),bt=O=>U({type:k.IncrementalSnapshot,data:{source:R.CanvasMutation,...O}}),vr=O=>U({type:k.IncrementalSnapshot,data:{source:R.AdoptedStyleSheet,...O}}),ie=new dt({mutationCb:xe,adoptedStyleSheetCb:vr}),ae=new lt({mirror:Z,mutationCb:xe,stylesheetManager:ie,recordCrossOriginIframes:H,wrappedEmit:U});for(let O of X||[])O.getMirror&&O.getMirror({nodeMirror:Z,crossOriginIframeMirror:ae.crossOriginIframeMirror,crossOriginIframeStyleMirror:ae.crossOriginIframeStyleMirror});let Ge=new pt;et=new ut({recordCanvas:A,mutationCb:bt,win:window,blockClass:s,blockSelector:o,mirror:Z,sampling:w.canvas,dataURLOptions:g});let Re=new ct({mutationCb:xe,scrollCb:yt,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:i,maskTextSelector:p,inlineStylesheet:u,maskInputOptions:D,dataURLOptions:g,maskTextFn:l,maskInputFn:m,recordCanvas:A,inlineImages:V,sampling:w,slimDOMOptions:_,iframeManager:ae,stylesheetManager:ie,canvasManager:et,keepIframeSrcFn:x,processedNodeManager:Ge},mirror:Z});De=(O=false)=>{if(!T)return;U({type:k.Meta,data:{href:window.location.href,width:sr(),height:nr()}},O),ie.reset(),Re.init(),le.forEach(F=>F.lock());let Q=En(document,{mirror:Z,blockClass:s,blockSelector:o,maskTextClass:i,maskTextSelector:p,inlineStylesheet:u,maskAllInputs:D,maskTextFn:l,maskInputFn:m,slimDOM:_,dataURLOptions:g,recordCanvas:A,inlineImages:V,onSerialize:F=>{ar(F,Z)&&ae.addIframe(F),lr(F,Z)&&ie.trackLinkElement(F),st(F)&&Re.addShadowRoot(C.shadowRoot(F),document);},onIframeLoad:(F,P)=>{ae.attachIframe(F,P),Re.observeAttachShadow(F);},onStylesheetLoad:(F,P)=>{ie.attachLinkElement(F,P);},keepIframeSrcFn:x});if(!Q)return console.warn("Failed to snapshot the document");U({type:k.FullSnapshot,data:{node:Q,initialOffset:rr(window)}},O),le.forEach(F=>F.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ie.adoptStyleSheets(document.adoptedStyleSheets,Z.getId(document));};try{let O=[],Q=P=>{var Y;return E(qn)({mutationCb:xe,mousemoveCb:(N,qe)=>U({type:k.IncrementalSnapshot,data:{source:qe,positions:N}}),mouseInteractionCb:N=>U({type:k.IncrementalSnapshot,data:{source:R.MouseInteraction,...N}}),scrollCb:yt,viewportResizeCb:N=>U({type:k.IncrementalSnapshot,data:{source:R.ViewportResize,...N}}),inputCb:N=>U({type:k.IncrementalSnapshot,data:{source:R.Input,...N}}),mediaInteractionCb:N=>U({type:k.IncrementalSnapshot,data:{source:R.MediaInteraction,...N}}),styleSheetRuleCb:N=>U({type:k.IncrementalSnapshot,data:{source:R.StyleSheetRule,...N}}),styleDeclarationCb:N=>U({type:k.IncrementalSnapshot,data:{source:R.StyleDeclaration,...N}}),canvasMutationCb:bt,fontCb:N=>U({type:k.IncrementalSnapshot,data:{source:R.Font,...N}}),selectionCb:N=>{U({type:k.IncrementalSnapshot,data:{source:R.Selection,...N}});},customElementCb:N=>{U({type:k.IncrementalSnapshot,data:{source:R.CustomElement,...N}});},blockClass:s,ignoreClass:a,ignoreSelector:c,maskTextClass:i,maskTextSelector:p,maskInputOptions:D,inlineStylesheet:u,sampling:w,recordDOM:T,recordCanvas:A,inlineImages:V,userTriggeredOnInput:$,collectFonts:G,doc:P,maskInputFn:m,maskTextFn:l,keepIframeSrcFn:x,blockSelector:o,slimDOMOptions:_,dataURLOptions:g,mirror:Z,iframeManager:ae,stylesheetManager:ie,shadowDomManager:Re,processedNodeManager:Ge,canvasManager:et,ignoreCSSAttributes:se,plugins:((Y=X==null?void 0:X.filter(N=>N.observer))==null?void 0:Y.map(N=>({observer:N.observer,options:N.options,callback:qe=>U({type:k.Plugin,data:{plugin:N.name,payload:qe}})})))||[]},b)};ae.addLoadListener(P=>{try{O.push(Q(P.contentDocument));}catch(Y){console.warn(Y);}});let F=()=>{De(),O.push(Q(document)),Ve=!0;};return ["interactive","complete"].includes(document.readyState)?F():(O.push(j("DOMContentLoaded",()=>{U({type:k.DomContentLoaded,data:{}}),K==="DOMContentLoaded"&&F();})),O.push(j("load",()=>{U({type:k.Load,data:{}}),K==="load"&&F();},window))),()=>{O.forEach(P=>{try{P();}catch(Y){String(Y).toLowerCase().includes("cross-origin")||console.warn(Y);}}),Ge.destroy(),Ve=!1,Dn();}}catch(O){console.warn(O);}}var _r,Lr,y,Nt,k,R,q,ee,ge,de,W,_t,Lt,Oe,zt,Dr,Je,Qe,Ce,C,Ae,Dt,on,an,ln,cn,pn,hn,We,ue,At,mn,gn,Ft,rt,pe,Pt,ot,Ut,it,we,E,le,Un,Ht,$e,lt,ct,me,Kn,ye,Xn,Bt,mr,gr,yr,br,jt,ut,dt,pt,U,De,et,Ve,Z,wr=Ir(()=>{_r=Object.defineProperty,Lr=(e,t,r)=>t in e?_r(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r,y=(e,t,r)=>Lr(e,typeof t!="symbol"?t+"":t,r),k=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e[e.Asset=7]="Asset",e))(k||{}),R=(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))(R||{}),q=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(q||{}),ee=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(ee||{}),ge=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ge||{}),de=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(de||{}),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||{}),_t={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Lt={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Oe={},zt={},Dr=()=>!!globalThis.Zone;Je={};Qe={};Ce=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Ce=()=>new Date().getTime());C={ownerDocument:Ar,childNodes:Fr,parentNode:Pr,parentElement:Ur,textContent:Wr,firstChild:Hr,lastChild:Br,nextSibling:$r,previousSibling:Vr,contains:jr,getRootNode:zr,host:Gr,styleSheets:qr,shadowRoot:Kr,querySelector:Xr,querySelectorAll:Yr,nowTimestamp:Ce,mutationObserverCtor:qt,patch:ce};Ae=class{constructor(){y(this,"idNodeMap",new Map),y(this,"nodeMetaMap",new WeakMap);}getId(t){var r;if(!t)return -1;let n=(r=this.getMeta(t))==null?void 0:r.id;return n!=null?n:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){let r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n));}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r);}replace(t,r){let n=this.getNode(t);if(n){let s=this.nodeMetaMap.get(n);s&&this.nodeMetaMap.set(r,s);}this.idNodeMap.set(t,r);}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap;}};Dt="__rrweb_original__";on=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,an=/^(?:[a-z+]+:)?\/\//i,ln=/^www\..*/i,cn=/^(data:)([^,]*),(.*)/i;pn=1,hn=new RegExp("[^a-z0-9-_:]"),We=-2;mn=/^[^ \t\n\r\u000c]+/,gn=/^[, \t\n\r\u000c]+/;Ft=new WeakMap;rt=class e{constructor(...t){y(this,"parentElement",null),y(this,"parentNode",null),y(this,"ownerDocument"),y(this,"firstChild",null),y(this,"lastChild",null),y(this,"previousSibling",null),y(this,"nextSibling",null),y(this,"ELEMENT_NODE",1),y(this,"TEXT_NODE",3),y(this,"nodeType"),y(this,"nodeName"),y(this,"RRNodeType");}get childNodes(){let t=[],r=this.firstChild;for(;r;)t.push(r),r=r.nextSibling;return t}contains(t){if(t instanceof e){if(t.ownerDocument!==this.ownerDocument)return false;if(t===this)return true}else return false;for(;t.parentNode;){if(t.parentNode===this)return true;t=t.parentNode;}return false}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"}};pe=`Please stop import mirror directly. Instead of that,\r
|
|
1
|
+
(function(){'use strict';var wt=Object.defineProperty;var Rr=(e,t,r)=>t in e?wt(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r;var kr=(e,t)=>()=>(e&&(t=e(e=0)),t);var Er=(e,t)=>{for(var r in t)wt(e,r,{get:t[r],enumerable:true});};var Ee=(e,t,r)=>Rr(e,typeof t!="symbol"?t+"":t,r);var vr={};Er(vr,{record:()=>xe});function mt(e){if(Te[e])return Te[e];let t=globalThis[e],r=t.prototype,n=e in At?At[e]:void 0,s=!!(n&&n.every(c=>{var i,p;return !!((p=(i=Object.getOwnPropertyDescriptor(r,c))==null?void 0:i.get)!=null&&p.toString().includes("[native code]"))})),o=e in Ft?Ft[e]:void 0,a=!!(o&&o.every(c=>{var i;return typeof r[c]=="function"&&((i=r[c])==null?void 0:i.toString().includes("[native code]"))}));if(s&&a&&!Ur())return Te[e]=t.prototype,t.prototype;try{let c=document.createElement("iframe");c.style.display="none",document.body.appendChild(c);let i=c.contentWindow;if(!i)return t.prototype;let p=i[e].prototype;if(!p)return c.remove(),r;let u=navigator.userAgent;return u.includes("Safari")&&!u.includes("Chrome")?(c.classList.add("rr-block"),c.setAttribute("__rrwebUntaintedMutationObserver",""),Kt[e]=()=>c.remove()):c.remove(),Te[e]=p}catch(c){return r}}function Q(e,t,r){var n,s;let o=(n=Ze[e])==null?void 0:n[r];if(o)return o.call(t);let a=mt(e),c=(s=Object.getOwnPropertyDescriptor(a,r))==null?void 0:s.get;return c?((Ze[e]||(Ze[e]={}))[r]=c,c.call(t)):t[r]}function Xt(e,t,r){let n=`${e}.${String(r)}`;if(et[n])return et[n].bind(t);let o=mt(e)[r];return typeof o!="function"?t[r]:(et[n]=o,o.bind(t))}function Wr(e){return Q("Node",e,"ownerDocument")}function Hr(e){return Q("Node",e,"childNodes")}function Br(e){return Q("Node",e,"parentNode")}function $r(e){return Q("Node",e,"parentElement")}function Vr(e){return Q("Node",e,"textContent")}function jr(e){return Q("Node",e,"firstChild")}function zr(e){return Q("Node",e,"lastChild")}function Gr(e){return Q("Node",e,"nextSibling")}function qr(e){return Q("Node",e,"previousSibling")}function Kr(e,t){return Xt("Node",e,"contains")(t)}function Xr(e){return Xt("Node",e,"getRootNode")()}function Yr(e){return !e||!("host"in e)?null:Q("ShadowRoot",e,"host")}function Jr(e){return e.styleSheets}function Qr(e){return !e||!("shadowRoot"in e)?null:Q("Element",e,"shadowRoot")}function Zr(e,t){return Q("Element",e,"querySelector")(t)}function en(e,t){return Q("Element",e,"querySelectorAll")(t)}function Yt(){var e;return [mt("MutationObserver").constructor,(e=Kt.MutationObserver)!=null?e:(()=>{})]}function ce(e,t,r){try{if(!(t in e))return ()=>{};let n=e[t],s=r(n);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=s,()=>{e[t]=n;}}catch(n){return ()=>{}}}function Jt(e){return e.nodeType===e.ELEMENT_NODE}function Se(e){let t=e&&"host"in e&&"mode"in e&&w.host(e)||null;return !!(t&&"shadowRoot"in t&&w.shadowRoot(t)===e)}function we(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function tn(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 rn(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let r=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function nt(e){try{let t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);let n=Array.from(t,s=>Qt(s,r)).join("");return tn(n)}catch(t){return null}}function Qt(e,t){if(sn(e)){let r;try{r=nt(e.styleSheet)||rn(e);}catch(n){r=e.cssText;}return e.styleSheet.href?We(r,e.styleSheet.href):r}else {let r=e.cssText;return on(e)&&e.selectorText.includes(":")&&(r=nn(r)),t?We(r,t):r}}function nn(e){let t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function sn(e){return "styleSheet"in e}function on(e){return "selectorText"in e}function an(){return new Fe}function Pe({element:e,maskInputOptions:t,tagName:r,type:n,value:s,maskInputFn:o}){let a=s||"",c=n&&se(n);return (t[r.toLowerCase()]||c&&t[c])&&(o?a=o(a,e):a="*".repeat(a.length)),a}function se(e){return e.toLowerCase()}function ln(e){let t=e.getContext("2d");if(!t)return true;let r=50;for(let n=0;n<e.width;n+=r)for(let s=0;s<e.height;s+=r){let o=t.getImageData,a=Pt in o?o[Pt]:o;if(new Uint32Array(a.call(t,n,s,Math.min(r,e.width-n),Math.min(r,e.height-s)).data.buffer).some(i=>i!==0))return false}return true}function Ue(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?se(t):null}function Zt(e,t){var o;let r;try{r=new URL(e,t!=null?t:window.location.href);}catch(a){return null}let n=/\.([0-9a-z]+)(?:$)/i,s=r.pathname.match(n);return (o=s==null?void 0:s[1])!=null?o:null}function cn(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}function We(e,t){return (e||"").replace(un,(r,n,s,o,a,c)=>{let i=s||a||c,p=n||o||"";if(!i)return r;if(dn.test(i)||pn.test(i))return `url(${p}${i}${p})`;if(hn.test(i))return `url(${p}${i}${p})`;if(i[0]==="/")return `url(${p}${cn(t)+i}${p})`;let u=i.split("#")[0],d=i.substring(u.length),f=t.split("#")[0].split("/"),h=u.split("/");f.pop();for(let m of h)m!=="."&&(m===".."?f.pop():f.push(m));return `url(${p}${f.join("/")}${d}${p})`})}function Ne(e,t=false){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function fn(e,t,r=false){let n=Array.from(t.childNodes),s=[],o=0;if(n.length>1&&e&&typeof e=="string"){let a=Ne(e,r),c=a.length/e.length;for(let i=1;i<n.length;i++)if(n[i].textContent&&typeof n[i].textContent=="string"){let p=Ne(n[i].textContent,r),u=100,d=3;for(;d<p.length&&(p[d].match(/[a-zA-Z0-9]/)||p.indexOf(p.substring(0,d),1)!==-1);d++);for(;d<p.length;d++){let f=p.substring(0,d),h=a.split(f),m=-1;if(h.length===2)m=h[0].length;else if(h.length>2&&h[0]===""&&n[i-1].textContent!=="")m=a.indexOf(f,1);else if(h.length===1){if(f=f.substring(0,f.length-1),h=a.split(f),h.length<=1)return s.push(e),s;d=u+1;}else d===p.length-1&&(m=a.indexOf(f));if(h.length>=2&&d>u){let l=n[i-1].textContent;if(l&&typeof l=="string"){let b=Ne(l).length;m=a.indexOf(f,b);}m===-1&&(m=h[0].length);}if(m!==-1){let l=Math.floor(m/c);for(;l>0&&l<e.length;){if(o+=1,o>50*n.length)return s.push(e),s;let b=Ne(e.substring(0,l),r);if(b.length===m){s.push(e.substring(0,l)),e=e.substring(l),a=a.substring(m);break}else b.length<m?l+=Math.max(1,Math.floor((m-b.length)/c)):l-=Math.max(1,Math.floor((b.length-m)*c));}break}}}}return s.push(e),s}function mn(e,t){return fn(e,t).join("/* rr_split */")}function er(){return gn++}function bn(e){if(e instanceof HTMLFormElement)return "form";let t=se(e.tagName);return yn.test(t)?"div":t}function Cn(e,t){if(t.trim()==="")return t;let r=0;function n(o){let a,c=o.exec(t.substring(r));return c?(a=c[0],r+=a.length,a):""}let s=[];for(;n(wn),!(r>=t.length);){let o=n(Sn);if(o.slice(-1)===",")o=fe(e,o.substring(0,o.length-1)),s.push(o);else {let a="";o=fe(e,o);let c=false;for(;;){let i=t.charAt(r);if(i===""){s.push((o+a).trim());break}else if(c)i===")"&&(c=false);else if(i===","){r+=1,s.push((o+a).trim());break}else i==="("&&(c=true);a+=i,r+=1;}}}return s.join(", ")}function fe(e,t){return !t||t.trim()===""?t:gt(e,t)}function vn(e){return !!(e.tagName==="svg"||e.ownerSVGElement)}function gt(e,t){let r=Wt.get(e);if(r||(r=e.createElement("a"),Wt.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function tr(e,t,r,n){return n&&(r==="src"||r==="href"&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&["table","td","th"].includes(t)?fe(e,n):r==="srcset"?Cn(e,n):r==="style"?We(n,gt(e)):t==="object"&&r==="data"?fe(e,n):n)}function rr(e,t,r){return ["video","audio"].includes(e)&&se(t)==="autoplay"}function Mn(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return !0}else for(let n=e.classList.length;n--;){let s=e.classList[n];if(t.test(s))return !0}if(r)return e.matches(r)}catch(n){}return false}function Be(e,t,r){if(!e)return false;if(e.nodeType!==e.ELEMENT_NODE)return r?Be(w.parentNode(e),t,r):false;for(let n=e.classList.length;n--;){let s=e.classList[n];if(t.test(s))return true}return r?Be(w.parentNode(e),t,r):false}function nr(e,t,r,n){let s;if(Jt(e)){if(s=e,!w.childNodes(s).length)return false}else {if(w.parentElement(e)===null)return false;s=w.parentElement(e);}try{if(typeof t=="string"){if(n){if(s.closest(`.${t}`))return !0}else if(s.classList.contains(t))return !0}else if(Be(s,t,n))return !0;if(r){if(n){if(s.closest(r))return !0}else if(s.matches(r))return !0}}catch(o){}return false}function In(e,t,r){let n=e.contentWindow;if(!n)return;let s=false,o;try{o=n.document.readyState;}catch(c){return}if(o!=="complete"){let c=setTimeout(()=>{s||(t(),s=true);},r);e.addEventListener("load",()=>{clearTimeout(c),s=true,t();});return}let a="about:blank";if(n.location.href!==a||e.src===a||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t);}function xn(e,t,r){let n=false,s;try{s=e.sheet;}catch(a){return}if(s)return;let o=setTimeout(()=>{n||(t(),n=true);},r);e.addEventListener("load",()=>{clearTimeout(o),n=true,t();});}function Rn(e,t){let{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:a,inlineStylesheet:c,maskInputOptions:i={},maskTextFn:p,maskInputFn:u,dataURLOptions:d={},inlineImages:f,recordCanvas:h,keepIframeSrcFn:m,newlyAddedElement:l=false,cssCaptured:b=false}=t,I=kn(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:H.Document,childNodes:[],compatMode:e.compatMode}:{type:H.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return {type:H.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:I};case e.ELEMENT_NODE:return On(e,{doc:r,blockClass:s,blockSelector:o,inlineStylesheet:c,maskInputOptions:i,maskInputFn:u,dataURLOptions:d,inlineImages:f,recordCanvas:h,keepIframeSrcFn:m,newlyAddedElement:l,rootId:I});case e.TEXT_NODE:return En(e,{doc:r,needsMask:a,maskTextFn:p,rootId:I,cssCaptured:b});case e.CDATA_SECTION_NODE:return {type:H.CDATA,textContent:"",rootId:I};case e.COMMENT_NODE:return {type:H.Comment,textContent:w.textContent(e)||"",rootId:I};default:return false}}function kn(e,t){if(!t.hasNode(e))return;let r=t.getId(e);return r===1?void 0:r}function En(e,t){let{needsMask:r,maskTextFn:n,rootId:s,cssCaptured:o}=t,a=w.parentNode(e),c=a&&a.tagName,i="",p=c==="STYLE"?true:void 0,u=c==="SCRIPT"?true:void 0;return u?i="SCRIPT_PLACEHOLDER":o||(i=w.textContent(e),p&&i&&(i=We(i,gt(t.doc)))),!p&&!u&&i&&r&&(i=n?n(i,w.parentElement(e)):i.replace(/[\S]/g,"*")),{type:H.Text,textContent:i||"",rootId:s}}function On(e,t){let{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:c,dataURLOptions:i={},inlineImages:p,recordCanvas:u,keepIframeSrcFn:d,newlyAddedElement:f=false,rootId:h}=t,m=Mn(e,n,s),l=bn(e),b={},I=e.attributes.length;for(let g=0;g<I;g++){let v=e.attributes[g];rr(l,v.name,v.value)||(b[v.name]=tr(r,l,se(v.name),v.value));}if(l==="link"&&o){let g=Array.from(r.styleSheets).find(N=>N.href===e.href),v=null;g&&(v=nt(g)),v&&(delete b.rel,delete b.href,b._cssText=v);}if(l==="style"&&e.sheet){let g=nt(e.sheet);g&&(e.childNodes.length>1&&(g=mn(g,e)),b._cssText=g);}if(["input","textarea","select"].includes(l)){let g=e.value,v=e.checked;b.type!=="radio"&&b.type!=="checkbox"&&b.type!=="submit"&&b.type!=="button"&&g?b.value=Pe({element:e,type:Ue(e),tagName:l,value:g,maskInputOptions:a,maskInputFn:c}):v&&(b.checked=v);}if(l==="option"&&(e.selected&&!a.select?b.selected=true:delete b.selected),l==="dialog"&&e.open&&(b.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),l==="canvas"&&u){if(e.__context==="2d")ln(e)||(b.rr_dataURL=e.toDataURL(i.type,i.quality));else if(!("__context"in e)){let g=e.toDataURL(i.type,i.quality),v=r.createElement("canvas");v.width=e.width,v.height=e.height;let N=v.toDataURL(i.type,i.quality);g!==N&&(b.rr_dataURL=g);}}if(l==="img"&&p){de||(de=r.createElement("canvas"),Ut=de.getContext("2d"));let g=e,v=g.currentSrc||g.getAttribute("src")||"<unknown-src>",N=g.crossOrigin,D=()=>{g.removeEventListener("load",D);try{de.width=g.naturalWidth,de.height=g.naturalHeight,Ut.drawImage(g,0,0),b.rr_dataURL=de.toDataURL(i.type,i.quality);}catch(B){if(g.crossOrigin!=="anonymous"){g.crossOrigin="anonymous",g.complete&&g.naturalWidth!==0?D():g.addEventListener("load",D);return}else console.warn(`Cannot inline img src=${v}! Error: ${B}`);}g.crossOrigin==="anonymous"&&(N?b.crossOrigin=N:g.removeAttribute("crossorigin"));};g.complete&&g.naturalWidth!==0?D():g.addEventListener("load",D);}if(["audio","video"].includes(l)){let g=b;g.rr_mediaState=e.paused?"paused":"played",g.rr_mediaCurrentTime=e.currentTime,g.rr_mediaPlaybackRate=e.playbackRate,g.rr_mediaMuted=e.muted,g.rr_mediaLoop=e.loop,g.rr_mediaVolume=e.volume;}if(f||(e.scrollLeft&&(b.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(b.rr_scrollTop=e.scrollTop)),m){let{width:g,height:v}=e.getBoundingClientRect();b={class:b.class,rr_width:`${g}px`,rr_height:`${v}px`};}l==="iframe"&&!d(b.src)&&(e.contentDocument||(b.rr_src=b.src),delete b.src);let S;try{customElements.get(l)&&(S=!0);}catch(g){}return {type:H.Element,tagName:l,attributes:b,childNodes:[],isSVG:vn(e)||void 0,needBlock:m,rootId:h,isCustom:S}}function L(e){return e==null?"":e.toLowerCase()}function sr(e){return e===true||e==="all"?{script:true,comment:true,headFavicon:true,headWhitespace:true,headMetaSocial:true,headMetaRobots:true,headMetaHttpEquiv:true,headMetaVerification:true,headMetaAuthorship:e==="all",headMetaDescKeywords:e==="all",headTitleMutations:e==="all"}:e||{}}function Tn(e,t){if(t.comment&&e.type===H.Comment)return true;if(e.type===H.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Zt(e.attributes.href)==="js"))return true;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(L(e.attributes.name).match(/^msapplication-tile(image|color)$/)||L(e.attributes.name)==="application-name"||L(e.attributes.rel)==="icon"||L(e.attributes.rel)==="apple-touch-icon"||L(e.attributes.rel)==="shortcut icon")))return true;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&L(e.attributes.name).match(/^description|keywords$/))return true;if(t.headMetaSocial&&(L(e.attributes.property).match(/^(og|twitter|fb):/)||L(e.attributes.name).match(/^(og|twitter):/)||L(e.attributes.name)==="pinterest"))return true;if(t.headMetaRobots&&(L(e.attributes.name)==="robots"||L(e.attributes.name)==="googlebot"||L(e.attributes.name)==="bingbot"))return true;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return true;if(t.headMetaAuthorship&&(L(e.attributes.name)==="author"||L(e.attributes.name)==="generator"||L(e.attributes.name)==="framework"||L(e.attributes.name)==="publisher"||L(e.attributes.name)==="progid"||L(e.attributes.property).match(/^article:/)||L(e.attributes.property).match(/^product:/)))return true;if(t.headMetaVerification&&(L(e.attributes.name)==="google-site-verification"||L(e.attributes.name)==="yandex-verification"||L(e.attributes.name)==="csrf-token"||L(e.attributes.name)==="p:domain_verify"||L(e.attributes.name)==="verify-v1"||L(e.attributes.name)==="verification"||L(e.attributes.name)==="shopify-checkout-api-token"))return true}}return false}function me(e,t){let{doc:r,mirror:n,blockClass:s,blockSelector:o,maskTextClass:a,maskTextSelector:c,skipChild:i=false,inlineStylesheet:p=true,maskInputOptions:u={},maskTextFn:d,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m={},inlineImages:l=false,recordCanvas:b=false,onSerialize:I,onIframeLoad:S,iframeLoadTimeout:g=5e3,onStylesheetLoad:v,stylesheetLoadTimeout:N=5e3,keepIframeSrcFn:D=()=>false,newlyAddedElement:B=false,cssCaptured:X=false}=t,{needsMask:V}=t,{preserveWhiteSpace:q=true}=t;V||(V=nr(e,a,c,V===void 0));let j=Rn(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:V,inlineStylesheet:p,maskInputOptions:u,maskTextFn:d,maskInputFn:f,dataURLOptions:m,inlineImages:l,recordCanvas:b,keepIframeSrcFn:D,newlyAddedElement:B,cssCaptured:X});if(!j)return console.warn(e,"not serialized"),null;let Y;n.hasNode(e)?Y=n.getId(e):Tn(j,h)||!q&&j.type===H.Text&&!j.textContent.replace(/^\s+|\s+$/gm,"").length?Y=He:Y=er();let R=Object.assign(j,{id:Y});if(n.add(e,R),Y===He)return null;I&&I(e);let te=!i;if(R.type===H.Element){te=te&&!R.needBlock,delete R.needBlock;let A=w.shadowRoot(e);A&&we(A)&&(R.isShadowHost=true);}if((R.type===H.Document||R.type===H.Element)&&te){h.headWhitespace&&R.type===H.Element&&R.tagName==="head"&&(q=false);let A={doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:V,maskTextClass:a,maskTextSelector:c,skipChild:i,inlineStylesheet:p,maskInputOptions:u,maskTextFn:d,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m,inlineImages:l,recordCanvas:b,preserveWhiteSpace:q,onSerialize:I,onIframeLoad:S,iframeLoadTimeout:g,onStylesheetLoad:v,stylesheetLoadTimeout:N,keepIframeSrcFn:D,cssCaptured:false};if(!(R.type===H.Element&&R.tagName==="textarea"&&R.attributes.value!==void 0)){R.type===H.Element&&R.attributes._cssText!==void 0&&typeof R.attributes._cssText=="string"&&(A.cssCaptured=true);for(let M of Array.from(w.childNodes(e))){let O=me(M,A);O&&R.childNodes.push(O);}}let C=null;if(Jt(e)&&(C=w.shadowRoot(e)))for(let M of Array.from(w.childNodes(C))){let O=me(M,A);O&&(we(C)&&(O.isShadow=true),R.childNodes.push(O));}}let oe=w.parentNode(e);return oe&&Se(oe)&&we(oe)&&(R.isShadow=true),R.type===H.Element&&R.tagName==="iframe"&&In(e,()=>{let A=e.contentDocument;if(A&&S){let C=me(A,{doc:A,mirror:n,blockClass:s,blockSelector:o,needsMask:V,maskTextClass:a,maskTextSelector:c,skipChild:false,inlineStylesheet:p,maskInputOptions:u,maskTextFn:d,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m,inlineImages:l,recordCanvas:b,preserveWhiteSpace:q,onSerialize:I,onIframeLoad:S,iframeLoadTimeout:g,onStylesheetLoad:v,stylesheetLoadTimeout:N,keepIframeSrcFn:D});C&&S(e,C);}},g),R.type===H.Element&&R.tagName==="link"&&typeof R.attributes.rel=="string"&&(R.attributes.rel==="stylesheet"||R.attributes.rel==="preload"&&typeof R.attributes.href=="string"&&Zt(R.attributes.href)==="css")&&xn(e,()=>{if(v){let A=me(e,{doc:r,mirror:n,blockClass:s,blockSelector:o,needsMask:V,maskTextClass:a,maskTextSelector:c,skipChild:false,inlineStylesheet:p,maskInputOptions:u,maskTextFn:d,maskInputFn:f,slimDOMOptions:h,dataURLOptions:m,inlineImages:l,recordCanvas:b,preserveWhiteSpace:q,onSerialize:I,onIframeLoad:S,iframeLoadTimeout:g,onStylesheetLoad:v,stylesheetLoadTimeout:N,keepIframeSrcFn:D});A&&v(e,A);}},N),R}function Nn(e,t){let{mirror:r=new Fe,blockClass:n="rr-block",blockSelector:s=null,maskTextClass:o="rr-mask",maskTextSelector:a=null,inlineStylesheet:c=true,inlineImages:i=false,recordCanvas:p=false,maskAllInputs:u=false,maskTextFn:d,maskInputFn:f,slimDOM:h=false,dataURLOptions:m,preserveWhiteSpace:l,onSerialize:b,onIframeLoad:I,iframeLoadTimeout:S,onStylesheetLoad:g,stylesheetLoadTimeout:v,keepIframeSrcFn:N=()=>false}=t,D=u===true?{color:true,date:true,"datetime-local":true,email:true,month:true,number:true,range:true,search:true,tel:true,text:true,time:true,url:true,week:true,textarea:true,select:true,password:true}:u===false?{password:true}:u,B=sr(h);return me(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:false,inlineStylesheet:c,maskInputOptions:D,maskTextFn:d,maskInputFn:f,slimDOMOptions:B,dataURLOptions:m,inlineImages:i,recordCanvas:p,preserveWhiteSpace:l,onSerialize:b,onIframeLoad:I,iframeLoadTimeout:S,onStylesheetLoad:g,stylesheetLoadTimeout:v,keepIframeSrcFn:N,newlyAddedElement:false})}function z(e,t,r=document){let n={capture:true,passive:true};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}function Me(e,t,r={}){let n=null,s=0;return function(...o){let a=Date.now();!s&&r.leading===false&&(s=a);let c=t-(a-s),i=this;c<=0||c>t?(n&&(clearTimeout(n),n=null),s=a,e.apply(i,o)):!n&&r.trailing!==false&&(n=setTimeout(()=>{s=r.leading===false?0:Date.now(),n=null,e.apply(i,o);},c));}}function ze(e,t,r,n,s=window){let o=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,n?r:{set(a){setTimeout(()=>{r.set.call(this,a);},0),o&&o.set&&o.set.call(this,a);}}),()=>ze(e,t,o||{},true)}function or(e){var t,r,n,s;let o=e.document;return {left:o.scrollingElement?o.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:o.documentElement.scrollLeft||(o==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)&&((n=w.parentElement(o.body))==null?void 0:n.scrollTop)||((s=o==null?void 0:o.body)==null?void 0:s.scrollTop)||0}}function ir(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ar(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function lr(e){return e?e.nodeType===e.ELEMENT_NODE?e:w.parentElement(e):null}function G(e,t,r,n){if(!e)return false;let s=lr(e);if(!s)return false;try{if(typeof t=="string"){if(s.classList.contains(t)||n&&s.closest("."+t)!==null)return !0}else if(Be(s,t,n))return !0}catch(o){}return !!(r&&(s.matches(r)||n&&s.closest(r)!==null))}function _n(e,t){return t.getId(e)!==-1}function tt(e,t,r){return e.tagName==="TITLE"&&r.headTitleMutations?true:t.getId(e)===He}function cr(e,t){if(Se(e))return false;let r=t.getId(e);if(!t.has(r))return true;let n=w.parentNode(e);return n&&n.nodeType===e.DOCUMENT_NODE?false:n?cr(n,t):true}function ot(e){return !!e.changedTouches}function Ln(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 ur(e,t){return !!(e.nodeName==="IFRAME"&&t.getMeta(e))}function dr(e,t){return !!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function it(e){return e?e instanceof st&&"shadowRoot"in e?!!e.shadowRoot:!!w.shadowRoot(e):false}function pr(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 Dn(e){let t=e,r;for(;r=pr(t);)t=r;return t}function An(e){let t=w.ownerDocument(e);if(!t)return false;let r=Dn(e);return w.contains(t,r)}function hr(e){let t=w.ownerDocument(e);return t?w.contains(t,e)||An(e):false}function ct(e,t){e.delete(t),w.childNodes(t).forEach(r=>ct(e,r));}function Fn(e,t){let r=[e];for(;r.length;){let n=r.pop();t.has(n)||(t.add(n),w.childNodes(n).forEach(s=>r.push(s)));}}function $t(e,t){return e.size===0?false:fr(e,t)}function fr(e,t){if(e.has(t))return true;let r=w.parentNode(t);return r?fr(e,r):false}function Pn(e){Ce=e;}function Un(){Ce=void 0;}function Ie(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(t){}return e&&e.target}function mr(e,t){let r=new lt;le.push(r),r.init(e);let[n,s]=Yt(),o=new n(k(r.processMutations.bind(r)));return o.observe(t,{attributes:true,attributeOldValue:true,characterData:true,characterDataOldValue:true,childList:true,subtree:true}),[o,s]}function Wn({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===false)return ()=>{};let s=typeof t.mousemove=="number"?t.mousemove:50,o=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,a=[],c,i=Me(k(d=>{let f=Date.now()-c;e(a.map(h=>(h.timeOffset-=f,h)),d),a=[],c=null;}),o),p=k(Me(k(d=>{let f=Ie(d),{clientX:h,clientY:m}=ot(d)?d.changedTouches[0]:d;c||(c=ve()),a.push({x:h,y:m,id:n.getId(f),timeOffset:ve()-c}),i(typeof DragEvent!="undefined"&&d instanceof DragEvent?x.Drag:d instanceof MouseEvent?x.MouseMove:x.TouchMove);}),s,{trailing:!1})),u=[z("mousemove",p,r),z("touchmove",p,r),z("drag",p,r)];return k(()=>{u.forEach(d=>d());})}function Hn({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:o}){if(o.mouseInteraction===false)return ()=>{};let a=o.mouseInteraction===true||o.mouseInteraction===void 0?{}:o.mouseInteraction,c=[],i=null,p=u=>d=>{let f=Ie(d);if(G(f,n,s,true))return;let h=null,m=u;if("pointerType"in d){switch(d.pointerType){case "mouse":h=re.Mouse;break;case "touch":h=re.Touch;break;case "pen":h=re.Pen;break}h===re.Touch?K[u]===K.MouseDown?m="TouchStart":K[u]===K.MouseUp&&(m="TouchEnd"):re.Pen;}else ot(d)&&(h=re.Touch);h!==null?(i=h,(m.startsWith("Touch")&&h===re.Touch||m.startsWith("Mouse")&&h===re.Mouse)&&(h=null)):K[u]===K.Click&&(h=i,i=null);let l=ot(d)?d.changedTouches[0]:d;if(!l)return;let b=r.getId(f),{clientX:I,clientY:S}=l;k(e)({type:K[m],id:b,x:I,y:S,...h!==null&&{pointerType:h}});};return Object.keys(K).filter(u=>Number.isNaN(Number(u))&&!u.endsWith("_Departed")&&a[u]!==false).forEach(u=>{let d=se(u),f=p(u);if(window.PointerEvent)switch(K[u]){case K.MouseDown:case K.MouseUp:d=d.replace("mouse","pointer");break;case K.TouchStart:case K.TouchEnd:return}c.push(z(d,f,t));}),k(()=>{c.forEach(u=>u());})}function gr({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:o}){let a=k(Me(k(c=>{let i=Ie(c);if(!i||G(i,n,s,!0))return;let p=r.getId(i);if(i===t&&t.defaultView){let u=or(t.defaultView);e({id:p,x:u.left,y:u.top});}else e({id:p,x:i.scrollLeft,y:i.scrollTop});}),o.scroll||100));return z("scroll",a,t)}function Bn({viewportResizeCb:e},{win:t}){let r=-1,n=-1,s=k(Me(k(()=>{let o=ir(),a=ar();(r!==o||n!==a)&&(e({width:Number(a),height:Number(o)}),r=o,n=a);}),200));return z("resize",s,t)}function Vn({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,ignoreClass:o,ignoreSelector:a,maskInputOptions:c,maskInputFn:i,sampling:p,userTriggeredOnInput:u}){function d(S){let g=Ie(S),v=S.isTrusted,N=g&&g.tagName;if(g&&N==="OPTION"&&(g=w.parentElement(g)),!g||!N||$n.indexOf(N)<0||G(g,n,s,true)||g.classList.contains(o)||a&&g.matches(a))return;let D=g.value,B=false,X=Ue(g)||"";X==="radio"||X==="checkbox"?B=g.checked:(c[N.toLowerCase()]||c[X])&&(D=Pe({element:g,maskInputOptions:c,tagName:N,type:X,value:D,maskInputFn:i})),f(g,u?{text:D,isChecked:B,userTriggered:v}:{text:D,isChecked:B});let V=g.name;X==="radio"&&V&&B&&t.querySelectorAll(`input[type="radio"][name="${V}"]`).forEach(q=>{if(q!==g){let j=q.value;f(q,u?{text:j,isChecked:!B,userTriggered:false}:{text:j,isChecked:!B});}});}function f(S,g){let v=Vt.get(S);if(!v||v.text!==g.text||v.isChecked!==g.isChecked){Vt.set(S,g);let N=r.getId(S);k(e)({...g,id:N});}}let m=(p.input==="last"?["change"]:["input","change"]).map(S=>z(S,k(d),t)),l=t.defaultView;if(!l)return ()=>{m.forEach(S=>S());};let b=l.Object.getOwnPropertyDescriptor(l.HTMLInputElement.prototype,"value"),I=[[l.HTMLInputElement.prototype,"value"],[l.HTMLInputElement.prototype,"checked"],[l.HTMLSelectElement.prototype,"value"],[l.HTMLTextAreaElement.prototype,"value"],[l.HTMLSelectElement.prototype,"selectedIndex"],[l.HTMLOptionElement.prototype,"selected"]];return b&&b.set&&m.push(...I.map(S=>ze(S[0],S[1],{set(){k(d)({target:this,isTrusted:false});}},false,l))),k(()=>{m.forEach(S=>S());})}function $e(e){let t=[];function r(n,s){if(_e("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||_e("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||_e("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||_e("CSSConditionRule")&&n.parentRule instanceof CSSConditionRule){let a=Array.from(n.parentRule.cssRules).indexOf(n);return s.unshift(a),r(n.parentRule,s)}else if(n.parentStyleSheet){let a=Array.from(n.parentStyleSheet.cssRules).indexOf(n);s.unshift(a);}return s}return r(e,t)}function ne(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function jn({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return ()=>{};let s=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:k((u,d,f)=>{let[h,m]=f,{id:l,styleId:b}=ne(d,t,r.styleMirror);return (l&&l!==-1||b&&b!==-1)&&e({id:l,styleId:b,adds:[{rule:h,index:m}]}),u.apply(d,f)})}),n.CSSStyleSheet.prototype.addRule=function(u,d,f=this.cssRules.length){let h=`${u} { ${d} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[h,f])};let o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:k((u,d,f)=>{let[h]=f,{id:m,styleId:l}=ne(d,t,r.styleMirror);return (m&&m!==-1||l&&l!==-1)&&e({id:m,styleId:l,removes:[{index:h}]}),u.apply(d,f)})}),n.CSSStyleSheet.prototype.removeRule=function(u){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[u])};let a;n.CSSStyleSheet.prototype.replace&&(a=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:k((u,d,f)=>{let[h]=f,{id:m,styleId:l}=ne(d,t,r.styleMirror);return (m&&m!==-1||l&&l!==-1)&&e({id:m,styleId:l,replace:h}),u.apply(d,f)})}));let c;n.CSSStyleSheet.prototype.replaceSync&&(c=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:k((u,d,f)=>{let[h]=f,{id:m,styleId:l}=ne(d,t,r.styleMirror);return (m&&m!==-1||l&&l!==-1)&&e({id:m,styleId:l,replaceSync:h}),u.apply(d,f)})}));let i={};Le("CSSGroupingRule")?i.CSSGroupingRule=n.CSSGroupingRule:(Le("CSSMediaRule")&&(i.CSSMediaRule=n.CSSMediaRule),Le("CSSConditionRule")&&(i.CSSConditionRule=n.CSSConditionRule),Le("CSSSupportsRule")&&(i.CSSSupportsRule=n.CSSSupportsRule));let p={};return Object.entries(i).forEach(([u,d])=>{p[u]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=new Proxy(p[u].insertRule,{apply:k((f,h,m)=>{let[l,b]=m,{id:I,styleId:S}=ne(h.parentStyleSheet,t,r.styleMirror);return (I&&I!==-1||S&&S!==-1)&&e({id:I,styleId:S,adds:[{rule:l,index:[...$e(h),b||0]}]}),f.apply(h,m)})}),d.prototype.deleteRule=new Proxy(p[u].deleteRule,{apply:k((f,h,m)=>{let[l]=m,{id:b,styleId:I}=ne(h.parentStyleSheet,t,r.styleMirror);return (b&&b!==-1||I&&I!==-1)&&e({id:b,styleId:I,removes:[{index:[...$e(h),l]}]}),f.apply(h,m)})});}),k(()=>{n.CSSStyleSheet.prototype.insertRule=s,n.CSSStyleSheet.prototype.deleteRule=o,a&&(n.CSSStyleSheet.prototype.replace=a),c&&(n.CSSStyleSheet.prototype.replaceSync=c),Object.entries(i).forEach(([u,d])=>{d.prototype.insertRule=p[u].insertRule,d.prototype.deleteRule=p[u].deleteRule;});})}function yr({mirror:e,stylesheetManager:t},r){var n,s,o;let a=null;r.nodeName==="#document"?a=e.getId(r):a=e.getId(w.host(r));let c=r.nodeName==="#document"?(n=r.defaultView)==null?void 0:n.Document:(o=(s=r.ownerDocument)==null?void 0:s.defaultView)==null?void 0:o.ShadowRoot,i=c!=null&&c.prototype?Object.getOwnPropertyDescriptor(c==null?void 0:c.prototype,"adoptedStyleSheets"):void 0;return a===null||a===-1||!c||!i?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){var p;return (p=i.get)==null?void 0:p.call(this)},set(p){var u;let d=(u=i.set)==null?void 0:u.call(this,p);if(a!==null&&a!==-1)try{t.adoptStyleSheets(p,a);}catch(f){}return d}}),k(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set});}))}function zn({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:s}){let o=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:k((c,i,p)=>{var u;let[d,f,h]=p;if(r.has(d))return o.apply(i,[d,f,h]);let{id:m,styleId:l}=ne((u=i.parentRule)==null?void 0:u.parentStyleSheet,t,n.styleMirror);return (m&&m!==-1||l&&l!==-1)&&e({id:m,styleId:l,set:{property:d,value:f,priority:h},index:$e(i.parentRule)}),c.apply(i,p)})});let a=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:k((c,i,p)=>{var u;let[d]=p;if(r.has(d))return a.apply(i,[d]);let{id:f,styleId:h}=ne((u=i.parentRule)==null?void 0:u.parentStyleSheet,t,n.styleMirror);return (f&&f!==-1||h&&h!==-1)&&e({id:f,styleId:h,remove:{property:d},index:$e(i.parentRule)}),c.apply(i,p)})}),k(()=>{s.CSSStyleDeclaration.prototype.setProperty=o,s.CSSStyleDeclaration.prototype.removeProperty=a;})}function Gn({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:s,doc:o}){let a=k(i=>Me(k(p=>{let u=Ie(p);if(!u||G(u,t,r,!0))return;let{currentTime:d,volume:f,muted:h,playbackRate:m,loop:l}=u;e({type:i,id:n.getId(u),currentTime:d,volume:f,muted:h,playbackRate:m,loop:l});}),s.media||500)),c=[z("play",a(pe.Play),o),z("pause",a(pe.Pause),o),z("seeked",a(pe.Seeked),o),z("volumechange",a(pe.VolumeChange),o),z("ratechange",a(pe.RateChange),o)];return k(()=>{c.forEach(i=>i());})}function qn({fontCb:e,doc:t}){let r=t.defaultView;if(!r)return ()=>{};let n=[],s=new WeakMap,o=r.FontFace;r.FontFace=function(i,p,u){let d=new o(i,p,u);return s.set(d,{family:i,buffer:typeof p!="string",descriptors:u,fontSource:typeof p=="string"?p:JSON.stringify(Array.from(new Uint8Array(p)))}),d};let a=ce(t.fonts,"add",function(c){return function(i){return setTimeout(k(()=>{let p=s.get(i);p&&(e(p),s.delete(i));}),0),c.apply(this,[i])}});return n.push(()=>{r.FontFace=o;}),n.push(a),k(()=>{n.forEach(c=>c());})}function Kn(e){let{doc:t,mirror:r,blockClass:n,blockSelector:s,selectionCb:o}=e,a=true,c=k(()=>{let i=t.getSelection();if(!i||a&&(i!=null&&i.isCollapsed))return;a=i.isCollapsed||false;let p=[],u=i.rangeCount||0;for(let d=0;d<u;d++){let f=i.getRangeAt(d),{startContainer:h,startOffset:m,endContainer:l,endOffset:b}=f;G(h,n,s,!0)||G(l,n,s,!0)||p.push({start:r.getId(h),startOffset:m,end:r.getId(l),endOffset:b});}o({ranges:p});});return c(),z("selectionchange",c)}function Xn({doc:e,customElementCb:t}){let r=e.defaultView;return !r||!r.customElements?()=>{}:ce(r.customElements,"define",function(s){return function(o,a,c){try{t({define:{name:o}});}catch(i){console.warn(`Custom element callback failed for ${o}`);}return s.apply(this,[o,a,c])}})}function Yn(e,t){let{mutationCb:r,mousemoveCb:n,mouseInteractionCb:s,scrollCb:o,viewportResizeCb:a,inputCb:c,mediaInteractionCb:i,styleSheetRuleCb:p,styleDeclarationCb:u,canvasMutationCb:d,fontCb:f,selectionCb:h,customElementCb:m}=e;e.mutationCb=(...l)=>{t.mutation&&t.mutation(...l),r(...l);},e.mousemoveCb=(...l)=>{t.mousemove&&t.mousemove(...l),n(...l);},e.mouseInteractionCb=(...l)=>{t.mouseInteraction&&t.mouseInteraction(...l),s(...l);},e.scrollCb=(...l)=>{t.scroll&&t.scroll(...l),o(...l);},e.viewportResizeCb=(...l)=>{t.viewportResize&&t.viewportResize(...l),a(...l);},e.inputCb=(...l)=>{t.input&&t.input(...l),c(...l);},e.mediaInteractionCb=(...l)=>{t.mediaInteaction&&t.mediaInteaction(...l),i(...l);},e.styleSheetRuleCb=(...l)=>{t.styleSheetRule&&t.styleSheetRule(...l),p(...l);},e.styleDeclarationCb=(...l)=>{t.styleDeclaration&&t.styleDeclaration(...l),u(...l);},e.canvasMutationCb=(...l)=>{t.canvasMutation&&t.canvasMutation(...l),d(...l);},e.fontCb=(...l)=>{t.font&&t.font(...l),f(...l);},e.selectionCb=(...l)=>{t.selection&&t.selection(...l),h(...l);},e.customElementCb=(...l)=>{t.customElement&&t.customElement(...l),m(...l);};}function Jn(e,t={}){let r=e.doc.defaultView;if(!r)return ()=>{};Yn(e,t);let n,s=()=>{};e.recordDOM&&([n,s]=mr(e,e.doc));let o=Wn(e),a=Hn(e),c=gr(e),i=Bn(e,{win:r}),p=Vn(e),u=Gn(e),d=()=>{},f=()=>{},h=()=>{},m=()=>{};e.recordDOM&&(d=jn(e,{win:r}),f=yr(e,e.doc),h=zn(e,{win:r}),e.collectFonts&&(m=qn(e)));let l=Kn(e),b=Xn(e),I=[];for(let S of e.plugins)I.push(S.observer(S.callback,r,S.options));return k(()=>{le.forEach(S=>S.reset()),n==null||n.disconnect(),s(),o(),a(),c(),i(),p(),u(),d(),f(),h(),m(),l(),b(),I.forEach(S=>S());})}function _e(e){return typeof window[e]!="undefined"}function Le(e){return !!(typeof window[e]!="undefined"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}function es(e,t){let r=jt.get(e);return r||(r=new Map,jt.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}function De(e,t,r){if(e instanceof Array)return e.map(n=>De(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return {rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){let n=e.constructor.name,s=Zn(e);return {rr_type:n,base64:s}}else {if(e instanceof DataView)return {rr_type:e.constructor.name,args:[De(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let n=e.constructor.name,{src:s}=e;return {rr_type:n,src:s}}else if(e instanceof HTMLCanvasElement){let n="HTMLImageElement",s=e.toDataURL();return {rr_type:n,src:s}}else {if(e instanceof ImageData)return {rr_type:e.constructor.name,args:[De(e.data,t,r),e.width,e.height]};if(wr(e,t)||typeof e=="object"){let n=e.constructor.name,s=br(e,t,r);return {rr_type:n,index:s}}}}return e}function ts(e,t,r,n){let s=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let a of o)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;let c=ce(t.CanvasRenderingContext2D.prototype,a,function(i){return function(...p){return G(this.canvas,r,n,!0)||setTimeout(()=>{let u=Sr(p,t,this);e(this.canvas,{type:ye["2D"],property:a,args:u});},0),i.apply(this,p)}});s.push(c);}catch(c){let i=ze(t.CanvasRenderingContext2D.prototype,a,{set(p){e(this.canvas,{type:ye["2D"],property:a,args:[p],setter:true});}});s.push(i);}return ()=>{s.forEach(a=>a());}}function rs(e){return e==="experimental-webgl"?"webgl":e}function zt(e,t,r,n){let s=[];try{let o=ce(e.HTMLCanvasElement.prototype,"getContext",function(a){return function(c,...i){if(!G(this,t,r,!0)){let p=rs(c);if("__context"in this||(this.__context=p),n&&["webgl","webgl2"].includes(p))if(i[0]&&typeof i[0]=="object"){let u=i[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0);}else i.splice(0,1,{preserveDrawingBuffer:!0});}return a.apply(this,[c,...i])}});s.push(o);}catch(o){console.error("failed to patch HTMLCanvasElement.prototype.getContext");}return ()=>{s.forEach(o=>o());}}function Gt(e,t,r,n,s,o){let a=[],c=Object.getOwnPropertyNames(e);for(let i of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(i))try{if(typeof e[i]!="function")continue;let p=ce(e,i,function(u){return function(...d){let f=u.apply(this,d);if(br(f,o,this),"tagName"in this.canvas&&!G(this.canvas,n,s,!0)){let h=Sr(d,o,this),m={type:t,property:i,args:h};r(this.canvas,m);}return f}});a.push(p);}catch(p){let u=ze(e,i,{set(d){r(this.canvas,{type:t,property:i,args:[d],setter:true});}});a.push(u);}return a}function ns(e,t,r,n){let s=[];return typeof t.WebGLRenderingContext!="undefined"&&s.push(...Gt(t.WebGLRenderingContext.prototype,ye.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext!="undefined"&&s.push(...Gt(t.WebGL2RenderingContext.prototype,ye.WebGL2,e,r,n,t)),()=>{s.forEach(o=>o());}}function ss(e){let t;try{if(t=qt&&(self.URL||self.webkitURL).createObjectURL(qt),!t)throw "";let r=new Worker(t,{name:e==null?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t);}),r}catch(r){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Cr),{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t);}}function xe(e={}){let{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,maskTextClass:i="rr-mask",maskTextSelector:p=null,inlineStylesheet:u=true,maskAllInputs:d,maskInputOptions:f,slimDOMOptions:h,maskInputFn:m,maskTextFn:l,hooks:b,packFn:I,sampling:S={},dataURLOptions:g={},mousemoveWait:v,recordDOM:N=true,recordCanvas:D=false,recordCrossOriginIframes:B=false,recordAfter:X=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:V=false,collectFonts:q=false,inlineImages:j=false,plugins:Y,keepIframeSrcFn:R=()=>false,ignoreCSSAttributes:te=new Set([]),errorHandler:oe}=e;Pn(oe);let A=B?window.parent===window:true,C=false;if(!A)try{window.parent.document&&(C=!1);}catch(T){C=true;}if(A&&!t)throw new Error("emit function is required");if(!A&&!C)return ()=>{};v!==void 0&&S.mousemove===void 0&&(S.mousemove=v),ee.reset();let M=d===true?{color:true,date:true,"datetime-local":true,email:true,month:true,number:true,range:true,search:true,tel:true,text:true,time:true,url:true,week:true,textarea:true,select:true,password:true}:f!==void 0?f:{password:true},O=sr(h);Ln();let W,$=0,ue=T=>{for(let Z of Y||[])Z.eventProcessor&&(T=Z.eventProcessor(T));return I&&!C&&(T=I(T)),T};U=(T,Z)=>{var F;let P=T;if(P.timestamp=ve(),(F=le[0])!=null&&F.isFrozen()&&P.type!==E.FullSnapshot&&!(P.type===E.IncrementalSnapshot&&P.data.source===x.Mutation)&&le.forEach(J=>J.unfreeze()),A)t==null||t(ue(P),Z);else if(C){let J={type:"rrweb",event:ue(P),origin:window.location.origin,isCheckout:Z};window.parent.postMessage(J,"*");}if(P.type===E.FullSnapshot)W=P,$=0;else if(P.type===E.IncrementalSnapshot){if(P.data.source===x.Mutation&&P.data.isAttachIframe)return;$++;let J=n&&$>=n,_=r&&P.timestamp-W.timestamp>r;(J||_)&&Ae(true);}};let Re=T=>{U({type:E.IncrementalSnapshot,data:{source:x.Mutation,...T}});},bt=T=>U({type:E.IncrementalSnapshot,data:{source:x.Scroll,...T}}),St=T=>U({type:E.IncrementalSnapshot,data:{source:x.CanvasMutation,...T}}),xr=T=>U({type:E.IncrementalSnapshot,data:{source:x.AdoptedStyleSheet,...T}}),ie=new ht({mutationCb:Re,adoptedStyleSheetCb:xr}),ae=new ut({mirror:ee,mutationCb:Re,stylesheetManager:ie,recordCrossOriginIframes:B,wrappedEmit:U});for(let T of Y||[])T.getMirror&&T.getMirror({nodeMirror:ee,crossOriginIframeMirror:ae.crossOriginIframeMirror,crossOriginIframeStyleMirror:ae.crossOriginIframeStyleMirror});let qe=new ft;rt=new pt({recordCanvas:D,mutationCb:St,win:window,blockClass:s,blockSelector:o,mirror:ee,sampling:S.canvas,dataURLOptions:g});let ke=new dt({mutationCb:Re,scrollCb:bt,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:i,maskTextSelector:p,inlineStylesheet:u,maskInputOptions:M,dataURLOptions:g,maskTextFn:l,maskInputFn:m,recordCanvas:D,inlineImages:j,sampling:S,slimDOMOptions:O,iframeManager:ae,stylesheetManager:ie,canvasManager:rt,keepIframeSrcFn:R,processedNodeManager:qe},mirror:ee});Ae=(T=false)=>{if(!N)return;U({type:E.Meta,data:{href:window.location.href,width:ar(),height:ir()}},T),ie.reset(),ke.init(),le.forEach(F=>F.lock());let Z=Nn(document,{mirror:ee,blockClass:s,blockSelector:o,maskTextClass:i,maskTextSelector:p,inlineStylesheet:u,maskAllInputs:M,maskTextFn:l,maskInputFn:m,slimDOM:O,dataURLOptions:g,recordCanvas:D,inlineImages:j,onSerialize:F=>{ur(F,ee)&&ae.addIframe(F),dr(F,ee)&&ie.trackLinkElement(F),it(F)&&ke.addShadowRoot(w.shadowRoot(F),document);},onIframeLoad:(F,P)=>{ae.attachIframe(F,P),ke.observeAttachShadow(F);},onStylesheetLoad:(F,P)=>{ie.attachLinkElement(F,P);},keepIframeSrcFn:R});if(!Z)return console.warn("Failed to snapshot the document");U({type:E.FullSnapshot,data:{node:Z,initialOffset:or(window)}},T),le.forEach(F=>F.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ie.adoptStyleSheets(document.adoptedStyleSheets,ee.getId(document));};try{let T=[],Z=P=>{var J;return k(Jn)({mutationCb:Re,mousemoveCb:(_,Ke)=>U({type:E.IncrementalSnapshot,data:{source:Ke,positions:_}}),mouseInteractionCb:_=>U({type:E.IncrementalSnapshot,data:{source:x.MouseInteraction,..._}}),scrollCb:bt,viewportResizeCb:_=>U({type:E.IncrementalSnapshot,data:{source:x.ViewportResize,..._}}),inputCb:_=>U({type:E.IncrementalSnapshot,data:{source:x.Input,..._}}),mediaInteractionCb:_=>U({type:E.IncrementalSnapshot,data:{source:x.MediaInteraction,..._}}),styleSheetRuleCb:_=>U({type:E.IncrementalSnapshot,data:{source:x.StyleSheetRule,..._}}),styleDeclarationCb:_=>U({type:E.IncrementalSnapshot,data:{source:x.StyleDeclaration,..._}}),canvasMutationCb:St,fontCb:_=>U({type:E.IncrementalSnapshot,data:{source:x.Font,..._}}),selectionCb:_=>{U({type:E.IncrementalSnapshot,data:{source:x.Selection,..._}});},customElementCb:_=>{U({type:E.IncrementalSnapshot,data:{source:x.CustomElement,..._}});},blockClass:s,ignoreClass:a,ignoreSelector:c,maskTextClass:i,maskTextSelector:p,maskInputOptions:M,inlineStylesheet:u,sampling:S,recordDOM:N,recordCanvas:D,inlineImages:j,userTriggeredOnInput:V,collectFonts:q,doc:P,maskInputFn:m,maskTextFn:l,keepIframeSrcFn:R,blockSelector:o,slimDOMOptions:O,dataURLOptions:g,mirror:ee,iframeManager:ae,stylesheetManager:ie,shadowDomManager:ke,processedNodeManager:qe,canvasManager:rt,ignoreCSSAttributes:te,plugins:((J=Y==null?void 0:Y.filter(_=>_.observer))==null?void 0:J.map(_=>({observer:_.observer,options:_.options,callback:Ke=>U({type:E.Plugin,data:{plugin:_.name,payload:Ke}})})))||[]},b)};ae.addLoadListener(P=>{try{T.push(Z(P.contentDocument));}catch(J){console.warn(J);}});let F=()=>{Ae(),T.push(Z(document)),je=!0;};return ["interactive","complete"].includes(document.readyState)?F():(T.push(z("DOMContentLoaded",()=>{U({type:E.DomContentLoaded,data:{}}),X==="DOMContentLoaded"&&F();})),T.push(z("load",()=>{U({type:E.Load,data:{}}),X==="load"&&F();},window))),()=>{T.forEach(P=>{try{P();}catch(J){String(J).toLowerCase().includes("cross-origin")||console.warn(J);}}),qe.destroy(),je=!1,Un();}}catch(T){console.warn(T);}}var Fr,Pr,y,Dt,E,x,K,re,ye,pe,H,At,Ft,Te,Kt,Ur,Ze,et,ve,w,Fe,Pt,un,dn,pn,hn,gn,yn,He,de,Ut,Sn,wn,Wt,st,he,Ht,at,Bt,lt,Ce,k,le,$n,Vt,Ve,ut,dt,ge,Qn,be,Zn,jt,br,Sr,wr,Cr,qt,pt,ht,ft,U,Ae,rt,je,ee,Mr=kr(()=>{Fr=Object.defineProperty,Pr=(e,t,r)=>t in e?Fr(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r,y=(e,t,r)=>Pr(e,typeof t!="symbol"?t+"":t,r),E=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e[e.Asset=7]="Asset",e))(E||{}),x=(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))(x||{}),K=(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))(K||{}),re=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(re||{}),ye=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ye||{}),pe=(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))(pe||{}),H=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(H||{}),At={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ft={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Te={},Kt={},Ur=()=>!!globalThis.Zone;Ze={};et={};ve=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(ve=()=>new Date().getTime());w={ownerDocument:Wr,childNodes:Hr,parentNode:Br,parentElement:$r,textContent:Vr,firstChild:jr,lastChild:zr,nextSibling:Gr,previousSibling:qr,contains:Kr,getRootNode:Xr,host:Yr,styleSheets:Jr,shadowRoot:Qr,querySelector:Zr,querySelectorAll:en,nowTimestamp:ve,mutationObserverCtor:Yt,patch:ce};Fe=class{constructor(){y(this,"idNodeMap",new Map),y(this,"nodeMetaMap",new WeakMap);}getId(t){var r;if(!t)return -1;let n=(r=this.getMeta(t))==null?void 0:r.id;return n!=null?n:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){let r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n));}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r);}replace(t,r){let n=this.getNode(t);if(n){let s=this.nodeMetaMap.get(n);s&&this.nodeMetaMap.set(r,s);}this.idNodeMap.set(t,r);}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap;}};Pt="__rrweb_original__";un=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,dn=/^(?:[a-z+]+:)?\/\//i,pn=/^www\..*/i,hn=/^(data:)([^,]*),(.*)/i;gn=1,yn=new RegExp("[^a-z0-9-_:]"),He=-2;Sn=/^[^ \t\n\r\u000c]+/,wn=/^[, \t\n\r\u000c]+/;Wt=new WeakMap;st=class e{constructor(...t){y(this,"parentElement",null),y(this,"parentNode",null),y(this,"ownerDocument"),y(this,"firstChild",null),y(this,"lastChild",null),y(this,"previousSibling",null),y(this,"nextSibling",null),y(this,"ELEMENT_NODE",1),y(this,"TEXT_NODE",3),y(this,"nodeType"),y(this,"nodeName"),y(this,"RRNodeType");}get childNodes(){let t=[],r=this.firstChild;for(;r;)t.push(r),r=r.nextSibling;return t}contains(t){if(t instanceof e){if(t.ownerDocument!==this.ownerDocument)return false;if(t===this)return true}else return false;for(;t.parentNode;){if(t.parentNode===this)return true;t=t.parentNode;}return false}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"}};he=`Please stop import mirror directly. Instead of that,\r
|
|
2
2
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
3
|
-
or you can use record.mirror to access the mirror instance during recording.`,Pt={map:{},getId(){return console.error(pe),-1},getNode(){return console.error(pe),null},removeNodeFromMap(){console.error(pe);},has(){return console.error(pe),false},reset(){console.error(pe);}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(Pt=new Proxy(Pt,{get(e,t,r){return t==="map"&&console.error(pe),Reflect.get(e,t,r)}}));ot=class{constructor(){y(this,"id",1),y(this,"styleIDMap",new WeakMap),y(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 n;return r===void 0?n=this.id++:n=r,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1;}generateId(){return this.id++}};Ut=(e,t)=>`${e}@${t}`,it=class{constructor(){y(this,"frozen",false),y(this,"locked",false),y(this,"texts",[]),y(this,"attributes",[]),y(this,"attributeMap",new WeakMap),y(this,"removes",[]),y(this,"mapRemoves",[]),y(this,"movedMap",{}),y(this,"addedSet",new Set),y(this,"movedSet",new Set),y(this,"droppedSet",new Set),y(this,"removesSubTreeCache",new Set),y(this,"mutationCb"),y(this,"blockClass"),y(this,"blockSelector"),y(this,"maskTextClass"),y(this,"maskTextSelector"),y(this,"inlineStylesheet"),y(this,"maskInputOptions"),y(this,"maskTextFn"),y(this,"maskInputFn"),y(this,"keepIframeSrcFn"),y(this,"recordCanvas"),y(this,"inlineImages"),y(this,"slimDOMOptions"),y(this,"dataURLOptions"),y(this,"doc"),y(this,"mirror"),y(this,"iframeManager"),y(this,"stylesheetManager"),y(this,"shadowDomManager"),y(this,"canvasManager"),y(this,"processedNodeManager"),y(this,"unattachedDoc"),y(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit();}),y(this,"emit",()=>{if(this.frozen||this.locked)return;let t=[],r=new Set;for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let f of this.movedSet){let h=C.parentNode(f);this.removesSubTreeCache.has(h)&&!this.movedSet.has(h)||this.addedSet.add(f);}let n=null,s=null,o=-1,a=null,c=false,i=new Set,p=this.addedSet.values(),u=p.next();for(;this.addedSet.size;){if(n!==null&&this.addedSet.has(C.previousSibling(n)))a=n,n=C.previousSibling(n);else {for(this.addedSet.has(u.value)||(u=p.next()),n=u.value;;){if(s=C.parentNode(n),this.addedSet.has(s)){n=s;continue}break}if(i.has(s))s=null;else if(s){if(ur(s)?(c=Wt(this.droppedSet,s)||this.removesSubTreeCache.has(s),c&&Wt(this.movedSet,n)&&(c=false)):c=true,this.addedSet.has(C.lastChild(s)))n=C.lastChild(s),a=null;else for(;;){if(a=C.nextSibling(n),this.addedSet.has(a)){n=a;continue}break}if(o=be(s)?this.mirror.getId(cr(n)):this.mirror.getId(s),o===-1&&s.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let l=C.host(s);o=this.mirror.getId(l);}}}if(this.addedSet.delete(n),!s||o===-1){i.add(n);continue}else if(c){this.droppedSet.add(n);continue}let f=false;if(n.nodeType===Node.TEXT_NODE){let l=s.tagName;if(l==="TEXTAREA")continue;l==="STYLE"&&r.has(o)&&(f=true);}let h=a?this.mirror.getId(a):null;for(;h===We;)a=a&&C.nextSibling(a),h=a&&this.mirror.getId(a);if(h===-1){console.warn("Couldn't record new node. Couldn't find mirror id for nextSibling:",a),n=null;continue}let m=fe(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:true,newlyAddedElement:true,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:l=>{ar(l,this.mirror)&&this.iframeManager.addIframe(l),lr(l,this.mirror)&&this.stylesheetManager.trackLinkElement(l),st(n)&&this.shadowDomManager.addShadowRoot(C.shadowRoot(n),this.doc);},onIframeLoad:(l,b)=>{this.iframeManager.attachIframe(l,b),this.shadowDomManager.observeAttachShadow(l);},onStylesheetLoad:(l,b)=>{this.stylesheetManager.attachLinkElement(l,b);},cssCaptured:f});m&&(t.push({parentId:o,nextId:h,node:m}),r.add(m.id));}let d={texts:this.texts.map(f=>{let h=f.node,m=C.parentNode(h);return m&&m.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(m),{id:this.mirror.getId(h),value:f.value}}).filter(f=>!r.has(f.id)).filter(f=>this.mirror.has(f.id)),attributes:this.attributes.map(f=>{let{attributes:h}=f;if(typeof h.style=="string"){let m=JSON.stringify(f.styleDiff),l=JSON.stringify(f._unchangedStyles);m.length<h.style.length&&(m+l).split("var(").length===h.style.split("var(").length&&(h.style=f.styleDiff);}return {id:this.mirror.getId(f.node),attributes:h}}).filter(f=>!r.has(f.id)).filter(f=>this.mirror.has(f.id)),removes:this.removes,adds:t};!d.texts.length&&!d.attributes.length&&!d.removes.length&&!d.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(d));}),y(this,"genTextAreaValueMutation",t=>{let r=this.attributeMap.get(t);r||(r={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(t,r));let n=Array.from(C.childNodes(t),s=>C.textContent(s)||"").join("");r.attributes.value=Fe({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Pe(t),value:n,maskInputFn:this.maskInputFn});}),y(this,"processMutation",t=>{if(!Ze(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case "characterData":{let r=C.textContent(t.target);!z(t.target,this.blockClass,this.blockSelector,false)&&r!==t.oldValue&&this.texts.push({value:er(t.target,this.maskTextClass,this.maskTextSelector,true)&&r?this.maskTextFn?this.maskTextFn(r,or(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case "attributes":{let r=t.target,n=ne(r.tagName),s=t.attributeName,o=t.target.getAttribute(s);if(s==="value"){let c=Pe(r);o=Fe({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:c,value:o,maskInputFn:this.maskInputFn});}if(z(t.target,this.blockClass,this.blockSelector,false)||o===t.oldValue)return;let a=this.attributeMap.get(t.target);if(n==="iframe"&&s==="src"&&!this.keepIframeSrcFn(o))if(!r.contentDocument)s="rr_src";else return;if(a||(a={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(a),this.attributeMap.set(t.target,a)),s==="type"&&n==="input"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!Zt(n,s))if(a.attributes[s]=Qt(this.doc,n,ne(s),o),s==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument();}catch(i){this.unattachedDoc=this.doc;}let c=this.unattachedDoc.createElement("span");t.oldValue&&c.setAttribute("style",t.oldValue);for(let i of Array.from(r.style)){let p=r.style.getPropertyValue(i),u=r.style.getPropertyPriority(i);p!==c.style.getPropertyValue(i)||u!==c.style.getPropertyPriority(i)?u===""?a.styleDiff[i]=p:a.styleDiff[i]=[p,u]:a._unchangedStyles[i]=[p,u];}for(let i of Array.from(c.style))r.style.getPropertyValue(i)===""&&(a.styleDiff[i]=false);}else s==="open"&&r.tagName==="DIALOG"&&(r.matches("dialog:modal")?a.attributes.rr_open_mode="modal":a.attributes.rr_open_mode="non-modal");break}case "childList":{if(z(t.target,this.blockClass,this.blockSelector,true))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{let n=this.mirror.getId(r),s=be(t.target)?this.mirror.getId(C.host(t.target)):this.mirror.getId(t.target);z(t.target,this.blockClass,this.blockSelector,false)||Ze(r,this.mirror,this.slimDOMOptions)||!kn(r,this.mirror)||(this.addedSet.has(r)?(at(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||ir(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Ut(n,s)]?at(this.movedSet,r):(this.removes.push({parentId:s,id:n,isShadow:be(t.target)&&Se(t.target)?true:void 0}),_n(r,this.removesSubTreeCache))),this.mapRemoves.push(r));});break}}}),y(this,"genAdds",(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Ze(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[Ut(this.mirror.getId(t),n)]=true);}else this.addedSet.add(t),this.droppedSet.delete(t);z(t,this.blockClass,this.blockSelector,false)||(C.childNodes(t).forEach(n=>this.genAdds(n)),st(t)&&C.childNodes(C.shadowRoot(t)).forEach(n=>{this.processedNodeManager.add(n,this),this.genAdds(n,t);}));}});}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(r=>{this[r]=t[r];});}freeze(){this.frozen=true,this.canvasManager.freeze();}unfreeze(){this.frozen=false,this.canvasManager.unfreeze(),this.emit();}isFrozen(){return this.frozen}lock(){this.locked=true,this.canvasManager.lock();}unlock(){this.locked=false,this.canvasManager.unlock(),this.emit();}reset(){this.shadowDomManager.reset(),this.canvasManager.reset();}};E=e=>we?(...r)=>{try{return e(...r)}catch(n){if(we&&we(n)===true)return;throw n}}:e,le=[];Un=["INPUT","TEXTAREA","SELECT"],Ht=new WeakMap;$e=class{constructor(t){y(this,"iframeIdToRemoteIdMap",new WeakMap),y(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t;}getId(t,r,n,s){let o=n||this.getIdToRemoteIdMap(t),a=s||this.getRemoteIdToIdMap(t),c=o.get(r);return c||(c=this.generateIdFn(),o.set(r,c),a.set(c,r)),c}getIds(t,r){let n=this.getIdToRemoteIdMap(t),s=this.getRemoteIdToIdMap(t);return r.map(o=>this.getId(t,o,n,s))}getRemoteId(t,r,n){let s=n||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;let o=s.get(r);return o||-1}getRemoteIds(t,r){let n=this.getRemoteIdToIdMap(t);return r.map(s=>this.getRemoteId(t,s,n))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t);}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}},lt=class{constructor(t){y(this,"iframes",new WeakMap),y(this,"crossOriginIframeMap",new WeakMap),y(this,"crossOriginIframeMirror",new $e(Jt)),y(this,"crossOriginIframeStyleMirror"),y(this,"crossOriginIframeRootIdMap",new WeakMap),y(this,"mirror"),y(this,"mutationCb"),y(this,"wrappedEmit"),y(this,"loadListener"),y(this,"stylesheetManager"),y(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new $e(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,true),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t);}addLoadListener(t){this.loadListener=t;}attachIframe(t,r){var n,s;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:true}),this.recordCrossOriginIframes&&((n=t.contentWindow)==null||n.addEventListener("message",this.handleMessage.bind(this))),(s=this.loadListener)==null||s.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument));}handleMessage(t){let r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin||!t.source)return;let s=this.crossOriginIframeMap.get(t.source);if(!s)return;let o=this.transformCrossOriginEvent(s,r.data.event);o&&this.wrappedEmit(o,r.data.isCheckout);}transformCrossOriginEvent(t,r){var n;switch(r.type){case k.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);let s=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,s),this.patchRootIdOnNode(r.data.node,s),{timestamp:r.timestamp,type:k.IncrementalSnapshot,data:{source:R.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:true}}}case k.Meta:case k.Load:case k.DomContentLoaded:return false;case k.Plugin:return r;case k.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case k.IncrementalSnapshot:switch(r.data.source){case R.Mutation:return r.data.adds.forEach(s=>{this.replaceIds(s,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(s.node,t);let o=this.crossOriginIframeRootIdMap.get(t);o&&this.patchRootIdOnNode(s.node,o);}),r.data.removes.forEach(s=>{this.replaceIds(s,t,["parentId","id"]);}),r.data.attributes.forEach(s=>{this.replaceIds(s,t,["id"]);}),r.data.texts.forEach(s=>{this.replaceIds(s,t,["id"]);}),r;case R.Drag:case R.TouchMove:case R.MouseMove:return r.data.positions.forEach(s=>{this.replaceIds(s,t,["id"]);}),r;case R.ViewportResize:return false;case R.MediaInteraction:case R.MouseInteraction:case R.Scroll:case R.CanvasMutation:case R.Input:return this.replaceIds(r.data,t,["id"]),r;case R.StyleSheetRule:case R.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case R.Font:return r;case R.Selection:return r.data.ranges.forEach(s=>{this.replaceIds(s,t,["start","end"]);}),r;case R.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)==null||n.forEach(s=>{this.replaceStyleIds(s,t,["styleId"]);}),r}}return false}replace(t,r,n,s){for(let o of s)!Array.isArray(r[o])&&typeof r[o]!="number"||(Array.isArray(r[o])?r[o]=t.getIds(n,r[o]):r[o]=t.getId(n,r[o]));return r}replaceIds(t,r,n){return this.replace(this.crossOriginIframeMirror,t,r,n)}replaceStyleIds(t,r,n){return this.replace(this.crossOriginIframeStyleMirror,t,r,n)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r);});}patchRootIdOnNode(t,r){t.type!==W.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r);});}},ct=class{constructor(t){y(this,"shadowDoms",new WeakSet),y(this,"mutationCb"),y(this,"scrollCb"),y(this,"bypassOptions"),y(this,"mirror"),y(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(!Se(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);let[n]=pr({...this.bypassOptions,doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(hr({...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(C.host(t))),this.restoreHandlers.push(fr({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){let n=this;this.restoreHandlers.push(ce(t.prototype,"attachShadow",function(s){return function(o){let a=s.call(this,o),c=C.shadowRoot(this);return c&&ur(this)&&n.addShadowRoot(c,r),a}}));}reset(){this.restoreHandlers.forEach(t=>{try{t();}catch(r){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet;}},me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Kn=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(ye=0;ye<me.length;ye++)Kn[me.charCodeAt(ye)]=ye;Xn=function(e){var t=new Uint8Array(e),r,n=t.length,s="";for(r=0;r<n;r+=3)s+=me[t[r]>>2],s+=me[(t[r]&3)<<4|t[r+1]>>4],s+=me[(t[r+1]&15)<<2|t[r+2]>>6],s+=me[t[r+2]&63];return n%3===2?s=s.substring(0,s.length-1)+"=":n%3===1&&(s=s.substring(0,s.length-2)+"=="),s},Bt=new Map;mr=(e,t,r)=>{if(!e||!(yr(e,t)||typeof e=="object"))return;let n=e.constructor.name,s=Yn(r,n),o=s.indexOf(e);return o===-1&&(o=s.length,s.push(e)),o};gr=(e,t,r)=>e.map(n=>Le(n,t,r)),yr=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(s=>typeof t[s]=="function").find(s=>e instanceof t[s]);br=`(function() {
|
|
3
|
+
or you can use record.mirror to access the mirror instance during recording.`,Ht={map:{},getId(){return console.error(he),-1},getNode(){return console.error(he),null},removeNodeFromMap(){console.error(he);},has(){return console.error(he),false},reset(){console.error(he);}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(Ht=new Proxy(Ht,{get(e,t,r){return t==="map"&&console.error(he),Reflect.get(e,t,r)}}));at=class{constructor(){y(this,"id",1),y(this,"styleIDMap",new WeakMap),y(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 n;return r===void 0?n=this.id++:n=r,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1;}generateId(){return this.id++}};Bt=(e,t)=>`${e}@${t}`,lt=class{constructor(){y(this,"frozen",false),y(this,"locked",false),y(this,"texts",[]),y(this,"attributes",[]),y(this,"attributeMap",new WeakMap),y(this,"removes",[]),y(this,"mapRemoves",[]),y(this,"movedMap",{}),y(this,"addedSet",new Set),y(this,"movedSet",new Set),y(this,"droppedSet",new Set),y(this,"removesSubTreeCache",new Set),y(this,"mutationCb"),y(this,"blockClass"),y(this,"blockSelector"),y(this,"maskTextClass"),y(this,"maskTextSelector"),y(this,"inlineStylesheet"),y(this,"maskInputOptions"),y(this,"maskTextFn"),y(this,"maskInputFn"),y(this,"keepIframeSrcFn"),y(this,"recordCanvas"),y(this,"inlineImages"),y(this,"slimDOMOptions"),y(this,"dataURLOptions"),y(this,"doc"),y(this,"mirror"),y(this,"iframeManager"),y(this,"stylesheetManager"),y(this,"shadowDomManager"),y(this,"canvasManager"),y(this,"processedNodeManager"),y(this,"unattachedDoc"),y(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit();}),y(this,"emit",()=>{if(this.frozen||this.locked)return;let t=[],r=new Set;for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let f of this.movedSet){let h=w.parentNode(f);this.removesSubTreeCache.has(h)&&!this.movedSet.has(h)||this.addedSet.add(f);}let n=null,s=null,o=-1,a=null,c=false,i=new Set,p=this.addedSet.values(),u=p.next();for(;this.addedSet.size;){if(n!==null&&this.addedSet.has(w.previousSibling(n)))a=n,n=w.previousSibling(n);else {for(this.addedSet.has(u.value)||(u=p.next()),n=u.value;;){if(s=w.parentNode(n),this.addedSet.has(s)){n=s;continue}break}if(i.has(s))s=null;else if(s){if(hr(s)?(c=$t(this.droppedSet,s)||this.removesSubTreeCache.has(s),c&&$t(this.movedSet,n)&&(c=false)):c=true,this.addedSet.has(w.lastChild(s)))n=w.lastChild(s),a=null;else for(;;){if(a=w.nextSibling(n),this.addedSet.has(a)){n=a;continue}break}if(o=Se(s)?this.mirror.getId(pr(n)):this.mirror.getId(s),o===-1&&s.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let l=w.host(s);o=this.mirror.getId(l);}}}if(this.addedSet.delete(n),!s||o===-1){i.add(n);continue}else if(c){this.droppedSet.add(n);continue}let f=false;if(n.nodeType===Node.TEXT_NODE){let l=s.tagName;if(l==="TEXTAREA")continue;l==="STYLE"&&r.has(o)&&(f=true);}let h=a?this.mirror.getId(a):null;for(;h===He;)a=a&&w.nextSibling(a),h=a&&this.mirror.getId(a);if(h===-1){console.warn("Couldn't record new node. Couldn't find mirror id for nextSibling:",a),n=null;continue}let m=me(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:true,newlyAddedElement:true,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:l=>{ur(l,this.mirror)&&this.iframeManager.addIframe(l),dr(l,this.mirror)&&this.stylesheetManager.trackLinkElement(l),it(n)&&this.shadowDomManager.addShadowRoot(w.shadowRoot(n),this.doc);},onIframeLoad:(l,b)=>{this.iframeManager.attachIframe(l,b),this.shadowDomManager.observeAttachShadow(l);},onStylesheetLoad:(l,b)=>{this.stylesheetManager.attachLinkElement(l,b);},cssCaptured:f});m&&(t.push({parentId:o,nextId:h,node:m}),r.add(m.id));}let d={texts:this.texts.map(f=>{let h=f.node,m=w.parentNode(h);return m&&m.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(m),{id:this.mirror.getId(h),value:f.value}}).filter(f=>!r.has(f.id)).filter(f=>this.mirror.has(f.id)),attributes:this.attributes.map(f=>{let{attributes:h}=f;if(typeof h.style=="string"){let m=JSON.stringify(f.styleDiff),l=JSON.stringify(f._unchangedStyles);m.length<h.style.length&&(m+l).split("var(").length===h.style.split("var(").length&&(h.style=f.styleDiff);}return {id:this.mirror.getId(f.node),attributes:h}}).filter(f=>!r.has(f.id)).filter(f=>this.mirror.has(f.id)),removes:this.removes,adds:t};!d.texts.length&&!d.attributes.length&&!d.removes.length&&!d.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(d));}),y(this,"genTextAreaValueMutation",t=>{let r=this.attributeMap.get(t);r||(r={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(t,r));let n=Array.from(w.childNodes(t),s=>w.textContent(s)||"").join("");r.attributes.value=Pe({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Ue(t),value:n,maskInputFn:this.maskInputFn});}),y(this,"processMutation",t=>{if(!tt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case "characterData":{let r=w.textContent(t.target);!G(t.target,this.blockClass,this.blockSelector,false)&&r!==t.oldValue&&this.texts.push({value:nr(t.target,this.maskTextClass,this.maskTextSelector,true)&&r?this.maskTextFn?this.maskTextFn(r,lr(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case "attributes":{let r=t.target,n=se(r.tagName),s=t.attributeName,o=t.target.getAttribute(s);if(s==="value"){let c=Ue(r);o=Pe({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:c,value:o,maskInputFn:this.maskInputFn});}if(G(t.target,this.blockClass,this.blockSelector,false)||o===t.oldValue)return;let a=this.attributeMap.get(t.target);if(n==="iframe"&&s==="src"&&!this.keepIframeSrcFn(o))if(!r.contentDocument)s="rr_src";else return;if(a||(a={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(a),this.attributeMap.set(t.target,a)),s==="type"&&n==="input"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!rr(n,s))if(a.attributes[s]=tr(this.doc,n,se(s),o),s==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument();}catch(i){this.unattachedDoc=this.doc;}let c=this.unattachedDoc.createElement("span");t.oldValue&&c.setAttribute("style",t.oldValue);for(let i of Array.from(r.style)){let p=r.style.getPropertyValue(i),u=r.style.getPropertyPriority(i);p!==c.style.getPropertyValue(i)||u!==c.style.getPropertyPriority(i)?u===""?a.styleDiff[i]=p:a.styleDiff[i]=[p,u]:a._unchangedStyles[i]=[p,u];}for(let i of Array.from(c.style))r.style.getPropertyValue(i)===""&&(a.styleDiff[i]=false);}else s==="open"&&r.tagName==="DIALOG"&&(r.matches("dialog:modal")?a.attributes.rr_open_mode="modal":a.attributes.rr_open_mode="non-modal");break}case "childList":{if(G(t.target,this.blockClass,this.blockSelector,true))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{let n=this.mirror.getId(r),s=Se(t.target)?this.mirror.getId(w.host(t.target)):this.mirror.getId(t.target);G(t.target,this.blockClass,this.blockSelector,false)||tt(r,this.mirror,this.slimDOMOptions)||!_n(r,this.mirror)||(this.addedSet.has(r)?(ct(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||cr(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Bt(n,s)]?ct(this.movedSet,r):(this.removes.push({parentId:s,id:n,isShadow:Se(t.target)&&we(t.target)?true:void 0}),Fn(r,this.removesSubTreeCache))),this.mapRemoves.push(r));});break}}}),y(this,"genAdds",(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(tt(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[Bt(this.mirror.getId(t),n)]=true);}else this.addedSet.add(t),this.droppedSet.delete(t);G(t,this.blockClass,this.blockSelector,false)||(w.childNodes(t).forEach(n=>this.genAdds(n)),it(t)&&w.childNodes(w.shadowRoot(t)).forEach(n=>{this.processedNodeManager.add(n,this),this.genAdds(n,t);}));}});}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(r=>{this[r]=t[r];});}freeze(){this.frozen=true,this.canvasManager.freeze();}unfreeze(){this.frozen=false,this.canvasManager.unfreeze(),this.emit();}isFrozen(){return this.frozen}lock(){this.locked=true,this.canvasManager.lock();}unlock(){this.locked=false,this.canvasManager.unlock(),this.emit();}reset(){this.shadowDomManager.reset(),this.canvasManager.reset();}};k=e=>Ce?(...r)=>{try{return e(...r)}catch(n){if(Ce&&Ce(n)===true)return;throw n}}:e,le=[];$n=["INPUT","TEXTAREA","SELECT"],Vt=new WeakMap;Ve=class{constructor(t){y(this,"iframeIdToRemoteIdMap",new WeakMap),y(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t;}getId(t,r,n,s){let o=n||this.getIdToRemoteIdMap(t),a=s||this.getRemoteIdToIdMap(t),c=o.get(r);return c||(c=this.generateIdFn(),o.set(r,c),a.set(c,r)),c}getIds(t,r){let n=this.getIdToRemoteIdMap(t),s=this.getRemoteIdToIdMap(t);return r.map(o=>this.getId(t,o,n,s))}getRemoteId(t,r,n){let s=n||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;let o=s.get(r);return o||-1}getRemoteIds(t,r){let n=this.getRemoteIdToIdMap(t);return r.map(s=>this.getRemoteId(t,s,n))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t);}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}},ut=class{constructor(t){y(this,"iframes",new WeakMap),y(this,"crossOriginIframeMap",new WeakMap),y(this,"crossOriginIframeMirror",new Ve(er)),y(this,"crossOriginIframeStyleMirror"),y(this,"crossOriginIframeRootIdMap",new WeakMap),y(this,"mirror"),y(this,"mutationCb"),y(this,"wrappedEmit"),y(this,"loadListener"),y(this,"stylesheetManager"),y(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ve(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,true),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t);}addLoadListener(t){this.loadListener=t;}attachIframe(t,r){var n,s;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:true}),this.recordCrossOriginIframes&&((n=t.contentWindow)==null||n.addEventListener("message",this.handleMessage.bind(this))),(s=this.loadListener)==null||s.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument));}handleMessage(t){let r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin||!t.source)return;let s=this.crossOriginIframeMap.get(t.source);if(!s)return;let o=this.transformCrossOriginEvent(s,r.data.event);o&&this.wrappedEmit(o,r.data.isCheckout);}transformCrossOriginEvent(t,r){var n;switch(r.type){case E.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);let s=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,s),this.patchRootIdOnNode(r.data.node,s),{timestamp:r.timestamp,type:E.IncrementalSnapshot,data:{source:x.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:true}}}case E.Meta:case E.Load:case E.DomContentLoaded:return false;case E.Plugin:return r;case E.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case E.IncrementalSnapshot:switch(r.data.source){case x.Mutation:return r.data.adds.forEach(s=>{this.replaceIds(s,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(s.node,t);let o=this.crossOriginIframeRootIdMap.get(t);o&&this.patchRootIdOnNode(s.node,o);}),r.data.removes.forEach(s=>{this.replaceIds(s,t,["parentId","id"]);}),r.data.attributes.forEach(s=>{this.replaceIds(s,t,["id"]);}),r.data.texts.forEach(s=>{this.replaceIds(s,t,["id"]);}),r;case x.Drag:case x.TouchMove:case x.MouseMove:return r.data.positions.forEach(s=>{this.replaceIds(s,t,["id"]);}),r;case x.ViewportResize:return false;case x.MediaInteraction:case x.MouseInteraction:case x.Scroll:case x.CanvasMutation:case x.Input:return this.replaceIds(r.data,t,["id"]),r;case x.StyleSheetRule:case x.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case x.Font:return r;case x.Selection:return r.data.ranges.forEach(s=>{this.replaceIds(s,t,["start","end"]);}),r;case x.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)==null||n.forEach(s=>{this.replaceStyleIds(s,t,["styleId"]);}),r}}return false}replace(t,r,n,s){for(let o of s)!Array.isArray(r[o])&&typeof r[o]!="number"||(Array.isArray(r[o])?r[o]=t.getIds(n,r[o]):r[o]=t.getId(n,r[o]));return r}replaceIds(t,r,n){return this.replace(this.crossOriginIframeMirror,t,r,n)}replaceStyleIds(t,r,n){return this.replace(this.crossOriginIframeStyleMirror,t,r,n)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r);});}patchRootIdOnNode(t,r){t.type!==H.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r);});}},dt=class{constructor(t){y(this,"shadowDoms",new WeakSet),y(this,"mutationCb"),y(this,"scrollCb"),y(this,"bypassOptions"),y(this,"mirror"),y(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(!we(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);let[n]=mr({...this.bypassOptions,doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(gr({...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(yr({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){let n=this;this.restoreHandlers.push(ce(t.prototype,"attachShadow",function(s){return function(o){let a=s.call(this,o),c=w.shadowRoot(this);return c&&hr(this)&&n.addShadowRoot(c,r),a}}));}reset(){this.restoreHandlers.forEach(t=>{try{t();}catch(r){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet;}},ge="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Qn=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(be=0;be<ge.length;be++)Qn[ge.charCodeAt(be)]=be;Zn=function(e){var t=new Uint8Array(e),r,n=t.length,s="";for(r=0;r<n;r+=3)s+=ge[t[r]>>2],s+=ge[(t[r]&3)<<4|t[r+1]>>4],s+=ge[(t[r+1]&15)<<2|t[r+2]>>6],s+=ge[t[r+2]&63];return n%3===2?s=s.substring(0,s.length-1)+"=":n%3===1&&(s=s.substring(0,s.length-2)+"=="),s},jt=new Map;br=(e,t,r)=>{if(!e||!(wr(e,t)||typeof e=="object"))return;let n=e.constructor.name,s=es(r,n),o=s.indexOf(e);return o===-1&&(o=s.length,s.push(e)),o};Sr=(e,t,r)=>e.map(n=>De(n,t,r)),wr=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(s=>typeof t[s]=="function").find(s=>e instanceof t[s]);Cr=`(function() {
|
|
4
4
|
"use strict";
|
|
5
5
|
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
6
6
|
var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
|
|
@@ -75,4 +75,4 @@ or you can use record.mirror to access the mirror instance during recording.`,Pt
|
|
|
75
75
|
};
|
|
76
76
|
})();
|
|
77
77
|
//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map
|
|
78
|
-
`,jt=typeof self!="undefined"&&self.Blob&&new Blob([br],{type:"text/javascript;charset=utf-8"});ut=class{constructor(t){y(this,"pendingCanvasMutations",new Map),y(this,"rafStamps",{latestId:0,invokeId:null}),y(this,"mirror"),y(this,"mutationCb"),y(this,"resetObservers"),y(this,"frozen",false),y(this,"locked",false),y(this,"processMutation",(i,p)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(i)||this.pendingCanvasMutations.set(i,[]),this.pendingCanvasMutations.get(i).push(p);});let{sampling:r="all",win:n,blockClass:s,blockSelector:o,recordCanvas:a,dataURLOptions:c}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&r==="all"&&this.initCanvasMutationObserver(n,s,o),a&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,s,o,{dataURLOptions:c});}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers();}freeze(){this.frozen=true;}unfreeze(){this.frozen=false;}lock(){this.locked=true;}unlock(){this.locked=false;}initCanvasFPSObserver(t,r,n,s,o){let a=$t(r,n,s,true),c=new Map,i=new es;i.onmessage=m=>{let{id:l}=m.data;if(c.set(l,false),!("base64"in m.data))return;let{base64:b,type:I,width:w,height:g}=m.data;this.mutationCb({id:l,type:ge["2D"],commands:[{property:"clearRect",args:[0,0,w,g]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:b}],type:I}]},0,0]}]});};let p=1e3/t,u=0,d,f=()=>{let m=[];return r.document.querySelectorAll("canvas").forEach(l=>{z(l,n,s,true)||m.push(l);}),m},h=m=>{if(u&&m-u<p){d=requestAnimationFrame(h);return}u=m,f().forEach(async l=>{var b;let I=this.mirror.getId(l);if(c.get(I)||l.width===0||l.height===0)return;if(c.set(I,true),["webgl","webgl2"].includes(l.__context)){let g=l.getContext(l.__context);((b=g==null?void 0:g.getContextAttributes())==null?void 0:b.preserveDrawingBuffer)===false&&g.clear(g.COLOR_BUFFER_BIT);}let w=await createImageBitmap(l);i.postMessage({id:I,bitmap:w,width:l.width,height:l.height,dataURLOptions:o.dataURLOptions},[w]);}),d=requestAnimationFrame(h);};d=requestAnimationFrame(h),this.resetObservers=()=>{a(),cancelAnimationFrame(d);};}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let s=$t(t,r,n,false),o=Jn(this.processMutation.bind(this),t,r,n),a=Zn(this.processMutation.bind(this),t,r,n);this.resetObservers=()=>{s(),o(),a();};}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations());}startRAFTimestamping(){let t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t);};requestAnimationFrame(t);}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{let n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n);}),requestAnimationFrame(()=>this.flushPendingCanvasMutations());}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;let s=n.map(a=>{let{type:c,...i}=a;return i}),{type:o}=n[0];this.mutationCb({id:r,type:o,commands:s}),this.pendingCanvasMutations.delete(t);}},dt=class{constructor(t){y(this,"trackedLinkElements",new WeakSet),y(this,"mutationCb"),y(this,"adoptedStyleSheetCb"),y(this,"styleMirror",new ot),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb;}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t);}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t));}adoptStyleSheets(t,r){if(t.length===0)return;let n={id:r,styleIds:[]},s=[];for(let o of t){let a;this.styleMirror.has(o)?a=this.styleMirror.getId(o):(a=this.styleMirror.add(o),s.push({styleId:a,rules:Array.from(o.rules||CSSRule,(c,i)=>({rule:Xt(c,o.href),index:i}))})),n.styleIds.push(a);}s.length>0&&(n.styles=s),this.adoptedStyleSheetCb(n);}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet;}trackStylesheetInLinkElement(t){}},pt=class{constructor(){y(this,"nodeMap",new WeakMap),y(this,"active",false);}inOtherBuffer(t,r){let n=this.nodeMap.get(t);return n&&Array.from(n).some(s=>s!==r)}add(t,r){this.active||(this.active=true,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=false;})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r));}destroy(){}},Ve=false;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((Nt=e.contentWindow)==null?void 0:Nt.Array.from)||Array.from,document.body.removeChild(e);}}catch(e){console.debug("Unable to override Array.from",e);}Z=rn();Ie.addCustomEvent=(e,t)=>{if(!Ve)throw new Error("please add custom event after start recording");U({type:k.Custom,data:{tag:e,payload:t}});};Ie.freezePage=()=>{le.forEach(e=>e.freeze());};Ie.takeFullSnapshot=e=>{if(!Ve)throw new Error("please take full snapshot after start recording");De(e);};Ie.mirror=Z;});var Rr="401: sign the user id on your server with userHash(id) from @mrrocket/sdk/next/server and pass identify(id, props, { hash }).",wt=(e,t=r=>console.warn(r))=>{let r=globalThis;e!==401||r.__mrrocketUnsigned||(r.__mrrocketUnsigned=true,t(`[MRRocket] ${Rr}`));};var Ct="[data-ck-mask]",vt="[data-ck-block]";var Mt=e=>{let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return (t>>>0)/4294967296};var Ke=1800*1e3,Xe=60*1e3,It=30*1e3,Er=5*1e3,Ye=64*1024,kr=4*1024*1024,xt=1024*1024,Or=[vt,'input[type="password"]','input[type="hidden"]','[autocomplete^="cc-"]','input[name*="card" i]','input[name*="cvc" i]','input[name*="cvv" i]','iframe[src*="js.stripe.com"]','iframe[src*="paypal.com"]'].join(","),Tr=Ct,Rt=(e,t)=>Mt(`replay:${e}`)<Math.min(1,Math.max(0,t)),Et=e=>{let t=e.toLowerCase().replace(/^\$/,"");return t.startsWith("purchase")?"purchase":t.startsWith("checkout")?"checkout":null},Nr=e=>"*".repeat(Math.min(12,e.length)),kt=e=>({emit:e,maskAllInputs:true,maskInputOptions:{color:true,date:true,"datetime-local":true,email:true,month:true,number:true,range:true,search:true,tel:true,text:true,time:true,url:true,week:true,textarea:true,select:true,password:true},maskInputFn:Nr,maskTextSelector:Tr,blockSelector:Or,recordCanvas:false,recordCrossOriginIframes:false,collectFonts:false,inlineImages:false,slimDOMOptions:"all",sampling:{mousemove:50,scroll:150,media:800,input:"last"}}),ke=class{constructor(t=Xe,r=kr){Ee(this,"windowMs",t);Ee(this,"maxBytes",r);Ee(this,"segments",[]);}push(t,r){(t.type===4||!this.segments.length)&&this.segments.push({events:[],bytes:0});let n=this.segments[this.segments.length-1];n.events.push(t),n.bytes+=r;let s=t.timestamp-this.windowMs;for(;this.segments.length>1&&(this.segments[1].events[0].timestamp<=s||this.bytes>this.maxBytes);)this.segments.shift();}get bytes(){return this.segments.reduce((t,r)=>t+r.bytes,0)}get size(){return this.segments.reduce((t,r)=>t+r.events.length,0)}get first(){var t,r,n;return (n=(r=(t=this.segments[0])==null?void 0:t.events[0])==null?void 0:r.timestamp)!=null?n:null}drain(){let t=this.segments.flatMap(r=>r.events);return this.segments=[],t}clear(){this.segments=[];}},Ot=(e,t)=>e>=Ye||e>0&&t>=Er,Tt=e=>{let t="";for(let r=0;r<e.length;r+=32768)t+=String.fromCharCode(...e.subarray(r,r+32768));return btoa(t)};var mt=(e,t)=>String(e!=null?e:"").slice(0,t),ze=()=>window.location.pathname.slice(0,300)||"/",ts=async e=>{let t=new Blob([e]).stream().pipeThrough(new CompressionStream("gzip"));return new Uint8Array(await new Response(t).arrayBuffer())},Cr=async e=>{if(typeof window=="undefined")return null;let{record:t}=await Promise.resolve().then(()=>(wr(),Sr)),r=`${e.host}/api/sdk/replay`,n=Rt(e.sessionId,e.sampleRate)?"upload":"buffer",s=n==="upload"?"sample":null,o=e.distinctId,a=e.identified===true,c=e.userHash,i=null,p=0,u=false,d=Date.now(),f=new ke,h=[],m=0,l=Date.now(),b=[{t:Date.now(),kind:"pageview",path:ze()}],I=Promise.resolve(),w=S=>{u||(!S&&n==="upload"&&M(false),u=true,x==null||x(),window.clearInterval(se),window.clearInterval(te),window.removeEventListener("error",$),window.removeEventListener("unhandledrejection",G),window.removeEventListener("pagehide",V),document.removeEventListener("visibilitychange",X),console.error===K&&(console.error=H),h=[],f.clear(),b=[]);},g=async(S,v,D)=>{let _;if(!D&&typeof CompressionStream!="undefined"?_=JSON.stringify({...S,enc:"gzip",data:Tt(await ts(v))}):_=JSON.stringify({...S,enc:"json",data:v}),_.length>xt){e.warn("A recording chunk was over 1 MB (a very large page). The recording stopped."),w(true);return}if(!(D&&"sendBeacon"in navigator&&navigator.sendBeacon(r,_)))try{let B=await fetch(r,{method:"POST",headers:{"content-type":"application/json"},body:_,keepalive:D||_.length<6e4});wt(B.status),(B.status===401||B.status===403||B.status===409||B.status===413)&&w(!0);}catch(B){e.warn(`Could not reach ${e.host||"this origin"} to upload a recording.`);}};function M(S){if(!h.length)return;let v=h;h=[],m=0,l=Date.now(),i!=null||(i=v[0].timestamp);let D=b;b=[];let _={key:e.apiKey,sessionId:e.sessionId,distinctId:o,identified:a,...c?{userHash:c}:{},start:i,seq:p++,consent:{replay:true},trigger:s,final:S,meta:{first:v[0].timestamp,last:v[v.length-1].timestamp,vw:window.innerWidth,vh:window.innerHeight,marks:D}},B=`[${v.map(oe=>oe.json).join(",")}]`;S?g(_,B,true):I=I.then(()=>g(_,B,false));}let T=S=>{u||n==="upload"||(n="upload",s=S,window.clearInterval(te),h=f.drain(),m=h.reduce((v,D)=>v+D.json.length,0),M(false));},A=S=>{var _;if(u)return;if(Date.now()-(i!=null?i:d)>Ke){w(false);return}let v=JSON.stringify(S),D={type:S.type,timestamp:S.timestamp,json:v};if(n==="buffer"){f.push(D,v.length);let B=(_=f.first)!=null?_:S.timestamp-Xe;b=b.filter(oe=>oe.t>=B);return}h.push(D),m+=v.length,m>=Ye&&M(false);},H=console.error,K=(...S)=>{try{t.addCustomEvent("$console",{level:"error",text:mt(S.map(v=>v instanceof Error?v.message:typeof v=="string"?v:"[object]").join(" "),300)});}catch(v){}H.apply(console,S);},$=S=>{let v=mt(S.message||"Script error",200);b.push({t:Date.now(),kind:"error",path:ze(),label:v});try{t.addCustomEvent("$error",{message:v});}catch(D){}T("error");},G=S=>{let v=S.reason,D=mt(typeof(v==null?void 0:v.message)=="string"?v.message:"Unhandled promise rejection",200);b.push({t:Date.now(),kind:"error",path:ze(),label:D});try{t.addCustomEvent("$error",{message:D});}catch(_){}T("error");},V=()=>n==="upload"&&M(true),X=()=>document.visibilityState==="hidden"&&n==="upload"&&M(false),x=t(kt(A));if(!x)return null;console.error=K,window.addEventListener("error",$),window.addEventListener("unhandledrejection",G),window.addEventListener("pagehide",V),document.addEventListener("visibilitychange",X);let se=window.setInterval(()=>{Date.now()-(i!=null?i:d)>Ke?w(false):n==="upload"&&Ot(m,Date.now()-l)&&M(false);},1e3),te=n==="buffer"?window.setInterval(()=>t.takeFullSnapshot(true),It):0;return {event:S=>{let v=Et(S);v&&T(v);},click:(S,v)=>{if(u)return;let D=Date.now(),_=ze(),B=S.label||S.selector.split(" > ").pop()||"";b.push({t:D,kind:"click",path:_,label:B,x:S.x,y:S.y,vw:S.vw,dead:!S.interactive}),v&&(b.push({t:D,kind:"rage",path:_,label:B,x:S.x,y:S.y,vw:S.vw}),T("rage"));},page:S=>!u&&b.push({t:Date.now(),kind:"pageview",path:S.slice(0,300)||"/"}),identify:(S,v)=>{v?c=v:S!==o&&(c=void 0),o=S,a=true;},stop:(S=false)=>w(S)}};window.__mrrocketReplay={startReplay:Cr};})();
|
|
78
|
+
`,qt=typeof self!="undefined"&&self.Blob&&new Blob([Cr],{type:"text/javascript;charset=utf-8"});pt=class{constructor(t){y(this,"pendingCanvasMutations",new Map),y(this,"rafStamps",{latestId:0,invokeId:null}),y(this,"mirror"),y(this,"mutationCb"),y(this,"resetObservers"),y(this,"frozen",false),y(this,"locked",false),y(this,"processMutation",(i,p)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(i)||this.pendingCanvasMutations.set(i,[]),this.pendingCanvasMutations.get(i).push(p);});let{sampling:r="all",win:n,blockClass:s,blockSelector:o,recordCanvas:a,dataURLOptions:c}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&r==="all"&&this.initCanvasMutationObserver(n,s,o),a&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,s,o,{dataURLOptions:c});}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers();}freeze(){this.frozen=true;}unfreeze(){this.frozen=false;}lock(){this.locked=true;}unlock(){this.locked=false;}initCanvasFPSObserver(t,r,n,s,o){let a=zt(r,n,s,true),c=new Map,i=new ss;i.onmessage=m=>{let{id:l}=m.data;if(c.set(l,false),!("base64"in m.data))return;let{base64:b,type:I,width:S,height:g}=m.data;this.mutationCb({id:l,type:ye["2D"],commands:[{property:"clearRect",args:[0,0,S,g]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:b}],type:I}]},0,0]}]});};let p=1e3/t,u=0,d,f=()=>{let m=[];return r.document.querySelectorAll("canvas").forEach(l=>{G(l,n,s,true)||m.push(l);}),m},h=m=>{if(u&&m-u<p){d=requestAnimationFrame(h);return}u=m,f().forEach(async l=>{var b;let I=this.mirror.getId(l);if(c.get(I)||l.width===0||l.height===0)return;if(c.set(I,true),["webgl","webgl2"].includes(l.__context)){let g=l.getContext(l.__context);((b=g==null?void 0:g.getContextAttributes())==null?void 0:b.preserveDrawingBuffer)===false&&g.clear(g.COLOR_BUFFER_BIT);}let S=await createImageBitmap(l);i.postMessage({id:I,bitmap:S,width:l.width,height:l.height,dataURLOptions:o.dataURLOptions},[S]);}),d=requestAnimationFrame(h);};d=requestAnimationFrame(h),this.resetObservers=()=>{a(),cancelAnimationFrame(d);};}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let s=zt(t,r,n,false),o=ts(this.processMutation.bind(this),t,r,n),a=ns(this.processMutation.bind(this),t,r,n);this.resetObservers=()=>{s(),o(),a();};}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations());}startRAFTimestamping(){let t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t);};requestAnimationFrame(t);}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{let n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n);}),requestAnimationFrame(()=>this.flushPendingCanvasMutations());}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;let s=n.map(a=>{let{type:c,...i}=a;return i}),{type:o}=n[0];this.mutationCb({id:r,type:o,commands:s}),this.pendingCanvasMutations.delete(t);}},ht=class{constructor(t){y(this,"trackedLinkElements",new WeakSet),y(this,"mutationCb"),y(this,"adoptedStyleSheetCb"),y(this,"styleMirror",new at),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb;}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t);}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t));}adoptStyleSheets(t,r){if(t.length===0)return;let n={id:r,styleIds:[]},s=[];for(let o of t){let a;this.styleMirror.has(o)?a=this.styleMirror.getId(o):(a=this.styleMirror.add(o),s.push({styleId:a,rules:Array.from(o.rules||CSSRule,(c,i)=>({rule:Qt(c,o.href),index:i}))})),n.styleIds.push(a);}s.length>0&&(n.styles=s),this.adoptedStyleSheetCb(n);}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet;}trackStylesheetInLinkElement(t){}},ft=class{constructor(){y(this,"nodeMap",new WeakMap),y(this,"active",false);}inOtherBuffer(t,r){let n=this.nodeMap.get(t);return n&&Array.from(n).some(s=>s!==r)}add(t,r){this.active||(this.active=true,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=false;})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r));}destroy(){}},je=false;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((Dt=e.contentWindow)==null?void 0:Dt.Array.from)||Array.from,document.body.removeChild(e);}}catch(e){console.debug("Unable to override Array.from",e);}ee=an();xe.addCustomEvent=(e,t)=>{if(!je)throw new Error("please add custom event after start recording");U({type:E.Custom,data:{tag:e,payload:t}});};xe.freezePage=()=>{le.forEach(e=>e.freeze());};xe.takeFullSnapshot=e=>{if(!je)throw new Error("please take full snapshot after start recording");Ae(e);};xe.mirror=ee;});var Or="401: sign the user id on your server with userHash(id) from @mrrocket/sdk/next/server and pass identify(id, props, { hash }).",Ct=(e,t=r=>console.warn(r))=>{let r=globalThis;e!==401||r.__mrrocketUnsigned||(r.__mrrocketUnsigned=true,t(`[MRRocket] ${Or}`));};var vt="[data-ck-mask]",Mt="[data-ck-block]";var It=e=>{let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return (t>>>0)/4294967296};var Ye=1800*1e3,Je=60*1e3,Rt=30*1e3,Tr=5*1e3,Qe=64*1024,Nr=4*1024*1024,kt=1024*1024,_r=[Mt,'input[type="password"]','input[type="hidden"]','[autocomplete^="cc-"]','input[name*="card" i]','input[name*="cvc" i]','input[name*="cvv" i]','iframe[src*="js.stripe.com"]','iframe[src*="paypal.com"]'].join(","),Xe=vt,Et=(e,t)=>It(`replay:${e}`)<Math.min(1,Math.max(0,t)),Ot=e=>{let t=e.toLowerCase().replace(/^\$/,"");return t.startsWith("purchase")?"purchase":t.startsWith("checkout")?"checkout":null},Lr=e=>"*".repeat(Math.min(12,e.length)),Dr="[data-ck-unmask]",xt=e=>e.replace(/\S/g,"*"),Tt=(e,t)=>e!=null?e:t,Ar=e=>(t,r)=>{let n=r==null?void 0:r.closest(`${Xe},${Dr}`);return n!=null&&n.matches?n.matches(Xe)?xt(t):t:e()?xt(t):t},Nt=(e,t)=>({emit:e,maskAllInputs:true,maskInputOptions:{color:true,date:true,"datetime-local":true,email:true,month:true,number:true,range:true,search:true,tel:true,text:true,time:true,url:true,week:true,textarea:true,select:true,password:true},maskInputFn:Lr,...t?{maskTextSelector:"*",maskTextFn:Ar(t)}:{maskTextSelector:Xe},blockSelector:_r,recordCanvas:false,recordCrossOriginIframes:false,collectFonts:false,inlineImages:false,slimDOMOptions:"all",sampling:{mousemove:50,scroll:150,media:800,input:"last"}}),Oe=class{constructor(t=Je,r=Nr){Ee(this,"windowMs",t);Ee(this,"maxBytes",r);Ee(this,"segments",[]);}push(t,r){(t.type===4||!this.segments.length)&&this.segments.push({events:[],bytes:0});let n=this.segments[this.segments.length-1];n.events.push(t),n.bytes+=r;let s=t.timestamp-this.windowMs;for(;this.segments.length>1&&(this.segments[1].events[0].timestamp<=s||this.bytes>this.maxBytes);)this.segments.shift();}get bytes(){return this.segments.reduce((t,r)=>t+r.bytes,0)}get size(){return this.segments.reduce((t,r)=>t+r.events.length,0)}get first(){var t,r,n;return (n=(r=(t=this.segments[0])==null?void 0:t.events[0])==null?void 0:r.timestamp)!=null?n:null}drain(){let t=this.segments.flatMap(r=>r.events);return this.segments=[],t}clear(){this.segments=[];}},_t=(e,t)=>e>=Qe||e>0&&t>=Tr,Lt=e=>{let t="";for(let r=0;r<e.length;r+=32768)t+=String.fromCharCode(...e.subarray(r,r+32768));return btoa(t)};var yt=(e,t)=>String(e!=null?e:"").slice(0,t),Ge=()=>window.location.pathname.slice(0,300)||"/",os=async e=>{let t=new Blob([e]).stream().pipeThrough(new CompressionStream("gzip"));return new Uint8Array(await new Response(t).arrayBuffer())},Ir=async e=>{if(typeof window=="undefined")return null;let{record:t}=await Promise.resolve().then(()=>(Mr(),vr)),r=`${e.host}/api/sdk/replay`,n=Et(e.sessionId,e.sampleRate)?"upload":"buffer",s=n==="upload"?"sample":null,o=e.distinctId,a=e.identified===true,c=e.userHash,i=null,p=0,u=false,d=Date.now(),f=new Oe,h=[],m=0,l=Date.now(),b=[{t:Date.now(),kind:"pageview",path:Ge()}],I=Promise.resolve(),S=C=>{u||(!C&&n==="upload"&&v(false),u=true,te==null||te(),window.clearInterval(oe),window.clearInterval(A),window.removeEventListener("error",V),window.removeEventListener("unhandledrejection",q),window.removeEventListener("pagehide",j),document.removeEventListener("visibilitychange",Y),console.error===X&&(console.error=B),h=[],f.clear(),b=[]);},g=async(C,M,O)=>{let W;if(!O&&typeof CompressionStream!="undefined"?W=JSON.stringify({...C,enc:"gzip",data:Lt(await os(M))}):W=JSON.stringify({...C,enc:"json",data:M}),W.length>kt){e.warn("A recording chunk was over 1 MB (a very large page). The recording stopped."),S(true);return}if(!(O&&"sendBeacon"in navigator&&navigator.sendBeacon(r,W)))try{let $=await fetch(r,{method:"POST",headers:{"content-type":"application/json"},body:W,keepalive:O||W.length<6e4});Ct($.status),($.status===401||$.status===403||$.status===409||$.status===413)&&S(!0);}catch($){e.warn(`Could not reach ${e.host||"this origin"} to upload a recording.`);}};function v(C){if(!h.length)return;let M=h;h=[],m=0,l=Date.now(),i!=null||(i=M[0].timestamp);let O=b;b=[];let W={key:e.apiKey,sessionId:e.sessionId,distinctId:o,identified:a,...c?{userHash:c}:{},start:i,seq:p++,consent:{replay:true},trigger:s,final:C,meta:{first:M[0].timestamp,last:M[M.length-1].timestamp,vw:window.innerWidth,vh:window.innerHeight,marks:O}},$=`[${M.map(ue=>ue.json).join(",")}]`;C?g(W,$,true):I=I.then(()=>g(W,$,false));}let N=C=>{u||n==="upload"||(n="upload",s=C,window.clearInterval(A),h=f.drain(),m=h.reduce((M,O)=>M+O.json.length,0),v(false));},D=C=>{var W;if(u)return;if(Date.now()-(i!=null?i:d)>Ye){S(false);return}let M=JSON.stringify(C),O={type:C.type,timestamp:C.timestamp,json:M};if(n==="buffer"){f.push(O,M.length);let $=(W=f.first)!=null?W:C.timestamp-Je;b=b.filter(ue=>ue.t>=$);return}h.push(O),m+=M.length,m>=Qe&&v(false);},B=console.error,X=(...C)=>{try{t.addCustomEvent("$console",{level:"error",text:yt(C.map(M=>M instanceof Error?M.message:typeof M=="string"?M:"[object]").join(" "),300)});}catch(M){}B.apply(console,C);},V=C=>{let M=yt(C.message||"Script error",200);b.push({t:Date.now(),kind:"error",path:Ge(),label:M});try{t.addCustomEvent("$error",{message:M});}catch(O){}N("error");},q=C=>{let M=C.reason,O=yt(typeof(M==null?void 0:M.message)=="string"?M.message:"Unhandled promise rejection",200);b.push({t:Date.now(),kind:"error",path:Ge(),label:O});try{t.addCustomEvent("$error",{message:O});}catch(W){}N("error");},j=()=>n==="upload"&&v(true),Y=()=>document.visibilityState==="hidden"&&n==="upload"&&v(false),R=e.maskAllText===false?void 0:()=>Tt(e.maskAllText,a),te=t(Nt(D,R));if(!te)return null;console.error=X,window.addEventListener("error",V),window.addEventListener("unhandledrejection",q),window.addEventListener("pagehide",j),document.addEventListener("visibilitychange",Y);let oe=window.setInterval(()=>{Date.now()-(i!=null?i:d)>Ye?S(false):n==="upload"&&_t(m,Date.now()-l)&&v(false);},1e3),A=n==="buffer"?window.setInterval(()=>t.takeFullSnapshot(true),Rt):0;return {event:C=>{let M=Ot(C);M&&N(M);},click:(C,M)=>{if(u)return;let O=Date.now(),W=Ge(),$=C.label||C.selector.split(" > ").pop()||"";b.push({t:O,kind:"click",path:W,label:$,x:C.x,y:C.y,vw:C.vw,dead:!C.interactive}),M&&(b.push({t:O,kind:"rage",path:W,label:$,x:C.x,y:C.y,vw:C.vw}),N("rage"));},page:C=>!u&&b.push({t:Date.now(),kind:"pageview",path:C.slice(0,300)||"/"}),identify:(C,M)=>{M?c=M:C!==o&&(c=void 0),o=C;let O=!a&&e.maskAllText===void 0;if(a=true,O&&!u)try{t.takeFullSnapshot(!0);}catch(W){}},stop:(C=false)=>S(C)}};window.__mrrocketReplay={startReplay:Ir};})();
|