@highlight-run/rrweb 2.1.2 → 2.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/plugins/console-record.js +3 -3
- package/dist/plugins/console-record.min.js +3 -3
- package/dist/plugins/console-record.min.js.map +1 -1
- package/dist/plugins/console-replay.js +0 -0
- package/dist/plugins/console-replay.min.js +0 -0
- package/dist/plugins/console-replay.min.js.map +1 -1
- package/dist/plugins/sequential-id-record.js +0 -0
- package/dist/plugins/sequential-id-record.min.js +0 -0
- package/dist/plugins/sequential-id-record.min.js.map +0 -0
- package/dist/plugins/sequential-id-replay.js +0 -0
- package/dist/plugins/sequential-id-replay.min.js +0 -0
- package/dist/plugins/sequential-id-replay.min.js.map +0 -0
- package/dist/record/rrweb-record-pack.js +0 -0
- package/dist/record/rrweb-record-pack.min.js +0 -0
- package/dist/record/rrweb-record-pack.min.js.map +1 -1
- package/dist/record/rrweb-record.js +3 -3
- package/dist/record/rrweb-record.min.js +3 -3
- package/dist/record/rrweb-record.min.js.map +1 -1
- package/dist/replay/rrweb-replay-unpack.css +0 -0
- package/dist/replay/rrweb-replay-unpack.js +3 -3
- package/dist/replay/rrweb-replay-unpack.min.css +0 -0
- package/dist/replay/rrweb-replay-unpack.min.css.map +0 -0
- 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 +0 -0
- package/dist/replay/rrweb-replay.js +4 -4
- package/dist/replay/rrweb-replay.min.css +0 -0
- package/dist/replay/rrweb-replay.min.css.map +0 -0
- package/dist/replay/rrweb-replay.min.js +4 -4
- package/dist/replay/rrweb-replay.min.js.map +1 -1
- package/dist/rrweb-all.css +0 -0
- package/dist/rrweb-all.js +10 -10
- package/dist/rrweb-all.min.css +0 -0
- package/dist/rrweb-all.min.css.map +0 -0
- package/dist/rrweb-all.min.js +10 -10
- package/dist/rrweb-all.min.js.map +1 -1
- package/dist/rrweb.css +0 -0
- package/dist/rrweb.js +5 -5
- package/dist/rrweb.min.css +0 -0
- package/dist/rrweb.min.css.map +0 -0
- package/dist/rrweb.min.js +5 -5
- package/dist/rrweb.min.js.map +1 -1
- package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__auto__createBase64WorkerFactory.js +0 -0
- package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__auto__isNodeJS.js +0 -0
- package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js +0 -0
- package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__node__WorkerClass.js +0 -0
- package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__node__createBase64WorkerFactory.js +0 -0
- package/es/rrweb/_virtual/image-bitmap-data-url-worker.js +0 -0
- package/es/rrweb/all.css +0 -0
- package/es/rrweb/ext/@xstate/fsm/es/index.js +0 -0
- package/es/rrweb/ext/base64-arraybuffer/dist/base64-arraybuffer.es5.js +0 -0
- package/es/rrweb/ext/fflate/esm/browser.js +0 -0
- package/es/rrweb/ext/mitt/dist/mitt.mjs.js +0 -0
- package/es/rrweb/ext/tslib/tslib.es6.js +0 -0
- package/es/rrweb/packages/rrdom/es/rrdom.js +0 -0
- package/es/rrweb/packages/rrweb/src/entries/all.js +0 -0
- package/es/rrweb/packages/rrweb/src/index.js +0 -0
- package/es/rrweb/packages/rrweb/src/packer/base.js +0 -0
- package/es/rrweb/packages/rrweb/src/packer/pack.js +0 -0
- package/es/rrweb/packages/rrweb/src/packer/unpack.js +0 -0
- package/es/rrweb/packages/rrweb/src/plugins/console/record/error-stack-parser.js +0 -0
- package/es/rrweb/packages/rrweb/src/plugins/console/record/index.js +0 -0
- package/es/rrweb/packages/rrweb/src/plugins/console/record/stringify.js +0 -0
- package/es/rrweb/packages/rrweb/src/plugins/console/replay/index.js +0 -0
- package/es/rrweb/packages/rrweb/src/plugins/sequential-id/record/index.js +0 -0
- package/es/rrweb/packages/rrweb/src/plugins/sequential-id/replay/index.js +0 -0
- package/es/rrweb/packages/rrweb/src/record/iframe-manager.js +0 -0
- package/es/rrweb/packages/rrweb/src/record/index.js +0 -0
- package/es/rrweb/packages/rrweb/src/record/mutation.js +0 -0
- package/es/rrweb/packages/rrweb/src/record/observer.js +0 -0
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/2d.js +0 -0
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas-manager.js +0 -0
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas.js +0 -0
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/serialize-args.js +0 -0
- package/es/rrweb/packages/rrweb/src/record/observers/canvas/webgl.js +0 -0
- package/es/rrweb/packages/rrweb/src/record/shadow-dom-manager.js +0 -0
- package/es/rrweb/packages/rrweb/src/record/stylesheet-manager.js +0 -0
- package/es/rrweb/packages/rrweb/src/replay/canvas/2d.js +0 -0
- package/es/rrweb/packages/rrweb/src/replay/canvas/deserialize-args.js +0 -0
- package/es/rrweb/packages/rrweb/src/replay/canvas/index.js +0 -0
- package/es/rrweb/packages/rrweb/src/replay/canvas/webgl.js +0 -0
- package/es/rrweb/packages/rrweb/src/replay/index.js +0 -0
- package/es/rrweb/packages/rrweb/src/replay/machine.js +0 -0
- package/es/rrweb/packages/rrweb/src/replay/smoothscroll.js +0 -0
- package/es/rrweb/packages/rrweb/src/replay/styles/inject-style.js +0 -0
- package/es/rrweb/packages/rrweb/src/replay/timer.js +0 -0
- package/es/rrweb/packages/rrweb/src/types.js +0 -0
- package/es/rrweb/packages/rrweb/src/utils.js +0 -0
- package/es/rrweb/packages/rrweb-snapshot/es/rrweb-snapshot.js +12 -5
- package/lib/plugins/console-record.js +0 -0
- package/lib/plugins/console-replay.js +0 -0
- package/lib/plugins/sequential-id-record.js +0 -0
- package/lib/plugins/sequential-id-replay.js +0 -0
- package/lib/record/rrweb-record-pack.js +0 -0
- package/lib/record/rrweb-record.js +12 -5
- package/lib/replay/rrweb-replay-unpack.css +0 -0
- package/lib/replay/rrweb-replay-unpack.js +0 -0
- package/lib/replay/rrweb-replay.css +0 -0
- package/lib/replay/rrweb-replay.js +0 -0
- package/lib/rrweb-all.css +0 -0
- package/lib/rrweb-all.js +12 -5
- package/lib/rrweb.css +0 -0
- package/lib/rrweb.js +12 -5
- package/package.json +3 -3
- package/typings/entries/all.d.ts +0 -0
- package/typings/entries/record-pack.d.ts +0 -0
- package/typings/entries/replay-unpack.d.ts +0 -0
- package/typings/index.d.ts +0 -0
- package/typings/packer/base.d.ts +0 -0
- package/typings/packer/index.d.ts +0 -0
- package/typings/packer/pack.d.ts +0 -0
- package/typings/packer/unpack.d.ts +0 -0
- package/typings/plugins/console/record/error-stack-parser.d.ts +0 -0
- package/typings/plugins/console/record/index.d.ts +0 -0
- package/typings/plugins/console/record/stringify.d.ts +0 -0
- package/typings/plugins/console/replay/index.d.ts +0 -0
- package/typings/plugins/sequential-id/record/index.d.ts +0 -0
- package/typings/plugins/sequential-id/replay/index.d.ts +0 -0
- package/typings/record/iframe-manager.d.ts +0 -0
- package/typings/record/index.d.ts +0 -0
- package/typings/record/mutation.d.ts +0 -0
- package/typings/record/observer.d.ts +0 -0
- package/typings/record/observers/canvas/2d.d.ts +0 -0
- package/typings/record/observers/canvas/canvas-manager.d.ts +0 -0
- package/typings/record/observers/canvas/canvas.d.ts +0 -0
- package/typings/record/observers/canvas/serialize-args.d.ts +0 -0
- package/typings/record/observers/canvas/webgl.d.ts +0 -0
- package/typings/record/shadow-dom-manager.d.ts +0 -0
- package/typings/record/stylesheet-manager.d.ts +0 -0
- package/typings/record/workers/image-bitmap-data-url-worker.d.ts +0 -0
- package/typings/replay/canvas/2d.d.ts +0 -0
- package/typings/replay/canvas/deserialize-args.d.ts +0 -0
- package/typings/replay/canvas/index.d.ts +0 -0
- package/typings/replay/canvas/webgl.d.ts +0 -0
- package/typings/replay/index.d.ts +0 -0
- package/typings/replay/machine.d.ts +0 -0
- package/typings/replay/smoothscroll.d.ts +0 -0
- package/typings/replay/styles/inject-style.d.ts +0 -0
- package/typings/replay/timer.d.ts +0 -0
- package/typings/rrdom/index.d.ts +0 -0
- package/typings/rrdom/tree-node.d.ts +0 -0
- package/typings/types.d.ts +0 -0
- package/typings/utils.d.ts +0 -0
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var rrwebReplay=function(fe){"use strict";var L;(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"})(L||(L={}));function Vt(e){return e.nodeType===e.ELEMENT_NODE}var $e=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 Wt(){return new $e}var Be=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Gt(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 c=[];function l(g){var m=new Error("".concat(t.source||"",":").concat(n,":").concat(r,": ").concat(g));if(m.reason=g,m.filename=t.source,m.line=n,m.column=r,m.source=e,t.silent)c.push(m);else throw m}function o(){var g=h();return{type:"stylesheet",stylesheet:{source:t.source,rules:g,parsingErrors:c}}}function u(){return f(/^{\s*/)}function d(){return f(/^}/)}function h(){var g,m=[];for(T(),v(m);e.length&&e.charAt(0)!=="}"&&(g=_()||re());)g!==!1&&(m.push(g),v(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 v(g){g===void 0&&(g=[]);for(var m;m=E();)m!==!1&&g.push(m),m=E();return g}function E(){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 l("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 X(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 y(){var g=s(),m=f(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(m){var b=X(m[0]);if(!f(/^:\s*/))return l("property missing ':'");var M=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),P=g({type:"declaration",property:b.replace(Be,""),value:M?X(M[0]).replace(Be,""):""});return f(/^[;\s]*/),P}}function N(){var g=[];if(!u())return l("missing '{'");v(g);for(var m;m=y();)m!==!1&&(g.push(m),v(g)),m=y();return d()?g:l("missing '}'")}function D(){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:N()})}function O(){var g=s(),m=f(/^@([-\w]+)?keyframes\s*/);if(m){var b=m[1];if(m=f(/^([-\w]+)\s*/),!m)return l("@keyframes missing name");var M=m[1];if(!u())return l("@keyframes missing '{'");for(var P,ee=v();P=D();)ee.push(P),ee=ee.concat(v());return d()?g({type:"keyframes",name:M,vendor:b,keyframes:ee}):l("@keyframes missing '}'")}}function R(){var g=s(),m=f(/^@supports *([^{]+)/);if(m){var b=X(m[1]);if(!u())return l("@supports missing '{'");var M=v().concat(h());return d()?g({type:"supports",supports:b,rules:M}):l("@supports missing '}'")}}function $(){var g=s(),m=f(/^@host\s*/);if(m){if(!u())return l("@host missing '{'");var b=v().concat(h());return d()?g({type:"host",rules:b}):l("@host missing '}'")}}function k(){var g=s(),m=f(/^@media *([^{]+)/);if(m){var b=X(m[1]);if(!u())return l("@media missing '{'");var M=v().concat(h());return d()?g({type:"media",media:b,rules:M}):l("@media missing '}'")}}function F(){var g=s(),m=f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(m)return g({type:"custom-media",name:X(m[1]),media:X(m[2])})}function ne(){var g=s(),m=f(/^@page */);if(m){var b=p()||[];if(!u())return l("@page missing '{'");for(var M=v(),P;P=y();)M.push(P),M=M.concat(v());return d()?g({type:"page",selectors:b,declarations:M}):l("@page missing '}'")}}function z(){var g=s(),m=f(/^@([-\w]+)?document *([^{]+)/);if(m){var b=X(m[1]),M=X(m[2]);if(!u())return l("@document missing '{'");var P=v().concat(h());return d()?g({type:"document",document:M,vendor:b,rules:P}):l("@document missing '}'")}}function K(){var g=s(),m=f(/^@font-face\s*/);if(m){if(!u())return l("@font-face missing '{'");for(var b=v(),M;M=y();)b.push(M),b=b.concat(v());return d()?g({type:"font-face",declarations:b}):l("@font-face missing '}'")}}var H=B("import"),Z=B("charset"),le=B("namespace");function B(g){var m=new RegExp("^@"+g+"\\s*([^;]+);");return function(){var b=s(),M=f(m);if(M){var P={type:g};return P[g]=M[1].trim(),b(P)}}}function _(){if(e[0]==="@")return O()||k()||F()||R()||H()||Z()||le()||z()||ne()||$()||K()}function re(){var g=s(),m=p();return m?(v(),g({type:"rule",selectors:m,declarations:N()})):l("selector missing")}return we(o())}function X(e){return e?e.replace(/^\s+|\s+$/g,""):""}function we(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],c=e[a];Array.isArray(c)?c.forEach(function(l){we(l,r)}):c&&typeof c=="object"&&we(c,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Ve={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 jt(e){var t=Ve[e.tagName]?Ve[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function Ht(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var We=/([^\\]):hover/,Yt=new RegExp(We.source,"g");function Ge(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=Gt(e,{silent:!0});if(!i.stylesheet)return e;var s=[];if(i.stylesheet.rules.forEach(function(l){"selectors"in l&&(l.selectors||[]).forEach(function(o){We.test(o)&&s.push(o)})}),s.length===0)return e;var a=new RegExp(s.filter(function(l,o){return s.indexOf(l)===o}).sort(function(l,o){return o.length-l.length}).map(function(l){return Ht(l)}).join("|"),"g"),c=e.replace(a,function(l){var o=l.replace(Yt,"$1.\\:hover");return"".concat(l,", ").concat(o)});return t?.stylesWithHoverClass.set(e,c),c}function je(){var e=new Map;return{stylesWithHoverClass:e}}function zt(e,t){var n=t.doc,r=t.hackCss,i=t.cache;switch(e.type){case L.Document:return n.implementation.createDocument(null,"",null);case L.DocumentType:return n.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case L.Element:{var s=jt(e),a;e.isSVG?a=n.createElementNS("http://www.w3.org/2000/svg",s):a=n.createElement(s);var c=function(d){if(!Object.prototype.hasOwnProperty.call(e.attributes,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.onload=function(){var F=a.getContext("2d");F&&F.drawImage(f,0,0,f.width,f.height)},f.src=h,a.RRNodeType&&(a.rr_dataURL=h)}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(F){return console.warn("media playback error",F)});break;case"paused":a.pause();break}}else{var v=s==="textarea"&&d==="value",E=s==="style"&&d==="_cssText";if(E&&r&&(h=Ge(h,i),typeof h=="string")){for(var p=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,y=void 0,N=[],D="https://replay-cors-proxy.highlightrun.workers.dev";(y=p.exec(h))!==null;)y.index===p.lastIndex&&p.lastIndex++,y.forEach(function(F,ne){if(ne===0){var z=F.slice(5,F.length-2);N.push({originalUrl:z,proxyUrl:z.replace(z,"".concat(D,"?url=").concat(z))})}});N.forEach(function(F){h=h.replace(F.originalUrl,F.proxyUrl)})}if(v||E){for(var O=n.createTextNode(h),R=0,$=Array.from(a.childNodes);R<$.length;R++){var k=$[R];k.nodeType===a.TEXT_NODE&&a.removeChild(k)}return a.appendChild(O),"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 l in e.attributes)c(l);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 L.Text:return n.createTextNode(e.isStyle&&r?Ge(e.textContent,i):e.textContent);case L.CDATA:return n.createCDATASection(e.textContent);case L.Comment:return n.createComment(e.textContent);default:return null}}function ve(e,t){var n=t.doc,r=t.mirror,i=t.skipChild,s=i===void 0?!1:i,a=t.hackCss,c=a===void 0?!0:a,l=t.afterAppend,o=t.cache,u=zt(e,{doc:n,hackCss:c,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===L.Document&&(n.close(),n.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==L.DocumentType&&(e.childNodes[0].type===L.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===L.Document||e.type===L.Element)&&!s)for(var d=0,h=e.childNodes;d<h.length;d++){var f=h[d],T=ve(f,{doc:n,mirror:r,skipChild:!1,hackCss:c,afterAppend:l,cache:o});if(!T){console.warn("Failed to rebuild",f);continue}f.isShadow&&Vt(u)&&u.shadowRoot?u.shadowRoot.appendChild(T):u.appendChild(T),l&&l(T)}return u}function Xt(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 Qt(e,t){var n=t.getMeta(e);if(n?.type===L.Element){var r=e;for(var i in n.attributes)if(Object.prototype.hasOwnProperty.call(n.attributes,i)&&i.startsWith("rr_")){var s=n.attributes[i];i==="rr_scrollLeft"&&(r.scrollLeft=s),i==="rr_scrollTop"&&(r.scrollTop=s)}}}function qt(e,t){var n=t.doc,r=t.onVisit,i=t.hackCss,s=i===void 0?!0:i,a=t.afterAppend,c=t.cache,l=t.mirror,o=l===void 0?new $e:l,u=ve(e,{doc:n,mirror:o,skipChild:!1,hackCss:s,afterAppend:a,cache:c});return Xt(o,function(d){r&&r(d),Qt(d,o)}),u}var w;(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"})(w||(w={}));var Jt=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 Kt(){return new Jt}function Zt(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[be(a[0].trim())]=a[1].trim())}}),t}function He(e){const t=[];for(const n in e){const r=e[n];if(typeof r!="string")continue;const i=rn(n);t.push(`${i}: ${r};`)}return t.join(" ")}const en=/-([a-z])/g,tn=/^--[a-zA-Z0-9-]+$/,be=e=>tn.test(e)?e:e.replace(en,(t,n)=>n?n.toUpperCase():""),nn=/\B([A-Z])/g,rn=e=>e.replace(nn,"-$1").toLowerCase();class W{constructor(...t){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=A.ELEMENT_NODE,this.TEXT_NODE=A.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 on(e){return class Bt extends e{constructor(){super(...arguments),this.nodeType=A.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=w.Document,this.textContent=null}get documentElement(){return this.childNodes.find(n=>n.RRNodeType===w.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===w.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===w.Element&&r.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(n){const r=n.RRNodeType;if((r===w.Element||r===w.DocumentType)&&this.childNodes.some(i=>i.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${r===w.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);return n.parentElement=null,n.parentNode=this,this.childNodes.push(n),n}insertBefore(n,r){const i=n.RRNodeType;if((i===w.Element||i===w.DocumentType)&&this.childNodes.some(a=>a.RRNodeType===i))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${i===w.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 Bt}createDocumentType(n,r,i){const s=new(Ye(W))(n,r,i);return s.ownerDocument=this,s}createElement(n){const r=new(ze(W))(n);return r.ownerDocument=this,r}createElementNS(n,r){return this.createElement(r)}createTextNode(n){const r=new(Xe(W))(n);return r.ownerDocument=this,r}createComment(n){const r=new(Qe(W))(n);return r.ownerDocument=this,r}createCDATASection(n){const r=new(qe(W))(n);return r.ownerDocument=this,r}toString(){return"RRDocument"}}}function Ye(e){return class extends e{constructor(t,n,r){super(),this.nodeType=A.DOCUMENT_TYPE_NODE,this.RRNodeType=w.DocumentType,this.textContent=null,this.name=t,this.publicId=n,this.systemId=r,this.nodeName=t}toString(){return"RRDocumentType"}}}function ze(e){return class extends e{constructor(t){super(),this.nodeType=A.ELEMENT_NODE,this.RRNodeType=w.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 an(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?Zt(this.attributes.style):{},n=/\B([A-Z])/g;return t.setProperty=(r,i,s)=>{if(n.test(r))return;const a=be(r);i?t[a]=i:delete t[a],s==="important"&&(t[a]+=" !important"),this.attributes.style=He(t)},t.removeProperty=r=>{if(n.test(r))return"";const i=be(r),s=t[i]||"";return delete t[i],this.attributes.style=He(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 sn(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 Xe(e){return class extends e{constructor(t){super(),this.nodeType=A.TEXT_NODE,this.nodeName="#text",this.RRNodeType=w.Text,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function Qe(e){return class extends e{constructor(t){super(),this.nodeType=A.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=w.Comment,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function qe(e){return class extends e{constructor(t){super(),this.nodeName="#cdata-section",this.nodeType=A.CDATA_SECTION_NODE,this.RRNodeType=w.CDATA,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class an{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 A;(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"})(A||(A={}));const De={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},ln={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 Y(e,t,n,r){const i=e.childNodes,s=t.childNodes;r=r||t.mirror||t.ownerDocument.mirror,(i.length>0||s.length>0)&&Je(Array.from(i),s,e,n,r);let a=null,c=null;switch(t.RRNodeType){case w.Document:{c=t.scrollData;break}case w.Element:{const l=e,o=t;switch(cn(l,o,r),c=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":{const u=t;if(u.rr_dataURL!==null){const d=document.createElement("img");d.onload=()=>{const h=l.getContext("2d");h&&h.drawImage(d,0,0,d.width,d.height)},d.src=u.rr_dataURL}u.canvasMutations.forEach(d=>n.applyCanvas(d.event,d.mutation,e))}break;case"STYLE":un(l,t.rules);break}if(o.shadowRoot){l.shadowRoot||l.attachShadow({mode:"open"});const u=l.shadowRoot.childNodes,d=o.shadowRoot.childNodes;(u.length>0||d.length>0)&&Je(Array.from(u),d,l.shadowRoot,n,r)}break}case w.Text:case w.Comment:case w.CDATA:e.textContent!==t.data&&(e.textContent=t.data);break}if(c&&n.applyScroll(c,!0),a&&n.applyInput(a),t.nodeName==="IFRAME"){const l=e.contentDocument,o=t;if(l){const u=r.getMeta(o.contentDocument);u&&n.mirror.add(l,Object.assign({},u)),Y(l,o.contentDocument,n,r)}}}function cn(e,t,n){const r=e.attributes,i=t.attributes;for(const s in i){const a=i[s],c=n.getMeta(t);if(c&&"isSVG"in c&&c.isSVG&&De[s])e.setAttributeNS(De[s],s,a);else if(t.tagName==="CANVAS"&&s==="rr_dataURL"){const l=document.createElement("img");l.src=a,l.onload=()=>{const o=e.getContext("2d");o&&o.drawImage(l,0,0,l.width,l.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 Je(e,t,n,r,i){var s;let a=0,c=e.length-1,l=0,o=t.length-1,u=e[a],d=e[c],h=t[l],f=t[o],T,v;for(;a<=c&&l<=o;){const E=r.mirror.getId(u),p=r.mirror.getId(d),y=i.getId(h),N=i.getId(f);if(u===void 0)u=e[++a];else if(d===void 0)d=e[--c];else if(E!==-1&&E===y)Y(u,h,r,i),u=e[++a],h=t[++l];else if(p!==-1&&p===N)Y(d,f,r,i),d=e[--c],f=t[--o];else if(E!==-1&&E===N)n.insertBefore(u,d.nextSibling),Y(u,f,r,i),u=e[++a],f=t[--o];else if(p!==-1&&p===y)n.insertBefore(d,u),Y(d,h,r,i),d=e[--c],h=t[++l];else{if(!T){T={};for(let D=a;D<=c;D++){const O=e[D];O&&r.mirror.hasNode(O)&&(T[r.mirror.getId(O)]=D)}}if(v=T[i.getId(h)],v){const D=e[v];n.insertBefore(D,u),Y(D,h,r,i),e[v]=void 0}else{const D=Ce(h,r.mirror,i);n.nodeName==="#document"&&((s=r.mirror.getMeta(D))===null||s===void 0?void 0:s.type)===w.Element&&n.documentElement&&(n.removeChild(n.documentElement),e[a]=void 0,u=void 0),n.insertBefore(D,u||null),Y(D,h,r,i)}h=t[++l]}}if(a>c){const E=t[o+1];let p=null;for(E&&n.childNodes.forEach(y=>{r.mirror.getId(y)===i.getId(E)&&(p=y)});l<=o;++l){const y=Ce(t[l],r.mirror,i);n.insertBefore(y,p),Y(y,t[l],r,i)}}else if(l>o)for(;a<=c;a++){const E=e[a];E&&(n.removeChild(E),r.mirror.removeNodeFromMap(E))}}function Ce(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 w.Document:s=new Document;break;case w.DocumentType:s=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case w.Element:{let a=e.tagName.toLowerCase();a=ln[a]||a,i&&"isSVG"in i&&i?.isSVG?s=document.createElementNS(De.svg,a):s=document.createElement(e.tagName);break}case w.Text:s=document.createTextNode(e.data);break;case w.Comment:s=document.createComment(e.data);break;case w.CDATA:s=document.createCDATASection(e.data);break}return i&&t.add(s,Object.assign({},i)),s}function ce(e,t){const n=e[t[0]];return t.length===1?n:ce(n.cssRules[t[1]].cssRules,t.slice(2))}var G;(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"})(G||(G={}));function Ke(e){const t=[...e],n=t.pop();return{positions:t,index:n}}function un(e,t){const n=e.sheet;t.forEach(r=>{if(r.type===G.Insert)try{if(Array.isArray(r.index)){const{positions:i,index:s}=Ke(r.index);ce(n.cssRules,i).insertRule(r.cssText,s)}else n.insertRule(r.cssText,r.index)}catch{}else if(r.type===G.Remove)try{if(Array.isArray(r.index)){const{positions:i,index:s}=Ke(r.index);ce(n.cssRules,i).deleteRule(s||0)}else n.deleteRule(r.index)}catch{}else r.type===G.SetProperty?ce(n.cssRules,r.index).style.setProperty(r.property,r.value,r.priority):r.type===G.RemoveProperty&&ce(n.cssRules,r.index).style.removeProperty(r.property)})}class ie extends on(W){constructor(t){super(),this._unserializedId=-1,this.mirror=Nn(),this.scrollData=null,t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,n,r){return new ie}createDocumentType(t,n,r){const i=new dn(t,n,r);return i.ownerDocument=this,i}createElement(t){const n=t.toUpperCase();let r;switch(n){case"AUDIO":case"VIDEO":r=new hn(n);break;case"IFRAME":r=new fn(n,this.mirror);break;case"CANVAS":r=new mn(n);break;case"STYLE":r=new pn(n);break;default:r=new ue(n);break}return r.ownerDocument=this,r}createComment(t){const n=new gn(t);return n.ownerDocument=this,n}createCDATASection(t){const n=new yn(t);return n.ownerDocument=this,n}createTextNode(t){const n=new vn(t);return n.ownerDocument=this,n}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=-1}}const dn=Ye(W);class ue extends ze(W){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class hn extends sn(ue){}class mn extends ue{constructor(){super(...arguments),this.rr_dataURL=null,this.canvasMutations=[]}getContext(){return null}}class pn extends ue{constructor(){super(...arguments),this.rules=[]}}class fn extends ue{constructor(t,n){super(t),this.contentDocument=new ie,this.contentDocument.mirror=n}}const vn=Xe(W),gn=Qe(W),yn=qe(W);function Tn(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function Ze(e,t,n,r){let i;switch(e.nodeType){case A.DOCUMENT_NODE:r&&r.nodeName==="IFRAME"?i=r.contentDocument:(i=t,i.compatMode=e.compatMode);break;case A.DOCUMENT_TYPE_NODE:{const a=e;i=t.createDocumentType(a.name,a.publicId,a.systemId);break}case A.ELEMENT_NODE:{const a=e,c=Tn(a);i=t.createElement(c);const l=i;for(const{name:o,value:u}of Array.from(a.attributes))l.attributes[o]=u;a.scrollLeft&&(l.scrollLeft=a.scrollLeft),a.scrollTop&&(l.scrollTop=a.scrollTop);break}case A.TEXT_NODE:i=t.createTextNode(e.textContent||"");break;case A.CDATA_SECTION_NODE:i=t.createCDATASection(e.data);break;case A.COMMENT_NODE:i=t.createComment(e.textContent||"");break;case A.DOCUMENT_FRAGMENT_NODE:i=r.attachShadow({mode:"open"});break;default:return null}let s=n.getMeta(e);return t instanceof ie&&(s||(s=et(i,t.unserializedId),n.add(e,s)),t.mirror.add(i,Object.assign({},s))),i}function En(e,t=Kt(),n=new ie){function r(i,s){const a=Ze(i,n,t,s);a!==null&&(s?.nodeName!=="IFRAME"&&i.nodeType!==A.DOCUMENT_FRAGMENT_NODE&&(s?.appendChild(a),a.parentNode=s,a.parentElement=s),i.nodeName==="IFRAME"?r(i.contentDocument,a):(i.nodeType===A.DOCUMENT_NODE||i.nodeType===A.ELEMENT_NODE||i.nodeType===A.DOCUMENT_FRAGMENT_NODE)&&(i.nodeType===A.ELEMENT_NODE&&i.shadowRoot&&r(i.shadowRoot,a),i.childNodes.forEach(c=>r(c,a))))}return r(e,null),n}function Nn(){return new wn}class wn{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 et(e,t){switch(e.RRNodeType){case w.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case w.DocumentType:{const n=e;return{id:t,type:e.RRNodeType,name:n.name,publicId:n.publicId,systemId:n.systemId}}case w.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case w.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case w.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case w.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}function tt(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(i){i(n)}),(r=e.get("*"))&&r.slice().map(function(i){i(t,n)})}}}var bn=Object.freeze({__proto__:null,default:tt});function Dn(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||l,scrollIntoView:n.prototype.scrollIntoView},s=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function a(p){const y=["MSIE ","Trident/","Edge/"];return new RegExp(y.join("|")).test(p)}const c=a(e.navigator.userAgent)?1:0;function l(p,y){this.scrollLeft=p,this.scrollTop=y}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,y){if(y==="Y")return p.clientHeight+c<p.scrollHeight;if(y==="X")return p.clientWidth+c<p.scrollWidth}function h(p,y){const N=e.getComputedStyle(p,null)["overflow"+y];return N==="auto"||N==="scroll"}function f(p){const y=d(p,"Y")&&h(p,"Y"),N=d(p,"X")&&h(p,"X");return y||N}function T(p){for(;p!==t.body&&f(p)===!1;)p=p.parentNode||p.host;return p}function v(p){const y=s();let N,D,O,R=(y-p.startTime)/r;R=R>1?1:R,N=o(R),D=p.startX+(p.x-p.startX)*N,O=p.startY+(p.y-p.startY)*N,p.method.call(p.scrollable,D,O),(D!==p.x||O!==p.y)&&e.requestAnimationFrame(v.bind(e,p))}function E(p,y,N){let D,O,R,$;const k=s();p===t.body?(D=e,O=e.scrollX||e.pageXOffset,R=e.scrollY||e.pageYOffset,$=i.scroll):(D=p,O=p.scrollLeft,R=p.scrollTop,$=l),v({scrollable:D,method:$,startTime:k,startX:O,startY:R,x:y,y:N})}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}E.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}E.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,y=arguments[0].top;E.call(this,this,typeof p>"u"?this.scrollLeft:~~p,typeof y>"u"?this.scrollTop:~~y)},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),y=p.getBoundingClientRect(),N=this.getBoundingClientRect();p!==t.body?(E.call(this,p,p.scrollLeft+N.left-y.left,p.scrollTop+N.top-y.top),e.getComputedStyle(p).position!=="fixed"&&e.scrollBy({left:y.left,top:y.top,behavior:"smooth"})):e.scrollBy({left:N.left,top:N.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||{}),I=(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))(I||{}),U=(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))(U||{}),ge=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ge||{}),Me=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(Me||{}),C=(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))(C||{});class Cn{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=()=>{const i=performance.now();for(this.timeOffset+=(i-t)*this.speed,t=i;n.length;){const s=n[0];if(this.timeOffset>=s.delay)n.shift(),s.doAction();else break}(n.length>0||this.liveMode)&&(this.raf=requestAnimationFrame(r))};this.raf=requestAnimationFrame(r)}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 xe(e,t){if(e.type===S.IncrementalSnapshot&&e.data.source===I.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 c=[];function l(g){var m=new Error("".concat(t.source||"",":").concat(n,":").concat(r,": ").concat(g));if(m.reason=g,m.filename=t.source,m.line=n,m.column=r,m.source=e,t.silent)c.push(m);else throw m}function o(){var g=h();return{type:"stylesheet",stylesheet:{source:t.source,rules:g,parsingErrors:c}}}function u(){return f(/^{\s*/)}function d(){return f(/^}/)}function h(){var g,m=[];for(T(),v(m);e.length&&e.charAt(0)!=="}"&&(g=_()||re());)g!==!1&&(m.push(g),v(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 v(g){g===void 0&&(g=[]);for(var m;m=E();)m!==!1&&g.push(m),m=E();return g}function E(){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 l("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 X(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 y(){var g=s(),m=f(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(m){var b=X(m[0]);if(!f(/^:\s*/))return l("property missing ':'");var x=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),P=g({type:"declaration",property:b.replace(Be,""),value:x?X(x[0]).replace(Be,""):""});return f(/^[;\s]*/),P}}function N(){var g=[];if(!u())return l("missing '{'");v(g);for(var m;m=y();)m!==!1&&(g.push(m),v(g)),m=y();return d()?g:l("missing '}'")}function D(){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:N()})}function O(){var g=s(),m=f(/^@([-\w]+)?keyframes\s*/);if(m){var b=m[1];if(m=f(/^([-\w]+)\s*/),!m)return l("@keyframes missing name");var x=m[1];if(!u())return l("@keyframes missing '{'");for(var P,ee=v();P=D();)ee.push(P),ee=ee.concat(v());return d()?g({type:"keyframes",name:x,vendor:b,keyframes:ee}):l("@keyframes missing '}'")}}function R(){var g=s(),m=f(/^@supports *([^{]+)/);if(m){var b=X(m[1]);if(!u())return l("@supports missing '{'");var x=v().concat(h());return d()?g({type:"supports",supports:b,rules:x}):l("@supports missing '}'")}}function $(){var g=s(),m=f(/^@host\s*/);if(m){if(!u())return l("@host missing '{'");var b=v().concat(h());return d()?g({type:"host",rules:b}):l("@host missing '}'")}}function k(){var g=s(),m=f(/^@media *([^{]+)/);if(m){var b=X(m[1]);if(!u())return l("@media missing '{'");var x=v().concat(h());return d()?g({type:"media",media:b,rules:x}):l("@media missing '}'")}}function F(){var g=s(),m=f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(m)return g({type:"custom-media",name:X(m[1]),media:X(m[2])})}function ne(){var g=s(),m=f(/^@page */);if(m){var b=p()||[];if(!u())return l("@page missing '{'");for(var x=v(),P;P=y();)x.push(P),x=x.concat(v());return d()?g({type:"page",selectors:b,declarations:x}):l("@page missing '}'")}}function z(){var g=s(),m=f(/^@([-\w]+)?document *([^{]+)/);if(m){var b=X(m[1]),x=X(m[2]);if(!u())return l("@document missing '{'");var P=v().concat(h());return d()?g({type:"document",document:x,vendor:b,rules:P}):l("@document missing '}'")}}function K(){var g=s(),m=f(/^@font-face\s*/);if(m){if(!u())return l("@font-face missing '{'");for(var b=v(),x;x=y();)b.push(x),b=b.concat(v());return d()?g({type:"font-face",declarations:b}):l("@font-face missing '}'")}}var H=B("import"),Z=B("charset"),le=B("namespace");function B(g){var m=new RegExp("^@"+g+"\\s*([^;]+);");return function(){var b=s(),x=f(m);if(x){var P={type:g};return P[g]=x[1].trim(),b(P)}}}function _(){if(e[0]==="@")return O()||k()||F()||R()||H()||Z()||le()||z()||ne()||$()||K()}function re(){var g=s(),m=p();return m?(v(),g({type:"rule",selectors:m,declarations:N()})):l("selector missing")}return we(o())}function X(e){return e?e.replace(/^\s+|\s+$/g,""):""}function we(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],c=e[a];Array.isArray(c)?c.forEach(function(l){we(l,r)}):c&&typeof c=="object"&&we(c,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Ve={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 jt(e){var t=Ve[e.tagName]?Ve[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function Ht(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var We=/([^\\]):hover/,Yt=new RegExp(We.source,"g");function Ge(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=Gt(e,{silent:!0});if(!i.stylesheet)return e;var s=[];if(i.stylesheet.rules.forEach(function(l){"selectors"in l&&(l.selectors||[]).forEach(function(o){We.test(o)&&s.push(o)})}),s.length===0)return e;var a=new RegExp(s.filter(function(l,o){return s.indexOf(l)===o}).sort(function(l,o){return o.length-l.length}).map(function(l){return Ht(l)}).join("|"),"g"),c=e.replace(a,function(l){var o=l.replace(Yt,"$1.\\:hover");return"".concat(l,", ").concat(o)});return t?.stylesWithHoverClass.set(e,c),c}function je(){var e=new Map;return{stylesWithHoverClass:e}}function zt(e,t){var n=t.doc,r=t.hackCss,i=t.cache;switch(e.type){case L.Document:return n.implementation.createDocument(null,"",null);case L.DocumentType:return n.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case L.Element:{var s=jt(e),a;e.isSVG?a=n.createElementNS("http://www.w3.org/2000/svg",s):a=n.createElement(s);var c=function(d){if(!Object.prototype.hasOwnProperty.call(e.attributes,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.onload=function(){var F=a.getContext("2d");F&&F.drawImage(f,0,0,f.width,f.height)},f.src=h,a.RRNodeType&&(a.rr_dataURL=h)}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(F){return console.warn("media playback error",F)});break;case"paused":a.pause();break}}else{var v=s==="textarea"&&d==="value",E=s==="style"&&d==="_cssText";if(E&&r&&(h=Ge(h,i),typeof h=="string")){for(var p=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,y=void 0,N=[],D="https://replay-cors-proxy.highlightrun.workers.dev";(y=p.exec(h))!==null;)y.index===p.lastIndex&&p.lastIndex++,y.forEach(function(F,ne){if(ne===0){var z=F.slice(5,F.length-2);N.push({originalUrl:z,proxyUrl:z.replace(z,"".concat(D,"?url=").concat(z))})}});N.forEach(function(F){h=h.replace(F.originalUrl,F.proxyUrl)})}if(v||E){for(var O=n.createTextNode(h),R=0,$=Array.from(a.childNodes);R<$.length;R++){var k=$[R];k.nodeType===a.TEXT_NODE&&a.removeChild(k)}return a.appendChild(O),"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 l in e.attributes)c(l);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 L.Text:return n.createTextNode(e.isStyle&&r?Ge(e.textContent,i):e.textContent);case L.CDATA:return n.createCDATASection(e.textContent);case L.Comment:return n.createComment(e.textContent);default:return null}}function ve(e,t){var n=t.doc,r=t.mirror,i=t.skipChild,s=i===void 0?!1:i,a=t.hackCss,c=a===void 0?!0:a,l=t.afterAppend,o=t.cache,u=zt(e,{doc:n,hackCss:c,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===L.Document&&(n.close(),n.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==L.DocumentType&&(e.childNodes[0].type===L.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===L.Document||e.type===L.Element)&&!s)for(var d=0,h=e.childNodes;d<h.length;d++){var f=h[d],T=ve(f,{doc:n,mirror:r,skipChild:!1,hackCss:c,afterAppend:l,cache:o});if(!T){console.warn("Failed to rebuild",f);continue}f.isShadow&&Vt(u)&&u.shadowRoot?u.shadowRoot.appendChild(T):u.appendChild(T),l&&l(T)}return u}function Xt(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 Qt(e,t){var n=t.getMeta(e);if(n?.type===L.Element){var r=e;for(var i in n.attributes)if(Object.prototype.hasOwnProperty.call(n.attributes,i)&&i.startsWith("rr_")){var s=n.attributes[i];i==="rr_scrollLeft"&&(r.scrollLeft=s),i==="rr_scrollTop"&&(r.scrollTop=s)}}}function qt(e,t){var n=t.doc,r=t.onVisit,i=t.hackCss,s=i===void 0?!0:i,a=t.afterAppend,c=t.cache,l=t.mirror,o=l===void 0?new $e:l,u=ve(e,{doc:n,mirror:o,skipChild:!1,hackCss:s,afterAppend:a,cache:c});return Xt(o,function(d){r&&r(d),Qt(d,o)}),u}var w;(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"})(w||(w={}));var Jt=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 Kt(){return new Jt}function Zt(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[be(a[0].trim())]=a[1].trim())}}),t}function He(e){const t=[];for(const n in e){const r=e[n];if(typeof r!="string")continue;const i=rn(n);t.push(`${i}: ${r};`)}return t.join(" ")}const en=/-([a-z])/g,tn=/^--[a-zA-Z0-9-]+$/,be=e=>tn.test(e)?e:e.replace(en,(t,n)=>n?n.toUpperCase():""),nn=/\B([A-Z])/g,rn=e=>e.replace(nn,"-$1").toLowerCase();class W{constructor(...t){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=A.ELEMENT_NODE,this.TEXT_NODE=A.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 on(e){return class Bt extends e{constructor(){super(...arguments),this.nodeType=A.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=w.Document,this.textContent=null}get documentElement(){return this.childNodes.find(n=>n.RRNodeType===w.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===w.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===w.Element&&r.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(n){const r=n.RRNodeType;if((r===w.Element||r===w.DocumentType)&&this.childNodes.some(i=>i.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${r===w.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);return n.parentElement=null,n.parentNode=this,this.childNodes.push(n),n}insertBefore(n,r){const i=n.RRNodeType;if((i===w.Element||i===w.DocumentType)&&this.childNodes.some(a=>a.RRNodeType===i))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${i===w.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 Bt}createDocumentType(n,r,i){const s=new(Ye(W))(n,r,i);return s.ownerDocument=this,s}createElement(n){const r=new(ze(W))(n);return r.ownerDocument=this,r}createElementNS(n,r){return this.createElement(r)}createTextNode(n){const r=new(Xe(W))(n);return r.ownerDocument=this,r}createComment(n){const r=new(Qe(W))(n);return r.ownerDocument=this,r}createCDATASection(n){const r=new(qe(W))(n);return r.ownerDocument=this,r}toString(){return"RRDocument"}}}function Ye(e){return class extends e{constructor(t,n,r){super(),this.nodeType=A.DOCUMENT_TYPE_NODE,this.RRNodeType=w.DocumentType,this.textContent=null,this.name=t,this.publicId=n,this.systemId=r,this.nodeName=t}toString(){return"RRDocumentType"}}}function ze(e){return class extends e{constructor(t){super(),this.nodeType=A.ELEMENT_NODE,this.RRNodeType=w.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 an(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?Zt(this.attributes.style):{},n=/\B([A-Z])/g;return t.setProperty=(r,i,s)=>{if(n.test(r))return;const a=be(r);i?t[a]=i:delete t[a],s==="important"&&(t[a]+=" !important"),this.attributes.style=He(t)},t.removeProperty=r=>{if(n.test(r))return"";const i=be(r),s=t[i]||"";return delete t[i],this.attributes.style=He(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 sn(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 Xe(e){return class extends e{constructor(t){super(),this.nodeType=A.TEXT_NODE,this.nodeName="#text",this.RRNodeType=w.Text,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function Qe(e){return class extends e{constructor(t){super(),this.nodeType=A.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=w.Comment,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function qe(e){return class extends e{constructor(t){super(),this.nodeName="#cdata-section",this.nodeType=A.CDATA_SECTION_NODE,this.RRNodeType=w.CDATA,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class an{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 A;(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"})(A||(A={}));const De={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},ln={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 Y(e,t,n,r){const i=e.childNodes,s=t.childNodes;r=r||t.mirror||t.ownerDocument.mirror,(i.length>0||s.length>0)&&Je(Array.from(i),s,e,n,r);let a=null,c=null;switch(t.RRNodeType){case w.Document:{c=t.scrollData;break}case w.Element:{const l=e,o=t;switch(cn(l,o,r),c=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":{const u=t;if(u.rr_dataURL!==null){const d=document.createElement("img");d.onload=()=>{const h=l.getContext("2d");h&&h.drawImage(d,0,0,d.width,d.height)},d.src=u.rr_dataURL}u.canvasMutations.forEach(d=>n.applyCanvas(d.event,d.mutation,e))}break;case"STYLE":un(l,t.rules);break}if(o.shadowRoot){l.shadowRoot||l.attachShadow({mode:"open"});const u=l.shadowRoot.childNodes,d=o.shadowRoot.childNodes;(u.length>0||d.length>0)&&Je(Array.from(u),d,l.shadowRoot,n,r)}break}case w.Text:case w.Comment:case w.CDATA:e.textContent!==t.data&&(e.textContent=t.data);break}if(c&&n.applyScroll(c,!0),a&&n.applyInput(a),t.nodeName==="IFRAME"){const l=e.contentDocument,o=t;if(l){const u=r.getMeta(o.contentDocument);u&&n.mirror.add(l,Object.assign({},u)),Y(l,o.contentDocument,n,r)}}}function cn(e,t,n){const r=e.attributes,i=t.attributes;for(const s in i){const a=i[s],c=n.getMeta(t);if(c&&"isSVG"in c&&c.isSVG&&De[s])e.setAttributeNS(De[s],s,a);else if(t.tagName==="CANVAS"&&s==="rr_dataURL"){const l=document.createElement("img");l.src=a,l.onload=()=>{const o=e.getContext("2d");o&&o.drawImage(l,0,0,l.width,l.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 Je(e,t,n,r,i){var s;let a=0,c=e.length-1,l=0,o=t.length-1,u=e[a],d=e[c],h=t[l],f=t[o],T,v;for(;a<=c&&l<=o;){const E=r.mirror.getId(u),p=r.mirror.getId(d),y=i.getId(h),N=i.getId(f);if(u===void 0)u=e[++a];else if(d===void 0)d=e[--c];else if(E!==-1&&E===y)Y(u,h,r,i),u=e[++a],h=t[++l];else if(p!==-1&&p===N)Y(d,f,r,i),d=e[--c],f=t[--o];else if(E!==-1&&E===N)n.insertBefore(u,d.nextSibling),Y(u,f,r,i),u=e[++a],f=t[--o];else if(p!==-1&&p===y)n.insertBefore(d,u),Y(d,h,r,i),d=e[--c],h=t[++l];else{if(!T){T={};for(let D=a;D<=c;D++){const O=e[D];O&&r.mirror.hasNode(O)&&(T[r.mirror.getId(O)]=D)}}if(v=T[i.getId(h)],v){const D=e[v];n.insertBefore(D,u),Y(D,h,r,i),e[v]=void 0}else{const D=Me(h,r.mirror,i);n.nodeName==="#document"&&((s=r.mirror.getMeta(D))===null||s===void 0?void 0:s.type)===w.Element&&n.documentElement&&(n.removeChild(n.documentElement),e[a]=void 0,u=void 0),n.insertBefore(D,u||null),Y(D,h,r,i)}h=t[++l]}}if(a>c){const E=t[o+1];let p=null;for(E&&n.childNodes.forEach(y=>{r.mirror.getId(y)===i.getId(E)&&(p=y)});l<=o;++l){const y=Me(t[l],r.mirror,i);n.insertBefore(y,p),Y(y,t[l],r,i)}}else if(l>o)for(;a<=c;a++){const E=e[a];E&&(n.removeChild(E),r.mirror.removeNodeFromMap(E))}}function Me(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 w.Document:s=new Document;break;case w.DocumentType:s=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case w.Element:{let a=e.tagName.toLowerCase();a=ln[a]||a,i&&"isSVG"in i&&i?.isSVG?s=document.createElementNS(De.svg,a):s=document.createElement(e.tagName);break}case w.Text:s=document.createTextNode(e.data);break;case w.Comment:s=document.createComment(e.data);break;case w.CDATA:s=document.createCDATASection(e.data);break}return i&&t.add(s,Object.assign({},i)),s}function ce(e,t){const n=e[t[0]];return t.length===1?n:ce(n.cssRules[t[1]].cssRules,t.slice(2))}var G;(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"})(G||(G={}));function Ke(e){const t=[...e],n=t.pop();return{positions:t,index:n}}function un(e,t){const n=e.sheet;t.forEach(r=>{if(r.type===G.Insert)try{if(Array.isArray(r.index)){const{positions:i,index:s}=Ke(r.index);ce(n.cssRules,i).insertRule(r.cssText,s)}else n.insertRule(r.cssText,r.index)}catch{}else if(r.type===G.Remove)try{if(Array.isArray(r.index)){const{positions:i,index:s}=Ke(r.index);ce(n.cssRules,i).deleteRule(s||0)}else n.deleteRule(r.index)}catch{}else r.type===G.SetProperty?ce(n.cssRules,r.index).style.setProperty(r.property,r.value,r.priority):r.type===G.RemoveProperty&&ce(n.cssRules,r.index).style.removeProperty(r.property)})}class ie extends on(W){constructor(t){super(),this._unserializedId=-1,this.mirror=Nn(),this.scrollData=null,t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,n,r){return new ie}createDocumentType(t,n,r){const i=new dn(t,n,r);return i.ownerDocument=this,i}createElement(t){const n=t.toUpperCase();let r;switch(n){case"AUDIO":case"VIDEO":r=new hn(n);break;case"IFRAME":r=new fn(n,this.mirror);break;case"CANVAS":r=new mn(n);break;case"STYLE":r=new pn(n);break;default:r=new ue(n);break}return r.ownerDocument=this,r}createComment(t){const n=new gn(t);return n.ownerDocument=this,n}createCDATASection(t){const n=new yn(t);return n.ownerDocument=this,n}createTextNode(t){const n=new vn(t);return n.ownerDocument=this,n}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=-1}}const dn=Ye(W);class ue extends ze(W){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class hn extends sn(ue){}class mn extends ue{constructor(){super(...arguments),this.rr_dataURL=null,this.canvasMutations=[]}getContext(){return null}}class pn extends ue{constructor(){super(...arguments),this.rules=[]}}class fn extends ue{constructor(t,n){super(t),this.contentDocument=new ie,this.contentDocument.mirror=n}}const vn=Xe(W),gn=Qe(W),yn=qe(W);function Tn(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function Ze(e,t,n,r){let i;switch(e.nodeType){case A.DOCUMENT_NODE:r&&r.nodeName==="IFRAME"?i=r.contentDocument:(i=t,i.compatMode=e.compatMode);break;case A.DOCUMENT_TYPE_NODE:{const a=e;i=t.createDocumentType(a.name,a.publicId,a.systemId);break}case A.ELEMENT_NODE:{const a=e,c=Tn(a);i=t.createElement(c);const l=i;for(const{name:o,value:u}of Array.from(a.attributes))l.attributes[o]=u;a.scrollLeft&&(l.scrollLeft=a.scrollLeft),a.scrollTop&&(l.scrollTop=a.scrollTop);break}case A.TEXT_NODE:i=t.createTextNode(e.textContent||"");break;case A.CDATA_SECTION_NODE:i=t.createCDATASection(e.data);break;case A.COMMENT_NODE:i=t.createComment(e.textContent||"");break;case A.DOCUMENT_FRAGMENT_NODE:i=r.attachShadow({mode:"open"});break;default:return null}let s=n.getMeta(e);return t instanceof ie&&(s||(s=et(i,t.unserializedId),n.add(e,s)),t.mirror.add(i,Object.assign({},s))),i}function En(e,t=Kt(),n=new ie){function r(i,s){const a=Ze(i,n,t,s);a!==null&&(s?.nodeName!=="IFRAME"&&i.nodeType!==A.DOCUMENT_FRAGMENT_NODE&&(s?.appendChild(a),a.parentNode=s,a.parentElement=s),i.nodeName==="IFRAME"?r(i.contentDocument,a):(i.nodeType===A.DOCUMENT_NODE||i.nodeType===A.ELEMENT_NODE||i.nodeType===A.DOCUMENT_FRAGMENT_NODE)&&(i.nodeType===A.ELEMENT_NODE&&i.shadowRoot&&r(i.shadowRoot,a),i.childNodes.forEach(c=>r(c,a))))}return r(e,null),n}function Nn(){return new wn}class wn{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 et(e,t){switch(e.RRNodeType){case w.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case w.DocumentType:{const n=e;return{id:t,type:e.RRNodeType,name:n.name,publicId:n.publicId,systemId:n.systemId}}case w.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case w.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case w.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case w.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}function tt(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(i){i(n)}),(r=e.get("*"))&&r.slice().map(function(i){i(t,n)})}}}var bn=Object.freeze({__proto__:null,default:tt});function Dn(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||l,scrollIntoView:n.prototype.scrollIntoView},s=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function a(p){const y=["MSIE ","Trident/","Edge/"];return new RegExp(y.join("|")).test(p)}const c=a(e.navigator.userAgent)?1:0;function l(p,y){this.scrollLeft=p,this.scrollTop=y}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,y){if(y==="Y")return p.clientHeight+c<p.scrollHeight;if(y==="X")return p.clientWidth+c<p.scrollWidth}function h(p,y){const N=e.getComputedStyle(p,null)["overflow"+y];return N==="auto"||N==="scroll"}function f(p){const y=d(p,"Y")&&h(p,"Y"),N=d(p,"X")&&h(p,"X");return y||N}function T(p){for(;p!==t.body&&f(p)===!1;)p=p.parentNode||p.host;return p}function v(p){const y=s();let N,D,O,R=(y-p.startTime)/r;R=R>1?1:R,N=o(R),D=p.startX+(p.x-p.startX)*N,O=p.startY+(p.y-p.startY)*N,p.method.call(p.scrollable,D,O),(D!==p.x||O!==p.y)&&e.requestAnimationFrame(v.bind(e,p))}function E(p,y,N){let D,O,R,$;const k=s();p===t.body?(D=e,O=e.scrollX||e.pageXOffset,R=e.scrollY||e.pageYOffset,$=i.scroll):(D=p,O=p.scrollLeft,R=p.scrollTop,$=l),v({scrollable:D,method:$,startTime:k,startX:O,startY:R,x:y,y:N})}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}E.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}E.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,y=arguments[0].top;E.call(this,this,typeof p>"u"?this.scrollLeft:~~p,typeof y>"u"?this.scrollTop:~~y)},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),y=p.getBoundingClientRect(),N=this.getBoundingClientRect();p!==t.body?(E.call(this,p,p.scrollLeft+N.left-y.left,p.scrollTop+N.top-y.top),e.getComputedStyle(p).position!=="fixed"&&e.scrollBy({left:y.left,top:y.top,behavior:"smooth"})):e.scrollBy({left:N.left,top:N.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||{}),I=(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))(I||{}),U=(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))(U||{}),ge=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ge||{}),xe=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(xe||{}),M=(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))(M||{});class Mn{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=()=>{const i=performance.now();for(this.timeOffset+=(i-t)*this.speed,t=i;n.length;){const s=n[0];if(this.timeOffset>=s.delay)n.shift(),s.doAction();else break}(n.length>0||this.liveMode)&&(this.raf=requestAnimationFrame(r))};this.raf=requestAnimationFrame(r)}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 Ce(e,t){if(e.type===S.IncrementalSnapshot&&e.data.source===I.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,6 +12,6 @@ var rrwebReplay=function(fe){"use strict";var L;(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 nt(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(c){i={error:c}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return a}var oe;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(oe||(oe={}));var rt={type:"xstate.init"};function Se(e){return e===void 0?[]:[].concat(e)}function te(e){return{type:"xstate.assign",assignment:e}}function it(e,t){return typeof(e=typeof e=="string"&&t&&t[e]?t[e]:e)=="string"?{type:e}:typeof e=="function"?{type:e.name,exec:e}:e}function ye(e){return function(t){return e===t}}function ot(e){return typeof e=="string"?{type:e}:e}function st(e,t){return{value:e,context:t,actions:[],changed:!1,matches:ye(e)}}function at(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(c){a[c]=typeof s.assignment[c]=="function"?s.assignment[c](r,n):s.assignment[c]}),r=a,!1}return!0}),r,i]}function lt(e,t){t===void 0&&(t={});var n=nt(at(Se(e.states[e.initial].entry).map(function(a){return it(a,t.actions)}),e.context,rt),2),r=n[0],i=n[1],s={config:e,_options:t,initialState:{value:e.initial,actions:r,context:i,matches:ye(e.initial)},transition:function(a,c){var l,o,u=typeof a=="string"?{value:a,context:e.context}:a,d=u.value,h=u.context,f=ot(c),T=e.states[d];if(T.on){var v=Se(T.on[f.type]);try{for(var E=function(_){var re=typeof Symbol=="function"&&Symbol.iterator,g=re&&_[re],m=0;if(g)return g.call(_);if(_&&typeof _.length=="number")return{next:function(){return _&&m>=_.length&&(_=void 0),{value:_&&_[m++],done:!_}}};throw new TypeError(re?"Object is not iterable.":"Symbol.iterator is not defined.")}(v),p=E.next();!p.done;p=E.next()){var y=p.value;if(y===void 0)return st(d,h);var N=typeof y=="string"?{target:y}:y,D=N.target,O=N.actions,R=O===void 0?[]:O,$=N.cond,k=$===void 0?function(){return!0}:$,F=D===void 0,ne=D??d,z=e.states[ne];if(k(h,f)){var K=nt(at((F?Se(R):[].concat(T.exit,R,z.entry).filter(function(_){return _})).map(function(_){return it(_,s._options.actions)}),h,f),3),H=K[0],Z=K[1],le=K[2],B=D??d;return{value:B,context:Z,actions:H,changed:D!==d||H.length>0||le,matches:ye(B)}}}}catch(_){l={error:_}}finally{try{p&&!p.done&&(o=E.return)&&o.call(E)}finally{if(l)throw l.error}}}return st(d,h)}};return s}var ct=function(e,t){return e.actions.forEach(function(n){var r=n.exec;return r&&r(e.context,t)})};function ut(e){var t=e.initialState,n=oe.NotStarted,r=new Set,i={_machine:e,send:function(s){n===oe.Running&&(t=e.transition(t,s),ct(t,ot(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:ye(a.value)}}return n=oe.Running,ct(t,rt),i},stop:function(){return n=oe.Stopped,r.clear(),i},get state(){return t},get status(){return n}};return i}var
|
|
15
|
+
***************************************************************************** */function nt(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(c){i={error:c}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return a}var oe;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(oe||(oe={}));var rt={type:"xstate.init"};function Se(e){return e===void 0?[]:[].concat(e)}function te(e){return{type:"xstate.assign",assignment:e}}function it(e,t){return typeof(e=typeof e=="string"&&t&&t[e]?t[e]:e)=="string"?{type:e}:typeof e=="function"?{type:e.name,exec:e}:e}function ye(e){return function(t){return e===t}}function ot(e){return typeof e=="string"?{type:e}:e}function st(e,t){return{value:e,context:t,actions:[],changed:!1,matches:ye(e)}}function at(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(c){a[c]=typeof s.assignment[c]=="function"?s.assignment[c](r,n):s.assignment[c]}),r=a,!1}return!0}),r,i]}function lt(e,t){t===void 0&&(t={});var n=nt(at(Se(e.states[e.initial].entry).map(function(a){return it(a,t.actions)}),e.context,rt),2),r=n[0],i=n[1],s={config:e,_options:t,initialState:{value:e.initial,actions:r,context:i,matches:ye(e.initial)},transition:function(a,c){var l,o,u=typeof a=="string"?{value:a,context:e.context}:a,d=u.value,h=u.context,f=ot(c),T=e.states[d];if(T.on){var v=Se(T.on[f.type]);try{for(var E=function(_){var re=typeof Symbol=="function"&&Symbol.iterator,g=re&&_[re],m=0;if(g)return g.call(_);if(_&&typeof _.length=="number")return{next:function(){return _&&m>=_.length&&(_=void 0),{value:_&&_[m++],done:!_}}};throw new TypeError(re?"Object is not iterable.":"Symbol.iterator is not defined.")}(v),p=E.next();!p.done;p=E.next()){var y=p.value;if(y===void 0)return st(d,h);var N=typeof y=="string"?{target:y}:y,D=N.target,O=N.actions,R=O===void 0?[]:O,$=N.cond,k=$===void 0?function(){return!0}:$,F=D===void 0,ne=D??d,z=e.states[ne];if(k(h,f)){var K=nt(at((F?Se(R):[].concat(T.exit,R,z.entry).filter(function(_){return _})).map(function(_){return it(_,s._options.actions)}),h,f),3),H=K[0],Z=K[1],le=K[2],B=D??d;return{value:B,context:Z,actions:H,changed:D!==d||H.length>0||le,matches:ye(B)}}}}catch(_){l={error:_}}finally{try{p&&!p.done&&(o=E.return)&&o.call(E)}finally{if(l)throw l.error}}}return st(d,h)}};return s}var ct=function(e,t){return e.actions.forEach(function(n){var r=n.exec;return r&&r(e.context,t)})};function ut(e){var t=e.initialState,n=oe.NotStarted,r=new Set,i={_machine:e,send:function(s){n===oe.Running&&(t=e.transition(t,s),ct(t,ot(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:ye(a.value)}}return n=oe.Running,ct(t,rt),i},stop:function(){return n=oe.Stopped,r.clear(),i},get state(){return t},get status(){return n}};return i}var xn=Object.defineProperty,Cn=Object.defineProperties,Sn=Object.getOwnPropertyDescriptors,dt=Object.getOwnPropertySymbols,Rn=Object.prototype.hasOwnProperty,An=Object.prototype.propertyIsEnumerable,ht=(e,t,n)=>t in e?xn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Te=(e,t)=>{for(var n in t||(t={}))Rn.call(t,n)&&ht(e,n,t[n]);if(dt)for(var n of dt(t))An.call(t,n)&&ht(e,n,t[n]);return e},Ee=(e,t)=>Cn(e,Sn(t));function In(e,t){for(let n=e.length-1;n>=0;n--){const r=e[n];if(r.type===S.Meta&&r.timestamp<=t)return e.slice(n)}return e}function On(e,{getCastFn:t,applyEventsSynchronously:n,emitter:r}){const i=lt({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:te({lastPlayedEvent:(s,a)=>a.type==="CAST_EVENT"?a.payload.event:s.lastPlayedEvent}),recordTimeOffset:te((s,a)=>{let c=s.timeOffset;return"payload"in a&&"timeOffset"in a.payload&&(c=a.payload.timeOffset),Ee(Te({},s),{timeOffset:c,baselineTime:s.events[0].timestamp+c})}),play(s){var a;const{timer:c,events:l,baselineTime:o,lastPlayedEvent:u}=s;c.clear();for(const v of l)Ce(v,o);const d=In(l,o);let h=u?.timestamp;u?.type===S.IncrementalSnapshot&&u.data.source===I.MouseMove&&(h=u.timestamp+((a=u.data.positions[0])==null?void 0:a.timeOffset)),o<(h||0)&&r.emit(M.PlayBack);const f=new Array,T=new Array;for(const v of d)if(!(h&&h<o&&(v.timestamp<=h||v===u)))if(v.timestamp<o)f.push(v);else{const E=t(v,!1);T.push({doAction:()=>{E()},delay:v.delay})}n(f),r.emit(M.Flush),c.addActions(T),c.start()},pause(s){s.timer.clear()},resetLastPlayedEvent:te(s=>Ee(Te({},s),{lastPlayedEvent:null})),startLive:te({baselineTime:(s,a)=>(s.timer.toggleLiveMode(!0),s.timer.start(),a.type==="TO_LIVE"&&a.payload.baselineTime?a.payload.baselineTime:Date.now())}),replaceEvents:te((s,a)=>{const{events:c,timer:l,baselineTime:o}=s;if(a.type==="REPLACE_EVENTS"){const{events:u}=a.payload;c.length=0;const d=[];for(const h of u)if(Ce(h,o),c.push(h),h.timestamp>=l.timeOffset+o){const f=t(h,!1);d.push({doAction:()=>{f()},delay:h.delay})}l.isActive()&&l.replaceActions(d)}return Ee(Te({},s),{events:c})}),addEvent:te((s,a)=>{const{baselineTime:c,timer:l,events:o}=s;if(a.type==="ADD_EVENT"){const{event:u}=a.payload;Ce(u,c);let d=o.length-1;if(!o[d]||o[d].timestamp<=u.timestamp)o.push(u);else{let T=-1,v=0;for(;v<=d;){const E=Math.floor((v+d)/2);o[E].timestamp<=u.timestamp?v=E+1:d=E-1}T===-1&&(T=v),o.splice(T,0,u)}const h=u.timestamp<c,f=t(u,h);h?f():l.isActive()&&l.addAction({doAction:()=>{f()},delay:u.delay})}return Ee(Te({},s),{events:o})})}});return ut(i)}function kn(e){const t=lt({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:te({normalSpeed:n=>n.timer.speed}),restoreSpeed:n=>{n.timer.setSpeed(n.normalSpeed)}}});return ut(t)}const se=`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 mt={map:{},getId(){return console.error(se),-1},getNode(){return console.error(se),null},removeNodeFromMap(){console.error(se)},has(){return console.error(se),!1},reset(){console.error(se)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(mt=new Proxy(mt,{get(e,t,n){return t==="map"&&console.error(se),Reflect.get(e,t,n)}}));function _n(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=(...t)=>{let n=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function Ln(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 c=t[s];if(c.parent){const l=c.parent.children.indexOf(c);c.parent.children.splice(l,0,n(i,c.parent))}else{const l=r.indexOf(c);r.splice(l,0,n(i,null))}continue}if(a in t){const c=t[a];c.children.push(n(i,c));continue}r.push(n(i,null))}return r}function pt(e,t){t(e.value);for(let n=e.children.length-1;n>=0;n--)pt(e.children[n],t)}function Re(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function ft(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=ft(i,t),c=s.height/i.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:c,absoluteScale:a.absoluteScale*c}}function vt(e){return Boolean(e?.shadowRoot)}function de(e,t){const n=e[t[0]];return t.length===1?n:de(n.cssRules[t[1]].cssRules,t.slice(2))}function gt(e){const t=[...e],n=t.pop();return{positions:t,index:n}}function Fn(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 Pn=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 yt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",he=typeof Uint8Array>"u"?[]:new Uint8Array(256),Ne=0;Ne<yt.length;Ne++)he[yt.charCodeAt(Ne)]=Ne;var Un=function(e){var t=e.length*.75,n=e.length,r,i=0,s,a,c,l;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=he[e.charCodeAt(r)],a=he[e.charCodeAt(r+1)],c=he[e.charCodeAt(r+2)],l=he[e.charCodeAt(r+3)],u[i++]=s<<2|a>>4,u[i++]=(a&15)<<4|c>>2,u[i++]=(c&3)<<6|l&63;return o},$n=(e,t,n)=>new Promise((r,i)=>{var s=l=>{try{c(n.next(l))}catch(o){i(o)}},a=l=>{try{c(n.throw(l))}catch(o){i(o)}},c=l=>l.done?r(l.value):Promise.resolve(l.value).then(s,a);c((n=n.apply(e,t)).next())});const Tt=new Map;function Et(e,t){let n=Tt.get(e);return n||(n=new Map,Tt.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}function Q(e,t,n){return r=>$n(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 Q(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 Et(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(Q(e,t,n))))}else{if("base64"in r)return Un(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(Q(e,t,n)));return new Blob(i,{type:r.type})}}else if(Array.isArray(r))return yield Promise.all(r.map(Q(e,t,n)));return r})}var Bn=(e,t,n)=>new Promise((r,i)=>{var s=l=>{try{c(n.next(l))}catch(o){i(o)}},a=l=>{try{c(n.throw(l))}catch(o){i(o)}},c=l=>l.done?r(l.value):Promise.resolve(l.value).then(s,a);c((n=n.apply(e,t)).next())});function Vn(e,t){try{return t===ge.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}const Wn=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function Gn(e,t){if(!(t!=null&&t.constructor))return;const{name:n}=t.constructor;if(!Wn.includes(n))return;const r=Et(e,n);r.includes(t)||r.push(t)}function jn(e){return Bn(this,arguments,function*({mutation:t,target:n,type:r,imageMap:i,errorHandler:s}){try{const a=Vn(n,r);if(!a)return;if(t.setter){a[t.property]=t.args[0];return}const c=a[t.property],l=yield Promise.all(t.args.map(Q(i,a))),o=c.apply(a,l);Gn(a,o)}catch(a){s(t,a)}})}var Hn=(e,t,n)=>new Promise((r,i)=>{var s=l=>{try{c(n.next(l))}catch(o){i(o)}},a=l=>{try{c(n.throw(l))}catch(o){i(o)}},c=l=>l.done?r(l.value):Promise.resolve(l.value).then(s,a);c((n=n.apply(e,t)).next())});function Yn(e){return Hn(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 c=a[n.property];if(n.property==="drawImage"&&typeof n.args[0]=="string")i.get(t),c.apply(a,n.args);else{const l=yield Promise.all(n.args.map(Q(i,a)));c.apply(a,l)}}catch(a){s(n,a)}})}var zn=(e,t,n)=>new Promise((r,i)=>{var s=l=>{try{c(n.next(l))}catch(o){i(o)}},a=l=>{try{c(n.throw(l))}catch(o){i(o)}},c=l=>l.done?r(l.value):Promise.resolve(l.value).then(s,a);c((n=n.apply(e,t)).next())});function Nt(e){return zn(this,arguments,function*({event:t,mutation:n,target:r,imageMap:i,canvasEventMap:s,errorHandler:a}){try{const c=s.get(t)||n,l="commands"in c?c.commands:[c];if([ge.WebGL,ge.WebGL2].includes(n.type)){for(let o=0;o<l.length;o++){const u=l[o];yield jn({mutation:u,type:n.type,target:r,imageMap:i,errorHandler:a})}return}for(let o=0;o<l.length;o++){const u=l[o];yield Yn({event:t,mutation:u,target:r,imageMap:i,errorHandler:a})}}catch(c){a(n,c)}})}var Xn=Object.defineProperty,Qn=Object.defineProperties,qn=Object.getOwnPropertyDescriptors,wt=Object.getOwnPropertySymbols,Jn=Object.prototype.hasOwnProperty,Kn=Object.prototype.propertyIsEnumerable,bt=(e,t,n)=>t in e?Xn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ae=(e,t)=>{for(var n in t||(t={}))Jn.call(t,n)&&bt(e,n,t[n]);if(wt)for(var n of wt(t))Kn.call(t,n)&&bt(e,n,t[n]);return e},Ae=(e,t)=>Qn(e,qn(t)),Ie=(e,t,n)=>new Promise((r,i)=>{var s=l=>{try{c(n.next(l))}catch(o){i(o)}},a=l=>{try{c(n.throw(l))}catch(o){i(o)}},c=l=>l.done?r(l.value):Promise.resolve(l.value).then(s,a);c((n=n.apply(e,t)).next())});const Dt=10*1e3,Ct=2*1e3,Mt=1*1e3,xt=60*60*1e3,Zn=tt||bn,Oe="[replayer]",ke={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function _e(e){return e.type==S.IncrementalSnapshot&&(e.data.source==I.TouchMove||e.data.source==I.MouseInteraction&&e.data.type==U.TouchStart)}class er{constructor(t,n){if(this.usingVirtualDom=!1,this.virtualDom=new ie,this.mouseTail=null,this.tailPositions=[],this.emitter=Zn(),this.activityIntervals=[],this.legacy_missingNodeRetryMap={},this.cache=je(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=Wt(),this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,this.handleResize=c=>{this.iframe.style.display="inherit";for(const l of[this.mouseTail,this.iframe])!l||(l.setAttribute("width",String(c.width)),l.setAttribute("height",String(c.height)))},this.applyEventsSynchronously=c=>{for(const l of c){switch(l.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(l,!0)()}this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null},this.getCastFn=(c,l=!1)=>{let o;switch(c.type){case S.DomContentLoaded:case S.Load:break;case S.Custom:o=()=>{this.emitter.emit(C.CustomEvent,c)};break;case S.Meta:o=()=>this.emitter.emit(C.Resize,{width:c.data.width,height:c.data.height});break;case S.FullSnapshot:o=()=>{if(this.firstFullSnapshot){if(this.firstFullSnapshot===c){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(c,l),this.iframe.contentWindow.scrollTo(c.data.initialOffset)};break;case S.IncrementalSnapshot:o=()=>{if(this.applyIncremental(c,l),!l&&(this.handleInactivity(c.timestamp),c===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const u of this.service.state.context.events)if(!(u.timestamp<=c.timestamp)&&this.isUserInteraction(u)){u.delay-c.delay>Dt*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=u);break}if(this.nextUserInteractionEvent){const u=this.nextUserInteractionEvent.delay-c.delay,d={speed:Math.min(Math.round(u/Ct),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:d}),this.emitter.emit(C.SkipStart,d)}}};break}return()=>{o&&o();for(const d of this.config.plugins||[])d.handler(c,l,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:c}});const u=this.service.state.context.events.length-1;if(c===this.service.state.context.events[u]){const d=()=>{u<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(C.Finish))};c.type===S.IncrementalSnapshot&&c.data.source===I.MouseMove&&c.data.positions.length?setTimeout(()=>{d()},Math.max(0,-c.data.positions[0].timeOffset+50)):d()}this.emitter.emit(C.EventCast,c)}},!(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:ke,useVirtualDom:!0,inactiveThreshold:.02,inactiveSkipTime:Ct};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(C.Resize,this.handleResize),this.setupDom(),this.emitter.on(C.Flush,()=>{if(this.usingVirtualDom){const c={mirror:this.mirror,applyCanvas:(l,o,u)=>{Nt({event:l,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(Y(this.iframe.contentDocument,this.virtualDom,c,this.virtualDom.mirror),this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const l in this.legacy_missingNodeRetryMap)try{const o=this.legacy_missingNodeRetryMap[l],u=Ce(o.node,this.mirror,this.virtualDom.mirror);Y(u,o.node,c,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(C.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset()});const i=new Cn([],n?.speed||r.speed);this.service=On({events:t.map(c=>n&&n.unpackFn?n.unpackFn(c):c).sort((c,l)=>c.timestamp-l.timestamp),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(c=>{this.emitter.emit(C.StateChange,{player:c})}),this.speedService=kn({normalSpeed:-1,timer:i}),this.speedService.start(),this.speedService.subscribe(c=>{this.emitter.emit(C.StateChange,{speed:c})});const s=this.service.state.context.events.find(c=>c.type===S.Meta),a=this.service.state.context.events.find(c=>c.type===S.FullSnapshot);if(s){const{width:c,height:l}=s.data;setTimeout(()=>{this.emitter.emit(C.Resize,{width:c,height:l})},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(_e)&&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=>{t[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 c=r[a-1],l=r[a];l.timestamp-c.timestamp>Dt?t.push({startTime:c.timestamp,endTime:l.timestamp,duration:l.timestamp-c.timestamp,active:!1}):t.push({startTime:c.timestamp,endTime:l.timestamp,duration:l.timestamp-c.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(C.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(C.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(C.Resume)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){const n=this.config.unpackFn?this.config.unpackFn(t):t;_e(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(_e(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=je()}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&&(Dn(this.iframe.contentWindow,this.iframe.contentDocument),_n(this.iframe.contentWindow))}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/xt*this.config.inactiveSkipTime<Mt?r/Mt:Math.round(Math.max(r,xt)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:i}),this.emitter.emit(C.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=[];qt(t.data.node,{doc:this.iframe.contentDocument,afterAppend:a=>{this.collectIframeAndAttachDocument(r,a)},cache:this.cache,mirror:this.mirror});for(const{mutationInQueue:a,builtNode:c}of r)this.attachDocumentToIframe(a,c),this.newDocumentQueue=this.newDocumentQueue.filter(l=>l!==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(C.FullsnapshotRebuilded,t),n||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,n){const r=Pn(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,et(i,this.virtualDom.unserializedId)),t.insertBefore(i,n);for(let s=0;s<r.length;s++)i.rules.push({cssText:r[s],type:G.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=[];ve(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===L.Element&&a?.tagName.toUpperCase()==="HTML"){const{documentElement:c,head:l}=n.contentDocument;this.insertStyleRules(c,l)}},cache:this.cache});for(const{mutationInQueue:s,builtNode:a}of i)this.attachDocumentToIframe(s,a),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==s)}collectIframeAndAttachDocument(t,n){if(Re(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(C.Start,a),this.emitter.on(C.Pause,a);const c=()=>{this.emitter.off(C.Start,a),this.emitter.off(C.Pause,a)};n.querySelectorAll('link[rel="stylesheet"]').forEach(l=>{l.sheet||(r.add(l),l.addEventListener("load",()=>{r.delete(l),r.size===0&&i!==-1&&(s.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(C.LoadStylesheetEnd),i&&clearTimeout(i),c())}))}),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(C.LoadStylesheetStart),i=setTimeout(()=>{s.matches("playing")&&this.play(this.getCurrentTime()),i=-1,c()},this.config.loadTimeout))}}preloadAllImages(){return Ie(this,null,function*(){this.service.state;const t=()=>{this.service.state};this.emitter.on(C.Start,t),this.emitter.on(C.Pause,t);const n=[];for(const r of this.service.state.context.events)r.type===S.IncrementalSnapshot&&r.data.source===I.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 Ie(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=>Ie(this,null,function*(){const a=yield Promise.all(s.args.map(Q(this.imageMap,null,r)));return Ae(ae({},s),{args:a})})));r.isUnchanged===!1&&this.canvasEventMap.set(n,Ae(ae({},t),{commands:i}))}else{const i=yield Promise.all(t.args.map(Q(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(n,Ae(ae({},t),{args:i}))}}})}applyIncremental(t,n){var r,i,s,a,c,l;const{data:o}=t;switch(o.source){case I.Mutation:{try{this.applyMutation(o,n)}catch(u){this.warn(`Exception in mutation ${u.message||u}`,o)}break}case I.Drag:case I.TouchMove:case I.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 I.MouseInteraction:{if(o.id===-1||n)break;const u=new Event(U[o.type].toLowerCase()),d=this.mirror.getNode(o.id);if(!d)return this.debugNodeNotFound(o,o.id);this.emitter.emit(C.MouseInteraction,{type:o.type,target:d});const{triggerFocus:h}=this.config;switch(o.type){case U.Blur:"blur"in d&&d.blur();break;case U.Focus:h&&d.focus&&d.focus({preventScroll:!0});break;case U.Click:case U.TouchStart:case U.TouchEnd:n?(o.type===U.TouchStart?this.touchActive=!0:o.type===U.TouchEnd&&(this.touchActive=!1),this.mousePos={x:o.x,y:o.y,id:o.id,debugData:o}):(o.type===U.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(o.x,o.y,o.id,n,o),o.type===U.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):o.type===U.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):o.type===U.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case U.TouchCancel:n?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:d.dispatchEvent(u)}break}case I.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 I.ViewportResize:this.emitter.emit(C.Resize,{width:o.width,height:o.height});break;case I.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 I.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===Me.Pause&&d.pause(),o.type===Me.Play&&d.play()}catch(h){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${h.message||h}`)}break}case I.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:G.Insert})),(s=o.removes)==null||s.forEach(({index:h})=>d?.push({index:h,type:G.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:v}=gt(f);de(d.cssRules,T).insertRule(h,v)}else{const T=f===void 0?void 0:Math.min(f,d.cssRules.length);d.insertRule(h,T)}}catch{}}),(c=o.removes)==null||c.forEach(({index:h})=>{try{if(Array.isArray(h)){const{positions:f,index:T}=gt(h);de(d.cssRules,f).deleteRule(T||0)}else d?.deleteRule(h)}catch{}})}break}case I.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(ae({type:G.SetProperty,index:o.index},o.set)),o.remove&&d.push(ae({type:G.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&&de(d.rules,o.index).style.setProperty(o.set.property,o.set.value,o.set.priority),o.remove&&de(d.rules,o.index).style.removeProperty(o.remove.property)}break}case I.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);Nt({event:t,mutation:o,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case I.Font:{try{const u=new FontFace(o.family,o.buffer?new Uint8Array(JSON.parse(o.fontSource)):o.fontSource,o.descriptors);(l=this.iframe.contentDocument)==null||l.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,En(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=Ze(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&&vt(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=ae({},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},c=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===L.Document?this.newDocumentQueue.push(o):s.push(o);o.node.isShadow&&(vt(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(Re(d,r)){this.attachDocumentToIframe(o,d);return}const v=ve(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:v,mutation:o};return}const E=r.getMeta(d);if(E&&E.type===L.Element&&E.tagName==="textarea"&&o.node.type===L.Text){const p=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);for(const y of p)y.nodeType===d.TEXT_NODE&&d.removeChild(y)}if(h&&h.nextSibling&&h.nextSibling.parentNode)d.insertBefore(v,h.nextSibling);else if(f&&f.parentNode)d.contains(f)?d.insertBefore(v,f):d.insertBefore(v,null);else{if(d===T)for(;T.firstChild;)T.removeChild(T.firstChild);d.appendChild(v)}if(this.usingVirtualDom&&v.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)==null?void 0:u.length)>0&&(d.rules=[]),Re(v,this.mirror)){const p=this.mirror.getId(v),y=this.newDocumentQueue.find(N=>N.parentId===p);y&&(this.attachDocumentToIframe(y,v),this.newDocumentQueue=this.newDocumentQueue.filter(N=>N!==y))}(o.previousId||o.nextId)&&this.legacy_resolveMissingNode(i,d,v,o)};t.adds.forEach(o=>{c(o)});const l=Date.now();for(;s.length;){const o=Ln(s);if(s.length=0,Date.now()-l>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)?pt(u,d=>{c(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),Fn(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 v in f)if(f[v]===!1)T.style.removeProperty(v);else if(f[v]instanceof Array){const E=f[v];T.style.setProperty(v,E[0],E[1])}else{const E=f[v];T.style.setProperty(v,E)}}}})}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===L.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,c=s&&t[s],l=a&&t[a];if(c){const{node:o,mutation:u}=c;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(l){const{node:o,mutation:u}=l;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 c=ft(a,this.iframe),l=t*c.absoluteScale+c.x,o=n*c.absoluteScale+c.y;this.mouse.style.left=`${l}px`,this.mouse.style.top=`${o}px`,i||this.drawMouseTail({x:l,y:o}),this.hoverElements(a)}drawMouseTail(t){if(!this.mouseTail)return;const{lineCap:n,lineWidth:r,strokeStyle:i,duration:s}=this.config.mouseTail===!0?ke:Object.assign({},ke,this.config.mouseTail),a=()=>{if(!this.mouseTail)return;const c=this.mouseTail.getContext("2d");!c||!this.tailPositions.length||(c.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),c.beginPath(),c.lineWidth=r,c.lineCap=n,c.strokeStyle=i,c.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(l=>c.lineTo(l.x,l.y)),c.stroke())};this.tailPositions.push(t),a(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(c=>c!==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>I.Mutation&&t.data.source<=I.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(C.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(Oe,`Node with id '${n}' not found. `,t)}warn(...t){!this.config.showWarning||console.warn(Oe,...t)}debug(...t){!this.config.showDebug||console.log(Oe,...t)}}var V=Uint8Array,q=Uint16Array,Le=Uint32Array,St=new V([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Rt=new V([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),tr=new V([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),At=function(e,t){for(var n=new q(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new Le(n[30]),r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)i[s]=s-n[r]<<5|r;return[n,i]},It=At(St,2),Ot=It[0],nr=It[1];Ot[28]=258,nr[258]=28;for(var rr=At(Rt,0),ir=rr[0],Fe=new q(32768),x=0;x<32768;++x){var J=(x&43690)>>>1|(x&21845)<<1;J=(J&52428)>>>2|(J&13107)<<2,J=(J&61680)>>>4|(J&3855)<<4,Fe[x]=((J&65280)>>>8|(J&255)<<8)>>>1}for(var me=function(e,t,n){for(var r=e.length,i=0,s=new q(t);i<r;++i)++s[e[i]-1];var a=new q(t);for(i=0;i<t;++i)a[i]=a[i-1]+s[i-1]<<1;var c;if(n){c=new q(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var o=i<<4|e[i],u=t-e[i],d=a[e[i]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)c[Fe[d]>>>l]=o}else for(c=new q(r),i=0;i<r;++i)c[i]=Fe[a[e[i]-1]++]>>>15-e[i];return c},pe=new V(288),x=0;x<144;++x)pe[x]=8;for(var x=144;x<256;++x)pe[x]=9;for(var x=256;x<280;++x)pe[x]=7;for(var x=280;x<288;++x)pe[x]=8;for(var kt=new V(32),x=0;x<32;++x)kt[x]=5;var or=me(pe,9,1),sr=me(kt,5,1),Pe=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},j=function(e,t,n){var r=t/8>>0;return(e[r]|e[r+1]<<8)>>>(t&7)&n},Ue=function(e,t){var n=t/8>>0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>>(t&7)},ar=function(e){return(e/8>>0)+(e&7&&1)},_t=function(e,t,n){(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof q?q:e instanceof Le?Le:V)(n-t);return r.set(e.subarray(t,n)),r},lr=function(e,t,n){var r=e.length,i=!t||n,s=!n||n.i;n||(n={}),t||(t=new V(r*3));var a=function(Pt){var Ut=t.length;if(Pt>Ut){var $t=new V(Math.max(Ut*2,Pt));$t.set(t),t=$t}},c=n.f||0,l=n.p||0,o=n.b||0,u=n.l,d=n.d,h=n.m,f=n.n,T=r*8;do{if(!u){n.f=c=j(e,l,1);var v=j(e,l+1,3);if(l+=3,v)if(v==1)u=or,d=sr,h=9,f=5;else if(v==2){var N=j(e,l,31)+257,D=j(e,l+10,15)+4,O=N+j(e,l+5,31)+1;l+=14;for(var R=new V(O),$=new V(19),k=0;k<D;++k)$[tr[k]]=j(e,l+k*3,7);l+=D*3;var F=Pe($),ne=(1<<F)-1;if(!s&&l+O*(F+7)>T)break;for(var z=me($,F,1),k=0;k<O;){var K=z[j(e,l,ne)];l+=K&15;var E=K>>>4;if(E<16)R[k++]=E;else{var H=0,Z=0;for(E==16?(Z=3+j(e,l,3),l+=2,H=R[k-1]):E==17?(Z=3+j(e,l,7),l+=3):E==18&&(Z=11+j(e,l,127),l+=7);Z--;)R[k++]=H}}var le=R.subarray(0,N),B=R.subarray(N);h=Pe(le),f=Pe(B),u=me(le,h,1),d=me(B,f,1)}else throw"invalid block type";else{var E=ar(l)+4,p=e[E-4]|e[E-3]<<8,y=E+p;if(y>r){if(s)throw"unexpected EOF";break}i&&a(o+p),t.set(e.subarray(E,y),o),n.b=o+=p,n.p=l=y*8;continue}if(l>T)throw"unexpected EOF"}i&&a(o+131072);for(var _=(1<<h)-1,re=(1<<f)-1,g=h+f+18;s||l+g<T;){var H=u[Ue(e,l)&_],m=H>>>4;if(l+=H&15,l>T)throw"unexpected EOF";if(!H)throw"invalid length/literal";if(m<256)t[o++]=m;else if(m==256){u=null;break}else{var b=m-254;if(m>264){var k=m-257,M=St[k];b=j(e,l,(1<<M)-1)+Ot[k],l+=M}var P=d[Ue(e,l)&re],ee=P>>>4;if(!P)throw"invalid distance";l+=P&15;var B=ir[ee];if(ee>3){var M=Rt[ee];B+=Ue(e,l)&(1<<M)-1,l+=M}if(l>T)throw"unexpected EOF";i&&a(o+131072);for(var Ft=o+b;o<Ft;o+=4)t[o]=t[o-B],t[o+1]=t[o+1-B],t[o+2]=t[o+2-B],t[o+3]=t[o+3-B];o=Ft}}n.l=u,n.p=l,n.b=o,u&&(c=1,n.m=h,n.d=d,n.n=f)}while(!c);return o==t.length?t:_t(t,0,o)},cr=function(e){if((e[0]&15)!=8||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(e[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function ur(e,t){return lr((cr(e),e.subarray(2,-4)),t)}function dr(e,t){var n=e.length;if(!t&&typeof TextEncoder<"u")return new TextEncoder().encode(e);for(var r=new V(e.length+(e.length>>>1)),i=0,s=function(o){r[i++]=o},a=0;a<n;++a){if(i+5>r.length){var c=new V(i+8+(n-a<<1));c.set(r),r=c}var l=e.charCodeAt(a);l<128||t?s(l):l<2048?(s(192|l>>>6),s(128|l&63)):l>55295&&l<57344?(l=65536+(l&1047552)|e.charCodeAt(++a)&1023,s(240|l>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|l&63)):(s(224|l>>>12),s(128|l>>>6&63),s(128|l&63))}return _t(r,0,i)}function hr(e,t){var n="";if(!t&&typeof TextDecoder<"u")return new TextDecoder().decode(e);for(var r=0;r<e.length;){var i=e[r++];i<128||t?n+=String.fromCharCode(i):i<224?n+=String.fromCharCode((i&31)<<6|e[r++]&63):i<240?n+=String.fromCharCode((i&15)<<12|(e[r++]&63)<<6|e[r++]&63):(i=((i&15)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,n+=String.fromCharCode(55296|i>>10,56320|i&1023))}return n}const Lt="v1",mr=e=>{if(typeof e!="string")return e;try{const t=JSON.parse(e);if(t.timestamp)return t}catch{}try{const t=JSON.parse(hr(ur(dr(e,!0))));if(t.v===Lt)return t;throw new Error(`These events were packed with packer ${t.v} which is incompatible with current packer ${Lt}.`)}catch(t){throw console.error(t),new Error("Unknown data format.")}};return fe.Replayer=er,fe.unpack=mr,Object.defineProperty(fe,"__esModule",{value:!0}),fe}({});
|
|
17
|
+
or you can use record.mirror to access the mirror instance during recording.`;let mt={map:{},getId(){return console.error(se),-1},getNode(){return console.error(se),null},removeNodeFromMap(){console.error(se)},has(){return console.error(se),!1},reset(){console.error(se)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(mt=new Proxy(mt,{get(e,t,n){return t==="map"&&console.error(se),Reflect.get(e,t,n)}}));function _n(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=(...t)=>{let n=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function Ln(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 c=t[s];if(c.parent){const l=c.parent.children.indexOf(c);c.parent.children.splice(l,0,n(i,c.parent))}else{const l=r.indexOf(c);r.splice(l,0,n(i,null))}continue}if(a in t){const c=t[a];c.children.push(n(i,c));continue}r.push(n(i,null))}return r}function pt(e,t){t(e.value);for(let n=e.children.length-1;n>=0;n--)pt(e.children[n],t)}function Re(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function ft(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=ft(i,t),c=s.height/i.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:c,absoluteScale:a.absoluteScale*c}}function vt(e){return Boolean(e?.shadowRoot)}function de(e,t){const n=e[t[0]];return t.length===1?n:de(n.cssRules[t[1]].cssRules,t.slice(2))}function gt(e){const t=[...e],n=t.pop();return{positions:t,index:n}}function Fn(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 Pn=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 yt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",he=typeof Uint8Array>"u"?[]:new Uint8Array(256),Ne=0;Ne<yt.length;Ne++)he[yt.charCodeAt(Ne)]=Ne;var Un=function(e){var t=e.length*.75,n=e.length,r,i=0,s,a,c,l;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=he[e.charCodeAt(r)],a=he[e.charCodeAt(r+1)],c=he[e.charCodeAt(r+2)],l=he[e.charCodeAt(r+3)],u[i++]=s<<2|a>>4,u[i++]=(a&15)<<4|c>>2,u[i++]=(c&3)<<6|l&63;return o},$n=(e,t,n)=>new Promise((r,i)=>{var s=l=>{try{c(n.next(l))}catch(o){i(o)}},a=l=>{try{c(n.throw(l))}catch(o){i(o)}},c=l=>l.done?r(l.value):Promise.resolve(l.value).then(s,a);c((n=n.apply(e,t)).next())});const Tt=new Map;function Et(e,t){let n=Tt.get(e);return n||(n=new Map,Tt.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}function Q(e,t,n){return r=>$n(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 Q(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 Et(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(Q(e,t,n))))}else{if("base64"in r)return Un(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(Q(e,t,n)));return new Blob(i,{type:r.type})}}else if(Array.isArray(r))return yield Promise.all(r.map(Q(e,t,n)));return r})}var Bn=(e,t,n)=>new Promise((r,i)=>{var s=l=>{try{c(n.next(l))}catch(o){i(o)}},a=l=>{try{c(n.throw(l))}catch(o){i(o)}},c=l=>l.done?r(l.value):Promise.resolve(l.value).then(s,a);c((n=n.apply(e,t)).next())});function Vn(e,t){try{return t===ge.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}const Wn=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function Gn(e,t){if(!(t!=null&&t.constructor))return;const{name:n}=t.constructor;if(!Wn.includes(n))return;const r=Et(e,n);r.includes(t)||r.push(t)}function jn(e){return Bn(this,arguments,function*({mutation:t,target:n,type:r,imageMap:i,errorHandler:s}){try{const a=Vn(n,r);if(!a)return;if(t.setter){a[t.property]=t.args[0];return}const c=a[t.property],l=yield Promise.all(t.args.map(Q(i,a))),o=c.apply(a,l);Gn(a,o)}catch(a){s(t,a)}})}var Hn=(e,t,n)=>new Promise((r,i)=>{var s=l=>{try{c(n.next(l))}catch(o){i(o)}},a=l=>{try{c(n.throw(l))}catch(o){i(o)}},c=l=>l.done?r(l.value):Promise.resolve(l.value).then(s,a);c((n=n.apply(e,t)).next())});function Yn(e){return Hn(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 c=a[n.property];if(n.property==="drawImage"&&typeof n.args[0]=="string")i.get(t),c.apply(a,n.args);else{const l=yield Promise.all(n.args.map(Q(i,a)));c.apply(a,l)}}catch(a){s(n,a)}})}var zn=(e,t,n)=>new Promise((r,i)=>{var s=l=>{try{c(n.next(l))}catch(o){i(o)}},a=l=>{try{c(n.throw(l))}catch(o){i(o)}},c=l=>l.done?r(l.value):Promise.resolve(l.value).then(s,a);c((n=n.apply(e,t)).next())});function Nt(e){return zn(this,arguments,function*({event:t,mutation:n,target:r,imageMap:i,canvasEventMap:s,errorHandler:a}){try{const c=s.get(t)||n,l="commands"in c?c.commands:[c];if([ge.WebGL,ge.WebGL2].includes(n.type)){for(let o=0;o<l.length;o++){const u=l[o];yield jn({mutation:u,type:n.type,target:r,imageMap:i,errorHandler:a})}return}for(let o=0;o<l.length;o++){const u=l[o];yield Yn({event:t,mutation:u,target:r,imageMap:i,errorHandler:a})}}catch(c){a(n,c)}})}var Xn=Object.defineProperty,Qn=Object.defineProperties,qn=Object.getOwnPropertyDescriptors,wt=Object.getOwnPropertySymbols,Jn=Object.prototype.hasOwnProperty,Kn=Object.prototype.propertyIsEnumerable,bt=(e,t,n)=>t in e?Xn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ae=(e,t)=>{for(var n in t||(t={}))Jn.call(t,n)&&bt(e,n,t[n]);if(wt)for(var n of wt(t))Kn.call(t,n)&&bt(e,n,t[n]);return e},Ae=(e,t)=>Qn(e,qn(t)),Ie=(e,t,n)=>new Promise((r,i)=>{var s=l=>{try{c(n.next(l))}catch(o){i(o)}},a=l=>{try{c(n.throw(l))}catch(o){i(o)}},c=l=>l.done?r(l.value):Promise.resolve(l.value).then(s,a);c((n=n.apply(e,t)).next())});const Dt=10*1e3,Mt=2*1e3,xt=1*1e3,Ct=60*60*1e3,Zn=tt||bn,Oe="[replayer]",ke={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function _e(e){return e.type==S.IncrementalSnapshot&&(e.data.source==I.TouchMove||e.data.source==I.MouseInteraction&&e.data.type==U.TouchStart)}class er{constructor(t,n){if(this.usingVirtualDom=!1,this.virtualDom=new ie,this.mouseTail=null,this.tailPositions=[],this.emitter=Zn(),this.activityIntervals=[],this.legacy_missingNodeRetryMap={},this.cache=je(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=Wt(),this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,this.handleResize=c=>{this.iframe.style.display="inherit";for(const l of[this.mouseTail,this.iframe])!l||(l.setAttribute("width",String(c.width)),l.setAttribute("height",String(c.height)))},this.applyEventsSynchronously=c=>{for(const l of c){switch(l.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(l,!0)()}this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null},this.getCastFn=(c,l=!1)=>{let o;switch(c.type){case S.DomContentLoaded:case S.Load:break;case S.Custom:o=()=>{this.emitter.emit(M.CustomEvent,c)};break;case S.Meta:o=()=>this.emitter.emit(M.Resize,{width:c.data.width,height:c.data.height});break;case S.FullSnapshot:o=()=>{if(this.firstFullSnapshot){if(this.firstFullSnapshot===c){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(c,l),this.iframe.contentWindow.scrollTo(c.data.initialOffset)};break;case S.IncrementalSnapshot:o=()=>{if(this.applyIncremental(c,l),!l&&(this.handleInactivity(c.timestamp),c===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const u of this.service.state.context.events)if(!(u.timestamp<=c.timestamp)&&this.isUserInteraction(u)){u.delay-c.delay>Dt*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=u);break}if(this.nextUserInteractionEvent){const u=this.nextUserInteractionEvent.delay-c.delay,d={speed:Math.min(Math.round(u/Mt),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:d}),this.emitter.emit(M.SkipStart,d)}}};break}return()=>{o&&o();for(const d of this.config.plugins||[])d.handler(c,l,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:c}});const u=this.service.state.context.events.length-1;if(c===this.service.state.context.events[u]){const d=()=>{u<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(M.Finish))};c.type===S.IncrementalSnapshot&&c.data.source===I.MouseMove&&c.data.positions.length?setTimeout(()=>{d()},Math.max(0,-c.data.positions[0].timeOffset+50)):d()}this.emitter.emit(M.EventCast,c)}},!(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:ke,useVirtualDom:!0,inactiveThreshold:.02,inactiveSkipTime:Mt};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(M.Resize,this.handleResize),this.setupDom(),this.emitter.on(M.Flush,()=>{if(this.usingVirtualDom){const c={mirror:this.mirror,applyCanvas:(l,o,u)=>{Nt({event:l,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(Y(this.iframe.contentDocument,this.virtualDom,c,this.virtualDom.mirror),this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const l in this.legacy_missingNodeRetryMap)try{const o=this.legacy_missingNodeRetryMap[l],u=Me(o.node,this.mirror,this.virtualDom.mirror);Y(u,o.node,c,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(M.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset()});const i=new Mn([],n?.speed||r.speed);this.service=On({events:t.map(c=>n&&n.unpackFn?n.unpackFn(c):c).sort((c,l)=>c.timestamp-l.timestamp),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(c=>{this.emitter.emit(M.StateChange,{player:c})}),this.speedService=kn({normalSpeed:-1,timer:i}),this.speedService.start(),this.speedService.subscribe(c=>{this.emitter.emit(M.StateChange,{speed:c})});const s=this.service.state.context.events.find(c=>c.type===S.Meta),a=this.service.state.context.events.find(c=>c.type===S.FullSnapshot);if(s){const{width:c,height:l}=s.data;setTimeout(()=>{this.emitter.emit(M.Resize,{width:c,height:l})},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(_e)&&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=>{t[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 c=r[a-1],l=r[a];l.timestamp-c.timestamp>Dt?t.push({startTime:c.timestamp,endTime:l.timestamp,duration:l.timestamp-c.timestamp,active:!1}):t.push({startTime:c.timestamp,endTime:l.timestamp,duration:l.timestamp-c.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(M.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(M.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(M.Resume)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){const n=this.config.unpackFn?this.config.unpackFn(t):t;_e(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(_e(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=je()}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&&(Dn(this.iframe.contentWindow,this.iframe.contentDocument),_n(this.iframe.contentWindow))}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/Ct*this.config.inactiveSkipTime<xt?r/xt:Math.round(Math.max(r,Ct)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:i}),this.emitter.emit(M.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=[];qt(t.data.node,{doc:this.iframe.contentDocument,afterAppend:a=>{this.collectIframeAndAttachDocument(r,a)},cache:this.cache,mirror:this.mirror});for(const{mutationInQueue:a,builtNode:c}of r)this.attachDocumentToIframe(a,c),this.newDocumentQueue=this.newDocumentQueue.filter(l=>l!==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(M.FullsnapshotRebuilded,t),n||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,n){const r=Pn(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,et(i,this.virtualDom.unserializedId)),t.insertBefore(i,n);for(let s=0;s<r.length;s++)i.rules.push({cssText:r[s],type:G.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=[];ve(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===L.Element&&a?.tagName.toUpperCase()==="HTML"){const{documentElement:c,head:l}=n.contentDocument;this.insertStyleRules(c,l)}},cache:this.cache});for(const{mutationInQueue:s,builtNode:a}of i)this.attachDocumentToIframe(s,a),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==s)}collectIframeAndAttachDocument(t,n){if(Re(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(M.Start,a),this.emitter.on(M.Pause,a);const c=()=>{this.emitter.off(M.Start,a),this.emitter.off(M.Pause,a)};n.querySelectorAll('link[rel="stylesheet"]').forEach(l=>{l.sheet||(r.add(l),l.addEventListener("load",()=>{r.delete(l),r.size===0&&i!==-1&&(s.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(M.LoadStylesheetEnd),i&&clearTimeout(i),c())}))}),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(M.LoadStylesheetStart),i=setTimeout(()=>{s.matches("playing")&&this.play(this.getCurrentTime()),i=-1,c()},this.config.loadTimeout))}}preloadAllImages(){return Ie(this,null,function*(){this.service.state;const t=()=>{this.service.state};this.emitter.on(M.Start,t),this.emitter.on(M.Pause,t);const n=[];for(const r of this.service.state.context.events)r.type===S.IncrementalSnapshot&&r.data.source===I.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 Ie(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=>Ie(this,null,function*(){const a=yield Promise.all(s.args.map(Q(this.imageMap,null,r)));return Ae(ae({},s),{args:a})})));r.isUnchanged===!1&&this.canvasEventMap.set(n,Ae(ae({},t),{commands:i}))}else{const i=yield Promise.all(t.args.map(Q(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(n,Ae(ae({},t),{args:i}))}}})}applyIncremental(t,n){var r,i,s,a,c,l;const{data:o}=t;switch(o.source){case I.Mutation:{try{this.applyMutation(o,n)}catch(u){this.warn(`Exception in mutation ${u.message||u}`,o)}break}case I.Drag:case I.TouchMove:case I.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 I.MouseInteraction:{if(o.id===-1||n)break;const u=new Event(U[o.type].toLowerCase()),d=this.mirror.getNode(o.id);if(!d)return this.debugNodeNotFound(o,o.id);this.emitter.emit(M.MouseInteraction,{type:o.type,target:d});const{triggerFocus:h}=this.config;switch(o.type){case U.Blur:"blur"in d&&d.blur();break;case U.Focus:h&&d.focus&&d.focus({preventScroll:!0});break;case U.Click:case U.TouchStart:case U.TouchEnd:n?(o.type===U.TouchStart?this.touchActive=!0:o.type===U.TouchEnd&&(this.touchActive=!1),this.mousePos={x:o.x,y:o.y,id:o.id,debugData:o}):(o.type===U.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(o.x,o.y,o.id,n,o),o.type===U.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):o.type===U.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):o.type===U.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case U.TouchCancel:n?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:d.dispatchEvent(u)}break}case I.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 I.ViewportResize:this.emitter.emit(M.Resize,{width:o.width,height:o.height});break;case I.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 I.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===xe.Pause&&d.pause(),o.type===xe.Play&&d.play()}catch(h){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${h.message||h}`)}break}case I.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:G.Insert})),(s=o.removes)==null||s.forEach(({index:h})=>d?.push({index:h,type:G.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:v}=gt(f);de(d.cssRules,T).insertRule(h,v)}else{const T=f===void 0?void 0:Math.min(f,d.cssRules.length);d.insertRule(h,T)}}catch{}}),(c=o.removes)==null||c.forEach(({index:h})=>{try{if(Array.isArray(h)){const{positions:f,index:T}=gt(h);de(d.cssRules,f).deleteRule(T||0)}else d?.deleteRule(h)}catch{}})}break}case I.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(ae({type:G.SetProperty,index:o.index},o.set)),o.remove&&d.push(ae({type:G.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&&de(d.rules,o.index).style.setProperty(o.set.property,o.set.value,o.set.priority),o.remove&&de(d.rules,o.index).style.removeProperty(o.remove.property)}break}case I.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);Nt({event:t,mutation:o,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case I.Font:{try{const u=new FontFace(o.family,o.buffer?new Uint8Array(JSON.parse(o.fontSource)):o.fontSource,o.descriptors);(l=this.iframe.contentDocument)==null||l.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,En(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=Ze(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&&vt(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=ae({},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},c=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===L.Document?this.newDocumentQueue.push(o):s.push(o);o.node.isShadow&&(vt(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(Re(d,r)){this.attachDocumentToIframe(o,d);return}const v=ve(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:v,mutation:o};return}const E=r.getMeta(d);if(E&&E.type===L.Element&&E.tagName==="textarea"&&o.node.type===L.Text){const p=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);for(const y of p)y.nodeType===d.TEXT_NODE&&d.removeChild(y)}if(h&&h.nextSibling&&h.nextSibling.parentNode)d.insertBefore(v,h.nextSibling);else if(f&&f.parentNode)d.contains(f)?d.insertBefore(v,f):d.insertBefore(v,null);else{if(d===T)for(;T.firstChild;)T.removeChild(T.firstChild);d.appendChild(v)}if(this.usingVirtualDom&&v.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)==null?void 0:u.length)>0&&(d.rules=[]),Re(v,this.mirror)){const p=this.mirror.getId(v),y=this.newDocumentQueue.find(N=>N.parentId===p);y&&(this.attachDocumentToIframe(y,v),this.newDocumentQueue=this.newDocumentQueue.filter(N=>N!==y))}(o.previousId||o.nextId)&&this.legacy_resolveMissingNode(i,d,v,o)};t.adds.forEach(o=>{c(o)});const l=Date.now();for(;s.length;){const o=Ln(s);if(s.length=0,Date.now()-l>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)?pt(u,d=>{c(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),Fn(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 v in f)if(f[v]===!1)T.style.removeProperty(v);else if(f[v]instanceof Array){const E=f[v];T.style.setProperty(v,E[0],E[1])}else{const E=f[v];T.style.setProperty(v,E)}}}})}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===L.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,c=s&&t[s],l=a&&t[a];if(c){const{node:o,mutation:u}=c;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(l){const{node:o,mutation:u}=l;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 c=ft(a,this.iframe),l=t*c.absoluteScale+c.x,o=n*c.absoluteScale+c.y;this.mouse.style.left=`${l}px`,this.mouse.style.top=`${o}px`,i||this.drawMouseTail({x:l,y:o}),this.hoverElements(a)}drawMouseTail(t){if(!this.mouseTail)return;const{lineCap:n,lineWidth:r,strokeStyle:i,duration:s}=this.config.mouseTail===!0?ke:Object.assign({},ke,this.config.mouseTail),a=()=>{if(!this.mouseTail)return;const c=this.mouseTail.getContext("2d");!c||!this.tailPositions.length||(c.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),c.beginPath(),c.lineWidth=r,c.lineCap=n,c.strokeStyle=i,c.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(l=>c.lineTo(l.x,l.y)),c.stroke())};this.tailPositions.push(t),a(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(c=>c!==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>I.Mutation&&t.data.source<=I.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(M.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(Oe,`Node with id '${n}' not found. `,t)}warn(...t){!this.config.showWarning||console.warn(Oe,...t)}debug(...t){!this.config.showDebug||console.log(Oe,...t)}}var V=Uint8Array,q=Uint16Array,Le=Uint32Array,St=new V([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Rt=new V([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),tr=new V([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),At=function(e,t){for(var n=new q(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new Le(n[30]),r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)i[s]=s-n[r]<<5|r;return[n,i]},It=At(St,2),Ot=It[0],nr=It[1];Ot[28]=258,nr[258]=28;for(var rr=At(Rt,0),ir=rr[0],Fe=new q(32768),C=0;C<32768;++C){var J=(C&43690)>>>1|(C&21845)<<1;J=(J&52428)>>>2|(J&13107)<<2,J=(J&61680)>>>4|(J&3855)<<4,Fe[C]=((J&65280)>>>8|(J&255)<<8)>>>1}for(var me=function(e,t,n){for(var r=e.length,i=0,s=new q(t);i<r;++i)++s[e[i]-1];var a=new q(t);for(i=0;i<t;++i)a[i]=a[i-1]+s[i-1]<<1;var c;if(n){c=new q(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var o=i<<4|e[i],u=t-e[i],d=a[e[i]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)c[Fe[d]>>>l]=o}else for(c=new q(r),i=0;i<r;++i)c[i]=Fe[a[e[i]-1]++]>>>15-e[i];return c},pe=new V(288),C=0;C<144;++C)pe[C]=8;for(var C=144;C<256;++C)pe[C]=9;for(var C=256;C<280;++C)pe[C]=7;for(var C=280;C<288;++C)pe[C]=8;for(var kt=new V(32),C=0;C<32;++C)kt[C]=5;var or=me(pe,9,1),sr=me(kt,5,1),Pe=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},j=function(e,t,n){var r=t/8>>0;return(e[r]|e[r+1]<<8)>>>(t&7)&n},Ue=function(e,t){var n=t/8>>0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>>(t&7)},ar=function(e){return(e/8>>0)+(e&7&&1)},_t=function(e,t,n){(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof q?q:e instanceof Le?Le:V)(n-t);return r.set(e.subarray(t,n)),r},lr=function(e,t,n){var r=e.length,i=!t||n,s=!n||n.i;n||(n={}),t||(t=new V(r*3));var a=function(Pt){var Ut=t.length;if(Pt>Ut){var $t=new V(Math.max(Ut*2,Pt));$t.set(t),t=$t}},c=n.f||0,l=n.p||0,o=n.b||0,u=n.l,d=n.d,h=n.m,f=n.n,T=r*8;do{if(!u){n.f=c=j(e,l,1);var v=j(e,l+1,3);if(l+=3,v)if(v==1)u=or,d=sr,h=9,f=5;else if(v==2){var N=j(e,l,31)+257,D=j(e,l+10,15)+4,O=N+j(e,l+5,31)+1;l+=14;for(var R=new V(O),$=new V(19),k=0;k<D;++k)$[tr[k]]=j(e,l+k*3,7);l+=D*3;var F=Pe($),ne=(1<<F)-1;if(!s&&l+O*(F+7)>T)break;for(var z=me($,F,1),k=0;k<O;){var K=z[j(e,l,ne)];l+=K&15;var E=K>>>4;if(E<16)R[k++]=E;else{var H=0,Z=0;for(E==16?(Z=3+j(e,l,3),l+=2,H=R[k-1]):E==17?(Z=3+j(e,l,7),l+=3):E==18&&(Z=11+j(e,l,127),l+=7);Z--;)R[k++]=H}}var le=R.subarray(0,N),B=R.subarray(N);h=Pe(le),f=Pe(B),u=me(le,h,1),d=me(B,f,1)}else throw"invalid block type";else{var E=ar(l)+4,p=e[E-4]|e[E-3]<<8,y=E+p;if(y>r){if(s)throw"unexpected EOF";break}i&&a(o+p),t.set(e.subarray(E,y),o),n.b=o+=p,n.p=l=y*8;continue}if(l>T)throw"unexpected EOF"}i&&a(o+131072);for(var _=(1<<h)-1,re=(1<<f)-1,g=h+f+18;s||l+g<T;){var H=u[Ue(e,l)&_],m=H>>>4;if(l+=H&15,l>T)throw"unexpected EOF";if(!H)throw"invalid length/literal";if(m<256)t[o++]=m;else if(m==256){u=null;break}else{var b=m-254;if(m>264){var k=m-257,x=St[k];b=j(e,l,(1<<x)-1)+Ot[k],l+=x}var P=d[Ue(e,l)&re],ee=P>>>4;if(!P)throw"invalid distance";l+=P&15;var B=ir[ee];if(ee>3){var x=Rt[ee];B+=Ue(e,l)&(1<<x)-1,l+=x}if(l>T)throw"unexpected EOF";i&&a(o+131072);for(var Ft=o+b;o<Ft;o+=4)t[o]=t[o-B],t[o+1]=t[o+1-B],t[o+2]=t[o+2-B],t[o+3]=t[o+3-B];o=Ft}}n.l=u,n.p=l,n.b=o,u&&(c=1,n.m=h,n.d=d,n.n=f)}while(!c);return o==t.length?t:_t(t,0,o)},cr=function(e){if((e[0]&15)!=8||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(e[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function ur(e,t){return lr((cr(e),e.subarray(2,-4)),t)}function dr(e,t){var n=e.length;if(!t&&typeof TextEncoder<"u")return new TextEncoder().encode(e);for(var r=new V(e.length+(e.length>>>1)),i=0,s=function(o){r[i++]=o},a=0;a<n;++a){if(i+5>r.length){var c=new V(i+8+(n-a<<1));c.set(r),r=c}var l=e.charCodeAt(a);l<128||t?s(l):l<2048?(s(192|l>>>6),s(128|l&63)):l>55295&&l<57344?(l=65536+(l&1047552)|e.charCodeAt(++a)&1023,s(240|l>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|l&63)):(s(224|l>>>12),s(128|l>>>6&63),s(128|l&63))}return _t(r,0,i)}function hr(e,t){var n="";if(!t&&typeof TextDecoder<"u")return new TextDecoder().decode(e);for(var r=0;r<e.length;){var i=e[r++];i<128||t?n+=String.fromCharCode(i):i<224?n+=String.fromCharCode((i&31)<<6|e[r++]&63):i<240?n+=String.fromCharCode((i&15)<<12|(e[r++]&63)<<6|e[r++]&63):(i=((i&15)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,n+=String.fromCharCode(55296|i>>10,56320|i&1023))}return n}const Lt="v1",mr=e=>{if(typeof e!="string")return e;try{const t=JSON.parse(e);if(t.timestamp)return t}catch{}try{const t=JSON.parse(hr(ur(dr(e,!0))));if(t.v===Lt)return t;throw new Error(`These events were packed with packer ${t.v} which is incompatible with current packer ${Lt}.`)}catch(t){throw console.error(t),new Error("Unknown data format.")}};return fe.Replayer=er,fe.unpack=mr,Object.defineProperty(fe,"__esModule",{value:!0}),fe}({});
|
|
File without changes
|
|
File without changes
|