@highlight-run/rrweb 2.0.16 → 2.0.19
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/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.css +1 -1
- package/dist/replay/rrweb-replay-unpack.js +3 -3
- package/dist/replay/rrweb-replay-unpack.min.css +1 -1
- package/dist/replay/rrweb-replay-unpack.min.css.map +1 -1
- package/dist/replay/rrweb-replay-unpack.min.js +3 -3
- package/dist/replay/rrweb-replay-unpack.min.js.map +1 -1
- package/dist/replay/rrweb-replay.css +1 -1
- package/dist/replay/rrweb-replay.js +3 -3
- package/dist/replay/rrweb-replay.min.css +1 -1
- package/dist/replay/rrweb-replay.min.css.map +1 -1
- package/dist/replay/rrweb-replay.min.js +3 -3
- package/dist/replay/rrweb-replay.min.js.map +1 -1
- package/dist/rrweb-all.css +1 -1
- package/dist/rrweb-all.js +8 -8
- package/dist/rrweb-all.min.css +1 -1
- package/dist/rrweb-all.min.css.map +1 -1
- package/dist/rrweb-all.min.js +8 -8
- package/dist/rrweb-all.min.js.map +1 -1
- package/dist/rrweb.css +1 -1
- package/dist/rrweb.js +5 -5
- package/dist/rrweb.min.css +1 -1
- package/dist/rrweb.min.css.map +1 -1
- package/dist/rrweb.min.js +5 -5
- package/dist/rrweb.min.js.map +1 -1
- package/es/rrweb/all.css +1 -1
- package/es/rrweb/packages/rrdom/es/rrdom.js +0 -4
- package/es/rrweb/packages/rrweb/src/record/index.js +3 -3
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas-manager.js +3 -0
- package/es/rrweb/packages/rrweb/src/replay/styles/inject-style.js +0 -1
- package/lib/record/rrweb-record.js +5 -2
- package/lib/replay/rrweb-replay-unpack.css +1 -1
- package/lib/replay/rrweb-replay-unpack.js +0 -5
- package/lib/replay/rrweb-replay.css +1 -1
- package/lib/replay/rrweb-replay.js +0 -5
- package/lib/rrweb-all.css +1 -1
- package/lib/rrweb-all.js +5 -7
- package/lib/rrweb.css +1 -1
- package/lib/rrweb.js +5 -7
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var rrwebReplay=function(he){"use strict";var A;(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"})(A||(A={}));function vt(e){return e.nodeType===e.ELEMENT_NODE}var xe=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(i){return n.removeNodeFromMap(i)})},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 Tt(){return new xe}var Re=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Nt(e,t){t===void 0&&(t={});var n=1,r=1;function i(g){var m=g.match(/\n/g);m&&(n+=m.length);var b=g.lastIndexOf(`
|
|
2
|
-
`);r=b===-1?r+g.length:g.length-b}function s(){var g={line:n,column:r};return function(m){return m.position=new a(g),T(),m}}var a=function(){function g(m){this.start=m,this.end={line:n,column:r},this.source=t.source}return g}();a.prototype.content=e;var l=[];function c(g){var m=new Error(t.source+":"+n+":"+r+": "+g);if(m.reason=g,m.filename=t.source,m.line=n,m.column=r,m.source=e,t.silent)l.push(m);else throw m}function o(){var g=h();return{type:"stylesheet",stylesheet:{source:t.source,rules:g,parsingErrors:l}}}function u(){return f(/^{\s*/)}function d(){return f(/^}/)}function h(){var g,m=[];for(T(),y(m);e.length&&e.charAt(0)!=="}"&&(g=O()||re());)g!==!1&&(m.push(g),y(m));return m}function f(g){var m=g.exec(e);if(m){var b=m[0];return i(b),e=e.slice(b.length),m}}function T(){f(/^\s*/)}function y(g){g===void 0&&(g=[]);for(var m;m=N();)m!==!1&&g.push(m),m=N();return g}function N(){var g=s();if(!(e.charAt(0)!=="/"||e.charAt(1)!=="*")){for(var m=2;e.charAt(m)!==""&&(e.charAt(m)!=="*"||e.charAt(m+1)!=="/");)++m;if(m+=2,e.charAt(m-1)==="")return c("End of comment missing");var b=e.slice(2,m-2);return r+=2,i(b),e=e.slice(m),r+=2,g({type:"comment",comment:b})}}function p(){var g=f(/^([^{]+)/);if(g)return V(g[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(m){return m.replace(/,/g,"\u200C")}).split(/\s*(?![^(]*\)),\s*/).map(function(m){return m.replace(/\u200C/g,",")})}function v(){var g=s(),m=f(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(m){var b=V(m[0]);if(!f(/^:\s*/))return c("property missing ':'");var R=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),P=g({type:"declaration",property:b.replace(Re,""),value:R?V(R[0]).replace(Re,""):""});return f(/^[;\s]*/),P}}function w(){var g=[];if(!u())return c("missing '{'");y(g);for(var m;m=v();)m!==!1&&(g.push(m),y(g)),m=v();return d()?g:c("missing '}'")}function M(){for(var g,m=[],b=s();g=f(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)m.push(g[1]),f(/^,\s*/);if(m.length)return b({type:"keyframe",values:m,declarations:w()})}function I(){var g=s(),m=f(/^@([-\w]+)?keyframes\s*/);if(m){var b=m[1];if(m=f(/^([-\w]+)\s*/),!m)return c("@keyframes missing name");var R=m[1];if(!u())return c("@keyframes missing '{'");for(var P,de=y();P=M();)de.push(P),de=de.concat(y());return d()?g({type:"keyframes",name:R,vendor:b,keyframes:de}):c("@keyframes missing '}'")}}function k(){var g=s(),m=f(/^@supports *([^{]+)/);if(m){var b=V(m[1]);if(!u())return c("@supports missing '{'");var R=y().concat(h());return d()?g({type:"supports",supports:b,rules:R}):c("@supports missing '}'")}}function U(){var g=s(),m=f(/^@host\s*/);if(m){if(!u())return c("@host missing '{'");var b=y().concat(h());return d()?g({type:"host",rules:b}):c("@host missing '}'")}}function j(){var g=s(),m=f(/^@media *([^{]+)/);if(m){var b=V(m[1]);if(!u())return c("@media missing '{'");var R=y().concat(h());return d()?g({type:"media",media:b,rules:R}):c("@media missing '}'")}}function L(){var g=s(),m=f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(m)return g({type:"custom-media",name:V(m[1]),media:V(m[2])})}function te(){var g=s(),m=f(/^@page */);if(m){var b=p()||[];if(!u())return c("@page missing '{'");for(var R=y(),P;P=v();)R.push(P),R=R.concat(y());return d()?g({type:"page",selectors:b,declarations:R}):c("@page missing '}'")}}function H(){var g=s(),m=f(/^@([-\w]+)?document *([^{]+)/);if(m){var b=V(m[1]),R=V(m[2]);if(!u())return c("@document missing '{'");var P=y().concat(h());return d()?g({type:"document",document:R,vendor:b,rules:P}):c("@document missing '}'")}}function ne(){var g=s(),m=f(/^@font-face\s*/);if(m){if(!u())return c("@font-face missing '{'");for(var b=y(),R;R=v();)b.push(R),b=b.concat(y());return d()?g({type:"font-face",declarations:b}):c("@font-face missing '}'")}}var ue=q("import"),Se=q("charset"),Ce=q("namespace");function q(g){var m=new RegExp("^@"+g+"\\s*([^;]+);");return function(){var b=s(),R=f(m);if(R){var P={type:g};return P[g]=R[1].trim(),b(P)}}}function O(){if(e[0]==="@")return I()||j()||L()||k()||ue()||Se()||Ce()||H()||te()||U()||ne()}function re(){var g=s(),m=p();return m?(y(),g({type:"rule",selectors:m,declarations:w()})):c("selector missing")}return me(o())}function V(e){return e?e.replace(/^\s+|\s+$/g,""):""}function me(e,t){for(var n=e&&typeof e.type=="string",r=n?e:t,i=0,s=Object.keys(e);i<s.length;i++){var a=s[i],l=e[a];Array.isArray(l)?l.forEach(function(c){me(c,r)}):l&&typeof l=="object"&&me(l,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Ae={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 Et(e){var t=Ae[e.tagName]?Ae[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function wt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Ie=/([^\\]):hover/,bt=new RegExp(Ie.source,"g");function Oe(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 i=Nt(e,{silent:!0});if(!i.stylesheet)return e;var s=[];if(i.stylesheet.rules.forEach(function(c){"selectors"in c&&(c.selectors||[]).forEach(function(o){Ie.test(o)&&s.push(o)})}),s.length===0)return e;var a=new RegExp(s.filter(function(c,o){return s.indexOf(c)===o}).sort(function(c,o){return o.length-c.length}).map(function(c){return wt(c)}).join("|"),"g"),l=e.replace(a,function(c){var o=c.replace(bt,"$1.\\:hover");return"".concat(c,", ").concat(o)});return t?.stylesWithHoverClass.set(e,l),l}function ke(){var e=new Map;return{stylesWithHoverClass:e}}function Dt(e,t){var n=t.doc,r=t.hackCss,i=t.cache;switch(e.type){case A.Document:return n.implementation.createDocument(null,"",null);case A.DocumentType:return n.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case A.Element:var s=Et(e),a;e.isSVG?a=n.createElementNS("http://www.w3.org/2000/svg",s):a=n.createElement(s);var l=function(d){if(!e.attributes.hasOwnProperty(d))return"continue";var h=e.attributes[d];if(s==="option"&&d==="selected"&&h===!1)return"continue";if(h=typeof h=="boolean"||typeof h=="number"?"":h,d.startsWith("rr_")){if(s==="canvas"&&d==="rr_dataURL"){var f=document.createElement("img");f.src=h,f.onload=function(){var L=a.getContext("2d");L&&L.drawImage(f,0,0,f.width,f.height)}}else if(s==="img"&&d==="rr_dataURL"){var T=a;T.currentSrc.startsWith("data:")||(T.setAttribute("rrweb-original-src",e.attributes.src),T.src=h,T.setAttribute("rrweb-inline-src",h))}if(d==="rr_width")a.style.width=h;else if(d==="rr_height")a.style.height=h;else if(d==="rr_mediaCurrentTime")a.currentTime=e.attributes.rr_mediaCurrentTime;else if(d==="rr_mediaState")switch(h){case"played":a.play().catch(function(L){return console.warn("media playback error",L)});break;case"paused":a.pause();break}}else{var y=s==="textarea"&&d==="value",N=s==="style"&&d==="_cssText";if(N&&r&&(h=Oe(h,i),typeof h=="string")){for(var p=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,v=void 0,w=[],M="https://replay-cors-proxy.highlightrun.workers.dev";(v=p.exec(h))!==null;)v.index===p.lastIndex&&p.lastIndex++,v.forEach(function(L,te){if(te===0){var H=L.slice(5,L.length-2);w.push({originalUrl:H,proxyUrl:H.replace(H,"".concat(M,"?url=").concat(H))})}});w.forEach(function(L){h=h.replace(L.originalUrl,L.proxyUrl)})}if(y||N){for(var I=n.createTextNode(h),k=0,U=Array.from(a.childNodes);k<U.length;k++){var j=U[k];j.nodeType===a.TEXT_NODE&&a.removeChild(j)}return a.appendChild(I),"continue"}try{if(e.isSVG&&d==="xlink:href")a.setAttributeNS("http://www.w3.org/1999/xlink",d,h);else if(d==="onload"||d==="onclick"||d.substring(0,7)==="onmouse")a.setAttribute("_"+d,h);else{if(s==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&d==="content")return a.setAttribute("csp-content",h),"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(d,h))}}catch{}}};for(var c in e.attributes)l(c);if(s==="img"){var o=a;if(!o.currentSrc.startsWith("data:")){var u=o.getAttribute("rrweb-inline-src");u!=null&&u.startsWith("data:")&&(o.src=u)}}if(e.isShadowHost)if(!a.shadowRoot)a.attachShadow({mode:"open"});else for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);return a;case A.Text:return n.createTextNode(e.isStyle&&r?Oe(e.textContent,i):e.textContent);case A.CDATA:return n.createCDATASection(e.textContent);case A.Comment:return n.createComment(e.textContent);default:return null}}function ie(e,t){var n=t.doc,r=t.mirror,i=t.skipChild,s=i===void 0?!1:i,a=t.hackCss,l=a===void 0?!0:a,c=t.afterAppend,o=t.cache,u=Dt(e,{doc:n,hackCss:l,cache:o});if(!u)return null;if(e.rootId&&console.assert(r.getNode(e.rootId)===n,"Target document should have the same root id."),e.type===A.Document&&(n.close(),n.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==A.DocumentType&&(e.childNodes[0].type===A.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===A.Document||e.type===A.Element)&&!s)for(var d=0,h=e.childNodes;d<h.length;d++){var f=h[d],T=ie(f,{doc:n,mirror:r,skipChild:!1,hackCss:l,afterAppend:c,cache:o});if(!T){console.warn("Failed to rebuild",f);continue}f.isShadow&&vt(u)&&u.shadowRoot?u.shadowRoot.appendChild(T):u.appendChild(T),c&&c(T)}return u}function Mt(e,t){function n(a){t(a)}for(var r=0,i=e.getIds();r<i.length;r++){var s=i[r];e.has(s)&&n(e.getNode(s))}}function St(e,t){var n=t.getMeta(e);if(n?.type===A.Element){var r=e;for(var i in n.attributes)if(n.attributes.hasOwnProperty(i)&&i.startsWith("rr_")){var s=n.attributes[i];i==="rr_scrollLeft"&&(r.scrollLeft=s),i==="rr_scrollTop"&&(r.scrollTop=s)}}}function Ct(e,t){var n=t.doc,r=t.onVisit,i=t.hackCss,s=i===void 0?!0:i,a=t.afterAppend,l=t.cache,c=t.mirror,o=c===void 0?new xe:c,u=ie(e,{doc:n,mirror:o,skipChild:!1,hackCss:s,afterAppend:a,cache:l});return Mt(o,function(d){r&&r(d),St(d,o)}),u}var E;(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"})(E||(E={}));var xt=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(i){return n.removeNodeFromMap(i)})},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 Rt(){return new xt}function At(e){const t={},n=/;(?![^(]*\))/g,r=/:(.+)/,i=/\/\*.*?\*\//g;return e.replace(i,"").split(n).forEach(function(s){if(s){const a=s.split(r);a.length>1&&(t[pe(a[0].trim())]=a[1].trim())}}),t}function _e(e){const t=[];for(const n in e){const r=e[n];if(typeof r!="string")continue;const i=_t(n);t.push(`${i}: ${r};`)}return t.join(" ")}const It=/-([a-z])/g,Ot=/^--[a-zA-Z0-9-]+$/,pe=e=>Ot.test(e)?e:e.replace(It,(t,n)=>n?n.toUpperCase():""),kt=/\B([A-Z])/g,_t=e=>e.replace(kt,"-$1").toLowerCase();class F{constructor(...t){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=C.ELEMENT_NODE,this.TEXT_NODE=C.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 Lt(e){return class yt extends e{constructor(){super(...arguments),this.nodeType=C.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=E.Document,this.textContent=null}get documentElement(){return this.childNodes.find(n=>n.RRNodeType===E.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===E.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===E.Element&&r.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(n){const r=n.RRNodeType;if((r===E.Element||r===E.DocumentType)&&this.childNodes.some(i=>i.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${r===E.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);return n.parentElement=null,n.parentNode=this,this.childNodes.push(n),n}insertBefore(n,r){const i=n.RRNodeType;if((i===E.Element||i===E.DocumentType)&&this.childNodes.some(a=>a.RRNodeType===i))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${i===E.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 i=this.createDocumentType("html",r,"");this.open(),this.appendChild(i)}}createDocument(n,r,i){return new yt}createDocumentType(n,r,i){const s=new(Le(F))(n,r,i);return s.ownerDocument=this,s}createElement(n){const r=new(Pe(F))(n);return r.ownerDocument=this,r}createElementNS(n,r){return this.createElement(r)}createTextNode(n){const r=new(Fe(F))(n);return r.ownerDocument=this,r}createComment(n){const r=new($e(F))(n);return r.ownerDocument=this,r}createCDATASection(n){const r=new(Ue(F))(n);return r.ownerDocument=this,r}toString(){return"RRDocument"}}}function Le(e){return class extends e{constructor(t,n,r){super(),this.nodeType=C.DOCUMENT_TYPE_NODE,this.RRNodeType=E.DocumentType,this.textContent=null,this.name=t,this.publicId=n,this.systemId=r,this.nodeName=t}toString(){return"RRDocumentType"}}}function Pe(e){return class extends e{constructor(t){super(),this.nodeType=C.ELEMENT_NODE,this.RRNodeType=E.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 Ft(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?At(this.attributes.style):{},n=/\B([A-Z])/g;return t.setProperty=(r,i,s)=>{if(n.test(r))return;const a=pe(r);i?t[a]=i:delete t[a],s==="important"&&(t[a]+=" !important"),this.attributes.style=_e(t)},t.removeProperty=r=>{if(n.test(r))return"";const i=pe(r),s=t[i]||"";return delete t[i],this.attributes.style=_e(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 Pt(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 Fe(e){return class extends e{constructor(t){super(),this.nodeType=C.TEXT_NODE,this.nodeName="#text",this.RRNodeType=E.Text,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function $e(e){return class extends e{constructor(t){super(),this.nodeType=C.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=E.Comment,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function Ue(e){return class extends e{constructor(t){super(),this.nodeName="#cdata-section",this.nodeType=C.CDATA_SECTION_NODE,this.RRNodeType=E.CDATA,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class Ft{constructor(t,n){if(this.classes=[],this.add=(...r)=>{for(const i of r){const s=String(i);this.classes.indexOf(s)>=0||this.classes.push(s)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...r)=>{this.classes=this.classes.filter(i=>r.indexOf(i)===-1),this.onChange&&this.onChange(this.classes.join(" "))},t){const r=t.trim().split(/\s+/);this.classes.push(...r)}this.onChange=n}}var C;(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"})(C||(C={}));const fe={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"};function B(e,t,n,r){const i=e.childNodes,s=t.childNodes;r=r||t.mirror||t.ownerDocument.mirror,(i.length>0||s.length>0)&&Be(Array.from(i),s,e,n,r);let a=null,l=null;switch(t.RRNodeType){case E.Document:{l=t.scrollData;break}case E.Element:{const c=e,o=t;switch($t(c,o,r),l=o.scrollData,a=o.inputData,o.tagName){case"AUDIO":case"VIDEO":{const u=e,d=o;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":Ut(c,t.rules);break}if(o.shadowRoot){c.shadowRoot||c.attachShadow({mode:"open"});const u=c.shadowRoot.childNodes,d=o.shadowRoot.childNodes;(u.length>0||d.length>0)&&Be(Array.from(u),d,c.shadowRoot,n,r)}break}case E.Text:case E.Comment:case E.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,o=t;if(c){const u=r.getMeta(o.contentDocument);u&&n.mirror.add(c,Object.assign({},u)),B(c,o.contentDocument,n,r)}}}function $t(e,t,n){const r=e.attributes,i=t.attributes;for(const s in i){const a=i[s],l=n.getMeta(t);if(l&&"isSVG"in l&&l.isSVG&&fe[s])e.setAttributeNS(fe[s],s,a);else if(t.tagName==="CANVAS"&&s==="rr_dataURL"){const c=document.createElement("img");c.src=a,c.onload=()=>{const o=e.getContext("2d");o&&o.drawImage(c,0,0,c.width,c.height)}}else e.setAttribute(s,a)}for(const{name:s}of Array.from(r))s in i||e.removeAttribute(s);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function Be(e,t,n,r,i){var s;let a=0,l=e.length-1,c=0,o=t.length-1,u=e[a],d=e[l],h=t[c],f=t[o],T,y;for(;a<=l&&c<=o;){const N=r.mirror.getId(u),p=r.mirror.getId(d),v=i.getId(h),w=i.getId(f);if(console.log("oldStartId",N),console.log("oldEndId",p),console.log("newStartId",v),console.log("newEndId",w),u===void 0)u=e[++a];else if(d===void 0)d=e[--l];else if(N!==-1&&N===v)B(u,h,r,i),u=e[++a],h=t[++c];else if(p!==-1&&p===w)B(d,f,r,i),d=e[--l],f=t[--o];else if(N!==-1&&N===w)n.insertBefore(u,d.nextSibling),B(u,f,r,i),u=e[++a],f=t[--o];else if(p!==-1&&p===v)n.insertBefore(d,u),B(d,h,r,i),d=e[--l],h=t[++c];else{if(!T){T={};for(let M=a;M<=l;M++){const I=e[M];I&&r.mirror.hasNode(I)&&(T[r.mirror.getId(I)]=M)}}if(y=T[i.getId(h)],y){const M=e[y];n.insertBefore(M,u),B(M,h,r,i),e[y]=void 0}else{const M=ge(h,r.mirror,i);n.nodeName==="#document"&&((s=r.mirror.getMeta(M))===null||s===void 0?void 0:s.type)===E.Element&&n.documentElement&&(n.removeChild(n.documentElement),e[a]=void 0,u=void 0),n.insertBefore(M,u||null),B(M,h,r,i)}h=t[++c]}}if(a>l){const N=t[o+1];let p=null;for(N&&n.childNodes.forEach(v=>{r.mirror.getId(v)===i.getId(N)&&(p=v)});c<=o;++c){const v=ge(t[c],r.mirror,i);n.insertBefore(v,p),B(v,t[c],r,i)}}else if(c>o)for(;a<=l;a++){const N=e[a];N&&(n.removeChild(N),r.mirror.removeNodeFromMap(N))}}function ge(e,t,n){const r=n.getId(e),i=n.getMeta(e);let s=null;if(r>-1&&(s=t.getNode(r)),s!==null)return s;switch(e.RRNodeType){case E.Document:s=new Document;break;case E.DocumentType:s=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case E.Element:{e.tagName.toLowerCase(),i&&"isSVG"in i&&i?.isSVG?s=document.createElementNS(fe.svg,e.tagName.toLowerCase()):s=document.createElement(e.tagName);break}case E.Text:s=document.createTextNode(e.data);break;case E.Comment:s=document.createComment(e.data);break;case E.CDATA:s=document.createCDATASection(e.data);break}return i&&t.add(s,Object.assign({},i)),s}function J(e,t){const n=e[t[0]];return t.length===1?n:J(n.cssRules[t[1]].cssRules,t.slice(2))}var $;(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"})($||($={}));function Ve(e){const t=[...e],n=t.pop();return{positions:t,index:n}}function Ut(e,t){const n=e.sheet;t.forEach(r=>{if(r.type===$.Insert)try{if(Array.isArray(r.index)){const{positions:i,index:s}=Ve(r.index);J(n.cssRules,i).insertRule(r.cssText,s)}else n.insertRule(r.cssText,r.index)}catch{}else if(r.type===$.Remove)try{if(Array.isArray(r.index)){const{positions:i,index:s}=Ve(r.index);J(n.cssRules,i).deleteRule(s||0)}else n.deleteRule(r.index)}catch{}else r.type===$.SetProperty?J(n.cssRules,r.index).style.setProperty(r.property,r.value,r.priority):r.type===$.RemoveProperty&&J(n.cssRules,r.index).style.removeProperty(r.property)})}class Y extends Lt(F){constructor(t){super(),this._unserializedId=-1,this.mirror=qt(),this.scrollData=null,t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,n,r){return new Y}createDocumentType(t,n,r){const i=new Bt(t,n,r);return i.ownerDocument=this,i}createElement(t){const n=t.toUpperCase();let r;switch(n){case"AUDIO":case"VIDEO":r=new Vt(n);break;case"IFRAME":r=new Ht(n,this.mirror);break;case"CANVAS":r=new Wt(n);break;case"STYLE":r=new jt(n);break;default:r=new Z(n);break}return r.ownerDocument=this,r}createComment(t){const n=new Yt(t);return n.ownerDocument=this,n}createCDATASection(t){const n=new zt(t);return n.ownerDocument=this,n}createTextNode(t){const n=new Gt(t);return n.ownerDocument=this,n}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=-1}}const Bt=Le(F);class Z extends Pe(F){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class Vt extends Pt(Z){}class Wt extends Z{constructor(){super(...arguments),this.canvasMutations=[]}getContext(){return null}}class jt extends Z{constructor(){super(...arguments),this.rules=[]}}class Ht extends Z{constructor(t,n){super(t),this.contentDocument=new Y,this.contentDocument.mirror=n}}const Gt=Fe(F),Yt=$e(F),zt=Ue(F);function Xt(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function We(e,t,n,r){let i;switch(e.nodeType){case C.DOCUMENT_NODE:r&&r.nodeName==="IFRAME"?i=r.contentDocument:(i=t,i.compatMode=e.compatMode);break;case C.DOCUMENT_TYPE_NODE:const a=e;i=t.createDocumentType(a.name,a.publicId,a.systemId);break;case C.ELEMENT_NODE:const l=e,c=Xt(l);i=t.createElement(c);const o=i;for(const{name:u,value:d}of Array.from(l.attributes))o.attributes[u]=d;l.scrollLeft&&(o.scrollLeft=l.scrollLeft),l.scrollTop&&(o.scrollTop=l.scrollTop);break;case C.TEXT_NODE:i=t.createTextNode(e.textContent||"");break;case C.CDATA_SECTION_NODE:i=t.createCDATASection(e.data);break;case C.COMMENT_NODE:i=t.createComment(e.textContent||"");break;case C.DOCUMENT_FRAGMENT_NODE:i=r.attachShadow({mode:"open"});break;default:return null}let s=n.getMeta(e);return t instanceof Y&&(s||(s=je(i,t.unserializedId),n.add(e,s)),t.mirror.add(i,Object.assign({},s))),i}function Qt(e,t=Rt(),n=new Y){function r(i,s){const a=We(i,n,t,s);a!==null&&(s?.nodeName!=="IFRAME"&&i.nodeType!==C.DOCUMENT_FRAGMENT_NODE&&(s?.appendChild(a),a.parentNode=s,a.parentElement=s),i.nodeName==="IFRAME"?r(i.contentDocument,a):(i.nodeType===C.DOCUMENT_NODE||i.nodeType===C.ELEMENT_NODE||i.nodeType===C.DOCUMENT_FRAGMENT_NODE)&&(i.nodeType===C.ELEMENT_NODE&&i.shadowRoot&&r(i.shadowRoot,a),i.childNodes.forEach(l=>r(l,a))))}return r(e,null),n}function qt(){return new Jt}class Jt{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 je(e,t){switch(e.RRNodeType){case E.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case E.DocumentType:const n=e;return{id:t,type:e.RRNodeType,name:n.name,publicId:n.publicId,systemId:n.systemId};case E.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case E.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case E.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case E.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}function He(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(i){i(r)}),(e["*"]||[]).slice().map(function(i){i(n,r)})}}}var Zt=Object.freeze({__proto__:null,default:He});function Kt(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;const n=e.HTMLElement||e.Element,r=468,i={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 v=["MSIE ","Trident/","Edge/"];return new RegExp(v.join("|")).test(p)}const l=a(e.navigator.userAgent)?1:0;function c(p,v){this.scrollLeft=p,this.scrollTop=v}function o(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,v){if(v==="Y")return p.clientHeight+l<p.scrollHeight;if(v==="X")return p.clientWidth+l<p.scrollWidth}function h(p,v){const w=e.getComputedStyle(p,null)["overflow"+v];return w==="auto"||w==="scroll"}function f(p){const v=d(p,"Y")&&h(p,"Y"),w=d(p,"X")&&h(p,"X");return v||w}function T(p){for(;p!==t.body&&f(p)===!1;)p=p.parentNode||p.host;return p}function y(p){const v=s();let w,M,I,k=(v-p.startTime)/r;k=k>1?1:k,w=o(k),M=p.startX+(p.x-p.startX)*w,I=p.startY+(p.y-p.startY)*w,p.method.call(p.scrollable,M,I),(M!==p.x||I!==p.y)&&e.requestAnimationFrame(y.bind(e,p))}function N(p,v,w){let M,I,k,U;const j=s();p===t.body?(M=e,I=e.scrollX||e.pageXOffset,k=e.scrollY||e.pageYOffset,U=i.scroll):(M=p,I=p.scrollLeft,k=p.scrollTop,U=c),y({scrollable:M,method:U,startTime:j,startX:I,startY:k,x:v,y:w})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){i.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset);return}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])){i.scrollBy.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}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");i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const p=arguments[0].left,v=arguments[0].top;N.call(this,this,typeof p>"u"?this.scrollLeft:~~p,typeof v>"u"?this.scrollTop:~~v)},n.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},n.prototype.scrollIntoView=function(){if(u(arguments[0])===!0){i.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const p=T(this),v=p.getBoundingClientRect(),w=this.getBoundingClientRect();p!==t.body?(N.call(this,p,p.scrollLeft+w.left-v.left,p.scrollTop+w.top-v.top),e.getComputedStyle(p).position!=="fixed"&&e.scrollBy({left:v.left,top:v.top,behavior:"smooth"})):e.scrollBy({left:w.left,top:w.top,behavior:"smooth"})}}var S=(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))(S||{}),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||{}),_=(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))(_||{}),oe=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(oe||{}),ye=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(ye||{}),D=(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))(D||{});class en{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 i(){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(i))}this.raf=requestAnimationFrame(i)}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 i=Math.floor((n+r)/2);if(this.actions[i].delay<t.delay)n=i+1;else if(this.actions[i].delay>t.delay)r=i-1;else return i+1}return n}}function ve(e,t){if(e.type===S.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}/*! *****************************************************************************
|
|
2
|
+
`);r=b===-1?r+g.length:g.length-b}function s(){var g={line:n,column:r};return function(m){return m.position=new a(g),T(),m}}var a=function(){function g(m){this.start=m,this.end={line:n,column:r},this.source=t.source}return g}();a.prototype.content=e;var l=[];function c(g){var m=new Error(t.source+":"+n+":"+r+": "+g);if(m.reason=g,m.filename=t.source,m.line=n,m.column=r,m.source=e,t.silent)l.push(m);else throw m}function o(){var g=h();return{type:"stylesheet",stylesheet:{source:t.source,rules:g,parsingErrors:l}}}function u(){return f(/^{\s*/)}function d(){return f(/^}/)}function h(){var g,m=[];for(T(),y(m);e.length&&e.charAt(0)!=="}"&&(g=O()||re());)g!==!1&&(m.push(g),y(m));return m}function f(g){var m=g.exec(e);if(m){var b=m[0];return i(b),e=e.slice(b.length),m}}function T(){f(/^\s*/)}function y(g){g===void 0&&(g=[]);for(var m;m=N();)m!==!1&&g.push(m),m=N();return g}function N(){var g=s();if(!(e.charAt(0)!=="/"||e.charAt(1)!=="*")){for(var m=2;e.charAt(m)!==""&&(e.charAt(m)!=="*"||e.charAt(m+1)!=="/");)++m;if(m+=2,e.charAt(m-1)==="")return c("End of comment missing");var b=e.slice(2,m-2);return r+=2,i(b),e=e.slice(m),r+=2,g({type:"comment",comment:b})}}function p(){var g=f(/^([^{]+)/);if(g)return V(g[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(m){return m.replace(/,/g,"\u200C")}).split(/\s*(?![^(]*\)),\s*/).map(function(m){return m.replace(/\u200C/g,",")})}function v(){var g=s(),m=f(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(m){var b=V(m[0]);if(!f(/^:\s*/))return c("property missing ':'");var R=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),P=g({type:"declaration",property:b.replace(Re,""),value:R?V(R[0]).replace(Re,""):""});return f(/^[;\s]*/),P}}function w(){var g=[];if(!u())return c("missing '{'");y(g);for(var m;m=v();)m!==!1&&(g.push(m),y(g)),m=v();return d()?g:c("missing '}'")}function M(){for(var g,m=[],b=s();g=f(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)m.push(g[1]),f(/^,\s*/);if(m.length)return b({type:"keyframe",values:m,declarations:w()})}function I(){var g=s(),m=f(/^@([-\w]+)?keyframes\s*/);if(m){var b=m[1];if(m=f(/^([-\w]+)\s*/),!m)return c("@keyframes missing name");var R=m[1];if(!u())return c("@keyframes missing '{'");for(var P,de=y();P=M();)de.push(P),de=de.concat(y());return d()?g({type:"keyframes",name:R,vendor:b,keyframes:de}):c("@keyframes missing '}'")}}function k(){var g=s(),m=f(/^@supports *([^{]+)/);if(m){var b=V(m[1]);if(!u())return c("@supports missing '{'");var R=y().concat(h());return d()?g({type:"supports",supports:b,rules:R}):c("@supports missing '}'")}}function $(){var g=s(),m=f(/^@host\s*/);if(m){if(!u())return c("@host missing '{'");var b=y().concat(h());return d()?g({type:"host",rules:b}):c("@host missing '}'")}}function j(){var g=s(),m=f(/^@media *([^{]+)/);if(m){var b=V(m[1]);if(!u())return c("@media missing '{'");var R=y().concat(h());return d()?g({type:"media",media:b,rules:R}):c("@media missing '}'")}}function L(){var g=s(),m=f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(m)return g({type:"custom-media",name:V(m[1]),media:V(m[2])})}function te(){var g=s(),m=f(/^@page */);if(m){var b=p()||[];if(!u())return c("@page missing '{'");for(var R=y(),P;P=v();)R.push(P),R=R.concat(y());return d()?g({type:"page",selectors:b,declarations:R}):c("@page missing '}'")}}function H(){var g=s(),m=f(/^@([-\w]+)?document *([^{]+)/);if(m){var b=V(m[1]),R=V(m[2]);if(!u())return c("@document missing '{'");var P=y().concat(h());return d()?g({type:"document",document:R,vendor:b,rules:P}):c("@document missing '}'")}}function ne(){var g=s(),m=f(/^@font-face\s*/);if(m){if(!u())return c("@font-face missing '{'");for(var b=y(),R;R=v();)b.push(R),b=b.concat(y());return d()?g({type:"font-face",declarations:b}):c("@font-face missing '}'")}}var ue=q("import"),Ce=q("charset"),Se=q("namespace");function q(g){var m=new RegExp("^@"+g+"\\s*([^;]+);");return function(){var b=s(),R=f(m);if(R){var P={type:g};return P[g]=R[1].trim(),b(P)}}}function O(){if(e[0]==="@")return I()||j()||L()||k()||ue()||Ce()||Se()||H()||te()||$()||ne()}function re(){var g=s(),m=p();return m?(y(),g({type:"rule",selectors:m,declarations:w()})):c("selector missing")}return me(o())}function V(e){return e?e.replace(/^\s+|\s+$/g,""):""}function me(e,t){for(var n=e&&typeof e.type=="string",r=n?e:t,i=0,s=Object.keys(e);i<s.length;i++){var a=s[i],l=e[a];Array.isArray(l)?l.forEach(function(c){me(c,r)}):l&&typeof l=="object"&&me(l,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Ae={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 Et(e){var t=Ae[e.tagName]?Ae[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function wt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Ie=/([^\\]):hover/,bt=new RegExp(Ie.source,"g");function Oe(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 i=Nt(e,{silent:!0});if(!i.stylesheet)return e;var s=[];if(i.stylesheet.rules.forEach(function(c){"selectors"in c&&(c.selectors||[]).forEach(function(o){Ie.test(o)&&s.push(o)})}),s.length===0)return e;var a=new RegExp(s.filter(function(c,o){return s.indexOf(c)===o}).sort(function(c,o){return o.length-c.length}).map(function(c){return wt(c)}).join("|"),"g"),l=e.replace(a,function(c){var o=c.replace(bt,"$1.\\:hover");return"".concat(c,", ").concat(o)});return t?.stylesWithHoverClass.set(e,l),l}function ke(){var e=new Map;return{stylesWithHoverClass:e}}function Dt(e,t){var n=t.doc,r=t.hackCss,i=t.cache;switch(e.type){case A.Document:return n.implementation.createDocument(null,"",null);case A.DocumentType:return n.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case A.Element:var s=Et(e),a;e.isSVG?a=n.createElementNS("http://www.w3.org/2000/svg",s):a=n.createElement(s);var l=function(d){if(!e.attributes.hasOwnProperty(d))return"continue";var h=e.attributes[d];if(s==="option"&&d==="selected"&&h===!1)return"continue";if(h=typeof h=="boolean"||typeof h=="number"?"":h,d.startsWith("rr_")){if(s==="canvas"&&d==="rr_dataURL"){var f=document.createElement("img");f.src=h,f.onload=function(){var L=a.getContext("2d");L&&L.drawImage(f,0,0,f.width,f.height)}}else if(s==="img"&&d==="rr_dataURL"){var T=a;T.currentSrc.startsWith("data:")||(T.setAttribute("rrweb-original-src",e.attributes.src),T.src=h,T.setAttribute("rrweb-inline-src",h))}if(d==="rr_width")a.style.width=h;else if(d==="rr_height")a.style.height=h;else if(d==="rr_mediaCurrentTime")a.currentTime=e.attributes.rr_mediaCurrentTime;else if(d==="rr_mediaState")switch(h){case"played":a.play().catch(function(L){return console.warn("media playback error",L)});break;case"paused":a.pause();break}}else{var y=s==="textarea"&&d==="value",N=s==="style"&&d==="_cssText";if(N&&r&&(h=Oe(h,i),typeof h=="string")){for(var p=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,v=void 0,w=[],M="https://replay-cors-proxy.highlightrun.workers.dev";(v=p.exec(h))!==null;)v.index===p.lastIndex&&p.lastIndex++,v.forEach(function(L,te){if(te===0){var H=L.slice(5,L.length-2);w.push({originalUrl:H,proxyUrl:H.replace(H,"".concat(M,"?url=").concat(H))})}});w.forEach(function(L){h=h.replace(L.originalUrl,L.proxyUrl)})}if(y||N){for(var I=n.createTextNode(h),k=0,$=Array.from(a.childNodes);k<$.length;k++){var j=$[k];j.nodeType===a.TEXT_NODE&&a.removeChild(j)}return a.appendChild(I),"continue"}try{if(e.isSVG&&d==="xlink:href")a.setAttributeNS("http://www.w3.org/1999/xlink",d,h);else if(d==="onload"||d==="onclick"||d.substring(0,7)==="onmouse")a.setAttribute("_"+d,h);else{if(s==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&d==="content")return a.setAttribute("csp-content",h),"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(d,h))}}catch{}}};for(var c in e.attributes)l(c);if(s==="img"){var o=a;if(!o.currentSrc.startsWith("data:")){var u=o.getAttribute("rrweb-inline-src");u!=null&&u.startsWith("data:")&&(o.src=u)}}if(e.isShadowHost)if(!a.shadowRoot)a.attachShadow({mode:"open"});else for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);return a;case A.Text:return n.createTextNode(e.isStyle&&r?Oe(e.textContent,i):e.textContent);case A.CDATA:return n.createCDATASection(e.textContent);case A.Comment:return n.createComment(e.textContent);default:return null}}function ie(e,t){var n=t.doc,r=t.mirror,i=t.skipChild,s=i===void 0?!1:i,a=t.hackCss,l=a===void 0?!0:a,c=t.afterAppend,o=t.cache,u=Dt(e,{doc:n,hackCss:l,cache:o});if(!u)return null;if(e.rootId&&console.assert(r.getNode(e.rootId)===n,"Target document should have the same root id."),e.type===A.Document&&(n.close(),n.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==A.DocumentType&&(e.childNodes[0].type===A.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===A.Document||e.type===A.Element)&&!s)for(var d=0,h=e.childNodes;d<h.length;d++){var f=h[d],T=ie(f,{doc:n,mirror:r,skipChild:!1,hackCss:l,afterAppend:c,cache:o});if(!T){console.warn("Failed to rebuild",f);continue}f.isShadow&&vt(u)&&u.shadowRoot?u.shadowRoot.appendChild(T):u.appendChild(T),c&&c(T)}return u}function Mt(e,t){function n(a){t(a)}for(var r=0,i=e.getIds();r<i.length;r++){var s=i[r];e.has(s)&&n(e.getNode(s))}}function Ct(e,t){var n=t.getMeta(e);if(n?.type===A.Element){var r=e;for(var i in n.attributes)if(n.attributes.hasOwnProperty(i)&&i.startsWith("rr_")){var s=n.attributes[i];i==="rr_scrollLeft"&&(r.scrollLeft=s),i==="rr_scrollTop"&&(r.scrollTop=s)}}}function St(e,t){var n=t.doc,r=t.onVisit,i=t.hackCss,s=i===void 0?!0:i,a=t.afterAppend,l=t.cache,c=t.mirror,o=c===void 0?new xe:c,u=ie(e,{doc:n,mirror:o,skipChild:!1,hackCss:s,afterAppend:a,cache:l});return Mt(o,function(d){r&&r(d),Ct(d,o)}),u}var E;(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"})(E||(E={}));var xt=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(i){return n.removeNodeFromMap(i)})},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 Rt(){return new xt}function At(e){const t={},n=/;(?![^(]*\))/g,r=/:(.+)/,i=/\/\*.*?\*\//g;return e.replace(i,"").split(n).forEach(function(s){if(s){const a=s.split(r);a.length>1&&(t[pe(a[0].trim())]=a[1].trim())}}),t}function _e(e){const t=[];for(const n in e){const r=e[n];if(typeof r!="string")continue;const i=_t(n);t.push(`${i}: ${r};`)}return t.join(" ")}const It=/-([a-z])/g,Ot=/^--[a-zA-Z0-9-]+$/,pe=e=>Ot.test(e)?e:e.replace(It,(t,n)=>n?n.toUpperCase():""),kt=/\B([A-Z])/g,_t=e=>e.replace(kt,"-$1").toLowerCase();class F{constructor(...t){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=S.ELEMENT_NODE,this.TEXT_NODE=S.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 Lt(e){return class yt extends e{constructor(){super(...arguments),this.nodeType=S.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=E.Document,this.textContent=null}get documentElement(){return this.childNodes.find(n=>n.RRNodeType===E.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===E.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===E.Element&&r.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(n){const r=n.RRNodeType;if((r===E.Element||r===E.DocumentType)&&this.childNodes.some(i=>i.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${r===E.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);return n.parentElement=null,n.parentNode=this,this.childNodes.push(n),n}insertBefore(n,r){const i=n.RRNodeType;if((i===E.Element||i===E.DocumentType)&&this.childNodes.some(a=>a.RRNodeType===i))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${i===E.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 i=this.createDocumentType("html",r,"");this.open(),this.appendChild(i)}}createDocument(n,r,i){return new yt}createDocumentType(n,r,i){const s=new(Le(F))(n,r,i);return s.ownerDocument=this,s}createElement(n){const r=new(Pe(F))(n);return r.ownerDocument=this,r}createElementNS(n,r){return this.createElement(r)}createTextNode(n){const r=new(Fe(F))(n);return r.ownerDocument=this,r}createComment(n){const r=new(Ue(F))(n);return r.ownerDocument=this,r}createCDATASection(n){const r=new($e(F))(n);return r.ownerDocument=this,r}toString(){return"RRDocument"}}}function Le(e){return class extends e{constructor(t,n,r){super(),this.nodeType=S.DOCUMENT_TYPE_NODE,this.RRNodeType=E.DocumentType,this.textContent=null,this.name=t,this.publicId=n,this.systemId=r,this.nodeName=t}toString(){return"RRDocumentType"}}}function Pe(e){return class extends e{constructor(t){super(),this.nodeType=S.ELEMENT_NODE,this.RRNodeType=E.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 Ft(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?At(this.attributes.style):{},n=/\B([A-Z])/g;return t.setProperty=(r,i,s)=>{if(n.test(r))return;const a=pe(r);i?t[a]=i:delete t[a],s==="important"&&(t[a]+=" !important"),this.attributes.style=_e(t)},t.removeProperty=r=>{if(n.test(r))return"";const i=pe(r),s=t[i]||"";return delete t[i],this.attributes.style=_e(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 Pt(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 Fe(e){return class extends e{constructor(t){super(),this.nodeType=S.TEXT_NODE,this.nodeName="#text",this.RRNodeType=E.Text,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function Ue(e){return class extends e{constructor(t){super(),this.nodeType=S.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=E.Comment,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function $e(e){return class extends e{constructor(t){super(),this.nodeName="#cdata-section",this.nodeType=S.CDATA_SECTION_NODE,this.RRNodeType=E.CDATA,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class Ft{constructor(t,n){if(this.classes=[],this.add=(...r)=>{for(const i of r){const s=String(i);this.classes.indexOf(s)>=0||this.classes.push(s)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...r)=>{this.classes=this.classes.filter(i=>r.indexOf(i)===-1),this.onChange&&this.onChange(this.classes.join(" "))},t){const r=t.trim().split(/\s+/);this.classes.push(...r)}this.onChange=n}}var S;(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"})(S||(S={}));const fe={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"};function B(e,t,n,r){const i=e.childNodes,s=t.childNodes;r=r||t.mirror||t.ownerDocument.mirror,(i.length>0||s.length>0)&&Be(Array.from(i),s,e,n,r);let a=null,l=null;switch(t.RRNodeType){case E.Document:{l=t.scrollData;break}case E.Element:{const c=e,o=t;switch(Ut(c,o,r),l=o.scrollData,a=o.inputData,o.tagName){case"AUDIO":case"VIDEO":{const u=e,d=o;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":$t(c,t.rules);break}if(o.shadowRoot){c.shadowRoot||c.attachShadow({mode:"open"});const u=c.shadowRoot.childNodes,d=o.shadowRoot.childNodes;(u.length>0||d.length>0)&&Be(Array.from(u),d,c.shadowRoot,n,r)}break}case E.Text:case E.Comment:case E.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,o=t;if(c){const u=r.getMeta(o.contentDocument);u&&n.mirror.add(c,Object.assign({},u)),B(c,o.contentDocument,n,r)}}}function Ut(e,t,n){const r=e.attributes,i=t.attributes;for(const s in i){const a=i[s],l=n.getMeta(t);if(l&&"isSVG"in l&&l.isSVG&&fe[s])e.setAttributeNS(fe[s],s,a);else if(t.tagName==="CANVAS"&&s==="rr_dataURL"){const c=document.createElement("img");c.src=a,c.onload=()=>{const o=e.getContext("2d");o&&o.drawImage(c,0,0,c.width,c.height)}}else e.setAttribute(s,a)}for(const{name:s}of Array.from(r))s in i||e.removeAttribute(s);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function Be(e,t,n,r,i){var s;let a=0,l=e.length-1,c=0,o=t.length-1,u=e[a],d=e[l],h=t[c],f=t[o],T,y;for(;a<=l&&c<=o;){const N=r.mirror.getId(u),p=r.mirror.getId(d),v=i.getId(h),w=i.getId(f);if(u===void 0)u=e[++a];else if(d===void 0)d=e[--l];else if(N!==-1&&N===v)B(u,h,r,i),u=e[++a],h=t[++c];else if(p!==-1&&p===w)B(d,f,r,i),d=e[--l],f=t[--o];else if(N!==-1&&N===w)n.insertBefore(u,d.nextSibling),B(u,f,r,i),u=e[++a],f=t[--o];else if(p!==-1&&p===v)n.insertBefore(d,u),B(d,h,r,i),d=e[--l],h=t[++c];else{if(!T){T={};for(let M=a;M<=l;M++){const I=e[M];I&&r.mirror.hasNode(I)&&(T[r.mirror.getId(I)]=M)}}if(y=T[i.getId(h)],y){const M=e[y];n.insertBefore(M,u),B(M,h,r,i),e[y]=void 0}else{const M=ge(h,r.mirror,i);n.nodeName==="#document"&&((s=r.mirror.getMeta(M))===null||s===void 0?void 0:s.type)===E.Element&&n.documentElement&&(n.removeChild(n.documentElement),e[a]=void 0,u=void 0),n.insertBefore(M,u||null),B(M,h,r,i)}h=t[++c]}}if(a>l){const N=t[o+1];let p=null;for(N&&n.childNodes.forEach(v=>{r.mirror.getId(v)===i.getId(N)&&(p=v)});c<=o;++c){const v=ge(t[c],r.mirror,i);n.insertBefore(v,p),B(v,t[c],r,i)}}else if(c>o)for(;a<=l;a++){const N=e[a];N&&(n.removeChild(N),r.mirror.removeNodeFromMap(N))}}function ge(e,t,n){const r=n.getId(e),i=n.getMeta(e);let s=null;if(r>-1&&(s=t.getNode(r)),s!==null)return s;switch(e.RRNodeType){case E.Document:s=new Document;break;case E.DocumentType:s=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case E.Element:{e.tagName.toLowerCase(),i&&"isSVG"in i&&i?.isSVG?s=document.createElementNS(fe.svg,e.tagName.toLowerCase()):s=document.createElement(e.tagName);break}case E.Text:s=document.createTextNode(e.data);break;case E.Comment:s=document.createComment(e.data);break;case E.CDATA:s=document.createCDATASection(e.data);break}return i&&t.add(s,Object.assign({},i)),s}function J(e,t){const n=e[t[0]];return t.length===1?n:J(n.cssRules[t[1]].cssRules,t.slice(2))}var U;(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"})(U||(U={}));function Ve(e){const t=[...e],n=t.pop();return{positions:t,index:n}}function $t(e,t){const n=e.sheet;t.forEach(r=>{if(r.type===U.Insert)try{if(Array.isArray(r.index)){const{positions:i,index:s}=Ve(r.index);J(n.cssRules,i).insertRule(r.cssText,s)}else n.insertRule(r.cssText,r.index)}catch{}else if(r.type===U.Remove)try{if(Array.isArray(r.index)){const{positions:i,index:s}=Ve(r.index);J(n.cssRules,i).deleteRule(s||0)}else n.deleteRule(r.index)}catch{}else r.type===U.SetProperty?J(n.cssRules,r.index).style.setProperty(r.property,r.value,r.priority):r.type===U.RemoveProperty&&J(n.cssRules,r.index).style.removeProperty(r.property)})}class Y extends Lt(F){constructor(t){super(),this._unserializedId=-1,this.mirror=qt(),this.scrollData=null,t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,n,r){return new Y}createDocumentType(t,n,r){const i=new Bt(t,n,r);return i.ownerDocument=this,i}createElement(t){const n=t.toUpperCase();let r;switch(n){case"AUDIO":case"VIDEO":r=new Vt(n);break;case"IFRAME":r=new Ht(n,this.mirror);break;case"CANVAS":r=new Wt(n);break;case"STYLE":r=new jt(n);break;default:r=new Z(n);break}return r.ownerDocument=this,r}createComment(t){const n=new Yt(t);return n.ownerDocument=this,n}createCDATASection(t){const n=new zt(t);return n.ownerDocument=this,n}createTextNode(t){const n=new Gt(t);return n.ownerDocument=this,n}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=-1}}const Bt=Le(F);class Z extends Pe(F){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class Vt extends Pt(Z){}class Wt extends Z{constructor(){super(...arguments),this.canvasMutations=[]}getContext(){return null}}class jt extends Z{constructor(){super(...arguments),this.rules=[]}}class Ht extends Z{constructor(t,n){super(t),this.contentDocument=new Y,this.contentDocument.mirror=n}}const Gt=Fe(F),Yt=Ue(F),zt=$e(F);function Xt(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function We(e,t,n,r){let i;switch(e.nodeType){case S.DOCUMENT_NODE:r&&r.nodeName==="IFRAME"?i=r.contentDocument:(i=t,i.compatMode=e.compatMode);break;case S.DOCUMENT_TYPE_NODE:const a=e;i=t.createDocumentType(a.name,a.publicId,a.systemId);break;case S.ELEMENT_NODE:const l=e,c=Xt(l);i=t.createElement(c);const o=i;for(const{name:u,value:d}of Array.from(l.attributes))o.attributes[u]=d;l.scrollLeft&&(o.scrollLeft=l.scrollLeft),l.scrollTop&&(o.scrollTop=l.scrollTop);break;case S.TEXT_NODE:i=t.createTextNode(e.textContent||"");break;case S.CDATA_SECTION_NODE:i=t.createCDATASection(e.data);break;case S.COMMENT_NODE:i=t.createComment(e.textContent||"");break;case S.DOCUMENT_FRAGMENT_NODE:i=r.attachShadow({mode:"open"});break;default:return null}let s=n.getMeta(e);return t instanceof Y&&(s||(s=je(i,t.unserializedId),n.add(e,s)),t.mirror.add(i,Object.assign({},s))),i}function Qt(e,t=Rt(),n=new Y){function r(i,s){const a=We(i,n,t,s);a!==null&&(s?.nodeName!=="IFRAME"&&i.nodeType!==S.DOCUMENT_FRAGMENT_NODE&&(s?.appendChild(a),a.parentNode=s,a.parentElement=s),i.nodeName==="IFRAME"?r(i.contentDocument,a):(i.nodeType===S.DOCUMENT_NODE||i.nodeType===S.ELEMENT_NODE||i.nodeType===S.DOCUMENT_FRAGMENT_NODE)&&(i.nodeType===S.ELEMENT_NODE&&i.shadowRoot&&r(i.shadowRoot,a),i.childNodes.forEach(l=>r(l,a))))}return r(e,null),n}function qt(){return new Jt}class Jt{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 je(e,t){switch(e.RRNodeType){case E.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case E.DocumentType:const n=e;return{id:t,type:e.RRNodeType,name:n.name,publicId:n.publicId,systemId:n.systemId};case E.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case E.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case E.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case E.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}function He(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(i){i(r)}),(e["*"]||[]).slice().map(function(i){i(n,r)})}}}var Zt=Object.freeze({__proto__:null,default:He});function Kt(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;const n=e.HTMLElement||e.Element,r=468,i={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 v=["MSIE ","Trident/","Edge/"];return new RegExp(v.join("|")).test(p)}const l=a(e.navigator.userAgent)?1:0;function c(p,v){this.scrollLeft=p,this.scrollTop=v}function o(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,v){if(v==="Y")return p.clientHeight+l<p.scrollHeight;if(v==="X")return p.clientWidth+l<p.scrollWidth}function h(p,v){const w=e.getComputedStyle(p,null)["overflow"+v];return w==="auto"||w==="scroll"}function f(p){const v=d(p,"Y")&&h(p,"Y"),w=d(p,"X")&&h(p,"X");return v||w}function T(p){for(;p!==t.body&&f(p)===!1;)p=p.parentNode||p.host;return p}function y(p){const v=s();let w,M,I,k=(v-p.startTime)/r;k=k>1?1:k,w=o(k),M=p.startX+(p.x-p.startX)*w,I=p.startY+(p.y-p.startY)*w,p.method.call(p.scrollable,M,I),(M!==p.x||I!==p.y)&&e.requestAnimationFrame(y.bind(e,p))}function N(p,v,w){let M,I,k,$;const j=s();p===t.body?(M=e,I=e.scrollX||e.pageXOffset,k=e.scrollY||e.pageYOffset,$=i.scroll):(M=p,I=p.scrollLeft,k=p.scrollTop,$=c),y({scrollable:M,method:$,startTime:j,startX:I,startY:k,x:v,y:w})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){i.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset);return}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])){i.scrollBy.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}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");i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const p=arguments[0].left,v=arguments[0].top;N.call(this,this,typeof p>"u"?this.scrollLeft:~~p,typeof v>"u"?this.scrollTop:~~v)},n.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},n.prototype.scrollIntoView=function(){if(u(arguments[0])===!0){i.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const p=T(this),v=p.getBoundingClientRect(),w=this.getBoundingClientRect();p!==t.body?(N.call(this,p,p.scrollLeft+w.left-v.left,p.scrollTop+w.top-v.top),e.getComputedStyle(p).position!=="fixed"&&e.scrollBy({left:v.left,top:v.top,behavior:"smooth"})):e.scrollBy({left:w.left,top:w.top,behavior:"smooth"})}}var C=(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))(C||{}),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||{}),_=(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))(_||{}),oe=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(oe||{}),ye=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(ye||{}),D=(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))(D||{});class en{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 i(){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(i))}this.raf=requestAnimationFrame(i)}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 i=Math.floor((n+r)/2);if(this.actions[i].delay<t.delay)n=i+1;else if(this.actions[i].delay>t.delay)r=i-1;else return i+1}return n}}function ve(e,t){if(e.type===C.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}/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
|
|
5
5
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -12,7 +12,7 @@ var rrwebReplay=function(he){"use strict";var A;(function(e){e[e.Document=0]="Do
|
|
|
12
12
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */function Ge(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r,i,s=n.call(e),a=[];try{for(;(t===void 0||t-- >0)&&!(r=s.next()).done;)a.push(r.value)}catch(l){i={error:l}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return a}var z;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(z||(z={}));var Ye={type:"xstate.init"};function Te(e){return e===void 0?[]:[].concat(e)}function G(e){return{type:"xstate.assign",assignment:e}}function ze(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 se(e){return function(t){return e===t}}function Xe(e){return typeof e=="string"?{type:e}:e}function Qe(e,t){return{value:e,context:t,actions:[],changed:!1,matches:se(e)}}function qe(e,t,n){var r=t,i=!1;return[e.filter(function(s){if(s.type==="xstate.assign"){i=!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,i]}function Je(e,t){t===void 0&&(t={});var n=Ge(qe(Te(e.states[e.initial].entry).map(function(a){return ze(a,t.actions)}),e.context,Ye),2),r=n[0],i=n[1],s={config:e,_options:t,initialState:{value:e.initial,actions:r,context:i,matches:se(e.initial)},transition:function(a,l){var c,o,u=typeof a=="string"?{value:a,context:e.context}:a,d=u.value,h=u.context,f=Xe(l),T=e.states[d];if(T.on){var y=Te(T.on[f.type]);try{for(var N=function(O){var re=typeof Symbol=="function"&&Symbol.iterator,g=re&&O[re],m=0;if(g)return g.call(O);if(O&&typeof O.length=="number")return{next:function(){return O&&m>=O.length&&(O=void 0),{value:O&&O[m++],done:!O}}};throw new TypeError(re?"Object is not iterable.":"Symbol.iterator is not defined.")}(y),p=N.next();!p.done;p=N.next()){var v=p.value;if(v===void 0)return Qe(d,h);var w=typeof v=="string"?{target:v}:v,M=w.target,I=w.actions,k=I===void 0?[]:I
|
|
15
|
+
***************************************************************************** */function Ge(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r,i,s=n.call(e),a=[];try{for(;(t===void 0||t-- >0)&&!(r=s.next()).done;)a.push(r.value)}catch(l){i={error:l}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return a}var z;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(z||(z={}));var Ye={type:"xstate.init"};function Te(e){return e===void 0?[]:[].concat(e)}function G(e){return{type:"xstate.assign",assignment:e}}function ze(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 se(e){return function(t){return e===t}}function Xe(e){return typeof e=="string"?{type:e}:e}function Qe(e,t){return{value:e,context:t,actions:[],changed:!1,matches:se(e)}}function qe(e,t,n){var r=t,i=!1;return[e.filter(function(s){if(s.type==="xstate.assign"){i=!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,i]}function Je(e,t){t===void 0&&(t={});var n=Ge(qe(Te(e.states[e.initial].entry).map(function(a){return ze(a,t.actions)}),e.context,Ye),2),r=n[0],i=n[1],s={config:e,_options:t,initialState:{value:e.initial,actions:r,context:i,matches:se(e.initial)},transition:function(a,l){var c,o,u=typeof a=="string"?{value:a,context:e.context}:a,d=u.value,h=u.context,f=Xe(l),T=e.states[d];if(T.on){var y=Te(T.on[f.type]);try{for(var N=function(O){var re=typeof Symbol=="function"&&Symbol.iterator,g=re&&O[re],m=0;if(g)return g.call(O);if(O&&typeof O.length=="number")return{next:function(){return O&&m>=O.length&&(O=void 0),{value:O&&O[m++],done:!O}}};throw new TypeError(re?"Object is not iterable.":"Symbol.iterator is not defined.")}(y),p=N.next();!p.done;p=N.next()){var v=p.value;if(v===void 0)return Qe(d,h);var w=typeof v=="string"?{target:v}:v,M=w.target,I=w.actions,k=I===void 0?[]:I,$=w.cond,j=$===void 0?function(){return!0}:$,L=M===void 0,te=M??d,H=e.states[te];if(j(h,f)){var ne=Ge(qe((L?Te(k):[].concat(T.exit,k,H.entry).filter(function(O){return O})).map(function(O){return ze(O,s._options.actions)}),h,f),3),ue=ne[0],Ce=ne[1],Se=ne[2],q=M??d;return{value:q,context:Ce,actions:ue,changed:M!==d||ue.length>0||Se,matches:se(q)}}}}catch(O){c={error:O}}finally{try{p&&!p.done&&(o=N.return)&&o.call(N)}finally{if(c)throw c.error}}}return Qe(d,h)}};return s}var Ze=function(e,t){return e.actions.forEach(function(n){var r=n.exec;return r&&r(e.context,t)})};function Ke(e){var t=e.initialState,n=z.NotStarted,r=new Set,i={_machine:e,send:function(s){n===z.Running&&(t=e.transition(t,s),Ze(t,Xe(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:se(a.value)}}return n=z.Running,Ze(t,Ye),i},stop:function(){return n=z.Stopped,r.clear(),i},get state(){return t},get status(){return n}};return i}var tn=Object.defineProperty,nn=Object.defineProperties,rn=Object.getOwnPropertyDescriptors,et=Object.getOwnPropertySymbols,on=Object.prototype.hasOwnProperty,sn=Object.prototype.propertyIsEnumerable,tt=(e,t,n)=>t in e?tn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ae=(e,t)=>{for(var n in t||(t={}))on.call(t,n)&&tt(e,n,t[n]);if(et)for(var n of et(t))sn.call(t,n)&&tt(e,n,t[n]);return e},ce=(e,t)=>nn(e,rn(t));function an(e,t){for(let n=e.length-1;n>=0;n--){const r=e[n];if(r.type===C.Meta&&r.timestamp<=t)return e.slice(n)}return e}function cn(e,{getCastFn:t,applyEventsSynchronously:n,emitter:r}){const i=Je({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:G({lastPlayedEvent:(s,a)=>a.type==="CAST_EVENT"?a.payload.event:s.lastPlayedEvent}),recordTimeOffset:G((s,a)=>{let l=s.timeOffset;return"payload"in a&&"timeOffset"in a.payload&&(l=a.payload.timeOffset),ce(ae({},s),{timeOffset:l,baselineTime:s.events[0].timestamp+l})}),play(s){var a;const{timer:l,events:c,baselineTime:o,lastPlayedEvent:u}=s;l.clear();for(const y of c)ve(y,o);const d=an(c,o);let h=u?.timestamp;u?.type===C.IncrementalSnapshot&&u.data.source===x.MouseMove&&(h=u.timestamp+((a=u.data.positions[0])==null?void 0:a.timeOffset)),o<(h||0)&&r.emit(D.PlayBack);const f=new Array,T=new Array;for(const y of d)if(!(h&&h<o&&(y.timestamp<=h||y===u)))if(y.timestamp<o)f.push(y);else{const N=t(y,!1);T.push({doAction:()=>{N()},delay:y.delay})}n(f),r.emit(D.Flush),l.addActions(T),l.start()},pause(s){s.timer.clear()},resetLastPlayedEvent:G(s=>ce(ae({},s),{lastPlayedEvent:null})),startLive:G({baselineTime:(s,a)=>(s.timer.toggleLiveMode(!0),s.timer.start(),a.type==="TO_LIVE"&&a.payload.baselineTime?a.payload.baselineTime:Date.now())}),replaceEvents:G((s,a)=>{const{events:l,timer:c,baselineTime:o}=s;if(a.type==="REPLACE_EVENTS"){const{events:u}=a.payload;l.length=0;const d=[];for(const h of u)if(ve(h,o),l.push(h),h.timestamp>=c.timeOffset+o){const f=t(h,!1);d.push({doAction:()=>{f()},delay:h.delay})}c.isActive()&&c.replaceActions(d)}return ce(ae({},s),{events:l})}),addEvent:G((s,a)=>{const{baselineTime:l,timer:c,events:o}=s;if(a.type==="ADD_EVENT"){const{event:u}=a.payload;ve(u,l);let d=o.length-1;if(!o[d]||o[d].timestamp<=u.timestamp)o.push(u);else{let T=-1,y=0;for(;y<=d;){const N=Math.floor((y+d)/2);o[N].timestamp<=u.timestamp?y=N+1:d=N-1}T===-1&&(T=y),o.splice(T,0,u)}const h=u.timestamp<l,f=t(u,h);h?f():c.isActive()&&c.addAction({doAction:()=>{f()},delay:u.delay})}return ce(ae({},s),{events:o})})}});return Ke(i)}function ln(e){const t=Je({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:G({normalSpeed:n=>n.timer.speed}),restoreSpeed:n=>{n.timer.setSpeed(n.normalSpeed)}}});return Ke(t)}const X=`Please stop import mirror directly. Instead of that,\r
|
|
16
16
|
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
17
|
-
or you can use record.mirror to access the mirror instance during recording.`;let nt={map:{},getId(){return console.error(X),-1},getNode(){return console.error(X),null},removeNodeFromMap(){console.error(X)},has(){return console.error(X),!1},reset(){console.error(X)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(nt=new Proxy(nt,{get(e,t,n){return t==="map"&&console.error(X),Reflect.get(e,t,n)}}));function un(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 dn(e){const t={},n=(i,s)=>{const a={value:i,parent:s,children:[]};return t[i.node.id]=a,a},r=[];for(const i of e){const{nextId:s,parentId:a}=i;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(i,l.parent))}else{const c=r.indexOf(l);r.splice(c,0,n(i,null))}continue}if(a in t){const l=t[a];l.children.push(n(i,l));continue}r.push(n(i,null))}return r}function rt(e,t){t(e.value);for(let n=e.children.length-1;n>=0;n--)rt(e.children[n],t)}function Ne(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function it(e,t){var n,r;const i=(r=(n=e.ownerDocument)==null?void 0:n.defaultView)==null?void 0:r.frameElement;if(!i||i===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const s=i.getBoundingClientRect(),a=it(i,t),l=s.height/i.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}}function ot(e){return Boolean(e?.shadowRoot)}function K(e,t){const n=e[t[0]];return t.length===1?n:K(n.cssRules[t[1]].cssRules,t.slice(2))}function st(e){const t=[...e],n=t.pop();return{positions:t,index:n}}function hn(e){const t=new Set,n=[];for(let r=e.length;r--;){const i=e[r];t.has(i.id)||(n.push(i),t.add(i.id))}return n}const mn=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;}`];for(var at="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ee=typeof Uint8Array>"u"?[]:new Uint8Array(256),le=0;le<at.length;le++)ee[at.charCodeAt(le)]=le;var pn=function(e){var t=e.length*.75,n=e.length,r,i=0,s,a,l,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var o=new ArrayBuffer(t),u=new Uint8Array(o);for(r=0;r<n;r+=4)s=ee[e.charCodeAt(r)],a=ee[e.charCodeAt(r+1)],l=ee[e.charCodeAt(r+2)],c=ee[e.charCodeAt(r+3)],u[i++]=s<<2|a>>4,u[i++]=(a&15)<<4|l>>2,u[i++]=(l&3)<<6|c&63;return o},fn=(e,t,n)=>new Promise((r,i)=>{var s=c=>{try{l(n.next(c))}catch(o){i(o)}},a=c=>{try{l(n.throw(c))}catch(o){i(o)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,a);l((n=n.apply(e,t)).next())});const ct=new Map;function lt(e,t){let n=ct.get(e);return n||(n=new Map,ct.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}function W(e,t,n){return r=>fn(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 i=yield W(e,t,n)(r.args);return yield createImageBitmap.apply(null,i)}else if("index"in r){if(n||t===null)return r;const{rr_type:i,index:s}=r;return lt(t,i)[s]}else if("args"in r){const{rr_type:i,args:s}=r,a=window[i];return new a(...yield Promise.all(s.map(W(e,t,n))))}else{if("base64"in r)return pn(r.base64);if("src"in r){const i=e.get(r.src);if(i)return i;{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 i=yield Promise.all(r.data.map(W(e,t,n)));return new Blob(i,{type:r.type})}}else if(Array.isArray(r))return yield Promise.all(r.map(W(e,t,n)));return r})}var gn=(e,t,n)=>new Promise((r,i)=>{var s=c=>{try{l(n.next(c))}catch(o){i(o)}},a=c=>{try{l(n.throw(c))}catch(o){i(o)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,a);l((n=n.apply(e,t)).next())});function yn(e,t){try{return t===oe.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}const vn=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function Tn(e,t){if(!(t!=null&&t.constructor))return;const{name:n}=t.constructor;if(!vn.includes(n))return;const r=lt(e,n);r.includes(t)||r.push(t)}function Nn(e){return gn(this,arguments,function*({mutation:t,target:n,type:r,imageMap:i,errorHandler:s}){try{const a=yn(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(W(i,a))),o=l.apply(a,c);Tn(a,o)}catch(a){s(t,a)}})}var En=(e,t,n)=>new Promise((r,i)=>{var s=c=>{try{l(n.next(c))}catch(o){i(o)}},a=c=>{try{l(n.throw(c))}catch(o){i(o)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,a);l((n=n.apply(e,t)).next())});function wn(e){return En(this,arguments,function*({event:t,mutation:n,target:r,imageMap:i,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=i.get(t);l.apply(a,n.args)}else{const c=yield Promise.all(n.args.map(W(i,a)));l.apply(a,c)}}catch(a){s(n,a)}})}var bn=(e,t,n)=>new Promise((r,i)=>{var s=c=>{try{l(n.next(c))}catch(o){i(o)}},a=c=>{try{l(n.throw(c))}catch(o){i(o)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,a);l((n=n.apply(e,t)).next())});function ut(e){return bn(this,arguments,function*({event:t,mutation:n,target:r,imageMap:i,canvasEventMap:s,errorHandler:a}){try{const l=s.get(t)||n,c="commands"in l?l.commands:[l];if([oe.WebGL,oe.WebGL2].includes(n.type)){for(let o=0;o<c.length;o++){const u=c[o];yield Nn({mutation:u,type:n.type,target:r,imageMap:i,errorHandler:a})}return}for(let o=0;o<c.length;o++){const u=c[o];yield wn({event:t,mutation:u,target:r,imageMap:i,errorHandler:a})}}catch(l){a(n,l)}})}var Dn=Object.defineProperty,Mn=Object.defineProperties,Sn=Object.getOwnPropertyDescriptors,dt=Object.getOwnPropertySymbols,Cn=Object.prototype.hasOwnProperty,xn=Object.prototype.propertyIsEnumerable,ht=(e,t,n)=>t in e?Dn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Q=(e,t)=>{for(var n in t||(t={}))Cn.call(t,n)&&ht(e,n,t[n]);if(dt)for(var n of dt(t))xn.call(t,n)&&ht(e,n,t[n]);return e},Ee=(e,t)=>Mn(e,Sn(t)),we=(e,t,n)=>new Promise((r,i)=>{var s=c=>{try{l(n.next(c))}catch(o){i(o)}},a=c=>{try{l(n.throw(c))}catch(o){i(o)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,a);l((n=n.apply(e,t)).next())});const mt=10*1e3,pt=2*1e3,ft=1*1e3,gt=60*60*1e3,Rn=He||Zt,be="[replayer]",De={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Me(e){return e.type==S.IncrementalSnapshot&&(e.data.source==x.TouchMove||e.data.source==x.MouseInteraction&&e.data.type==_.TouchStart)}class An{constructor(t,n){if(this.usingVirtualDom=!1,this.virtualDom=new Y,this.mouseTail=null,this.tailPositions=[],this.emitter=Rn(),this.activityIntervals=[],this.legacy_missingNodeRetryMap={},this.cache=ke(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=Tt(),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:De,useVirtualDom:!0,inactiveThreshold:.02,inactiveSkipTime:pt};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(D.Resize,this.handleResize),this.setupDom(),this.emitter.on(D.Flush,()=>{if(this.usingVirtualDom){const l={mirror:this.mirror,applyCanvas:(c,o,u)=>{ut({event:c,mutation:o,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this)};if(B(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 o=this.legacy_missingNodeRetryMap[c],u=ge(o.node,this.mirror,this.virtualDom.mirror);B(u,o.node,l,this.virtualDom.mirror),o.node=u}catch(o){this.config.showWarning&&console.warn(o)}}this.mousePos&&this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null}),this.emitter.on(D.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset()});const i=new en([],n?.speed||r.speed);this.service=cn({events:t.map(l=>n&&n.unpackFn?n.unpackFn(l):l).sort((l,c)=>l.timestamp-c.timestamp),timer:i,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(D.StateChange,{player:l})}),this.speedService=ln({normalSpeed:-1,timer:i}),this.speedService.start(),this.speedService.subscribe(l=>{this.emitter.emit(D.StateChange,{speed:l})});const s=this.service.state.context.events.find(l=>l.type===S.Meta),a=this.service.state.context.events.find(l=>l.type===S.FullSnapshot);if(s){const{width:l,height:c}=s.data;setTimeout(()=>{this.emitter.emit(D.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(Me)&&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>mt?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 i=[];let s=t[0];for(let a=1;a<t.length;a++)t[a].active!=t[a-1].active&&(i.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&&i.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=i[0];for(let a=1;a<i.length;a++)(!i[a].active&&i[a].duration>this.config.inactiveThreshold*n.totalTime||!i[a-1].active&&i[a-1].duration>this.config.inactiveThreshold*n.totalTime)&&(this.activityIntervals.push({startTime:s.startTime,endTime:i[a-1].endTime,duration:i[a-1].endTime-s.startTime,active:i[a-1].active}),s=i[a]);s&&i.length>0&&this.activityIntervals.push({startTime:s.startTime,endTime:i[i.length-1].endTime,duration:i[i.length-1].endTime-s.startTime,active:i[i.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(D.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(D.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(D.Resume)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){const n=this.config.unpackFn?this.config.unpackFn(t):t;Me(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(Me(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=ke()}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&&(Kt(this.iframe.contentWindow,this.iframe.contentDocument),un(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 S.DomContentLoaded:case S.Load:case S.Custom:continue;case S.FullSnapshot:case S.Meta:case S.Plugin:case S.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 S.DomContentLoaded:case S.Load:break;case S.Custom:r=()=>{this.emitter.emit(D.CustomEvent,t)};break;case S.Meta:r=()=>this.emitter.emit(D.Resize,{width:t.data.width,height:t.data.height});break;case S.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 S.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 i of this.service.state.context.events)if(!(i.timestamp<=t.timestamp)&&this.isUserInteraction(i)){i.delay-t.delay>mt*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=i);break}if(this.nextUserInteractionEvent){const i=this.nextUserInteractionEvent.delay-t.delay,s={speed:Math.min(Math.round(i/pt),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:s}),this.emitter.emit(D.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 i=this.service.state.context.events.length-1;if(t===this.service.state.context.events[i]){const s=()=>{i<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(D.Finish))};t.type===S.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(D.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,i={speed:r/gt*this.config.inactiveSkipTime<ft?r/ft:Math.round(Math.max(r,gt)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:i}),this.emitter.emit(D.SkipStart,i)}}}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=[];Ct(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:i,head:s}=this.iframe.contentDocument;this.insertStyleRules(i,s),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(D.FullsnapshotRebuilded,t),n||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,n){const r=mn(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 i=this.virtualDom.createElement("style");this.virtualDom.mirror.add(i,je(i,this.virtualDom.unserializedId)),t.insertBefore(i,n);for(let s=0;s<r.length;s++)i.rules.push({cssText:r[s],type:$.Insert,index:s})}else{const i=document.createElement("style");t.insertBefore(i,n);for(let s=0;s<r.length;s++)i.sheet.insertRule(r[s],s)}}attachDocumentToIframe(t,n){const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[];ie(t.node,{doc:n.contentDocument,mirror:r,hackCss:!0,skipChild:!1,afterAppend:s=>{this.collectIframeAndAttachDocument(i,s);const a=r.getMeta(s);if(a?.type===A.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 i)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(i=>i.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 i,s=this.service.state;const a=()=>{s=this.service.state};this.emitter.on(D.Start,a),this.emitter.on(D.Pause,a);const l=()=>{this.emitter.off(D.Start,a),this.emitter.off(D.Pause,a)};n.querySelectorAll('link[rel="stylesheet"]').forEach(c=>{c.sheet||(r.add(c),c.addEventListener("load",()=>{r.delete(c),r.size===0&&i!==-1&&(s.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(D.LoadStylesheetEnd),i&&clearTimeout(i),l())}))}),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(D.LoadStylesheetStart),i=setTimeout(()=>{s.matches("playing")&&this.play(this.getCurrentTime()),i=-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 we(this,null,function*(){this.service.state;const t=()=>{this.service.state};this.emitter.on(D.Start,t),this.emitter.on(D.Pause,t);const n=[];for(const r of this.service.state.context.events)r.type===S.IncrementalSnapshot&&r.data.source===x.CanvasMutation&&(n.push(this.deserializeAndPreloadCanvasEvents(r.data,r)),("commands"in r.data?r.data.commands:[r.data]).forEach(i=>{this.preloadImages(i,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"),i=r.getContext("2d"),s=i?.createImageData(r.width,r.height);s?.data,JSON.parse(t.args[0]),i?.putImageData(s,0,0)}}deserializeAndPreloadCanvasEvents(t,n){return we(this,null,function*(){if(!this.canvasEventMap.has(n)){const r={isUnchanged:!0};if("commands"in t){const i=yield Promise.all(t.commands.map(s=>we(this,null,function*(){const a=yield Promise.all(s.args.map(W(this.imageMap,null,r)));return Ee(Q({},s),{args:a})})));r.isUnchanged===!1&&this.canvasEventMap.set(n,Ee(Q({},t),{commands:i}))}else{const i=yield Promise.all(t.args.map(W(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(n,Ee(Q({},t),{args:i}))}}})}applyIncremental(t,n){var r,i,s,a,l,c;const{data:o}=t;switch(o.source){case x.Mutation:{try{this.applyMutation(o,n)}catch(u){this.warn(`Exception in mutation ${u.message||u}`,o)}break}case x.Drag:case x.TouchMove:case x.MouseMove:if(n){const u=o.positions[o.positions.length-1];this.mousePos={x:u.x,y:u.y,id:u.id,debugData:o}}else o.positions.forEach(u=>{const d={doAction:()=>{this.moveAndHover(u.x,u.y,u.id,n,o)},delay:u.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(d)}),this.timer.addAction({doAction(){},delay:t.delay-((r=o.positions[0])==null?void 0:r.timeOffset)});break;case x.MouseInteraction:{if(o.id===-1||n)break;const u=new Event(_[o.type].toLowerCase()),d=this.mirror.getNode(o.id);if(!d)return this.debugNodeNotFound(o,o.id);this.emitter.emit(D.MouseInteraction,{type:o.type,target:d});const{triggerFocus:h}=this.config;switch(o.type){case _.Blur:"blur"in d&&d.blur();break;case _.Focus:h&&d.focus&&d.focus({preventScroll:!0});break;case _.Click:case _.TouchStart:case _.TouchEnd:n?(o.type===_.TouchStart?this.touchActive=!0:o.type===_.TouchEnd&&(this.touchActive=!1),this.mousePos={x:o.x,y:o.y,id:o.id,debugData:o}):(o.type===_.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(o.x,o.y,o.id,n,o),o.type===_.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):o.type===_.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):o.type===_.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case _.TouchCancel:n?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:d.dispatchEvent(u)}break}case x.Scroll:{if(o.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);u.scrollData=o;break}this.applyScroll(o,n);break}case x.ViewportResize:this.emitter.emit(D.Resize,{width:o.width,height:o.height});break;case x.Input:{if(o.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);u.inputData=o;break}this.applyInput(o);break}case x.MediaInteraction:{const u=this.usingVirtualDom?this.virtualDom.mirror.getNode(o.id):this.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);const d=u;try{o.currentTime&&(d.currentTime=o.currentTime),o.volume&&(d.volume=o.volume),o.muted&&(d.muted=o.muted),o.type===ye.Pause&&d.pause(),o.type===ye.Play&&d.play()}catch(h){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${h.message||h}`)}break}case x.StyleSheetRule:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);const d=u.rules;(i=o.adds)==null||i.forEach(({rule:h,index:f})=>d?.push({cssText:h,index:f,type:$.Insert})),(s=o.removes)==null||s.forEach(({index:h})=>d?.push({index:h,type:$.Remove}))}else{const u=this.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);const d=u.sheet;(a=o.adds)==null||a.forEach(({rule:h,index:f})=>{try{if(Array.isArray(f)){const{positions:T,index:y}=st(f);K(d.cssRules,T).insertRule(h,y)}else{const T=f===void 0?void 0:Math.min(f,d.cssRules.length);d.insertRule(h,T)}}catch{}}),(l=o.removes)==null||l.forEach(({index:h})=>{try{if(Array.isArray(h)){const{positions:f,index:T}=st(h);K(d.cssRules,f).deleteRule(T||0)}else d?.deleteRule(h)}catch{}})}break}case x.StyleDeclaration:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);const d=u.rules;o.set&&d.push(Q({type:$.SetProperty,index:o.index},o.set)),o.remove&&d.push(Q({type:$.RemoveProperty,index:o.index},o.remove))}else{const u=this.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);const d=u.sheet;o.set&&K(d.rules,o.index).style.setProperty(o.set.property,o.set.value,o.set.priority),o.remove&&K(d.rules,o.index).style.removeProperty(o.remove.property)}break}case x.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);u.canvasMutations.push({event:t,mutation:o})}else{const u=this.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);ut({event:t,mutation:o,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case x.Font:{try{const u=new FontFace(o.family,o.buffer?new Uint8Array(JSON.parse(o.fontSource)):o.fontSource,o.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,Qt(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const o in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[o],d=We(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(o=>{var u;const d=r.getNode(o.id);if(!d)return t.removes.find(f=>f.id===o.parentId)?void 0:this.warnNodeNotFound(t,o.id);let h=r.getNode(o.parentId);if(!h)return this.warnNodeNotFound(t,o.parentId);if(o.isShadow&&ot(h)&&(h=h.shadowRoot),r.removeNodeFromMap(d),h)try{h.removeChild(d),this.usingVirtualDom&&d.nodeName==="#text"&&h.nodeName==="STYLE"&&((u=h.rules)==null?void 0:u.length)>0&&(h.rules=[])}catch(f){if(f instanceof DOMException)this.warn("parent could not remove child in mutation",h,d,t);else throw f}});const i=Q({},this.legacy_missingNodeRetryMap),s=[],a=o=>{let u=null;return o.nextId&&(u=r.getNode(o.nextId)),o.nextId!==null&&o.nextId!==void 0&&o.nextId!==-1&&!u},l=o=>{var u;if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");let d=r.getNode(o.parentId);if(!d)return o.node.type===A.Document?this.newDocumentQueue.push(o):s.push(o);o.node.isShadow&&(ot(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let h=null,f=null;if(o.previousId&&(h=r.getNode(o.previousId)),o.nextId&&(f=r.getNode(o.nextId)),a(o))return s.push(o);if(o.node.rootId&&!r.getNode(o.node.rootId))return;const T=o.node.rootId?r.getNode(o.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Ne(d,r)){this.attachDocumentToIframe(o,d);return}const y=ie(o.node,{doc:T,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache});if(o.previousId===-1||o.nextId===-1){i[o.node.id]={node:y,mutation:o};return}const N=r.getMeta(d);if(N&&N.type===A.Element&&N.tagName==="textarea"&&o.node.type===A.Text){const p=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);for(const v of p)v.nodeType===d.TEXT_NODE&&d.removeChild(v)}if(h&&h.nextSibling&&h.nextSibling.parentNode)d.insertBefore(y,h.nextSibling);else if(f&&f.parentNode)d.contains(f)?d.insertBefore(y,f):d.insertBefore(y,null);else{if(d===T)for(;T.firstChild;)T.removeChild(T.firstChild);d.appendChild(y)}if(this.usingVirtualDom&&y.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)==null?void 0:u.length)>0&&(d.rules=[]),Ne(y,this.mirror)){const p=this.mirror.getId(y),v=this.newDocumentQueue.find(w=>w.parentId===p);v&&(this.attachDocumentToIframe(v,y),this.newDocumentQueue=this.newDocumentQueue.filter(w=>w!==v))}(o.previousId||o.nextId)&&this.legacy_resolveMissingNode(i,d,y,o)};t.adds.forEach(o=>{l(o)});const c=Date.now();for(;s.length;){const o=dn(s);if(s.length=0,Date.now()-c>500){this.warn("Timeout in the loop, please check the resolve tree data:",o);break}for(const u of o)r.getNode(u.value.parentId)?rt(u,d=>{l(d)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),hn(t.texts).forEach(o=>{var u;const d=r.getNode(o.id);if(!d)return t.removes.find(h=>h.id===o.id)?void 0:this.warnNodeNotFound(t,o.id);if(d.textContent=o.value,this.usingVirtualDom){const h=d.parentNode;((u=h?.rules)==null?void 0:u.length)>0&&(h.rules=[])}}),t.attributes.forEach(o=>{const u=r.getNode(o.id);if(!u)return t.removes.find(d=>d.id===o.id)?void 0:this.warnNodeNotFound(t,o.id);for(const d in o.attributes)if(typeof d=="string"){const h=o.attributes[d];if(h===null)u.removeAttribute(d);else if(typeof h=="string")try{u.setAttribute(d,h)}catch(f){this.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",f)}else if(d==="style"){const f=h,T=u;for(const y in f)if(f[y]===!1)T.style.removeProperty(y);else if(f[y]instanceof Array){const N=f[y];T.style.setProperty(y,N[0],N[1])}else{const N=f[y];T.style.setProperty(y,N)}}}})}applyScroll(t,n){const r=this.mirror.getNode(t.id);if(!r)return this.debugNodeNotFound(t,t.id);const i=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(i?.type===A.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,i){const{previousId:s,nextId:a}=i,l=s&&t[s],c=a&&t[a];if(l){const{node:o,mutation:u}=l;n.insertBefore(o,r),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,n,o,u)}if(c){const{node:o,mutation:u}=c;n.insertBefore(o,r.nextSibling),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,n,o,u)}}moveAndHover(t,n,r,i,s){const a=this.mirror.getNode(r);if(!a)return this.debugNodeNotFound(s,r);const l=it(a,this.iframe),c=t*l.absoluteScale+l.x,o=n*l.absoluteScale+l.y;this.mouse.style.left=`${c}px`,this.mouse.style.top=`${o}px`,i||this.drawMouseTail({x:c,y:o}),this.hoverElements(a)}drawMouseTail(t){if(!this.mouseTail)return;const{lineCap:n,lineWidth:r,strokeStyle:i,duration:s}=this.config.mouseTail===!0?De:Object.assign({},De,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=i,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(i=>{i.classList.remove(":hover")});let r=t;for(;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement}isUserInteraction(t){return t.type!==S.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(D.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(be,`Node with id '${n}' not found. `,t)}warn(...t){!this.config.showWarning||console.warn(be,...t)}debug(...t){!this.config.showDebug||console.log(be,...t)}}return he.Replayer=An,Object.defineProperty(he,"__esModule",{value:!0}),he}({});
|
|
17
|
+
or you can use record.mirror to access the mirror instance during recording.`;let nt={map:{},getId(){return console.error(X),-1},getNode(){return console.error(X),null},removeNodeFromMap(){console.error(X)},has(){return console.error(X),!1},reset(){console.error(X)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(nt=new Proxy(nt,{get(e,t,n){return t==="map"&&console.error(X),Reflect.get(e,t,n)}}));function un(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 dn(e){const t={},n=(i,s)=>{const a={value:i,parent:s,children:[]};return t[i.node.id]=a,a},r=[];for(const i of e){const{nextId:s,parentId:a}=i;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(i,l.parent))}else{const c=r.indexOf(l);r.splice(c,0,n(i,null))}continue}if(a in t){const l=t[a];l.children.push(n(i,l));continue}r.push(n(i,null))}return r}function rt(e,t){t(e.value);for(let n=e.children.length-1;n>=0;n--)rt(e.children[n],t)}function Ne(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function it(e,t){var n,r;const i=(r=(n=e.ownerDocument)==null?void 0:n.defaultView)==null?void 0:r.frameElement;if(!i||i===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const s=i.getBoundingClientRect(),a=it(i,t),l=s.height/i.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}}function ot(e){return Boolean(e?.shadowRoot)}function K(e,t){const n=e[t[0]];return t.length===1?n:K(n.cssRules[t[1]].cssRules,t.slice(2))}function st(e){const t=[...e],n=t.pop();return{positions:t,index:n}}function hn(e){const t=new Set,n=[];for(let r=e.length;r--;){const i=e[r];t.has(i.id)||(n.push(i),t.add(i.id))}return n}const mn=e=>["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;}`];for(var at="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ee=typeof Uint8Array>"u"?[]:new Uint8Array(256),le=0;le<at.length;le++)ee[at.charCodeAt(le)]=le;var pn=function(e){var t=e.length*.75,n=e.length,r,i=0,s,a,l,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var o=new ArrayBuffer(t),u=new Uint8Array(o);for(r=0;r<n;r+=4)s=ee[e.charCodeAt(r)],a=ee[e.charCodeAt(r+1)],l=ee[e.charCodeAt(r+2)],c=ee[e.charCodeAt(r+3)],u[i++]=s<<2|a>>4,u[i++]=(a&15)<<4|l>>2,u[i++]=(l&3)<<6|c&63;return o},fn=(e,t,n)=>new Promise((r,i)=>{var s=c=>{try{l(n.next(c))}catch(o){i(o)}},a=c=>{try{l(n.throw(c))}catch(o){i(o)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,a);l((n=n.apply(e,t)).next())});const ct=new Map;function lt(e,t){let n=ct.get(e);return n||(n=new Map,ct.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}function W(e,t,n){return r=>fn(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 i=yield W(e,t,n)(r.args);return yield createImageBitmap.apply(null,i)}else if("index"in r){if(n||t===null)return r;const{rr_type:i,index:s}=r;return lt(t,i)[s]}else if("args"in r){const{rr_type:i,args:s}=r,a=window[i];return new a(...yield Promise.all(s.map(W(e,t,n))))}else{if("base64"in r)return pn(r.base64);if("src"in r){const i=e.get(r.src);if(i)return i;{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 i=yield Promise.all(r.data.map(W(e,t,n)));return new Blob(i,{type:r.type})}}else if(Array.isArray(r))return yield Promise.all(r.map(W(e,t,n)));return r})}var gn=(e,t,n)=>new Promise((r,i)=>{var s=c=>{try{l(n.next(c))}catch(o){i(o)}},a=c=>{try{l(n.throw(c))}catch(o){i(o)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,a);l((n=n.apply(e,t)).next())});function yn(e,t){try{return t===oe.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}const vn=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function Tn(e,t){if(!(t!=null&&t.constructor))return;const{name:n}=t.constructor;if(!vn.includes(n))return;const r=lt(e,n);r.includes(t)||r.push(t)}function Nn(e){return gn(this,arguments,function*({mutation:t,target:n,type:r,imageMap:i,errorHandler:s}){try{const a=yn(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(W(i,a))),o=l.apply(a,c);Tn(a,o)}catch(a){s(t,a)}})}var En=(e,t,n)=>new Promise((r,i)=>{var s=c=>{try{l(n.next(c))}catch(o){i(o)}},a=c=>{try{l(n.throw(c))}catch(o){i(o)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,a);l((n=n.apply(e,t)).next())});function wn(e){return En(this,arguments,function*({event:t,mutation:n,target:r,imageMap:i,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=i.get(t);l.apply(a,n.args)}else{const c=yield Promise.all(n.args.map(W(i,a)));l.apply(a,c)}}catch(a){s(n,a)}})}var bn=(e,t,n)=>new Promise((r,i)=>{var s=c=>{try{l(n.next(c))}catch(o){i(o)}},a=c=>{try{l(n.throw(c))}catch(o){i(o)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,a);l((n=n.apply(e,t)).next())});function ut(e){return bn(this,arguments,function*({event:t,mutation:n,target:r,imageMap:i,canvasEventMap:s,errorHandler:a}){try{const l=s.get(t)||n,c="commands"in l?l.commands:[l];if([oe.WebGL,oe.WebGL2].includes(n.type)){for(let o=0;o<c.length;o++){const u=c[o];yield Nn({mutation:u,type:n.type,target:r,imageMap:i,errorHandler:a})}return}for(let o=0;o<c.length;o++){const u=c[o];yield wn({event:t,mutation:u,target:r,imageMap:i,errorHandler:a})}}catch(l){a(n,l)}})}var Dn=Object.defineProperty,Mn=Object.defineProperties,Cn=Object.getOwnPropertyDescriptors,dt=Object.getOwnPropertySymbols,Sn=Object.prototype.hasOwnProperty,xn=Object.prototype.propertyIsEnumerable,ht=(e,t,n)=>t in e?Dn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Q=(e,t)=>{for(var n in t||(t={}))Sn.call(t,n)&&ht(e,n,t[n]);if(dt)for(var n of dt(t))xn.call(t,n)&&ht(e,n,t[n]);return e},Ee=(e,t)=>Mn(e,Cn(t)),we=(e,t,n)=>new Promise((r,i)=>{var s=c=>{try{l(n.next(c))}catch(o){i(o)}},a=c=>{try{l(n.throw(c))}catch(o){i(o)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,a);l((n=n.apply(e,t)).next())});const mt=10*1e3,pt=2*1e3,ft=1*1e3,gt=60*60*1e3,Rn=He||Zt,be="[replayer]",De={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Me(e){return e.type==C.IncrementalSnapshot&&(e.data.source==x.TouchMove||e.data.source==x.MouseInteraction&&e.data.type==_.TouchStart)}class An{constructor(t,n){if(this.usingVirtualDom=!1,this.virtualDom=new Y,this.mouseTail=null,this.tailPositions=[],this.emitter=Rn(),this.activityIntervals=[],this.legacy_missingNodeRetryMap={},this.cache=ke(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=Tt(),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:De,useVirtualDom:!0,inactiveThreshold:.02,inactiveSkipTime:pt};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(D.Resize,this.handleResize),this.setupDom(),this.emitter.on(D.Flush,()=>{if(this.usingVirtualDom){const l={mirror:this.mirror,applyCanvas:(c,o,u)=>{ut({event:c,mutation:o,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this)};if(B(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 o=this.legacy_missingNodeRetryMap[c],u=ge(o.node,this.mirror,this.virtualDom.mirror);B(u,o.node,l,this.virtualDom.mirror),o.node=u}catch(o){this.config.showWarning&&console.warn(o)}}this.mousePos&&this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null}),this.emitter.on(D.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset()});const i=new en([],n?.speed||r.speed);this.service=cn({events:t.map(l=>n&&n.unpackFn?n.unpackFn(l):l).sort((l,c)=>l.timestamp-c.timestamp),timer:i,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(D.StateChange,{player:l})}),this.speedService=ln({normalSpeed:-1,timer:i}),this.speedService.start(),this.speedService.subscribe(l=>{this.emitter.emit(D.StateChange,{speed:l})});const s=this.service.state.context.events.find(l=>l.type===C.Meta),a=this.service.state.context.events.find(l=>l.type===C.FullSnapshot);if(s){const{width:l,height:c}=s.data;setTimeout(()=>{this.emitter.emit(D.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(Me)&&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>mt?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 i=[];let s=t[0];for(let a=1;a<t.length;a++)t[a].active!=t[a-1].active&&(i.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&&i.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=i[0];for(let a=1;a<i.length;a++)(!i[a].active&&i[a].duration>this.config.inactiveThreshold*n.totalTime||!i[a-1].active&&i[a-1].duration>this.config.inactiveThreshold*n.totalTime)&&(this.activityIntervals.push({startTime:s.startTime,endTime:i[a-1].endTime,duration:i[a-1].endTime-s.startTime,active:i[a-1].active}),s=i[a]);s&&i.length>0&&this.activityIntervals.push({startTime:s.startTime,endTime:i[i.length-1].endTime,duration:i[i.length-1].endTime-s.startTime,active:i[i.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(D.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(D.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(D.Resume)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){const n=this.config.unpackFn?this.config.unpackFn(t):t;Me(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(Me(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=ke()}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&&(Kt(this.iframe.contentWindow,this.iframe.contentDocument),un(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 C.DomContentLoaded:case C.Load:case C.Custom:continue;case C.FullSnapshot:case C.Meta:case C.Plugin:case C.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 C.DomContentLoaded:case C.Load:break;case C.Custom:r=()=>{this.emitter.emit(D.CustomEvent,t)};break;case C.Meta:r=()=>this.emitter.emit(D.Resize,{width:t.data.width,height:t.data.height});break;case C.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 C.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 i of this.service.state.context.events)if(!(i.timestamp<=t.timestamp)&&this.isUserInteraction(i)){i.delay-t.delay>mt*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=i);break}if(this.nextUserInteractionEvent){const i=this.nextUserInteractionEvent.delay-t.delay,s={speed:Math.min(Math.round(i/pt),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:s}),this.emitter.emit(D.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 i=this.service.state.context.events.length-1;if(t===this.service.state.context.events[i]){const s=()=>{i<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(D.Finish))};t.type===C.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(D.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,i={speed:r/gt*this.config.inactiveSkipTime<ft?r/ft:Math.round(Math.max(r,gt)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:i}),this.emitter.emit(D.SkipStart,i)}}}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=[];St(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:i,head:s}=this.iframe.contentDocument;this.insertStyleRules(i,s),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(D.FullsnapshotRebuilded,t),n||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,n){const r=mn(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 i=this.virtualDom.createElement("style");this.virtualDom.mirror.add(i,je(i,this.virtualDom.unserializedId)),t.insertBefore(i,n);for(let s=0;s<r.length;s++)i.rules.push({cssText:r[s],type:U.Insert,index:s})}else{const i=document.createElement("style");t.insertBefore(i,n);for(let s=0;s<r.length;s++)i.sheet.insertRule(r[s],s)}}attachDocumentToIframe(t,n){const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[];ie(t.node,{doc:n.contentDocument,mirror:r,hackCss:!0,skipChild:!1,afterAppend:s=>{this.collectIframeAndAttachDocument(i,s);const a=r.getMeta(s);if(a?.type===A.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 i)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(i=>i.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 i,s=this.service.state;const a=()=>{s=this.service.state};this.emitter.on(D.Start,a),this.emitter.on(D.Pause,a);const l=()=>{this.emitter.off(D.Start,a),this.emitter.off(D.Pause,a)};n.querySelectorAll('link[rel="stylesheet"]').forEach(c=>{c.sheet||(r.add(c),c.addEventListener("load",()=>{r.delete(c),r.size===0&&i!==-1&&(s.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(D.LoadStylesheetEnd),i&&clearTimeout(i),l())}))}),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(D.LoadStylesheetStart),i=setTimeout(()=>{s.matches("playing")&&this.play(this.getCurrentTime()),i=-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 we(this,null,function*(){this.service.state;const t=()=>{this.service.state};this.emitter.on(D.Start,t),this.emitter.on(D.Pause,t);const n=[];for(const r of this.service.state.context.events)r.type===C.IncrementalSnapshot&&r.data.source===x.CanvasMutation&&(n.push(this.deserializeAndPreloadCanvasEvents(r.data,r)),("commands"in r.data?r.data.commands:[r.data]).forEach(i=>{this.preloadImages(i,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"),i=r.getContext("2d"),s=i?.createImageData(r.width,r.height);s?.data,JSON.parse(t.args[0]),i?.putImageData(s,0,0)}}deserializeAndPreloadCanvasEvents(t,n){return we(this,null,function*(){if(!this.canvasEventMap.has(n)){const r={isUnchanged:!0};if("commands"in t){const i=yield Promise.all(t.commands.map(s=>we(this,null,function*(){const a=yield Promise.all(s.args.map(W(this.imageMap,null,r)));return Ee(Q({},s),{args:a})})));r.isUnchanged===!1&&this.canvasEventMap.set(n,Ee(Q({},t),{commands:i}))}else{const i=yield Promise.all(t.args.map(W(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(n,Ee(Q({},t),{args:i}))}}})}applyIncremental(t,n){var r,i,s,a,l,c;const{data:o}=t;switch(o.source){case x.Mutation:{try{this.applyMutation(o,n)}catch(u){this.warn(`Exception in mutation ${u.message||u}`,o)}break}case x.Drag:case x.TouchMove:case x.MouseMove:if(n){const u=o.positions[o.positions.length-1];this.mousePos={x:u.x,y:u.y,id:u.id,debugData:o}}else o.positions.forEach(u=>{const d={doAction:()=>{this.moveAndHover(u.x,u.y,u.id,n,o)},delay:u.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(d)}),this.timer.addAction({doAction(){},delay:t.delay-((r=o.positions[0])==null?void 0:r.timeOffset)});break;case x.MouseInteraction:{if(o.id===-1||n)break;const u=new Event(_[o.type].toLowerCase()),d=this.mirror.getNode(o.id);if(!d)return this.debugNodeNotFound(o,o.id);this.emitter.emit(D.MouseInteraction,{type:o.type,target:d});const{triggerFocus:h}=this.config;switch(o.type){case _.Blur:"blur"in d&&d.blur();break;case _.Focus:h&&d.focus&&d.focus({preventScroll:!0});break;case _.Click:case _.TouchStart:case _.TouchEnd:n?(o.type===_.TouchStart?this.touchActive=!0:o.type===_.TouchEnd&&(this.touchActive=!1),this.mousePos={x:o.x,y:o.y,id:o.id,debugData:o}):(o.type===_.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(o.x,o.y,o.id,n,o),o.type===_.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):o.type===_.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):o.type===_.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case _.TouchCancel:n?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:d.dispatchEvent(u)}break}case x.Scroll:{if(o.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);u.scrollData=o;break}this.applyScroll(o,n);break}case x.ViewportResize:this.emitter.emit(D.Resize,{width:o.width,height:o.height});break;case x.Input:{if(o.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);u.inputData=o;break}this.applyInput(o);break}case x.MediaInteraction:{const u=this.usingVirtualDom?this.virtualDom.mirror.getNode(o.id):this.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);const d=u;try{o.currentTime&&(d.currentTime=o.currentTime),o.volume&&(d.volume=o.volume),o.muted&&(d.muted=o.muted),o.type===ye.Pause&&d.pause(),o.type===ye.Play&&d.play()}catch(h){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${h.message||h}`)}break}case x.StyleSheetRule:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);const d=u.rules;(i=o.adds)==null||i.forEach(({rule:h,index:f})=>d?.push({cssText:h,index:f,type:U.Insert})),(s=o.removes)==null||s.forEach(({index:h})=>d?.push({index:h,type:U.Remove}))}else{const u=this.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);const d=u.sheet;(a=o.adds)==null||a.forEach(({rule:h,index:f})=>{try{if(Array.isArray(f)){const{positions:T,index:y}=st(f);K(d.cssRules,T).insertRule(h,y)}else{const T=f===void 0?void 0:Math.min(f,d.cssRules.length);d.insertRule(h,T)}}catch{}}),(l=o.removes)==null||l.forEach(({index:h})=>{try{if(Array.isArray(h)){const{positions:f,index:T}=st(h);K(d.cssRules,f).deleteRule(T||0)}else d?.deleteRule(h)}catch{}})}break}case x.StyleDeclaration:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);const d=u.rules;o.set&&d.push(Q({type:U.SetProperty,index:o.index},o.set)),o.remove&&d.push(Q({type:U.RemoveProperty,index:o.index},o.remove))}else{const u=this.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);const d=u.sheet;o.set&&K(d.rules,o.index).style.setProperty(o.set.property,o.set.value,o.set.priority),o.remove&&K(d.rules,o.index).style.removeProperty(o.remove.property)}break}case x.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);u.canvasMutations.push({event:t,mutation:o})}else{const u=this.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);ut({event:t,mutation:o,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case x.Font:{try{const u=new FontFace(o.family,o.buffer?new Uint8Array(JSON.parse(o.fontSource)):o.fontSource,o.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,Qt(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const o in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[o],d=We(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(o=>{var u;const d=r.getNode(o.id);if(!d)return t.removes.find(f=>f.id===o.parentId)?void 0:this.warnNodeNotFound(t,o.id);let h=r.getNode(o.parentId);if(!h)return this.warnNodeNotFound(t,o.parentId);if(o.isShadow&&ot(h)&&(h=h.shadowRoot),r.removeNodeFromMap(d),h)try{h.removeChild(d),this.usingVirtualDom&&d.nodeName==="#text"&&h.nodeName==="STYLE"&&((u=h.rules)==null?void 0:u.length)>0&&(h.rules=[])}catch(f){if(f instanceof DOMException)this.warn("parent could not remove child in mutation",h,d,t);else throw f}});const i=Q({},this.legacy_missingNodeRetryMap),s=[],a=o=>{let u=null;return o.nextId&&(u=r.getNode(o.nextId)),o.nextId!==null&&o.nextId!==void 0&&o.nextId!==-1&&!u},l=o=>{var u;if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");let d=r.getNode(o.parentId);if(!d)return o.node.type===A.Document?this.newDocumentQueue.push(o):s.push(o);o.node.isShadow&&(ot(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let h=null,f=null;if(o.previousId&&(h=r.getNode(o.previousId)),o.nextId&&(f=r.getNode(o.nextId)),a(o))return s.push(o);if(o.node.rootId&&!r.getNode(o.node.rootId))return;const T=o.node.rootId?r.getNode(o.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Ne(d,r)){this.attachDocumentToIframe(o,d);return}const y=ie(o.node,{doc:T,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache});if(o.previousId===-1||o.nextId===-1){i[o.node.id]={node:y,mutation:o};return}const N=r.getMeta(d);if(N&&N.type===A.Element&&N.tagName==="textarea"&&o.node.type===A.Text){const p=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);for(const v of p)v.nodeType===d.TEXT_NODE&&d.removeChild(v)}if(h&&h.nextSibling&&h.nextSibling.parentNode)d.insertBefore(y,h.nextSibling);else if(f&&f.parentNode)d.contains(f)?d.insertBefore(y,f):d.insertBefore(y,null);else{if(d===T)for(;T.firstChild;)T.removeChild(T.firstChild);d.appendChild(y)}if(this.usingVirtualDom&&y.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)==null?void 0:u.length)>0&&(d.rules=[]),Ne(y,this.mirror)){const p=this.mirror.getId(y),v=this.newDocumentQueue.find(w=>w.parentId===p);v&&(this.attachDocumentToIframe(v,y),this.newDocumentQueue=this.newDocumentQueue.filter(w=>w!==v))}(o.previousId||o.nextId)&&this.legacy_resolveMissingNode(i,d,y,o)};t.adds.forEach(o=>{l(o)});const c=Date.now();for(;s.length;){const o=dn(s);if(s.length=0,Date.now()-c>500){this.warn("Timeout in the loop, please check the resolve tree data:",o);break}for(const u of o)r.getNode(u.value.parentId)?rt(u,d=>{l(d)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),hn(t.texts).forEach(o=>{var u;const d=r.getNode(o.id);if(!d)return t.removes.find(h=>h.id===o.id)?void 0:this.warnNodeNotFound(t,o.id);if(d.textContent=o.value,this.usingVirtualDom){const h=d.parentNode;((u=h?.rules)==null?void 0:u.length)>0&&(h.rules=[])}}),t.attributes.forEach(o=>{const u=r.getNode(o.id);if(!u)return t.removes.find(d=>d.id===o.id)?void 0:this.warnNodeNotFound(t,o.id);for(const d in o.attributes)if(typeof d=="string"){const h=o.attributes[d];if(h===null)u.removeAttribute(d);else if(typeof h=="string")try{u.setAttribute(d,h)}catch(f){this.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",f)}else if(d==="style"){const f=h,T=u;for(const y in f)if(f[y]===!1)T.style.removeProperty(y);else if(f[y]instanceof Array){const N=f[y];T.style.setProperty(y,N[0],N[1])}else{const N=f[y];T.style.setProperty(y,N)}}}})}applyScroll(t,n){const r=this.mirror.getNode(t.id);if(!r)return this.debugNodeNotFound(t,t.id);const i=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(i?.type===A.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,i){const{previousId:s,nextId:a}=i,l=s&&t[s],c=a&&t[a];if(l){const{node:o,mutation:u}=l;n.insertBefore(o,r),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,n,o,u)}if(c){const{node:o,mutation:u}=c;n.insertBefore(o,r.nextSibling),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,n,o,u)}}moveAndHover(t,n,r,i,s){const a=this.mirror.getNode(r);if(!a)return this.debugNodeNotFound(s,r);const l=it(a,this.iframe),c=t*l.absoluteScale+l.x,o=n*l.absoluteScale+l.y;this.mouse.style.left=`${c}px`,this.mouse.style.top=`${o}px`,i||this.drawMouseTail({x:c,y:o}),this.hoverElements(a)}drawMouseTail(t){if(!this.mouseTail)return;const{lineCap:n,lineWidth:r,strokeStyle:i,duration:s}=this.config.mouseTail===!0?De:Object.assign({},De,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=i,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(i=>{i.classList.remove(":hover")});let r=t;for(;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement}isUserInteraction(t){return t.type!==C.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(D.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(be,`Node with id '${n}' not found. `,t)}warn(...t){!this.config.showWarning||console.warn(be,...t)}debug(...t){!this.config.showDebug||console.log(be,...t)}}return he.Replayer=An,Object.defineProperty(he,"__esModule",{value:!0}),he}({});
|
|
18
18
|
//# sourceMappingURL=rrweb-replay.min.js.map
|