@highlight-run/rrweb 2.0.5 → 2.0.8
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/dist/plugins/console-record.js +1 -1
- package/dist/plugins/console-record.min.js +1 -1
- package/dist/plugins/console-record.min.js.map +1 -1
- package/dist/plugins/console-replay.min.js.map +1 -1
- package/dist/record/rrweb-record-pack.min.js.map +1 -1
- package/dist/record/rrweb-record.js +3 -3
- package/dist/record/rrweb-record.min.js +3 -3
- package/dist/record/rrweb-record.min.js.map +1 -1
- package/dist/replay/rrweb-replay-unpack.js +4 -4
- package/dist/replay/rrweb-replay-unpack.min.js +4 -4
- package/dist/replay/rrweb-replay-unpack.min.js.map +1 -1
- package/dist/replay/rrweb-replay.js +3 -3
- package/dist/replay/rrweb-replay.min.js +3 -3
- package/dist/replay/rrweb-replay.min.js.map +1 -1
- package/dist/rrweb-all.js +12 -12
- package/dist/rrweb-all.min.js +12 -12
- package/dist/rrweb-all.min.js.map +1 -1
- package/dist/rrweb.js +5 -5
- package/dist/rrweb.min.js +5 -5
- package/dist/rrweb.min.js.map +1 -1
- package/es/rrweb/packages/rrweb/src/record/mutation.js +23 -11
- package/es/rrweb/packages/rrweb/src/record/observer.js +6 -6
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/2d.js +1 -1
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas.js +2 -2
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/webgl.js +1 -2
- package/es/rrweb/packages/rrweb/src/utils.js +16 -23
- package/es/rrweb/packages/rrweb-snapshot/es/rrweb-snapshot.js +278 -241
- package/lib/record/rrweb-record.js +325 -284
- package/lib/rrweb-all.js +325 -284
- package/lib/rrweb.js +325 -284
- package/package.json +4 -4
- package/typings/utils.d.ts +1 -1
package/dist/rrweb.min.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var rrweb=function(q){"use strict";var k;(function(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"})(k||(k={}));function Nt(e){return e.nodeType===e.ELEMENT_NODE}function ke(e){var t,r=(t=e)===null||t===void 0?void 0:t.host;return Boolean(r&&r.shadowRoot&&r.shadowRoot===e)}var Ke=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var r;if(!t)return-1;var n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var r=this,n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(function(o){return r.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function Et(){return new Ke}function Qe(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,o=e.value,s=e.maskInputFn,a=o||"";return(t[r.toLowerCase()]||t[n])&&(s?a=s(a):a="*".repeat(a.length)),a}var wt="__rrweb_original__";function Gr(e){var t=e.getContext("2d");if(!t)return!0;for(var r=50,n=0;n<e.width;n+=r)for(var o=0;o<e.height;o+=r){var s=t.getImageData,a=wt in s?s[wt]:s,l=new Uint32Array(a.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer);if(l.some(function(c){return c!==0}))return!1}return!0}function Ct(e){return e=e.replace(/[^ -~]+/g,""),e=e?.split(" ").map(function(t){return Math.random().toString(20).substr(2,t.length)}).join(" ")||"",e}var Br=1,zr=new RegExp("[^a-z0-9-_:]"),Re=-2;function Hr(){return Br++}function Yr(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return zr.test(t)?"div":t}function Je(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(Xr).join(""):null}catch{return null}}function Xr(e){var t=e.cssText;if(Zr(e))try{t=Je(e.styleSheet)||t}catch{}return t}function Zr(e){return"styleSheet"in e}function Kr(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function Qr(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var be,It,Jr=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,qr=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,en=/^(data:)([^,]*),(.*)/i;function $e(e,t){return(e||"").replace(Jr,function(r,n,o,s,a,l){var c=o||a||l,i=n||s||"";if(!c)return r;if(!qr.test(c)||en.test(c))return"url("+i+c+i+")";if(c[0]==="/")return"url("+i+(Qr(t)+c)+i+")";var u=t.split("/"),d=c.split("/");u.pop();for(var m=0,h=d;m<h.length;m++){var g=h[m];g!=="."&&(g===".."?u.pop():u.push(g))}return"url("+i+u.join("/")+i+")"})}var tn=/^[^ \t\n\r\u000c]+/,rn=/^[, \t\n\r\u000c]+/;function nn(e,t){if(t.trim()==="")return t;var r=0;function n(i){var u,d=i.exec(t.substring(r));return d?(u=d[0],r+=u.length,u):""}for(var o=[];n(rn),!(r>=t.length);){var s=n(tn);if(s.slice(-1)===",")s=Ve(e,s.substring(0,s.length-1)),o.push(s);else{var a="";s=Ve(e,s);for(var l=!1;;){var c=t.charAt(r);if(c===""){o.push((s+a).trim());break}else if(l)c===")"&&(l=!1);else if(c===","){r+=1,o.push((s+a).trim());break}else c==="("&&(l=!0);a+=c,r+=1}}}return o.join(", ")}function Ve(e,t){if(!t||t.trim()==="")return t;var r=e.createElement("a");return r.href=t,r.href}function on(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function qe(){var e=document.createElement("a");return e.href="",e.href}function Mt(e,t,r,n){return r==="src"||r==="href"&&n||r==="xlink:href"&&n&&n[0]!=="#"||r==="background"&&n&&(t==="table"||t==="td"||t==="th")?Ve(e,n):r==="srcset"&&n?nn(e,n):r==="style"&&n?$e(n,qe()):t==="object"&&r==="data"&&n?Ve(e,n):n}function sn(e,t,r){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var n=0;n<e.classList.length;n++){var o=e.classList[n];if(t.test(o))return!0}return r?e.matches(r):!1}function Ue(e,t,r){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var n=0;n<e.classList.length;n++){var o=e.classList[n];if(t.test(o))return!0}return r&&e.matches(r)?!0:Ue(e.parentNode,t,r)}return e.nodeType,e.TEXT_NODE,Ue(e.parentNode,t,r)}function an(e,t,r){var n=e.contentWindow;if(n){var o=!1,s;try{s=n.document.readyState}catch{return}if(s!=="complete"){var a=setTimeout(function(){o||(t(),o=!0)},r);e.addEventListener("load",function(){clearTimeout(a),o=!0,t()});return}var l="about:blank";if(n.location.href!==l||e.src===l||e.src===""){setTimeout(t,0);return}e.addEventListener("load",t)}}function ln(e){return e.getAttribute("href")?e.sheet!==null:!0}function cn(e,t,r){var n=!1,o;try{o=e.sheet}catch{return}if(!o){var s=setTimeout(function(){n||(t(),n=!0)},r);e.addEventListener("load",function(){clearTimeout(s),n=!0,t()})}}function un(e,t){var r,n=t.doc,o=t.mirror,s=t.blockClass,a=t.blockSelector,l=t.maskTextClass,c=t.maskTextSelector,i=t.inlineStylesheet,u=t.maskInputOptions,d=u===void 0?{}:u,m=t.maskTextFn,h=t.maskInputFn,g=t.dataURLOptions,f=g===void 0?{}:g,S=t.inlineImages,p=t.recordCanvas,b=t.keepIframeSrcFn,N=t.enableStrictPrivacy,I;if(o.getMeta(n)){var P=o.getId(n);I=P===1?void 0:P}switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:k.Document,childNodes:[],compatMode:e.compatMode,rootId:I}:{type:k.Document,childNodes:[],rootId:I};case e.DOCUMENT_TYPE_NODE:return{type:k.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:I};case e.ELEMENT_NODE:for(var A=sn(e,s,a),C=Yr(e),w={},H=e.attributes.length,X=0;X<H;X++){var Z=e.attributes[X];w[Z.name]=Mt(n,C,Z.name,Z.value)}if(C==="link"&&i){var J=Array.from(n.styleSheets).find(function(me){return me.href===e.href}),B=null;J&&(B=Je(J)),B&&(delete w.rel,delete w.href,w._cssText=$e(B,J.href))}if(C==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var B=Je(e.sheet);B&&(w._cssText=$e(B,qe()))}if(C==="input"||C==="textarea"||C==="select"){var ne=e.value;w.type!=="radio"&&w.type!=="checkbox"&&w.type!=="submit"&&w.type!=="button"&&ne?w.value=Qe({type:w.type,tagName:C,value:ne,maskInputOptions:d,maskInputFn:h}):e.checked&&(w.checked=e.checked)}if(C==="option"&&(e.selected&&!d.select?w.selected=!0:delete w.selected),C==="canvas"&&p){if(e.__context==="2d")Gr(e)||(w.rr_dataURL=e.toDataURL(f.type,f.quality));else if(!("__context"in e)){var K=e.toDataURL(f.type,f.quality),G=document.createElement("canvas");G.width=e.width,G.height=e.height;var $=G.toDataURL(f.type,f.quality);K!==$&&(w.rr_dataURL=K)}}if(C==="img"&&S){be||(be=n.createElement("canvas"),It=be.getContext("2d"));var L=e,v=L.crossOrigin;L.crossOrigin="anonymous";var y=function(){try{be.width=L.naturalWidth,be.height=L.naturalHeight,It.drawImage(L,0,0),w.rr_dataURL=be.toDataURL(f.type,f.quality)}catch(me){console.warn("Cannot inline img src="+L.currentSrc+"! Error: "+me)}v?w.crossOrigin=v:L.removeAttribute("crossorigin")};L.complete&&L.naturalWidth!==0?y():L.onload=y}if((C==="audio"||C==="video")&&(w.rr_mediaState=e.paused?"paused":"played",w.rr_mediaCurrentTime=e.currentTime),e.scrollLeft&&(w.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(w.rr_scrollTop=e.scrollTop),A||C==="img"&&N){var T=e.getBoundingClientRect(),E=T.width,R=T.height;w={class:w.class,rr_width:E+"px",rr_height:R+"px"},A=!0}return C==="iframe"&&!b(w.src)&&(e.contentDocument||(w.rr_src=w.src),delete w.src),{type:k.Element,tagName:C,attributes:w,childNodes:[],isSVG:on(e)||void 0,needBlock:A,rootId:I};case e.TEXT_NODE:var j=e.parentNode&&e.parentNode.tagName,_=e.textContent,re=j==="STYLE"?!0:void 0,F=j==="SCRIPT"?!0:void 0,W=!1;if(re&&_){try{e.nextSibling||e.previousSibling||!((r=e.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(_=Kr(e.parentNode.sheet))}catch(me){console.warn("Cannot get CSS styles from text's parentNode. Error: "+me,e)}_=$e(_,qe()),W=!0}if(F?(_="SCRIPT_PLACEHOLDER",W=!0):j==="NOSCRIPT"&&(_="",W=!0),!re&&!F&&Ue(e,l,c)&&_&&(_=m?m(_):_.replace(/[\S]/g,"*")),N&&!W&&j){var ue=new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]);!ue.has(j)&&_&&(_=Ct(_))}return{type:k.Text,textContent:_||"",isStyle:re,rootId:I};case e.CDATA_SECTION_NODE:return{type:k.CDATA,textContent:"",rootId:I};case e.COMMENT_NODE:return{type:k.Comment,textContent:e.textContent||"",rootId:I};default:return!1}}function V(e){return e===void 0?"":e.toLowerCase()}function dn(e,t){return!!(t.comment&&e.type===k.Comment||e.type===k.Element&&(t.script&&(e.tagName==="script"||e.tagName==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js"))||t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(V(e.attributes.name).match(/^msapplication-tile(image|color)$/)||V(e.attributes.name)==="application-name"||V(e.attributes.rel)==="icon"||V(e.attributes.rel)==="apple-touch-icon"||V(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&V(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(V(e.attributes.property).match(/^(og|twitter|fb):/)||V(e.attributes.name).match(/^(og|twitter):/)||V(e.attributes.name)==="pinterest")||t.headMetaRobots&&(V(e.attributes.name)==="robots"||V(e.attributes.name)==="googlebot"||V(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&(V(e.attributes.name)==="author"||V(e.attributes.name)==="generator"||V(e.attributes.name)==="framework"||V(e.attributes.name)==="publisher"||V(e.attributes.name)==="progid"||V(e.attributes.property).match(/^article:/)||V(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(V(e.attributes.name)==="google-site-verification"||V(e.attributes.name)==="yandex-verification"||V(e.attributes.name)==="csrf-token"||V(e.attributes.name)==="p:domain_verify"||V(e.attributes.name)==="verify-v1"||V(e.attributes.name)==="verification"||V(e.attributes.name)==="shopify-checkout-api-token"))))}function Se(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,s=t.blockSelector,a=t.maskTextClass,l=t.maskTextSelector,c=t.skipChild,i=c===void 0?!1:c,u=t.inlineStylesheet,d=u===void 0?!0:u,m=t.maskInputOptions,h=m===void 0?{}:m,g=t.maskTextFn,f=t.maskInputFn,S=t.slimDOMOptions,p=t.dataURLOptions,b=p===void 0?{}:p,N=t.inlineImages,I=N===void 0?!1:N,P=t.recordCanvas,A=P===void 0?!1:P,C=t.onSerialize,w=t.onIframeLoad,H=t.iframeLoadTimeout,X=H===void 0?5e3:H,Z=t.onStylesheetLoad,J=t.stylesheetLoadTimeout,B=J===void 0?5e3:J,ne=t.keepIframeSrcFn,K=ne===void 0?function(){return!1}:ne,G=t.enableStrictPrivacy,$=t.preserveWhiteSpace,L=$===void 0?!0:$,v=un(e,{doc:r,mirror:n,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:l,inlineStylesheet:d,maskInputOptions:h,maskTextFn:g,maskInputFn:f,dataURLOptions:b,inlineImages:I,recordCanvas:A,keepIframeSrcFn:K,enableStrictPrivacy:G});if(!v)return console.warn(e,"not serialized"),null;var y;if(n.hasNode(e)?y=n.getId(e):dn(v,S)||!L&&v.type===k.Text&&!v.isStyle&&!v.textContent.replace(/^\s+|\s+$/gm,"").length?y=Re:y=Hr(),y===Re)return null;var T=Object.assign(v,{id:y});n.add(e,T),C&&C(e);var E=!i;if(T.type===k.Element){if(E=E&&!T.needBlock,T.needBlock&&T.tagName==="img"){var R=e.cloneNode();R.src="",n.add(R,T)}if(T.tagName==="link"){var R=e.cloneNode();R.href="",R.innerText=T.attributes._cssText,n.add(R,T)}delete T.needBlock,e.shadowRoot&&(T.isShadowHost=!0)}if((T.type===k.Document||T.type===k.Element)&&E){S.headWhitespace&&T.type===k.Element&&T.tagName==="head"&&(L=!1);for(var j={doc:r,mirror:n,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:l,skipChild:i,inlineStylesheet:d,maskInputOptions:h,maskTextFn:g,maskInputFn:f,slimDOMOptions:S,dataURLOptions:b,inlineImages:I,recordCanvas:A,preserveWhiteSpace:L,onSerialize:C,onIframeLoad:w,iframeLoadTimeout:X,onStylesheetLoad:Z,stylesheetLoadTimeout:B,keepIframeSrcFn:K,enableStrictPrivacy:G},_=0,re=Array.from(e.childNodes);_<re.length;_++){var F=re[_],W=Se(F,j);W&&T.childNodes.push(W)}if(Nt(e)&&e.shadowRoot)for(var ue=0,me=Array.from(e.shadowRoot.childNodes);ue<me.length;ue++){var F=me[ue],W=Se(F,j);W&&(W.isShadow=!0,T.childNodes.push(W))}}return e.parentNode&&ke(e.parentNode)&&(T.isShadow=!0),T.type===k.Element&&T.tagName==="iframe"&&an(e,function(){var De=e.contentDocument;if(De&&w){var Ur=Se(De,{doc:De,mirror:n,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:h,maskTextFn:g,maskInputFn:f,slimDOMOptions:S,dataURLOptions:b,inlineImages:I,recordCanvas:A,preserveWhiteSpace:L,onSerialize:C,onIframeLoad:w,iframeLoadTimeout:X,keepIframeSrcFn:K,enableStrictPrivacy:G});Ur&&w(e,Ur)}},X),T.type===k.Element&&T.tagName==="link"&&T.attributes.rel==="stylesheet"&&(cn(e,function(){if(Z){var De=Se(e,{doc:r,mirror:n,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:h,maskTextFn:g,maskInputFn:f,slimDOMOptions:S,dataURLOptions:b,inlineImages:I,recordCanvas:A,preserveWhiteSpace:L,onSerialize:C,onIframeLoad:w,onStylesheetLoad:Z,iframeLoadTimeout:X,keepIframeSrcFn:K,enableStrictPrivacy:G});De&&Z(e,De)}},B),ln(e)===!1)?null:T}function hn(e,t){var r=t||{},n=r.mirror,o=n===void 0?new Ke:n,s=r.blockClass,a=s===void 0?"highlight-block":s,l=r.blockSelector,c=l===void 0?null:l,i=r.maskTextClass,u=i===void 0?"highlight-mask":i,d=r.maskTextSelector,m=d===void 0?null:d,h=r.inlineStylesheet,g=h===void 0?!0:h,f=r.inlineImages,S=f===void 0?!1:f,p=r.recordCanvas,b=p===void 0?!1:p,N=r.maskAllInputs,I=N===void 0?!1:N,P=r.maskTextFn,A=r.maskInputFn,C=r.slimDOM,w=C===void 0?!1:C,H=r.dataURLOptions,X=r.preserveWhiteSpace,Z=r.onSerialize,J=r.onIframeLoad,B=r.iframeLoadTimeout,ne=r.onStylesheetLoad,K=r.stylesheetLoadTimeout,G=r.keepIframeSrcFn,$=G===void 0?function(){return!1}:G,L=r.enableStrictPrivacy,v=L===void 0?!1:L,y=I===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:I===!1?{password:!0}:I,T=w===!0||w==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:w==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:w===!1?{}:w;return Se(e,{doc:e,mirror:o,blockClass:a,blockSelector:c,maskTextClass:u,maskTextSelector:m,skipChild:!1,inlineStylesheet:g,maskInputOptions:y,maskTextFn:P,maskInputFn:A,slimDOMOptions:T,dataURLOptions:H,inlineImages:S,recordCanvas:b,preserveWhiteSpace:X,onSerialize:Z,onIframeLoad:J,iframeLoadTimeout:B,onStylesheetLoad:ne,stylesheetLoadTimeout:K,keepIframeSrcFn:$,enableStrictPrivacy:v})}var xt=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function mn(e,t){t===void 0&&(t={});var r=1,n=1;function o(v){var y=v.match(/\n/g);y&&(r+=y.length);var T=v.lastIndexOf(`
|
|
2
|
-
`);n=T===-1?n+v.length:v.length-T}function s(){var v={line:r,column:n};return function(y){return y.position=new a(v),g(),y}}var a=function(){function v(y){this.start=y,this.end={line:r,column:n},this.source=t.source}return v}();a.prototype.content=e;var l=[];function c(v){var y=new Error(t.source+":"+r+":"+n+": "+v);if(y.reason=v,y.filename=t.source,y.line=r,y.column=n,y.source=e,t.silent)l.push(y);else throw y}function i(){var v=m();return{type:"stylesheet",stylesheet:{source:t.source,rules:v,parsingErrors:l}}}function u(){return h(/^{\s*/)}function d(){return h(/^}/)}function m(){var v,y=[];for(g(),f(y);e.length&&e.charAt(0)!=="}"&&(v=$()||L());)v!==!1&&(y.push(v),f(y));return y}function h(v){var y=v.exec(e);if(y){var T=y[0];return o(T),e=e.slice(T.length),y}}function g(){h(/^\s*/)}function f(v){v===void 0&&(v=[]);for(var y;y=S();)y!==!1&&v.push(y),y=S();return v}function S(){var v=s();if(!(e.charAt(0)!=="/"||e.charAt(1)!=="*")){for(var y=2;e.charAt(y)!==""&&(e.charAt(y)!=="*"||e.charAt(y+1)!=="/");)++y;if(y+=2,e.charAt(y-1)==="")return c("End of comment missing");var T=e.slice(2,y-2);return n+=2,o(T),e=e.slice(y),n+=2,v({type:"comment",comment:T})}}function p(){var v=h(/^([^{]+)/);if(v)return le(v[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(y){return y.replace(/,/g,"\u200C")}).split(/\s*(?![^(]*\)),\s*/).map(function(y){return y.replace(/\u200C/g,",")})}function b(){var v=s(),y=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(y){var T=le(y[0]);if(!h(/^:\s*/))return c("property missing ':'");var E=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),R=v({type:"declaration",property:T.replace(xt,""),value:E?le(E[0]).replace(xt,""):""});return h(/^[;\s]*/),R}}function N(){var v=[];if(!u())return c("missing '{'");f(v);for(var y;y=b();)y!==!1&&(v.push(y),f(v)),y=b();return d()?v:c("missing '}'")}function I(){for(var v,y=[],T=s();v=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)y.push(v[1]),h(/^,\s*/);if(y.length)return T({type:"keyframe",values:y,declarations:N()})}function P(){var v=s(),y=h(/^@([-\w]+)?keyframes\s*/);if(y){var T=y[1];if(y=h(/^([-\w]+)\s*/),!y)return c("@keyframes missing name");var E=y[1];if(!u())return c("@keyframes missing '{'");for(var R,j=f();R=I();)j.push(R),j=j.concat(f());return d()?v({type:"keyframes",name:E,vendor:T,keyframes:j}):c("@keyframes missing '}'")}}function A(){var v=s(),y=h(/^@supports *([^{]+)/);if(y){var T=le(y[1]);if(!u())return c("@supports missing '{'");var E=f().concat(m());return d()?v({type:"supports",supports:T,rules:E}):c("@supports missing '}'")}}function C(){var v=s(),y=h(/^@host\s*/);if(y){if(!u())return c("@host missing '{'");var T=f().concat(m());return d()?v({type:"host",rules:T}):c("@host missing '}'")}}function w(){var v=s(),y=h(/^@media *([^{]+)/);if(y){var T=le(y[1]);if(!u())return c("@media missing '{'");var E=f().concat(m());return d()?v({type:"media",media:T,rules:E}):c("@media missing '}'")}}function H(){var v=s(),y=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(y)return v({type:"custom-media",name:le(y[1]),media:le(y[2])})}function X(){var v=s(),y=h(/^@page */);if(y){var T=p()||[];if(!u())return c("@page missing '{'");for(var E=f(),R;R=b();)E.push(R),E=E.concat(f());return d()?v({type:"page",selectors:T,declarations:E}):c("@page missing '}'")}}function Z(){var v=s(),y=h(/^@([-\w]+)?document *([^{]+)/);if(y){var T=le(y[1]),E=le(y[2]);if(!u())return c("@document missing '{'");var R=f().concat(m());return d()?v({type:"document",document:E,vendor:T,rules:R}):c("@document missing '}'")}}function J(){var v=s(),y=h(/^@font-face\s*/);if(y){if(!u())return c("@font-face missing '{'");for(var T=f(),E;E=b();)T.push(E),T=T.concat(f());return d()?v({type:"font-face",declarations:T}):c("@font-face missing '}'")}}var B=G("import"),ne=G("charset"),K=G("namespace");function G(v){var y=new RegExp("^@"+v+"\\s*([^;]+);");return function(){var T=s(),E=h(y);if(E){var R={type:v};return R[v]=E[1].trim(),T(R)}}}function $(){if(e[0]==="@")return P()||w()||H()||A()||B()||ne()||K()||Z()||X()||C()||J()}function L(){var v=s(),y=p();return y?(f(),v({type:"rule",selectors:y,declarations:N()})):c("selector missing")}return et(i())}function le(e){return e?e.replace(/^\s+|\s+$/g,""):""}function et(e,t){for(var r=e&&typeof e.type=="string",n=r?e:t,o=0,s=Object.keys(e);o<s.length;o++){var a=s[o],l=e[a];Array.isArray(l)?l.forEach(function(c){et(c,n)}):l&&typeof l=="object"&&et(l,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Dt={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function pn(e){var t=Dt[e.tagName]?Dt[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function fn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var kt=/([^\\]):hover/,gn=new RegExp(kt.source,"g");function Rt(e,t){var r;if(!(!((r=window?.HIG_CONFIGURATION)===null||r===void 0)&&r.enableOnHoverClass))return e;var n=t?.stylesWithHoverClass.get(e);if(n)return n;var o=mn(e,{silent:!0});if(!o.stylesheet)return e;var s=[];if(o.stylesheet.rules.forEach(function(c){"selectors"in c&&(c.selectors||[]).forEach(function(i){kt.test(i)&&s.push(i)})}),s.length===0)return e;var a=new RegExp(s.filter(function(c,i){return s.indexOf(c)===i}).sort(function(c,i){return i.length-c.length}).map(function(c){return fn(c)}).join("|"),"g"),l=e.replace(a,function(c){var i=c.replace(gn,"$1.\\:hover");return c+", "+i});return t?.stylesWithHoverClass.set(e,l),l}function Ot(){var e=new Map;return{stylesWithHoverClass:e}}function yn(e,t){var r=t.doc,n=t.hackCss,o=t.cache;switch(e.type){case k.Document:return r.implementation.createDocument(null,"",null);case k.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case k.Element:var s=pn(e),a;e.isSVG?a=r.createElementNS("http://www.w3.org/2000/svg",s):a=r.createElement(s);var l=function(i){if(!e.attributes.hasOwnProperty(i))return"continue";var u=e.attributes[i];if(s==="option"&&i==="selected"&&u===!1)return"continue";if(u=typeof u=="boolean"||typeof u=="number"?"":u,i.startsWith("rr_")){if(s==="canvas"&&i==="rr_dataURL"){var d=document.createElement("img");d.src=u,d.onload=function(){var C=a.getContext("2d");C&&C.drawImage(d,0,0,d.width,d.height)}}else if(s==="img"&&i==="rr_dataURL"){var m=a;m.currentSrc.startsWith("data:")||(m.setAttribute("rrweb-original-src",e.attributes.src),m.src=u)}if(i==="rr_width")a.style.width=u;else if(i==="rr_height")a.style.height=u;else if(i==="rr_mediaCurrentTime")a.currentTime=e.attributes.rr_mediaCurrentTime;else if(i==="rr_mediaState")switch(u){case"played":a.play().catch(function(C){return console.warn("media playback error",C)});break;case"paused":a.pause();break}}else{var h=s==="textarea"&&i==="value",g=s==="style"&&i==="_cssText";if(g&&n&&(u=Rt(u,o),typeof u=="string")){for(var f=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,S=void 0,p=[],b="https://replay-cors-proxy.highlightrun.workers.dev";(S=f.exec(u))!==null;)S.index===f.lastIndex&&f.lastIndex++,S.forEach(function(C,w){if(w===0){var H=C.slice(5,C.length-2);p.push({originalUrl:H,proxyUrl:H.replace(H,b+"?url="+H)})}});p.forEach(function(C){u=u.replace(C.originalUrl,C.proxyUrl)})}if(h||g){for(var N=r.createTextNode(u),I=0,P=Array.from(a.childNodes);I<P.length;I++){var A=P[I];A.nodeType===a.TEXT_NODE&&a.removeChild(A)}return a.appendChild(N),"continue"}try{if(e.isSVG&&i==="xlink:href")a.setAttributeNS("http://www.w3.org/1999/xlink",i,u);else if(i==="onload"||i==="onclick"||i.substring(0,7)==="onmouse")a.setAttribute("_"+i,u);else{if(s==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&i==="content")return a.setAttribute("csp-content",u),"continue";s==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||s==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")||(s==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?a.setAttribute("rrweb-original-srcset",e.attributes.srcset):a.setAttribute(i,u))}}catch{}}};for(var c in e.attributes)l(c);if(e.isShadowHost)if(!a.shadowRoot)a.attachShadow({mode:"open"});else for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);return a;case k.Text:return r.createTextNode(e.isStyle&&n?Rt(e.textContent,o):e.textContent);case k.CDATA:return r.createCDATASection(e.textContent);case k.Comment:return r.createComment(e.textContent);default:return null}}function je(e,t){var r=t.doc,n=t.mirror,o=t.skipChild,s=o===void 0?!1:o,a=t.hackCss,l=a===void 0?!0:a,c=t.afterAppend,i=t.cache,u=yn(e,{doc:r,hackCss:l,cache:i});if(!u)return null;if(e.rootId&&console.assert(n.getNode(e.rootId)===r,"Target document should have the same root id."),e.type===k.Document&&(r.close(),r.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==k.DocumentType&&(e.childNodes[0].type===k.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),u=r),n.add(u,e),(e.type===k.Document||e.type===k.Element)&&!s)for(var d=0,m=e.childNodes;d<m.length;d++){var h=m[d],g=je(h,{doc:r,mirror:n,skipChild:!1,hackCss:l,afterAppend:c,cache:i});if(!g){console.warn("Failed to rebuild",h);continue}h.isShadow&&Nt(u)&&u.shadowRoot?u.shadowRoot.appendChild(g):u.appendChild(g),c&&c(g)}return u}function vn(e,t){function r(a){t(a)}for(var n=0,o=e.getIds();n<o.length;n++){var s=o[n];e.has(s)&&r(e.getNode(s))}}function bn(e,t){var r=t.getMeta(e);if(r?.type===k.Element){var n=e;for(var o in r.attributes)if(r.attributes.hasOwnProperty(o)&&o.startsWith("rr_")){var s=r.attributes[o];o==="rr_scrollLeft"&&(n.scrollLeft=s),o==="rr_scrollTop"&&(n.scrollTop=s)}}}function Sn(e,t){var r=t.doc,n=t.onVisit,o=t.hackCss,s=o===void 0?!0:o,a=t.afterAppend,l=t.cache,c=t.mirror,i=c===void 0?new Ke:c,u=je(e,{doc:r,mirror:i,skipChild:!1,hackCss:s,afterAppend:a,cache:l});return vn(i,function(d){n&&n(d),bn(d,i)}),u}function te(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const Te=`Please stop import mirror directly. Instead of that,\r
|
|
1
|
+
var rrweb=function(J){"use strict";var R;(function(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"})(R||(R={}));function Tt(e){return e.nodeType===e.ELEMENT_NODE}function De(e){var t,n=(t=e)===null||t===void 0?void 0:t.host;return Boolean(n?.shadowRoot===e)}var Ke=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var n;if(!t)return-1;var r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var n=this,r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(function(o){return n.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,n){var r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)},e.prototype.replace=function(t,n){this.idNodeMap.set(t,n)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function Nt(){return new Ke}function Qe(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,o=e.value,s=e.maskInputFn,a=o||"";return(t[n.toLowerCase()]||t[r])&&(s?a=s(a):a="*".repeat(a.length)),a}var Et="__rrweb_original__";function Zn(e){var t=e.getContext("2d");if(!t)return!0;for(var n=50,r=0;r<e.width;r+=n)for(var o=0;o<e.height;o+=n){var s=t.getImageData,a=Et in s?s[Et]:s,l=new Uint32Array(a.call(t,r,o,Math.min(n,e.width-r),Math.min(n,e.height-o)).data.buffer);if(l.some(function(c){return c!==0}))return!1}return!0}function wt(e){return e=e.replace(/[^ -~]+/g,""),e=e?.split(" ").map(function(t){return Math.random().toString(20).substr(2,t.length)}).join(" ")||"",e}var Kn=1,Qn=new RegExp("[^a-z0-9-_:]"),Re=-2;function Jn(){return Kn++}function qn(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return Qn.test(t)?"div":t}function Je(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(er).join(""):null}catch{return null}}function er(e){var t=e.cssText;if(tr(e))try{t=Je(e.styleSheet)||t}catch{}return t}function tr(e){return"styleSheet"in e}function nr(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function rr(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var ye,Ct,or=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ir=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,sr=/^(data:)([^,]*),(.*)/i;function $e(e,t){return(e||"").replace(or,function(n,r,o,s,a,l){var c=o||a||l,i=r||s||"";if(!c)return n;if(!ir.test(c)||sr.test(c))return"url("+i+c+i+")";if(c[0]==="/")return"url("+i+(rr(t)+c)+i+")";var u=t.split("/"),d=c.split("/");u.pop();for(var m=0,h=d;m<h.length;m++){var f=h[m];f!=="."&&(f===".."?u.pop():u.push(f))}return"url("+i+u.join("/")+i+")"})}var ar=/^[^ \t\n\r\u000c]+/,lr=/^[, \t\n\r\u000c]+/;function cr(e,t){if(t.trim()==="")return t;var n=0;function r(i){var u,d=i.exec(t.substring(n));return d?(u=d[0],n+=u.length,u):""}for(var o=[];r(lr),!(n>=t.length);){var s=r(ar);if(s.slice(-1)===",")s=Ve(e,s.substring(0,s.length-1)),o.push(s);else{var a="";s=Ve(e,s);for(var l=!1;;){var c=t.charAt(n);if(c===""){o.push((s+a).trim());break}else if(l)c===")"&&(l=!1);else if(c===","){n+=1,o.push((s+a).trim());break}else c==="("&&(l=!0);a+=c,n+=1}}}return o.join(", ")}function Ve(e,t){if(!t||t.trim()==="")return t;var n=e.createElement("a");return n.href=t,n.href}function ur(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function qe(){var e=document.createElement("a");return e.href="",e.href}function It(e,t,n,r){return n==="src"||n==="href"&&r||n==="xlink:href"&&r&&r[0]!=="#"||n==="background"&&r&&(t==="table"||t==="td"||t==="th")?Ve(e,r):n==="srcset"&&r?cr(e,r):n==="style"&&r?$e(r,qe()):t==="object"&&n==="data"&&r?Ve(e,r):r}function dr(e,t,n){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?e.matches(n):!1}function Ue(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?Ue(e.parentNode,t,n):!1;for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?Ue(e.parentNode,t,n):!1}function xt(e,t,n){var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(r===null)return!1;if(typeof t=="string"){if(r.classList.contains(t)||r.closest("."+t))return!0}else if(Ue(r,t,!0))return!0;return!!(n&&(r.matches(n)||r.closest(n)))}function hr(e,t,n){var r=e.contentWindow;if(r){var o=!1,s;try{s=r.document.readyState}catch{return}if(s!=="complete"){var a=setTimeout(function(){o||(t(),o=!0)},n);e.addEventListener("load",function(){clearTimeout(a),o=!0,t()});return}var l="about:blank";if(r.location.href!==l||e.src===l||e.src===""){setTimeout(t,0);return}e.addEventListener("load",t)}}function mr(e){return e.getAttribute("href")?e.sheet!==null:!0}function pr(e,t,n){var r=!1,o;try{o=e.sheet}catch{return}if(!o){var s=setTimeout(function(){r||(t(),r=!0)},n);e.addEventListener("load",function(){clearTimeout(s),r=!0,t()})}}function fr(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,s=t.blockSelector,a=t.maskTextClass,l=t.maskTextSelector,c=t.inlineStylesheet,i=t.maskInputOptions,u=i===void 0?{}:i,d=t.maskTextFn,m=t.maskInputFn,h=t.dataURLOptions,f=h===void 0?{}:h,g=t.inlineImages,N=t.recordCanvas,p=t.keepIframeSrcFn,S=t.newlyAddedElement,y=S===void 0?!1:S,T=t.enableStrictPrivacy,D=gr(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:R.Document,childNodes:[],compatMode:e.compatMode,rootId:D}:{type:R.Document,childNodes:[],rootId:D};case e.DOCUMENT_TYPE_NODE:return{type:R.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:D};case e.ELEMENT_NODE:return yr(e,{doc:n,blockClass:o,blockSelector:s,inlineStylesheet:c,maskInputOptions:u,maskInputFn:m,dataURLOptions:f,inlineImages:g,recordCanvas:N,keepIframeSrcFn:p,newlyAddedElement:y,enableStrictPrivacy:T,rootId:D});case e.TEXT_NODE:return vr(e,{maskTextClass:a,maskTextSelector:l,maskTextFn:d,enableStrictPrivacy:T,rootId:D});case e.CDATA_SECTION_NODE:return{type:R.CDATA,textContent:"",rootId:D};case e.COMMENT_NODE:return{type:R.Comment,textContent:e.textContent||"",rootId:D};default:return!1}}function gr(e,t){if(t.hasNode(e)){var n=t.getId(e);return n===1?void 0:n}}function vr(e,t){var n,r=t.maskTextClass,o=t.maskTextSelector,s=t.maskTextFn,a=t.enableStrictPrivacy,l=t.rootId,c=e.parentNode&&e.parentNode.tagName,i=e.textContent,u=c==="STYLE"?!0:void 0,d=c==="SCRIPT"?!0:void 0,m=!1;if(u&&i){try{e.nextSibling||e.previousSibling||!((n=e.parentNode.sheet)===null||n===void 0)&&n.cssRules&&(i=nr(e.parentNode.sheet))}catch(f){console.warn("Cannot get CSS styles from text's parentNode. Error: "+f,e)}i=$e(i,qe()),m=!0}if(d?(i="SCRIPT_PLACEHOLDER",m=!0):c==="NOSCRIPT"&&(i="",m=!0),!u&&!d&&i&&xt(e,r,o)&&(i=s?s(i):i.replace(/[\S]/g,"*")),a&&!m&&c){var h=new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]);!h.has(c)&&i&&(i=wt(i))}return{type:R.Text,textContent:i||"",isStyle:u,rootId:l}}function yr(e,t){for(var n=t.doc,r=t.blockClass,o=t.blockSelector,s=t.inlineStylesheet,a=t.maskInputOptions,l=a===void 0?{}:a,c=t.maskInputFn,i=t.dataURLOptions,u=i===void 0?{}:i,d=t.inlineImages,m=t.recordCanvas,h=t.keepIframeSrcFn,f=t.newlyAddedElement,g=f===void 0?!1:f,N=t.enableStrictPrivacy,p=t.rootId,S=dr(e,r,o),y=qn(e),T={},D=e.attributes.length,A=0;A<D;A++){var M=e.attributes[A];T[M.name]=It(n,y,M.name,M.value)}if(y==="link"&&s){var F=Array.from(n.styleSheets).find(function(v){return v.href===e.href}),W=null;F&&(W=Je(F)),W&&(delete T.rel,delete T.href,T._cssText=$e(W,F.href))}if(y==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var W=Je(e.sheet);W&&(T._cssText=$e(W,qe()))}if(y==="input"||y==="textarea"||y==="select"){var X=e.value;T.type!=="radio"&&T.type!=="checkbox"&&T.type!=="submit"&&T.type!=="button"&&X?T.value=Qe({type:T.type,tagName:y,value:X,maskInputOptions:l,maskInputFn:c}):e.checked&&(T.checked=e.checked)}if(y==="option"&&(e.selected&&!l.select?T.selected=!0:delete T.selected),y==="canvas"&&m){if(e.__context==="2d")Zn(e)||(T.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var Z=e.toDataURL(u.type,u.quality),K=document.createElement("canvas");K.width=e.width,K.height=e.height;var q=K.toDataURL(u.type,u.quality);Z!==q&&(T.rr_dataURL=Z)}}if(y==="img"&&d){ye||(ye=n.createElement("canvas"),Ct=ye.getContext("2d"));var V=e,z=V.crossOrigin;V.crossOrigin="anonymous";var Y=function(){try{ye.width=V.naturalWidth,ye.height=V.naturalHeight,Ct.drawImage(V,0,0),T.rr_dataURL=ye.toDataURL(u.type,u.quality)}catch(v){console.warn("Cannot inline img src="+V.currentSrc+"! Error: "+v)}z?T.crossOrigin=z:V.removeAttribute("crossorigin")};V.complete&&V.naturalWidth!==0?Y():V.onload=Y}if((y==="audio"||y==="video")&&(T.rr_mediaState=e.paused?"paused":"played",T.rr_mediaCurrentTime=e.currentTime),g||(e.scrollLeft&&(T.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(T.rr_scrollTop=e.scrollTop)),S||y==="img"&&N){var L=e.getBoundingClientRect(),U=L.width,b=L.height;T={class:T.class,rr_width:U+"px",rr_height:b+"px"},S=!0}return y==="iframe"&&!h(T.src)&&(e.contentDocument||(T.rr_src=T.src),delete T.src),{type:R.Element,tagName:y,attributes:T,childNodes:[],isSVG:ur(e)||void 0,needBlock:S,rootId:p}}function _(e){return e===void 0?"":e.toLowerCase()}function br(e,t){return!!(t.comment&&e.type===R.Comment||e.type===R.Element&&(t.script&&(e.tagName==="script"||e.tagName==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js"))||t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(_(e.attributes.name).match(/^msapplication-tile(image|color)$/)||_(e.attributes.name)==="application-name"||_(e.attributes.rel)==="icon"||_(e.attributes.rel)==="apple-touch-icon"||_(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&_(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(_(e.attributes.property).match(/^(og|twitter|fb):/)||_(e.attributes.name).match(/^(og|twitter):/)||_(e.attributes.name)==="pinterest")||t.headMetaRobots&&(_(e.attributes.name)==="robots"||_(e.attributes.name)==="googlebot"||_(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&(_(e.attributes.name)==="author"||_(e.attributes.name)==="generator"||_(e.attributes.name)==="framework"||_(e.attributes.name)==="publisher"||_(e.attributes.name)==="progid"||_(e.attributes.property).match(/^article:/)||_(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(_(e.attributes.name)==="google-site-verification"||_(e.attributes.name)==="yandex-verification"||_(e.attributes.name)==="csrf-token"||_(e.attributes.name)==="p:domain_verify"||_(e.attributes.name)==="verify-v1"||_(e.attributes.name)==="verification"||_(e.attributes.name)==="shopify-checkout-api-token"))))}function be(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,s=t.blockSelector,a=t.maskTextClass,l=t.maskTextSelector,c=t.skipChild,i=c===void 0?!1:c,u=t.inlineStylesheet,d=u===void 0?!0:u,m=t.maskInputOptions,h=m===void 0?{}:m,f=t.maskTextFn,g=t.maskInputFn,N=t.slimDOMOptions,p=t.dataURLOptions,S=p===void 0?{}:p,y=t.inlineImages,T=y===void 0?!1:y,D=t.recordCanvas,A=D===void 0?!1:D,M=t.onSerialize,F=t.onIframeLoad,W=t.iframeLoadTimeout,X=W===void 0?5e3:W,Z=t.onStylesheetLoad,K=t.stylesheetLoadTimeout,q=K===void 0?5e3:K,V=t.keepIframeSrcFn,z=V===void 0?function(){return!1}:V,Y=t.newlyAddedElement,L=Y===void 0?!1:Y,U=t.enableStrictPrivacy,b=t.preserveWhiteSpace,v=b===void 0?!0:b,I=fr(e,{doc:n,mirror:r,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:l,inlineStylesheet:d,maskInputOptions:h,maskTextFn:f,maskInputFn:g,dataURLOptions:S,inlineImages:T,recordCanvas:A,keepIframeSrcFn:z,newlyAddedElement:L,enableStrictPrivacy:U});if(!I)return console.warn(e,"not serialized"),null;var E;if(r.hasNode(e)?E=r.getId(e):br(I,N)||!v&&I.type===R.Text&&!I.isStyle&&!I.textContent.replace(/^\s+|\s+$/gm,"").length?E=Re:E=Jn(),E===Re)return null;var C=Object.assign(I,{id:E});r.add(e,C),M&&M(e);var Q=!i;if(C.type===R.Element){if(Q=Q&&!C.needBlock,C.needBlock&&C.tagName==="img"){var ee=e.cloneNode();ee.src="",r.add(ee,C)}delete C.needBlock,e.shadowRoot&&(C.isShadowHost=!0)}if((C.type===R.Document||C.type===R.Element)&&Q){N.headWhitespace&&C.type===R.Element&&C.tagName==="head"&&(v=!1);for(var ae={doc:n,mirror:r,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:l,skipChild:i,inlineStylesheet:d,maskInputOptions:h,maskTextFn:f,maskInputFn:g,slimDOMOptions:N,dataURLOptions:S,inlineImages:T,recordCanvas:A,preserveWhiteSpace:v,onSerialize:M,onIframeLoad:F,iframeLoadTimeout:X,onStylesheetLoad:Z,stylesheetLoadTimeout:q,keepIframeSrcFn:z,enableStrictPrivacy:U},P=0,j=Array.from(e.childNodes);P<j.length;P++){var ve=j[P],Me=be(ve,ae);Me&&C.childNodes.push(Me)}if(Tt(e)&&e.shadowRoot)for(var St=0,Yn=Array.from(e.shadowRoot.childNodes);St<Yn.length;St++){var ve=Yn[St],Me=be(ve,ae);Me&&(Me.isShadow=!0,C.childNodes.push(Me))}}return e.parentNode&&De(e.parentNode)&&(C.isShadow=!0),C.type===R.Element&&C.tagName==="iframe"&&hr(e,function(){var ke=e.contentDocument;if(ke&&F){var Hn=be(ke,{doc:ke,mirror:r,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:h,maskTextFn:f,maskInputFn:g,slimDOMOptions:N,dataURLOptions:S,inlineImages:T,recordCanvas:A,preserveWhiteSpace:v,onSerialize:M,onIframeLoad:F,iframeLoadTimeout:X,keepIframeSrcFn:z,enableStrictPrivacy:U});Hn&&F(e,Hn)}},X),C.type===R.Element&&C.tagName==="link"&&C.attributes.rel==="stylesheet"&&(pr(e,function(){if(Z){var ke=be(e,{doc:n,mirror:r,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:h,maskTextFn:f,maskInputFn:g,slimDOMOptions:N,dataURLOptions:S,inlineImages:T,recordCanvas:A,preserveWhiteSpace:v,onSerialize:M,onIframeLoad:F,onStylesheetLoad:Z,iframeLoadTimeout:X,keepIframeSrcFn:z,enableStrictPrivacy:U});ke&&Z(e,ke)}},q),mr(e)===!1)?null:C}function Sr(e,t){var n=t||{},r=n.mirror,o=r===void 0?new Ke:r,s=n.blockClass,a=s===void 0?"highlight-block":s,l=n.blockSelector,c=l===void 0?null:l,i=n.maskTextClass,u=i===void 0?"highlight-mask":i,d=n.maskTextSelector,m=d===void 0?null:d,h=n.inlineStylesheet,f=h===void 0?!0:h,g=n.inlineImages,N=g===void 0?!1:g,p=n.recordCanvas,S=p===void 0?!1:p,y=n.maskAllInputs,T=y===void 0?!1:y,D=n.maskTextFn,A=n.maskInputFn,M=n.slimDOM,F=M===void 0?!1:M,W=n.dataURLOptions,X=n.preserveWhiteSpace,Z=n.onSerialize,K=n.onIframeLoad,q=n.iframeLoadTimeout,V=n.onStylesheetLoad,z=n.stylesheetLoadTimeout,Y=n.keepIframeSrcFn,L=Y===void 0?function(){return!1}:Y,U=n.enableStrictPrivacy,b=U===void 0?!1:U,v=T===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:T===!1?{password:!0}:T,I=F===!0||F==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:F==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:F===!1?{}:F;return be(e,{doc:e,mirror:o,blockClass:a,blockSelector:c,maskTextClass:u,maskTextSelector:m,skipChild:!1,inlineStylesheet:f,maskInputOptions:v,maskTextFn:D,maskInputFn:A,slimDOMOptions:I,dataURLOptions:W,inlineImages:N,recordCanvas:S,preserveWhiteSpace:X,onSerialize:Z,onIframeLoad:K,iframeLoadTimeout:q,onStylesheetLoad:V,stylesheetLoadTimeout:z,keepIframeSrcFn:L,newlyAddedElement:!1,enableStrictPrivacy:b})}var Mt=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Tr(e,t){t===void 0&&(t={});var n=1,r=1;function o(b){var v=b.match(/\n/g);v&&(n+=v.length);var I=b.lastIndexOf(`
|
|
2
|
+
`);r=I===-1?r+b.length:b.length-I}function s(){var b={line:n,column:r};return function(v){return v.position=new a(b),f(),v}}var a=function(){function b(v){this.start=v,this.end={line:n,column:r},this.source=t.source}return b}();a.prototype.content=e;var l=[];function c(b){var v=new Error(t.source+":"+n+":"+r+": "+b);if(v.reason=b,v.filename=t.source,v.line=n,v.column=r,v.source=e,t.silent)l.push(v);else throw v}function i(){var b=m();return{type:"stylesheet",stylesheet:{source:t.source,rules:b,parsingErrors:l}}}function u(){return h(/^{\s*/)}function d(){return h(/^}/)}function m(){var b,v=[];for(f(),g(v);e.length&&e.charAt(0)!=="}"&&(b=L()||U());)b!==!1&&(v.push(b),g(v));return v}function h(b){var v=b.exec(e);if(v){var I=v[0];return o(I),e=e.slice(I.length),v}}function f(){h(/^\s*/)}function g(b){b===void 0&&(b=[]);for(var v;v=N();)v!==!1&&b.push(v),v=N();return b}function N(){var b=s();if(!(e.charAt(0)!=="/"||e.charAt(1)!=="*")){for(var v=2;e.charAt(v)!==""&&(e.charAt(v)!=="*"||e.charAt(v+1)!=="/");)++v;if(v+=2,e.charAt(v-1)==="")return c("End of comment missing");var I=e.slice(2,v-2);return r+=2,o(I),e=e.slice(v),r+=2,b({type:"comment",comment:I})}}function p(){var b=h(/^([^{]+)/);if(b)return le(b[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(v){return v.replace(/,/g,"\u200C")}).split(/\s*(?![^(]*\)),\s*/).map(function(v){return v.replace(/\u200C/g,",")})}function S(){var b=s(),v=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(v){var I=le(v[0]);if(!h(/^:\s*/))return c("property missing ':'");var E=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),C=b({type:"declaration",property:I.replace(Mt,""),value:E?le(E[0]).replace(Mt,""):""});return h(/^[;\s]*/),C}}function y(){var b=[];if(!u())return c("missing '{'");g(b);for(var v;v=S();)v!==!1&&(b.push(v),g(b)),v=S();return d()?b:c("missing '}'")}function T(){for(var b,v=[],I=s();b=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)v.push(b[1]),h(/^,\s*/);if(v.length)return I({type:"keyframe",values:v,declarations:y()})}function D(){var b=s(),v=h(/^@([-\w]+)?keyframes\s*/);if(v){var I=v[1];if(v=h(/^([-\w]+)\s*/),!v)return c("@keyframes missing name");var E=v[1];if(!u())return c("@keyframes missing '{'");for(var C,Q=g();C=T();)Q.push(C),Q=Q.concat(g());return d()?b({type:"keyframes",name:E,vendor:I,keyframes:Q}):c("@keyframes missing '}'")}}function A(){var b=s(),v=h(/^@supports *([^{]+)/);if(v){var I=le(v[1]);if(!u())return c("@supports missing '{'");var E=g().concat(m());return d()?b({type:"supports",supports:I,rules:E}):c("@supports missing '}'")}}function M(){var b=s(),v=h(/^@host\s*/);if(v){if(!u())return c("@host missing '{'");var I=g().concat(m());return d()?b({type:"host",rules:I}):c("@host missing '}'")}}function F(){var b=s(),v=h(/^@media *([^{]+)/);if(v){var I=le(v[1]);if(!u())return c("@media missing '{'");var E=g().concat(m());return d()?b({type:"media",media:I,rules:E}):c("@media missing '}'")}}function W(){var b=s(),v=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(v)return b({type:"custom-media",name:le(v[1]),media:le(v[2])})}function X(){var b=s(),v=h(/^@page */);if(v){var I=p()||[];if(!u())return c("@page missing '{'");for(var E=g(),C;C=S();)E.push(C),E=E.concat(g());return d()?b({type:"page",selectors:I,declarations:E}):c("@page missing '}'")}}function Z(){var b=s(),v=h(/^@([-\w]+)?document *([^{]+)/);if(v){var I=le(v[1]),E=le(v[2]);if(!u())return c("@document missing '{'");var C=g().concat(m());return d()?b({type:"document",document:E,vendor:I,rules:C}):c("@document missing '}'")}}function K(){var b=s(),v=h(/^@font-face\s*/);if(v){if(!u())return c("@font-face missing '{'");for(var I=g(),E;E=S();)I.push(E),I=I.concat(g());return d()?b({type:"font-face",declarations:I}):c("@font-face missing '}'")}}var q=Y("import"),V=Y("charset"),z=Y("namespace");function Y(b){var v=new RegExp("^@"+b+"\\s*([^;]+);");return function(){var I=s(),E=h(v);if(E){var C={type:b};return C[b]=E[1].trim(),I(C)}}}function L(){if(e[0]==="@")return D()||F()||W()||A()||q()||V()||z()||Z()||X()||M()||K()}function U(){var b=s(),v=p();return v?(g(),b({type:"rule",selectors:v,declarations:y()})):c("selector missing")}return et(i())}function le(e){return e?e.replace(/^\s+|\s+$/g,""):""}function et(e,t){for(var n=e&&typeof e.type=="string",r=n?e:t,o=0,s=Object.keys(e);o<s.length;o++){var a=s[o],l=e[a];Array.isArray(l)?l.forEach(function(c){et(c,r)}):l&&typeof l=="object"&&et(l,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var kt={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function Nr(e){var t=kt[e.tagName]?kt[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function Er(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Dt=/([^\\]):hover/,wr=new RegExp(Dt.source,"g");function Rt(e,t){var n;if(!(!((n=window?.HIG_CONFIGURATION)===null||n===void 0)&&n.enableOnHoverClass))return e;var r=t?.stylesWithHoverClass.get(e);if(r)return r;var o=Tr(e,{silent:!0});if(!o.stylesheet)return e;var s=[];if(o.stylesheet.rules.forEach(function(c){"selectors"in c&&(c.selectors||[]).forEach(function(i){Dt.test(i)&&s.push(i)})}),s.length===0)return e;var a=new RegExp(s.filter(function(c,i){return s.indexOf(c)===i}).sort(function(c,i){return i.length-c.length}).map(function(c){return Er(c)}).join("|"),"g"),l=e.replace(a,function(c){var i=c.replace(wr,"$1.\\:hover");return c+", "+i});return t?.stylesWithHoverClass.set(e,l),l}function Ot(){var e=new Map;return{stylesWithHoverClass:e}}function Cr(e,t){var n=t.doc,r=t.hackCss,o=t.cache;switch(e.type){case R.Document:return n.implementation.createDocument(null,"",null);case R.DocumentType:return n.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case R.Element:var s=Nr(e),a;e.isSVG?a=n.createElementNS("http://www.w3.org/2000/svg",s):a=n.createElement(s);var l=function(i){if(!e.attributes.hasOwnProperty(i))return"continue";var u=e.attributes[i];if(s==="option"&&i==="selected"&&u===!1)return"continue";if(u=typeof u=="boolean"||typeof u=="number"?"":u,i.startsWith("rr_")){if(s==="canvas"&&i==="rr_dataURL"){var d=document.createElement("img");d.src=u,d.onload=function(){var M=a.getContext("2d");M&&M.drawImage(d,0,0,d.width,d.height)}}else if(s==="img"&&i==="rr_dataURL"){var m=a;m.currentSrc.startsWith("data:")||(m.setAttribute("rrweb-original-src",e.attributes.src),m.src=u)}if(i==="rr_width")a.style.width=u;else if(i==="rr_height")a.style.height=u;else if(i==="rr_mediaCurrentTime")a.currentTime=e.attributes.rr_mediaCurrentTime;else if(i==="rr_mediaState")switch(u){case"played":a.play().catch(function(M){return console.warn("media playback error",M)});break;case"paused":a.pause();break}}else{var h=s==="textarea"&&i==="value",f=s==="style"&&i==="_cssText";if(f&&r&&(u=Rt(u,o),typeof u=="string")){for(var g=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,N=void 0,p=[],S="https://replay-cors-proxy.highlightrun.workers.dev";(N=g.exec(u))!==null;)N.index===g.lastIndex&&g.lastIndex++,N.forEach(function(M,F){if(F===0){var W=M.slice(5,M.length-2);p.push({originalUrl:W,proxyUrl:W.replace(W,S+"?url="+W)})}});p.forEach(function(M){u=u.replace(M.originalUrl,M.proxyUrl)})}if(h||f){for(var y=n.createTextNode(u),T=0,D=Array.from(a.childNodes);T<D.length;T++){var A=D[T];A.nodeType===a.TEXT_NODE&&a.removeChild(A)}return a.appendChild(y),"continue"}try{if(e.isSVG&&i==="xlink:href")a.setAttributeNS("http://www.w3.org/1999/xlink",i,u);else if(i==="onload"||i==="onclick"||i.substring(0,7)==="onmouse")a.setAttribute("_"+i,u);else{if(s==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&i==="content")return a.setAttribute("csp-content",u),"continue";s==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||s==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")||(s==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?a.setAttribute("rrweb-original-srcset",e.attributes.srcset):a.setAttribute(i,u))}}catch{}}};for(var c in e.attributes)l(c);if(e.isShadowHost)if(!a.shadowRoot)a.attachShadow({mode:"open"});else for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);return a;case R.Text:return n.createTextNode(e.isStyle&&r?Rt(e.textContent,o):e.textContent);case R.CDATA:return n.createCDATASection(e.textContent);case R.Comment:return n.createComment(e.textContent);default:return null}}function je(e,t){var n=t.doc,r=t.mirror,o=t.skipChild,s=o===void 0?!1:o,a=t.hackCss,l=a===void 0?!0:a,c=t.afterAppend,i=t.cache,u=Cr(e,{doc:n,hackCss:l,cache:i});if(!u)return null;if(e.rootId&&console.assert(r.getNode(e.rootId)===n,"Target document should have the same root id."),e.type===R.Document&&(n.close(),n.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==R.DocumentType&&(e.childNodes[0].type===R.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),u=n),r.add(u,e),(e.type===R.Document||e.type===R.Element)&&!s)for(var d=0,m=e.childNodes;d<m.length;d++){var h=m[d],f=je(h,{doc:n,mirror:r,skipChild:!1,hackCss:l,afterAppend:c,cache:i});if(!f){console.warn("Failed to rebuild",h);continue}h.isShadow&&Tt(u)&&u.shadowRoot?u.shadowRoot.appendChild(f):u.appendChild(f),c&&c(f)}return u}function Ir(e,t){function n(a){t(a)}for(var r=0,o=e.getIds();r<o.length;r++){var s=o[r];e.has(s)&&n(e.getNode(s))}}function xr(e,t){var n=t.getMeta(e);if(n?.type===R.Element){var r=e;for(var o in n.attributes)if(n.attributes.hasOwnProperty(o)&&o.startsWith("rr_")){var s=n.attributes[o];o==="rr_scrollLeft"&&(r.scrollLeft=s),o==="rr_scrollTop"&&(r.scrollTop=s)}}}function Mr(e,t){var n=t.doc,r=t.onVisit,o=t.hackCss,s=o===void 0?!0:o,a=t.afterAppend,l=t.cache,c=t.mirror,i=c===void 0?new Ke:c,u=je(e,{doc:n,mirror:i,skipChild:!1,hackCss:s,afterAppend:a,cache:l});return Ir(i,function(d){r&&r(d),xr(d,i)}),u}function te(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const Se=`Please stop import mirror directly. Instead of that,\r
|
|
3
3
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
4
|
-
or you can use record.mirror to access the mirror instance during recording.`;q.mirror={map:{},getId(){return console.error(Te),-1},getNode(){return console.error(Te),null},removeNodeFromMap(){console.error(Te)},has(){return console.error(Te),!1},reset(){console.error(Te)}},typeof window<"u"&&window.Proxy&&window.Reflect&&(q.mirror=new Proxy(q.mirror,{get(e,t,r){return t==="map"&&console.error(Te),Reflect.get(e,t,r)}}));function Ne(e,t,r={}){let n=null,o=0;return function(s){const a=Date.now();!o&&r.leading===!1&&(o=a);const l=t-(a-o),c=this,i=arguments;l<=0||l>t?(n&&(clearTimeout(n),n=null),o=a,e.apply(c,i)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{o=r.leading===!1?0:Date.now(),n=null,e.apply(c,i)},l))}}function Oe(e,t,r,n,o=window){const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(a){setTimeout(()=>{r.set.call(this,a)},0),s&&s.set&&s.set.call(this,a)}}),()=>Oe(e,t,s||{},!0)}function pe(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],o=r(n);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,()=>{e[t]=n}}catch{return()=>{}}}function tt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function rt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}const At=e=>{try{if(e instanceof HTMLElement)return e.tagName==="CANVAS"}catch{return!1}return!1};function ee(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){let r=!1;if(typeof t=="string"){if(e.closest!==void 0)return e.closest("."+t)!==null;r=e.classList.contains(t)}else e.classList.forEach(n=>{t.test(n)&&(r=!0)});return r||ee(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,ee(e.parentNode,t)}function Lt(e,t){return t.getId(e)!==-1}function Ge(e,t){return t.getId(e)===Re}function nt(e,t){if(ke(e))return!1;const r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?nt(e.parentNode,t):!0:!0}function ot(e){return Boolean(e.changedTouches)}function it(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),Node.prototype.contains||(Node.prototype.contains=function(t){if(!(0 in arguments))throw new TypeError("1 argument is required");do if(this===t)return!0;while(t=t&&t.parentNode);return!1})}function _t(e){const t={},r=(o,s)=>{const a={value:o,parent:s,children:[]};return t[o.node.id]=a,a},n=[];for(const o of e){const{nextId:s,parentId:a}=o;if(s&&s in t){const l=t[s];if(l.parent){const c=l.parent.children.indexOf(l);l.parent.children.splice(c,0,r(o,l.parent))}else{const c=n.indexOf(l);n.splice(c,0,r(o,null))}continue}if(a in t){const l=t[a];l.children.push(r(o,l));continue}n.push(r(o,null))}return n}function st(e,t){t(e.value);for(let r=e.children.length-1;r>=0;r--)st(e.children[r],t)}function Ee(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function Ft(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function at(e,t){var r,n;const o=(n=(r=e.ownerDocument)==null?void 0:r.defaultView)==null?void 0:n.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const s=o.getBoundingClientRect(),a=at(o,t),l=s.height/o.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}}function Ae(e){return Boolean(e?.shadowRoot)}function we(e,t){const r=e[t[0]];return t.length===1?r:we(r.cssRules[t[1]].cssRules,t.slice(2))}function lt(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function Pt(e){const t=new Set,r=[];for(let n=e.length;n--;){const o=e[n];t.has(o.id)||(r.push(o),t.add(o.id))}return r}var Tn=Object.freeze({__proto__:null,on:te,get _mirror(){return q.mirror},throttle:Ne,hookSetter:Oe,patch:pe,getWindowHeight:tt,getWindowWidth:rt,isCanvasNode:At,isBlocked:ee,isSerialized:Lt,isIgnored:Ge,isAncestorRemoved:nt,isTouchEvent:ot,polyfill:it,queueToResolveTrees:_t,iterateResolveTree:st,isSerializedIframe:Ee,isSerializedStylesheet:Ft,getBaseDimension:at,hasShadowRoot:Ae,getNestedRule:we,getPositionsAndIndex:lt,uniqueTextMutations:Pt}),M=(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))(M||{}),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))(x||{}),Y=(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))(Y||{}),ce=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ce||{}),fe=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(fe||{}),O=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e))(O||{});function Wt(e){return"__ln"in e}class Nn{constructor(){this.length=0,this.head=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=r?.next||null;return r}addNode(t){const r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&Wt(t.previousSibling)){const n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&Wt(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;this.length++}removeNode(t){const r=t.__ln;!this.head||(r.previous?(r.previous.next=r.next,r.next&&(r.next.previous=r.previous)):(this.head=r.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}}const $t=(e,t)=>`${e}@${t}`;class En{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],r=new Nn,n=l=>{let c=l,i=Re;for(;i===Re;)c=c&&c.nextSibling,i=c&&this.mirror.getId(c);return i},o=l=>{var c,i,u,d,m;const h=l.getRootNode?(c=l.getRootNode())==null?void 0:c.host:null;let g=h;for(;(u=(i=g?.getRootNode)==null?void 0:i.call(g))!=null&&u.host;)g=((m=(d=g?.getRootNode)==null?void 0:d.call(g))==null?void 0:m.host)||null;const f=!this.doc.contains(l)&&(!g||!this.doc.contains(g));if(!l.parentNode||f)return;const S=ke(l.parentNode)?this.mirror.getId(h):this.mirror.getId(l.parentNode),p=n(l);if(S===-1||p===-1)return r.addNode(l);const b=Se(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,enableStrictPrivacy:this.enableStrictPrivacy,onSerialize:N=>{Ee(N,this.mirror)&&this.iframeManager.addIframe(N),Ft(N,this.mirror)&&this.stylesheetManager.addStylesheet(N),Ae(l)&&this.shadowDomManager.addShadowRoot(l.shadowRoot,document)},onIframeLoad:(N,I)=>{this.iframeManager.attachIframe(N,I,this.mirror),this.shadowDomManager.observeAttachShadow(N)},onStylesheetLoad:(N,I)=>{this.stylesheetManager.attachStylesheet(N,I,this.mirror)}});b&&t.push({parentId:S,nextId:p,node:b})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const l of Array.from(this.movedSet.values()))ut(this.removes,l,this.mirror)&&!this.movedSet.has(l.parentNode)||o(l);for(const l of Array.from(this.addedSet.values()))!dt(this.droppedSet,l)&&!ut(this.removes,l,this.mirror)||dt(this.movedSet,l)?o(l):this.droppedSet.add(l);let s=null;for(;r.length;){let l=null;if(s){const c=this.mirror.getId(s.value.parentNode),i=n(s.value);c!==-1&&i!==-1&&(l=s)}if(!l)for(let c=r.length-1;c>=0;c--){const i=r.get(c);if(i){const u=this.mirror.getId(i.value.parentNode),d=n(i.value);if(u!==-1&&d!==-1){l=i;break}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}s=l.previous,r.removeNode(l.value),o(l.value)}const a={texts:this.texts.map(l=>{let c=l.value;return this.enableStrictPrivacy&&c&&(c=Ct(c)),{id:this.mirror.getId(l.node),value:c}}).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>({id:this.mirror.getId(l.node),attributes:l.attributes})).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:t};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.processMutation=t=>{if(!Ge(t.target,this.mirror))switch(t.type){case"characterData":{const r=t.target.textContent;!ee(t.target,this.blockClass)&&r!==t.oldValue&&this.texts.push({value:Ue(t.target,this.maskTextClass,this.maskTextSelector)&&r?this.maskTextFn?this.maskTextFn(r):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let n=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(n=Qe({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),ee(t.target,this.blockClass)||n===t.oldValue)return;let o=this.attributes.find(s=>s.node===t.target);if(o||(o={node:t.target,attributes:{}},this.attributes.push(o)),t.attributeName==="style"){const s=this.doc.createElement("span");t.oldValue&&s.setAttribute("style",t.oldValue),(o.attributes.style===void 0||o.attributes.style===null)&&(o.attributes.style={});const a=o.attributes.style;for(const l of Array.from(r.style)){const c=r.style.getPropertyValue(l),i=r.style.getPropertyPriority(l);(c!==s.style.getPropertyValue(l)||i!==s.style.getPropertyPriority(l))&&(i===""?a[l]=c:a[l]=[c,i])}for(const l of Array.from(s.style))r.style.getPropertyValue(l)===""&&(a[l]=!1)}else{if(t.target.tagName==="INPUT"){const s=t.target;if(s.type==="password"){o.attributes.value="*".repeat(s.value.length);break}}o.attributes[t.attributeName]=Mt(this.doc,t.target.tagName,t.attributeName,n)}break}case"childList":{t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{const n=this.mirror.getId(r),o=ke(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);ee(t.target,this.blockClass)||Ge(r,this.mirror)||!Lt(r,this.mirror)||(this.addedSet.has(r)?(ct(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||nt(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[$t(n,o)]?ct(this.movedSet,r):this.removes.push({parentId:o,id:n,isShadow:ke(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,r)=>{if(!(r&&ee(r,this.blockClass))){if(this.mirror.getMeta(t)){if(Ge(t,this.mirror))return;this.movedSet.add(t);let n=null;r&&this.mirror.getMeta(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[$t(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);ee(t,this.blockClass)||t.childNodes.forEach(n=>this.genAdds(n))}}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","enableStrictPrivacy"].forEach(r=>{this[r]=t[r]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function ct(e,t){e.delete(t),t.childNodes.forEach(r=>ct(e,r))}function ut(e,t,r){const{parentNode:n}=t;if(!n)return!1;const o=r.getId(n);return e.some(s=>s.id===o)?!0:ut(e,n,r)}function dt(e,t){const{parentNode:r}=t;return r?e.has(r)?!0:dt(e,r):!1}var wn=Object.defineProperty,Cn=Object.defineProperties,In=Object.getOwnPropertyDescriptors,Vt=Object.getOwnPropertySymbols,Mn=Object.prototype.hasOwnProperty,xn=Object.prototype.propertyIsEnumerable,Ut=(e,t,r)=>t in e?wn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jt=(e,t)=>{for(var r in t||(t={}))Mn.call(t,r)&&Ut(e,r,t[r]);if(Vt)for(var r of Vt(t))xn.call(t,r)&&Ut(e,r,t[r]);return e},Dn=(e,t)=>Cn(e,In(t));const ge=[],Gt=typeof CSSGroupingRule<"u",Bt=typeof CSSMediaRule<"u",zt=typeof CSSSupportsRule<"u",Ht=typeof CSSConditionRule<"u";function Le(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch{return e.target}}function Yt(e,t){var r,n;const o=new En;ge.push(o),o.init(e);let s=window.MutationObserver||window.__rrMutationObserver;const a=(n=(r=window?.Zone)==null?void 0:r.__symbol__)==null?void 0:n.call(r,"MutationObserver");a&&window[a]&&(s=window[a]);const l=new s(o.processMutations.bind(o));return l.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),l}function kn({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,s=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let a=[],l;const c=Ne(d=>{const m=Date.now()-l;e(a.map(h=>(h.timeOffset-=m,h)),d),a=[],l=null},s),i=Ne(d=>{const m=Le(d),{clientX:h,clientY:g}=ot(d)?d.changedTouches[0]:d;l||(l=Date.now()),a.push({x:h,y:g,id:n.getId(m),timeOffset:Date.now()-l}),c(typeof DragEvent<"u"&&d instanceof DragEvent?x.Drag:d instanceof MouseEvent?x.MouseMove:x.TouchMove)},o,{trailing:!1}),u=[te("mousemove",i,r),te("touchmove",i,r),te("drag",i,r)];return()=>{u.forEach(d=>d())}}function Rn({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const s=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[],l=c=>i=>{const u=Le(i);if(ee(u,n)||At(u))return;const d=ot(i)?i.changedTouches[0]:i;if(!d)return;const m=r.getId(u),{clientX:h,clientY:g}=d;e({type:Y[c],id:m,x:h,y:g})};return Object.keys(Y).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&s[c]!==!1).forEach(c=>{const i=c.toLowerCase(),u=l(c);a.push(te(i,u,t))}),()=>{a.forEach(c=>c())}}function Xt({scrollCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){const s=Ne(a=>{const l=Le(a);if(!l||ee(l,n))return;const c=r.getId(l);if(l===t){const i=t.scrollingElement||t.documentElement;e({id:c,x:i.scrollLeft,y:i.scrollTop})}else e({id:c,x:l.scrollLeft,y:l.scrollTop})},o.scroll||100);return te("scroll",s,t)}function On({viewportResizeCb:e}){let t=-1,r=-1;const n=Ne(()=>{const o=tt(),s=rt();(t!==o||r!==s)&&(e({width:Number(s),height:Number(o)}),t=o,r=s)},200);return te("resize",n,window)}function Zt(e,t){const r=jt({},e);return t||delete r.userTriggered,r}const An=["INPUT","TEXTAREA","SELECT"],Kt=new WeakMap;function Ln({inputCb:e,doc:t,mirror:r,blockClass:n,ignoreClass:o,maskInputOptions:s,maskInputFn:a,sampling:l,userTriggeredOnInput:c}){function i(g){let f=Le(g);const S=g.isTrusted;if(f&&f.tagName==="OPTION"&&(f=f.parentElement),!f||!f.tagName||An.indexOf(f.tagName)<0||ee(f,n))return;const p=f.type;if(f.classList.contains(o))return;let b=f.value,N=!1;p==="radio"||p==="checkbox"?N=f.checked:(s[f.tagName.toLowerCase()]||s[p])&&(b=Qe({maskInputOptions:s,tagName:f.tagName,type:p,value:b,maskInputFn:a})),u(f,Zt({text:b,isChecked:N,userTriggered:S},c));const I=f.name;p==="radio"&&I&&N&&t.querySelectorAll(`input[type="radio"][name="${I}"]`).forEach(P=>{P!==f&&u(P,Zt({text:P.value,isChecked:!N,userTriggered:!1},c))})}function u(g,f){const S=Kt.get(g);if(!S||S.text!==f.text||S.isChecked!==f.isChecked){Kt.set(g,f);const p=r.getId(g);e(Dn(jt({},f),{id:p}))}}const d=(l.input==="last"?["change"]:["input","change"]).map(g=>te(g,i,t)),m=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),h=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return m&&m.set&&d.push(...h.map(g=>Oe(g[0],g[1],{set(){i({target:this})}}))),()=>{d.forEach(g=>g())}}function Be(e){const t=[];function r(n,o){if(Gt&&n.parentRule instanceof CSSGroupingRule||Bt&&n.parentRule instanceof CSSMediaRule||zt&&n.parentRule instanceof CSSSupportsRule||Ht&&n.parentRule instanceof CSSConditionRule){const s=Array.from(n.parentRule.cssRules).indexOf(n);o.unshift(s)}else{const s=Array.from(n.parentStyleSheet.cssRules).indexOf(n);o.unshift(s)}return o}return r(e,t)}function _n({styleSheetRuleCb:e,mirror:t},{win:r}){const n=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=function(l,c){const i=t.getId(this.ownerNode);return i!==-1&&e({id:i,adds:[{rule:l,index:c}]}),n.apply(this,arguments)};const o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=function(l){const c=t.getId(this.ownerNode);return c!==-1&&e({id:c,removes:[{index:l}]}),o.apply(this,arguments)};const s={};Gt?s.CSSGroupingRule=r.CSSGroupingRule:(Bt&&(s.CSSMediaRule=r.CSSMediaRule),Ht&&(s.CSSConditionRule=r.CSSConditionRule),zt&&(s.CSSSupportsRule=r.CSSSupportsRule));const a={};return Object.entries(s).forEach(([l,c])=>{a[l]={insertRule:c.prototype.insertRule,deleteRule:c.prototype.deleteRule},c.prototype.insertRule=function(i,u){const d=t.getId(this.parentStyleSheet.ownerNode);return d!==-1&&e({id:d,adds:[{rule:i,index:[...Be(this),u||0]}]}),a[l].insertRule.apply(this,arguments)},c.prototype.deleteRule=function(i){const u=t.getId(this.parentStyleSheet.ownerNode);return u!==-1&&e({id:u,removes:[{index:[...Be(this),i]}]}),a[l].deleteRule.apply(this,arguments)}}),()=>{r.CSSStyleSheet.prototype.insertRule=n,r.CSSStyleSheet.prototype.deleteRule=o,Object.entries(s).forEach(([l,c])=>{c.prototype.insertRule=a[l].insertRule,c.prototype.deleteRule=a[l].deleteRule})}}function Fn({styleDeclarationCb:e,mirror:t},{win:r}){const n=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=function(s,a,l){var c,i;const u=t.getId((i=(c=this.parentRule)==null?void 0:c.parentStyleSheet)==null?void 0:i.ownerNode);return u!==-1&&e({id:u,set:{property:s,value:a,priority:l},index:Be(this.parentRule)}),n.apply(this,arguments)};const o=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=function(s){var a,l;const c=t.getId((l=(a=this.parentRule)==null?void 0:a.parentStyleSheet)==null?void 0:l.ownerNode);return c!==-1&&e({id:c,remove:{property:s},index:Be(this.parentRule)}),o.apply(this,arguments)},()=>{r.CSSStyleDeclaration.prototype.setProperty=n,r.CSSStyleDeclaration.prototype.removeProperty=o}}function Pn({mediaInteractionCb:e,blockClass:t,mirror:r,sampling:n}){const o=a=>Ne(l=>{const c=Le(l);if(!c||ee(c,t))return;const{currentTime:i,volume:u,muted:d}=c;e({type:a,id:r.getId(c),currentTime:i,volume:u,muted:d})},n.media||500),s=[te("play",o(fe.Play)),te("pause",o(fe.Pause)),te("seeked",o(fe.Seeked)),te("volumechange",o(fe.VolumeChange))];return()=>{s.forEach(a=>a())}}function Wn({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],o=new WeakMap,s=r.FontFace;r.FontFace=function(l,c,i){const u=new s(l,c,i);return o.set(u,{family:l,buffer:typeof c!="string",descriptors:i,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),u};const a=pe(t.fonts,"add",function(l){return function(c){return setTimeout(()=>{const i=o.get(c);i&&(e(i),o.delete(c))},0),l.apply(this,[c])}});return n.push(()=>{r.FontFace=s}),n.push(a),()=>{n.forEach(l=>l())}}function $n(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:s,viewportResizeCb:a,inputCb:l,mediaInteractionCb:c,styleSheetRuleCb:i,styleDeclarationCb:u,canvasMutationCb:d,fontCb:m}=e;e.mutationCb=(...h)=>{t.mutation&&t.mutation(...h),r(...h)},e.mousemoveCb=(...h)=>{t.mousemove&&t.mousemove(...h),n(...h)},e.mouseInteractionCb=(...h)=>{t.mouseInteraction&&t.mouseInteraction(...h),o(...h)},e.scrollCb=(...h)=>{t.scroll&&t.scroll(...h),s(...h)},e.viewportResizeCb=(...h)=>{t.viewportResize&&t.viewportResize(...h),a(...h)},e.inputCb=(...h)=>{t.input&&t.input(...h),l(...h)},e.mediaInteractionCb=(...h)=>{t.mediaInteaction&&t.mediaInteaction(...h),c(...h)},e.styleSheetRuleCb=(...h)=>{t.styleSheetRule&&t.styleSheetRule(...h),i(...h)},e.styleDeclarationCb=(...h)=>{t.styleDeclaration&&t.styleDeclaration(...h),u(...h)},e.canvasMutationCb=(...h)=>{t.canvasMutation&&t.canvasMutation(...h),d(...h)},e.fontCb=(...h)=>{t.font&&t.font(...h),m(...h)}}function Vn(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};$n(e,t);const n=Yt(e,e.doc),o=kn(e),s=Rn(e),a=Xt(e),l=On(e),c=Ln(e),i=Pn(e),u=_n(e,{win:r}),d=Fn(e,{win:r}),m=e.collectFonts?Wn(e):()=>{},h=[];for(const g of e.plugins)h.push(g.observer(g.callback,r,g.options));return()=>{ge.forEach(g=>g.reset()),n.disconnect(),o(),s(),a(),l(),c(),i(),u(),d(),m(),h.forEach(g=>g())}}class Un{constructor(t){this.iframes=new WeakMap,this.mutationCb=t.mutationCb}addIframe(t){this.iframes.set(t,!0)}addLoadListener(t){this.loadListener=t}attachIframe(t,r,n){var o;this.mutationCb({adds:[{parentId:n.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(o=this.loadListener)==null||o.call(this,t)}}var jn=Object.defineProperty,Gn=Object.defineProperties,Bn=Object.getOwnPropertyDescriptors,Qt=Object.getOwnPropertySymbols,zn=Object.prototype.hasOwnProperty,Hn=Object.prototype.propertyIsEnumerable,Jt=(e,t,r)=>t in e?jn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,qt=(e,t)=>{for(var r in t||(t={}))zn.call(t,r)&&Jt(e,r,t[r]);if(Qt)for(var r of Qt(t))Hn.call(t,r)&&Jt(e,r,t[r]);return e},er=(e,t)=>Gn(e,Bn(t));class Yn{constructor(t){this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;const r=this;this.restorePatches.push(pe(HTMLElement.prototype,"attachShadow",function(n){return function(){const o=n.apply(this,arguments);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,this.ownerDocument),o}}))}addShadowRoot(t,r){Yt(er(qt({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),Xt(er(qt({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}observeAttachShadow(t){if(t.contentWindow){const r=this;this.restorePatches.push(pe(t.contentWindow.HTMLElement.prototype,"attachShadow",function(n){return function(){const o=n.apply(this,arguments);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,t.contentDocument),o}}))}}reset(){this.restorePatches.forEach(t=>t())}}for(var Ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_e=typeof Uint8Array>"u"?[]:new Uint8Array(256),ze=0;ze<Ce.length;ze++)_e[Ce.charCodeAt(ze)]=ze;var Xn=function(e){var t=new Uint8Array(e),r,n=t.length,o="";for(r=0;r<n;r+=3)o+=Ce[t[r]>>2],o+=Ce[(t[r]&3)<<4|t[r+1]>>4],o+=Ce[(t[r+1]&15)<<2|t[r+2]>>6],o+=Ce[t[r+2]&63];return n%3===2?o=o.substring(0,o.length-1)+"=":n%3===1&&(o=o.substring(0,o.length-2)+"=="),o},Zn=function(e){var t=e.length*.75,r=e.length,n,o=0,s,a,l,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var i=new ArrayBuffer(t),u=new Uint8Array(i);for(n=0;n<r;n+=4)s=_e[e.charCodeAt(n)],a=_e[e.charCodeAt(n+1)],l=_e[e.charCodeAt(n+2)],c=_e[e.charCodeAt(n+3)],u[o++]=s<<2|a>>4,u[o++]=(a&15)<<4|l>>2,u[o++]=(l&3)<<6|c&63;return i};const tr=new Map;function Kn(e,t){let r=tr.get(e);return r||(r=new Map,tr.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}const rr=(e,t,r)=>{if(!e||!(or(e,t)||typeof e=="object"))return;const n=e.constructor.name,o=Kn(r,n);let s=o.indexOf(e);return s===-1&&(s=o.length,o.push(e)),s};function He(e,t,r){if(e instanceof Array)return e.map(n=>He(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){const n=e.constructor.name,o=Xn(e);return{rr_type:n,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[He(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const n=e.constructor.name,{src:o}=e;return{rr_type:n,src:o}}else if(e instanceof HTMLCanvasElement){const n="HTMLImageElement",o=e.toDataURL();return{rr_type:n,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[He(e.data,t,r),e.width,e.height]};if(or(e,t)||typeof e=="object"){const n=e.constructor.name,o=rr(e,t,r);return{rr_type:n,index:o}}}}return e}const nr=(e,t,r)=>[...e].map(n=>He(n,t,r)),or=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(n=>typeof t[n]=="function");return Boolean(r.find(n=>e instanceof t[n]))};function Qn(e,t,r,n){const o=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of s)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;const l=pe(t.CanvasRenderingContext2D.prototype,a,function(c){return function(...i){return ee(this.canvas,r)||setTimeout(()=>{const u=nr([...i],t,this);e(this.canvas,{type:ce["2D"],property:a,args:u})},0),c.apply(this,i)}});o.push(l)}catch{const c=Oe(t.CanvasRenderingContext2D.prototype,a,{set(i){e(this.canvas,{type:ce["2D"],property:a,args:[i],setter:!0})}});o.push(c)}return()=>{o.forEach(a=>a())}}function ir(e,t){const r=[];try{const n=pe(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(s,...a){return ee(this,t)||"__context"in this||(this.__context=s),o.apply(this,[s,...a])}});r.push(n)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(n=>n())}}function sr(e,t,r,n,o,s){const a=[],l=Object.getOwnPropertyNames(e);for(const c of l)try{if(typeof e[c]!="function")continue;const i=pe(e,c,function(u){return function(...d){const m=u.apply(this,d);if(rr(m,s,e),!ee(this.canvas,n)){const h=o.getId(this.canvas),g=nr([...d],s,e),f={type:t,property:c,args:g};r(this.canvas,f)}return m}});a.push(i)}catch{const u=Oe(e,c,{set(d){r(this.canvas,{type:t,property:c,args:[d],setter:!0})}});a.push(u)}return a}function Jn(e,t,r,n){const o=[];return o.push(...sr(t.WebGLRenderingContext.prototype,ce.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...sr(t.WebGL2RenderingContext.prototype,ce.WebGL2,e,r,n,t)),()=>{o.forEach(s=>s())}}function qn(e,t){var r=atob(e);if(t){for(var n=new Uint8Array(r.length),o=0,s=r.length;o<s;++o)n[o]=r.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}function eo(e,t,r){var n=t===void 0?null:t,o=r===void 0?!1:r,s=qn(e,o),a=s.indexOf(`
|
|
5
|
-
`,10)+1,l=s.substring(a)+(n?"//# sourceMappingURL="+n:""),c=new Blob([l],{type:"application/javascript"});return URL.createObjectURL(c)}function to(e,t,r){var n;return function(s){return n=n||eo(e,t,r),new Worker(n,s)}}var ro=to("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Zm9yKHZhciByPSJBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OSsvIixsPXR5cGVvZiBVaW50OEFycmF5PiJ1Ij9bXTpuZXcgVWludDhBcnJheSgyNTYpLGY9MDtmPHIubGVuZ3RoO2YrKylsW3IuY2hhckNvZGVBdChmKV09Zjt2YXIgZD1mdW5jdGlvbihzKXt2YXIgZT1uZXcgVWludDhBcnJheShzKSxuLGE9ZS5sZW5ndGgsdD0iIjtmb3Iobj0wO248YTtuKz0zKXQrPXJbZVtuXT4+Ml0sdCs9clsoZVtuXSYzKTw8NHxlW24rMV0+PjRdLHQrPXJbKGVbbisxXSYxNSk8PDJ8ZVtuKzJdPj42XSx0Kz1yW2VbbisyXSY2M107cmV0dXJuIGElMz09PTI/dD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTEpKyI9IjphJTM9PT0xJiYodD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTIpKyI9PSIpLHR9O2NvbnN0IGM9bmV3IE1hcCx1PW5ldyBNYXA7YXN5bmMgZnVuY3Rpb24gcChzLGUpe2NvbnN0IG49YCR7c30tJHtlfWA7aWYodS5oYXMobikpcmV0dXJuIHUuZ2V0KG4pO2NvbnN0IGE9bmV3IE9mZnNjcmVlbkNhbnZhcyhzLGUpO2EuZ2V0Q29udGV4dCgiMmQiKTtjb25zdCB0PWF3YWl0KGF3YWl0IGEuY29udmVydFRvQmxvYigpKS5hcnJheUJ1ZmZlcigpLGc9ZCh0KTtyZXR1cm4gdS5zZXQobixnKSxnfWNvbnN0IGk9c2VsZjtpLm9ubWVzc2FnZT1hc3luYyBmdW5jdGlvbihzKXtpZighKCJPZmZzY3JlZW5DYW52YXMiaW4gZ2xvYmFsVGhpcykpcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOnMuZGF0YS5pZH0pO2NvbnN0e2lkOmUsYml0bWFwOm4sd2lkdGg6YSxoZWlnaHQ6dH09cy5kYXRhLGc9cChhLHQpLGg9bmV3IE9mZnNjcmVlbkNhbnZhcyhhLHQpO2guZ2V0Q29udGV4dCgiMmQiKS5kcmF3SW1hZ2UobiwwLDApLG4uY2xvc2UoKTtjb25zdCB3PWF3YWl0IGguY29udmVydFRvQmxvYigpLHk9dy50eXBlLGI9YXdhaXQgdy5hcnJheUJ1ZmZlcigpLG89ZChiKTtpZighYy5oYXMoZSkmJmF3YWl0IGc9PT1vKXJldHVybiBjLnNldChlLG8pLGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpZihjLmdldChlKT09PW8pcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpLnBvc3RNZXNzYWdlKHtpZDplLHR5cGU6eSxiYXNlNjQ6byx3aWR0aDphLGhlaWdodDp0fSksYy5zZXQoZSxvKX19KSgpOwoK",null,!1),ar=Object.getOwnPropertySymbols,no=Object.prototype.hasOwnProperty,oo=Object.prototype.propertyIsEnumerable,io=(e,t)=>{var r={};for(var n in e)no.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ar)for(var n of ar(e))t.indexOf(n)<0&&oo.call(e,n)&&(r[n]=e[n]);return r},so=(e,t,r)=>new Promise((n,o)=>{var s=c=>{try{l(r.next(c))}catch(i){o(i)}},a=c=>{try{l(r.throw(c))}catch(i){o(i)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,a);l((r=r.apply(e,t)).next())});class ao{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(a,l){(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(l)};const{sampling:r="all",win:n,blockClass:o,recordCanvas:s}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&r==="all"&&this.initCanvasMutationObserver(n,o),s&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,o)}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,n){const o=ir(r,n),s=new Map,a=new ro;a.onmessage=d=>{const{id:m}=d.data;if(s.set(m,!1),!("base64"in d.data))return;const{base64:h,type:g,width:f,height:S}=d.data;this.mutationCb({id:m,type:ce["2D"],commands:[{property:"clearRect",args:[0,0,f,S]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:h}],type:g}]},0,0]}]})};const l=1e3/t;let c=0,i;const u=d=>{if(c&&d-c<l){i=requestAnimationFrame(u);return}c=d,r.document.querySelectorAll(`canvas:not(.${n} *)`).forEach(m=>so(this,null,function*(){var h;const g=this.mirror.getId(m);if(s.get(g))return;if(s.set(g,!0),["webgl","webgl2"].includes(m.__context)){const S=m.getContext(m.__context);((h=S?.getContextAttributes())==null?void 0:h.preserveDrawingBuffer)===!1&&S?.clear(S.COLOR_BUFFER_BIT)}const f=yield createImageBitmap(m);a.postMessage({id:g,bitmap:f,width:m.width,height:m.height},[f])})),i=requestAnimationFrame(u)};i=requestAnimationFrame(u),this.resetObservers=()=>{o(),cancelAnimationFrame(i)}}initCanvasMutationObserver(t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=ir(t,r),o=Qn(this.processMutation.bind(this),t,r,this.mirror),s=Jn(this.processMutation.bind(this),t,r,this.mirror);this.resetObservers=()=>{n(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;const o=n.map(a=>io(a,["type"])),{type:s}=n[0];this.mutationCb({id:r,type:s,commands:o}),this.pendingCanvasMutations.delete(t)}}class lo{constructor(t){this.trackedStylesheets=new WeakSet,this.mutationCb=t.mutationCb}addStylesheet(t){this.trackedStylesheets.has(t)||(this.trackedStylesheets.add(t),this.trackStylesheet(t))}trackStylesheet(t){}attachStylesheet(t,r,n){this.mutationCb({adds:[{parentId:n.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[]}),this.addStylesheet(t)}}var co=Object.defineProperty,uo=Object.defineProperties,ho=Object.getOwnPropertyDescriptors,lr=Object.getOwnPropertySymbols,mo=Object.prototype.hasOwnProperty,po=Object.prototype.propertyIsEnumerable,cr=(e,t,r)=>t in e?co(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,oe=(e,t)=>{for(var r in t||(t={}))mo.call(t,r)&&cr(e,r,t[r]);if(lr)for(var r of lr(t))po.call(t,r)&&cr(e,r,t[r]);return e},fo=(e,t)=>uo(e,ho(t));function Q(e){return fo(oe({},e),{timestamp:Date.now()})}let z,Fe;const de=Et();function ye(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="highlight-block",blockSelector:s=null,ignoreClass:a="highlight-ignore",maskTextClass:l="highlight-mask",maskTextSelector:c=null,inlineStylesheet:i=!0,maskAllInputs:u,maskInputOptions:d,slimDOMOptions:m,maskInputFn:h,maskTextFn:g,hooks:f,packFn:S,sampling:p={},mousemoveWait:b,recordCanvas:N=!1,userTriggeredOnInput:I=!1,collectFonts:P=!1,inlineImages:A=!1,plugins:C,keepIframeSrcFn:w=()=>!1,enableStrictPrivacy:H=!1}=e;if(!t)throw new Error("emit function is required");b!==void 0&&p.mousemove===void 0&&(p.mousemove=b),de.reset();const X=u===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:d!==void 0?d:{password:!0},Z=m===!0||m==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:m==="all",headMetaDescKeywords:m==="all"}:m||{};it();let J,B=0;const ne=E=>{for(const R of C||[])R.eventProcessor&&(E=R.eventProcessor(E));return S&&(E=S(E)),E};z=(E,R)=>{var j;if(((j=ge[0])==null?void 0:j.isFrozen())&&E.type!==M.FullSnapshot&&!(E.type===M.IncrementalSnapshot&&E.data.source===x.Mutation)&&ge.forEach(_=>_.unfreeze()),t(ne(E),R),E.type===M.FullSnapshot)J=E,B=0;else if(E.type===M.IncrementalSnapshot){if(E.data.source===x.Mutation&&E.data.isAttachIframe)return;B++;const _=n&&B>=n,re=r&&E.timestamp-J.timestamp>r;(_||re)&&Fe(!0)}};const K=E=>{z(Q({type:M.IncrementalSnapshot,data:oe({source:x.Mutation},E)}))},G=E=>z(Q({type:M.IncrementalSnapshot,data:oe({source:x.Scroll},E)})),$=E=>z(Q({type:M.IncrementalSnapshot,data:oe({source:x.CanvasMutation},E)})),L=new Un({mutationCb:K}),v=new lo({mutationCb:K}),y=new ao({recordCanvas:N,mutationCb:$,win:window,blockClass:o,mirror:de,sampling:p.canvas}),T=new Yn({mutationCb:K,scrollCb:G,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:c,inlineStylesheet:i,maskInputOptions:X,maskTextFn:g,maskInputFn:h,recordCanvas:N,inlineImages:A,sampling:p,slimDOMOptions:Z,iframeManager:L,stylesheetManager:v,canvasManager:y,enableStrictPrivacy:H},mirror:de});Fe=(E=!1)=>{var R,j,_,re;z(Q({type:M.Meta,data:{href:window.location.href,width:rt(),height:tt()}}),E),ge.forEach(W=>W.lock());const F=hn(document,{mirror:de,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:c,inlineStylesheet:i,maskAllInputs:X,maskTextFn:g,slimDOM:Z,recordCanvas:N,inlineImages:A,enableStrictPrivacy:H,onSerialize:W=>{Ee(W,de)&&L.addIframe(W),Ae(W)&&T.addShadowRoot(W.shadowRoot,document)},onIframeLoad:(W,ue)=>{L.attachIframe(W,ue,de),T.observeAttachShadow(W)},onStylesheetLoad:(W,ue)=>{this.stylesheetManager.attachStylesheet(W,ue,this.mirror)},keepIframeSrcFn:w});if(!F)return console.warn("Failed to snapshot the document");z(Q({type:M.FullSnapshot,data:{node:F,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((j=(R=document?.body)==null?void 0:R.parentElement)==null?void 0:j.scrollLeft)||document?.body.scrollLeft||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((re=(_=document?.body)==null?void 0:_.parentElement)==null?void 0:re.scrollTop)||document?.body.scrollTop||0}}})),ge.forEach(W=>W.unlock())};try{const E=[];E.push(te("DOMContentLoaded",()=>{z(Q({type:M.DomContentLoaded,data:{}}))}));const R=_=>{var re;return Vn({mutationCb:K,mousemoveCb:(F,W)=>z(Q({type:M.IncrementalSnapshot,data:{source:W,positions:F}})),mouseInteractionCb:F=>z(Q({type:M.IncrementalSnapshot,data:oe({source:x.MouseInteraction},F)})),scrollCb:G,viewportResizeCb:F=>z(Q({type:M.IncrementalSnapshot,data:oe({source:x.ViewportResize},F)})),inputCb:F=>z(Q({type:M.IncrementalSnapshot,data:oe({source:x.Input},F)})),mediaInteractionCb:F=>z(Q({type:M.IncrementalSnapshot,data:oe({source:x.MediaInteraction},F)})),styleSheetRuleCb:F=>z(Q({type:M.IncrementalSnapshot,data:oe({source:x.StyleSheetRule},F)})),styleDeclarationCb:F=>z(Q({type:M.IncrementalSnapshot,data:oe({source:x.StyleDeclaration},F)})),canvasMutationCb:$,fontCb:F=>z(Q({type:M.IncrementalSnapshot,data:oe({source:x.Font},F)})),blockClass:o,ignoreClass:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:X,inlineStylesheet:i,sampling:p,recordCanvas:N,inlineImages:A,userTriggeredOnInput:I,collectFonts:P,doc:_,maskInputFn:h,maskTextFn:g,blockSelector:s,slimDOMOptions:Z,mirror:de,iframeManager:L,stylesheetManager:v,shadowDomManager:T,canvasManager:y,enableStrictPrivacy:H,plugins:((re=C?.filter(F=>F.observer))==null?void 0:re.map(F=>({observer:F.observer,options:F.options,callback:W=>z(Q({type:M.Plugin,data:{plugin:F.name,payload:W}}))})))||[]},f)};L.addLoadListener(_=>{E.push(R(_.contentDocument))});const j=()=>{Fe(),E.push(R(document))};return document.readyState==="interactive"||document.readyState==="complete"?j():E.push(te("load",()=>{z(Q({type:M.Load,data:{}})),j()},window)),()=>{E.forEach(_=>_())}}catch(E){console.warn(E)}}ye.addCustomEvent=(e,t)=>{!z||z(Q({type:M.Custom,data:{tag:e,payload:t}}))},ye.freezePage=()=>{ge.forEach(e=>e.freeze())},ye.takeFullSnapshot=e=>{if(!Fe)throw new Error("please take full snapshot after start recording");Fe(e)},ye.mirror=de;var D;(function(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"})(D||(D={}));var go=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var r;if(!t)return-1;var n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var r=this,n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(function(o){return r.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function yo(){return new go}function vo(e){const t={},r=/;(?![^(]*\))/g,n=/:(.+)/,o=/\/\*.*?\*\//g;return e.replace(o,"").split(r).forEach(function(s){if(s){const a=s.split(n);a.length>1&&(t[ht(a[0].trim())]=a[1].trim())}}),t}function ur(e){const t=[];for(const r in e){const n=e[r];if(typeof n!="string")continue;const o=No(r);t.push(`${o}: ${n};`)}return t.join(" ")}const bo=/-([a-z])/g,So=/^--[a-zA-Z0-9-]+$/,ht=e=>So.test(e)?e:e.replace(bo,(t,r)=>r?r.toUpperCase():""),To=/\B([A-Z])/g,No=e=>e.replace(To,"-$1").toLowerCase();class ie{constructor(...t){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=U.ELEMENT_NODE,this.TEXT_NODE=U.TEXT_NODE}get firstChild(){return this.childNodes[0]||null}get lastChild(){return this.childNodes[this.childNodes.length-1]||null}get nextSibling(){const t=this.parentNode;if(!t)return null;const r=t.childNodes,n=r.indexOf(this);return r[n+1]||null}contains(t){if(t===this)return!0;for(const r of this.childNodes)if(r.contains(t))return!0;return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,r){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function Eo(e){return class jr extends e{constructor(){super(...arguments),this.nodeType=U.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=D.Document,this.textContent=null}get documentElement(){return this.childNodes.find(r=>r.RRNodeType===D.Element&&r.tagName==="HTML")||null}get body(){var r;return((r=this.documentElement)===null||r===void 0?void 0:r.childNodes.find(n=>n.RRNodeType===D.Element&&n.tagName==="BODY"))||null}get head(){var r;return((r=this.documentElement)===null||r===void 0?void 0:r.childNodes.find(n=>n.RRNodeType===D.Element&&n.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(r){const n=r.RRNodeType;if((n===D.Element||n===D.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===n))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${n===D.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);return r.parentElement=null,r.parentNode=this,this.childNodes.push(r),r}insertBefore(r,n){const o=r.RRNodeType;if((o===D.Element||o===D.DocumentType)&&this.childNodes.some(a=>a.RRNodeType===o))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${o===D.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);if(n===null)return this.appendChild(r);const s=this.childNodes.indexOf(n);if(s==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(s,0,r),r.parentElement=null,r.parentNode=this,r}removeChild(r){const n=this.childNodes.indexOf(r);if(n===-1)throw new Error("Failed to execute 'removeChild' on 'RRDocument': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(n,1),r.parentElement=null,r.parentNode=null,r}open(){this.childNodes=[]}close(){}write(r){let n;if(r==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?n="-//W3C//DTD XHTML 1.0 Transitional//EN":r==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(n="-//W3C//DTD HTML 4.0 Transitional//EN"),n){const o=this.createDocumentType("html",n,"");this.open(),this.appendChild(o)}}createDocument(r,n,o){return new jr}createDocumentType(r,n,o){const s=new(dr(ie))(r,n,o);return s.ownerDocument=this,s}createElement(r){const n=new(hr(ie))(r);return n.ownerDocument=this,n}createElementNS(r,n){return this.createElement(n)}createTextNode(r){const n=new(mr(ie))(r);return n.ownerDocument=this,n}createComment(r){const n=new(pr(ie))(r);return n.ownerDocument=this,n}createCDATASection(r){const n=new(fr(ie))(r);return n.ownerDocument=this,n}toString(){return"RRDocument"}}}function dr(e){return class extends e{constructor(t,r,n){super(),this.nodeType=U.DOCUMENT_TYPE_NODE,this.RRNodeType=D.DocumentType,this.textContent=null,this.name=t,this.publicId=r,this.systemId=n,this.nodeName=t}toString(){return"RRDocumentType"}}}function hr(e){return class extends e{constructor(t){super(),this.nodeType=U.ELEMENT_NODE,this.RRNodeType=D.Element,this.attributes={},this.shadowRoot=null,this.tagName=t.toUpperCase(),this.nodeName=t.toUpperCase()}get textContent(){let t="";return this.childNodes.forEach(r=>t+=r.textContent),t}set textContent(t){this.childNodes=[this.ownerDocument.createTextNode(t)]}get classList(){return new Co(this.attributes.class,t=>{this.attributes.class=t})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const t=this.attributes.style?vo(this.attributes.style):{},r=/\B([A-Z])/g;return t.setProperty=(n,o,s)=>{if(r.test(n))return;const a=ht(n);o?t[a]=o:delete t[a],s==="important"&&(t[a]+=" !important"),this.attributes.style=ur(t)},t.removeProperty=n=>{if(r.test(n))return"";const o=ht(n),s=t[o]||"";return delete t[o],this.attributes.style=ur(t),s},t}getAttribute(t){return this.attributes[t]||null}setAttribute(t,r){this.attributes[t]=r}setAttributeNS(t,r,n){this.setAttribute(r,n)}removeAttribute(t){delete this.attributes[t]}appendChild(t){return this.childNodes.push(t),t.parentNode=this,t.parentElement=this,t}insertBefore(t,r){if(r===null)return this.appendChild(t);const n=this.childNodes.indexOf(r);if(n==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(n,0,t),t.parentElement=this,t.parentNode=this,t}removeChild(t){const r=this.childNodes.indexOf(t);if(r===-1)throw new Error("Failed to execute 'removeChild' on 'RRElement': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(r,1),t.parentElement=null,t.parentNode=null,t}attachShadow(t){const r=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=r,r}dispatchEvent(t){return!0}toString(){let t="";for(const r in this.attributes)t+=`${r}="${this.attributes[r]}" `;return`${this.tagName} ${t}`}}}function wo(e){return class extends e{attachShadow(t){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}}function mr(e){return class extends e{constructor(t){super(),this.nodeType=U.TEXT_NODE,this.nodeName="#text",this.RRNodeType=D.Text,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function pr(e){return class extends e{constructor(t){super(),this.nodeType=U.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=D.Comment,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function fr(e){return class extends e{constructor(t){super(),this.nodeName="#cdata-section",this.nodeType=U.CDATA_SECTION_NODE,this.RRNodeType=D.CDATA,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class Co{constructor(t,r){if(this.classes=[],this.add=(...n)=>{for(const o of n){const s=String(o);this.classes.indexOf(s)>=0||this.classes.push(s)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...n)=>{this.classes=this.classes.filter(o=>n.indexOf(o)===-1),this.onChange&&this.onChange(this.classes.join(" "))},t){const n=t.trim().split(/\s+/);this.classes.push(...n)}this.onChange=r}}var U;(function(e){e[e.PLACEHOLDER=0]="PLACEHOLDER",e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"})(U||(U={}));const mt={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"};function ae(e,t,r,n){const o=e.childNodes,s=t.childNodes;n=n||t.mirror||t.ownerDocument.mirror,(o.length>0||s.length>0)&&gr(Array.from(o),s,e,r,n);let a=null,l=null;switch(t.RRNodeType){case D.Document:{l=t.scrollData;break}case D.Element:{const c=e,i=t;switch(Io(c,i,n),l=i.scrollData,a=i.inputData,i.tagName){case"AUDIO":case"VIDEO":{const u=e,d=i;d.paused!==void 0&&(d.paused?u.pause():u.play()),d.muted!==void 0&&(u.muted=d.muted),d.volume!==void 0&&(u.volume=d.volume),d.currentTime!==void 0&&(u.currentTime=d.currentTime);break}case"CANVAS":t.canvasMutations.forEach(u=>r.applyCanvas(u.event,u.mutation,e));break;case"STYLE":Mo(c,t.rules);break}if(i.shadowRoot){c.shadowRoot||c.attachShadow({mode:"open"});const u=c.shadowRoot.childNodes,d=i.shadowRoot.childNodes;(u.length>0||d.length>0)&&gr(Array.from(u),d,c.shadowRoot,r,n)}break}case D.Text:case D.Comment:case D.CDATA:e.textContent!==t.data&&(e.textContent=t.data);break}if(l&&r.applyScroll(l,!0),a&&r.applyInput(a),t.nodeName==="IFRAME"){const c=e.contentDocument,i=t;if(c){const u=n.getMeta(i.contentDocument);u&&r.mirror.add(c,Object.assign({},u)),ae(c,i.contentDocument,r,n)}}}function Io(e,t,r){const n=e.attributes,o=t.attributes;for(const s in o){const a=o[s],l=r.getMeta(t);if(l&&"isSVG"in l&&l.isSVG&&mt[s])e.setAttributeNS(mt[s],s,a);else if(t.tagName==="CANVAS"&&s==="rr_dataURL"){const c=document.createElement("img");c.src=a,c.onload=()=>{const i=e.getContext("2d");i&&i.drawImage(c,0,0,c.width,c.height)}}else e.setAttribute(s,a)}for(const{name:s}of Array.from(n))s in o||e.removeAttribute(s);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function gr(e,t,r,n,o){var s,a;let l=0,c=e.length-1,i=0,u=t.length-1,d=e[l],m=e[c],h=t[i],g=t[u],f,S;for(;l<=c&&i<=u;)if(d===void 0)d=e[++l];else if(m===void 0)m=e[--c];else if(n.mirror.getId(d)===o.getId(h))ae(d,h,n,o),d=e[++l],h=t[++i];else if(n.mirror.getId(m)===o.getId(g))ae(m,g,n,o),m=e[--c],g=t[--u];else if(n.mirror.getId(d)===o.getId(g))r.insertBefore(d,m.nextSibling),ae(d,g,n,o),d=e[++l],g=t[--u];else if(n.mirror.getId(m)===o.getId(h))r.insertBefore(m,d),ae(m,h,n,o),m=e[--c],h=t[++i];else{if(!f){f={};for(let p=l;p<=c;p++){const b=e[p];b&&n.mirror.hasNode(b)&&(f[n.mirror.getId(b)]=p)}}if(S=f[o.getId(h)],S){const p=e[S];r.insertBefore(p,d),ae(p,h,n,o),e[S]=void 0}else{const p=pt(h,n.mirror,o);((s=n.mirror.getMeta(r))===null||s===void 0?void 0:s.type)===D.Document&&((a=n.mirror.getMeta(p))===null||a===void 0?void 0:a.type)===D.Element&&r.documentElement&&(r.removeChild(r.documentElement),e[l]=void 0,d=void 0),r.insertBefore(p,d||null),ae(p,h,n,o)}h=t[++i]}if(l>c){const p=t[u+1];let b=null;for(p&&r.childNodes.forEach(N=>{n.mirror.getId(N)===o.getId(p)&&(b=N)});i<=u;++i){const N=pt(t[i],n.mirror,o);r.insertBefore(N,b),ae(N,t[i],n,o)}}else if(i>u)for(;l<=c;l++){const p=e[l];p&&(r.removeChild(p),n.mirror.removeNodeFromMap(p))}}function pt(e,t,r){let n=t.getNode(r.getId(e));const o=r.getMeta(e);if(n!==null)return n;switch(e.RRNodeType){case D.Document:n=new Document;break;case D.DocumentType:n=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case D.Element:{e.tagName.toLowerCase(),o&&"isSVG"in o&&o?.isSVG?n=document.createElementNS(mt.svg,e.tagName.toLowerCase()):n=document.createElement(e.tagName);break}case D.Text:n=document.createTextNode(e.data);break;case D.Comment:n=document.createComment(e.data);break;case D.CDATA:n=document.createCDATASection(e.data);break}return o&&t.add(n,Object.assign({},o)),n}function Pe(e,t){const r=e[t[0]];return t.length===1?r:Pe(r.cssRules[t[1]].cssRules,t.slice(2))}var se;(function(e){e[e.Insert=0]="Insert",e[e.Remove=1]="Remove",e[e.Snapshot=2]="Snapshot",e[e.SetProperty=3]="SetProperty",e[e.RemoveProperty=4]="RemoveProperty"})(se||(se={}));function yr(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function Mo(e,t){const r=e.sheet;t.forEach(n=>{if(n.type===se.Insert)try{if(Array.isArray(n.index)){const{positions:o,index:s}=yr(n.index);Pe(r.cssRules,o).insertRule(n.cssText,s)}else r.insertRule(n.cssText,n.index)}catch{}else if(n.type===se.Remove)try{if(Array.isArray(n.index)){const{positions:o,index:s}=yr(n.index);Pe(r.cssRules,o).deleteRule(s||0)}else r.deleteRule(n.index)}catch{}else n.type===se.SetProperty?Pe(r.cssRules,n.index).style.setProperty(n.property,n.value,n.priority):n.type===se.RemoveProperty&&Pe(r.cssRules,n.index).style.removeProperty(n.property)})}class Ie extends Eo(ie){constructor(t){super(),this._unserializedId=-1,this.mirror=Wo(),this.scrollData=null,t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,r,n){return new Ie}createDocumentType(t,r,n){const o=new xo(t,r,n);return o.ownerDocument=this,o}createElement(t){const r=t.toUpperCase();let n;switch(r){case"AUDIO":case"VIDEO":n=new Do(r);break;case"IFRAME":n=new Oo(r,this.mirror);break;case"CANVAS":n=new ko(r);break;case"STYLE":n=new Ro(r);break;default:n=new We(r);break}return n.ownerDocument=this,n}createComment(t){const r=new Lo(t);return r.ownerDocument=this,r}createCDATASection(t){const r=new _o(t);return r.ownerDocument=this,r}createTextNode(t){const r=new Ao(t);return r.ownerDocument=this,r}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=-1}}const xo=dr(ie);class We extends hr(ie){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class Do extends wo(We){}class ko extends We{constructor(){super(...arguments),this.canvasMutations=[]}getContext(){return null}}class Ro extends We{constructor(){super(...arguments),this.rules=[]}}class Oo extends We{constructor(t,r){super(t),this.contentDocument=new Ie,this.contentDocument.mirror=r}}const Ao=mr(ie),Lo=pr(ie),_o=fr(ie);function Fo(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function vr(e,t,r,n){let o;switch(e.nodeType){case U.DOCUMENT_NODE:n&&n.nodeName==="IFRAME"?o=n.contentDocument:(o=t,o.compatMode=e.compatMode);break;case U.DOCUMENT_TYPE_NODE:const a=e;o=t.createDocumentType(a.name,a.publicId,a.systemId);break;case U.ELEMENT_NODE:const l=e,c=Fo(l);o=t.createElement(c);const i=o;for(const{name:u,value:d}of Array.from(l.attributes))i.attributes[u]=d;l.scrollLeft&&(i.scrollLeft=l.scrollLeft),l.scrollTop&&(i.scrollTop=l.scrollTop);break;case U.TEXT_NODE:o=t.createTextNode(e.textContent||"");break;case U.CDATA_SECTION_NODE:o=t.createCDATASection(e.data);break;case U.COMMENT_NODE:o=t.createComment(e.textContent||"");break;case U.DOCUMENT_FRAGMENT_NODE:o=n.attachShadow({mode:"open"});break;default:return null}let s=r.getMeta(e);return t instanceof Ie&&(s||(s=br(o,t.unserializedId),r.add(e,s)),t.mirror.add(o,Object.assign({},s))),o}function Po(e,t=yo(),r=new Ie){function n(o,s){const a=vr(o,r,t,s);a!==null&&(s?.nodeName!=="IFRAME"&&o.nodeType!==U.DOCUMENT_FRAGMENT_NODE&&(s?.appendChild(a),a.parentNode=s,a.parentElement=s),o.nodeName==="IFRAME"?n(o.contentDocument,a):(o.nodeType===U.DOCUMENT_NODE||o.nodeType===U.ELEMENT_NODE||o.nodeType===U.DOCUMENT_FRAGMENT_NODE)&&(o.nodeType===U.ELEMENT_NODE&&o.shadowRoot&&n(o.shadowRoot,a),o.childNodes.forEach(l=>n(l,a))))}return n(e,null),r}function Wo(){return new $o}class $o{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){var r;if(!t)return-1;const n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return 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){const 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){const n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function br(e,t){switch(e.RRNodeType){case D.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case D.DocumentType:const r=e;return{id:t,type:e.RRNodeType,name:r.name,publicId:r.publicId,systemId:r.systemId};case D.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case D.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case D.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case D.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}function Sr(e){return e=e||Object.create(null),{on:function(r,n){(e[r]||(e[r]=[])).push(n)},off:function(r,n){e[r]&&e[r].splice(e[r].indexOf(n)>>>0,1)},emit:function(r,n){(e[r]||[]).slice().map(function(o){o(n)}),(e["*"]||[]).slice().map(function(o){o(r,n)})}}}var Vo=Object.freeze({__proto__:null,default:Sr});function Uo(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;const r=e.HTMLElement||e.Element,n=468,o={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||c,scrollIntoView:r.prototype.scrollIntoView},s=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function a(p){const b=["MSIE ","Trident/","Edge/"];return new RegExp(b.join("|")).test(p)}const l=a(e.navigator.userAgent)?1:0;function c(p,b){this.scrollLeft=p,this.scrollTop=b}function i(p){return .5*(1-Math.cos(Math.PI*p))}function u(p){if(p===null||typeof p!="object"||p.behavior===void 0||p.behavior==="auto"||p.behavior==="instant")return!0;if(typeof p=="object"&&p.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+p.behavior+" is not a valid value for enumeration ScrollBehavior.")}function d(p,b){if(b==="Y")return p.clientHeight+l<p.scrollHeight;if(b==="X")return p.clientWidth+l<p.scrollWidth}function m(p,b){const N=e.getComputedStyle(p,null)["overflow"+b];return N==="auto"||N==="scroll"}function h(p){const b=d(p,"Y")&&m(p,"Y"),N=d(p,"X")&&m(p,"X");return b||N}function g(p){for(;p!==t.body&&h(p)===!1;)p=p.parentNode||p.host;return p}function f(p){const b=s();let N,I,P,A=(b-p.startTime)/n;A=A>1?1:A,N=i(A),I=p.startX+(p.x-p.startX)*N,P=p.startY+(p.y-p.startY)*N,p.method.call(p.scrollable,I,P),(I!==p.x||P!==p.y)&&e.requestAnimationFrame(f.bind(e,p))}function S(p,b,N){let I,P,A,C;const w=s();p===t.body?(I=e,P=e.scrollX||e.pageXOffset,A=e.scrollY||e.pageYOffset,C=o.scroll):(I=p,P=p.scrollLeft,A=p.scrollTop,C=c),f({scrollable:I,method:C,startTime:w,startX:P,startY:A,x:b,y:N})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset);return}S.call(e,t.body,arguments[0].left!==void 0?~~arguments[0].left:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:e.scrollY||e.pageYOffset)}},e.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])){o.scrollBy.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}S.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset))}},r.prototype.scroll=r.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(u(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const p=arguments[0].left,b=arguments[0].top;S.call(this,this,typeof p>"u"?this.scrollLeft:~~p,typeof b>"u"?this.scrollTop:~~b)},r.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},r.prototype.scrollIntoView=function(){if(u(arguments[0])===!0){o.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const p=g(this),b=p.getBoundingClientRect(),N=this.getBoundingClientRect();p!==t.body?(S.call(this,p,p.scrollLeft+N.left-b.left,p.scrollTop+N.top-b.top),e.getComputedStyle(p).position!=="fixed"&&e.scrollBy({left:b.left,top:b.top,behavior:"smooth"})):e.scrollBy({left:N.left,top:N.top,behavior:"smooth"})}}class jo{constructor(t=[],r){this.timeOffset=0,this.raf=null,this.actions=t,this.speed=r}addAction(t){const r=this.findActionIndex(t);this.actions.splice(r,0,t)}addActions(t){this.actions=this.actions.concat(t)}replaceActions(t){this.actions.length=0,this.actions.splice(0,0,...t)}start(){this.timeOffset=0;let t=performance.now();const{actions:r}=this,n=this;function o(){const s=performance.now();for(n.timeOffset+=(s-t)*n.speed,t=s;r.length;){const a=r[0];if(n.timeOffset>=a.delay)r.shift(),a.doAction();else break}(r.length>0||n.liveMode)&&(n.raf=requestAnimationFrame(o))}this.raf=requestAnimationFrame(o)}clear(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(t){this.speed=t}toggleLiveMode(t){this.liveMode=t}isActive(){return this.raf!==null}findActionIndex(t){let r=0,n=this.actions.length-1;for(;r<=n;){const o=Math.floor((r+n)/2);if(this.actions[o].delay<t.delay)r=o+1;else if(this.actions[o].delay>t.delay)n=o-1;else return o+1}return r}}function ft(e,t){if(e.type===M.IncrementalSnapshot&&e.data.source===x.MouseMove){const r=e.data.positions[0].timeOffset,n=e.timestamp+r;return e.delay=n-t,n-t}return e.delay=e.timestamp-t,e.delay}/*! *****************************************************************************
|
|
4
|
+
or you can use record.mirror to access the mirror instance during recording.`;J.mirror={map:{},getId(){return console.error(Se),-1},getNode(){return console.error(Se),null},removeNodeFromMap(){console.error(Se)},has(){return console.error(Se),!1},reset(){console.error(Se)}},typeof window<"u"&&window.Proxy&&window.Reflect&&(J.mirror=new Proxy(J.mirror,{get(e,t,n){return t==="map"&&console.error(Se),Reflect.get(e,t,n)}}));function Te(e,t,n={}){let r=null,o=0;return function(s){const a=Date.now();!o&&n.leading===!1&&(o=a);const l=t-(a-o),c=this,i=arguments;l<=0||l>t?(r&&(clearTimeout(r),r=null),o=a,e.apply(c,i)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{o=n.leading===!1?0:Date.now(),r=null,e.apply(c,i)},l))}}function Oe(e,t,n,r,o=window){const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(a){setTimeout(()=>{n.set.call(this,a)},0),s&&s.set&&s.set.call(this,a)}}),()=>Oe(e,t,s||{},!0)}function he(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}function tt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function nt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}const At=e=>{try{if(e instanceof HTMLElement)return e.tagName==="CANVAS"}catch{return!1}return!1};function ne(e,t,n){if(!e)return!1;const r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!r)return!1;if(typeof t=="string"){if(r.classList.contains(t)||n&&r.closest("."+t)!==null)return!0}else if(Ue(r,t,n))return!0;return!1}function Lt(e,t){return t.getId(e)!==-1}function Be(e,t){return t.getId(e)===Re}function rt(e,t){if(De(e))return!1;const n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?rt(e.parentNode,t):!0:!0}function ot(e){return Boolean(e.changedTouches)}function it(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),Node.prototype.contains||(Node.prototype.contains=function(t){if(!(0 in arguments))throw new TypeError("1 argument is required");do if(this===t)return!0;while(t=t&&t.parentNode);return!1})}function Pt(e){const t={},n=(o,s)=>{const a={value:o,parent:s,children:[]};return t[o.node.id]=a,a},r=[];for(const o of e){const{nextId:s,parentId:a}=o;if(s&&s in t){const l=t[s];if(l.parent){const c=l.parent.children.indexOf(l);l.parent.children.splice(c,0,n(o,l.parent))}else{const c=r.indexOf(l);r.splice(c,0,n(o,null))}continue}if(a in t){const l=t[a];l.children.push(n(o,l));continue}r.push(n(o,null))}return r}function st(e,t){t(e.value);for(let n=e.children.length-1;n>=0;n--)st(e.children[n],t)}function Ne(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function _t(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function at(e,t){var n,r;const o=(r=(n=e.ownerDocument)==null?void 0:n.defaultView)==null?void 0:r.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const s=o.getBoundingClientRect(),a=at(o,t),l=s.height/o.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}}function Ae(e){return Boolean(e?.shadowRoot)}function Ee(e,t){const n=e[t[0]];return t.length===1?n:Ee(n.cssRules[t[1]].cssRules,t.slice(2))}function lt(e){const t=[...e],n=t.pop();return{positions:t,index:n}}function Ft(e){const t=new Set,n=[];for(let r=e.length;r--;){const o=e[r];t.has(o.id)||(n.push(o),t.add(o.id))}return n}var kr=Object.freeze({__proto__:null,on:te,get _mirror(){return J.mirror},throttle:Te,hookSetter:Oe,patch:he,getWindowHeight:tt,getWindowWidth:nt,isCanvasNode:At,isBlocked:ne,isSerialized:Lt,isIgnored:Be,isAncestorRemoved:rt,isTouchEvent:ot,polyfill:it,queueToResolveTrees:Pt,iterateResolveTree:st,isSerializedIframe:Ne,isSerializedStylesheet:_t,getBaseDimension:at,hasShadowRoot:Ae,getNestedRule:Ee,getPositionsAndIndex:lt,uniqueTextMutations:Ft}),w=(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))(w||{}),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))(x||{}),G=(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))(G||{}),ce=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ce||{}),me=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(me||{}),O=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e))(O||{});function Wt(e){return"__ln"in e}class Dr{constructor(){this.length=0,this.head=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=n?.next||null;return n}addNode(t){const n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&Wt(t.previousSibling)){const r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&Wt(t.nextSibling)&&t.nextSibling.__ln.previous){const r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;this.length++}removeNode(t){const n=t.__ln;!this.head||(n.previous?(n.previous.next=n.next,n.next&&(n.next.previous=n.previous)):(this.head=n.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}}const $t=(e,t)=>`${e}@${t}`;class Rr{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],n=new Dr,r=l=>{let c=l,i=Re;for(;i===Re;)c=c&&c.nextSibling,i=c&&this.mirror.getId(c);return i},o=l=>{var c,i,u,d,m;const h=l.getRootNode?(c=l.getRootNode())==null?void 0:c.host:null;let f=h;for(;(u=(i=f?.getRootNode)==null?void 0:i.call(f))!=null&&u.host;)f=((m=(d=f?.getRootNode)==null?void 0:d.call(f))==null?void 0:m.host)||null;const g=!this.doc.contains(l)&&(!f||!this.doc.contains(f));if(!l.parentNode||g)return;const N=De(l.parentNode)?this.mirror.getId(h):this.mirror.getId(l.parentNode),p=r(l);if(N===-1||p===-1)return n.addNode(l);const S=be(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,enableStrictPrivacy:this.enableStrictPrivacy,onSerialize:y=>{Ne(y,this.mirror)&&this.iframeManager.addIframe(y),_t(y,this.mirror)&&this.stylesheetManager.addStylesheet(y),Ae(l)&&this.shadowDomManager.addShadowRoot(l.shadowRoot,document)},onIframeLoad:(y,T)=>{this.iframeManager.attachIframe(y,T,this.mirror),this.shadowDomManager.observeAttachShadow(y)},onStylesheetLoad:(y,T)=>{this.stylesheetManager.attachStylesheet(y,T,this.mirror)},newlyAddedElement:!0});S&&t.push({parentId:N,nextId:p,node:S})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const l of Array.from(this.movedSet.values()))Vt(this.removes,l,this.mirror)&&!this.movedSet.has(l.parentNode)||o(l);for(const l of Array.from(this.addedSet.values()))!jt(this.droppedSet,l)&&!Vt(this.removes,l,this.mirror)||jt(this.movedSet,l)?o(l):this.droppedSet.add(l);let s=null;for(;n.length;){let l=null;if(s){const c=this.mirror.getId(s.value.parentNode),i=r(s.value);c!==-1&&i!==-1&&(l=s)}if(!l)for(let c=n.length-1;c>=0;c--){const i=n.get(c);if(i){const u=this.mirror.getId(i.value.parentNode),d=r(i.value);if(u!==-1&&d!==-1){l=i;break}}}if(!l){for(;n.head;)n.removeNode(n.head.value);break}s=l.previous,n.removeNode(l.value),o(l.value)}const a={texts:this.texts.map(l=>{let c=l.value;return this.enableStrictPrivacy&&c&&(c=wt(c)),{id:this.mirror.getId(l.node),value:c}}).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>({id:this.mirror.getId(l.node),attributes:l.attributes})).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:t};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.processMutation=t=>{if(!Be(t.target,this.mirror))switch(t.type){case"characterData":{const n=t.target.textContent;!ne(t.target,this.blockClass,!1)&&n!==t.oldValue&&this.texts.push({value:xt(t.target,this.maskTextClass,this.maskTextSelector)&&n?this.maskTextFn?this.maskTextFn(n):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{const n=t.target;let r=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(r=Qe({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:r,maskInputFn:this.maskInputFn})),ne(t.target,this.blockClass,!1)||r===t.oldValue)return;let o=this.attributes.find(s=>s.node===t.target);if(o||(o={node:t.target,attributes:{}},this.attributes.push(o)),t.attributeName==="style"){const s=this.doc.createElement("span");t.oldValue&&s.setAttribute("style",t.oldValue),(o.attributes.style===void 0||o.attributes.style===null)&&(o.attributes.style={});const a=o.attributes.style;for(const l of Array.from(n.style)){const c=n.style.getPropertyValue(l),i=n.style.getPropertyPriority(l);(c!==s.style.getPropertyValue(l)||i!==s.style.getPropertyPriority(l))&&(i===""?a[l]=c:a[l]=[c,i])}for(const l of Array.from(s.style))n.style.getPropertyValue(l)===""&&(a[l]=!1)}else{if(t.target.tagName==="INPUT"){const s=t.target;if(s.type==="password"){o.attributes.value="*".repeat(s.value.length);break}}o.attributes[t.attributeName]=It(this.doc,t.target.tagName,t.attributeName,r)}break}case"childList":{if(ne(t.target,this.blockClass,!0))return;t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{const r=this.mirror.getId(n),o=De(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);ne(t.target,this.blockClass,!1)||Be(n,this.mirror)||!Lt(n,this.mirror)||(this.addedSet.has(n)?(ct(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||rt(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[$t(r,o)]?ct(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:De(t.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(t,n)=>{if(this.mirror.hasNode(t)){if(Be(t,this.mirror))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[$t(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);ne(t,this.blockClass,!1)||t.childNodes.forEach(r=>this.genAdds(r))}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","enableStrictPrivacy"].forEach(n=>{this[n]=t[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function ct(e,t){e.delete(t),t.childNodes.forEach(n=>ct(e,n))}function Vt(e,t,n){return e.length===0?!1:Ut(e,t,n)}function Ut(e,t,n){const{parentNode:r}=t;if(!r)return!1;const o=n.getId(r);return e.some(s=>s.id===o)?!0:Ut(e,r,n)}function jt(e,t){return e.size===0?!1:Bt(e,t)}function Bt(e,t){const{parentNode:n}=t;return n?e.has(n)?!0:Bt(e,n):!1}var Or=Object.defineProperty,Ar=Object.defineProperties,Lr=Object.getOwnPropertyDescriptors,Gt=Object.getOwnPropertySymbols,Pr=Object.prototype.hasOwnProperty,_r=Object.prototype.propertyIsEnumerable,zt=(e,t,n)=>t in e?Or(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Yt=(e,t)=>{for(var n in t||(t={}))Pr.call(t,n)&&zt(e,n,t[n]);if(Gt)for(var n of Gt(t))_r.call(t,n)&&zt(e,n,t[n]);return e},Fr=(e,t)=>Ar(e,Lr(t));const pe=[],Ht=typeof CSSGroupingRule<"u",Xt=typeof CSSMediaRule<"u",Zt=typeof CSSSupportsRule<"u",Kt=typeof CSSConditionRule<"u";function Le(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch{return e.target}}function Qt(e,t){var n,r;const o=new Rr;pe.push(o),o.init(e);let s=window.MutationObserver||window.__rrMutationObserver;const a=(r=(n=window?.Zone)==null?void 0:n.__symbol__)==null?void 0:r.call(n,"MutationObserver");a&&window[a]&&(s=window[a]);const l=new s(o.processMutations.bind(o));return l.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),l}function Wr({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,s=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let a=[],l;const c=Te(d=>{const m=Date.now()-l;e(a.map(h=>(h.timeOffset-=m,h)),d),a=[],l=null},s),i=Te(d=>{const m=Le(d),{clientX:h,clientY:f}=ot(d)?d.changedTouches[0]:d;l||(l=Date.now()),a.push({x:h,y:f,id:r.getId(m),timeOffset:Date.now()-l}),c(typeof DragEvent<"u"&&d instanceof DragEvent?x.Drag:d instanceof MouseEvent?x.MouseMove:x.TouchMove)},o,{trailing:!1}),u=[te("mousemove",i,n),te("touchmove",i,n),te("drag",i,n)];return()=>{u.forEach(d=>d())}}function $r({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const s=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[],l=c=>i=>{const u=Le(i);if(ne(u,r,!0)||At(u))return;const d=ot(i)?i.changedTouches[0]:i;if(!d)return;const m=n.getId(u),{clientX:h,clientY:f}=d;e({type:G[c],id:m,x:h,y:f})};return Object.keys(G).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&s[c]!==!1).forEach(c=>{const i=c.toLowerCase(),u=l(c);a.push(te(i,u,t))}),()=>{a.forEach(c=>c())}}function Jt({scrollCb:e,doc:t,mirror:n,blockClass:r,sampling:o}){const s=Te(a=>{const l=Le(a);if(!l||ne(l,r,!0))return;const c=n.getId(l);if(l===t){const i=t.scrollingElement||t.documentElement;e({id:c,x:i.scrollLeft,y:i.scrollTop})}else e({id:c,x:l.scrollLeft,y:l.scrollTop})},o.scroll||100);return te("scroll",s,t)}function Vr({viewportResizeCb:e}){let t=-1,n=-1;const r=Te(()=>{const o=tt(),s=nt();(t!==o||n!==s)&&(e({width:Number(s),height:Number(o)}),t=o,n=s)},200);return te("resize",r,window)}function qt(e,t){const n=Yt({},e);return t||delete n.userTriggered,n}const Ur=["INPUT","TEXTAREA","SELECT"],en=new WeakMap;function jr({inputCb:e,doc:t,mirror:n,blockClass:r,ignoreClass:o,maskInputOptions:s,maskInputFn:a,sampling:l,userTriggeredOnInput:c}){function i(f){let g=Le(f);const N=f.isTrusted;if(g&&g.tagName==="OPTION"&&(g=g.parentElement),!g||!g.tagName||Ur.indexOf(g.tagName)<0||ne(g,r,!0))return;const p=g.type;if(g.classList.contains(o))return;let S=g.value,y=!1;p==="radio"||p==="checkbox"?y=g.checked:(s[g.tagName.toLowerCase()]||s[p])&&(S=Qe({maskInputOptions:s,tagName:g.tagName,type:p,value:S,maskInputFn:a})),u(g,qt({text:S,isChecked:y,userTriggered:N},c));const T=g.name;p==="radio"&&T&&y&&t.querySelectorAll(`input[type="radio"][name="${T}"]`).forEach(D=>{D!==g&&u(D,qt({text:D.value,isChecked:!y,userTriggered:!1},c))})}function u(f,g){const N=en.get(f);if(!N||N.text!==g.text||N.isChecked!==g.isChecked){en.set(f,g);const p=n.getId(f);e(Fr(Yt({},g),{id:p}))}}const d=(l.input==="last"?["change"]:["input","change"]).map(f=>te(f,i,t)),m=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),h=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return m&&m.set&&d.push(...h.map(f=>Oe(f[0],f[1],{set(){i({target:this})}}))),()=>{d.forEach(f=>f())}}function Ge(e){const t=[];function n(r,o){if(Ht&&r.parentRule instanceof CSSGroupingRule||Xt&&r.parentRule instanceof CSSMediaRule||Zt&&r.parentRule instanceof CSSSupportsRule||Kt&&r.parentRule instanceof CSSConditionRule){const s=Array.from(r.parentRule.cssRules).indexOf(r);o.unshift(s)}else{const s=Array.from(r.parentStyleSheet.cssRules).indexOf(r);o.unshift(s)}return o}return n(e,t)}function Br({styleSheetRuleCb:e,mirror:t},{win:n}){const r=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=function(l,c){const i=t.getId(this.ownerNode);return i!==-1&&e({id:i,adds:[{rule:l,index:c}]}),r.apply(this,arguments)};const o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=function(l){const c=t.getId(this.ownerNode);return c!==-1&&e({id:c,removes:[{index:l}]}),o.apply(this,arguments)};const s={};Ht?s.CSSGroupingRule=n.CSSGroupingRule:(Xt&&(s.CSSMediaRule=n.CSSMediaRule),Kt&&(s.CSSConditionRule=n.CSSConditionRule),Zt&&(s.CSSSupportsRule=n.CSSSupportsRule));const a={};return Object.entries(s).forEach(([l,c])=>{a[l]={insertRule:c.prototype.insertRule,deleteRule:c.prototype.deleteRule},c.prototype.insertRule=function(i,u){const d=t.getId(this.parentStyleSheet.ownerNode);return d!==-1&&e({id:d,adds:[{rule:i,index:[...Ge(this),u||0]}]}),a[l].insertRule.apply(this,arguments)},c.prototype.deleteRule=function(i){const u=t.getId(this.parentStyleSheet.ownerNode);return u!==-1&&e({id:u,removes:[{index:[...Ge(this),i]}]}),a[l].deleteRule.apply(this,arguments)}}),()=>{n.CSSStyleSheet.prototype.insertRule=r,n.CSSStyleSheet.prototype.deleteRule=o,Object.entries(s).forEach(([l,c])=>{c.prototype.insertRule=a[l].insertRule,c.prototype.deleteRule=a[l].deleteRule})}}function Gr({styleDeclarationCb:e,mirror:t},{win:n}){const r=n.CSSStyleDeclaration.prototype.setProperty;n.CSSStyleDeclaration.prototype.setProperty=function(s,a,l){var c,i;const u=t.getId((i=(c=this.parentRule)==null?void 0:c.parentStyleSheet)==null?void 0:i.ownerNode);return u!==-1&&e({id:u,set:{property:s,value:a,priority:l},index:Ge(this.parentRule)}),r.apply(this,arguments)};const o=n.CSSStyleDeclaration.prototype.removeProperty;return n.CSSStyleDeclaration.prototype.removeProperty=function(s){var a,l;const c=t.getId((l=(a=this.parentRule)==null?void 0:a.parentStyleSheet)==null?void 0:l.ownerNode);return c!==-1&&e({id:c,remove:{property:s},index:Ge(this.parentRule)}),o.apply(this,arguments)},()=>{n.CSSStyleDeclaration.prototype.setProperty=r,n.CSSStyleDeclaration.prototype.removeProperty=o}}function zr({mediaInteractionCb:e,blockClass:t,mirror:n,sampling:r}){const o=a=>Te(l=>{const c=Le(l);if(!c||ne(c,t,!0))return;const{currentTime:i,volume:u,muted:d}=c;e({type:a,id:n.getId(c),currentTime:i,volume:u,muted:d})},r.media||500),s=[te("play",o(me.Play)),te("pause",o(me.Pause)),te("seeked",o(me.Seeked)),te("volumechange",o(me.VolumeChange))];return()=>{s.forEach(a=>a())}}function Yr({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,s=n.FontFace;n.FontFace=function(l,c,i){const u=new s(l,c,i);return o.set(u,{family:l,buffer:typeof c!="string",descriptors:i,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),u};const a=he(t.fonts,"add",function(l){return function(c){return setTimeout(()=>{const i=o.get(c);i&&(e(i),o.delete(c))},0),l.apply(this,[c])}});return r.push(()=>{n.FontFace=s}),r.push(a),()=>{r.forEach(l=>l())}}function Hr(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:s,viewportResizeCb:a,inputCb:l,mediaInteractionCb:c,styleSheetRuleCb:i,styleDeclarationCb:u,canvasMutationCb:d,fontCb:m}=e;e.mutationCb=(...h)=>{t.mutation&&t.mutation(...h),n(...h)},e.mousemoveCb=(...h)=>{t.mousemove&&t.mousemove(...h),r(...h)},e.mouseInteractionCb=(...h)=>{t.mouseInteraction&&t.mouseInteraction(...h),o(...h)},e.scrollCb=(...h)=>{t.scroll&&t.scroll(...h),s(...h)},e.viewportResizeCb=(...h)=>{t.viewportResize&&t.viewportResize(...h),a(...h)},e.inputCb=(...h)=>{t.input&&t.input(...h),l(...h)},e.mediaInteractionCb=(...h)=>{t.mediaInteaction&&t.mediaInteaction(...h),c(...h)},e.styleSheetRuleCb=(...h)=>{t.styleSheetRule&&t.styleSheetRule(...h),i(...h)},e.styleDeclarationCb=(...h)=>{t.styleDeclaration&&t.styleDeclaration(...h),u(...h)},e.canvasMutationCb=(...h)=>{t.canvasMutation&&t.canvasMutation(...h),d(...h)},e.fontCb=(...h)=>{t.font&&t.font(...h),m(...h)}}function Xr(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};Hr(e,t);const r=Qt(e,e.doc),o=Wr(e),s=$r(e),a=Jt(e),l=Vr(e),c=jr(e),i=zr(e),u=Br(e,{win:n}),d=Gr(e,{win:n}),m=e.collectFonts?Yr(e):()=>{},h=[];for(const f of e.plugins)h.push(f.observer(f.callback,n,f.options));return()=>{pe.forEach(f=>f.reset()),r.disconnect(),o(),s(),a(),l(),c(),i(),u(),d(),m(),h.forEach(f=>f())}}class Zr{constructor(t){this.iframes=new WeakMap,this.mutationCb=t.mutationCb}addIframe(t){this.iframes.set(t,!0)}addLoadListener(t){this.loadListener=t}attachIframe(t,n,r){var o;this.mutationCb({adds:[{parentId:r.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(o=this.loadListener)==null||o.call(this,t)}}var Kr=Object.defineProperty,Qr=Object.defineProperties,Jr=Object.getOwnPropertyDescriptors,tn=Object.getOwnPropertySymbols,qr=Object.prototype.hasOwnProperty,eo=Object.prototype.propertyIsEnumerable,nn=(e,t,n)=>t in e?Kr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rn=(e,t)=>{for(var n in t||(t={}))qr.call(t,n)&&nn(e,n,t[n]);if(tn)for(var n of tn(t))eo.call(t,n)&&nn(e,n,t[n]);return e},on=(e,t)=>Qr(e,Jr(t));class to{constructor(t){this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;const n=this;this.restorePatches.push(he(HTMLElement.prototype,"attachShadow",function(r){return function(){const o=r.apply(this,arguments);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,this.ownerDocument),o}}))}addShadowRoot(t,n){Qt(on(rn({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),Jt(on(rn({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}observeAttachShadow(t){if(t.contentWindow){const n=this;this.restorePatches.push(he(t.contentWindow.HTMLElement.prototype,"attachShadow",function(r){return function(){const o=r.apply(this,arguments);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,t.contentDocument),o}}))}}reset(){this.restorePatches.forEach(t=>t())}}for(var we="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Pe=typeof Uint8Array>"u"?[]:new Uint8Array(256),ze=0;ze<we.length;ze++)Pe[we.charCodeAt(ze)]=ze;var no=function(e){var t=new Uint8Array(e),n,r=t.length,o="";for(n=0;n<r;n+=3)o+=we[t[n]>>2],o+=we[(t[n]&3)<<4|t[n+1]>>4],o+=we[(t[n+1]&15)<<2|t[n+2]>>6],o+=we[t[n+2]&63];return r%3===2?o=o.substring(0,o.length-1)+"=":r%3===1&&(o=o.substring(0,o.length-2)+"=="),o},ro=function(e){var t=e.length*.75,n=e.length,r,o=0,s,a,l,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var i=new ArrayBuffer(t),u=new Uint8Array(i);for(r=0;r<n;r+=4)s=Pe[e.charCodeAt(r)],a=Pe[e.charCodeAt(r+1)],l=Pe[e.charCodeAt(r+2)],c=Pe[e.charCodeAt(r+3)],u[o++]=s<<2|a>>4,u[o++]=(a&15)<<4|l>>2,u[o++]=(l&3)<<6|c&63;return i};const sn=new Map;function oo(e,t){let n=sn.get(e);return n||(n=new Map,sn.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}const an=(e,t,n)=>{if(!e||!(cn(e,t)||typeof e=="object"))return;const r=e.constructor.name,o=oo(n,r);let s=o.indexOf(e);return s===-1&&(s=o.length,o.push(e)),s};function Ye(e,t,n){if(e instanceof Array)return e.map(r=>Ye(r,t,n));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){const r=e.constructor.name,o=no(e);return{rr_type:r,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Ye(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const r=e.constructor.name,{src:o}=e;return{rr_type:r,src:o}}else if(e instanceof HTMLCanvasElement){const r="HTMLImageElement",o=e.toDataURL();return{rr_type:r,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Ye(e.data,t,n),e.width,e.height]};if(cn(e,t)||typeof e=="object"){const r=e.constructor.name,o=an(e,t,n);return{rr_type:r,index:o}}}}return e}const ln=(e,t,n)=>[...e].map(r=>Ye(r,t,n)),cn=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(r=>typeof t[r]=="function");return Boolean(n.find(r=>e instanceof t[r]))};function io(e,t,n,r){const o=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of s)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;const l=he(t.CanvasRenderingContext2D.prototype,a,function(c){return function(...i){return ne(this.canvas,n,!0)||setTimeout(()=>{const u=ln([...i],t,this);e(this.canvas,{type:ce["2D"],property:a,args:u})},0),c.apply(this,i)}});o.push(l)}catch{const c=Oe(t.CanvasRenderingContext2D.prototype,a,{set(i){e(this.canvas,{type:ce["2D"],property:a,args:[i],setter:!0})}});o.push(c)}return()=>{o.forEach(a=>a())}}function un(e,t){const n=[];try{const r=he(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(s,...a){return ne(this,t,!0)||"__context"in this||(this.__context=s),o.apply(this,[s,...a])}});n.push(r)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(r=>r())}}function dn(e,t,n,r,o,s){const a=[],l=Object.getOwnPropertyNames(e);for(const c of l)try{if(typeof e[c]!="function")continue;const i=he(e,c,function(u){return function(...d){const m=u.apply(this,d);if(an(m,s,e),!ne(this.canvas,r,!0)){const h=ln([...d],s,e),f={type:t,property:c,args:h};n(this.canvas,f)}return m}});a.push(i)}catch{const u=Oe(e,c,{set(d){n(this.canvas,{type:t,property:c,args:[d],setter:!0})}});a.push(u)}return a}function so(e,t,n,r){const o=[];return o.push(...dn(t.WebGLRenderingContext.prototype,ce.WebGL,e,n,r,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...dn(t.WebGL2RenderingContext.prototype,ce.WebGL2,e,n,r,t)),()=>{o.forEach(s=>s())}}function ao(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,s=n.length;o<s;++o)r[o]=n.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}function lo(e,t,n){var r=t===void 0?null:t,o=n===void 0?!1:n,s=ao(e,o),a=s.indexOf(`
|
|
5
|
+
`,10)+1,l=s.substring(a)+(r?"//# sourceMappingURL="+r:""),c=new Blob([l],{type:"application/javascript"});return URL.createObjectURL(c)}function co(e,t,n){var r;return function(s){return r=r||lo(e,t,n),new Worker(r,s)}}var uo=co("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Zm9yKHZhciByPSJBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OSsvIixsPXR5cGVvZiBVaW50OEFycmF5PiJ1Ij9bXTpuZXcgVWludDhBcnJheSgyNTYpLGY9MDtmPHIubGVuZ3RoO2YrKylsW3IuY2hhckNvZGVBdChmKV09Zjt2YXIgZD1mdW5jdGlvbihzKXt2YXIgZT1uZXcgVWludDhBcnJheShzKSxuLGE9ZS5sZW5ndGgsdD0iIjtmb3Iobj0wO248YTtuKz0zKXQrPXJbZVtuXT4+Ml0sdCs9clsoZVtuXSYzKTw8NHxlW24rMV0+PjRdLHQrPXJbKGVbbisxXSYxNSk8PDJ8ZVtuKzJdPj42XSx0Kz1yW2VbbisyXSY2M107cmV0dXJuIGElMz09PTI/dD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTEpKyI9IjphJTM9PT0xJiYodD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTIpKyI9PSIpLHR9O2NvbnN0IGM9bmV3IE1hcCx1PW5ldyBNYXA7YXN5bmMgZnVuY3Rpb24gcChzLGUpe2NvbnN0IG49YCR7c30tJHtlfWA7aWYodS5oYXMobikpcmV0dXJuIHUuZ2V0KG4pO2NvbnN0IGE9bmV3IE9mZnNjcmVlbkNhbnZhcyhzLGUpO2EuZ2V0Q29udGV4dCgiMmQiKTtjb25zdCB0PWF3YWl0KGF3YWl0IGEuY29udmVydFRvQmxvYigpKS5hcnJheUJ1ZmZlcigpLGc9ZCh0KTtyZXR1cm4gdS5zZXQobixnKSxnfWNvbnN0IGk9c2VsZjtpLm9ubWVzc2FnZT1hc3luYyBmdW5jdGlvbihzKXtpZighKCJPZmZzY3JlZW5DYW52YXMiaW4gZ2xvYmFsVGhpcykpcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOnMuZGF0YS5pZH0pO2NvbnN0e2lkOmUsYml0bWFwOm4sd2lkdGg6YSxoZWlnaHQ6dH09cy5kYXRhLGc9cChhLHQpLGg9bmV3IE9mZnNjcmVlbkNhbnZhcyhhLHQpO2guZ2V0Q29udGV4dCgiMmQiKS5kcmF3SW1hZ2UobiwwLDApLG4uY2xvc2UoKTtjb25zdCB3PWF3YWl0IGguY29udmVydFRvQmxvYigpLHk9dy50eXBlLGI9YXdhaXQgdy5hcnJheUJ1ZmZlcigpLG89ZChiKTtpZighYy5oYXMoZSkmJmF3YWl0IGc9PT1vKXJldHVybiBjLnNldChlLG8pLGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpZihjLmdldChlKT09PW8pcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpLnBvc3RNZXNzYWdlKHtpZDplLHR5cGU6eSxiYXNlNjQ6byx3aWR0aDphLGhlaWdodDp0fSksYy5zZXQoZSxvKX19KSgpOwoK",null,!1),hn=Object.getOwnPropertySymbols,ho=Object.prototype.hasOwnProperty,mo=Object.prototype.propertyIsEnumerable,po=(e,t)=>{var n={};for(var r in e)ho.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&hn)for(var r of hn(e))t.indexOf(r)<0&&mo.call(e,r)&&(n[r]=e[r]);return n},fo=(e,t,n)=>new Promise((r,o)=>{var s=c=>{try{l(n.next(c))}catch(i){o(i)}},a=c=>{try{l(n.throw(c))}catch(i){o(i)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,a);l((n=n.apply(e,t)).next())});class go{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(a,l){(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(l)};const{sampling:n="all",win:r,blockClass:o,recordCanvas:s}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&n==="all"&&this.initCanvasMutationObserver(r,o),s&&typeof n=="number"&&this.initCanvasFPSObserver(n,r,o)}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,n,r){const o=un(n,r),s=new Map,a=new uo;a.onmessage=d=>{const{id:m}=d.data;if(s.set(m,!1),!("base64"in d.data))return;const{base64:h,type:f,width:g,height:N}=d.data;this.mutationCb({id:m,type:ce["2D"],commands:[{property:"clearRect",args:[0,0,g,N]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:h}],type:f}]},0,0]}]})};const l=1e3/t;let c=0,i;const u=d=>{if(c&&d-c<l){i=requestAnimationFrame(u);return}c=d,n.document.querySelectorAll(`canvas:not(.${r} *)`).forEach(m=>fo(this,null,function*(){var h;const f=this.mirror.getId(m);if(s.get(f))return;if(s.set(f,!0),["webgl","webgl2"].includes(m.__context)){const N=m.getContext(m.__context);((h=N?.getContextAttributes())==null?void 0:h.preserveDrawingBuffer)===!1&&N?.clear(N.COLOR_BUFFER_BIT)}const g=yield createImageBitmap(m);a.postMessage({id:f,bitmap:g,width:m.width,height:m.height},[g])})),i=requestAnimationFrame(u)};i=requestAnimationFrame(u),this.resetObservers=()=>{o(),cancelAnimationFrame(i)}}initCanvasMutationObserver(t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=un(t,n),o=io(this.processMutation.bind(this),t,n,this.mirror),s=so(this.processMutation.bind(this),t,n,this.mirror);this.resetObservers=()=>{r(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=n=>{this.rafStamps.latestId=n,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,n)=>{const r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,n){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(t);if(!r||n===-1)return;const o=r.map(a=>po(a,["type"])),{type:s}=r[0];this.mutationCb({id:n,type:s,commands:o}),this.pendingCanvasMutations.delete(t)}}class vo{constructor(t){this.trackedStylesheets=new WeakSet,this.mutationCb=t.mutationCb}addStylesheet(t){this.trackedStylesheets.has(t)||(this.trackedStylesheets.add(t),this.trackStylesheet(t))}trackStylesheet(t){}attachStylesheet(t,n,r){this.mutationCb({adds:[{parentId:r.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[]}),this.addStylesheet(t)}}var yo=Object.defineProperty,bo=Object.defineProperties,So=Object.getOwnPropertyDescriptors,mn=Object.getOwnPropertySymbols,To=Object.prototype.hasOwnProperty,No=Object.prototype.propertyIsEnumerable,pn=(e,t,n)=>t in e?yo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,re=(e,t)=>{for(var n in t||(t={}))To.call(t,n)&&pn(e,n,t[n]);if(mn)for(var n of mn(t))No.call(t,n)&&pn(e,n,t[n]);return e},Eo=(e,t)=>bo(e,So(t));function H(e){return Eo(re({},e),{timestamp:Date.now()})}let B,_e;const ue=Nt();function fe(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="highlight-block",blockSelector:s=null,ignoreClass:a="highlight-ignore",maskTextClass:l="highlight-mask",maskTextSelector:c=null,inlineStylesheet:i=!0,maskAllInputs:u,maskInputOptions:d,slimDOMOptions:m,maskInputFn:h,maskTextFn:f,hooks:g,packFn:N,sampling:p={},mousemoveWait:S,recordCanvas:y=!1,userTriggeredOnInput:T=!1,collectFonts:D=!1,inlineImages:A=!1,plugins:M,keepIframeSrcFn:F=()=>!1,enableStrictPrivacy:W=!1}=e;if(!t)throw new Error("emit function is required");S!==void 0&&p.mousemove===void 0&&(p.mousemove=S),ue.reset();const X=u===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:d!==void 0?d:{password:!0},Z=m===!0||m==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:m==="all",headMetaDescKeywords:m==="all"}:m||{};it();let K,q=0;const V=E=>{for(const C of M||[])C.eventProcessor&&(E=C.eventProcessor(E));return N&&(E=N(E)),E};B=(E,C)=>{var Q;if(((Q=pe[0])==null?void 0:Q.isFrozen())&&E.type!==w.FullSnapshot&&!(E.type===w.IncrementalSnapshot&&E.data.source===x.Mutation)&&pe.forEach(ee=>ee.unfreeze()),t(V(E),C),E.type===w.FullSnapshot)K=E,q=0;else if(E.type===w.IncrementalSnapshot){if(E.data.source===x.Mutation&&E.data.isAttachIframe)return;q++;const ee=r&&q>=r,ae=n&&E.timestamp-K.timestamp>n;(ee||ae)&&_e(!0)}};const z=E=>{B(H({type:w.IncrementalSnapshot,data:re({source:x.Mutation},E)}))},Y=E=>B(H({type:w.IncrementalSnapshot,data:re({source:x.Scroll},E)})),L=E=>B(H({type:w.IncrementalSnapshot,data:re({source:x.CanvasMutation},E)})),U=new Zr({mutationCb:z}),b=new vo({mutationCb:z}),v=new go({recordCanvas:y,mutationCb:L,win:window,blockClass:o,mirror:ue,sampling:p.canvas}),I=new to({mutationCb:z,scrollCb:Y,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:c,inlineStylesheet:i,maskInputOptions:X,maskTextFn:f,maskInputFn:h,recordCanvas:y,inlineImages:A,sampling:p,slimDOMOptions:Z,iframeManager:U,stylesheetManager:b,canvasManager:v,enableStrictPrivacy:W},mirror:ue});_e=(E=!1)=>{var C,Q,ee,ae;B(H({type:w.Meta,data:{href:window.location.href,width:nt(),height:tt()}}),E),pe.forEach(j=>j.lock());const P=Sr(document,{mirror:ue,blockClass:o,blockSelector:s,maskTextClass:l,maskTextSelector:c,inlineStylesheet:i,maskAllInputs:X,maskTextFn:f,slimDOM:Z,recordCanvas:y,inlineImages:A,enableStrictPrivacy:W,onSerialize:j=>{Ne(j,ue)&&U.addIframe(j),Ae(j)&&I.addShadowRoot(j.shadowRoot,document)},onIframeLoad:(j,ve)=>{U.attachIframe(j,ve,ue),I.observeAttachShadow(j)},onStylesheetLoad:(j,ve)=>{this.stylesheetManager.attachStylesheet(j,ve,this.mirror)},keepIframeSrcFn:F});if(!P)return console.warn("Failed to snapshot the document");B(H({type:w.FullSnapshot,data:{node:P,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((Q=(C=document?.body)==null?void 0:C.parentElement)==null?void 0:Q.scrollLeft)||document?.body.scrollLeft||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((ae=(ee=document?.body)==null?void 0:ee.parentElement)==null?void 0:ae.scrollTop)||document?.body.scrollTop||0}}})),pe.forEach(j=>j.unlock())};try{const E=[];E.push(te("DOMContentLoaded",()=>{B(H({type:w.DomContentLoaded,data:{}}))}));const C=ee=>{var ae;return Xr({mutationCb:z,mousemoveCb:(P,j)=>B(H({type:w.IncrementalSnapshot,data:{source:j,positions:P}})),mouseInteractionCb:P=>B(H({type:w.IncrementalSnapshot,data:re({source:x.MouseInteraction},P)})),scrollCb:Y,viewportResizeCb:P=>B(H({type:w.IncrementalSnapshot,data:re({source:x.ViewportResize},P)})),inputCb:P=>B(H({type:w.IncrementalSnapshot,data:re({source:x.Input},P)})),mediaInteractionCb:P=>B(H({type:w.IncrementalSnapshot,data:re({source:x.MediaInteraction},P)})),styleSheetRuleCb:P=>B(H({type:w.IncrementalSnapshot,data:re({source:x.StyleSheetRule},P)})),styleDeclarationCb:P=>B(H({type:w.IncrementalSnapshot,data:re({source:x.StyleDeclaration},P)})),canvasMutationCb:L,fontCb:P=>B(H({type:w.IncrementalSnapshot,data:re({source:x.Font},P)})),blockClass:o,ignoreClass:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:X,inlineStylesheet:i,sampling:p,recordCanvas:y,inlineImages:A,userTriggeredOnInput:T,collectFonts:D,doc:ee,maskInputFn:h,maskTextFn:f,blockSelector:s,slimDOMOptions:Z,mirror:ue,iframeManager:U,stylesheetManager:b,shadowDomManager:I,canvasManager:v,enableStrictPrivacy:W,plugins:((ae=M?.filter(P=>P.observer))==null?void 0:ae.map(P=>({observer:P.observer,options:P.options,callback:j=>B(H({type:w.Plugin,data:{plugin:P.name,payload:j}}))})))||[]},g)};U.addLoadListener(ee=>{E.push(C(ee.contentDocument))});const Q=()=>{_e(),E.push(C(document))};return document.readyState==="interactive"||document.readyState==="complete"?Q():E.push(te("load",()=>{B(H({type:w.Load,data:{}})),Q()},window)),()=>{E.forEach(ee=>ee())}}catch(E){console.warn(E)}}fe.addCustomEvent=(e,t)=>{!B||B(H({type:w.Custom,data:{tag:e,payload:t}}))},fe.freezePage=()=>{pe.forEach(e=>e.freeze())},fe.takeFullSnapshot=e=>{if(!_e)throw new Error("please take full snapshot after start recording");_e(e)},fe.mirror=ue;var k;(function(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"})(k||(k={}));var wo=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var n;if(!t)return-1;var r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var n=this,r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(function(o){return n.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,n){var r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)},e.prototype.replace=function(t,n){this.idNodeMap.set(t,n)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function Co(){return new wo}function Io(e){const t={},n=/;(?![^(]*\))/g,r=/:(.+)/,o=/\/\*.*?\*\//g;return e.replace(o,"").split(n).forEach(function(s){if(s){const a=s.split(r);a.length>1&&(t[ut(a[0].trim())]=a[1].trim())}}),t}function fn(e){const t=[];for(const n in e){const r=e[n];if(typeof r!="string")continue;const o=Do(n);t.push(`${o}: ${r};`)}return t.join(" ")}const xo=/-([a-z])/g,Mo=/^--[a-zA-Z0-9-]+$/,ut=e=>Mo.test(e)?e:e.replace(xo,(t,n)=>n?n.toUpperCase():""),ko=/\B([A-Z])/g,Do=e=>e.replace(ko,"-$1").toLowerCase();class oe{constructor(...t){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=$.ELEMENT_NODE,this.TEXT_NODE=$.TEXT_NODE}get firstChild(){return this.childNodes[0]||null}get lastChild(){return this.childNodes[this.childNodes.length-1]||null}get nextSibling(){const t=this.parentNode;if(!t)return null;const n=t.childNodes,r=n.indexOf(this);return n[r+1]||null}contains(t){if(t===this)return!0;for(const n of this.childNodes)if(n.contains(t))return!0;return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,n){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"}}function Ro(e){return class Xn extends e{constructor(){super(...arguments),this.nodeType=$.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=k.Document,this.textContent=null}get documentElement(){return this.childNodes.find(n=>n.RRNodeType===k.Element&&n.tagName==="HTML")||null}get body(){var n;return((n=this.documentElement)===null||n===void 0?void 0:n.childNodes.find(r=>r.RRNodeType===k.Element&&r.tagName==="BODY"))||null}get head(){var n;return((n=this.documentElement)===null||n===void 0?void 0:n.childNodes.find(r=>r.RRNodeType===k.Element&&r.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(n){const r=n.RRNodeType;if((r===k.Element||r===k.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${r===k.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);return n.parentElement=null,n.parentNode=this,this.childNodes.push(n),n}insertBefore(n,r){const o=n.RRNodeType;if((o===k.Element||o===k.DocumentType)&&this.childNodes.some(a=>a.RRNodeType===o))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${o===k.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);if(r===null)return this.appendChild(n);const s=this.childNodes.indexOf(r);if(s==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(s,0,n),n.parentElement=null,n.parentNode=this,n}removeChild(n){const r=this.childNodes.indexOf(n);if(r===-1)throw new Error("Failed to execute 'removeChild' on 'RRDocument': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(r,1),n.parentElement=null,n.parentNode=null,n}open(){this.childNodes=[]}close(){}write(n){let r;if(n==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?r="-//W3C//DTD XHTML 1.0 Transitional//EN":n==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(r="-//W3C//DTD HTML 4.0 Transitional//EN"),r){const o=this.createDocumentType("html",r,"");this.open(),this.appendChild(o)}}createDocument(n,r,o){return new Xn}createDocumentType(n,r,o){const s=new(gn(oe))(n,r,o);return s.ownerDocument=this,s}createElement(n){const r=new(vn(oe))(n);return r.ownerDocument=this,r}createElementNS(n,r){return this.createElement(r)}createTextNode(n){const r=new(yn(oe))(n);return r.ownerDocument=this,r}createComment(n){const r=new(bn(oe))(n);return r.ownerDocument=this,r}createCDATASection(n){const r=new(Sn(oe))(n);return r.ownerDocument=this,r}toString(){return"RRDocument"}}}function gn(e){return class extends e{constructor(t,n,r){super(),this.nodeType=$.DOCUMENT_TYPE_NODE,this.RRNodeType=k.DocumentType,this.textContent=null,this.name=t,this.publicId=n,this.systemId=r,this.nodeName=t}toString(){return"RRDocumentType"}}}function vn(e){return class extends e{constructor(t){super(),this.nodeType=$.ELEMENT_NODE,this.RRNodeType=k.Element,this.attributes={},this.shadowRoot=null,this.tagName=t.toUpperCase(),this.nodeName=t.toUpperCase()}get textContent(){let t="";return this.childNodes.forEach(n=>t+=n.textContent),t}set textContent(t){this.childNodes=[this.ownerDocument.createTextNode(t)]}get classList(){return new Ao(this.attributes.class,t=>{this.attributes.class=t})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const t=this.attributes.style?Io(this.attributes.style):{},n=/\B([A-Z])/g;return t.setProperty=(r,o,s)=>{if(n.test(r))return;const a=ut(r);o?t[a]=o:delete t[a],s==="important"&&(t[a]+=" !important"),this.attributes.style=fn(t)},t.removeProperty=r=>{if(n.test(r))return"";const o=ut(r),s=t[o]||"";return delete t[o],this.attributes.style=fn(t),s},t}getAttribute(t){return this.attributes[t]||null}setAttribute(t,n){this.attributes[t]=n}setAttributeNS(t,n,r){this.setAttribute(n,r)}removeAttribute(t){delete this.attributes[t]}appendChild(t){return this.childNodes.push(t),t.parentNode=this,t.parentElement=this,t}insertBefore(t,n){if(n===null)return this.appendChild(t);const r=this.childNodes.indexOf(n);if(r==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(r,0,t),t.parentElement=this,t.parentNode=this,t}removeChild(t){const n=this.childNodes.indexOf(t);if(n===-1)throw new Error("Failed to execute 'removeChild' on 'RRElement': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(n,1),t.parentElement=null,t.parentNode=null,t}attachShadow(t){const n=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=n,n}dispatchEvent(t){return!0}toString(){let t="";for(const n in this.attributes)t+=`${n}="${this.attributes[n]}" `;return`${this.tagName} ${t}`}}}function Oo(e){return class extends e{attachShadow(t){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}}function yn(e){return class extends e{constructor(t){super(),this.nodeType=$.TEXT_NODE,this.nodeName="#text",this.RRNodeType=k.Text,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function bn(e){return class extends e{constructor(t){super(),this.nodeType=$.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=k.Comment,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function Sn(e){return class extends e{constructor(t){super(),this.nodeName="#cdata-section",this.nodeType=$.CDATA_SECTION_NODE,this.RRNodeType=k.CDATA,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class Ao{constructor(t,n){if(this.classes=[],this.add=(...r)=>{for(const o of r){const s=String(o);this.classes.indexOf(s)>=0||this.classes.push(s)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...r)=>{this.classes=this.classes.filter(o=>r.indexOf(o)===-1),this.onChange&&this.onChange(this.classes.join(" "))},t){const r=t.trim().split(/\s+/);this.classes.push(...r)}this.onChange=n}}var $;(function(e){e[e.PLACEHOLDER=0]="PLACEHOLDER",e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"})($||($={}));const dt={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"};function se(e,t,n,r){const o=e.childNodes,s=t.childNodes;r=r||t.mirror||t.ownerDocument.mirror,(o.length>0||s.length>0)&&Tn(Array.from(o),s,e,n,r);let a=null,l=null;switch(t.RRNodeType){case k.Document:{l=t.scrollData;break}case k.Element:{const c=e,i=t;switch(Lo(c,i,r),l=i.scrollData,a=i.inputData,i.tagName){case"AUDIO":case"VIDEO":{const u=e,d=i;d.paused!==void 0&&(d.paused?u.pause():u.play()),d.muted!==void 0&&(u.muted=d.muted),d.volume!==void 0&&(u.volume=d.volume),d.currentTime!==void 0&&(u.currentTime=d.currentTime);break}case"CANVAS":t.canvasMutations.forEach(u=>n.applyCanvas(u.event,u.mutation,e));break;case"STYLE":Po(c,t.rules);break}if(i.shadowRoot){c.shadowRoot||c.attachShadow({mode:"open"});const u=c.shadowRoot.childNodes,d=i.shadowRoot.childNodes;(u.length>0||d.length>0)&&Tn(Array.from(u),d,c.shadowRoot,n,r)}break}case k.Text:case k.Comment:case k.CDATA:e.textContent!==t.data&&(e.textContent=t.data);break}if(l&&n.applyScroll(l,!0),a&&n.applyInput(a),t.nodeName==="IFRAME"){const c=e.contentDocument,i=t;if(c){const u=r.getMeta(i.contentDocument);u&&n.mirror.add(c,Object.assign({},u)),se(c,i.contentDocument,n,r)}}}function Lo(e,t,n){const r=e.attributes,o=t.attributes;for(const s in o){const a=o[s],l=n.getMeta(t);if(l&&"isSVG"in l&&l.isSVG&&dt[s])e.setAttributeNS(dt[s],s,a);else if(t.tagName==="CANVAS"&&s==="rr_dataURL"){const c=document.createElement("img");c.src=a,c.onload=()=>{const i=e.getContext("2d");i&&i.drawImage(c,0,0,c.width,c.height)}}else e.setAttribute(s,a)}for(const{name:s}of Array.from(r))s in o||e.removeAttribute(s);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function Tn(e,t,n,r,o){var s,a;let l=0,c=e.length-1,i=0,u=t.length-1,d=e[l],m=e[c],h=t[i],f=t[u],g,N;for(;l<=c&&i<=u;)if(d===void 0)d=e[++l];else if(m===void 0)m=e[--c];else if(r.mirror.getId(d)===o.getId(h))se(d,h,r,o),d=e[++l],h=t[++i];else if(r.mirror.getId(m)===o.getId(f))se(m,f,r,o),m=e[--c],f=t[--u];else if(r.mirror.getId(d)===o.getId(f))n.insertBefore(d,m.nextSibling),se(d,f,r,o),d=e[++l],f=t[--u];else if(r.mirror.getId(m)===o.getId(h))n.insertBefore(m,d),se(m,h,r,o),m=e[--c],h=t[++i];else{if(!g){g={};for(let p=l;p<=c;p++){const S=e[p];S&&r.mirror.hasNode(S)&&(g[r.mirror.getId(S)]=p)}}if(N=g[o.getId(h)],N){const p=e[N];n.insertBefore(p,d),se(p,h,r,o),e[N]=void 0}else{const p=ht(h,r.mirror,o);((s=r.mirror.getMeta(n))===null||s===void 0?void 0:s.type)===k.Document&&((a=r.mirror.getMeta(p))===null||a===void 0?void 0:a.type)===k.Element&&n.documentElement&&(n.removeChild(n.documentElement),e[l]=void 0,d=void 0),n.insertBefore(p,d||null),se(p,h,r,o)}h=t[++i]}if(l>c){const p=t[u+1];let S=null;for(p&&n.childNodes.forEach(y=>{r.mirror.getId(y)===o.getId(p)&&(S=y)});i<=u;++i){const y=ht(t[i],r.mirror,o);n.insertBefore(y,S),se(y,t[i],r,o)}}else if(i>u)for(;l<=c;l++){const p=e[l];p&&(n.removeChild(p),r.mirror.removeNodeFromMap(p))}}function ht(e,t,n){let r=t.getNode(n.getId(e));const o=n.getMeta(e);if(r!==null)return r;switch(e.RRNodeType){case k.Document:r=new Document;break;case k.DocumentType:r=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case k.Element:{e.tagName.toLowerCase(),o&&"isSVG"in o&&o?.isSVG?r=document.createElementNS(dt.svg,e.tagName.toLowerCase()):r=document.createElement(e.tagName);break}case k.Text:r=document.createTextNode(e.data);break;case k.Comment:r=document.createComment(e.data);break;case k.CDATA:r=document.createCDATASection(e.data);break}return o&&t.add(r,Object.assign({},o)),r}function Fe(e,t){const n=e[t[0]];return t.length===1?n:Fe(n.cssRules[t[1]].cssRules,t.slice(2))}var ie;(function(e){e[e.Insert=0]="Insert",e[e.Remove=1]="Remove",e[e.Snapshot=2]="Snapshot",e[e.SetProperty=3]="SetProperty",e[e.RemoveProperty=4]="RemoveProperty"})(ie||(ie={}));function Nn(e){const t=[...e],n=t.pop();return{positions:t,index:n}}function Po(e,t){const n=e.sheet;t.forEach(r=>{if(r.type===ie.Insert)try{if(Array.isArray(r.index)){const{positions:o,index:s}=Nn(r.index);Fe(n.cssRules,o).insertRule(r.cssText,s)}else n.insertRule(r.cssText,r.index)}catch{}else if(r.type===ie.Remove)try{if(Array.isArray(r.index)){const{positions:o,index:s}=Nn(r.index);Fe(n.cssRules,o).deleteRule(s||0)}else n.deleteRule(r.index)}catch{}else r.type===ie.SetProperty?Fe(n.cssRules,r.index).style.setProperty(r.property,r.value,r.priority):r.type===ie.RemoveProperty&&Fe(n.cssRules,r.index).style.removeProperty(r.property)})}class Ce extends Ro(oe){constructor(t){super(),this._unserializedId=-1,this.mirror=Yo(),this.scrollData=null,t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,n,r){return new Ce}createDocumentType(t,n,r){const o=new _o(t,n,r);return o.ownerDocument=this,o}createElement(t){const n=t.toUpperCase();let r;switch(n){case"AUDIO":case"VIDEO":r=new Fo(n);break;case"IFRAME":r=new Vo(n,this.mirror);break;case"CANVAS":r=new Wo(n);break;case"STYLE":r=new $o(n);break;default:r=new We(n);break}return r.ownerDocument=this,r}createComment(t){const n=new jo(t);return n.ownerDocument=this,n}createCDATASection(t){const n=new Bo(t);return n.ownerDocument=this,n}createTextNode(t){const n=new Uo(t);return n.ownerDocument=this,n}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=-1}}const _o=gn(oe);class We extends vn(oe){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class Fo extends Oo(We){}class Wo extends We{constructor(){super(...arguments),this.canvasMutations=[]}getContext(){return null}}class $o extends We{constructor(){super(...arguments),this.rules=[]}}class Vo extends We{constructor(t,n){super(t),this.contentDocument=new Ce,this.contentDocument.mirror=n}}const Uo=yn(oe),jo=bn(oe),Bo=Sn(oe);function Go(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function En(e,t,n,r){let o;switch(e.nodeType){case $.DOCUMENT_NODE:r&&r.nodeName==="IFRAME"?o=r.contentDocument:(o=t,o.compatMode=e.compatMode);break;case $.DOCUMENT_TYPE_NODE:const a=e;o=t.createDocumentType(a.name,a.publicId,a.systemId);break;case $.ELEMENT_NODE:const l=e,c=Go(l);o=t.createElement(c);const i=o;for(const{name:u,value:d}of Array.from(l.attributes))i.attributes[u]=d;l.scrollLeft&&(i.scrollLeft=l.scrollLeft),l.scrollTop&&(i.scrollTop=l.scrollTop);break;case $.TEXT_NODE:o=t.createTextNode(e.textContent||"");break;case $.CDATA_SECTION_NODE:o=t.createCDATASection(e.data);break;case $.COMMENT_NODE:o=t.createComment(e.textContent||"");break;case $.DOCUMENT_FRAGMENT_NODE:o=r.attachShadow({mode:"open"});break;default:return null}let s=n.getMeta(e);return t instanceof Ce&&(s||(s=wn(o,t.unserializedId),n.add(e,s)),t.mirror.add(o,Object.assign({},s))),o}function zo(e,t=Co(),n=new Ce){function r(o,s){const a=En(o,n,t,s);a!==null&&(s?.nodeName!=="IFRAME"&&o.nodeType!==$.DOCUMENT_FRAGMENT_NODE&&(s?.appendChild(a),a.parentNode=s,a.parentElement=s),o.nodeName==="IFRAME"?r(o.contentDocument,a):(o.nodeType===$.DOCUMENT_NODE||o.nodeType===$.ELEMENT_NODE||o.nodeType===$.DOCUMENT_FRAGMENT_NODE)&&(o.nodeType===$.ELEMENT_NODE&&o.shadowRoot&&r(o.shadowRoot,a),o.childNodes.forEach(l=>r(l,a))))}return r(e,null),n}function Yo(){return new Ho}class Ho{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){var n;if(!t)return-1;const r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){const r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function wn(e,t){switch(e.RRNodeType){case k.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case k.DocumentType:const n=e;return{id:t,type:e.RRNodeType,name:n.name,publicId:n.publicId,systemId:n.systemId};case k.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case k.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case k.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case k.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}function Cn(e){return e=e||Object.create(null),{on:function(n,r){(e[n]||(e[n]=[])).push(r)},off:function(n,r){e[n]&&e[n].splice(e[n].indexOf(r)>>>0,1)},emit:function(n,r){(e[n]||[]).slice().map(function(o){o(r)}),(e["*"]||[]).slice().map(function(o){o(n,r)})}}}var Xo=Object.freeze({__proto__:null,default:Cn});function Zo(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;const n=e.HTMLElement||e.Element,r=468,o={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:n.prototype.scroll||c,scrollIntoView:n.prototype.scrollIntoView},s=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function a(p){const S=["MSIE ","Trident/","Edge/"];return new RegExp(S.join("|")).test(p)}const l=a(e.navigator.userAgent)?1:0;function c(p,S){this.scrollLeft=p,this.scrollTop=S}function i(p){return .5*(1-Math.cos(Math.PI*p))}function u(p){if(p===null||typeof p!="object"||p.behavior===void 0||p.behavior==="auto"||p.behavior==="instant")return!0;if(typeof p=="object"&&p.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+p.behavior+" is not a valid value for enumeration ScrollBehavior.")}function d(p,S){if(S==="Y")return p.clientHeight+l<p.scrollHeight;if(S==="X")return p.clientWidth+l<p.scrollWidth}function m(p,S){const y=e.getComputedStyle(p,null)["overflow"+S];return y==="auto"||y==="scroll"}function h(p){const S=d(p,"Y")&&m(p,"Y"),y=d(p,"X")&&m(p,"X");return S||y}function f(p){for(;p!==t.body&&h(p)===!1;)p=p.parentNode||p.host;return p}function g(p){const S=s();let y,T,D,A=(S-p.startTime)/r;A=A>1?1:A,y=i(A),T=p.startX+(p.x-p.startX)*y,D=p.startY+(p.y-p.startY)*y,p.method.call(p.scrollable,T,D),(T!==p.x||D!==p.y)&&e.requestAnimationFrame(g.bind(e,p))}function N(p,S,y){let T,D,A,M;const F=s();p===t.body?(T=e,D=e.scrollX||e.pageXOffset,A=e.scrollY||e.pageYOffset,M=o.scroll):(T=p,D=p.scrollLeft,A=p.scrollTop,M=c),g({scrollable:T,method:M,startTime:F,startX:D,startY:A,x:S,y})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset);return}N.call(e,t.body,arguments[0].left!==void 0?~~arguments[0].left:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:e.scrollY||e.pageYOffset)}},e.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])){o.scrollBy.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}N.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset))}},n.prototype.scroll=n.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(u(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const p=arguments[0].left,S=arguments[0].top;N.call(this,this,typeof p>"u"?this.scrollLeft:~~p,typeof S>"u"?this.scrollTop:~~S)},n.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},n.prototype.scrollIntoView=function(){if(u(arguments[0])===!0){o.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const p=f(this),S=p.getBoundingClientRect(),y=this.getBoundingClientRect();p!==t.body?(N.call(this,p,p.scrollLeft+y.left-S.left,p.scrollTop+y.top-S.top),e.getComputedStyle(p).position!=="fixed"&&e.scrollBy({left:S.left,top:S.top,behavior:"smooth"})):e.scrollBy({left:y.left,top:y.top,behavior:"smooth"})}}class Ko{constructor(t=[],n){this.timeOffset=0,this.raf=null,this.actions=t,this.speed=n}addAction(t){const n=this.findActionIndex(t);this.actions.splice(n,0,t)}addActions(t){this.actions=this.actions.concat(t)}replaceActions(t){this.actions.length=0,this.actions.splice(0,0,...t)}start(){this.timeOffset=0;let t=performance.now();const{actions:n}=this,r=this;function o(){const s=performance.now();for(r.timeOffset+=(s-t)*r.speed,t=s;n.length;){const a=n[0];if(r.timeOffset>=a.delay)n.shift(),a.doAction();else break}(n.length>0||r.liveMode)&&(r.raf=requestAnimationFrame(o))}this.raf=requestAnimationFrame(o)}clear(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(t){this.speed=t}toggleLiveMode(t){this.liveMode=t}isActive(){return this.raf!==null}findActionIndex(t){let n=0,r=this.actions.length-1;for(;n<=r;){const o=Math.floor((n+r)/2);if(this.actions[o].delay<t.delay)n=o+1;else if(this.actions[o].delay>t.delay)r=o-1;else return o+1}return n}}function mt(e,t){if(e.type===w.IncrementalSnapshot&&e.data.source===x.MouseMove){const n=e.data.positions[0].timeOffset,r=e.timestamp+n;return e.delay=r-t,r-t}return e.delay=e.timestamp-t,e.delay}/*! *****************************************************************************
|
|
6
6
|
Copyright (c) Microsoft Corporation.
|
|
7
7
|
|
|
8
8
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -15,5 +15,5 @@ or you can use record.mirror to access the mirror instance during recording.`;q.
|
|
|
15
15
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
16
16
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
17
17
|
PERFORMANCE OF THIS SOFTWARE.
|
|
18
|
-
***************************************************************************** */function Tr(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n,o,s=r.call(e),a=[];try{for(;(t===void 0||t-- >0)&&!(n=s.next()).done;)a.push(n.value)}catch(l){o={error:l}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}return a}var Me;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Me||(Me={}));var Nr={type:"xstate.init"};function gt(e){return e===void 0?[]:[].concat(e)}function ve(e){return{type:"xstate.assign",assignment:e}}function Er(e,t){return typeof(e=typeof e=="string"&&t&&t[e]?t[e]:e)=="string"?{type:e}:typeof e=="function"?{type:e.name,exec:e}:e}function Ye(e){return function(t){return e===t}}function wr(e){return typeof e=="string"?{type:e}:e}function Cr(e,t){return{value:e,context:t,actions:[],changed:!1,matches:Ye(e)}}function Ir(e,t,r){var n=t,o=!1;return[e.filter(function(s){if(s.type==="xstate.assign"){o=!0;var a=Object.assign({},n);return typeof s.assignment=="function"?a=s.assignment(n,r):Object.keys(s.assignment).forEach(function(l){a[l]=typeof s.assignment[l]=="function"?s.assignment[l](n,r):s.assignment[l]}),n=a,!1}return!0}),n,o]}function Mr(e,t){t===void 0&&(t={});var r=Tr(Ir(gt(e.states[e.initial].entry).map(function(a){return Er(a,t.actions)}),e.context,Nr),2),n=r[0],o=r[1],s={config:e,_options:t,initialState:{value:e.initial,actions:n,context:o,matches:Ye(e.initial)},transition:function(a,l){var c,i,u=typeof a=="string"?{value:a,context:e.context}:a,d=u.value,m=u.context,h=wr(l),g=e.states[d];if(g.on){var f=gt(g.on[h.type]);try{for(var S=function($){var L=typeof Symbol=="function"&&Symbol.iterator,v=L&&$[L],y=0;if(v)return v.call($);if($&&typeof $.length=="number")return{next:function(){return $&&y>=$.length&&($=void 0),{value:$&&$[y++],done:!$}}};throw new TypeError(L?"Object is not iterable.":"Symbol.iterator is not defined.")}(f),p=S.next();!p.done;p=S.next()){var b=p.value;if(b===void 0)return Cr(d,m);var N=typeof b=="string"?{target:b}:b,I=N.target,P=N.actions,A=P===void 0?[]:P,C=N.cond,w=C===void 0?function(){return!0}:C,H=I===void 0,X=I??d,Z=e.states[X];if(w(m,h)){var J=Tr(Ir((H?gt(A):[].concat(g.exit,A,Z.entry).filter(function($){return $})).map(function($){return Er($,s._options.actions)}),m,h),3),B=J[0],ne=J[1],K=J[2],G=I??d;return{value:G,context:ne,actions:B,changed:I!==d||B.length>0||K,matches:Ye(G)}}}}catch($){c={error:$}}finally{try{p&&!p.done&&(i=S.return)&&i.call(S)}finally{if(c)throw c.error}}}return Cr(d,m)}};return s}var xr=function(e,t){return e.actions.forEach(function(r){var n=r.exec;return n&&n(e.context,t)})};function Dr(e){var t=e.initialState,r=Me.NotStarted,n=new Set,o={_machine:e,send:function(s){r===Me.Running&&(t=e.transition(t,s),xr(t,wr(s)),n.forEach(function(a){return a(t)}))},subscribe:function(s){return n.add(s),s(t),{unsubscribe:function(){return n.delete(s)}}},start:function(s){if(s){var a=typeof s=="object"?s:{context:e.config.context,value:s};t={value:a.value,actions:[],context:a.context,matches:Ye(a.value)}}return r=Me.Running,xr(t,Nr),o},stop:function(){return r=Me.Stopped,n.clear(),o},get state(){return t},get status(){return r}};return o}var Go=Object.defineProperty,Bo=Object.defineProperties,zo=Object.getOwnPropertyDescriptors,kr=Object.getOwnPropertySymbols,Ho=Object.prototype.hasOwnProperty,Yo=Object.prototype.propertyIsEnumerable,Rr=(e,t,r)=>t in e?Go(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Xe=(e,t)=>{for(var r in t||(t={}))Ho.call(t,r)&&Rr(e,r,t[r]);if(kr)for(var r of kr(t))Yo.call(t,r)&&Rr(e,r,t[r]);return e},Ze=(e,t)=>Bo(e,zo(t));function Xo(e,t){for(let r=e.length-1;r>=0;r--){const n=e[r];if(n.type===M.Meta&&n.timestamp<=t)return e.slice(r)}return e}function Zo(e,{getCastFn:t,applyEventsSynchronously:r,emitter:n}){const o=Mr({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]},REPLACE_EVENTS:{target:"playing",actions:["replaceEvents"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]},REPLACE_EVENTS:{target:"paused",actions:["replaceEvents"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:ve({lastPlayedEvent:(s,a)=>a.type==="CAST_EVENT"?a.payload.event:s.lastPlayedEvent}),recordTimeOffset:ve((s,a)=>{let l=s.timeOffset;return"payload"in a&&"timeOffset"in a.payload&&(l=a.payload.timeOffset),Ze(Xe({},s),{timeOffset:l,baselineTime:s.events[0].timestamp+l})}),play(s){var a;const{timer:l,events:c,baselineTime:i,lastPlayedEvent:u}=s;l.clear();for(const f of c)ft(f,i);const d=Xo(c,i);let m=u?.timestamp;u?.type===M.IncrementalSnapshot&&u.data.source===x.MouseMove&&(m=u.timestamp+((a=u.data.positions[0])==null?void 0:a.timeOffset)),i<(m||0)&&n.emit(O.PlayBack);const h=new Array,g=new Array;for(const f of d)if(!(m&&m<i&&(f.timestamp<=m||f===u)))if(f.timestamp<i)h.push(f);else{const S=t(f,!1);g.push({doAction:()=>{S()},delay:f.delay})}r(h),n.emit(O.Flush),l.addActions(g),l.start()},pause(s){s.timer.clear()},resetLastPlayedEvent:ve(s=>Ze(Xe({},s),{lastPlayedEvent:null})),startLive:ve({baselineTime:(s,a)=>(s.timer.toggleLiveMode(!0),s.timer.start(),a.type==="TO_LIVE"&&a.payload.baselineTime?a.payload.baselineTime:Date.now())}),replaceEvents:ve((s,a)=>{const{events:l,timer:c,baselineTime:i}=s;if(a.type==="REPLACE_EVENTS"){const{events:u}=a.payload;l.length=0;const d=[];for(const m of u)if(ft(m,i),l.push(m),m.timestamp>=c.timeOffset+i){const h=t(m,!1);d.push({doAction:()=>{h()},delay:m.delay})}c.isActive()&&c.replaceActions(d)}return Ze(Xe({},s),{events:l})}),addEvent:ve((s,a)=>{const{baselineTime:l,timer:c,events:i}=s;if(a.type==="ADD_EVENT"){const{event:u}=a.payload;ft(u,l);let d=i.length-1;if(!i[d]||i[d].timestamp<=u.timestamp)i.push(u);else{let g=-1,f=0;for(;f<=d;){const S=Math.floor((f+d)/2);i[S].timestamp<=u.timestamp?f=S+1:d=S-1}g===-1&&(g=f),i.splice(g,0,u)}const m=u.timestamp<l,h=t(u,m);m?h():c.isActive()&&c.addAction({doAction:()=>{h()},delay:u.delay})}return Ze(Xe({},s),{events:i})})}});return Dr(o)}function Ko(e){const t=Mr({id:"speed",context:e,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(r,n)=>{"payload"in n&&r.timer.setSpeed(n.payload.speed)},recordSpeed:ve({normalSpeed:r=>r.timer.speed}),restoreSpeed:r=>{r.timer.setSpeed(r.normalSpeed)}}});return Dr(t)}const Qo=e=>[`.${e} { background: currentColor }`,"noscript { display: none !important; }",`.${e} { background: currentColor; border-radius: 5px; }`,`.${e}:hover::after {content: 'Redacted'; color: white; background: black; text-align: center; width: 100%; display: block;}`];var Jo=(e,t,r)=>new Promise((n,o)=>{var s=c=>{try{l(r.next(c))}catch(i){o(i)}},a=c=>{try{l(r.throw(c))}catch(i){o(i)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,a);l((r=r.apply(e,t)).next())});const Or=new Map;function Ar(e,t){let r=Or.get(e);return r||(r=new Map,Or.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}function he(e,t,r){return n=>Jo(this,null,function*(){if(n&&typeof n=="object"&&"rr_type"in n)if(r&&(r.isUnchanged=!1),n.rr_type==="ImageBitmap"&&"args"in n){const o=yield he(e,t,r)(n.args);return yield createImageBitmap.apply(null,o)}else if("index"in n){if(r||t===null)return n;const{rr_type:o,index:s}=n;return Ar(t,o)[s]}else if("args"in n){const{rr_type:o,args:s}=n,a=window[o];return new a(...yield Promise.all(s.map(he(e,t,r))))}else{if("base64"in n)return Zn(n.base64);if("src"in n){const o=e.get(n.src);if(o)return o;{const s=new Image;return s.src=n.src,e.set(n.src,s),s}}else if("data"in n&&n.rr_type==="Blob"){const o=yield Promise.all(n.data.map(he(e,t,r)));return new Blob(o,{type:n.type})}}else if(Array.isArray(n))return yield Promise.all(n.map(he(e,t,r)));return n})}var qo=(e,t,r)=>new Promise((n,o)=>{var s=c=>{try{l(r.next(c))}catch(i){o(i)}},a=c=>{try{l(r.throw(c))}catch(i){o(i)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,a);l((r=r.apply(e,t)).next())});function ei(e,t){try{return t===ce.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}const ti=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function ri(e,t){if(!(t!=null&&t.constructor))return;const{name:r}=t.constructor;if(!ti.includes(r))return;const n=Ar(e,r);n.includes(t)||n.push(t)}function ni(e){return qo(this,arguments,function*({mutation:t,target:r,type:n,imageMap:o,errorHandler:s}){try{const a=ei(r,n);if(!a)return;if(t.setter){a[t.property]=t.args[0];return}const l=a[t.property],c=yield Promise.all(t.args.map(he(o,a))),i=l.apply(a,c);ri(a,i)}catch(a){s(t,a)}})}var oi=(e,t,r)=>new Promise((n,o)=>{var s=c=>{try{l(r.next(c))}catch(i){o(i)}},a=c=>{try{l(r.throw(c))}catch(i){o(i)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,a);l((r=r.apply(e,t)).next())});function ii(e){return oi(this,arguments,function*({event:t,mutation:r,target:n,imageMap:o,errorHandler:s}){try{const a=n.getContext("2d");if(r.setter){a[r.property]=r.args[0];return}const l=a[r.property];if(r.property==="drawImage"&&typeof r.args[0]=="string"){const c=o.get(t);l.apply(a,r.args)}else{const c=yield Promise.all(r.args.map(he(o,a)));l.apply(a,c)}}catch(a){s(r,a)}})}var si=(e,t,r)=>new Promise((n,o)=>{var s=c=>{try{l(r.next(c))}catch(i){o(i)}},a=c=>{try{l(r.throw(c))}catch(i){o(i)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,a);l((r=r.apply(e,t)).next())});function Lr(e){return si(this,arguments,function*({event:t,mutation:r,target:n,imageMap:o,canvasEventMap:s,errorHandler:a}){try{const l=s.get(t)||r,c="commands"in l?l.commands:[l];if([ce.WebGL,ce.WebGL2].includes(r.type)){for(let i=0;i<c.length;i++){const u=c[i];yield ni({mutation:u,type:r.type,target:n,imageMap:o,errorHandler:a})}return}for(let i=0;i<c.length;i++){const u=c[i];yield ii({event:t,mutation:u,target:n,imageMap:o,errorHandler:a})}}catch(l){a(r,l)}})}var ai=Object.defineProperty,li=Object.defineProperties,ci=Object.getOwnPropertyDescriptors,_r=Object.getOwnPropertySymbols,ui=Object.prototype.hasOwnProperty,di=Object.prototype.propertyIsEnumerable,Fr=(e,t,r)=>t in e?ai(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xe=(e,t)=>{for(var r in t||(t={}))ui.call(t,r)&&Fr(e,r,t[r]);if(_r)for(var r of _r(t))di.call(t,r)&&Fr(e,r,t[r]);return e},yt=(e,t)=>li(e,ci(t)),vt=(e,t,r)=>new Promise((n,o)=>{var s=c=>{try{l(r.next(c))}catch(i){o(i)}},a=c=>{try{l(r.throw(c))}catch(i){o(i)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,a);l((r=r.apply(e,t)).next())});const Pr=10*1e3,Wr=2*1e3,$r=1*1e3,Vr=60*60*1e3,hi=Sr||Vo,bt="[replayer]",St={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Tt(e){return e.type==M.IncrementalSnapshot&&(e.data.source==x.TouchMove||e.data.source==x.MouseInteraction&&e.data.type==Y.TouchStart)}class mi{constructor(t,r){if(this.usingVirtualDom=!1,this.virtualDom=new Ie,this.mouseTail=null,this.tailPositions=[],this.emitter=hi(),this.activityIntervals=[],this.legacy_missingNodeRetryMap={},this.cache=Ot(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=Et(),this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,!(r!=null&&r.liveMode)&&t.length<2)throw new Error("Replayer need at least 2 events.");const n={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"highlight-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:St,useVirtualDom:!0,inactiveThreshold:.02,inactiveSkipTime:Wr};this.config=Object.assign({},n,r),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(O.Resize,this.handleResize),this.setupDom(),this.emitter.on(O.Flush,()=>{if(this.usingVirtualDom){const l={mirror:this.mirror,applyCanvas:(c,i,u)=>{Lr({event:c,mutation:i,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this)};if(ae(this.iframe.contentDocument,this.virtualDom,l,this.virtualDom.mirror),this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const c in this.legacy_missingNodeRetryMap)try{const i=this.legacy_missingNodeRetryMap[c],u=pt(i.node,this.mirror,this.virtualDom.mirror);ae(u,i.node,l,this.virtualDom.mirror),i.node=u}catch(i){this.config.showWarning&&console.warn(i)}}this.mousePos&&this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null}),this.emitter.on(O.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset()});const o=new jo([],r?.speed||n.speed);this.service=Zo({events:t.map(l=>r&&r.unpackFn?r.unpackFn(l):l).sort((l,c)=>l.timestamp-c.timestamp),timer:o,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(l=>{this.emitter.emit(O.StateChange,{player:l})}),this.speedService=Ko({normalSpeed:-1,timer:o}),this.speedService.start(),this.speedService.subscribe(l=>{this.emitter.emit(O.StateChange,{speed:l})});const s=this.service.state.context.events.find(l=>l.type===M.Meta),a=this.service.state.context.events.find(l=>l.type===M.FullSnapshot);if(s){const{width:l,height:c}=s.data;setTimeout(()=>{this.emitter.emit(O.Resize,{width:l,height:c})},0)}a&&setTimeout(()=>{this.firstFullSnapshot||(this.firstFullSnapshot=a,this.rebuildFullSnapshot(a),this.iframe.contentWindow.scrollTo(a.data.initialOffset))},1),this.service.state.context.events.find(Tt)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(t,r){return this.emitter.on(t,r),this}off(t,r){return this.emitter.off(t,r),this}setConfig(t){Object.keys(t).forEach(r=>{this.config[r]=t[r]}),this.config.skipInactive||this.backToNormal(),typeof t.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:t.speed}}),typeof t.mouseTail<"u"&&(t.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getActivityIntervals(){if(this.activityIntervals.length==0){const t=[],r=this.getMetaData(),n=[{timestamp:r.startTime},...this.service.state.context.events.filter(a=>this.isUserInteraction(a)),{timestamp:r.endTime}];for(let a=1;a<n.length;a++){const l=n[a-1],c=n[a];c.timestamp-l.timestamp>Pr?t.push({startTime:l.timestamp,endTime:c.timestamp,duration:c.timestamp-l.timestamp,active:!1}):t.push({startTime:l.timestamp,endTime:c.timestamp,duration:c.timestamp-l.timestamp,active:!0})}const o=[];let s=t[0];for(let a=1;a<t.length;a++)t[a].active!=t[a-1].active&&(o.push({startTime:s.startTime,endTime:t[a-1].endTime,duration:t[a-1].endTime-s.startTime,active:t[a-1].active}),s=t[a]);s&&t.length>0&&o.push({startTime:s.startTime,endTime:t[t.length-1].endTime,duration:t[t.length-1].endTime-s.startTime,active:t[t.length-1].active}),s=o[0];for(let a=1;a<o.length;a++)(!o[a].active&&o[a].duration>this.config.inactiveThreshold*r.totalTime||!o[a-1].active&&o[a-1].duration>this.config.inactiveThreshold*r.totalTime)&&(this.activityIntervals.push({startTime:s.startTime,endTime:o[a-1].endTime,duration:o[a-1].endTime-s.startTime,active:o[a-1].active}),s=o[a]);s&&o.length>0&&this.activityIntervals.push({startTime:s.startTime,endTime:o[o.length-1].endTime,duration:o[o.length-1].endTime-s.startTime,active:o[o.length-1].active})}return this.activityIntervals}getMetaData(){const t=this.service.state.context.events[0],r=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:t.timestamp,endTime:r.timestamp,totalTime:r.timestamp-t.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:t,events:r}=this.service.state.context;return t-r[0].timestamp}getMirror(){return this.mirror}play(t=0){var r,n;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:t}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:t}})),(n=(r=this.iframe.contentDocument)==null?void 0:r.getElementsByTagName("html")[0])==null||n.classList.remove("rrweb-paused"),this.emitter.emit(O.Start),this.handleInactivity(this.getMetaData().startTime+t,!0)}pause(t){var r,n;t===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof t=="number"&&(this.play(t),this.service.send({type:"PAUSE"})),(n=(r=this.iframe.contentDocument)==null?void 0:r.getElementsByTagName("html")[0])==null||n.classList.add("rrweb-paused"),this.emitter.emit(O.Pause)}resume(t=0){console.warn("The 'resume' will be departed in 1.0. Please use 'play' method which has the same interface."),this.play(t),this.emitter.emit(O.Resume)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){const r=this.config.unpackFn?this.config.unpackFn(t):t;Tt(r)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:r}}))}replaceEvents(t){for(const r of t)if(Tt(r)){this.mouse.classList.add("touch-device");break}this.service.send({type:"REPLACE_EVENTS",payload:{events:t}})}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=Ot()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");const t=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&t.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",t.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(Uo(this.iframe.contentWindow,this.iframe.contentDocument),it(this.iframe.contentWindow))}handleResize(t){this.iframe.style.display="inherit";for(const r of[this.mouseTail,this.iframe])!r||(r.setAttribute("width",String(t.width)),r.setAttribute("height",String(t.height)))}applyEventsSynchronously(t){for(const r of t){switch(r.type){case M.DomContentLoaded:case M.Load:case M.Custom:continue;case M.FullSnapshot:case M.Meta:case M.Plugin:case M.IncrementalSnapshot:break}this.getCastFn(r,!0)()}this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null}getCastFn(t,r=!1){let n;switch(t.type){case M.DomContentLoaded:case M.Load:break;case M.Custom:n=()=>{this.emitter.emit(O.CustomEvent,t)};break;case M.Meta:n=()=>this.emitter.emit(O.Resize,{width:t.data.width,height:t.data.height});break;case M.FullSnapshot:n=()=>{if(this.firstFullSnapshot){if(this.firstFullSnapshot===t){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(t,r),this.iframe.contentWindow.scrollTo(t.data.initialOffset)};break;case M.IncrementalSnapshot:n=()=>{if(this.applyIncremental(t,r),!r&&(this.handleInactivity(t.timestamp),t===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const o of this.service.state.context.events)if(!(o.timestamp<=t.timestamp)&&this.isUserInteraction(o)){o.delay-t.delay>Pr*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=o);break}if(this.nextUserInteractionEvent){const o=this.nextUserInteractionEvent.delay-t.delay,s={speed:Math.min(Math.round(o/Wr),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:s}),this.emitter.emit(O.SkipStart,s)}}};break}return()=>{n&&n();for(const s of this.config.plugins||[])s.handler(t,r,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:t}});const o=this.service.state.context.events.length-1;if(t===this.service.state.context.events[o]){const s=()=>{o<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(O.Finish))};t.type===M.IncrementalSnapshot&&t.data.source===x.MouseMove&&t.data.positions.length?setTimeout(()=>{s()},Math.max(0,-t.data.positions[0].timeOffset+50)):s()}this.emitter.emit(O.EventCast,t)}}handleInactivity(t,r){if((t===this.inactiveEndTimestamp||r)&&(this.inactiveEndTimestamp=null,this.backToNormal()),this.config.skipInactive&&!this.inactiveEndTimestamp){for(const n of this.getActivityIntervals())if(t>=n.startTime&&t<n.endTime&&!n.active){this.inactiveEndTimestamp=n.endTime;break}if(this.inactiveEndTimestamp){const n=this.inactiveEndTimestamp-t,o={speed:n/Vr*this.config.inactiveSkipTime<$r?n/$r:Math.round(Math.max(n,Vr)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:o}),this.emitter.emit(O.SkipStart,o)}}}rebuildFullSnapshot(t,r=!1){if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const n=[];Sn(t.data.node,{doc:this.iframe.contentDocument,afterAppend:a=>{this.collectIframeAndAttachDocument(n,a)},cache:this.cache,mirror:this.mirror});for(const{mutationInQueue:a,builtNode:l}of n)this.attachDocumentToIframe(a,l),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==a);const{documentElement:o,head:s}=this.iframe.contentDocument;this.insertStyleRules(o,s),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(O.FullsnapshotRebuilded,t),r||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,r){const n=Qo(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&n.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,br(o,this.virtualDom.unserializedId)),t.insertBefore(o,r);for(let s=0;s<n.length;s++)o.rules.push({cssText:n[s],type:se.Insert,index:s})}else{const o=document.createElement("style");t.insertBefore(o,r);for(let s=0;s<n.length;s++)o.sheet.insertRule(n[s],s)}}attachDocumentToIframe(t,r){const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,o=[];je(t.node,{doc:r.contentDocument,mirror:n,hackCss:!0,skipChild:!1,afterAppend:s=>{this.collectIframeAndAttachDocument(o,s);const a=n.getMeta(s);if(a?.type===k.Element&&a?.tagName.toUpperCase()==="HTML"){const{documentElement:l,head:c}=r.contentDocument;this.insertStyleRules(l,c)}},cache:this.cache});for(const{mutationInQueue:s,builtNode:a}of o)this.attachDocumentToIframe(s,a),this.newDocumentQueue=this.newDocumentQueue.filter(l=>l!==s)}collectIframeAndAttachDocument(t,r){if(Ee(r,this.mirror)){const n=this.newDocumentQueue.find(o=>o.parentId===this.mirror.getId(r));n&&t.push({mutationInQueue:n,builtNode:r})}}waitForStylesheetLoad(){var t;const r=(t=this.iframe.contentDocument)==null?void 0:t.head;if(r){const n=new Set;let o,s=this.service.state;const a=()=>{s=this.service.state};this.emitter.on(O.Start,a),this.emitter.on(O.Pause,a);const l=()=>{this.emitter.off(O.Start,a),this.emitter.off(O.Pause,a)};r.querySelectorAll('link[rel="stylesheet"]').forEach(c=>{c.sheet||(n.add(c),c.addEventListener("load",()=>{n.delete(c),n.size===0&&o!==-1&&(s.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(O.LoadStylesheetEnd),o&&clearTimeout(o),l())}))}),n.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(O.LoadStylesheetStart),o=setTimeout(()=>{s.matches("playing")&&this.play(this.getCurrentTime()),o=-1,l()},this.config.loadTimeout))}}hasImageArg(t){for(const r of t)if(!(!r||typeof r!="object")){if("rr_type"in r&&"args"in r){if(this.hasImageArg(r.args))return!0}else if("rr_type"in r&&r.rr_type==="HTMLImageElement"||r instanceof Array&&this.hasImageArg(r))return!0}return!1}getImageArgs(t){const r=[];for(const n of t)!n||typeof n!="object"||("rr_type"in n&&"args"in n?r.push(...this.getImageArgs(n.args)):"rr_type"in n&&n.rr_type==="HTMLImageElement"?r.push(n.src):n instanceof Array&&r.push(...this.getImageArgs(n)));return r}preloadAllImages(){return vt(this,null,function*(){this.service.state;const t=()=>{this.service.state};this.emitter.on(O.Start,t),this.emitter.on(O.Pause,t);const r=[];for(const n of this.service.state.context.events)n.type===M.IncrementalSnapshot&&n.data.source===x.CanvasMutation&&(r.push(this.deserializeAndPreloadCanvasEvents(n.data,n)),("commands"in n.data?n.data.commands:[n.data]).forEach(o=>{this.preloadImages(o,n)}));return Promise.all(r)})}preloadImages(t,r){if(t.property==="drawImage"&&typeof t.args[0]=="string"&&!this.imageMap.has(r)){const n=document.createElement("canvas"),o=n.getContext("2d"),s=o?.createImageData(n.width,n.height);s?.data,JSON.parse(t.args[0]),o?.putImageData(s,0,0)}}deserializeAndPreloadCanvasEvents(t,r){return vt(this,null,function*(){if(!this.canvasEventMap.has(r)){const n={isUnchanged:!0};if("commands"in t){const o=yield Promise.all(t.commands.map(s=>vt(this,null,function*(){const a=yield Promise.all(s.args.map(he(this.imageMap,null,n)));return yt(xe({},s),{args:a})})));n.isUnchanged===!1&&this.canvasEventMap.set(r,yt(xe({},t),{commands:o}))}else{const o=yield Promise.all(t.args.map(he(this.imageMap,null,n)));n.isUnchanged===!1&&this.canvasEventMap.set(r,yt(xe({},t),{args:o}))}}})}applyIncremental(t,r){var n,o,s,a,l,c;const{data:i}=t;switch(i.source){case x.Mutation:{try{this.applyMutation(i,r)}catch(u){this.warn(`Exception in mutation ${u.message||u}`,i)}break}case x.Drag:case x.TouchMove:case x.MouseMove:if(r){const u=i.positions[i.positions.length-1];this.mousePos={x:u.x,y:u.y,id:u.id,debugData:i}}else i.positions.forEach(u=>{const d={doAction:()=>{this.moveAndHover(u.x,u.y,u.id,r,i)},delay:u.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(d)}),this.timer.addAction({doAction(){},delay:t.delay-((n=i.positions[0])==null?void 0:n.timeOffset)});break;case x.MouseInteraction:{if(i.id===-1||r)break;const u=new Event(Y[i.type].toLowerCase()),d=this.mirror.getNode(i.id);if(!d)return this.debugNodeNotFound(i,i.id);this.emitter.emit(O.MouseInteraction,{type:i.type,target:d});const{triggerFocus:m}=this.config;switch(i.type){case Y.Blur:"blur"in d&&d.blur();break;case Y.Focus:m&&d.focus&&d.focus({preventScroll:!0});break;case Y.Click:case Y.TouchStart:case Y.TouchEnd:r?(i.type===Y.TouchStart?this.touchActive=!0:i.type===Y.TouchEnd&&(this.touchActive=!1),this.mousePos={x:i.x,y:i.y,id:i.id,debugData:i}):(i.type===Y.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(i.x,i.y,i.id,r,i),i.type===Y.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):i.type===Y.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):i.type===Y.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case Y.TouchCancel:r?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:d.dispatchEvent(u)}break}case x.Scroll:{if(i.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);u.scrollData=i;break}this.applyScroll(i,r);break}case x.ViewportResize:this.emitter.emit(O.Resize,{width:i.width,height:i.height});break;case x.Input:{if(i.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);u.inputData=i;break}this.applyInput(i);break}case x.MediaInteraction:{const u=this.usingVirtualDom?this.virtualDom.mirror.getNode(i.id):this.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);const d=u;try{i.currentTime&&(d.currentTime=i.currentTime),i.volume&&(d.volume=i.volume),i.muted&&(d.muted=i.muted),i.type===fe.Pause&&d.pause(),i.type===fe.Play&&d.play()}catch(m){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${m.message||m}`)}break}case x.StyleSheetRule:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);const d=u.rules;(o=i.adds)==null||o.forEach(({rule:m,index:h})=>d?.push({cssText:m,index:h,type:se.Insert})),(s=i.removes)==null||s.forEach(({index:m})=>d?.push({index:m,type:se.Remove}))}else{const u=this.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);const d=u.sheet;(a=i.adds)==null||a.forEach(({rule:m,index:h})=>{try{if(Array.isArray(h)){const{positions:g,index:f}=lt(h);we(d.cssRules,g).insertRule(m,f)}else{const g=h===void 0?void 0:Math.min(h,d.cssRules.length);d.insertRule(m,g)}}catch{}}),(l=i.removes)==null||l.forEach(({index:m})=>{try{if(Array.isArray(m)){const{positions:h,index:g}=lt(m);we(d.cssRules,h).deleteRule(g||0)}else d?.deleteRule(m)}catch{}})}break}case x.StyleDeclaration:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);const d=u.rules;i.set&&d.push(xe({type:se.SetProperty,index:i.index},i.set)),i.remove&&d.push(xe({type:se.RemoveProperty,index:i.index},i.remove))}else{const u=this.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);const d=u.sheet;i.set&&we(d.rules,i.index).style.setProperty(i.set.property,i.set.value,i.set.priority),i.remove&&we(d.rules,i.index).style.removeProperty(i.remove.property)}break}case x.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);u.canvasMutations.push({event:t,mutation:i})}else{const u=this.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);Lr({event:t,mutation:i,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case x.Font:{try{const u=new FontFace(i.family,i.buffer?new Uint8Array(JSON.parse(i.fontSource)):i.fontSource,i.descriptors);(c=this.iframe.contentDocument)==null||c.fonts.add(u)}catch(u){this.config.showWarning&&console.warn(u)}break}}}applyMutation(t,r){if(this.config.useVirtualDom&&!this.usingVirtualDom&&r&&(this.usingVirtualDom=!0,Po(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const i in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[i],d=vr(u.node,this.virtualDom,this.mirror);d&&(u.node=d)}catch(u){this.config.showWarning&&console.warn(u)}const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;t.removes.forEach(i=>{var u;const d=n.getNode(i.id);if(!d)return t.removes.find(h=>h.id===i.parentId)?void 0:this.warnNodeNotFound(t,i.id);let m=n.getNode(i.parentId);if(!m)return this.warnNodeNotFound(t,i.parentId);if(i.isShadow&&Ae(m)&&(m=m.shadowRoot),n.removeNodeFromMap(d),m)try{m.removeChild(d),this.usingVirtualDom&&d.nodeName==="#text"&&m.nodeName==="STYLE"&&((u=m.rules)==null?void 0:u.length)>0&&(m.rules=[])}catch(h){if(h instanceof DOMException)this.warn("parent could not remove child in mutation",m,d,t);else throw h}});const o=xe({},this.legacy_missingNodeRetryMap),s=[],a=i=>{let u=null;return i.nextId&&(u=n.getNode(i.nextId)),i.nextId!==null&&i.nextId!==void 0&&i.nextId!==-1&&!u},l=i=>{var u;if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");let d=n.getNode(i.parentId);if(!d)return i.node.type===k.Document?this.newDocumentQueue.push(i):s.push(i);i.node.isShadow&&(Ae(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let m=null,h=null;if(i.previousId&&(m=n.getNode(i.previousId)),i.nextId&&(h=n.getNode(i.nextId)),a(i))return s.push(i);if(i.node.rootId&&!n.getNode(i.node.rootId))return;const g=i.node.rootId?n.getNode(i.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Ee(d,n)){this.attachDocumentToIframe(i,d);return}const f=je(i.node,{doc:g,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache});if(i.previousId===-1||i.nextId===-1){o[i.node.id]={node:f,mutation:i};return}const S=n.getMeta(d);if(S&&S.type===k.Element&&S.tagName==="textarea"&&i.node.type===k.Text){const p=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);for(const b of p)b.nodeType===d.TEXT_NODE&&d.removeChild(b)}if(m&&m.nextSibling&&m.nextSibling.parentNode)d.insertBefore(f,m.nextSibling);else if(h&&h.parentNode)d.contains(h)?d.insertBefore(f,h):d.insertBefore(f,null);else{if(d===g)for(;g.firstChild;)g.removeChild(g.firstChild);d.appendChild(f)}if(this.usingVirtualDom&&f.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)==null?void 0:u.length)>0&&(d.rules=[]),Ee(f,this.mirror)){const p=this.mirror.getId(f),b=this.newDocumentQueue.find(N=>N.parentId===p);b&&(this.attachDocumentToIframe(b,f),this.newDocumentQueue=this.newDocumentQueue.filter(N=>N!==b))}(i.previousId||i.nextId)&&this.legacy_resolveMissingNode(o,d,f,i)};t.adds.forEach(i=>{l(i)});const c=Date.now();for(;s.length;){const i=_t(s);if(s.length=0,Date.now()-c>500){this.warn("Timeout in the loop, please check the resolve tree data:",i);break}for(const u of i)n.getNode(u.value.parentId)?st(u,d=>{l(d)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(o).length&&Object.assign(this.legacy_missingNodeRetryMap,o),Pt(t.texts).forEach(i=>{var u;const d=n.getNode(i.id);if(!d)return t.removes.find(m=>m.id===i.id)?void 0:this.warnNodeNotFound(t,i.id);if(d.textContent=i.value,this.usingVirtualDom){const m=d.parentNode;((u=m?.rules)==null?void 0:u.length)>0&&(m.rules=[])}}),t.attributes.forEach(i=>{const u=n.getNode(i.id);if(!u)return t.removes.find(d=>d.id===i.id)?void 0:this.warnNodeNotFound(t,i.id);for(const d in i.attributes)if(typeof d=="string"){const m=i.attributes[d];if(m===null)u.removeAttribute(d);else if(typeof m=="string")try{u.setAttribute(d,m)}catch(h){this.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",h)}else if(d==="style"){const h=m,g=u;for(const f in h)if(h[f]===!1)g.style.removeProperty(f);else if(h[f]instanceof Array){const S=h[f];g.style.setProperty(f,S[0],S[1])}else{const S=h[f];g.style.setProperty(f,S)}}}})}applyScroll(t,r){const n=this.mirror.getNode(t.id);if(!n)return this.debugNodeNotFound(t,t.id);const o=this.mirror.getMeta(n);if(n===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else if(o?.type===k.Document)n.defaultView.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else try{n.scrollTop=t.y,n.scrollLeft=t.x}catch{}}applyInput(t){const r=this.mirror.getNode(t.id);if(!r)return this.debugNodeNotFound(t,t.id);try{r.checked=t.isChecked,r.value=t.text}catch{}}legacy_resolveMissingNode(t,r,n,o){const{previousId:s,nextId:a}=o,l=s&&t[s],c=a&&t[a];if(l){const{node:i,mutation:u}=l;r.insertBefore(i,n),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,r,i,u)}if(c){const{node:i,mutation:u}=c;r.insertBefore(i,n.nextSibling),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,r,i,u)}}moveAndHover(t,r,n,o,s){const a=this.mirror.getNode(n);if(!a)return this.debugNodeNotFound(s,n);const l=at(a,this.iframe),c=t*l.absoluteScale+l.x,i=r*l.absoluteScale+l.y;this.mouse.style.left=`${c}px`,this.mouse.style.top=`${i}px`,o||this.drawMouseTail({x:c,y:i}),this.hoverElements(a)}drawMouseTail(t){if(!this.mouseTail)return;const{lineCap:r,lineWidth:n,strokeStyle:o,duration:s}=this.config.mouseTail===!0?St:Object.assign({},St,this.config.mouseTail),a=()=>{if(!this.mouseTail)return;const l=this.mouseTail.getContext("2d");!l||!this.tailPositions.length||(l.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),l.beginPath(),l.lineWidth=n,l.lineCap=r,l.strokeStyle=o,l.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(c=>l.lineTo(c.x,c.y)),l.stroke())};this.tailPositions.push(t),a(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(l=>l!==t),a()},s/this.speedService.state.context.timer.speed)}hoverElements(t){var r;(r=this.iframe.contentDocument)==null||r.querySelectorAll(".\\:hover").forEach(o=>{o.classList.remove(":hover")});let n=t;for(;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement}isUserInteraction(t){return t.type!==M.IncrementalSnapshot?!1:t.data.source>x.Mutation&&t.data.source<=x.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(O.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(t,r){this.warn(`Node with id '${r}' not found. `,t)}warnCanvasMutationFailed(t,r){this.warn("Has error on canvas update",r,"canvas mutation:",t)}debugNodeNotFound(t,r){this.debug(bt,`Node with id '${r}' not found. `,t)}warn(...t){!this.config.showWarning||console.warn(bt,...t)}debug(...t){!this.config.showDebug||console.log(bt,...t)}}const{addCustomEvent:pi}=ye,{freezePage:fi}=ye;return q.EventType=M,q.IncrementalSource=x,q.MouseInteractions=Y,q.Replayer=mi,q.ReplayerEvents=O,q.addCustomEvent=pi,q.freezePage=fi,q.record=ye,q.utils=Tn,Object.defineProperty(q,"__esModule",{value:!0}),q}({});
|
|
18
|
+
***************************************************************************** */function In(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r,o,s=n.call(e),a=[];try{for(;(t===void 0||t-- >0)&&!(r=s.next()).done;)a.push(r.value)}catch(l){o={error:l}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return a}var Ie;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Ie||(Ie={}));var xn={type:"xstate.init"};function pt(e){return e===void 0?[]:[].concat(e)}function ge(e){return{type:"xstate.assign",assignment:e}}function Mn(e,t){return typeof(e=typeof e=="string"&&t&&t[e]?t[e]:e)=="string"?{type:e}:typeof e=="function"?{type:e.name,exec:e}:e}function He(e){return function(t){return e===t}}function kn(e){return typeof e=="string"?{type:e}:e}function Dn(e,t){return{value:e,context:t,actions:[],changed:!1,matches:He(e)}}function Rn(e,t,n){var r=t,o=!1;return[e.filter(function(s){if(s.type==="xstate.assign"){o=!0;var a=Object.assign({},r);return typeof s.assignment=="function"?a=s.assignment(r,n):Object.keys(s.assignment).forEach(function(l){a[l]=typeof s.assignment[l]=="function"?s.assignment[l](r,n):s.assignment[l]}),r=a,!1}return!0}),r,o]}function On(e,t){t===void 0&&(t={});var n=In(Rn(pt(e.states[e.initial].entry).map(function(a){return Mn(a,t.actions)}),e.context,xn),2),r=n[0],o=n[1],s={config:e,_options:t,initialState:{value:e.initial,actions:r,context:o,matches:He(e.initial)},transition:function(a,l){var c,i,u=typeof a=="string"?{value:a,context:e.context}:a,d=u.value,m=u.context,h=kn(l),f=e.states[d];if(f.on){var g=pt(f.on[h.type]);try{for(var N=function(L){var U=typeof Symbol=="function"&&Symbol.iterator,b=U&&L[U],v=0;if(b)return b.call(L);if(L&&typeof L.length=="number")return{next:function(){return L&&v>=L.length&&(L=void 0),{value:L&&L[v++],done:!L}}};throw new TypeError(U?"Object is not iterable.":"Symbol.iterator is not defined.")}(g),p=N.next();!p.done;p=N.next()){var S=p.value;if(S===void 0)return Dn(d,m);var y=typeof S=="string"?{target:S}:S,T=y.target,D=y.actions,A=D===void 0?[]:D,M=y.cond,F=M===void 0?function(){return!0}:M,W=T===void 0,X=T??d,Z=e.states[X];if(F(m,h)){var K=In(Rn((W?pt(A):[].concat(f.exit,A,Z.entry).filter(function(L){return L})).map(function(L){return Mn(L,s._options.actions)}),m,h),3),q=K[0],V=K[1],z=K[2],Y=T??d;return{value:Y,context:V,actions:q,changed:T!==d||q.length>0||z,matches:He(Y)}}}}catch(L){c={error:L}}finally{try{p&&!p.done&&(i=N.return)&&i.call(N)}finally{if(c)throw c.error}}}return Dn(d,m)}};return s}var An=function(e,t){return e.actions.forEach(function(n){var r=n.exec;return r&&r(e.context,t)})};function Ln(e){var t=e.initialState,n=Ie.NotStarted,r=new Set,o={_machine:e,send:function(s){n===Ie.Running&&(t=e.transition(t,s),An(t,kn(s)),r.forEach(function(a){return a(t)}))},subscribe:function(s){return r.add(s),s(t),{unsubscribe:function(){return r.delete(s)}}},start:function(s){if(s){var a=typeof s=="object"?s:{context:e.config.context,value:s};t={value:a.value,actions:[],context:a.context,matches:He(a.value)}}return n=Ie.Running,An(t,xn),o},stop:function(){return n=Ie.Stopped,r.clear(),o},get state(){return t},get status(){return n}};return o}var Qo=Object.defineProperty,Jo=Object.defineProperties,qo=Object.getOwnPropertyDescriptors,Pn=Object.getOwnPropertySymbols,ei=Object.prototype.hasOwnProperty,ti=Object.prototype.propertyIsEnumerable,_n=(e,t,n)=>t in e?Qo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xe=(e,t)=>{for(var n in t||(t={}))ei.call(t,n)&&_n(e,n,t[n]);if(Pn)for(var n of Pn(t))ti.call(t,n)&&_n(e,n,t[n]);return e},Ze=(e,t)=>Jo(e,qo(t));function ni(e,t){for(let n=e.length-1;n>=0;n--){const r=e[n];if(r.type===w.Meta&&r.timestamp<=t)return e.slice(n)}return e}function ri(e,{getCastFn:t,applyEventsSynchronously:n,emitter:r}){const o=On({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]},REPLACE_EVENTS:{target:"playing",actions:["replaceEvents"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]},REPLACE_EVENTS:{target:"paused",actions:["replaceEvents"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:ge({lastPlayedEvent:(s,a)=>a.type==="CAST_EVENT"?a.payload.event:s.lastPlayedEvent}),recordTimeOffset:ge((s,a)=>{let l=s.timeOffset;return"payload"in a&&"timeOffset"in a.payload&&(l=a.payload.timeOffset),Ze(Xe({},s),{timeOffset:l,baselineTime:s.events[0].timestamp+l})}),play(s){var a;const{timer:l,events:c,baselineTime:i,lastPlayedEvent:u}=s;l.clear();for(const g of c)mt(g,i);const d=ni(c,i);let m=u?.timestamp;u?.type===w.IncrementalSnapshot&&u.data.source===x.MouseMove&&(m=u.timestamp+((a=u.data.positions[0])==null?void 0:a.timeOffset)),i<(m||0)&&r.emit(O.PlayBack);const h=new Array,f=new Array;for(const g of d)if(!(m&&m<i&&(g.timestamp<=m||g===u)))if(g.timestamp<i)h.push(g);else{const N=t(g,!1);f.push({doAction:()=>{N()},delay:g.delay})}n(h),r.emit(O.Flush),l.addActions(f),l.start()},pause(s){s.timer.clear()},resetLastPlayedEvent:ge(s=>Ze(Xe({},s),{lastPlayedEvent:null})),startLive:ge({baselineTime:(s,a)=>(s.timer.toggleLiveMode(!0),s.timer.start(),a.type==="TO_LIVE"&&a.payload.baselineTime?a.payload.baselineTime:Date.now())}),replaceEvents:ge((s,a)=>{const{events:l,timer:c,baselineTime:i}=s;if(a.type==="REPLACE_EVENTS"){const{events:u}=a.payload;l.length=0;const d=[];for(const m of u)if(mt(m,i),l.push(m),m.timestamp>=c.timeOffset+i){const h=t(m,!1);d.push({doAction:()=>{h()},delay:m.delay})}c.isActive()&&c.replaceActions(d)}return Ze(Xe({},s),{events:l})}),addEvent:ge((s,a)=>{const{baselineTime:l,timer:c,events:i}=s;if(a.type==="ADD_EVENT"){const{event:u}=a.payload;mt(u,l);let d=i.length-1;if(!i[d]||i[d].timestamp<=u.timestamp)i.push(u);else{let f=-1,g=0;for(;g<=d;){const N=Math.floor((g+d)/2);i[N].timestamp<=u.timestamp?g=N+1:d=N-1}f===-1&&(f=g),i.splice(f,0,u)}const m=u.timestamp<l,h=t(u,m);m?h():c.isActive()&&c.addAction({doAction:()=>{h()},delay:u.delay})}return Ze(Xe({},s),{events:i})})}});return Ln(o)}function oi(e){const t=On({id:"speed",context:e,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(n,r)=>{"payload"in r&&n.timer.setSpeed(r.payload.speed)},recordSpeed:ge({normalSpeed:n=>n.timer.speed}),restoreSpeed:n=>{n.timer.setSpeed(n.normalSpeed)}}});return Ln(t)}const ii=e=>[`.${e} { background: currentColor }`,"noscript { display: none !important; }",`.${e} { background: currentColor; border-radius: 5px; }`,`.${e}:hover::after {content: 'Redacted'; color: white; background: black; text-align: center; width: 100%; display: block;}`];var si=(e,t,n)=>new Promise((r,o)=>{var s=c=>{try{l(n.next(c))}catch(i){o(i)}},a=c=>{try{l(n.throw(c))}catch(i){o(i)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,a);l((n=n.apply(e,t)).next())});const Fn=new Map;function Wn(e,t){let n=Fn.get(e);return n||(n=new Map,Fn.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}function de(e,t,n){return r=>si(this,null,function*(){if(r&&typeof r=="object"&&"rr_type"in r)if(n&&(n.isUnchanged=!1),r.rr_type==="ImageBitmap"&&"args"in r){const o=yield de(e,t,n)(r.args);return yield createImageBitmap.apply(null,o)}else if("index"in r){if(n||t===null)return r;const{rr_type:o,index:s}=r;return Wn(t,o)[s]}else if("args"in r){const{rr_type:o,args:s}=r,a=window[o];return new a(...yield Promise.all(s.map(de(e,t,n))))}else{if("base64"in r)return ro(r.base64);if("src"in r){const o=e.get(r.src);if(o)return o;{const s=new Image;return s.src=r.src,e.set(r.src,s),s}}else if("data"in r&&r.rr_type==="Blob"){const o=yield Promise.all(r.data.map(de(e,t,n)));return new Blob(o,{type:r.type})}}else if(Array.isArray(r))return yield Promise.all(r.map(de(e,t,n)));return r})}var ai=(e,t,n)=>new Promise((r,o)=>{var s=c=>{try{l(n.next(c))}catch(i){o(i)}},a=c=>{try{l(n.throw(c))}catch(i){o(i)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,a);l((n=n.apply(e,t)).next())});function li(e,t){try{return t===ce.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}const ci=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function ui(e,t){if(!(t!=null&&t.constructor))return;const{name:n}=t.constructor;if(!ci.includes(n))return;const r=Wn(e,n);r.includes(t)||r.push(t)}function di(e){return ai(this,arguments,function*({mutation:t,target:n,type:r,imageMap:o,errorHandler:s}){try{const a=li(n,r);if(!a)return;if(t.setter){a[t.property]=t.args[0];return}const l=a[t.property],c=yield Promise.all(t.args.map(de(o,a))),i=l.apply(a,c);ui(a,i)}catch(a){s(t,a)}})}var hi=(e,t,n)=>new Promise((r,o)=>{var s=c=>{try{l(n.next(c))}catch(i){o(i)}},a=c=>{try{l(n.throw(c))}catch(i){o(i)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,a);l((n=n.apply(e,t)).next())});function mi(e){return hi(this,arguments,function*({event:t,mutation:n,target:r,imageMap:o,errorHandler:s}){try{const a=r.getContext("2d");if(n.setter){a[n.property]=n.args[0];return}const l=a[n.property];if(n.property==="drawImage"&&typeof n.args[0]=="string"){const c=o.get(t);l.apply(a,n.args)}else{const c=yield Promise.all(n.args.map(de(o,a)));l.apply(a,c)}}catch(a){s(n,a)}})}var pi=(e,t,n)=>new Promise((r,o)=>{var s=c=>{try{l(n.next(c))}catch(i){o(i)}},a=c=>{try{l(n.throw(c))}catch(i){o(i)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,a);l((n=n.apply(e,t)).next())});function $n(e){return pi(this,arguments,function*({event:t,mutation:n,target:r,imageMap:o,canvasEventMap:s,errorHandler:a}){try{const l=s.get(t)||n,c="commands"in l?l.commands:[l];if([ce.WebGL,ce.WebGL2].includes(n.type)){for(let i=0;i<c.length;i++){const u=c[i];yield di({mutation:u,type:n.type,target:r,imageMap:o,errorHandler:a})}return}for(let i=0;i<c.length;i++){const u=c[i];yield mi({event:t,mutation:u,target:r,imageMap:o,errorHandler:a})}}catch(l){a(n,l)}})}var fi=Object.defineProperty,gi=Object.defineProperties,vi=Object.getOwnPropertyDescriptors,Vn=Object.getOwnPropertySymbols,yi=Object.prototype.hasOwnProperty,bi=Object.prototype.propertyIsEnumerable,Un=(e,t,n)=>t in e?fi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xe=(e,t)=>{for(var n in t||(t={}))yi.call(t,n)&&Un(e,n,t[n]);if(Vn)for(var n of Vn(t))bi.call(t,n)&&Un(e,n,t[n]);return e},ft=(e,t)=>gi(e,vi(t)),gt=(e,t,n)=>new Promise((r,o)=>{var s=c=>{try{l(n.next(c))}catch(i){o(i)}},a=c=>{try{l(n.throw(c))}catch(i){o(i)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,a);l((n=n.apply(e,t)).next())});const jn=10*1e3,Bn=2*1e3,Gn=1*1e3,zn=60*60*1e3,Si=Cn||Xo,vt="[replayer]",yt={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function bt(e){return e.type==w.IncrementalSnapshot&&(e.data.source==x.TouchMove||e.data.source==x.MouseInteraction&&e.data.type==G.TouchStart)}class Ti{constructor(t,n){if(this.usingVirtualDom=!1,this.virtualDom=new Ce,this.mouseTail=null,this.tailPositions=[],this.emitter=Si(),this.activityIntervals=[],this.legacy_missingNodeRetryMap={},this.cache=Ot(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=Nt(),this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,!(n!=null&&n.liveMode)&&t.length<2)throw new Error("Replayer need at least 2 events.");const r={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"highlight-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:yt,useVirtualDom:!0,inactiveThreshold:.02,inactiveSkipTime:Bn};this.config=Object.assign({},r,n),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(O.Resize,this.handleResize),this.setupDom(),this.emitter.on(O.Flush,()=>{if(this.usingVirtualDom){const l={mirror:this.mirror,applyCanvas:(c,i,u)=>{$n({event:c,mutation:i,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this)};if(se(this.iframe.contentDocument,this.virtualDom,l,this.virtualDom.mirror),this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const c in this.legacy_missingNodeRetryMap)try{const i=this.legacy_missingNodeRetryMap[c],u=ht(i.node,this.mirror,this.virtualDom.mirror);se(u,i.node,l,this.virtualDom.mirror),i.node=u}catch(i){this.config.showWarning&&console.warn(i)}}this.mousePos&&this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null}),this.emitter.on(O.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset()});const o=new Ko([],n?.speed||r.speed);this.service=ri({events:t.map(l=>n&&n.unpackFn?n.unpackFn(l):l).sort((l,c)=>l.timestamp-c.timestamp),timer:o,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(l=>{this.emitter.emit(O.StateChange,{player:l})}),this.speedService=oi({normalSpeed:-1,timer:o}),this.speedService.start(),this.speedService.subscribe(l=>{this.emitter.emit(O.StateChange,{speed:l})});const s=this.service.state.context.events.find(l=>l.type===w.Meta),a=this.service.state.context.events.find(l=>l.type===w.FullSnapshot);if(s){const{width:l,height:c}=s.data;setTimeout(()=>{this.emitter.emit(O.Resize,{width:l,height:c})},0)}a&&setTimeout(()=>{this.firstFullSnapshot||(this.firstFullSnapshot=a,this.rebuildFullSnapshot(a),this.iframe.contentWindow.scrollTo(a.data.initialOffset))},1),this.service.state.context.events.find(bt)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(t,n){return this.emitter.on(t,n),this}off(t,n){return this.emitter.off(t,n),this}setConfig(t){Object.keys(t).forEach(n=>{this.config[n]=t[n]}),this.config.skipInactive||this.backToNormal(),typeof t.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:t.speed}}),typeof t.mouseTail<"u"&&(t.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getActivityIntervals(){if(this.activityIntervals.length==0){const t=[],n=this.getMetaData(),r=[{timestamp:n.startTime},...this.service.state.context.events.filter(a=>this.isUserInteraction(a)),{timestamp:n.endTime}];for(let a=1;a<r.length;a++){const l=r[a-1],c=r[a];c.timestamp-l.timestamp>jn?t.push({startTime:l.timestamp,endTime:c.timestamp,duration:c.timestamp-l.timestamp,active:!1}):t.push({startTime:l.timestamp,endTime:c.timestamp,duration:c.timestamp-l.timestamp,active:!0})}const o=[];let s=t[0];for(let a=1;a<t.length;a++)t[a].active!=t[a-1].active&&(o.push({startTime:s.startTime,endTime:t[a-1].endTime,duration:t[a-1].endTime-s.startTime,active:t[a-1].active}),s=t[a]);s&&t.length>0&&o.push({startTime:s.startTime,endTime:t[t.length-1].endTime,duration:t[t.length-1].endTime-s.startTime,active:t[t.length-1].active}),s=o[0];for(let a=1;a<o.length;a++)(!o[a].active&&o[a].duration>this.config.inactiveThreshold*n.totalTime||!o[a-1].active&&o[a-1].duration>this.config.inactiveThreshold*n.totalTime)&&(this.activityIntervals.push({startTime:s.startTime,endTime:o[a-1].endTime,duration:o[a-1].endTime-s.startTime,active:o[a-1].active}),s=o[a]);s&&o.length>0&&this.activityIntervals.push({startTime:s.startTime,endTime:o[o.length-1].endTime,duration:o[o.length-1].endTime-s.startTime,active:o[o.length-1].active})}return this.activityIntervals}getMetaData(){const t=this.service.state.context.events[0],n=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:t.timestamp,endTime:n.timestamp,totalTime:n.timestamp-t.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:t,events:n}=this.service.state.context;return t-n[0].timestamp}getMirror(){return this.mirror}play(t=0){var n,r;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:t}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:t}})),(r=(n=this.iframe.contentDocument)==null?void 0:n.getElementsByTagName("html")[0])==null||r.classList.remove("rrweb-paused"),this.emitter.emit(O.Start),this.handleInactivity(this.getMetaData().startTime+t,!0)}pause(t){var n,r;t===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof t=="number"&&(this.play(t),this.service.send({type:"PAUSE"})),(r=(n=this.iframe.contentDocument)==null?void 0:n.getElementsByTagName("html")[0])==null||r.classList.add("rrweb-paused"),this.emitter.emit(O.Pause)}resume(t=0){console.warn("The 'resume' will be departed in 1.0. Please use 'play' method which has the same interface."),this.play(t),this.emitter.emit(O.Resume)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){const n=this.config.unpackFn?this.config.unpackFn(t):t;bt(n)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:n}}))}replaceEvents(t){for(const n of t)if(bt(n)){this.mouse.classList.add("touch-device");break}this.service.send({type:"REPLACE_EVENTS",payload:{events:t}})}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=Ot()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");const t=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&t.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",t.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(Zo(this.iframe.contentWindow,this.iframe.contentDocument),it(this.iframe.contentWindow))}handleResize(t){this.iframe.style.display="inherit";for(const n of[this.mouseTail,this.iframe])!n||(n.setAttribute("width",String(t.width)),n.setAttribute("height",String(t.height)))}applyEventsSynchronously(t){for(const n of t){switch(n.type){case w.DomContentLoaded:case w.Load:case w.Custom:continue;case w.FullSnapshot:case w.Meta:case w.Plugin:case w.IncrementalSnapshot:break}this.getCastFn(n,!0)()}this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null}getCastFn(t,n=!1){let r;switch(t.type){case w.DomContentLoaded:case w.Load:break;case w.Custom:r=()=>{this.emitter.emit(O.CustomEvent,t)};break;case w.Meta:r=()=>this.emitter.emit(O.Resize,{width:t.data.width,height:t.data.height});break;case w.FullSnapshot:r=()=>{if(this.firstFullSnapshot){if(this.firstFullSnapshot===t){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(t,n),this.iframe.contentWindow.scrollTo(t.data.initialOffset)};break;case w.IncrementalSnapshot:r=()=>{if(this.applyIncremental(t,n),!n&&(this.handleInactivity(t.timestamp),t===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const o of this.service.state.context.events)if(!(o.timestamp<=t.timestamp)&&this.isUserInteraction(o)){o.delay-t.delay>jn*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=o);break}if(this.nextUserInteractionEvent){const o=this.nextUserInteractionEvent.delay-t.delay,s={speed:Math.min(Math.round(o/Bn),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:s}),this.emitter.emit(O.SkipStart,s)}}};break}return()=>{r&&r();for(const s of this.config.plugins||[])s.handler(t,n,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:t}});const o=this.service.state.context.events.length-1;if(t===this.service.state.context.events[o]){const s=()=>{o<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(O.Finish))};t.type===w.IncrementalSnapshot&&t.data.source===x.MouseMove&&t.data.positions.length?setTimeout(()=>{s()},Math.max(0,-t.data.positions[0].timeOffset+50)):s()}this.emitter.emit(O.EventCast,t)}}handleInactivity(t,n){if((t===this.inactiveEndTimestamp||n)&&(this.inactiveEndTimestamp=null,this.backToNormal()),this.config.skipInactive&&!this.inactiveEndTimestamp){for(const r of this.getActivityIntervals())if(t>=r.startTime&&t<r.endTime&&!r.active){this.inactiveEndTimestamp=r.endTime;break}if(this.inactiveEndTimestamp){const r=this.inactiveEndTimestamp-t,o={speed:r/zn*this.config.inactiveSkipTime<Gn?r/Gn:Math.round(Math.max(r,zn)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:o}),this.emitter.emit(O.SkipStart,o)}}}rebuildFullSnapshot(t,n=!1){if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const r=[];Mr(t.data.node,{doc:this.iframe.contentDocument,afterAppend:a=>{this.collectIframeAndAttachDocument(r,a)},cache:this.cache,mirror:this.mirror});for(const{mutationInQueue:a,builtNode:l}of r)this.attachDocumentToIframe(a,l),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==a);const{documentElement:o,head:s}=this.iframe.contentDocument;this.insertStyleRules(o,s),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(O.FullsnapshotRebuilded,t),n||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,n){const r=ii(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&r.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,wn(o,this.virtualDom.unserializedId)),t.insertBefore(o,n);for(let s=0;s<r.length;s++)o.rules.push({cssText:r[s],type:ie.Insert,index:s})}else{const o=document.createElement("style");t.insertBefore(o,n);for(let s=0;s<r.length;s++)o.sheet.insertRule(r[s],s)}}attachDocumentToIframe(t,n){const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,o=[];je(t.node,{doc:n.contentDocument,mirror:r,hackCss:!0,skipChild:!1,afterAppend:s=>{this.collectIframeAndAttachDocument(o,s);const a=r.getMeta(s);if(a?.type===R.Element&&a?.tagName.toUpperCase()==="HTML"){const{documentElement:l,head:c}=n.contentDocument;this.insertStyleRules(l,c)}},cache:this.cache});for(const{mutationInQueue:s,builtNode:a}of o)this.attachDocumentToIframe(s,a),this.newDocumentQueue=this.newDocumentQueue.filter(l=>l!==s)}collectIframeAndAttachDocument(t,n){if(Ne(n,this.mirror)){const r=this.newDocumentQueue.find(o=>o.parentId===this.mirror.getId(n));r&&t.push({mutationInQueue:r,builtNode:n})}}waitForStylesheetLoad(){var t;const n=(t=this.iframe.contentDocument)==null?void 0:t.head;if(n){const r=new Set;let o,s=this.service.state;const a=()=>{s=this.service.state};this.emitter.on(O.Start,a),this.emitter.on(O.Pause,a);const l=()=>{this.emitter.off(O.Start,a),this.emitter.off(O.Pause,a)};n.querySelectorAll('link[rel="stylesheet"]').forEach(c=>{c.sheet||(r.add(c),c.addEventListener("load",()=>{r.delete(c),r.size===0&&o!==-1&&(s.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(O.LoadStylesheetEnd),o&&clearTimeout(o),l())}))}),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(O.LoadStylesheetStart),o=setTimeout(()=>{s.matches("playing")&&this.play(this.getCurrentTime()),o=-1,l()},this.config.loadTimeout))}}hasImageArg(t){for(const n of t)if(!(!n||typeof n!="object")){if("rr_type"in n&&"args"in n){if(this.hasImageArg(n.args))return!0}else if("rr_type"in n&&n.rr_type==="HTMLImageElement"||n instanceof Array&&this.hasImageArg(n))return!0}return!1}getImageArgs(t){const n=[];for(const r of t)!r||typeof r!="object"||("rr_type"in r&&"args"in r?n.push(...this.getImageArgs(r.args)):"rr_type"in r&&r.rr_type==="HTMLImageElement"?n.push(r.src):r instanceof Array&&n.push(...this.getImageArgs(r)));return n}preloadAllImages(){return gt(this,null,function*(){this.service.state;const t=()=>{this.service.state};this.emitter.on(O.Start,t),this.emitter.on(O.Pause,t);const n=[];for(const r of this.service.state.context.events)r.type===w.IncrementalSnapshot&&r.data.source===x.CanvasMutation&&(n.push(this.deserializeAndPreloadCanvasEvents(r.data,r)),("commands"in r.data?r.data.commands:[r.data]).forEach(o=>{this.preloadImages(o,r)}));return Promise.all(n)})}preloadImages(t,n){if(t.property==="drawImage"&&typeof t.args[0]=="string"&&!this.imageMap.has(n)){const r=document.createElement("canvas"),o=r.getContext("2d"),s=o?.createImageData(r.width,r.height);s?.data,JSON.parse(t.args[0]),o?.putImageData(s,0,0)}}deserializeAndPreloadCanvasEvents(t,n){return gt(this,null,function*(){if(!this.canvasEventMap.has(n)){const r={isUnchanged:!0};if("commands"in t){const o=yield Promise.all(t.commands.map(s=>gt(this,null,function*(){const a=yield Promise.all(s.args.map(de(this.imageMap,null,r)));return ft(xe({},s),{args:a})})));r.isUnchanged===!1&&this.canvasEventMap.set(n,ft(xe({},t),{commands:o}))}else{const o=yield Promise.all(t.args.map(de(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(n,ft(xe({},t),{args:o}))}}})}applyIncremental(t,n){var r,o,s,a,l,c;const{data:i}=t;switch(i.source){case x.Mutation:{try{this.applyMutation(i,n)}catch(u){this.warn(`Exception in mutation ${u.message||u}`,i)}break}case x.Drag:case x.TouchMove:case x.MouseMove:if(n){const u=i.positions[i.positions.length-1];this.mousePos={x:u.x,y:u.y,id:u.id,debugData:i}}else i.positions.forEach(u=>{const d={doAction:()=>{this.moveAndHover(u.x,u.y,u.id,n,i)},delay:u.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(d)}),this.timer.addAction({doAction(){},delay:t.delay-((r=i.positions[0])==null?void 0:r.timeOffset)});break;case x.MouseInteraction:{if(i.id===-1||n)break;const u=new Event(G[i.type].toLowerCase()),d=this.mirror.getNode(i.id);if(!d)return this.debugNodeNotFound(i,i.id);this.emitter.emit(O.MouseInteraction,{type:i.type,target:d});const{triggerFocus:m}=this.config;switch(i.type){case G.Blur:"blur"in d&&d.blur();break;case G.Focus:m&&d.focus&&d.focus({preventScroll:!0});break;case G.Click:case G.TouchStart:case G.TouchEnd:n?(i.type===G.TouchStart?this.touchActive=!0:i.type===G.TouchEnd&&(this.touchActive=!1),this.mousePos={x:i.x,y:i.y,id:i.id,debugData:i}):(i.type===G.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(i.x,i.y,i.id,n,i),i.type===G.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):i.type===G.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):i.type===G.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case G.TouchCancel:n?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:d.dispatchEvent(u)}break}case x.Scroll:{if(i.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);u.scrollData=i;break}this.applyScroll(i,n);break}case x.ViewportResize:this.emitter.emit(O.Resize,{width:i.width,height:i.height});break;case x.Input:{if(i.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);u.inputData=i;break}this.applyInput(i);break}case x.MediaInteraction:{const u=this.usingVirtualDom?this.virtualDom.mirror.getNode(i.id):this.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);const d=u;try{i.currentTime&&(d.currentTime=i.currentTime),i.volume&&(d.volume=i.volume),i.muted&&(d.muted=i.muted),i.type===me.Pause&&d.pause(),i.type===me.Play&&d.play()}catch(m){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${m.message||m}`)}break}case x.StyleSheetRule:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);const d=u.rules;(o=i.adds)==null||o.forEach(({rule:m,index:h})=>d?.push({cssText:m,index:h,type:ie.Insert})),(s=i.removes)==null||s.forEach(({index:m})=>d?.push({index:m,type:ie.Remove}))}else{const u=this.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);const d=u.sheet;(a=i.adds)==null||a.forEach(({rule:m,index:h})=>{try{if(Array.isArray(h)){const{positions:f,index:g}=lt(h);Ee(d.cssRules,f).insertRule(m,g)}else{const f=h===void 0?void 0:Math.min(h,d.cssRules.length);d.insertRule(m,f)}}catch{}}),(l=i.removes)==null||l.forEach(({index:m})=>{try{if(Array.isArray(m)){const{positions:h,index:f}=lt(m);Ee(d.cssRules,h).deleteRule(f||0)}else d?.deleteRule(m)}catch{}})}break}case x.StyleDeclaration:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);const d=u.rules;i.set&&d.push(xe({type:ie.SetProperty,index:i.index},i.set)),i.remove&&d.push(xe({type:ie.RemoveProperty,index:i.index},i.remove))}else{const u=this.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);const d=u.sheet;i.set&&Ee(d.rules,i.index).style.setProperty(i.set.property,i.set.value,i.set.priority),i.remove&&Ee(d.rules,i.index).style.removeProperty(i.remove.property)}break}case x.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);u.canvasMutations.push({event:t,mutation:i})}else{const u=this.mirror.getNode(i.id);if(!u)return this.debugNodeNotFound(i,i.id);$n({event:t,mutation:i,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case x.Font:{try{const u=new FontFace(i.family,i.buffer?new Uint8Array(JSON.parse(i.fontSource)):i.fontSource,i.descriptors);(c=this.iframe.contentDocument)==null||c.fonts.add(u)}catch(u){this.config.showWarning&&console.warn(u)}break}}}applyMutation(t,n){if(this.config.useVirtualDom&&!this.usingVirtualDom&&n&&(this.usingVirtualDom=!0,zo(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const i in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[i],d=En(u.node,this.virtualDom,this.mirror);d&&(u.node=d)}catch(u){this.config.showWarning&&console.warn(u)}const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;t.removes.forEach(i=>{var u;const d=r.getNode(i.id);if(!d)return t.removes.find(h=>h.id===i.parentId)?void 0:this.warnNodeNotFound(t,i.id);let m=r.getNode(i.parentId);if(!m)return this.warnNodeNotFound(t,i.parentId);if(i.isShadow&&Ae(m)&&(m=m.shadowRoot),r.removeNodeFromMap(d),m)try{m.removeChild(d),this.usingVirtualDom&&d.nodeName==="#text"&&m.nodeName==="STYLE"&&((u=m.rules)==null?void 0:u.length)>0&&(m.rules=[])}catch(h){if(h instanceof DOMException)this.warn("parent could not remove child in mutation",m,d,t);else throw h}});const o=xe({},this.legacy_missingNodeRetryMap),s=[],a=i=>{let u=null;return i.nextId&&(u=r.getNode(i.nextId)),i.nextId!==null&&i.nextId!==void 0&&i.nextId!==-1&&!u},l=i=>{var u;if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");let d=r.getNode(i.parentId);if(!d)return i.node.type===R.Document?this.newDocumentQueue.push(i):s.push(i);i.node.isShadow&&(Ae(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let m=null,h=null;if(i.previousId&&(m=r.getNode(i.previousId)),i.nextId&&(h=r.getNode(i.nextId)),a(i))return s.push(i);if(i.node.rootId&&!r.getNode(i.node.rootId))return;const f=i.node.rootId?r.getNode(i.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Ne(d,r)){this.attachDocumentToIframe(i,d);return}const g=je(i.node,{doc:f,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache});if(i.previousId===-1||i.nextId===-1){o[i.node.id]={node:g,mutation:i};return}const N=r.getMeta(d);if(N&&N.type===R.Element&&N.tagName==="textarea"&&i.node.type===R.Text){const p=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);for(const S of p)S.nodeType===d.TEXT_NODE&&d.removeChild(S)}if(m&&m.nextSibling&&m.nextSibling.parentNode)d.insertBefore(g,m.nextSibling);else if(h&&h.parentNode)d.contains(h)?d.insertBefore(g,h):d.insertBefore(g,null);else{if(d===f)for(;f.firstChild;)f.removeChild(f.firstChild);d.appendChild(g)}if(this.usingVirtualDom&&g.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)==null?void 0:u.length)>0&&(d.rules=[]),Ne(g,this.mirror)){const p=this.mirror.getId(g),S=this.newDocumentQueue.find(y=>y.parentId===p);S&&(this.attachDocumentToIframe(S,g),this.newDocumentQueue=this.newDocumentQueue.filter(y=>y!==S))}(i.previousId||i.nextId)&&this.legacy_resolveMissingNode(o,d,g,i)};t.adds.forEach(i=>{l(i)});const c=Date.now();for(;s.length;){const i=Pt(s);if(s.length=0,Date.now()-c>500){this.warn("Timeout in the loop, please check the resolve tree data:",i);break}for(const u of i)r.getNode(u.value.parentId)?st(u,d=>{l(d)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(o).length&&Object.assign(this.legacy_missingNodeRetryMap,o),Ft(t.texts).forEach(i=>{var u;const d=r.getNode(i.id);if(!d)return t.removes.find(m=>m.id===i.id)?void 0:this.warnNodeNotFound(t,i.id);if(d.textContent=i.value,this.usingVirtualDom){const m=d.parentNode;((u=m?.rules)==null?void 0:u.length)>0&&(m.rules=[])}}),t.attributes.forEach(i=>{const u=r.getNode(i.id);if(!u)return t.removes.find(d=>d.id===i.id)?void 0:this.warnNodeNotFound(t,i.id);for(const d in i.attributes)if(typeof d=="string"){const m=i.attributes[d];if(m===null)u.removeAttribute(d);else if(typeof m=="string")try{u.setAttribute(d,m)}catch(h){this.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",h)}else if(d==="style"){const h=m,f=u;for(const g in h)if(h[g]===!1)f.style.removeProperty(g);else if(h[g]instanceof Array){const N=h[g];f.style.setProperty(g,N[0],N[1])}else{const N=h[g];f.style.setProperty(g,N)}}}})}applyScroll(t,n){const r=this.mirror.getNode(t.id);if(!r)return this.debugNodeNotFound(t,t.id);const o=this.mirror.getMeta(r);if(r===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:t.y,left:t.x,behavior:n?"auto":"smooth"});else if(o?.type===R.Document)r.defaultView.scrollTo({top:t.y,left:t.x,behavior:n?"auto":"smooth"});else try{r.scrollTop=t.y,r.scrollLeft=t.x}catch{}}applyInput(t){const n=this.mirror.getNode(t.id);if(!n)return this.debugNodeNotFound(t,t.id);try{n.checked=t.isChecked,n.value=t.text}catch{}}legacy_resolveMissingNode(t,n,r,o){const{previousId:s,nextId:a}=o,l=s&&t[s],c=a&&t[a];if(l){const{node:i,mutation:u}=l;n.insertBefore(i,r),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,n,i,u)}if(c){const{node:i,mutation:u}=c;n.insertBefore(i,r.nextSibling),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,n,i,u)}}moveAndHover(t,n,r,o,s){const a=this.mirror.getNode(r);if(!a)return this.debugNodeNotFound(s,r);const l=at(a,this.iframe),c=t*l.absoluteScale+l.x,i=n*l.absoluteScale+l.y;this.mouse.style.left=`${c}px`,this.mouse.style.top=`${i}px`,o||this.drawMouseTail({x:c,y:i}),this.hoverElements(a)}drawMouseTail(t){if(!this.mouseTail)return;const{lineCap:n,lineWidth:r,strokeStyle:o,duration:s}=this.config.mouseTail===!0?yt:Object.assign({},yt,this.config.mouseTail),a=()=>{if(!this.mouseTail)return;const l=this.mouseTail.getContext("2d");!l||!this.tailPositions.length||(l.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),l.beginPath(),l.lineWidth=r,l.lineCap=n,l.strokeStyle=o,l.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(c=>l.lineTo(c.x,c.y)),l.stroke())};this.tailPositions.push(t),a(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(l=>l!==t),a()},s/this.speedService.state.context.timer.speed)}hoverElements(t){var n;(n=this.iframe.contentDocument)==null||n.querySelectorAll(".\\:hover").forEach(o=>{o.classList.remove(":hover")});let r=t;for(;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement}isUserInteraction(t){return t.type!==w.IncrementalSnapshot?!1:t.data.source>x.Mutation&&t.data.source<=x.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(O.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(t,n){this.warn(`Node with id '${n}' not found. `,t)}warnCanvasMutationFailed(t,n){this.warn("Has error on canvas update",n,"canvas mutation:",t)}debugNodeNotFound(t,n){this.debug(vt,`Node with id '${n}' not found. `,t)}warn(...t){!this.config.showWarning||console.warn(vt,...t)}debug(...t){!this.config.showDebug||console.log(vt,...t)}}const{addCustomEvent:Ni}=fe,{freezePage:Ei}=fe;return J.EventType=w,J.IncrementalSource=x,J.MouseInteractions=G,J.Replayer=Ti,J.ReplayerEvents=O,J.addCustomEvent=Ni,J.freezePage=Ei,J.record=fe,J.utils=kr,Object.defineProperty(J,"__esModule",{value:!0}),J}({});
|
|
19
19
|
//# sourceMappingURL=rrweb.min.js.map
|