-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
player.js
51 lines (48 loc) · 111 KB
/
player.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
(()=>{var qt=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});function Yt(){}function Ve(e,t){for(let n in t)e[n]=t[n];return e}function yn(e){return e()}function _e(){return Object.create(null)}function Dt(e){e.forEach(yn)}function jn(e){return typeof e=="function"}function xe(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}function We(e){let t={};for(let n in e)n[0]!=="$"&&(t[n]=e[n]);return t}function B(e,t){e.appendChild(t)}function ht(e,t,n){e.insertBefore(t,n||null)}function ct(e){e.parentNode.removeChild(e)}function te(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function j(e){return document.createElement(e)}function Pt(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function Ct(e){return document.createTextNode(e)}function nt(){return Ct(" ")}function Ft(e,t,n,o){return e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o)}function T(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Qt(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function J(e,t,n,o){n===null?e.style.removeProperty(t):e.style.setProperty(t,n,o?"important":"")}function Et(e,t,n){e.classList[n?"add":"remove"](t)}var Vt;function Ot(e){Vt=e}function jt(){if(!Vt)throw new Error("Function called outside component initialization");return Vt}function vn(e){jt().$$.on_mount.push(e)}function Cn(e){jt().$$.on_destroy.push(e)}function qn(){let e=jt();return(t,n,{cancelable:o=!1}={})=>{let i=e.$$.callbacks[t];if(i){let s=function(r,a,{bubbles:l=!1,cancelable:u=!1}={}){let c=document.createEvent("CustomEvent");return c.initCustomEvent(r,l,u,a),c}(t,n,{cancelable:o});return i.slice().forEach(r=>{r.call(e,s)}),!s.defaultPrevented}return!0}}var xt=[],ft=[],$t=[],he=[],to=Promise.resolve(),pe=!1;function ge(e){$t.push(e)}var ee=new Set,Gt=0;function In(){let e=Vt;do{for(;Gt<xt.length;){let t=xt[Gt];Gt++,Ot(t),eo(t.$$)}for(Ot(null),xt.length=0,Gt=0;ft.length;)ft.pop()();for(let t=0;t<$t.length;t+=1){let n=$t[t];ee.has(n)||(ee.add(n),n())}$t.length=0}while(xt.length);for(;he.length;)he.pop()();pe=!1,ee.clear(),Ot(e)}function eo(e){if(e.fragment!==null){e.update(),Dt(e.before_update);let t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(ge)}}var Kt=new Set,yt;function An(){yt={r:0,c:[],p:yt}}function bn(){yt.r||Dt(yt.c),yt=yt.p}function dt(e,t){e&&e.i&&(Kt.delete(e),e.i(t))}function St(e,t,n,o){if(e&&e.o){if(Kt.has(e))return;Kt.add(e),yt.c.push(()=>{Kt.delete(e),o&&(n&&e.d(1),o())}),e.o(t)}else o&&o()}function wn(e){e&&e.c()}function ke(e,t,n,o){let{fragment:i,on_mount:s,on_destroy:r,after_update:a}=e.$$;i&&i.m(t,n),o||ge(()=>{let l=s.map(yn).filter(jn);r?r.push(...l):Dt(l),e.$$.on_mount=[]}),a.forEach(ge)}function Fe(e,t){let n=e.$$;n.fragment!==null&&(Dt(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function no(e,t){e.$$.dirty[0]===-1&&(xt.push(e),pe||(pe=!0,to.then(In)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function Oe(e,t,n,o,i,s,r,a=[-1]){let l=Vt;Ot(e);let u=e.$$={fragment:null,ctx:null,props:s,update:Yt,not_equal:i,bound:_e(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(l?l.$$.context:[])),callbacks:_e(),dirty:a,skip_bound:!1,root:t.target||l.$$.root};r&&r(u.root);let c=!1;if(u.ctx=n?n(e,t.props||{},(d,h,...C)=>{let g=C.length?C[0]:h;return u.ctx&&i(u.ctx[d],u.ctx[d]=g)&&(!u.skip_bound&&u.bound[d]&&u.bound[d](g),c&&no(e,d)),h}):[],u.update(),c=!0,Dt(u.before_update),u.fragment=!!o&&o(u.ctx),t.target){if(t.hydrate){let d=function(h){return Array.from(h.childNodes)}(t.target);u.fragment&&u.fragment.l(d),d.forEach(ct)}else u.fragment&&u.fragment.c();t.intro&&dt(e.$$.fragment),ke(e,t.target,t.anchor,t.customElement),In()}Ot(l)}var _t=class{$destroy(){Fe(this,1),this.$destroy=Yt}$on(t,n){let o=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return o.push(n),()=>{let i=o.indexOf(n);i!==-1&&o.splice(i,1)}}$set(t){var n;this.$$set&&(n=t,Object.keys(n).length!==0)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}},q;function oo(e){return e.nodeType===e.ELEMENT_NODE}(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"})(q||(q={}));var Nn=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var n;if(!t)return-1;var o=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return o??-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,o=this.getId(t);this.idNodeMap.delete(o),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 o=n.id;this.idNodeMap.set(o,t),this.nodeMetaMap.set(t,n)},e.prototype.replace=function(t,n){var o=this.getNode(t);if(o){var i=this.nodeMetaMap.get(o);i&&this.nodeMetaMap.set(n,i)}this.idNodeMap.set(t,n)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function En(){return new Nn}var Ge=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function io(e,t){t===void 0&&(t={});var n=1,o=1;function i(A){var m=A.match(/\n/g);m&&(n+=m.length);var D=A.lastIndexOf(`
`);o=D===-1?o+A.length:A.length-D}function s(){var A={line:n,column:o};return function(m){return m.position=new r(A),C(),m}}var r=function(A){this.start=A,this.end={line:n,column:o},this.source=t.source};r.prototype.content=e;var a=[];function l(A){var m=new Error("".concat(t.source||"",":").concat(n,":").concat(o,": ").concat(A));if(m.reason=A,m.filename=t.source,m.line=n,m.column=o,m.source=e,!t.silent)throw m;a.push(m)}function u(){return h(/^{\s*/)}function c(){return h(/^}/)}function d(){var A,m=[];for(C(),g(m);e.length&&e.charAt(0)!=="}"&&(A=v()||x());)A!==!1&&(m.push(A),g(m));return m}function h(A){var m=A.exec(e);if(m){var D=m[0];return i(D),e=e.slice(D.length),m}}function C(){h(/^\s*/)}function g(A){var m;for(A===void 0&&(A=[]);m=p();)m!==!1&&A.push(m),m=p();return A}function p(){var A=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 D=e.slice(2,m-2);return o+=2,i(D),e=e.slice(m),o+=2,A({type:"comment",comment:D})}}function f(){var A=h(/^([^{]+)/);if(A)return ut(A[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 A=s(),m=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(m){var D=ut(m[0]);if(!h(/^:\s*/))return l("property missing ':'");var S=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),P=A({type:"declaration",property:D.replace(Ge,""),value:S?ut(S[0]).replace(Ge,""):""});return h(/^[;\s]*/),P}}function I(){var A,m=[];if(!u())return l("missing '{'");for(g(m);A=y();)A!==!1&&(m.push(A),g(m)),A=y();return c()?m:l("missing '}'")}function N(){for(var A,m=[],D=s();A=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)m.push(A[1]),h(/^,\s*/);if(m.length)return D({type:"keyframe",values:m,declarations:I()})}var E,L=U("import"),V=U("charset"),K=U("namespace");function U(A){var m=new RegExp("^@"+A+"\\s*([^;]+);");return function(){var D=s(),S=h(m);if(S){var P={type:A};return P[A]=S[1].trim(),D(P)}}}function v(){if(e[0]==="@")return function(){var A=s(),m=h(/^@([-\w]+)?keyframes\s*/);if(m){var D=m[1];if(!(m=h(/^([-\w]+)\s*/)))return l("@keyframes missing name");var S,P=m[1];if(!u())return l("@keyframes missing '{'");for(var _=g();S=N();)_.push(S),_=_.concat(g());return c()?A({type:"keyframes",name:P,vendor:D,keyframes:_}):l("@keyframes missing '}'")}}()||function(){var A=s(),m=h(/^@media *([^{]+)/);if(m){var D=ut(m[1]);if(!u())return l("@media missing '{'");var S=g().concat(d());return c()?A({type:"media",media:D,rules:S}):l("@media missing '}'")}}()||function(){var A=s(),m=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(m)return A({type:"custom-media",name:ut(m[1]),media:ut(m[2])})}()||function(){var A=s(),m=h(/^@supports *([^{]+)/);if(m){var D=ut(m[1]);if(!u())return l("@supports missing '{'");var S=g().concat(d());return c()?A({type:"supports",supports:D,rules:S}):l("@supports missing '}'")}}()||L()||V()||K()||function(){var A=s(),m=h(/^@([-\w]+)?document *([^{]+)/);if(m){var D=ut(m[1]),S=ut(m[2]);if(!u())return l("@document missing '{'");var P=g().concat(d());return c()?A({type:"document",document:S,vendor:D,rules:P}):l("@document missing '}'")}}()||function(){var A=s();if(h(/^@page */)){var m=f()||[];if(!u())return l("@page missing '{'");for(var D,S=g();D=y();)S.push(D),S=S.concat(g());return c()?A({type:"page",selectors:m,declarations:S}):l("@page missing '}'")}}()||function(){var A=s();if(h(/^@host\s*/)){if(!u())return l("@host missing '{'");var m=g().concat(d());return c()?A({type:"host",rules:m}):l("@host missing '}'")}}()||function(){var A=s();if(h(/^@font-face\s*/)){if(!u())return l("@font-face missing '{'");for(var m,D=g();m=y();)D.push(m),D=D.concat(g());return c()?A({type:"font-face",declarations:D}):l("@font-face missing '}'")}}()}function x(){var A=s(),m=f();return m?(g(),A({type:"rule",selectors:m,declarations:I()})):l("selector missing")}return me((E=d(),{type:"stylesheet",stylesheet:{source:t.source,rules:E,parsingErrors:a}}))}function ut(e){return e?e.replace(/^\s+|\s+$/g,""):""}function me(e,t){for(var n=e&&typeof e.type=="string",o=n?e:t,i=0,s=Object.keys(e);i<s.length;i++){var r=e[s[i]];Array.isArray(r)?r.forEach(function(a){me(a,o)}):r&&typeof r=="object"&&me(r,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Ue={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"},Sn=/([^\\]):hover/,ro=new RegExp(Sn.source,"g");function Ze(e,t){var n=t?.stylesWithHoverClass.get(e);if(n)return n;var o=io(e,{silent:!0});if(!o.stylesheet)return e;var i=[];if(o.stylesheet.rules.forEach(function(a){"selectors"in a&&(a.selectors||[]).forEach(function(l){Sn.test(l)&&i.push(l)})}),i.length===0)return e;var s=new RegExp(i.filter(function(a,l){return i.indexOf(a)===l}).sort(function(a,l){return l.length-a.length}).map(function(a){return a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}).join("|"),"g"),r=e.replace(s,function(a){var l=a.replace(ro,"$1.\\:hover");return"".concat(a,", ").concat(l)});return t?.stylesWithHoverClass.set(e,r),r}function $e(){return{stylesWithHoverClass:new Map}}function so(e,t){var n=t.doc,o=t.hackCss,i=t.cache;switch(e.type){case q.Document:return n.implementation.createDocument(null,"",null);case q.DocumentType:return n.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case q.Element:var s,r=function(I){var N=Ue[I.tagName]?Ue[I.tagName]:I.tagName;return N==="link"&&I.attributes._cssText&&(N="style"),N}(e);s=e.isSVG?n.createElementNS("http://www.w3.org/2000/svg",r):n.createElement(r);var a={};for(var l in e.attributes)if(Object.prototype.hasOwnProperty.call(e.attributes,l)){var u=e.attributes[l];if(r!=="option"||l!=="selected"||u!==!1)if(u===!0&&(u=""),l.startsWith("rr_"))a[l]=u;else{var c=r==="textarea"&&l==="value",d=r==="style"&&l==="_cssText";if(d&&o&&typeof u=="string"&&(u=Ze(u,i)),!c&&!d||typeof u!="string")try{if(e.isSVG&&l==="xlink:href")s.setAttributeNS("http://www.w3.org/1999/xlink",l,u.toString());else if(l==="onload"||l==="onclick"||l.substring(0,7)==="onmouse")s.setAttribute("_"+l,u.toString());else{if(r==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&l==="content"){s.setAttribute("csp-content",u.toString());continue}r==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||r==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")||(r==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?s.setAttribute("rrweb-original-srcset",e.attributes.srcset):s.setAttribute(l,u.toString()))}}catch{}else{for(var h=n.createTextNode(u),C=0,g=Array.from(s.childNodes);C<g.length;C++){var p=g[C];p.nodeType===s.TEXT_NODE&&s.removeChild(p)}s.appendChild(h)}}}var f=function(I){var N=a[I];if(r==="canvas"&&I==="rr_dataURL"){var E=document.createElement("img");E.onload=function(){var V=s.getContext("2d");V&&V.drawImage(E,0,0,E.width,E.height)},E.src=N.toString(),s.RRNodeType&&(s.rr_dataURL=N.toString())}else if(r==="img"&&I==="rr_dataURL"){var L=s;L.currentSrc.startsWith("data:")||(L.setAttribute("rrweb-original-src",e.attributes.src),L.src=N.toString())}if(I==="rr_width")s.style.width=N.toString();else if(I==="rr_height")s.style.height=N.toString();else if(I==="rr_mediaCurrentTime"&&typeof N=="number")s.currentTime=N;else if(I==="rr_mediaState")switch(N){case"played":s.play().catch(function(V){return console.warn("media playback error",V)});break;case"paused":s.pause()}};for(var y in a)f(y);if(e.isShadowHost)if(s.shadowRoot)for(;s.shadowRoot.firstChild;)s.shadowRoot.removeChild(s.shadowRoot.firstChild);else s.attachShadow({mode:"open"});return s;case q.Text:return n.createTextNode(e.isStyle&&o?Ze(e.textContent,i):e.textContent);case q.CDATA:return n.createCDATASection(e.textContent);case q.Comment:return n.createComment(e.textContent);default:return null}}function Bt(e,t){var n=t.doc,o=t.mirror,i=t.skipChild,s=i!==void 0&&i,r=t.hackCss,a=r===void 0||r,l=t.afterAppend,u=t.cache,c=so(e,{doc:n,hackCss:a,cache:u});if(!c)return null;if(e.rootId&&o.getNode(e.rootId)!==n&&o.replace(e.rootId,n),e.type===q.Document&&(n.close(),n.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==q.DocumentType&&(e.childNodes[0].type===q.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" "">')),c=n),o.add(c,e),(e.type===q.Document||e.type===q.Element)&&!s)for(var d=0,h=e.childNodes;d<h.length;d++){var C=h[d],g=Bt(C,{doc:n,mirror:o,skipChild:!1,hackCss:a,afterAppend:l,cache:u});g?(C.isShadow&&oo(c)&&c.shadowRoot?c.shadowRoot.appendChild(g):c.appendChild(g),l&&l(g,C.id)):console.warn("Failed to rebuild",C)}return c}function ao(e,t){var n=t.doc,o=t.onVisit,i=t.hackCss,s=i===void 0||i,r=t.afterAppend,a=t.cache,l=t.mirror,u=l===void 0?new Nn:l,c=Bt(e,{doc:n,mirror:u,skipChild:!1,hackCss:s,afterAppend:r,cache:a});return function(d,h){for(var C=0,g=d.getIds();C<g.length;C++){var p=g[C];d.has(p)&&h(d.getNode(p))}}(u,function(d){o&&o(d),function(h,C){var g=C.getMeta(h);if(g?.type===q.Element){var p=h;for(var f in g.attributes)if(Object.prototype.hasOwnProperty.call(g.attributes,f)&&f.startsWith("rr_")){var y=g.attributes[f];f==="rr_scrollLeft"&&(p.scrollLeft=y),f==="rr_scrollTop"&&(p.scrollTop=y)}}}(d,u)}),c}var At=`Please stop import mirror directly. Instead of that,\r
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
or you can use record.mirror to access the mirror instance during recording.`,Ke={map:{},getId:()=>(console.error(At),-1),getNode:()=>(console.error(At),null),removeNodeFromMap(){console.error(At)},has:()=>(console.error(At),!1),reset(){console.error(At)}};function lo(e){let t={},n=(i,s)=>{let r={value:i,parent:s,children:[]};return t[i.node.id]=r,r},o=[];for(let i of e){let{nextId:s,parentId:r}=i;if(s&&s in t){let a=t[s];if(a.parent){let l=a.parent.children.indexOf(a);a.parent.children.splice(l,0,n(i,a.parent))}else{let l=o.indexOf(a);o.splice(l,0,n(i,null))}}else if(r in t){let a=t[r];a.children.push(n(i,a))}else o.push(n(i,null))}return o}function Tn(e,t){t(e.value);for(let n=e.children.length-1;n>=0;n--)Tn(e.children[n],t)}function ne(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Dn(e,t){var n,o;let i=(o=(n=e.ownerDocument)===null||n===void 0?void 0:n.defaultView)===null||o===void 0?void 0:o.frameElement;if(!i||i===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};let s=i.getBoundingClientRect(),r=Dn(i,t),a=s.height/i.clientHeight;return{x:s.x*r.relativeScale+r.x,y:s.y*r.relativeScale+r.y,relativeScale:a,absoluteScale:r.absoluteScale*a}}function Ut(e){return!!e?.shadowRoot}function kt(e,t){let n=e[t[0]];return t.length===1?n:kt(n.cssRules[t[1]].cssRules,t.slice(2))}function Ye(e){let t=[...e],n=t.pop();return{positions:t,index:n}}typeof window<"u"&&window.Proxy&&window.Reflect&&(Ke=new Proxy(Ke,{get:(e,t,n)=>(t==="map"&&console.error(At),Reflect.get(e,t,n))}));var fe=class{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){var n;return(n=this.styleIDMap.get(t))!==null&&n!==void 0?n:-1}has(t){return this.styleIDMap.has(t)}add(t,n){if(this.has(t))return this.getId(t);let o;return o=n===void 0?this.id++:n,this.styleIDMap.set(t,o),this.idStyleMap.set(o,t),o}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},Y=(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))(Y||{}),O=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e))(O||{}),tt=(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))(tt||{}),zt=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(zt||{}),G=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e.Destroy="destroy",e))(G||{});function vt(e,t,n,o){return new(n||(n=Promise))(function(i,s){function r(u){try{l(o.next(u))}catch(c){s(c)}}function a(u){try{l(o.throw(u))}catch(c){s(c)}}function l(u){var c;u.done?i(u.value):(c=u.value,c instanceof n?c:new n(function(d){d(c)})).then(r,a)}l((o=o.apply(e,t||[])).next())})}for(oe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",wt=typeof Uint8Array>"u"?[]:new Uint8Array(256),Mt=0;Mt<oe.length;Mt++)wt[oe.charCodeAt(Mt)]=Mt;var oe,wt,Mt,Mn=null;try{Pe=typeof module<"u"&&typeof module.require=="function"&&module.require("worker_threads")||typeof __non_webpack_require__=="function"&&__non_webpack_require__("worker_threads")||typeof qt=="function"&&qt("worker_threads"),Mn=Pe.Worker}catch{}var Pe;function co(e,t,n){var o=t===void 0?null:t,i=function(a,l){return Buffer.from(a,"base64").toString(l?"utf16":"utf8")}(e,n!==void 0&&n),s=i.indexOf(`
`,10)+1,r=i.substring(s)+(o?"//# sourceMappingURL="+o:"");return function(a){return new Mn(r,Object.assign({},a,{eval:!0}))}}var ie,re,se,k,uo=Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]";ie="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",re=null,se=!1,uo&&co(ie,re,se),En(),function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(k||(k={}));var ho=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var n;if(!t)return-1;var o=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return o??-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,o=this.getId(t);this.idNodeMap.delete(o),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 o=n.id;this.idNodeMap.set(o,t),this.nodeMetaMap.set(t,n)},e.prototype.replace=function(t,n){var o=this.getNode(t);if(o){var i=this.nodeMetaMap.get(o);i&&this.nodeMetaMap.set(n,i)}this.idNodeMap.set(t,n)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function Qe(e){let t=[];for(let n in e){let o=e[n];if(typeof o!="string")continue;let i=fo(n);t.push(`${i}: ${o};`)}return t.join(" ")}var po=/-([a-z])/g,go=/^--[a-zA-Z0-9-]+$/,ae=e=>go.test(e)?e:e.replace(po,(t,n)=>n?n.toUpperCase():""),mo=/\B([A-Z])/g,fo=e=>e.replace(mo,"-$1").toLowerCase(),et=class{constructor(...t){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=z.ELEMENT_NODE,this.TEXT_NODE=z.TEXT_NODE}get firstChild(){return this.childNodes[0]||null}get lastChild(){return this.childNodes[this.childNodes.length-1]||null}get nextSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes,o=n.indexOf(this);return n[o+1]||null}contains(t){if(t===this)return!0;for(let 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 Rn(e){return class extends e{constructor(t,n,o){super(),this.nodeType=z.DOCUMENT_TYPE_NODE,this.RRNodeType=k.DocumentType,this.textContent=null,this.name=t,this.publicId=n,this.systemId=o,this.nodeName=t}toString(){return"RRDocumentType"}}}function xn(e){return class extends e{constructor(t){super(),this.nodeType=z.ELEMENT_NODE,this.RRNodeType=k.Element,this.attributes={},this.shadowRoot=null,this.tagName=t.toUpperCase(),this.nodeName=t.toUpperCase()}get textContent(){let t="";return this.childNodes.forEach(n=>t+=n.textContent),t}set textContent(t){this.childNodes=[this.ownerDocument.createTextNode(t)]}get classList(){return new ye(this.attributes.class,t=>{this.attributes.class=t})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){let t=this.attributes.style?function(o){let i={},s=/:(.+)/;return o.replace(/\/\*.*?\*\//g,"").split(/;(?![^(]*\))/g).forEach(function(r){if(r){let a=r.split(s);a.length>1&&(i[ae(a[0].trim())]=a[1].trim())}}),i}(this.attributes.style):{},n=/\B([A-Z])/g;return t.setProperty=(o,i,s)=>{if(n.test(o))return;let r=ae(o);i?t[r]=i:delete t[r],s==="important"&&(t[r]+=" !important"),this.attributes.style=Qe(t)},t.removeProperty=o=>{if(n.test(o))return"";let i=ae(o),s=t[i]||"";return delete t[i],this.attributes.style=Qe(t),s},t}getAttribute(t){return this.attributes[t]||null}setAttribute(t,n){this.attributes[t]=n}setAttributeNS(t,n,o){this.setAttribute(n,o)}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);let o=this.childNodes.indexOf(n);if(o==-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(o,0,t),t.parentElement=this,t.parentNode=this,t}removeChild(t){let 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){let n=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=n,n}dispatchEvent(t){return!0}toString(){let t="";for(let n in this.attributes)t+=`${n}="${this.attributes[n]}" `;return`${this.tagName} ${t}`}}}function kn(e){return class extends e{constructor(t){super(),this.nodeType=z.TEXT_NODE,this.nodeName="#text",this.RRNodeType=k.Text,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function Fn(e){return class extends e{constructor(t){super(),this.nodeType=z.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=k.Comment,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function On(e){return class extends e{constructor(t){super(),this.nodeName="#cdata-section",this.nodeType=z.CDATA_SECTION_NODE,this.RRNodeType=k.CDATA,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}var ye=class{constructor(t,n){if(this.classes=[],this.add=(...o)=>{for(let i of o){let s=String(i);this.classes.indexOf(s)>=0||this.classes.push(s)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...o)=>{this.classes=this.classes.filter(i=>o.indexOf(i)===-1),this.onChange&&this.onChange(this.classes.join(" "))},t){let o=t.trim().split(/\s+/);this.classes.push(...o)}this.onChange=n}},z;(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"})(z||(z={}));var ve={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},yo={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 lt(e,t,n,o){let i=e.childNodes,s=t.childNodes;o=o||t.mirror||t.ownerDocument.mirror,(i.length>0||s.length>0)&&ze(Array.from(i),s,e,n,o);let r=null,a=null;switch(t.RRNodeType){case k.Document:a=t.scrollData;break;case k.Element:{let l=e,u=t;switch(function(c,d,h){let C=c.attributes,g=d.attributes;for(let p in g){let f=g[p],y=h.getMeta(d);if(y&&"isSVG"in y&&y.isSVG&&ve[p])c.setAttributeNS(ve[p],p,f);else if(d.tagName==="CANVAS"&&p==="rr_dataURL"){let I=document.createElement("img");I.src=f,I.onload=()=>{let N=c.getContext("2d");N&&N.drawImage(I,0,0,I.width,I.height)}}else c.setAttribute(p,f)}for(let{name:p}of Array.from(C))p in g||c.removeAttribute(p);d.scrollLeft&&(c.scrollLeft=d.scrollLeft),d.scrollTop&&(c.scrollTop=d.scrollTop)}(l,u,o),a=u.scrollData,r=u.inputData,u.tagName){case"AUDIO":case"VIDEO":{let c=e,d=u;d.paused!==void 0&&(d.paused?c.pause():c.play()),d.muted!==void 0&&(c.muted=d.muted),d.volume!==void 0&&(c.volume=d.volume),d.currentTime!==void 0&&(c.currentTime=d.currentTime),d.playbackRate!==void 0&&(c.playbackRate=d.playbackRate);break}case"CANVAS":{let c=t;if(c.rr_dataURL!==null){let d=document.createElement("img");d.onload=()=>{let h=l.getContext("2d");h&&h.drawImage(d,0,0,d.width,d.height)},d.src=c.rr_dataURL}c.canvasMutations.forEach(d=>n.applyCanvas(d.event,d.mutation,e))}break;case"STYLE":{let c=l.sheet;c&&t.rules.forEach(d=>n.applyStyleSheetMutation(d,c))}}if(u.shadowRoot){l.shadowRoot||l.attachShadow({mode:"open"});let c=l.shadowRoot.childNodes,d=u.shadowRoot.childNodes;(c.length>0||d.length>0)&&ze(Array.from(c),d,l.shadowRoot,n,o)}break}case k.Text:case k.Comment:case k.CDATA:e.textContent!==t.data&&(e.textContent=t.data)}if(a&&n.applyScroll(a,!0),r&&n.applyInput(r),t.nodeName==="IFRAME"){let l=e.contentDocument,u=t;if(l){let c=o.getMeta(u.contentDocument);c&&n.mirror.add(l,Object.assign({},c)),lt(l,u.contentDocument,n,o)}}}function ze(e,t,n,o,i){var s;let r,a,l=0,u=e.length-1,c=0,d=t.length-1,h=e[l],C=e[u],g=t[c],p=t[d];for(;l<=u&&c<=d;){let f=o.mirror.getId(h),y=o.mirror.getId(C),I=i.getId(g),N=i.getId(p);if(h===void 0)h=e[++l];else if(C===void 0)C=e[--u];else if(f!==-1&&f===I)lt(h,g,o,i),h=e[++l],g=t[++c];else if(y!==-1&&y===N)lt(C,p,o,i),C=e[--u],p=t[--d];else if(f!==-1&&f===N)n.insertBefore(h,C.nextSibling),lt(h,p,o,i),h=e[++l],p=t[--d];else if(y!==-1&&y===I)n.insertBefore(C,h),lt(C,g,o,i),C=e[--u],g=t[++c];else{if(!r){r={};for(let E=l;E<=u;E++){let L=e[E];L&&o.mirror.hasNode(L)&&(r[o.mirror.getId(L)]=E)}}if(a=r[i.getId(g)],a){let E=e[a];n.insertBefore(E,h),lt(E,g,o,i),e[a]=void 0}else{let E=Ce(g,o.mirror,i);n.nodeName==="#document"&&((s=o.mirror.getMeta(E))===null||s===void 0?void 0:s.type)===k.Element&&n.documentElement&&(n.removeChild(n.documentElement),e[l]=void 0,h=void 0),n.insertBefore(E,h||null),lt(E,g,o,i)}g=t[++c]}}if(l>u){let f=t[d+1],y=null;for(f&&n.childNodes.forEach(I=>{o.mirror.getId(I)===i.getId(f)&&(y=I)});c<=d;++c){let I=Ce(t[c],o.mirror,i);n.insertBefore(I,y),lt(I,t[c],o,i)}}else if(c>d)for(;l<=u;l++){let f=e[l];f&&(n.removeChild(f),o.mirror.removeNodeFromMap(f))}}function Ce(e,t,n){let o=n.getId(e),i=n.getMeta(e),s=null;if(o>-1&&(s=t.getNode(o)),s!==null)return s;switch(e.RRNodeType){case k.Document:s=new Document;break;case k.DocumentType:s=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case k.Element:{let r=e.tagName.toLowerCase();r=yo[r]||r,s=i&&"isSVG"in i&&i?.isSVG?document.createElementNS(ve.svg,r):document.createElement(e.tagName);break}case k.Text:s=document.createTextNode(e.data);break;case k.Comment:s=document.createComment(e.data);break;case k.CDATA:s=document.createCDATASection(e.data)}return i&&t.add(s,Object.assign({},i)),s}var Tt=class e extends function(t){return class Bn extends t{constructor(){super(...arguments),this.nodeType=z.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=k.Document,this.textContent=null}get documentElement(){return this.childNodes.find(o=>o.RRNodeType===k.Element&&o.tagName==="HTML")||null}get body(){var o;return((o=this.documentElement)===null||o===void 0?void 0:o.childNodes.find(i=>i.RRNodeType===k.Element&&i.tagName==="BODY"))||null}get head(){var o;return((o=this.documentElement)===null||o===void 0?void 0:o.childNodes.find(i=>i.RRNodeType===k.Element&&i.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(o){let i=o.RRNodeType;if((i===k.Element||i===k.DocumentType)&&this.childNodes.some(s=>s.RRNodeType===i))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${i===k.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);return o.parentElement=null,o.parentNode=this,this.childNodes.push(o),o}insertBefore(o,i){let s=o.RRNodeType;if((s===k.Element||s===k.DocumentType)&&this.childNodes.some(a=>a.RRNodeType===s))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${s===k.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);if(i===null)return this.appendChild(o);let r=this.childNodes.indexOf(i);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,o),o.parentElement=null,o.parentNode=this,o}removeChild(o){let i=this.childNodes.indexOf(o);if(i===-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(i,1),o.parentElement=null,o.parentNode=null,o}open(){this.childNodes=[]}close(){}write(o){let i;if(o==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?i="-//W3C//DTD XHTML 1.0 Transitional//EN":o==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(i="-//W3C//DTD HTML 4.0 Transitional//EN"),i){let s=this.createDocumentType("html",i,"");this.open(),this.appendChild(s)}}createDocument(o,i,s){return new Bn}createDocumentType(o,i,s){let r=new(Rn(et))(o,i,s);return r.ownerDocument=this,r}createElement(o){let i=new(xn(et))(o);return i.ownerDocument=this,i}createElementNS(o,i){return this.createElement(i)}createTextNode(o){let i=new(kn(et))(o);return i.ownerDocument=this,i}createComment(o){let i=new(Fn(et))(o);return i.ownerDocument=this,i}createCDATASection(o){let i=new(On(et))(o);return i.ownerDocument=this,i}toString(){return"RRDocument"}}}(et){constructor(t){super(),this.UNSERIALIZED_STARTING_ID=-2,this._unserializedId=this.UNSERIALIZED_STARTING_ID,this.mirror=new Ne,this.scrollData=null,t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,n,o){return new e}createDocumentType(t,n,o){let i=new vo(t,n,o);return i.ownerDocument=this,i}createElement(t){let n=t.toUpperCase(),o;switch(n){case"AUDIO":case"VIDEO":o=new Ie(n);break;case"IFRAME":o=new we(n,this.mirror);break;case"CANVAS":o=new Ae(n);break;case"STYLE":o=new be(n);break;default:o=new It(n)}return o.ownerDocument=this,o}createComment(t){let n=new Io(t);return n.ownerDocument=this,n}createCDATASection(t){let n=new Ao(t);return n.ownerDocument=this,n}createTextNode(t){let n=new Co(t);return n.ownerDocument=this,n}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}},vo=Rn(et),It=class extends xn(et){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}},Ie=class extends function(t){return class extends t{attachShadow(n){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}}(It){},Ae=class extends It{constructor(){super(...arguments),this.rr_dataURL=null,this.canvasMutations=[]}getContext(){return null}},be=class extends It{constructor(){super(...arguments),this.rules=[]}},we=class extends It{constructor(t,n){super(t),this.contentDocument=new Tt,this.contentDocument.mirror=n}},Co=kn(et),Io=Fn(et),Ao=On(et);function Ln(e,t,n,o){let i;switch(e.nodeType){case z.DOCUMENT_NODE:o&&o.nodeName==="IFRAME"?i=o.contentDocument:(i=t,i.compatMode=e.compatMode);break;case z.DOCUMENT_TYPE_NODE:{let r=e;i=t.createDocumentType(r.name,r.publicId,r.systemId);break}case z.ELEMENT_NODE:{let r=e,a=function(u){return u instanceof HTMLFormElement?"FORM":u.tagName.toUpperCase()}(r);i=t.createElement(a);let l=i;for(let{name:u,value:c}of Array.from(r.attributes))l.attributes[u]=c;r.scrollLeft&&(l.scrollLeft=r.scrollLeft),r.scrollTop&&(l.scrollTop=r.scrollTop);break}case z.TEXT_NODE:i=t.createTextNode(e.textContent||"");break;case z.CDATA_SECTION_NODE:i=t.createCDATASection(e.data);break;case z.COMMENT_NODE:i=t.createComment(e.textContent||"");break;case z.DOCUMENT_FRAGMENT_NODE:i=o.attachShadow({mode:"open"});break;default:return null}let s=n.getMeta(e);return t instanceof Tt&&(s||(s=Vn(i,t.unserializedId),n.add(e,s)),t.mirror.add(i,Object.assign({},s))),i}function bo(e,t=function(){return new ho}(),n=new Tt){return function o(i,s){let r=Ln(i,n,t,s);if(r!==null)if(s?.nodeName!=="IFRAME"&&i.nodeType!==z.DOCUMENT_FRAGMENT_NODE&&(s?.appendChild(r),r.parentNode=s,r.parentElement=s),i.nodeName==="IFRAME"){let a=i.contentDocument;a&&o(a,r)}else i.nodeType!==z.DOCUMENT_NODE&&i.nodeType!==z.ELEMENT_NODE&&i.nodeType!==z.DOCUMENT_FRAGMENT_NODE||(i.nodeType===z.ELEMENT_NODE&&i.shadowRoot&&o(i.shadowRoot,r),i.childNodes.forEach(a=>o(a,r)))}(e,null),n}var Ne=class{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){var n;if(!t)return-1;let o=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return o??-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){let n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(o=>this.removeNodeFromMap(o))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){let o=n.id;this.idNodeMap.set(o,t),this.nodeMetaMap.set(t,n)}replace(t,n){let o=this.getNode(t);if(o){let i=this.nodeMetaMap.get(o);i&&this.nodeMetaMap.set(n,i)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Vn(e,t){switch(e.RRNodeType){case k.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case k.DocumentType:{let n=e;return{id:t,type:e.RRNodeType,name:n.name,publicId:n.publicId,systemId:n.systemId}}case k.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case k.Text:case k.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case k.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}var ot=Uint8Array,gt=Uint16Array,Ee=Uint32Array,_n=new ot([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]),Wn=new ot([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]),wo=new ot([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Gn=function(e,t){for(var n=new gt(31),o=0;o<31;++o)n[o]=t+=1<<e[o-1];var i=new Ee(n[30]);for(o=1;o<30;++o)for(var s=n[o];s<n[o+1];++s)i[s]=s-n[o]<<5|o;return[n,i]},Un=Gn(_n,2),Zn=Un[0],No=Un[1];Zn[28]=258,No[258]=28;for($n=Gn(Wn,0)[0],Ht=new gt(32768),$=0;$<32768;++$)pt=(43690&$)>>>1|(21845&$)<<1,pt=(61680&(pt=(52428&pt)>>>2|(13107&pt)<<2))>>>4|(3855&pt)<<4,Ht[$]=((65280&pt)>>>8|(255&pt)<<8)>>>1;var pt,$n,Ht,$,Lt=function(e,t,n){for(var o=e.length,i=0,s=new gt(t);i<o;++i)++s[e[i]-1];var r,a=new gt(t);for(i=0;i<t;++i)a[i]=a[i-1]+s[i-1]<<1;if(n){r=new gt(1<<t);var l=15-t;for(i=0;i<o;++i)if(e[i])for(var u=i<<4|e[i],c=t-e[i],d=a[e[i]-1]++<<c,h=d|(1<<c)-1;d<=h;++d)r[Ht[d]>>>l]=u}else for(r=new gt(o),i=0;i<o;++i)r[i]=Ht[a[e[i]-1]++]>>>15-e[i];return r},Wt=new ot(288);for($=0;$<144;++$)Wt[$]=8;for($=144;$<256;++$)Wt[$]=9;for($=256;$<280;++$)Wt[$]=7;for($=280;$<288;++$)Wt[$]=8;var Kn=new ot(32);for($=0;$<32;++$)Kn[$]=5;var Eo=Lt(Wt,9,1),So=Lt(Kn,5,1),le=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},rt=function(e,t,n){var o=t/8>>0;return(e[o]|e[o+1]<<8)>>>(7&t)&n},ce=function(e,t){var n=t/8>>0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>>(7&t)},Yn=function(e,t,n){(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length);var o=new(e instanceof gt?gt:e instanceof Ee?Ee:ot)(n-t);return o.set(e.subarray(t,n)),o};function To(e,t){return function(n,o,i){var s=n.length,r=!o||i,a=!i||i.i;i||(i={}),o||(o=new ot(3*s));var l,u=function(it){var Be=o.length;if(it>Be){var Le=new ot(Math.max(2*Be,it));Le.set(o),o=Le}},c=i.f||0,d=i.p||0,h=i.b||0,C=i.l,g=i.d,p=i.m,f=i.n,y=8*s;do{if(!C){i.f=c=rt(n,d,1);var I=rt(n,d+1,3);if(d+=3,!I){var N=n[(S=((l=d)/8>>0)+(7&l&&1)+4)-4]|n[S-3]<<8,E=S+N;if(E>s){if(a)throw"unexpected EOF";break}r&&u(h+N),o.set(n.subarray(S,E),h),i.b=h+=N,i.p=d=8*E;continue}if(I==1)C=Eo,g=So,p=9,f=5;else{if(I!=2)throw"invalid block type";var L=rt(n,d,31)+257,V=rt(n,d+10,15)+4,K=L+rt(n,d+5,31)+1;d+=14;for(var U=new ot(K),v=new ot(19),x=0;x<V;++x)v[wo[x]]=rt(n,d+3*x,7);d+=3*V;var A=le(v),m=(1<<A)-1;if(!a&&d+K*(A+7)>y)break;var D=Lt(v,A,1);for(x=0;x<K;){var S,P=D[rt(n,d,m)];if(d+=15&P,(S=P>>>4)<16)U[x++]=S;else{var _=0,b=0;for(S==16?(b=3+rt(n,d,3),d+=2,_=U[x-1]):S==17?(b=3+rt(n,d,7),d+=3):S==18&&(b=11+rt(n,d,127),d+=7);b--;)U[x++]=_}}var F=U.subarray(0,L),R=U.subarray(L);p=le(F),f=le(R),C=Lt(F,p,1),g=Lt(R,f,1)}if(d>y)throw"unexpected EOF"}r&&u(h+131072);for(var Q=(1<<p)-1,H=(1<<f)-1,st=p+f+18;a||d+st<y;){var X=(_=C[ce(n,d)&Q])>>>4;if((d+=15&_)>y)throw"unexpected EOF";if(!_)throw"invalid length/literal";if(X<256)o[h++]=X;else{if(X==256){C=null;break}var w=X-254;if(X>264){var W=_n[x=X-257];w=rt(n,d,(1<<W)-1)+Zn[x],d+=W}var Z=g[ce(n,d)&H],at=Z>>>4;if(!Z)throw"invalid distance";if(d+=15&Z,R=$n[at],at>3&&(W=Wn[at],R+=ce(n,d)&(1<<W)-1,d+=W),d>y)throw"unexpected EOF";r&&u(h+131072);for(var M=h+w;h<M;h+=4)o[h]=o[h-R],o[h+1]=o[h+1-R],o[h+2]=o[h+2-R],o[h+3]=o[h+3-R];h=M}}i.l=C,i.p=d,i.b=h,C&&(c=1,i.m=p,i.d=g,i.n=f)}while(!c);return h==o.length?o:Yn(o,0,h)}((function(n){if((15&n[0])!=8||n[0]>>>4>7||(n[0]<<8|n[1])%31)throw"invalid zlib data";if(32&n[1])throw"invalid zlib data: preset dictionaries not supported"}(e),e.subarray(2,-4)),t)}var Do=e=>{if(typeof e!="string")return e;try{let t=JSON.parse(e);if(t.timestamp)return t}catch{}try{let t=JSON.parse(function(n,o){var i="";if(!o&&typeof TextDecoder<"u")return new TextDecoder().decode(n);for(var s=0;s<n.length;){var r=n[s++];r<128||o?i+=String.fromCharCode(r):r<224?i+=String.fromCharCode((31&r)<<6|63&n[s++]):r<240?i+=String.fromCharCode((15&r)<<12|(63&n[s++])<<6|63&n[s++]):(r=((15&r)<<18|(63&n[s++])<<12|(63&n[s++])<<6|63&n[s++])-65536,i+=String.fromCharCode(55296|r>>10,56320|1023&r))}return i}(To(function(n,o){var i=n.length;if(!o&&typeof TextEncoder<"u")return new TextEncoder().encode(n);for(var s=new ot(n.length+(n.length>>>1)),r=0,a=function(d){s[r++]=d},l=0;l<i;++l){if(r+5>s.length){var u=new ot(r+8+(i-l<<1));u.set(s),s=u}var c=n.charCodeAt(l);c<128||o?a(c):c<2048?(a(192|c>>>6),a(128|63&c)):c>55295&&c<57344?(a(240|(c=65536+(1047552&c)|1023&n.charCodeAt(++l))>>>18),a(128|c>>>12&63),a(128|c>>>6&63),a(128|63&c)):(a(224|c>>>12),a(128|c>>>6&63),a(128|63&c))}return Yn(s,0,r)}(e,!0))));if(t.v==="v1")return t;throw new Error(`These events were packed with packer ${t.v} which is incompatible with current packer v1.`)}catch(t){throw console.error(t),new Error("Unknown data format.")}};function Pn(e){return{all:e=e||new Map,on:function(t,n){var o=e.get(t);o?o.push(n):e.set(t,[n])},off:function(t,n){var o=e.get(t);o&&(n?o.splice(o.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var o=e.get(t);o&&o.slice().map(function(i){i(n)}),(o=e.get("*"))&&o.slice().map(function(i){i(t,n)})}}}var Nt,Mo=Object.freeze({__proto__:null,default:Pn});function Ro(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;let n=e.HTMLElement||e.Element,o={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:n.prototype.scroll||a,scrollIntoView:n.prototype.scrollIntoView},i=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,s=(r=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(r)?1:0);var r;function a(p,f){this.scrollLeft=p,this.scrollTop=f}function l(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 u(p,f){return f==="Y"?p.clientHeight+s<p.scrollHeight:f==="X"?p.clientWidth+s<p.scrollWidth:void 0}function c(p,f){let y=e.getComputedStyle(p,null)["overflow"+f];return y==="auto"||y==="scroll"}function d(p){let f=u(p,"Y")&&c(p,"Y"),y=u(p,"X")&&c(p,"X");return f||y}function h(p){for(;p!==t.body&&d(p)===!1;)p=p.parentNode||p.host;return p}function C(p){let f,y,I,N=(i()-p.startTime)/468;var E;N=N>1?1:N,E=N,f=.5*(1-Math.cos(Math.PI*E)),y=p.startX+(p.x-p.startX)*f,I=p.startY+(p.y-p.startY)*f,p.method.call(p.scrollable,y,I),y===p.x&&I===p.y||e.requestAnimationFrame(C.bind(e,p))}function g(p,f,y){let I,N,E,L,V=i();p===t.body?(I=e,N=e.scrollX||e.pageXOffset,E=e.scrollY||e.pageYOffset,L=o.scroll):(I=p,N=p.scrollLeft,E=p.scrollTop,L=a),C({scrollable:I,method:L,startTime:V,startX:N,startY:E,x:f,y})}e.scroll=e.scrollTo=function(){arguments[0]!==void 0&&(l(arguments[0])!==!0?g.call(e,t.body,arguments[0].left!==void 0?~~arguments[0].left:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:e.scrollY||e.pageYOffset):o.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){arguments[0]!==void 0&&(l(arguments[0])?o.scrollBy.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0):g.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(l(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");return void o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop)}let p=arguments[0].left,f=arguments[0].top;g.call(this,this,p===void 0?this.scrollLeft:~~p,f===void 0?this.scrollTop:~~f)},n.prototype.scrollBy=function(){arguments[0]!==void 0&&(l(arguments[0])!==!0?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},n.prototype.scrollIntoView=function(){if(l(arguments[0])===!0)return void o.scrollIntoView.call(this,arguments[0]===void 0||arguments[0]);let p=h(this),f=p.getBoundingClientRect(),y=this.getBoundingClientRect();p!==t.body?(g.call(this,p,p.scrollLeft+y.left-f.left,p.scrollTop+y.top-f.top),e.getComputedStyle(p).position!=="fixed"&&e.scrollBy({left:f.left,top:f.top,behavior:"smooth"})):e.scrollBy({left:y.left,top:y.top,behavior:"smooth"})}}var Se=class{constructor(t=[],n){this.timeOffset=0,this.raf=null,this.actions=t,this.speed=n.speed,this.liveMode=n.liveMode}addAction(t){if(!this.actions.length||this.actions[this.actions.length-1].delay<=t.delay)return void this.actions.push(t);let n=this.findActionIndex(t);this.actions.splice(n,0,t)}start(){this.timeOffset=0;let t=performance.now(),n=()=>{let o=performance.now();for(this.timeOffset+=(o-t)*this.speed,t=o;this.actions.length;){let i=this.actions[0];if(!(this.timeOffset>=i.delay))break;this.actions.shift(),i.doAction()}(this.actions.length>0||this.liveMode)&&(this.raf=requestAnimationFrame(n))};this.raf=requestAnimationFrame(n)}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,o=this.actions.length-1;for(;n<=o;){let i=Math.floor((n+o)/2);if(this.actions[i].delay<t.delay)n=i+1;else{if(!(this.actions[i].delay>t.delay))return i+1;o=i-1}}return n}};function He(e,t){if(e.type===Y.IncrementalSnapshot&&e.data.source===O.MouseMove&&e.data.positions&&e.data.positions.length){let n=e.data.positions[0].timeOffset,o=e.timestamp+n;return e.delay=o-t,o-t}return e.delay=e.timestamp-t,e.delay}function Je(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o,i,s=n.call(e),r=[];try{for(;(t===void 0||t-- >0)&&!(o=s.next()).done;)r.push(o.value)}catch(a){i={error:a}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return r}(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Nt||(Nt={}));var Qn={type:"xstate.init"};function ue(e){return e===void 0?[]:[].concat(e)}function bt(e){return{type:"xstate.assign",assignment:e}}function Xe(e,t){return typeof(e=typeof e=="string"&&t&&t[e]?t[e]:e)=="string"?{type:e}:typeof e=="function"?{type:e.name,exec:e}:e}function Jt(e){return function(t){return e===t}}function zn(e){return typeof e=="string"?{type:e}:e}function je(e,t){return{value:e,context:t,actions:[],changed:!1,matches:Jt(e)}}function qe(e,t,n){var o=t,i=!1;return[e.filter(function(s){if(s.type==="xstate.assign"){i=!0;var r=Object.assign({},o);return typeof s.assignment=="function"?r=s.assignment(o,n):Object.keys(s.assignment).forEach(function(a){r[a]=typeof s.assignment[a]=="function"?s.assignment[a](o,n):s.assignment[a]}),o=r,!1}return!0}),o,i]}function Hn(e,t){t===void 0&&(t={});var n=Je(qe(ue(e.states[e.initial].entry).map(function(r){return Xe(r,t.actions)}),e.context,Qn),2),o=n[0],i=n[1],s={config:e,_options:t,initialState:{value:e.initial,actions:o,context:i,matches:Jt(e.initial)},transition:function(r,a){var l,u,c=typeof r=="string"?{value:r,context:e.context}:r,d=c.value,h=c.context,C=zn(a),g=e.states[d];if(g.on){var p=ue(g.on[C.type]);try{for(var f=function(b){var F=typeof Symbol=="function"&&Symbol.iterator,R=F&&b[F],Q=0;if(R)return R.call(b);if(b&&typeof b.length=="number")return{next:function(){return b&&Q>=b.length&&(b=void 0),{value:b&&b[Q++],done:!b}}};throw new TypeError(F?"Object is not iterable.":"Symbol.iterator is not defined.")}(p),y=f.next();!y.done;y=f.next()){var I=y.value;if(I===void 0)return je(d,h);var N=typeof I=="string"?{target:I}:I,E=N.target,L=N.actions,V=L===void 0?[]:L,K=N.cond,U=K===void 0?function(){return!0}:K,v=E===void 0,x=E??d,A=e.states[x];if(U(h,C)){var m=Je(qe((v?ue(V):[].concat(g.exit,V,A.entry).filter(function(b){return b})).map(function(b){return Xe(b,s._options.actions)}),h,C),3),D=m[0],S=m[1],P=m[2],_=E??d;return{value:_,context:S,actions:D,changed:E!==d||D.length>0||P,matches:Jt(_)}}}}catch(b){l={error:b}}finally{try{y&&!y.done&&(u=f.return)&&u.call(f)}finally{if(l)throw l.error}}}return je(d,h)}};return s}var tn=function(e,t){return e.actions.forEach(function(n){var o=n.exec;return o&&o(e.context,t)})};function Jn(e){var t=e.initialState,n=Nt.NotStarted,o=new Set,i={_machine:e,send:function(s){n===Nt.Running&&(t=e.transition(t,s),tn(t,zn(s)),o.forEach(function(r){return r(t)}))},subscribe:function(s){return o.add(s),s(t),{unsubscribe:function(){return o.delete(s)}}},start:function(s){if(s){var r=typeof s=="object"?s:{context:e.config.context,value:s};t={value:r.value,actions:[],context:r.context,matches:Jt(r.value)}}return n=Nt.Running,tn(t,Qn),i},stop:function(){return n=Nt.Stopped,o.clear(),i},get state(){return t},get status(){return n}};return i}function xo(e,{getCastFn:t,applyEventsSynchronously:n,emitter:o}){let i=Hn({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:bt({lastPlayedEvent:(s,r)=>r.type==="CAST_EVENT"?r.payload.event:s.lastPlayedEvent}),recordTimeOffset:bt((s,r)=>{let a=s.timeOffset;return"payload"in r&&"timeOffset"in r.payload&&(a=r.payload.timeOffset),Object.assign(Object.assign({},s),{timeOffset:a,baselineTime:s.events[0].timestamp+a})}),play(s){var r;let{timer:a,events:l,baselineTime:u,lastPlayedEvent:c}=s;a.clear();for(let g of l)He(g,u);let d=function(g,p){for(let f=g.length-1;f>=0;f--){let y=g[f];if(y.type===Y.Meta&&y.timestamp<=p)return g.slice(f)}return g}(l,u),h=c?.timestamp;c?.type===Y.IncrementalSnapshot&&c.data.source===O.MouseMove&&(h=c.timestamp+((r=c.data.positions[0])===null||r===void 0?void 0:r.timeOffset)),u<(h||0)&&o.emit(G.PlayBack);let C=new Array;for(let g of d)if(!(h&&h<u&&(g.timestamp<=h||g===c)))if(g.timestamp<u)C.push(g);else{let p=t(g,!1);a.addAction({doAction:()=>{p()},delay:g.delay})}n(C),o.emit(G.Flush),a.start()},pause(s){s.timer.clear()},resetLastPlayedEvent:bt(s=>Object.assign(Object.assign({},s),{lastPlayedEvent:null})),startLive:bt({baselineTime:(s,r)=>(s.timer.toggleLiveMode(!0),s.timer.start(),r.type==="TO_LIVE"&&r.payload.baselineTime?r.payload.baselineTime:Date.now())}),addEvent:bt((s,r)=>{let{baselineTime:a,timer:l,events:u}=s;if(r.type==="ADD_EVENT"){let{event:c}=r.payload;He(c,a);let d=u.length-1;if(!u[d]||u[d].timestamp<=c.timestamp)u.push(c);else{let g=-1,p=0;for(;p<=d;){let f=Math.floor((p+d)/2);u[f].timestamp<=c.timestamp?p=f+1:d=f-1}g===-1&&(g=p),u.splice(g,0,c)}let h=c.timestamp<a,C=t(c,h);h?C():l.isActive()&&l.addAction({doAction:()=>{C()},delay:c.delay})}return Object.assign(Object.assign({},s),{events:u})})}});return Jn(i)}var en=new Map;function Xn(e,t){let n=en.get(e);return n||(n=new Map,en.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}function mt(e,t,n){return o=>vt(this,void 0,void 0,function*(){if(o&&typeof o=="object"&&"rr_type"in o){if(n&&(n.isUnchanged=!1),o.rr_type==="ImageBitmap"&&"args"in o){let i=yield mt(e,t,n)(o.args);return yield createImageBitmap.apply(null,i)}if("index"in o){if(n||t===null)return o;let{rr_type:i,index:s}=o;return Xn(t,i)[s]}if("args"in o){let{rr_type:i,args:s}=o;return new window[i](...yield Promise.all(s.map(mt(e,t,n))))}if("base64"in o)return function(i){var s,r,a,l,u,c=.75*i.length,d=i.length,h=0;i[i.length-1]==="="&&(c--,i[i.length-2]==="="&&c--);var C=new ArrayBuffer(c),g=new Uint8Array(C);for(s=0;s<d;s+=4)r=wt[i.charCodeAt(s)],a=wt[i.charCodeAt(s+1)],l=wt[i.charCodeAt(s+2)],u=wt[i.charCodeAt(s+3)],g[h++]=r<<2|a>>4,g[h++]=(15&a)<<4|l>>2,g[h++]=(3&l)<<6|63&u;return C}(o.base64);if("src"in o){let i=e.get(o.src);if(i)return i;{let s=new Image;return s.src=o.src,e.set(o.src,s),s}}if("data"in o&&o.rr_type==="Blob"){let i=yield Promise.all(o.data.map(mt(e,t,n)));return new Blob(i,{type:o.type})}}else if(Array.isArray(o))return yield Promise.all(o.map(mt(e,t,n)));return o})}var ko=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function Fo({mutation:e,target:t,type:n,imageMap:o,errorHandler:i}){return vt(this,void 0,void 0,function*(){try{let s=function(l,u){try{return u===zt.WebGL?l.getContext("webgl")||l.getContext("experimental-webgl"):l.getContext("webgl2")}catch{return null}}(t,n);if(!s)return;if(e.setter)return void(s[e.property]=e.args[0]);let r=s[e.property],a=yield Promise.all(e.args.map(mt(o,s)));(function(l,u){if(!u?.constructor)return;let{name:c}=u.constructor;if(!ko.includes(c))return;let d=Xn(l,c);d.includes(u)||d.push(u)})(s,r.apply(s,a))}catch(s){i(e,s)}})}function Oo({event:e,mutation:t,target:n,imageMap:o,errorHandler:i}){return vt(this,void 0,void 0,function*(){try{let s=n.getContext("2d");if(t.setter)return void(s[t.property]=t.args[0]);let r=s[t.property];if(t.property==="drawImage"&&typeof t.args[0]=="string")o.get(e),r.apply(s,t.args);else{let a=yield Promise.all(t.args.map(mt(o,s)));r.apply(s,a)}}catch(s){i(t,s)}})}function nn({event:e,mutation:t,target:n,imageMap:o,canvasEventMap:i,errorHandler:s}){return vt(this,void 0,void 0,function*(){try{let r=i.get(e)||t,a="commands"in r?r.commands:[r];if([zt.WebGL,zt.WebGL2].includes(t.type)){for(let l=0;l<a.length;l++){let u=a[l];yield Fo({mutation:u,type:t.type,target:n,imageMap:o,errorHandler:s})}return}for(let l=0;l<a.length;l++){let u=a[l];yield Oo({event:e,mutation:u,target:n,imageMap:o,errorHandler:s})}}catch(r){s(t,r)}})}var Bo=Pn||Mo,de={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function on(e){return e.type==Y.IncrementalSnapshot&&(e.data.source==O.TouchMove||e.data.source==O.MouseInteraction&&e.data.type==tt.TouchStart)}var Te=class{constructor(t,n){if(this.usingVirtualDom=!1,this.virtualDom=new Tt,this.mouseTail=null,this.tailPositions=[],this.emitter=Bo(),this.legacy_missingNodeRetryMap={},this.cache=$e(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=En(),this.styleMirror=new fe,this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,this.lastSelectionData=null,this.constructedStyleMutations=[],this.adoptedStyleSheets=[],this.handleResize=a=>{this.iframe.style.display="inherit";for(let l of[this.mouseTail,this.iframe])l&&(l.setAttribute("width",String(a.width)),l.setAttribute("height",String(a.height)))},this.applyEventsSynchronously=a=>{for(let l of a){switch(l.type){case Y.DomContentLoaded:case Y.Load:case Y.Custom:continue;case Y.FullSnapshot:case Y.Meta:case Y.Plugin:case Y.IncrementalSnapshot:}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=(a,l=!1)=>{let u;switch(a.type){case Y.DomContentLoaded:case Y.Load:break;case Y.Custom:u=()=>{this.emitter.emit(G.CustomEvent,a)};break;case Y.Meta:u=()=>this.emitter.emit(G.Resize,{width:a.data.width,height:a.data.height});break;case Y.FullSnapshot:u=()=>{var c;if(this.firstFullSnapshot){if(this.firstFullSnapshot===a)return void(this.firstFullSnapshot=!0)}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(a,l),(c=this.iframe.contentWindow)===null||c===void 0||c.scrollTo(a.data.initialOffset),this.styleMirror.reset()};break;case Y.IncrementalSnapshot:u=()=>{if(this.applyIncremental(a,l),!l&&(a===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(let c of this.service.state.context.events)if(!(c.timestamp<=a.timestamp)&&this.isUserInteraction(c)){c.delay-a.delay>1e4*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=c);break}if(this.nextUserInteractionEvent){let c=this.nextUserInteractionEvent.delay-a.delay,d={speed:Math.min(Math.round(c/5e3),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:d}),this.emitter.emit(G.SkipStart,d)}}}}return()=>{u&&u();for(let d of this.config.plugins||[])d.handler&&d.handler(a,l,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:a}});let c=this.service.state.context.events.length-1;if(a===this.service.state.context.events[c]){let d=()=>{c<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(G.Finish))};a.type===Y.IncrementalSnapshot&&a.data.source===O.MouseMove&&a.data.positions.length?setTimeout(()=>{d()},Math.max(0,50-a.data.positions[0].timeOffset)):d()}this.emitter.emit(G.EventCast,a)}},!n?.liveMode&&t.length<2)throw new Error("Replayer need at least 2 events.");let o={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:de,useVirtualDom:!0};this.config=Object.assign({},o,n),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(G.Resize,this.handleResize),this.setupDom();for(let a of this.config.plugins||[])a.getMirror&&a.getMirror({nodeMirror:this.mirror});this.emitter.on(G.Flush,()=>{if(this.usingVirtualDom){let a={mirror:this.mirror,applyCanvas:(l,u,c)=>{nn({event:l,mutation:u,target:c,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(l,u)=>{l.source===O.StyleSheetRule?this.applyStyleSheetRule(l,u):l.source===O.StyleDeclaration&&this.applyStyleDeclaration(l,u)}};if(this.iframe.contentDocument&<(this.iframe.contentDocument,this.virtualDom,a,this.virtualDom.mirror),this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(let l in this.legacy_missingNodeRetryMap)try{let u=this.legacy_missingNodeRetryMap[l],c=Ce(u.node,this.mirror,this.virtualDom.mirror);lt(c,u.node,a,this.virtualDom.mirror),u.node=c}catch(u){this.config.showWarning&&console.warn(u)}this.constructedStyleMutations.forEach(l=>{this.applyStyleSheetMutation(l)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(l=>{this.applyAdoptedStyleSheet(l)}),this.adoptedStyleSheets=[]}this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(G.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset()});let i=new Se([],{speed:this.config.speed,liveMode:this.config.liveMode});this.service=xo({events:t.map(a=>n&&n.unpackFn?n.unpackFn(a):a).sort((a,l)=>a.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(a=>{this.emitter.emit(G.StateChange,{player:a})}),this.speedService=Jn(Hn({id:"speed",context:{normalSpeed:-1,timer:i},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:(a,l)=>{"payload"in l&&a.timer.setSpeed(l.payload.speed)},recordSpeed:bt({normalSpeed:a=>a.timer.speed}),restoreSpeed:a=>{a.timer.setSpeed(a.normalSpeed)}}})),this.speedService.start(),this.speedService.subscribe(a=>{this.emitter.emit(G.StateChange,{speed:a})});let s=this.service.state.context.events.find(a=>a.type===Y.Meta),r=this.service.state.context.events.find(a=>a.type===Y.FullSnapshot);if(s){let{width:a,height:l}=s.data;setTimeout(()=>{this.emitter.emit(G.Resize,{width:a,height:l})},0)}r&&setTimeout(()=>{var a;this.firstFullSnapshot||(this.firstFullSnapshot=r,this.rebuildFullSnapshot(r),(a=this.iframe.contentWindow)===null||a===void 0||a.scrollTo(r.data.initialOffset))},1),this.service.state.context.events.find(on)&&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(),t.speed!==void 0&&this.speedService.send({type:"SET_SPEED",payload:{speed:t.speed}}),t.mouseTail!==void 0&&(t.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getMetaData(){let 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(){let{baselineTime:t,events:n}=this.service.state.context;return t-n[0].timestamp}getMirror(){return this.mirror}play(t=0){var n,o;this.service.state.matches("paused")||this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:t}}),(o=(n=this.iframe.contentDocument)===null||n===void 0?void 0:n.getElementsByTagName("html")[0])===null||o===void 0||o.classList.remove("rrweb-paused"),this.emitter.emit(G.Start)}pause(t){var n,o;t===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof t=="number"&&(this.play(t),this.service.send({type:"PAUSE"})),(o=(n=this.iframe.contentDocument)===null||n===void 0?void 0:n.getElementsByTagName("html")[0])===null||o===void 0||o.classList.add("rrweb-paused"),this.emitter.emit(G.Pause)}resume(t=0){console.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(t),this.emitter.emit(G.Resume)}destroy(){this.pause(),this.config.root.removeChild(this.wrapper),this.emitter.emit(G.Destroy)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){let n=this.config.unpackFn?this.config.unpackFn(t):t;on(n)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:n}}))}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=$e()}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");let 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&&(Ro(this.iframe.contentWindow,this.iframe.contentDocument),function(n=window){"NodeList"in n&&!n.NodeList.prototype.forEach&&(n.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in n&&!n.DOMTokenList.prototype.forEach&&(n.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...o)=>{let i=o[0];if(!(0 in o))throw new TypeError("1 argument is required");do if(this===i)return!0;while(i=i&&i.parentNode);return!1})}(this.iframe.contentWindow))}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={};let o=[],i=(a,l)=>{this.collectIframeAndAttachDocument(o,a);for(let u of this.config.plugins||[])u.onBuild&&u.onBuild(a,{id:l,replayer:this})};ao(t.data.node,{doc:this.iframe.contentDocument,afterAppend:i,cache:this.cache,mirror:this.mirror}),i(this.iframe.contentDocument,t.data.node.id);for(let{mutationInQueue:a,builtNode:l}of o)this.attachDocumentToIframe(a,l),this.newDocumentQueue=this.newDocumentQueue.filter(u=>u!==a);let{documentElement:s,head:r}=this.iframe.contentDocument;this.insertStyleRules(s,r),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(G.FullsnapshotRebuilded,t),n||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,n){var o;let i=(s=this.config.blockClass,[`.${s} { background: currentColor }`,"noscript { display: none !important; }"]).concat(this.config.insertStyleRules);var s;if(this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){let r=this.virtualDom.createElement("style");this.virtualDom.mirror.add(r,Vn(r,this.virtualDom.unserializedId)),t.insertBefore(r,n),r.rules.push({source:O.StyleSheetRule,adds:i.map((a,l)=>({rule:a,index:l}))})}else{let r=document.createElement("style");t.insertBefore(r,n);for(let a=0;a<i.length;a++)(o=r.sheet)===null||o===void 0||o.insertRule(i[a],a)}}attachDocumentToIframe(t,n){let o=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[],s=(r,a)=>{this.collectIframeAndAttachDocument(i,r);let l=o.getMeta(r);if(l?.type===q.Element&&l?.tagName.toUpperCase()==="HTML"){let{documentElement:u,head:c}=n.contentDocument;this.insertStyleRules(u,c)}for(let u of this.config.plugins||[])u.onBuild&&u.onBuild(r,{id:a,replayer:this})};Bt(t.node,{doc:n.contentDocument,mirror:o,hackCss:!0,skipChild:!1,afterAppend:s,cache:this.cache}),s(n.contentDocument,t.node.id);for(let{mutationInQueue:r,builtNode:a}of i)this.attachDocumentToIframe(r,a),this.newDocumentQueue=this.newDocumentQueue.filter(l=>l!==r)}collectIframeAndAttachDocument(t,n){if(ne(n,this.mirror)){let o=this.newDocumentQueue.find(i=>i.parentId===this.mirror.getId(n));o&&t.push({mutationInQueue:o,builtNode:n})}}waitForStylesheetLoad(){var t;let n=(t=this.iframe.contentDocument)===null||t===void 0?void 0:t.head;if(n){let o=new Set,i,s=this.service.state,r=()=>{s=this.service.state};this.emitter.on(G.Start,r),this.emitter.on(G.Pause,r);let a=()=>{this.emitter.off(G.Start,r),this.emitter.off(G.Pause,r)};n.querySelectorAll('link[rel="stylesheet"]').forEach(l=>{l.sheet||(o.add(l),l.addEventListener("load",()=>{o.delete(l),o.size===0&&i!==-1&&(s.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(G.LoadStylesheetEnd),i&&clearTimeout(i),a())}))}),o.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(G.LoadStylesheetStart),i=setTimeout(()=>{s.matches("playing")&&this.play(this.getCurrentTime()),i=-1,a()},this.config.loadTimeout))}}preloadAllImages(){return vt(this,void 0,void 0,function*(){this.service.state;let t=()=>{this.service.state};this.emitter.on(G.Start,t),this.emitter.on(G.Pause,t);let n=[];for(let o of this.service.state.context.events)o.type===Y.IncrementalSnapshot&&o.data.source===O.CanvasMutation&&(n.push(this.deserializeAndPreloadCanvasEvents(o.data,o)),("commands"in o.data?o.data.commands:[o.data]).forEach(i=>{this.preloadImages(i,o)}));return Promise.all(n)})}preloadImages(t,n){if(t.property==="drawImage"&&typeof t.args[0]=="string"&&!this.imageMap.has(n)){let o=document.createElement("canvas"),i=o.getContext("2d"),s=i?.createImageData(o.width,o.height);s?.data,JSON.parse(t.args[0]),i?.putImageData(s,0,0)}}deserializeAndPreloadCanvasEvents(t,n){return vt(this,void 0,void 0,function*(){if(!this.canvasEventMap.has(n)){let o={isUnchanged:!0};if("commands"in t){let i=yield Promise.all(t.commands.map(s=>vt(this,void 0,void 0,function*(){let r=yield Promise.all(s.args.map(mt(this.imageMap,null,o)));return Object.assign(Object.assign({},s),{args:r})})));o.isUnchanged===!1&&this.canvasEventMap.set(n,Object.assign(Object.assign({},t),{commands:i}))}else{let i=yield Promise.all(t.args.map(mt(this.imageMap,null,o)));o.isUnchanged===!1&&this.canvasEventMap.set(n,Object.assign(Object.assign({},t),{args:i}))}}})}applyIncremental(t,n){var o,i,s;let{data:r}=t;switch(r.source){case O.Mutation:try{this.applyMutation(r,n)}catch(a){this.warn(`Exception in mutation ${a.message||a}`,r)}break;case O.Drag:case O.TouchMove:case O.MouseMove:if(n){let a=r.positions[r.positions.length-1];this.mousePos={x:a.x,y:a.y,id:a.id,debugData:r}}else r.positions.forEach(a=>{let l={doAction:()=>{this.moveAndHover(a.x,a.y,a.id,n,r)},delay:a.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(l)}),this.timer.addAction({doAction(){},delay:t.delay-((o=r.positions[0])===null||o===void 0?void 0:o.timeOffset)});break;case O.MouseInteraction:{if(r.id===-1||n)break;let a=new Event(tt[r.type].toLowerCase()),l=this.mirror.getNode(r.id);if(!l)return this.debugNodeNotFound(r,r.id);this.emitter.emit(G.MouseInteraction,{type:r.type,target:l});let{triggerFocus:u}=this.config;switch(r.type){case tt.Blur:"blur"in l&&l.blur();break;case tt.Focus:u&&l.focus&&l.focus({preventScroll:!0});break;case tt.Click:case tt.TouchStart:case tt.TouchEnd:n?(r.type===tt.TouchStart?this.touchActive=!0:r.type===tt.TouchEnd&&(this.touchActive=!1),this.mousePos={x:r.x,y:r.y,id:r.id,debugData:r}):(r.type===tt.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(r.x,r.y,r.id,n,r),r.type===tt.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):r.type===tt.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):r.type===tt.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case tt.TouchCancel:n?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:l.dispatchEvent(a)}break}case O.Scroll:if(r.id===-1)break;if(this.usingVirtualDom){let a=this.virtualDom.mirror.getNode(r.id);if(!a)return this.debugNodeNotFound(r,r.id);a.scrollData=r;break}this.applyScroll(r,n);break;case O.ViewportResize:this.emitter.emit(G.Resize,{width:r.width,height:r.height});break;case O.Input:if(r.id===-1)break;if(this.usingVirtualDom){let a=this.virtualDom.mirror.getNode(r.id);if(!a)return this.debugNodeNotFound(r,r.id);a.inputData=r;break}this.applyInput(r);break;case O.MediaInteraction:{let a=this.usingVirtualDom?this.virtualDom.mirror.getNode(r.id):this.mirror.getNode(r.id);if(!a)return this.debugNodeNotFound(r,r.id);let l=a;try{r.currentTime&&(l.currentTime=r.currentTime),r.volume&&(l.volume=r.volume),r.muted&&(l.muted=r.muted),r.type===1&&l.pause(),r.type===0&&l.play(),r.type===4&&(l.playbackRate=r.playbackRate)}catch(u){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${u.message||u}`)}break}case O.StyleSheetRule:case O.StyleDeclaration:this.usingVirtualDom?r.styleId?this.constructedStyleMutations.push(r):r.id&&((i=this.virtualDom.mirror.getNode(r.id))===null||i===void 0||i.rules.push(r)):this.applyStyleSheetMutation(r);break;case O.CanvasMutation:if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){let a=this.virtualDom.mirror.getNode(r.id);if(!a)return this.debugNodeNotFound(r,r.id);a.canvasMutations.push({event:t,mutation:r})}else{let a=this.mirror.getNode(r.id);if(!a)return this.debugNodeNotFound(r,r.id);nn({event:t,mutation:r,target:a,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break;case O.Font:try{let a=new FontFace(r.family,r.buffer?new Uint8Array(JSON.parse(r.fontSource)):r.fontSource,r.descriptors);(s=this.iframe.contentDocument)===null||s===void 0||s.fonts.add(a)}catch(a){this.config.showWarning&&console.warn(a)}break;case O.Selection:if(n){this.lastSelectionData=r;break}this.applySelection(r);break;case O.AdoptedStyleSheet:this.usingVirtualDom?this.adoptedStyleSheets.push(r):this.applyAdoptedStyleSheet(r)}}applyMutation(t,n){if(this.config.useVirtualDom&&!this.usingVirtualDom&&n&&(this.usingVirtualDom=!0,bo(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(let l in this.legacy_missingNodeRetryMap)try{let u=this.legacy_missingNodeRetryMap[l],c=Ln(u.node,this.virtualDom,this.mirror);c&&(u.node=c)}catch(u){this.config.showWarning&&console.warn(u)}let o=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;t.removes.forEach(l=>{var u;let c=o.getNode(l.id);if(!c)return t.removes.find(h=>h.id===l.parentId)?void 0:this.warnNodeNotFound(t,l.id);let d=o.getNode(l.parentId);if(!d)return this.warnNodeNotFound(t,l.parentId);if(l.isShadow&&Ut(d)&&(d=d.shadowRoot),o.removeNodeFromMap(c),d)try{d.removeChild(c),this.usingVirtualDom&&c.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)===null||u===void 0?void 0:u.length)>0&&(d.rules=[])}catch(h){if(!(h instanceof DOMException))throw h;this.warn("parent could not remove child in mutation",d,c,t)}});let i=Object.assign({},this.legacy_missingNodeRetryMap),s=[],r=l=>{var u;if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");let c=o.getNode(l.parentId);if(!c)return l.node.type===q.Document?this.newDocumentQueue.push(l):s.push(l);l.node.isShadow&&(Ut(c)||c.attachShadow({mode:"open"}),c=c.shadowRoot);let d=null,h=null;if(l.previousId&&(d=o.getNode(l.previousId)),l.nextId&&(h=o.getNode(l.nextId)),(y=>{let I=null;return y.nextId&&(I=o.getNode(y.nextId)),y.nextId!==null&&y.nextId!==void 0&&y.nextId!==-1&&!I})(l))return s.push(l);if(l.node.rootId&&!o.getNode(l.node.rootId))return;let C=l.node.rootId?o.getNode(l.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(ne(c,o))return void this.attachDocumentToIframe(l,c);let g=(y,I)=>{for(let N of this.config.plugins||[])N.onBuild&&N.onBuild(y,{id:I,replayer:this})},p=Bt(l.node,{doc:C,mirror:o,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:g});if(l.previousId===-1||l.nextId===-1)return void(i[l.node.id]={node:p,mutation:l});let f=o.getMeta(c);if(f&&f.type===q.Element&&f.tagName==="textarea"&&l.node.type===q.Text){let y=Array.isArray(c.childNodes)?c.childNodes:Array.from(c.childNodes);for(let I of y)I.nodeType===c.TEXT_NODE&&c.removeChild(I)}if(d&&d.nextSibling&&d.nextSibling.parentNode)c.insertBefore(p,d.nextSibling);else if(h&&h.parentNode)c.contains(h)?c.insertBefore(p,h):c.insertBefore(p,null);else{if(c===C)for(;C.firstChild;)C.removeChild(C.firstChild);c.appendChild(p)}if(g(p,l.node.id),this.usingVirtualDom&&p.nodeName==="#text"&&c.nodeName==="STYLE"&&((u=c.rules)===null||u===void 0?void 0:u.length)>0&&(c.rules=[]),ne(p,this.mirror)){let y=this.mirror.getId(p),I=this.newDocumentQueue.find(N=>N.parentId===y);I&&(this.attachDocumentToIframe(I,p),this.newDocumentQueue=this.newDocumentQueue.filter(N=>N!==I))}(l.previousId||l.nextId)&&this.legacy_resolveMissingNode(i,c,p,l)};t.adds.forEach(l=>{r(l)});let a=Date.now();for(;s.length;){let l=lo(s);if(s.length=0,Date.now()-a>500){this.warn("Timeout in the loop, please check the resolve tree data:",l);break}for(let u of l)o.getNode(u.value.parentId)?Tn(u,c=>{r(c)}):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),function(l){let u=new Set,c=[];for(let d=l.length;d--;){let h=l[d];u.has(h.id)||(c.push(h),u.add(h.id))}return c}(t.texts).forEach(l=>{var u;let c=o.getNode(l.id);if(!c)return t.removes.find(d=>d.id===l.id)?void 0:this.warnNodeNotFound(t,l.id);if(c.textContent=l.value,this.usingVirtualDom){let d=c.parentNode;((u=d?.rules)===null||u===void 0?void 0:u.length)>0&&(d.rules=[])}}),t.attributes.forEach(l=>{let u=o.getNode(l.id);if(!u)return t.removes.find(c=>c.id===l.id)?void 0:this.warnNodeNotFound(t,l.id);for(let c in l.attributes)if(typeof c=="string"){let d=l.attributes[c];if(d===null)u.removeAttribute(c);else if(typeof d=="string")try{if(c==="_cssText"&&(u.nodeName==="LINK"||u.nodeName==="STYLE"))try{let h=o.getMeta(u);Object.assign(h.attributes,l.attributes);let C=Bt(h,{doc:u.ownerDocument,mirror:o,skipChild:!0,hackCss:!0,cache:this.cache}),g=u.nextSibling,p=u.parentNode;if(C&&p){p.removeChild(u),p.insertBefore(C,g),o.replace(l.id,C);break}}catch{}u.setAttribute(c,d)}catch(h){this.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",h)}else if(c==="style"){let h=d,C=u;for(let g in h)if(h[g]===!1)C.style.removeProperty(g);else if(h[g]instanceof Array){let p=h[g];C.style.setProperty(g,p[0],p[1])}else{let p=h[g];C.style.setProperty(g,p)}}}})}applyScroll(t,n){var o,i;let s=this.mirror.getNode(t.id);if(!s)return this.debugNodeNotFound(t,t.id);let r=this.mirror.getMeta(s);if(s===this.iframe.contentDocument)(o=this.iframe.contentWindow)===null||o===void 0||o.scrollTo({top:t.y,left:t.x,behavior:n?"auto":"smooth"});else if(r?.type===q.Document)(i=s.defaultView)===null||i===void 0||i.scrollTo({top:t.y,left:t.x,behavior:n?"auto":"smooth"});else try{s.scrollTo({top:t.y,left:t.x,behavior:n?"auto":"smooth"})}catch{}}applyInput(t){let n=this.mirror.getNode(t.id);if(!n)return this.debugNodeNotFound(t,t.id);try{n.checked=t.isChecked,n.value=t.text}catch{}}applySelection(t){try{let n=new Set,o=t.ranges.map(({start:i,startOffset:s,end:r,endOffset:a})=>{let l=this.mirror.getNode(i),u=this.mirror.getNode(r);if(!l||!u)return;let c=new Range;c.setStart(l,s),c.setEnd(u,a);let d=l.ownerDocument,h=d?.getSelection();return h&&n.add(h),{range:c,selection:h}});n.forEach(i=>i.removeAllRanges()),o.forEach(i=>{var s;return i&&((s=i.selection)===null||s===void 0?void 0:s.addRange(i.range))})}catch{}}applyStyleSheetMutation(t){var n;let o=null;t.styleId?o=this.styleMirror.getStyle(t.styleId):t.id&&(o=((n=this.mirror.getNode(t.id))===null||n===void 0?void 0:n.sheet)||null),o&&(t.source===O.StyleSheetRule?this.applyStyleSheetRule(t,o):t.source===O.StyleDeclaration&&this.applyStyleDeclaration(t,o))}applyStyleSheetRule(t,n){var o,i,s,r;if((o=t.adds)===null||o===void 0||o.forEach(({rule:a,index:l})=>{try{if(Array.isArray(l)){let{positions:u,index:c}=Ye(l);kt(n.cssRules,u).insertRule(a,c)}else{let u=l===void 0?void 0:Math.min(l,n.cssRules.length);n?.insertRule(a,u)}}catch{}}),(i=t.removes)===null||i===void 0||i.forEach(({index:a})=>{try{if(Array.isArray(a)){let{positions:l,index:u}=Ye(a);kt(n.cssRules,l).deleteRule(u||0)}else n?.deleteRule(a)}catch{}}),t.replace)try{(s=n.replace)===null||s===void 0||s.call(n,t.replace)}catch{}if(t.replaceSync)try{(r=n.replaceSync)===null||r===void 0||r.call(n,t.replaceSync)}catch{}}applyStyleDeclaration(t,n){t.set&&kt(n.rules,t.index).style.setProperty(t.set.property,t.set.value,t.set.priority),t.remove&&kt(n.rules,t.index).style.removeProperty(t.remove.property)}applyAdoptedStyleSheet(t){var n;let o=this.mirror.getNode(t.id);if(!o)return;(n=t.styles)===null||n===void 0||n.forEach(r=>{var a;let l=null,u=null;if(Ut(o)?u=((a=o.ownerDocument)===null||a===void 0?void 0:a.defaultView)||null:o.nodeName==="#document"&&(u=o.defaultView),u)try{l=new u.CSSStyleSheet,this.styleMirror.add(l,r.styleId),this.applyStyleSheetRule({source:O.StyleSheetRule,adds:r.rules},l)}catch{}});let i=0,s=(r,a)=>{let l=a.map(u=>this.styleMirror.getStyle(u)).filter(u=>u!==null);Ut(r)?r.shadowRoot.adoptedStyleSheets=l:r.nodeName==="#document"&&(r.adoptedStyleSheets=l),l.length!==a.length&&i<10&&(setTimeout(()=>s(r,a),0+100*i),i++)};s(o,t.styleIds)}legacy_resolveMissingNode(t,n,o,i){let{previousId:s,nextId:r}=i,a=s&&t[s],l=r&&t[r];if(a){let{node:u,mutation:c}=a;n.insertBefore(u,o),delete t[c.node.id],delete this.legacy_missingNodeRetryMap[c.node.id],(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(t,n,u,c)}if(l){let{node:u,mutation:c}=l;n.insertBefore(u,o.nextSibling),delete t[c.node.id],delete this.legacy_missingNodeRetryMap[c.node.id],(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(t,n,u,c)}}moveAndHover(t,n,o,i,s){let r=this.mirror.getNode(o);if(!r)return this.debugNodeNotFound(s,o);let a=Dn(r,this.iframe),l=t*a.absoluteScale+a.x,u=n*a.absoluteScale+a.y;this.mouse.style.left=`${l}px`,this.mouse.style.top=`${u}px`,i||this.drawMouseTail({x:l,y:u}),this.hoverElements(r)}drawMouseTail(t){if(!this.mouseTail)return;let{lineCap:n,lineWidth:o,strokeStyle:i,duration:s}=this.config.mouseTail===!0?de:Object.assign({},de,this.config.mouseTail),r=()=>{if(!this.mouseTail)return;let a=this.mouseTail.getContext("2d");a&&this.tailPositions.length&&(a.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),a.beginPath(),a.lineWidth=o,a.lineCap=n,a.strokeStyle=i,a.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(l=>a.lineTo(l.x,l.y)),a.stroke())};this.tailPositions.push(t),r(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(a=>a!==t),r()},s/this.speedService.state.context.timer.speed)}hoverElements(t){var n;(n=this.iframe.contentDocument)===null||n===void 0||n.querySelectorAll(".\\:hover").forEach(i=>{i.classList.remove(":hover")});let o=t;for(;o;)o.classList&&o.classList.add(":hover"),o=o.parentElement}isUserInteraction(t){return t.type===Y.IncrementalSnapshot&&t.data.source>O.Mutation&&t.data.source<=O.Input}backToNormal(){this.nextUserInteractionEvent=null,this.speedService.state.matches("normal")||(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(G.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("[replayer]",`Node with id '${n}' not found. `,t)}warn(...t){this.config.showWarning&&console.warn("[replayer]",...t)}debug(...t){this.config.showDebug&&console.log("[replayer]",...t)}};function rn(e){let t="";return Object.keys(e).forEach(n=>{t+=`${n}: ${e[n]};`}),t}function Rt(e,t=2){let n=String(e),o=Math.pow(10,t-1);if(e<o)for(;String(o).length>n.length;)n=`0${e}`;return n}function Zt(e){if(e<=0)return"00:00";let t=Math.floor(e/36e5);e%=36e5;let n=Math.floor(e/6e4);e%=6e4;let o=Math.floor(e/1e3);return t?`${Rt(t)}:${Rt(n)}:${Rt(o)}`:`${Rt(n)}:${Rt(o)}`}function sn(){let e=!1;return["fullscreen","webkitIsFullScreen","mozFullScreen","msFullscreenElement"].forEach(t=>{t in document&&(e=e||!!document[t])}),e}function an(e){return{"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Undefined]":"undefined","[object Null]":"null","[object Object]":"object"}[Object.prototype.toString.call(e)]}function Lo(e){return e.type===Y.IncrementalSnapshot&&e.data.source>O.Mutation&&e.data.source<=O.Input}function Vo(e){let t,n,o,i,s,r,a,l,u;return{c(){t=j("div"),n=j("input"),o=nt(),i=j("label"),s=nt(),r=j("span"),a=Ct(e[3]),T(n,"type","checkbox"),T(n,"id",e[2]),n.disabled=e[1],T(n,"class","svelte-9brlez"),T(i,"for",e[2]),T(i,"class","svelte-9brlez"),T(r,"class","label svelte-9brlez"),T(t,"class","switch svelte-9brlez"),Et(t,"disabled",e[1])},m(c,d){ht(c,t,d),B(t,n),n.checked=e[0],B(t,o),B(t,i),B(t,s),B(t,r),B(r,a),l||(u=Ft(n,"change",e[4]),l=!0)},p(c,[d]){4&d&&T(n,"id",c[2]),2&d&&(n.disabled=c[1]),1&d&&(n.checked=c[0]),4&d&&T(i,"for",c[2]),8&d&&Qt(a,c[3]),2&d&&Et(t,"disabled",c[1])},i:Yt,o:Yt,d(c){c&&ct(t),l=!1,u()}}}function _o(e,t,n){let{disabled:o}=t,{checked:i}=t,{id:s}=t,{label:r}=t;return e.$$set=a=>{"disabled"in a&&n(1,o=a.disabled),"checked"in a&&n(0,i=a.checked),"id"in a&&n(2,s=a.id),"label"in a&&n(3,r=a.label)},[i,o,s,r,function(){i=this.checked,n(0,i)}]}var De=class extends _t{constructor(t){super(),Oe(this,t,_o,Vo,xe,{disabled:1,checked:0,id:2,label:3})}};function ln(e,t,n){let o=e.slice();return o[39]=t[n],o}function cn(e,t,n){let o=e.slice();return o[42]=t[n],o}function un(e,t,n){let o=e.slice();return o[45]=t[n],o}function dn(e){let t,n,o,i,s,r,a,l,u,c,d,h,C,g,p,f,y,I,N,E,L,V,K,U,v,x,A=Zt(e[6])+"",m=Zt(e[8].totalTime)+"",D=e[14],S=[];for(let w=0;w<D.length;w+=1)S[w]=hn(un(e,D,w));let P=e[9],_=[];for(let w=0;w<P.length;w+=1)_[w]=pn(cn(e,P,w));function b(w,W){return w[7]==="playing"?Go:Wo}let F=b(e),R=F(e),Q=e[3],H=[];for(let w=0;w<Q.length;w+=1)H[w]=gn(ln(e,Q,w));function st(w){e[30](w)}let X={id:"skip",disabled:e[10]==="skipping",label:"skip inactive"};return e[0]!==void 0&&(X.checked=e[0]),E=new De({props:X}),ft.push(()=>function(w,W,Z){let at=w.$$.props[W];at!==void 0&&(w.$$.bound[at]=Z,Z(w.$$.ctx[at]))}(E,"checked",st)),{c(){t=j("div"),n=j("div"),o=j("span"),i=Ct(A),s=nt(),r=j("div"),a=j("div"),l=nt();for(let w=0;w<S.length;w+=1)S[w].c();u=nt();for(let w=0;w<_.length;w+=1)_[w].c();c=nt(),d=j("div"),h=nt(),C=j("span"),g=Ct(m),p=nt(),f=j("div"),y=j("button"),R.c(),I=nt();for(let w=0;w<H.length;w+=1)H[w].c();N=nt(),wn(E.$$.fragment),V=nt(),K=j("button"),K.innerHTML=`<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><defs><style type="text/css"></style></defs><path d="M916 380c-26.4 0-48-21.6-48-48L868 223.2 613.6 477.6c-18.4
18.4-48.8 18.4-68 0-18.4-18.4-18.4-48.8 0-68L800 156 692 156c-26.4
0-48-21.6-48-48 0-26.4 21.6-48 48-48l224 0c26.4 0 48 21.6 48 48l0
224C964 358.4 942.4 380 916 380zM231.2 860l108.8 0c26.4 0 48 21.6 48
48s-21.6 48-48 48l-224 0c-26.4 0-48-21.6-48-48l0-224c0-26.4 21.6-48
48-48 26.4 0 48 21.6 48 48L164 792l253.6-253.6c18.4-18.4 48.8-18.4
68 0 18.4 18.4 18.4 48.8 0 68L231.2 860z" p-id="1286"></path></svg>`,T(o,"class","rr-timeline__time svelte-19ke1iv"),T(a,"class","rr-progress__step svelte-19ke1iv"),J(a,"width",e[13]),T(d,"class","rr-progress__handler svelte-19ke1iv"),J(d,"left",e[13]),T(r,"class","rr-progress svelte-19ke1iv"),Et(r,"disabled",e[10]==="skipping"),T(C,"class","rr-timeline__time svelte-19ke1iv"),T(n,"class","rr-timeline svelte-19ke1iv"),T(y,"class","svelte-19ke1iv"),T(K,"class","svelte-19ke1iv"),T(f,"class","rr-controller__btns svelte-19ke1iv"),T(t,"class","rr-controller svelte-19ke1iv")},m(w,W){ht(w,t,W),B(t,n),B(n,o),B(o,i),B(n,s),B(n,r),B(r,a),e[27](a),B(r,l);for(let Z=0;Z<S.length;Z+=1)S[Z].m(r,null);B(r,u);for(let Z=0;Z<_.length;Z+=1)_[Z].m(r,null);B(r,c),B(r,d),e[28](r),B(n,h),B(n,C),B(C,g),B(t,p),B(t,f),B(f,y),R.m(y,null),B(f,I);for(let Z=0;Z<H.length;Z+=1)H[Z].m(f,null);B(f,N),ke(E,f,null),B(f,V),B(f,K),U=!0,v||(x=[Ft(r,"click",e[16]),Ft(y,"click",e[4]),Ft(K,"click",e[31])],v=!0)},p(w,W){if((!U||64&W[0])&&A!==(A=Zt(w[6])+"")&&Qt(i,A),(!U||8192&W[0])&&J(a,"width",w[13]),16384&W[0]){let M;for(D=w[14],M=0;M<D.length;M+=1){let it=un(w,D,M);S[M]?S[M].p(it,W):(S[M]=hn(it),S[M].c(),S[M].m(r,u))}for(;M<S.length;M+=1)S[M].d(1);S.length=D.length}if(512&W[0]){let M;for(P=w[9],M=0;M<P.length;M+=1){let it=cn(w,P,M);_[M]?_[M].p(it,W):(_[M]=pn(it),_[M].c(),_[M].m(r,c))}for(;M<_.length;M+=1)_[M].d(1);_.length=P.length}if((!U||8192&W[0])&&J(d,"left",w[13]),1024&W[0]&&Et(r,"disabled",w[10]==="skipping"),(!U||256&W[0])&&m!==(m=Zt(w[8].totalTime)+"")&&Qt(g,m),F!==(F=b(w))&&(R.d(1),R=F(w),R&&(R.c(),R.m(y,null))),1066&W[0]){let M;for(Q=w[3],M=0;M<Q.length;M+=1){let it=ln(w,Q,M);H[M]?H[M].p(it,W):(H[M]=gn(it),H[M].c(),H[M].m(f,N))}for(;M<H.length;M+=1)H[M].d(1);H.length=Q.length}let Z={};var at;1024&W[0]&&(Z.disabled=w[10]==="skipping"),!L&&1&W[0]&&(L=!0,Z.checked=w[0],at=()=>L=!1,he.push(at)),E.$set(Z)},i(w){U||(dt(E.$$.fragment,w),U=!0)},o(w){St(E.$$.fragment,w),U=!1},d(w){w&&ct(t),e[27](null),te(S,w),te(_,w),e[28](null),R.d(),te(H,w),Fe(E),v=!1,Dt(x)}}}function hn(e){let t,n;return{c(){t=j("div"),T(t,"title",n=e[45].name),J(t,"width",e[45].width),J(t,"height","4px"),J(t,"position","absolute"),J(t,"background",e[45].background),J(t,"left",e[45].position)},m(o,i){ht(o,t,i)},p(o,i){16384&i[0]&&n!==(n=o[45].name)&&T(t,"title",n),16384&i[0]&&J(t,"width",o[45].width),16384&i[0]&&J(t,"background",o[45].background),16384&i[0]&&J(t,"left",o[45].position)},d(o){o&&ct(t)}}}function pn(e){let t,n;return{c(){t=j("div"),T(t,"title",n=e[42].name),J(t,"width","10px"),J(t,"height","5px"),J(t,"position","absolute"),J(t,"top","2px"),J(t,"transform","translate(-50%, -50%)"),J(t,"background",e[42].background),J(t,"left",e[42].position)},m(o,i){ht(o,t,i)},p(o,i){512&i[0]&&n!==(n=o[42].name)&&T(t,"title",n),512&i[0]&&J(t,"background",o[42].background),512&i[0]&&J(t,"left",o[42].position)},d(o){o&&ct(t)}}}function Wo(e){let t,n;return{c(){t=Pt("svg"),n=Pt("path"),T(n,"d",`M170.65984 896l0-768 640 384zM644.66944
512l-388.66944-233.32864 0 466.65728z`),T(t,"class","icon"),T(t,"viewBox","0 0 1024 1024"),T(t,"version","1.1"),T(t,"xmlns","http://www.w3.org/2000/svg"),T(t,"xmlns:xlink","http://www.w3.org/1999/xlink"),T(t,"width","16"),T(t,"height","16")},m(o,i){ht(o,t,i),B(t,n)},d(o){o&&ct(t)}}}function Go(e){let t,n;return{c(){t=Pt("svg"),n=Pt("path"),T(n,"d",`M682.65984 128q53.00224 0 90.50112 37.49888t37.49888 90.50112l0
512q0 53.00224-37.49888 90.50112t-90.50112
37.49888-90.50112-37.49888-37.49888-90.50112l0-512q0-53.00224
37.49888-90.50112t90.50112-37.49888zM341.34016 128q53.00224 0
90.50112 37.49888t37.49888 90.50112l0 512q0 53.00224-37.49888
90.50112t-90.50112
37.49888-90.50112-37.49888-37.49888-90.50112l0-512q0-53.00224
37.49888-90.50112t90.50112-37.49888zM341.34016 213.34016q-17.67424
0-30.16704 12.4928t-12.4928 30.16704l0 512q0 17.67424 12.4928
30.16704t30.16704 12.4928 30.16704-12.4928
12.4928-30.16704l0-512q0-17.67424-12.4928-30.16704t-30.16704-12.4928zM682.65984
213.34016q-17.67424 0-30.16704 12.4928t-12.4928 30.16704l0 512q0
17.67424 12.4928 30.16704t30.16704 12.4928 30.16704-12.4928
12.4928-30.16704l0-512q0-17.67424-12.4928-30.16704t-30.16704-12.4928z`),T(t,"class","icon"),T(t,"viewBox","0 0 1024 1024"),T(t,"version","1.1"),T(t,"xmlns","http://www.w3.org/2000/svg"),T(t,"xmlns:xlink","http://www.w3.org/1999/xlink"),T(t,"width","16"),T(t,"height","16")},m(o,i){ht(o,t,i),B(t,n)},d(o){o&&ct(t)}}}function gn(e){let t,n,o,i,s,r,a=e[39]+"";function l(){return e[29](e[39])}return{c(){t=j("button"),n=Ct(a),o=Ct("x"),t.disabled=i=e[10]==="skipping",T(t,"class","svelte-19ke1iv"),Et(t,"active",e[39]===e[1]&&e[10]!=="skipping")},m(u,c){ht(u,t,c),B(t,n),B(t,o),s||(r=Ft(t,"click",l),s=!0)},p(u,c){e=u,8&c[0]&&a!==(a=e[39]+"")&&Qt(n,a),1024&c[0]&&i!==(i=e[10]==="skipping")&&(t.disabled=i),1034&c[0]&&Et(t,"active",e[39]===e[1]&&e[10]!=="skipping")},d(u){u&&ct(t),s=!1,r()}}}function Uo(e){let t,n,o=e[2]&&dn(e);return{c(){o&&o.c(),t=Ct("")},m(i,s){o&&o.m(i,s),ht(i,t,s),n=!0},p(i,s){i[2]?o?(o.p(i,s),4&s[0]&&dt(o,1)):(o=dn(i),o.c(),dt(o,1),o.m(t.parentNode,t)):o&&(An(),St(o,1,1,()=>{o=null}),bn())},i(i){n||(dt(o),n=!0)},o(i){St(o),n=!1},d(i){o&&o.d(i),i&&ct(t)}}}function mn(e,t,n){return(100-(t-n)/(t-e)*100).toFixed(2)}function Zo(e,t,n){let o=qn(),i,s,r,a,l,u,c,d,h,C,{replayer:g}=t,{showController:p}=t,{autoPlay:f}=t,{skipInactive:y}=t,{speedOption:I}=t,{speed:N=I.length?I[0]:1}=t,{tags:E={}}=t,{inactiveColor:L}=t,V=0,K=null,U=!1,v=null,x=()=>{K&&(cancelAnimationFrame(K),K=null)},A=()=>{i==="paused"&&(l?(g.play(),l=!1):g.play(V))},m=()=>{i==="playing"&&(g.pause(),U=!1)},D=(b,F)=>{n(6,V=b),U=!1,(typeof F=="boolean"?F:i==="playing")?g.play(b):g.pause(b)},S=(b,F,R=!1,Q)=>{v=R?{start:b,end:F}:null,n(6,V=b),U=F,u=Q,g.play(b)},P=b=>{let F=i==="playing";n(1,N=b),F&&g.pause(),g.setConfig({speed:N}),F&&g.play(V)};var _;return vn(()=>{n(7,i=g.service.state.value),n(10,s=g.speedService.state.value),g.on("state-change",b=>{let{player:F,speed:R}=b;if(F?.value&&i!==F.value)switch(n(7,i=F.value),i){case"playing":x(),K=requestAnimationFrame(function Q(){n(6,V=g.getCurrentTime()),U&&V>=U&&(v?S(v.start,v.end,!0,void 0):(g.pause(),u&&(u(),u=null))),V<c.totalTime&&(K=requestAnimationFrame(Q))});break;case"paused":x()}R?.value&&s!==R.value&&n(10,s=R.value)}),g.on("finish",()=>{l=!0,u&&(u(),u=null)}),f&&g.play()}),_=()=>{y!==g.config.skipInactive&&g.setConfig({skipInactive:y})},jt().$$.after_update.push(_),Cn(()=>{g.pause(),x()}),e.$$set=b=>{"replayer"in b&&n(17,g=b.replayer),"showController"in b&&n(2,p=b.showController),"autoPlay"in b&&n(18,f=b.autoPlay),"skipInactive"in b&&n(0,y=b.skipInactive),"speedOption"in b&&n(3,I=b.speedOption),"speed"in b&&n(1,N=b.speed),"tags"in b&&n(19,E=b.tags),"inactiveColor"in b&&n(20,L=b.inactiveColor)},e.$$.update=()=>{if(64&e.$$.dirty[0]&&o("ui-update-current-time",{payload:V}),128&e.$$.dirty[0]&&o("ui-update-player-state",{payload:i}),131072&e.$$.dirty[0]&&n(8,c=g.getMetaData()),320&e.$$.dirty[0]){let b=Math.min(1,V/c.totalTime);n(13,d=100*b+"%"),o("ui-update-progress",{payload:b})}655360&e.$$.dirty[0]&&n(9,h=(()=>{let{context:b}=g.service.state,F=b.events.length,R=b.events[0].timestamp,Q=b.events[F-1].timestamp,H=[];return b.events.forEach(st=>{if(st.type===Y.Custom){let X={name:st.data.tag,background:E[st.data.tag]||"rgb(73, 80, 246)",position:`${mn(R,Q,st.timestamp)}%`};H.push(X)}}),H})()),1179648&e.$$.dirty[0]&&n(14,C=(()=>{try{let{context:b}=g.service.state,F=b.events.length,R=b.events[0].timestamp,Q=b.events[F-1].timestamp,H=function(X){let w=[],W=X[0].timestamp;for(let Z of X)Lo(Z)&&(Z.timestamp-W>1e4&&w.push([W,Z.timestamp]),W=Z.timestamp);return w}(b.events),st=(X,w,W,Z)=>((Z-W)/(w-X)*100).toFixed(2);return H.map(X=>({name:"inactive period",background:L,position:`${mn(R,Q,X[0])}%`,width:`${st(R,Q,X[0],X[1])}%`}))}catch{return[]}})())},[y,N,p,I,()=>{switch(i){case"playing":m();break;case"paused":A()}},P,V,i,c,h,s,r,a,d,C,o,b=>{if(s==="skipping")return;let F=r.getBoundingClientRect(),R=(b.clientX-F.left)/F.width;R<0?R=0:R>1&&(R=1);let Q=c.totalTime*R;l=!1,D(Q)},g,f,E,L,A,m,D,S,()=>{n(0,y=!y)},()=>Promise.resolve().then(()=>{n(8,c=g.getMetaData())}),function(b){ft[b?"unshift":"push"](()=>{a=b,n(12,a)})},function(b){ft[b?"unshift":"push"](()=>{r=b,n(11,r)})},b=>P(b),function(b){y=b,n(0,y)},()=>o("fullscreen")]}var Me=class extends _t{constructor(t){super(),Oe(this,t,Zo,Uo,xe,{replayer:17,showController:2,autoPlay:18,skipInactive:0,speedOption:3,speed:1,tags:19,inactiveColor:20,toggle:4,play:21,pause:22,goto:23,playRange:24,setSpeed:5,toggleSkipInactive:25,triggerUpdateMeta:26},null,[-1,-1])}get toggle(){return this.$$.ctx[4]}get play(){return this.$$.ctx[21]}get pause(){return this.$$.ctx[22]}get goto(){return this.$$.ctx[23]}get playRange(){return this.$$.ctx[24]}get setSpeed(){return this.$$.ctx[5]}get toggleSkipInactive(){return this.$$.ctx[25]}get triggerUpdateMeta(){return this.$$.ctx[26]}};function fn(e){let t,n,o={replayer:e[7],showController:e[3],autoPlay:e[1],speedOption:e[2],skipInactive:e[0],tags:e[4],inactiveColor:e[5]};return t=new Me({props:o}),e[32](t),t.$on("fullscreen",e[33]),{c(){wn(t.$$.fragment)},m(i,s){ke(t,i,s),n=!0},p(i,s){let r={};128&s[0]&&(r.replayer=i[7]),8&s[0]&&(r.showController=i[3]),2&s[0]&&(r.autoPlay=i[1]),4&s[0]&&(r.speedOption=i[2]),1&s[0]&&(r.skipInactive=i[0]),16&s[0]&&(r.tags=i[4]),32&s[0]&&(r.inactiveColor=i[5]),t.$set(r)},i(i){n||(dt(t.$$.fragment,i),n=!0)},o(i){St(t.$$.fragment,i),n=!1},d(i){e[32](null),Fe(t,i)}}}function $o(e){let t,n,o,i,s=e[7]&&fn(e);return{c(){t=j("div"),n=j("div"),o=nt(),s&&s.c(),T(n,"class","rr-player__frame"),T(n,"style",e[11]),T(t,"class","rr-player"),T(t,"style",e[12])},m(r,a){ht(r,t,a),B(t,n),e[31](n),B(t,o),s&&s.m(t,null),e[34](t),i=!0},p(r,a){(!i||2048&a[0])&&T(n,"style",r[11]),r[7]?s?(s.p(r,a),128&a[0]&&dt(s,1)):(s=fn(r),s.c(),dt(s,1),s.m(t,null)):s&&(An(),St(s,1,1,()=>{s=null}),bn()),(!i||4096&a[0])&&T(t,"style",r[12])},i(r){i||(dt(s),i=!0)},o(r){St(s),i=!1},d(r){r&&ct(t),e[31](null),s&&s.d(),e[34](null)}}}function Ko(e,t,n){let o,{width:i=1024}=t,{height:s=576}=t,{maxScale:r=1}=t,{events:a=[]}=t,{skipInactive:l=!0}=t,{autoPlay:u=!0}=t,{speedOption:c=[1,2,4,8]}=t,{speed:d=1}=t,{showController:h=!0}=t,{tags:C={}}=t,{inactiveColor:g="#D4D4D4"}=t,p,f,y,I,N,E,L=i,V=s,K=(v,x)=>{let A=[i/x.width,s/x.height];r&&A.push(r),v.style.transform=`scale(${Math.min(...A)})translate(-50%, -50%)`},U=()=>{var v;p&&(sn()?document.exitFullscreen?document.exitFullscreen():document.mozExitFullscreen?document.mozExitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen():(v=p).requestFullscreen?v.requestFullscreen():v.mozRequestFullScreen?v.mozRequestFullScreen():v.webkitRequestFullscreen?v.webkitRequestFullscreen():v.msRequestFullscreen&&v.msRequestFullscreen())};return vn(()=>{if(c!==void 0&&an(c)!=="array")throw new Error("speedOption must be array");if(c.forEach(x=>{if(an(x)!=="number")throw new Error("item of speedOption must be number")}),c.indexOf(d)<0)throw new Error(`speed must be one of speedOption,
current config:
{
...
speed: ${d},
speedOption: [${c.toString()}]
...
}
`);var v;n(7,o=new Te(a,Object.assign({speed:d,root:f,unpackFn:Do},t))),o.on("resize",x=>{K(o.wrapper,x)}),v=()=>{sn()?setTimeout(()=>{L=i,V=s,n(13,i=p.offsetWidth),n(14,s=p.offsetHeight-(h?80:0)),K(o.wrapper,{width:o.iframe.offsetWidth,height:o.iframe.offsetHeight})},0):(n(13,i=L),n(14,s=V),K(o.wrapper,{width:o.iframe.offsetWidth,height:o.iframe.offsetHeight}))},document.addEventListener("fullscreenchange",v),document.addEventListener("webkitfullscreenchange",v),document.addEventListener("mozfullscreenchange",v),document.addEventListener("MSFullscreenChange",v),y=()=>{document.removeEventListener("fullscreenchange",v),document.removeEventListener("webkitfullscreenchange",v),document.removeEventListener("mozfullscreenchange",v),document.removeEventListener("MSFullscreenChange",v)}}),Cn(()=>{y&&y()}),e.$$set=v=>{n(39,t=Ve(Ve({},t),We(v))),"width"in v&&n(13,i=v.width),"height"in v&&n(14,s=v.height),"maxScale"in v&&n(15,r=v.maxScale),"events"in v&&n(16,a=v.events),"skipInactive"in v&&n(0,l=v.skipInactive),"autoPlay"in v&&n(1,u=v.autoPlay),"speedOption"in v&&n(2,c=v.speedOption),"speed"in v&&n(17,d=v.speed),"showController"in v&&n(3,h=v.showController),"tags"in v&&n(4,C=v.tags),"inactiveColor"in v&&n(5,g=v.inactiveColor)},e.$$.update=()=>{24576&e.$$.dirty[0]&&n(11,N=rn({width:`${i}px`,height:`${s}px`})),24584&e.$$.dirty[0]&&n(12,E=rn({width:`${i}px`,height:`${s+(h?80:0)}px`}))},t=We(t),[l,u,c,h,C,g,U,o,p,f,I,N,E,i,s,r,a,d,()=>o.getMirror(),()=>{K(o.wrapper,{width:o.iframe.offsetWidth,height:o.iframe.offsetHeight})},(v,x)=>{switch(o.on(v,x),v){case"ui-update-current-time":case"ui-update-progress":case"ui-update-player-state":I.$on(v,({detail:A})=>x(A))}},v=>{o.addEvent(v),I.triggerUpdateMeta()},()=>o.getMetaData(),()=>o,()=>{I.toggle()},v=>{I.setSpeed(v)},()=>{I.toggleSkipInactive()},()=>{I.play()},()=>{I.pause()},(v,x)=>{I.goto(v,x)},(v,x,A=!1,m)=>{I.playRange(v,x,A,m)},function(v){ft[v?"unshift":"push"](()=>{f=v,n(9,f)})},function(v){ft[v?"unshift":"push"](()=>{I=v,n(10,I)})},()=>U(),function(v){ft[v?"unshift":"push"](()=>{p=v,n(8,p)})}]}var Re=class extends _t{constructor(t){super(),Oe(this,t,Ko,$o,xe,{width:13,height:14,maxScale:15,events:16,skipInactive:0,autoPlay:1,speedOption:2,speed:17,showController:3,tags:4,inactiveColor:5,getMirror:18,triggerResize:19,toggleFullscreen:6,addEventListener:20,addEvent:21,getMetaData:22,getReplayer:23,toggle:24,setSpeed:25,toggleSkipInactive:26,play:27,pause:28,goto:29,playRange:30},null,[-1,-1])}get getMirror(){return this.$$.ctx[18]}get triggerResize(){return this.$$.ctx[19]}get toggleFullscreen(){return this.$$.ctx[6]}get addEventListener(){return this.$$.ctx[20]}get addEvent(){return this.$$.ctx[21]}get getMetaData(){return this.$$.ctx[22]}get getReplayer(){return this.$$.ctx[23]}get toggle(){return this.$$.ctx[24]}get setSpeed(){return this.$$.ctx[25]}get toggleSkipInactive(){return this.$$.ctx[26]}get play(){return this.$$.ctx[27]}get pause(){return this.$$.ctx[28]}get goto(){return this.$$.ctx[29]}get playRange(){return this.$$.ctx[30]}},Xt=class extends Re{constructor(t){super({target:t.target,props:t.data||t.props})}};function Yo(e){document.body.innerHTML="";let t=new Xt({target:document.body,props:{events:e,autoPlay:!1,UNSAFE_replayCanvas:!0,speed:99999999999,speedOption:[99999999999],skipInactive:!0,showWarning:!1,loadTimeout:1e3}});t.addEventListener("ui-update-progress",n=>{n.payload==1&&console.log("FINISHED")}),t.play(),setTimeout(()=>{console.log("FINISHED")},1e3)}window.playEvents=Yo;})();
/*! Bundled license information:
rrweb-player/dist/index.mjs:
(*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** *)
*/