@highlight-run/rrweb 2.1.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/record/rrweb-record.js +3 -3
  2. package/dist/record/rrweb-record.min.js +3 -3
  3. package/dist/record/rrweb-record.min.js.map +1 -1
  4. package/dist/rrweb-all.js +8 -8
  5. package/dist/rrweb-all.min.js +8 -8
  6. package/dist/rrweb-all.min.js.map +1 -1
  7. package/dist/rrweb.js +5 -5
  8. package/dist/rrweb.min.js +5 -5
  9. package/dist/rrweb.min.js.map +1 -1
  10. package/es/rrweb/packages/rrweb/src/record/index.js +3 -3
  11. package/lib/record/rrweb-record.js +2 -2
  12. package/lib/rrweb-all.js +2 -2
  13. package/lib/rrweb.js +2 -2
  14. package/package.json +2 -2
  15. package/typings/entries/all.d.ts +0 -0
  16. package/typings/entries/record-pack.d.ts +0 -0
  17. package/typings/entries/replay-unpack.d.ts +0 -0
  18. package/typings/index.d.ts +0 -0
  19. package/typings/packer/base.d.ts +0 -0
  20. package/typings/packer/index.d.ts +0 -0
  21. package/typings/packer/pack.d.ts +0 -0
  22. package/typings/packer/unpack.d.ts +0 -0
  23. package/typings/plugins/console/record/error-stack-parser.d.ts +0 -0
  24. package/typings/plugins/console/record/index.d.ts +0 -0
  25. package/typings/plugins/console/record/stringify.d.ts +0 -0
  26. package/typings/plugins/console/replay/index.d.ts +0 -0
  27. package/typings/plugins/sequential-id/record/index.d.ts +0 -0
  28. package/typings/plugins/sequential-id/replay/index.d.ts +0 -0
  29. package/typings/record/iframe-manager.d.ts +0 -0
  30. package/typings/record/index.d.ts +0 -0
  31. package/typings/record/mutation.d.ts +0 -0
  32. package/typings/record/observer.d.ts +0 -0
  33. package/typings/record/observers/canvas/2d.d.ts +0 -0
  34. package/typings/record/observers/canvas/canvas-manager.d.ts +0 -0
  35. package/typings/record/observers/canvas/canvas.d.ts +0 -0
  36. package/typings/record/observers/canvas/serialize-args.d.ts +0 -0
  37. package/typings/record/observers/canvas/webgl.d.ts +0 -0
  38. package/typings/record/shadow-dom-manager.d.ts +0 -0
  39. package/typings/record/stylesheet-manager.d.ts +0 -0
  40. package/typings/record/workers/image-bitmap-data-url-worker.d.ts +0 -0
  41. package/typings/replay/canvas/2d.d.ts +0 -0
  42. package/typings/replay/canvas/deserialize-args.d.ts +0 -0
  43. package/typings/replay/canvas/index.d.ts +0 -0
  44. package/typings/replay/canvas/webgl.d.ts +0 -0
  45. package/typings/replay/index.d.ts +0 -0
  46. package/typings/replay/machine.d.ts +0 -0
  47. package/typings/replay/smoothscroll.d.ts +0 -0
  48. package/typings/replay/styles/inject-style.d.ts +0 -0
  49. package/typings/replay/timer.d.ts +0 -0
  50. package/typings/rrdom/index.d.ts +0 -0
  51. package/typings/rrdom/tree-node.d.ts +0 -0
  52. package/typings/types.d.ts +0 -0
  53. package/typings/utils.d.ts +0 -0
package/dist/rrweb.js CHANGED
@@ -1,8 +1,8 @@
1
- var rrweb=function(J){"use strict";var k;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(k||(k={}));function wt(e){return e.nodeType===e.ELEMENT_NODE}function De(e){var t=e?.host;return Boolean(t?.shadowRoot===e)}function Re(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}var Qe=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var n;if(!t)return-1;var r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var n=this,r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(function(o){return n.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,n){var r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)},e.prototype.replace=function(t,n){this.idNodeMap.set(t,n)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function Ct(){return new Qe}function qe(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,o=e.value,i=e.maskInputFn,a=o||"";return(t[n.toLowerCase()]||t[r])&&(i?a=i(a):a="*".repeat(a.length)),a}var It="__rrweb_original__";function Jn(e){var t=e.getContext("2d");if(!t)return!0;for(var n=50,r=0;r<e.width;r+=n)for(var o=0;o<e.height;o+=n){var i=t.getImageData,a=It in i?i[It]:i,l=new Uint32Array(a.call(t,r,o,Math.min(n,e.width-r),Math.min(n,e.height-o)).data.buffer);if(l.some(function(c){return c!==0}))return!1}return!0}function Mt(e){return e=e.replace(/[^ -~]+/g,""),e=e?.split(" ").map(function(t){return Math.random().toString(20).substr(2,t.length)}).join(" ")||"",e}var er=1,tr=new RegExp("[^a-z0-9-_:]"),Oe=-2;function nr(){return er++}function rr(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return tr.test(t)?"div":t}function Je(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(or).join(""):null}catch{return null}}function or(e){var t=e.cssText;if(ir(e))try{t=Je(e.styleSheet)||t}catch{}return t}function ir(e){return"styleSheet"in e}function sr(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function ar(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var be,xt,lr=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,cr=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,ur=/^(data:)([^,]*),(.*)/i;function Ve(e,t){return(e||"").replace(lr,function(n,r,o,i,a,l){var c=o||a||l,s=r||i||"";if(!c)return n;if(!cr.test(c)||ur.test(c))return"url(".concat(s).concat(c).concat(s,")");if(c[0]==="/")return"url(".concat(s).concat(ar(t)+c).concat(s,")");var u=t.split("/"),d=c.split("/");u.pop();for(var h=0,m=d;h<m.length;h++){var p=m[h];p!=="."&&(p===".."?u.pop():u.push(p))}return"url(".concat(s).concat(u.join("/")).concat(s,")")})}var dr=/^[^ \t\n\r\u000c]+/,hr=/^[, \t\n\r\u000c]+/;function mr(e,t){if(t.trim()==="")return t;var n=0;function r(s){var u,d=s.exec(t.substring(n));return d?(u=d[0],n+=u.length,u):""}for(var o=[];r(hr),!(n>=t.length);){var i=r(dr);if(i.slice(-1)===",")i=Ue(e,i.substring(0,i.length-1)),o.push(i);else{var a="";i=Ue(e,i);for(var l=!1;;){var c=t.charAt(n);if(c===""){o.push((i+a).trim());break}else if(l)c===")"&&(l=!1);else if(c===","){n+=1,o.push((i+a).trim());break}else c==="("&&(l=!0);a+=c,n+=1}}}return o.join(", ")}function Ue(e,t){if(!t||t.trim()==="")return t;var n=e.createElement("a");return n.href=t,n.href}function pr(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function et(){var e=document.createElement("a");return e.href="",e.href}function kt(e,t,n,r){return n==="src"||n==="href"&&r&&!(t==="use"&&r[0]==="#")||n==="xlink:href"&&r&&r[0]!=="#"||n==="background"&&r&&(t==="table"||t==="td"||t==="th")?Ue(e,r):n==="srcset"&&r?mr(e,r):n==="style"&&r?Ve(r,et()):t==="object"&&n==="data"&&r?Ue(e,r):r}function fr(e,t,n){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?e.matches(n):!1}function Ge(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?Ge(e.parentNode,t,n):!1;for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?Ge(e.parentNode,t,n):!1}function Dt(e,t,n){var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(r===null)return!1;if(typeof t=="string"){if(r.classList.contains(t)||r.closest(".".concat(t)))return!0}else if(Ge(r,t,!0))return!0;return!!(n&&(r.matches(n)||r.closest(n)))}function vr(e,t,n){var r=e.contentWindow;if(r){var o=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){var a=setTimeout(function(){o||(t(),o=!0)},n);e.addEventListener("load",function(){clearTimeout(a),o=!0,t()});return}var l="about:blank";if(r.location.href!==l||e.src===l||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function Rt(e){return e.getAttribute("href")?e.sheet!==null:!0}function Ot(e,t,n){var r=!1,o;try{o=e.sheet}catch{return}if(!o){var i=setTimeout(function(){r||(t(),r=!0)},n);e.addEventListener("load",function(){clearTimeout(i),r=!0,t()})}}function gr(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.maskTextClass,l=t.maskTextSelector,c=t.inlineStylesheet,s=t.maskInputOptions,u=s===void 0?{}:s,d=t.maskTextFn,h=t.maskInputFn,m=t.dataURLOptions,p=m===void 0?{}:m,v=t.inlineImages,N=t.recordCanvas,f=t.keepIframeSrcFn,b=t.newlyAddedElement,S=b===void 0?!1:b,y=t.enableStrictPrivacy,M=yr(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:k.Document,childNodes:[],compatMode:e.compatMode,rootId:M}:{type:k.Document,childNodes:[],rootId:M};case e.DOCUMENT_TYPE_NODE:return{type:k.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:M};case e.ELEMENT_NODE:return Sr(e,{doc:n,blockClass:o,blockSelector:i,inlineStylesheet:c,maskInputOptions:u,maskInputFn:h,dataURLOptions:p,inlineImages:v,recordCanvas:N,keepIframeSrcFn:f,newlyAddedElement:S,enableStrictPrivacy:y,rootId:M});case e.TEXT_NODE:return br(e,{maskTextClass:a,maskTextSelector:l,maskTextFn:d,enableStrictPrivacy:y,rootId:M});case e.CDATA_SECTION_NODE:return{type:k.CDATA,textContent:"",rootId:M};case e.COMMENT_NODE:return{type:k.Comment,textContent:e.textContent||"",rootId:M};default:return!1}}function yr(e,t){if(t.hasNode(e)){var n=t.getId(e);return n===1?void 0:n}}function br(e,t){var n,r=t.maskTextClass,o=t.maskTextSelector,i=t.maskTextFn,a=t.enableStrictPrivacy,l=t.rootId,c=e.parentNode&&e.parentNode.tagName,s=e.textContent,u=c==="STYLE"?!0:void 0,d=c==="SCRIPT"?!0:void 0,h=!1;if(u&&s){try{e.nextSibling||e.previousSibling||!((n=e.parentNode.sheet)===null||n===void 0)&&n.cssRules&&(s=sr(e.parentNode.sheet))}catch(p){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(p),e)}s=Ve(s,et()),h=!0}if(d?(s="SCRIPT_PLACEHOLDER",h=!0):c==="NOSCRIPT"&&(s="",h=!0),!u&&!d&&s&&Dt(e,r,o)&&(s=i?i(s):s.replace(/[\S]/g,"*")),a&&!h&&c){var m=new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]);!m.has(c)&&s&&(s=Mt(s))}return{type:k.Text,textContent:s||"",isStyle:u,rootId:l}}function Sr(e,t){for(var n=t.doc,r=t.blockClass,o=t.blockSelector,i=t.inlineStylesheet,a=t.maskInputOptions,l=a===void 0?{}:a,c=t.maskInputFn,s=t.dataURLOptions,u=s===void 0?{}:s,d=t.inlineImages,h=t.recordCanvas,m=t.keepIframeSrcFn,p=t.newlyAddedElement,v=p===void 0?!1:p,N=t.enableStrictPrivacy,f=t.rootId,b=fr(e,r,o),S=rr(e),y={},M=e.attributes.length,R=0;R<M;R++){var A=e.attributes[R];y[A.name]=kt(n,S,A.name,A.value)}if(S==="link"&&i){var P=Array.from(n.styleSheets).find(function(g){return g.href===e.href}),L=null;P&&(L=Je(P)),L&&(delete y.rel,delete y.href,y._cssText=Ve(L,P.href))}if(S==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var L=Je(e.sheet);L&&(y._cssText=Ve(L,et()))}if(S==="input"||S==="textarea"||S==="select"){var B=e.value;y.type!=="radio"&&y.type!=="checkbox"&&y.type!=="submit"&&y.type!=="button"&&B?y.value=qe({type:y.type,tagName:S,value:B,maskInputOptions:l,maskInputFn:c}):e.checked&&(y.checked=e.checked)}if(S==="option"&&(e.selected&&!l.select?y.selected=!0:delete y.selected),S==="canvas"&&h){if(e.__context==="2d")Jn(e)||(y.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var $=e.toDataURL(u.type,u.quality),Q=document.createElement("canvas");Q.width=e.width,Q.height=e.height;var Y=Q.toDataURL(u.type,u.quality);$!==Y&&(y.rr_dataURL=$)}}if(S==="img"&&d){be||(be=n.createElement("canvas"),xt=be.getContext("2d"));var j=e,H=j.crossOrigin;j.crossOrigin="anonymous";var Z=function(){try{be.width=j.naturalWidth,be.height=j.naturalHeight,xt.drawImage(j,0,0),y.rr_dataURL=be.toDataURL(u.type,u.quality)}catch(g){console.warn("Cannot inline img src=".concat(j.currentSrc,"! Error: ").concat(g))}H?y.crossOrigin=H:j.removeAttribute("crossorigin")};j.complete&&j.naturalWidth!==0?Z():j.onload=Z}if((S==="audio"||S==="video")&&(y.rr_mediaState=e.paused?"paused":"played",y.rr_mediaCurrentTime=e.currentTime),v||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),b||S==="img"&&N){var F=e.getBoundingClientRect(),G=F.width,T=F.height;y={class:y.class,rr_width:"".concat(G,"px"),rr_height:"".concat(T,"px")},b=!0}return S==="iframe"&&!m(y.src)&&(e.contentDocument||(y.rr_src=y.src),delete y.src),{type:k.Element,tagName:S,attributes:y,childNodes:[],isSVG:pr(e)||void 0,needBlock:b,rootId:f}}function W(e){return e===void 0?"":e.toLowerCase()}function Tr(e,t){return!!(t.comment&&e.type===k.Comment||e.type===k.Element&&(t.script&&(e.tagName==="script"||e.tagName==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js"))||t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(W(e.attributes.name).match(/^msapplication-tile(image|color)$/)||W(e.attributes.name)==="application-name"||W(e.attributes.rel)==="icon"||W(e.attributes.rel)==="apple-touch-icon"||W(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&W(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(W(e.attributes.property).match(/^(og|twitter|fb):/)||W(e.attributes.name).match(/^(og|twitter):/)||W(e.attributes.name)==="pinterest")||t.headMetaRobots&&(W(e.attributes.name)==="robots"||W(e.attributes.name)==="googlebot"||W(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&(W(e.attributes.name)==="author"||W(e.attributes.name)==="generator"||W(e.attributes.name)==="framework"||W(e.attributes.name)==="publisher"||W(e.attributes.name)==="progid"||W(e.attributes.property).match(/^article:/)||W(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(W(e.attributes.name)==="google-site-verification"||W(e.attributes.name)==="yandex-verification"||W(e.attributes.name)==="csrf-token"||W(e.attributes.name)==="p:domain_verify"||W(e.attributes.name)==="verify-v1"||W(e.attributes.name)==="verification"||W(e.attributes.name)==="shopify-checkout-api-token"))))}function me(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.maskTextClass,l=t.maskTextSelector,c=t.skipChild,s=c===void 0?!1:c,u=t.inlineStylesheet,d=u===void 0?!0:u,h=t.maskInputOptions,m=h===void 0?{}:h,p=t.maskTextFn,v=t.maskInputFn,N=t.slimDOMOptions,f=t.dataURLOptions,b=f===void 0?{}:f,S=t.inlineImages,y=S===void 0?!1:S,M=t.recordCanvas,R=M===void 0?!1:M,A=t.onSerialize,P=t.onIframeLoad,L=t.iframeLoadTimeout,B=L===void 0?5e3:L,$=t.onStylesheetLoad,Q=t.stylesheetLoadTimeout,Y=Q===void 0?5e3:Q,j=t.keepIframeSrcFn,H=j===void 0?function(){return!1}:j,Z=t.newlyAddedElement,F=Z===void 0?!1:Z,G=t.enableStrictPrivacy,T=t.preserveWhiteSpace,g=T===void 0?!0:T,I=gr(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:v,dataURLOptions:b,inlineImages:y,recordCanvas:R,keepIframeSrcFn:H,newlyAddedElement:F,enableStrictPrivacy:G});if(!I)return console.warn(e,"not serialized"),null;var E;if(r.hasNode(e)?E=r.getId(e):Tr(I,N)||!g&&I.type===k.Text&&!I.isStyle&&!I.textContent.replace(/^\s+|\s+$/gm,"").length?E=Oe:E=nr(),E===Oe)return null;var w=Object.assign(I,{id:E});r.add(e,w),A&&A(e);var q=!s;if(w.type===k.Element){if(q=q&&!w.needBlock,w.needBlock&&w.tagName==="img"){var ee=e.cloneNode();ee.src="",r.add(ee,w)}delete w.needBlock;var le=e.shadowRoot;le&&Re(le)&&(w.isShadowHost=!0)}if((w.type===k.Document||w.type===k.Element)&&q){N.headWhitespace&&w.type===k.Element&&w.tagName==="head"&&(g=!1);for(var _={doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:s,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:v,slimDOMOptions:N,dataURLOptions:b,inlineImages:y,recordCanvas:R,preserveWhiteSpace:g,onSerialize:A,onIframeLoad:P,iframeLoadTimeout:B,onStylesheetLoad:$,stylesheetLoadTimeout:Y,keepIframeSrcFn:H,enableStrictPrivacy:G},V=0,xe=Array.from(e.childNodes);V<xe.length;V++){var Nt=xe[V],ke=me(Nt,_);ke&&w.childNodes.push(ke)}if(wt(e)&&e.shadowRoot)for(var Et=0,Kn=Array.from(e.shadowRoot.childNodes);Et<Kn.length;Et++){var Nt=Kn[Et],ke=me(Nt,_);ke&&(Re(e.shadowRoot)&&(ke.isShadow=!0),w.childNodes.push(ke))}}return e.parentNode&&De(e.parentNode)&&Re(e.parentNode)&&(w.isShadow=!0),w.type===k.Element&&w.tagName==="iframe"&&vr(e,function(){var de=e.contentDocument;if(de&&P){var Qn=me(de,{doc:de,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:v,slimDOMOptions:N,dataURLOptions:b,inlineImages:y,recordCanvas:R,preserveWhiteSpace:g,onSerialize:A,onIframeLoad:P,iframeLoadTimeout:B,onStylesheetLoad:$,stylesheetLoadTimeout:Y,keepIframeSrcFn:H,enableStrictPrivacy:G});Qn&&P(e,Qn)}},B),w.type===k.Element&&w.tagName==="link"&&w.attributes.rel==="stylesheet"&&(Ot(e,function(){if($){var de=me(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:v,slimDOMOptions:N,dataURLOptions:b,inlineImages:y,recordCanvas:R,preserveWhiteSpace:g,onSerialize:A,onIframeLoad:P,iframeLoadTimeout:B,onStylesheetLoad:$,stylesheetLoadTimeout:Y,keepIframeSrcFn:H,enableStrictPrivacy:G});de&&$(e,de)}},Y),Rt(e)===!1)||w.type===k.Element&&w.tagName==="link"&&w.attributes.rel==="stylesheet"&&(Ot(e,function(){if($){var de=me(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:v,slimDOMOptions:N,dataURLOptions:b,inlineImages:y,recordCanvas:R,preserveWhiteSpace:g,onSerialize:A,onIframeLoad:P,iframeLoadTimeout:B,enableStrictPrivacy:G,onStylesheetLoad:$,stylesheetLoadTimeout:Y,keepIframeSrcFn:H});de&&$(e,de)}},Y),Rt(e)===!1)?null:w}function Nr(e,t){var n=t||{},r=n.mirror,o=r===void 0?new Qe:r,i=n.blockClass,a=i===void 0?"highlight-block":i,l=n.blockSelector,c=l===void 0?null:l,s=n.maskTextClass,u=s===void 0?"highlight-mask":s,d=n.maskTextSelector,h=d===void 0?null:d,m=n.inlineStylesheet,p=m===void 0?!0:m,v=n.inlineImages,N=v===void 0?!1:v,f=n.recordCanvas,b=f===void 0?!1:f,S=n.maskAllInputs,y=S===void 0?!1:S,M=n.maskTextFn,R=n.maskInputFn,A=n.slimDOM,P=A===void 0?!1:A,L=n.dataURLOptions,B=n.preserveWhiteSpace,$=n.onSerialize,Q=n.onIframeLoad,Y=n.iframeLoadTimeout,j=n.onStylesheetLoad,H=n.stylesheetLoadTimeout,Z=n.keepIframeSrcFn,F=Z===void 0?function(){return!1}:Z,G=n.enableStrictPrivacy,T=G===void 0?!1:G,g=y===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:y===!1?{password:!0}:y,I=P===!0||P==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:P==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:P===!1?{}:P;return me(e,{doc:e,mirror:o,blockClass:a,blockSelector:c,maskTextClass:u,maskTextSelector:h,skipChild:!1,inlineStylesheet:p,maskInputOptions:g,maskTextFn:M,maskInputFn:R,slimDOMOptions:I,dataURLOptions:L,inlineImages:N,recordCanvas:b,preserveWhiteSpace:B,onSerialize:$,onIframeLoad:Q,iframeLoadTimeout:Y,onStylesheetLoad:j,stylesheetLoadTimeout:H,keepIframeSrcFn:F,newlyAddedElement:!1,enableStrictPrivacy:T})}var Lt=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Er(e,t){t===void 0&&(t={});var n=1,r=1;function o(T){var g=T.match(/\n/g);g&&(n+=g.length);var I=T.lastIndexOf(`
2
- `);r=I===-1?r+T.length:T.length-I}function i(){var T={line:n,column:r};return function(g){return g.position=new a(T),p(),g}}var a=function(){function T(g){this.start=g,this.end={line:n,column:r},this.source=t.source}return T}();a.prototype.content=e;var l=[];function c(T){var g=new Error("".concat(t.source||"",":").concat(n,":").concat(r,": ").concat(T));if(g.reason=T,g.filename=t.source,g.line=n,g.column=r,g.source=e,t.silent)l.push(g);else throw g}function s(){var T=h();return{type:"stylesheet",stylesheet:{source:t.source,rules:T,parsingErrors:l}}}function u(){return m(/^{\s*/)}function d(){return m(/^}/)}function h(){var T,g=[];for(p(),v(g);e.length&&e.charAt(0)!=="}"&&(T=F()||G());)T!==!1&&(g.push(T),v(g));return g}function m(T){var g=T.exec(e);if(g){var I=g[0];return o(I),e=e.slice(I.length),g}}function p(){m(/^\s*/)}function v(T){T===void 0&&(T=[]);for(var g;g=N();)g!==!1&&T.push(g),g=N();return T}function N(){var T=i();if(!(e.charAt(0)!=="/"||e.charAt(1)!=="*")){for(var g=2;e.charAt(g)!==""&&(e.charAt(g)!=="*"||e.charAt(g+1)!=="/");)++g;if(g+=2,e.charAt(g-1)==="")return c("End of comment missing");var I=e.slice(2,g-2);return r+=2,o(I),e=e.slice(g),r+=2,T({type:"comment",comment:I})}}function f(){var T=m(/^([^{]+)/);if(T)return ce(T[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(g){return g.replace(/,/g,"\u200C")}).split(/\s*(?![^(]*\)),\s*/).map(function(g){return g.replace(/\u200C/g,",")})}function b(){var T=i(),g=m(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(g){var I=ce(g[0]);if(!m(/^:\s*/))return c("property missing ':'");var E=m(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),w=T({type:"declaration",property:I.replace(Lt,""),value:E?ce(E[0]).replace(Lt,""):""});return m(/^[;\s]*/),w}}function S(){var T=[];if(!u())return c("missing '{'");v(T);for(var g;g=b();)g!==!1&&(T.push(g),v(T)),g=b();return d()?T:c("missing '}'")}function y(){for(var T,g=[],I=i();T=m(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)g.push(T[1]),m(/^,\s*/);if(g.length)return I({type:"keyframe",values:g,declarations:S()})}function M(){var T=i(),g=m(/^@([-\w]+)?keyframes\s*/);if(g){var I=g[1];if(g=m(/^([-\w]+)\s*/),!g)return c("@keyframes missing name");var E=g[1];if(!u())return c("@keyframes missing '{'");for(var w,q=v();w=y();)q.push(w),q=q.concat(v());return d()?T({type:"keyframes",name:E,vendor:I,keyframes:q}):c("@keyframes missing '}'")}}function R(){var T=i(),g=m(/^@supports *([^{]+)/);if(g){var I=ce(g[1]);if(!u())return c("@supports missing '{'");var E=v().concat(h());return d()?T({type:"supports",supports:I,rules:E}):c("@supports missing '}'")}}function A(){var T=i(),g=m(/^@host\s*/);if(g){if(!u())return c("@host missing '{'");var I=v().concat(h());return d()?T({type:"host",rules:I}):c("@host missing '}'")}}function P(){var T=i(),g=m(/^@media *([^{]+)/);if(g){var I=ce(g[1]);if(!u())return c("@media missing '{'");var E=v().concat(h());return d()?T({type:"media",media:I,rules:E}):c("@media missing '}'")}}function L(){var T=i(),g=m(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(g)return T({type:"custom-media",name:ce(g[1]),media:ce(g[2])})}function B(){var T=i(),g=m(/^@page */);if(g){var I=f()||[];if(!u())return c("@page missing '{'");for(var E=v(),w;w=b();)E.push(w),E=E.concat(v());return d()?T({type:"page",selectors:I,declarations:E}):c("@page missing '}'")}}function $(){var T=i(),g=m(/^@([-\w]+)?document *([^{]+)/);if(g){var I=ce(g[1]),E=ce(g[2]);if(!u())return c("@document missing '{'");var w=v().concat(h());return d()?T({type:"document",document:E,vendor:I,rules:w}):c("@document missing '}'")}}function Q(){var T=i(),g=m(/^@font-face\s*/);if(g){if(!u())return c("@font-face missing '{'");for(var I=v(),E;E=b();)I.push(E),I=I.concat(v());return d()?T({type:"font-face",declarations:I}):c("@font-face missing '}'")}}var Y=Z("import"),j=Z("charset"),H=Z("namespace");function Z(T){var g=new RegExp("^@"+T+"\\s*([^;]+);");return function(){var I=i(),E=m(g);if(E){var w={type:T};return w[T]=E[1].trim(),I(w)}}}function F(){if(e[0]==="@")return M()||P()||L()||R()||Y()||j()||H()||$()||B()||A()||Q()}function G(){var T=i(),g=f();return g?(v(),T({type:"rule",selectors:g,declarations:S()})):c("selector missing")}return tt(s())}function ce(e){return e?e.replace(/^\s+|\s+$/g,""):""}function tt(e,t){for(var n=e&&typeof e.type=="string",r=n?e:t,o=0,i=Object.keys(e);o<i.length;o++){var a=i[o],l=e[a];Array.isArray(l)?l.forEach(function(c){tt(c,r)}):l&&typeof l=="object"&&tt(l,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var At={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function wr(e){var t=At[e.tagName]?At[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function Cr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Pt=/([^\\]):hover/,Ir=new RegExp(Pt.source,"g");function Ft(e,t){var n;if(!(!((n=window?.HIG_CONFIGURATION)===null||n===void 0)&&n.enableOnHoverClass))return e;var r=t?.stylesWithHoverClass.get(e);if(r)return r;var o=Er(e,{silent:!0});if(!o.stylesheet)return e;var i=[];if(o.stylesheet.rules.forEach(function(c){"selectors"in c&&(c.selectors||[]).forEach(function(s){Pt.test(s)&&i.push(s)})}),i.length===0)return e;var a=new RegExp(i.filter(function(c,s){return i.indexOf(c)===s}).sort(function(c,s){return s.length-c.length}).map(function(c){return Cr(c)}).join("|"),"g"),l=e.replace(a,function(c){var s=c.replace(Ir,"$1.\\:hover");return"".concat(c,", ").concat(s)});return t?.stylesWithHoverClass.set(e,l),l}function _t(){var e=new Map;return{stylesWithHoverClass:e}}function Mr(e,t){var n=t.doc,r=t.hackCss,o=t.cache;switch(e.type){case k.Document:return n.implementation.createDocument(null,"",null);case k.DocumentType:return n.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case k.Element:{var i=wr(e),a;e.isSVG?a=n.createElementNS("http://www.w3.org/2000/svg",i):a=n.createElement(i);var l=function(d){if(!Object.prototype.hasOwnProperty.call(e.attributes,d))return"continue";var h=e.attributes[d];if(i==="option"&&d==="selected"&&h===!1)return"continue";if(h=typeof h=="boolean"||typeof h=="number"?"":h,d.startsWith("rr_")){if(i==="canvas"&&d==="rr_dataURL"){var m=document.createElement("img");m.onload=function(){var L=a.getContext("2d");L&&L.drawImage(m,0,0,m.width,m.height)},m.src=h,a.RRNodeType&&(a.rr_dataURL=h)}else if(i==="img"&&d==="rr_dataURL"){var p=a;p.currentSrc.startsWith("data:")||(p.setAttribute("rrweb-original-src",e.attributes.src),p.src=h,p.setAttribute("rrweb-inline-src",h))}if(d==="rr_width")a.style.width=h;else if(d==="rr_height")a.style.height=h;else if(d==="rr_mediaCurrentTime")a.currentTime=e.attributes.rr_mediaCurrentTime;else if(d==="rr_mediaState")switch(h){case"played":a.play().catch(function(L){return console.warn("media playback error",L)});break;case"paused":a.pause();break}}else{var v=i==="textarea"&&d==="value",N=i==="style"&&d==="_cssText";if(N&&r&&(h=Ft(h,o),typeof h=="string")){for(var f=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,b=void 0,S=[],y="https://replay-cors-proxy.highlightrun.workers.dev";(b=f.exec(h))!==null;)b.index===f.lastIndex&&f.lastIndex++,b.forEach(function(L,B){if(B===0){var $=L.slice(5,L.length-2);S.push({originalUrl:$,proxyUrl:$.replace($,"".concat(y,"?url=").concat($))})}});S.forEach(function(L){h=h.replace(L.originalUrl,L.proxyUrl)})}if(v||N){for(var M=n.createTextNode(h),R=0,A=Array.from(a.childNodes);R<A.length;R++){var P=A[R];P.nodeType===a.TEXT_NODE&&a.removeChild(P)}return a.appendChild(M),"continue"}try{if(e.isSVG&&d==="xlink:href")a.setAttributeNS("http://www.w3.org/1999/xlink",d,h);else if(d==="onload"||d==="onclick"||d.substring(0,7)==="onmouse")a.setAttribute("_"+d,h);else{if(i==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&d==="content")return a.setAttribute("csp-content",h),"continue";i==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||i==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")||(i==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?a.setAttribute("rrweb-original-srcset",e.attributes.srcset):a.setAttribute(d,h))}}catch{}}};for(var c in e.attributes)l(c);if(i==="img"){var s=a;if(!s.currentSrc.startsWith("data:")){var u=s.getAttribute("rrweb-inline-src");u!=null&&u.startsWith("data:")&&(s.src=u)}}if(e.isShadowHost)if(!a.shadowRoot)a.attachShadow({mode:"open"});else for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);return a}case k.Text:return n.createTextNode(e.isStyle&&r?Ft(e.textContent,o):e.textContent);case k.CDATA:return n.createCDATASection(e.textContent);case k.Comment:return n.createComment(e.textContent);default:return null}}function je(e,t){var n=t.doc,r=t.mirror,o=t.skipChild,i=o===void 0?!1:o,a=t.hackCss,l=a===void 0?!0:a,c=t.afterAppend,s=t.cache,u=Mr(e,{doc:n,hackCss:l,cache:s});if(!u)return null;if(e.rootId&&console.assert(r.getNode(e.rootId)===n,"Target document should have the same root id."),e.type===k.Document&&(n.close(),n.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==k.DocumentType&&(e.childNodes[0].type===k.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),u=n),r.add(u,e),(e.type===k.Document||e.type===k.Element)&&!i)for(var d=0,h=e.childNodes;d<h.length;d++){var m=h[d],p=je(m,{doc:n,mirror:r,skipChild:!1,hackCss:l,afterAppend:c,cache:s});if(!p){console.warn("Failed to rebuild",m);continue}m.isShadow&&wt(u)&&u.shadowRoot?u.shadowRoot.appendChild(p):u.appendChild(p),c&&c(p)}return u}function xr(e,t){function n(a){t(a)}for(var r=0,o=e.getIds();r<o.length;r++){var i=o[r];e.has(i)&&n(e.getNode(i))}}function kr(e,t){var n=t.getMeta(e);if(n?.type===k.Element){var r=e;for(var o in n.attributes)if(Object.prototype.hasOwnProperty.call(n.attributes,o)&&o.startsWith("rr_")){var i=n.attributes[o];o==="rr_scrollLeft"&&(r.scrollLeft=i),o==="rr_scrollTop"&&(r.scrollTop=i)}}}function Dr(e,t){var n=t.doc,r=t.onVisit,o=t.hackCss,i=o===void 0?!0:o,a=t.afterAppend,l=t.cache,c=t.mirror,s=c===void 0?new Qe:c,u=je(e,{doc:n,mirror:s,skipChild:!1,hackCss:i,afterAppend:a,cache:l});return xr(s,function(d){r&&r(d),kr(d,s)}),u}function te(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const Se=`Please stop import mirror directly. Instead of that,\r
1
+ var rrweb=function(J){"use strict";var k;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(k||(k={}));function Ct(e){return e.nodeType===e.ELEMENT_NODE}function De(e){var t=e?.host;return Boolean(t?.shadowRoot===e)}function Re(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}var Qe=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var n;if(!t)return-1;var r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var n=this,r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(function(o){return n.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,n){var r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)},e.prototype.replace=function(t,n){this.idNodeMap.set(t,n)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function It(){return new Qe}function qe(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,o=e.value,i=e.maskInputFn,a=o||"";return(t[n.toLowerCase()]||t[r])&&(i?a=i(a):a="*".repeat(a.length)),a}var Mt="__rrweb_original__";function Jn(e){var t=e.getContext("2d");if(!t)return!0;for(var n=50,r=0;r<e.width;r+=n)for(var o=0;o<e.height;o+=n){var i=t.getImageData,a=Mt in i?i[Mt]:i,l=new Uint32Array(a.call(t,r,o,Math.min(n,e.width-r),Math.min(n,e.height-o)).data.buffer);if(l.some(function(c){return c!==0}))return!1}return!0}function Je(e){return e=e.replace(/[^ -~]+/g,""),e=e?.split(" ").map(function(t){return Math.random().toString(20).substr(2,t.length)}).join(" ")||"",e}var er=1,tr=new RegExp("[^a-z0-9-_:]"),Oe=-2;function nr(){return er++}function rr(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return tr.test(t)?"div":t}function et(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(or).join(""):null}catch{return null}}function or(e){var t=e.cssText;if(ir(e))try{t=et(e.styleSheet)||t}catch{}return t}function ir(e){return"styleSheet"in e}function sr(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function ar(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var be,xt,lr=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,cr=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,ur=/^(data:)([^,]*),(.*)/i;function Ve(e,t){return(e||"").replace(lr,function(n,r,o,i,a,l){var c=o||a||l,s=r||i||"";if(!c)return n;if(!cr.test(c)||ur.test(c))return"url(".concat(s).concat(c).concat(s,")");if(c[0]==="/")return"url(".concat(s).concat(ar(t)+c).concat(s,")");var u=t.split("/"),d=c.split("/");u.pop();for(var h=0,m=d;h<m.length;h++){var p=m[h];p!=="."&&(p===".."?u.pop():u.push(p))}return"url(".concat(s).concat(u.join("/")).concat(s,")")})}var dr=/^[^ \t\n\r\u000c]+/,hr=/^[, \t\n\r\u000c]+/;function mr(e,t){if(t.trim()==="")return t;var n=0;function r(s){var u,d=s.exec(t.substring(n));return d?(u=d[0],n+=u.length,u):""}for(var o=[];r(hr),!(n>=t.length);){var i=r(dr);if(i.slice(-1)===",")i=Ue(e,i.substring(0,i.length-1)),o.push(i);else{var a="";i=Ue(e,i);for(var l=!1;;){var c=t.charAt(n);if(c===""){o.push((i+a).trim());break}else if(l)c===")"&&(l=!1);else if(c===","){n+=1,o.push((i+a).trim());break}else c==="("&&(l=!0);a+=c,n+=1}}}return o.join(", ")}function Ue(e,t){if(!t||t.trim()==="")return t;var n=e.createElement("a");return n.href=t,n.href}function pr(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function tt(){var e=document.createElement("a");return e.href="",e.href}function kt(e,t,n,r){return n==="src"||n==="href"&&r&&!(t==="use"&&r[0]==="#")||n==="xlink:href"&&r&&r[0]!=="#"||n==="background"&&r&&(t==="table"||t==="td"||t==="th")?Ue(e,r):n==="srcset"&&r?mr(e,r):n==="style"&&r?Ve(r,tt()):t==="object"&&n==="data"&&r?Ue(e,r):r}function fr(e,t,n){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?e.matches(n):!1}function Ge(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?Ge(e.parentNode,t,n):!1;for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return n?Ge(e.parentNode,t,n):!1}function Dt(e,t,n){var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(r===null)return!1;if(typeof t=="string"){if(r.classList.contains(t)||r.closest(".".concat(t)))return!0}else if(Ge(r,t,!0))return!0;return!!(n&&(r.matches(n)||r.closest(n)))}function vr(e,t,n){var r=e.contentWindow;if(r){var o=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){var a=setTimeout(function(){o||(t(),o=!0)},n);e.addEventListener("load",function(){clearTimeout(a),o=!0,t()});return}var l="about:blank";if(r.location.href!==l||e.src===l||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function Rt(e){return e.getAttribute("href")?e.sheet!==null:!0}function Ot(e,t,n){var r=!1,o;try{o=e.sheet}catch{return}if(!o){var i=setTimeout(function(){r||(t(),r=!0)},n);e.addEventListener("load",function(){clearTimeout(i),r=!0,t()})}}function gr(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.maskTextClass,l=t.maskTextSelector,c=t.inlineStylesheet,s=t.maskInputOptions,u=s===void 0?{}:s,d=t.maskTextFn,h=t.maskInputFn,m=t.dataURLOptions,p=m===void 0?{}:m,v=t.inlineImages,N=t.recordCanvas,f=t.keepIframeSrcFn,b=t.newlyAddedElement,S=b===void 0?!1:b,y=t.enableStrictPrivacy,M=yr(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:k.Document,childNodes:[],compatMode:e.compatMode,rootId:M}:{type:k.Document,childNodes:[],rootId:M};case e.DOCUMENT_TYPE_NODE:return{type:k.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:M};case e.ELEMENT_NODE:return Sr(e,{doc:n,blockClass:o,blockSelector:i,inlineStylesheet:c,maskInputOptions:u,maskInputFn:h,dataURLOptions:p,inlineImages:v,recordCanvas:N,keepIframeSrcFn:f,newlyAddedElement:S,enableStrictPrivacy:y,rootId:M});case e.TEXT_NODE:return br(e,{maskTextClass:a,maskTextSelector:l,maskTextFn:d,enableStrictPrivacy:y,rootId:M});case e.CDATA_SECTION_NODE:return{type:k.CDATA,textContent:"",rootId:M};case e.COMMENT_NODE:return{type:k.Comment,textContent:e.textContent||"",rootId:M};default:return!1}}function yr(e,t){if(t.hasNode(e)){var n=t.getId(e);return n===1?void 0:n}}function br(e,t){var n,r=t.maskTextClass,o=t.maskTextSelector,i=t.maskTextFn,a=t.enableStrictPrivacy,l=t.rootId,c=e.parentNode&&e.parentNode.tagName,s=e.textContent,u=c==="STYLE"?!0:void 0,d=c==="SCRIPT"?!0:void 0,h=!1;if(u&&s){try{e.nextSibling||e.previousSibling||!((n=e.parentNode.sheet)===null||n===void 0)&&n.cssRules&&(s=sr(e.parentNode.sheet))}catch(p){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(p),e)}s=Ve(s,tt()),h=!0}if(d?(s="SCRIPT_PLACEHOLDER",h=!0):c==="NOSCRIPT"&&(s="",h=!0),!u&&!d&&s&&Dt(e,r,o)&&(s=i?i(s):s.replace(/[\S]/g,"*")),a&&!h&&c){var m=new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]);!m.has(c)&&s&&(s=Je(s))}return{type:k.Text,textContent:s||"",isStyle:u,rootId:l}}function Sr(e,t){for(var n=t.doc,r=t.blockClass,o=t.blockSelector,i=t.inlineStylesheet,a=t.maskInputOptions,l=a===void 0?{}:a,c=t.maskInputFn,s=t.dataURLOptions,u=s===void 0?{}:s,d=t.inlineImages,h=t.recordCanvas,m=t.keepIframeSrcFn,p=t.newlyAddedElement,v=p===void 0?!1:p,N=t.enableStrictPrivacy,f=t.rootId,b=fr(e,r,o),S=rr(e),y={},M=e.attributes.length,R=0;R<M;R++){var A=e.attributes[R];y[A.name]=kt(n,S,A.name,A.value)}if(S==="link"&&i){var P=Array.from(n.styleSheets).find(function(g){return g.href===e.href}),L=null;P&&(L=et(P)),L&&(delete y.rel,delete y.href,y._cssText=Ve(L,P.href))}if(S==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var L=et(e.sheet);L&&(y._cssText=Ve(L,tt()))}if(S==="input"||S==="textarea"||S==="select"){var B=e.value;y.type!=="radio"&&y.type!=="checkbox"&&y.type!=="submit"&&y.type!=="button"&&B?y.value=qe({type:y.type,tagName:S,value:B,maskInputOptions:l,maskInputFn:c}):e.checked&&(y.checked=e.checked)}if(S==="option"&&(e.selected&&!l.select?y.selected=!0:delete y.selected),S==="canvas"&&h){if(e.__context==="2d")Jn(e)||(y.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var $=e.toDataURL(u.type,u.quality),Q=document.createElement("canvas");Q.width=e.width,Q.height=e.height;var Y=Q.toDataURL(u.type,u.quality);$!==Y&&(y.rr_dataURL=$)}}if(S==="img"&&d){be||(be=n.createElement("canvas"),xt=be.getContext("2d"));var j=e,H=j.crossOrigin;j.crossOrigin="anonymous";var Z=function(){try{be.width=j.naturalWidth,be.height=j.naturalHeight,xt.drawImage(j,0,0),y.rr_dataURL=be.toDataURL(u.type,u.quality)}catch(g){console.warn("Cannot inline img src=".concat(j.currentSrc,"! Error: ").concat(g))}H?y.crossOrigin=H:j.removeAttribute("crossorigin")};j.complete&&j.naturalWidth!==0?Z():j.onload=Z}if((S==="audio"||S==="video")&&(y.rr_mediaState=e.paused?"paused":"played",y.rr_mediaCurrentTime=e.currentTime),v||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),b||S==="img"&&N){var F=e.getBoundingClientRect(),G=F.width,T=F.height;y={class:y.class,rr_width:"".concat(G,"px"),rr_height:"".concat(T,"px")},b=!0}return S==="iframe"&&!m(y.src)&&(e.contentDocument||(y.rr_src=y.src),delete y.src),{type:k.Element,tagName:S,attributes:y,childNodes:[],isSVG:pr(e)||void 0,needBlock:b,rootId:f}}function W(e){return e===void 0?"":e.toLowerCase()}function Tr(e,t){return!!(t.comment&&e.type===k.Comment||e.type===k.Element&&(t.script&&(e.tagName==="script"||e.tagName==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js"))||t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(W(e.attributes.name).match(/^msapplication-tile(image|color)$/)||W(e.attributes.name)==="application-name"||W(e.attributes.rel)==="icon"||W(e.attributes.rel)==="apple-touch-icon"||W(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&W(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(W(e.attributes.property).match(/^(og|twitter|fb):/)||W(e.attributes.name).match(/^(og|twitter):/)||W(e.attributes.name)==="pinterest")||t.headMetaRobots&&(W(e.attributes.name)==="robots"||W(e.attributes.name)==="googlebot"||W(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&(W(e.attributes.name)==="author"||W(e.attributes.name)==="generator"||W(e.attributes.name)==="framework"||W(e.attributes.name)==="publisher"||W(e.attributes.name)==="progid"||W(e.attributes.property).match(/^article:/)||W(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(W(e.attributes.name)==="google-site-verification"||W(e.attributes.name)==="yandex-verification"||W(e.attributes.name)==="csrf-token"||W(e.attributes.name)==="p:domain_verify"||W(e.attributes.name)==="verify-v1"||W(e.attributes.name)==="verification"||W(e.attributes.name)==="shopify-checkout-api-token"))))}function me(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.maskTextClass,l=t.maskTextSelector,c=t.skipChild,s=c===void 0?!1:c,u=t.inlineStylesheet,d=u===void 0?!0:u,h=t.maskInputOptions,m=h===void 0?{}:h,p=t.maskTextFn,v=t.maskInputFn,N=t.slimDOMOptions,f=t.dataURLOptions,b=f===void 0?{}:f,S=t.inlineImages,y=S===void 0?!1:S,M=t.recordCanvas,R=M===void 0?!1:M,A=t.onSerialize,P=t.onIframeLoad,L=t.iframeLoadTimeout,B=L===void 0?5e3:L,$=t.onStylesheetLoad,Q=t.stylesheetLoadTimeout,Y=Q===void 0?5e3:Q,j=t.keepIframeSrcFn,H=j===void 0?function(){return!1}:j,Z=t.newlyAddedElement,F=Z===void 0?!1:Z,G=t.enableStrictPrivacy,T=t.preserveWhiteSpace,g=T===void 0?!0:T,I=gr(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:v,dataURLOptions:b,inlineImages:y,recordCanvas:R,keepIframeSrcFn:H,newlyAddedElement:F,enableStrictPrivacy:G});if(!I)return console.warn(e,"not serialized"),null;var E;if(r.hasNode(e)?E=r.getId(e):Tr(I,N)||!g&&I.type===k.Text&&!I.isStyle&&!I.textContent.replace(/^\s+|\s+$/gm,"").length?E=Oe:E=nr(),E===Oe)return null;var w=Object.assign(I,{id:E});r.add(e,w),A&&A(e);var q=!s;if(w.type===k.Element){if(q=q&&!w.needBlock,w.needBlock&&w.tagName==="img"){var ee=e.cloneNode();ee.src="",r.add(ee,w)}delete w.needBlock;var le=e.shadowRoot;le&&Re(le)&&(w.isShadowHost=!0)}if((w.type===k.Document||w.type===k.Element)&&q){N.headWhitespace&&w.type===k.Element&&w.tagName==="head"&&(g=!1);for(var _={doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:s,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:v,slimDOMOptions:N,dataURLOptions:b,inlineImages:y,recordCanvas:R,preserveWhiteSpace:g,onSerialize:A,onIframeLoad:P,iframeLoadTimeout:B,onStylesheetLoad:$,stylesheetLoadTimeout:Y,keepIframeSrcFn:H,enableStrictPrivacy:G},V=0,xe=Array.from(e.childNodes);V<xe.length;V++){var Et=xe[V],ke=me(Et,_);ke&&w.childNodes.push(ke)}if(Ct(e)&&e.shadowRoot)for(var wt=0,Kn=Array.from(e.shadowRoot.childNodes);wt<Kn.length;wt++){var Et=Kn[wt],ke=me(Et,_);ke&&(Re(e.shadowRoot)&&(ke.isShadow=!0),w.childNodes.push(ke))}}return e.parentNode&&De(e.parentNode)&&Re(e.parentNode)&&(w.isShadow=!0),w.type===k.Element&&w.tagName==="iframe"&&vr(e,function(){var de=e.contentDocument;if(de&&P){var Qn=me(de,{doc:de,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:v,slimDOMOptions:N,dataURLOptions:b,inlineImages:y,recordCanvas:R,preserveWhiteSpace:g,onSerialize:A,onIframeLoad:P,iframeLoadTimeout:B,onStylesheetLoad:$,stylesheetLoadTimeout:Y,keepIframeSrcFn:H,enableStrictPrivacy:G});Qn&&P(e,Qn)}},B),w.type===k.Element&&w.tagName==="link"&&w.attributes.rel==="stylesheet"&&(Ot(e,function(){if($){var de=me(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:v,slimDOMOptions:N,dataURLOptions:b,inlineImages:y,recordCanvas:R,preserveWhiteSpace:g,onSerialize:A,onIframeLoad:P,iframeLoadTimeout:B,onStylesheetLoad:$,stylesheetLoadTimeout:Y,keepIframeSrcFn:H,enableStrictPrivacy:G});de&&$(e,de)}},Y),Rt(e)===!1)||w.type===k.Element&&w.tagName==="link"&&w.attributes.rel==="stylesheet"&&(Ot(e,function(){if($){var de=me(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:m,maskTextFn:p,maskInputFn:v,slimDOMOptions:N,dataURLOptions:b,inlineImages:y,recordCanvas:R,preserveWhiteSpace:g,onSerialize:A,onIframeLoad:P,iframeLoadTimeout:B,enableStrictPrivacy:G,onStylesheetLoad:$,stylesheetLoadTimeout:Y,keepIframeSrcFn:H});de&&$(e,de)}},Y),Rt(e)===!1)?null:w}function Nr(e,t){var n=t||{},r=n.mirror,o=r===void 0?new Qe:r,i=n.blockClass,a=i===void 0?"highlight-block":i,l=n.blockSelector,c=l===void 0?null:l,s=n.maskTextClass,u=s===void 0?"highlight-mask":s,d=n.maskTextSelector,h=d===void 0?null:d,m=n.inlineStylesheet,p=m===void 0?!0:m,v=n.inlineImages,N=v===void 0?!1:v,f=n.recordCanvas,b=f===void 0?!1:f,S=n.maskAllInputs,y=S===void 0?!1:S,M=n.maskTextFn,R=n.maskInputFn,A=n.slimDOM,P=A===void 0?!1:A,L=n.dataURLOptions,B=n.preserveWhiteSpace,$=n.onSerialize,Q=n.onIframeLoad,Y=n.iframeLoadTimeout,j=n.onStylesheetLoad,H=n.stylesheetLoadTimeout,Z=n.keepIframeSrcFn,F=Z===void 0?function(){return!1}:Z,G=n.enableStrictPrivacy,T=G===void 0?!1:G,g=y===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:y===!1?{password:!0}:y,I=P===!0||P==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:P==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:P===!1?{}:P;return me(e,{doc:e,mirror:o,blockClass:a,blockSelector:c,maskTextClass:u,maskTextSelector:h,skipChild:!1,inlineStylesheet:p,maskInputOptions:g,maskTextFn:M,maskInputFn:R,slimDOMOptions:I,dataURLOptions:L,inlineImages:N,recordCanvas:b,preserveWhiteSpace:B,onSerialize:$,onIframeLoad:Q,iframeLoadTimeout:Y,onStylesheetLoad:j,stylesheetLoadTimeout:H,keepIframeSrcFn:F,newlyAddedElement:!1,enableStrictPrivacy:T})}var Lt=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Er(e,t){t===void 0&&(t={});var n=1,r=1;function o(T){var g=T.match(/\n/g);g&&(n+=g.length);var I=T.lastIndexOf(`
2
+ `);r=I===-1?r+T.length:T.length-I}function i(){var T={line:n,column:r};return function(g){return g.position=new a(T),p(),g}}var a=function(){function T(g){this.start=g,this.end={line:n,column:r},this.source=t.source}return T}();a.prototype.content=e;var l=[];function c(T){var g=new Error("".concat(t.source||"",":").concat(n,":").concat(r,": ").concat(T));if(g.reason=T,g.filename=t.source,g.line=n,g.column=r,g.source=e,t.silent)l.push(g);else throw g}function s(){var T=h();return{type:"stylesheet",stylesheet:{source:t.source,rules:T,parsingErrors:l}}}function u(){return m(/^{\s*/)}function d(){return m(/^}/)}function h(){var T,g=[];for(p(),v(g);e.length&&e.charAt(0)!=="}"&&(T=F()||G());)T!==!1&&(g.push(T),v(g));return g}function m(T){var g=T.exec(e);if(g){var I=g[0];return o(I),e=e.slice(I.length),g}}function p(){m(/^\s*/)}function v(T){T===void 0&&(T=[]);for(var g;g=N();)g!==!1&&T.push(g),g=N();return T}function N(){var T=i();if(!(e.charAt(0)!=="/"||e.charAt(1)!=="*")){for(var g=2;e.charAt(g)!==""&&(e.charAt(g)!=="*"||e.charAt(g+1)!=="/");)++g;if(g+=2,e.charAt(g-1)==="")return c("End of comment missing");var I=e.slice(2,g-2);return r+=2,o(I),e=e.slice(g),r+=2,T({type:"comment",comment:I})}}function f(){var T=m(/^([^{]+)/);if(T)return ce(T[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(g){return g.replace(/,/g,"\u200C")}).split(/\s*(?![^(]*\)),\s*/).map(function(g){return g.replace(/\u200C/g,",")})}function b(){var T=i(),g=m(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(g){var I=ce(g[0]);if(!m(/^:\s*/))return c("property missing ':'");var E=m(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),w=T({type:"declaration",property:I.replace(Lt,""),value:E?ce(E[0]).replace(Lt,""):""});return m(/^[;\s]*/),w}}function S(){var T=[];if(!u())return c("missing '{'");v(T);for(var g;g=b();)g!==!1&&(T.push(g),v(T)),g=b();return d()?T:c("missing '}'")}function y(){for(var T,g=[],I=i();T=m(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)g.push(T[1]),m(/^,\s*/);if(g.length)return I({type:"keyframe",values:g,declarations:S()})}function M(){var T=i(),g=m(/^@([-\w]+)?keyframes\s*/);if(g){var I=g[1];if(g=m(/^([-\w]+)\s*/),!g)return c("@keyframes missing name");var E=g[1];if(!u())return c("@keyframes missing '{'");for(var w,q=v();w=y();)q.push(w),q=q.concat(v());return d()?T({type:"keyframes",name:E,vendor:I,keyframes:q}):c("@keyframes missing '}'")}}function R(){var T=i(),g=m(/^@supports *([^{]+)/);if(g){var I=ce(g[1]);if(!u())return c("@supports missing '{'");var E=v().concat(h());return d()?T({type:"supports",supports:I,rules:E}):c("@supports missing '}'")}}function A(){var T=i(),g=m(/^@host\s*/);if(g){if(!u())return c("@host missing '{'");var I=v().concat(h());return d()?T({type:"host",rules:I}):c("@host missing '}'")}}function P(){var T=i(),g=m(/^@media *([^{]+)/);if(g){var I=ce(g[1]);if(!u())return c("@media missing '{'");var E=v().concat(h());return d()?T({type:"media",media:I,rules:E}):c("@media missing '}'")}}function L(){var T=i(),g=m(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(g)return T({type:"custom-media",name:ce(g[1]),media:ce(g[2])})}function B(){var T=i(),g=m(/^@page */);if(g){var I=f()||[];if(!u())return c("@page missing '{'");for(var E=v(),w;w=b();)E.push(w),E=E.concat(v());return d()?T({type:"page",selectors:I,declarations:E}):c("@page missing '}'")}}function $(){var T=i(),g=m(/^@([-\w]+)?document *([^{]+)/);if(g){var I=ce(g[1]),E=ce(g[2]);if(!u())return c("@document missing '{'");var w=v().concat(h());return d()?T({type:"document",document:E,vendor:I,rules:w}):c("@document missing '}'")}}function Q(){var T=i(),g=m(/^@font-face\s*/);if(g){if(!u())return c("@font-face missing '{'");for(var I=v(),E;E=b();)I.push(E),I=I.concat(v());return d()?T({type:"font-face",declarations:I}):c("@font-face missing '}'")}}var Y=Z("import"),j=Z("charset"),H=Z("namespace");function Z(T){var g=new RegExp("^@"+T+"\\s*([^;]+);");return function(){var I=i(),E=m(g);if(E){var w={type:T};return w[T]=E[1].trim(),I(w)}}}function F(){if(e[0]==="@")return M()||P()||L()||R()||Y()||j()||H()||$()||B()||A()||Q()}function G(){var T=i(),g=f();return g?(v(),T({type:"rule",selectors:g,declarations:S()})):c("selector missing")}return nt(s())}function ce(e){return e?e.replace(/^\s+|\s+$/g,""):""}function nt(e,t){for(var n=e&&typeof e.type=="string",r=n?e:t,o=0,i=Object.keys(e);o<i.length;o++){var a=i[o],l=e[a];Array.isArray(l)?l.forEach(function(c){nt(c,r)}):l&&typeof l=="object"&&nt(l,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var At={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function wr(e){var t=At[e.tagName]?At[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function Cr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Pt=/([^\\]):hover/,Ir=new RegExp(Pt.source,"g");function Ft(e,t){var n;if(!(!((n=window?.HIG_CONFIGURATION)===null||n===void 0)&&n.enableOnHoverClass))return e;var r=t?.stylesWithHoverClass.get(e);if(r)return r;var o=Er(e,{silent:!0});if(!o.stylesheet)return e;var i=[];if(o.stylesheet.rules.forEach(function(c){"selectors"in c&&(c.selectors||[]).forEach(function(s){Pt.test(s)&&i.push(s)})}),i.length===0)return e;var a=new RegExp(i.filter(function(c,s){return i.indexOf(c)===s}).sort(function(c,s){return s.length-c.length}).map(function(c){return Cr(c)}).join("|"),"g"),l=e.replace(a,function(c){var s=c.replace(Ir,"$1.\\:hover");return"".concat(c,", ").concat(s)});return t?.stylesWithHoverClass.set(e,l),l}function _t(){var e=new Map;return{stylesWithHoverClass:e}}function Mr(e,t){var n=t.doc,r=t.hackCss,o=t.cache;switch(e.type){case k.Document:return n.implementation.createDocument(null,"",null);case k.DocumentType:return n.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case k.Element:{var i=wr(e),a;e.isSVG?a=n.createElementNS("http://www.w3.org/2000/svg",i):a=n.createElement(i);var l=function(d){if(!Object.prototype.hasOwnProperty.call(e.attributes,d))return"continue";var h=e.attributes[d];if(i==="option"&&d==="selected"&&h===!1)return"continue";if(h=typeof h=="boolean"||typeof h=="number"?"":h,d.startsWith("rr_")){if(i==="canvas"&&d==="rr_dataURL"){var m=document.createElement("img");m.onload=function(){var L=a.getContext("2d");L&&L.drawImage(m,0,0,m.width,m.height)},m.src=h,a.RRNodeType&&(a.rr_dataURL=h)}else if(i==="img"&&d==="rr_dataURL"){var p=a;p.currentSrc.startsWith("data:")||(p.setAttribute("rrweb-original-src",e.attributes.src),p.src=h,p.setAttribute("rrweb-inline-src",h))}if(d==="rr_width")a.style.width=h;else if(d==="rr_height")a.style.height=h;else if(d==="rr_mediaCurrentTime")a.currentTime=e.attributes.rr_mediaCurrentTime;else if(d==="rr_mediaState")switch(h){case"played":a.play().catch(function(L){return console.warn("media playback error",L)});break;case"paused":a.pause();break}}else{var v=i==="textarea"&&d==="value",N=i==="style"&&d==="_cssText";if(N&&r&&(h=Ft(h,o),typeof h=="string")){for(var f=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,b=void 0,S=[],y="https://replay-cors-proxy.highlightrun.workers.dev";(b=f.exec(h))!==null;)b.index===f.lastIndex&&f.lastIndex++,b.forEach(function(L,B){if(B===0){var $=L.slice(5,L.length-2);S.push({originalUrl:$,proxyUrl:$.replace($,"".concat(y,"?url=").concat($))})}});S.forEach(function(L){h=h.replace(L.originalUrl,L.proxyUrl)})}if(v||N){for(var M=n.createTextNode(h),R=0,A=Array.from(a.childNodes);R<A.length;R++){var P=A[R];P.nodeType===a.TEXT_NODE&&a.removeChild(P)}return a.appendChild(M),"continue"}try{if(e.isSVG&&d==="xlink:href")a.setAttributeNS("http://www.w3.org/1999/xlink",d,h);else if(d==="onload"||d==="onclick"||d.substring(0,7)==="onmouse")a.setAttribute("_"+d,h);else{if(i==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&d==="content")return a.setAttribute("csp-content",h),"continue";i==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||i==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")||(i==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?a.setAttribute("rrweb-original-srcset",e.attributes.srcset):a.setAttribute(d,h))}}catch{}}};for(var c in e.attributes)l(c);if(i==="img"){var s=a;if(!s.currentSrc.startsWith("data:")){var u=s.getAttribute("rrweb-inline-src");u!=null&&u.startsWith("data:")&&(s.src=u)}}if(e.isShadowHost)if(!a.shadowRoot)a.attachShadow({mode:"open"});else for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);return a}case k.Text:return n.createTextNode(e.isStyle&&r?Ft(e.textContent,o):e.textContent);case k.CDATA:return n.createCDATASection(e.textContent);case k.Comment:return n.createComment(e.textContent);default:return null}}function je(e,t){var n=t.doc,r=t.mirror,o=t.skipChild,i=o===void 0?!1:o,a=t.hackCss,l=a===void 0?!0:a,c=t.afterAppend,s=t.cache,u=Mr(e,{doc:n,hackCss:l,cache:s});if(!u)return null;if(e.rootId&&console.assert(r.getNode(e.rootId)===n,"Target document should have the same root id."),e.type===k.Document&&(n.close(),n.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==k.DocumentType&&(e.childNodes[0].type===k.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),u=n),r.add(u,e),(e.type===k.Document||e.type===k.Element)&&!i)for(var d=0,h=e.childNodes;d<h.length;d++){var m=h[d],p=je(m,{doc:n,mirror:r,skipChild:!1,hackCss:l,afterAppend:c,cache:s});if(!p){console.warn("Failed to rebuild",m);continue}m.isShadow&&Ct(u)&&u.shadowRoot?u.shadowRoot.appendChild(p):u.appendChild(p),c&&c(p)}return u}function xr(e,t){function n(a){t(a)}for(var r=0,o=e.getIds();r<o.length;r++){var i=o[r];e.has(i)&&n(e.getNode(i))}}function kr(e,t){var n=t.getMeta(e);if(n?.type===k.Element){var r=e;for(var o in n.attributes)if(Object.prototype.hasOwnProperty.call(n.attributes,o)&&o.startsWith("rr_")){var i=n.attributes[o];o==="rr_scrollLeft"&&(r.scrollLeft=i),o==="rr_scrollTop"&&(r.scrollTop=i)}}}function Dr(e,t){var n=t.doc,r=t.onVisit,o=t.hackCss,i=o===void 0?!0:o,a=t.afterAppend,l=t.cache,c=t.mirror,s=c===void 0?new Qe:c,u=je(e,{doc:n,mirror:s,skipChild:!1,hackCss:i,afterAppend:a,cache:l});return xr(s,function(d){r&&r(d),kr(d,s)}),u}function te(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const Se=`Please stop import mirror directly. Instead of that,\r
3
3
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
4
- or you can use record.mirror to access the mirror instance during recording.`;J.mirror={map:{},getId(){return console.error(Se),-1},getNode(){return console.error(Se),null},removeNodeFromMap(){console.error(Se)},has(){return console.error(Se),!1},reset(){console.error(Se)}},typeof window<"u"&&window.Proxy&&window.Reflect&&(J.mirror=new Proxy(J.mirror,{get(e,t,n){return t==="map"&&console.error(Se),Reflect.get(e,t,n)}}));function Te(e,t,n={}){let r=null,o=0;return function(...i){const a=Date.now();!o&&n.leading===!1&&(o=a);const l=t-(a-o),c=this;l<=0||l>t?(r&&(clearTimeout(r),r=null),o=a,e.apply(c,i)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{o=n.leading===!1?0:Date.now(),r=null,e.apply(c,i)},l))}}function Le(e,t,n,r,o=window){const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(a){setTimeout(()=>{n.set.call(this,a)},0),i&&i.set&&i.set.call(this,a)}}),()=>Le(e,t,i||{},!0)}function pe(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}function nt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function rt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}const Wt=e=>{try{if(e instanceof HTMLElement)return e.tagName==="CANVAS"}catch{return!1}return!1};function ne(e,t,n){if(!e)return!1;const r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!r)return!1;if(typeof t=="string"){if(r.classList.contains(t)||n&&r.closest("."+t)!==null)return!0}else if(Ge(r,t,n))return!0;return!1}function $t(e,t){return t.getId(e)!==-1}function Be(e,t){return t.getId(e)===Oe}function ot(e,t){if(De(e))return!1;const n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?ot(e.parentNode,t):!0:!0}function it(e){return Boolean(e.changedTouches)}function st(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let n=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function Vt(e){const t={},n=(o,i)=>{const a={value:o,parent:i,children:[]};return t[o.node.id]=a,a},r=[];for(const o of e){const{nextId:i,parentId:a}=o;if(i&&i in t){const l=t[i];if(l.parent){const c=l.parent.children.indexOf(l);l.parent.children.splice(c,0,n(o,l.parent))}else{const c=r.indexOf(l);r.splice(c,0,n(o,null))}continue}if(a in t){const l=t[a];l.children.push(n(o,l));continue}r.push(n(o,null))}return r}function at(e,t){t(e.value);for(let n=e.children.length-1;n>=0;n--)at(e.children[n],t)}function Ne(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function lt(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function ct(e,t){var n,r;const o=(r=(n=e.ownerDocument)==null?void 0:n.defaultView)==null?void 0:r.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const i=o.getBoundingClientRect(),a=ct(o,t),l=i.height/o.clientHeight;return{x:i.x*a.relativeScale+a.x,y:i.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}}function Ae(e){return Boolean(e?.shadowRoot)}function Ee(e,t){const n=e[t[0]];return t.length===1?n:Ee(n.cssRules[t[1]].cssRules,t.slice(2))}function ut(e){const t=[...e],n=t.pop();return{positions:t,index:n}}function Ut(e){const t=new Set,n=[];for(let r=e.length;r--;){const o=e[r];t.has(o.id)||(n.push(o),t.add(o.id))}return n}var Rr=Object.freeze({__proto__:null,on:te,get _mirror(){return J.mirror},throttle:Te,hookSetter:Le,patch:pe,getWindowHeight:nt,getWindowWidth:rt,isCanvasNode:Wt,isBlocked:ne,isSerialized:$t,isIgnored:Be,isAncestorRemoved:ot,isTouchEvent:it,polyfill:st,queueToResolveTrees:Vt,iterateResolveTree:at,isSerializedIframe:Ne,isSerializedStylesheet:lt,getBaseDimension:ct,hasShadowRoot:Ae,getNestedRule:Ee,getPositionsAndIndex:ut,uniqueTextMutations:Ut}),C=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(C||{}),x=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e))(x||{}),X=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(X||{}),ue=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ue||{}),fe=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(fe||{}),O=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e))(O||{});function Gt(e){return"__ln"in e}class Or{constructor(){this.length=0,this.head=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=n?.next||null;return n}addNode(t){const n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&Gt(t.previousSibling)){const r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&Gt(t.nextSibling)&&t.nextSibling.__ln.previous){const r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;this.length++}removeNode(t){const n=t.__ln;!this.head||(n.previous?(n.previous.next=n.next,n.next&&(n.next.previous=n.previous)):(this.head=n.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}}const jt=(e,t)=>`${e}@${t}`;class Lr{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],n=new Or,r=l=>{let c=l,s=Oe;for(;s===Oe;)c=c&&c.nextSibling,s=c&&this.mirror.getId(c);return s},o=l=>{var c,s,u,d,h;const m=l.getRootNode?(c=l.getRootNode())==null?void 0:c.host:null;let p=m;for(;(u=(s=p?.getRootNode)==null?void 0:s.call(p))!=null&&u.host;)p=((h=(d=p?.getRootNode)==null?void 0:d.call(p))==null?void 0:h.host)||null;const v=!this.doc.contains(l)&&(!p||!this.doc.contains(p));if(!l.parentNode||v)return;const N=De(l.parentNode)?this.mirror.getId(m):this.mirror.getId(l.parentNode),f=r(l);if(N===-1||f===-1)return n.addNode(l);const b=me(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,enableStrictPrivacy:this.enableStrictPrivacy,onSerialize:S=>{Ne(S,this.mirror)&&this.iframeManager.addIframe(S),lt(S,this.mirror)&&this.stylesheetManager.addStylesheet(S),Ae(l)&&this.shadowDomManager.addShadowRoot(l.shadowRoot,document)},onIframeLoad:(S,y)=>{this.iframeManager.attachIframe(S,y,this.mirror),this.shadowDomManager.observeAttachShadow(S)},onStylesheetLoad:(S,y)=>{this.stylesheetManager.attachStylesheet(S,y,this.mirror)}});b&&t.push({parentId:N,nextId:f,node:b})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const l of Array.from(this.movedSet.values()))Bt(this.removes,l,this.mirror)&&!this.movedSet.has(l.parentNode)||o(l);for(const l of Array.from(this.addedSet.values()))!Yt(this.droppedSet,l)&&!Bt(this.removes,l,this.mirror)||Yt(this.movedSet,l)?o(l):this.droppedSet.add(l);let i=null;for(;n.length;){let l=null;if(i){const c=this.mirror.getId(i.value.parentNode),s=r(i.value);c!==-1&&s!==-1&&(l=i)}if(!l)for(let c=n.length-1;c>=0;c--){const s=n.get(c);if(s){const u=this.mirror.getId(s.value.parentNode),d=r(s.value);if(u!==-1&&d!==-1){l=s;break}}}if(!l){for(;n.head;)n.removeNode(n.head.value);break}i=l.previous,n.removeNode(l.value),o(l.value)}const a={texts:this.texts.map(l=>{let c=l.value;return this.enableStrictPrivacy&&c&&(c=Mt(c)),{id:this.mirror.getId(l.node),value:c}}).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>({id:this.mirror.getId(l.node),attributes:l.attributes})).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:t};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.processMutation=t=>{if(!Be(t.target,this.mirror))switch(t.type){case"characterData":{const n=t.target.textContent;!ne(t.target,this.blockClass,!1)&&n!==t.oldValue&&this.texts.push({value:Dt(t.target,this.maskTextClass,this.maskTextSelector)&&n?this.maskTextFn?this.maskTextFn(n):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{const n=t.target;let r=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(r=qe({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:r,maskInputFn:this.maskInputFn})),ne(t.target,this.blockClass,!1)||r===t.oldValue)return;let o=this.attributes.find(i=>i.node===t.target);if(n.tagName==="IFRAME"&&t.attributeName==="src"&&!this.keepIframeSrcFn(r))if(!n.contentDocument)t.attributeName="rr_src";else return;if(o||(o={node:t.target,attributes:{}},this.attributes.push(o)),t.attributeName==="style"){const i=this.doc.createElement("span");t.oldValue&&i.setAttribute("style",t.oldValue),(o.attributes.style===void 0||o.attributes.style===null)&&(o.attributes.style={});const a=o.attributes.style;for(const l of Array.from(n.style)){const c=n.style.getPropertyValue(l),s=n.style.getPropertyPriority(l);(c!==i.style.getPropertyValue(l)||s!==i.style.getPropertyPriority(l))&&(s===""?a[l]=c:a[l]=[c,s])}for(const l of Array.from(i.style))n.style.getPropertyValue(l)===""&&(a[l]=!1)}else{if(t.target.tagName==="INPUT"){const i=t.target;if(i.type==="password"){o.attributes.value="*".repeat(i.value.length);break}}o.attributes[t.attributeName]=kt(this.doc,n.tagName,t.attributeName,r)}break}case"childList":{if(ne(t.target,this.blockClass,!0))return;t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{const r=this.mirror.getId(n),o=De(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);ne(t.target,this.blockClass,!1)||Be(n,this.mirror)||!$t(n,this.mirror)||(this.addedSet.has(n)?(dt(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||ot(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[jt(r,o)]?dt(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:De(t.target)&&Re(t.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(t,n)=>{if(this.mirror.hasNode(t)){if(Be(t,this.mirror))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[jt(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);ne(t,this.blockClass,!1)||t.childNodes.forEach(r=>this.genAdds(r))}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","enableStrictPrivacy"].forEach(n=>{this[n]=t[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function dt(e,t){e.delete(t),t.childNodes.forEach(n=>dt(e,n))}function Bt(e,t,n){return e.length===0?!1:zt(e,t,n)}function zt(e,t,n){const{parentNode:r}=t;if(!r)return!1;const o=n.getId(r);return e.some(i=>i.id===o)?!0:zt(e,r,n)}function Yt(e,t){return e.size===0?!1:Ht(e,t)}function Ht(e,t){const{parentNode:n}=t;return n?e.has(n)?!0:Ht(e,n):!1}var Ar=Object.defineProperty,Pr=Object.defineProperties,Fr=Object.getOwnPropertyDescriptors,Xt=Object.getOwnPropertySymbols,_r=Object.prototype.hasOwnProperty,Wr=Object.prototype.propertyIsEnumerable,Zt=(e,t,n)=>t in e?Ar(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kt=(e,t)=>{for(var n in t||(t={}))_r.call(t,n)&&Zt(e,n,t[n]);if(Xt)for(var n of Xt(t))Wr.call(t,n)&&Zt(e,n,t[n]);return e},$r=(e,t)=>Pr(e,Fr(t));const ve=[],Qt=typeof CSSGroupingRule<"u",qt=typeof CSSMediaRule<"u",Jt=typeof CSSSupportsRule<"u",en=typeof CSSConditionRule<"u";function Pe(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch{return e.target}}function tn(e,t){var n,r;const o=new Lr;ve.push(o),o.init(e);let i=window.MutationObserver||window.__rrMutationObserver;const a=(r=(n=window?.Zone)==null?void 0:n.__symbol__)==null?void 0:r.call(n,"MutationObserver");a&&window[a]&&(i=window[a]);const l=new i(o.processMutations.bind(o));return l.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),l}function Vr({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let a=[],l;const c=Te(d=>{const h=Date.now()-l;e(a.map(m=>(m.timeOffset-=h,m)),d),a=[],l=null},i),s=Te(d=>{const h=Pe(d),{clientX:m,clientY:p}=it(d)?d.changedTouches[0]:d;l||(l=Date.now()),a.push({x:m,y:p,id:r.getId(h),timeOffset:Date.now()-l}),c(typeof DragEvent<"u"&&d instanceof DragEvent?x.Drag:d instanceof MouseEvent?x.MouseMove:x.TouchMove)},o,{trailing:!1}),u=[te("mousemove",s,n),te("touchmove",s,n),te("drag",s,n)];return()=>{u.forEach(d=>d())}}function Ur({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const i=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[],l=c=>s=>{const u=Pe(s);if(ne(u,r,!0)||Wt(u))return;const d=it(s)?s.changedTouches[0]:s;if(!d)return;const h=n.getId(u),{clientX:m,clientY:p}=d;e({type:X[c],id:h,x:m,y:p})};return Object.keys(X).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&i[c]!==!1).forEach(c=>{const s=c.toLowerCase(),u=l(c);a.push(te(s,u,t))}),()=>{a.forEach(c=>c())}}function nn({scrollCb:e,doc:t,mirror:n,blockClass:r,sampling:o}){const i=Te(a=>{const l=Pe(a);if(!l||ne(l,r,!0))return;const c=n.getId(l);if(l===t){const s=t.scrollingElement||t.documentElement;e({id:c,x:s.scrollLeft,y:s.scrollTop})}else e({id:c,x:l.scrollLeft,y:l.scrollTop})},o.scroll||100);return te("scroll",i,t)}function Gr({viewportResizeCb:e}){let t=-1,n=-1;const r=Te(()=>{const o=nt(),i=rt();(t!==o||n!==i)&&(e({width:Number(i),height:Number(o)}),t=o,n=i)},200);return te("resize",r,window)}function rn(e,t){const n=Kt({},e);return t||delete n.userTriggered,n}const jr=["INPUT","TEXTAREA","SELECT"],on=new WeakMap;function Br({inputCb:e,doc:t,mirror:n,blockClass:r,ignoreClass:o,maskInputOptions:i,maskInputFn:a,sampling:l,userTriggeredOnInput:c}){function s(p){let v=Pe(p);const N=p.isTrusted;if(v&&v.tagName==="OPTION"&&(v=v.parentElement),!v||!v.tagName||jr.indexOf(v.tagName)<0||ne(v,r,!0))return;const f=v.type;if(v.classList.contains(o))return;let b=v.value,S=!1;f==="radio"||f==="checkbox"?S=v.checked:(i[v.tagName.toLowerCase()]||i[f])&&(b=qe({maskInputOptions:i,tagName:v.tagName,type:f,value:b,maskInputFn:a})),u(v,rn({text:b,isChecked:S,userTriggered:N},c));const y=v.name;f==="radio"&&y&&S&&t.querySelectorAll(`input[type="radio"][name="${y}"]`).forEach(M=>{M!==v&&u(M,rn({text:M.value,isChecked:!S,userTriggered:!1},c))})}function u(p,v){const N=on.get(p);if(!N||N.text!==v.text||N.isChecked!==v.isChecked){on.set(p,v);const f=n.getId(p);e($r(Kt({},v),{id:f}))}}const d=(l.input==="last"?["change"]:["input","change"]).map(p=>te(p,s,t)),h=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),m=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return h&&h.set&&d.push(...m.map(p=>Le(p[0],p[1],{set(){s({target:this})}}))),()=>{d.forEach(p=>p())}}function ze(e){const t=[];function n(r,o){if(Qt&&r.parentRule instanceof CSSGroupingRule||qt&&r.parentRule instanceof CSSMediaRule||Jt&&r.parentRule instanceof CSSSupportsRule||en&&r.parentRule instanceof CSSConditionRule){const i=Array.from(r.parentRule.cssRules).indexOf(r);o.unshift(i)}else{const i=Array.from(r.parentStyleSheet.cssRules).indexOf(r);o.unshift(i)}return o}return n(e,t)}function zr({styleSheetRuleCb:e,mirror:t},{win:n}){const r=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=function(l,c){const s=t.getId(this.ownerNode);return s!==-1&&e({id:s,adds:[{rule:l,index:c}]}),r.apply(this,[l,c])};const o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=function(l){const c=t.getId(this.ownerNode);return c!==-1&&e({id:c,removes:[{index:l}]}),o.apply(this,[l])};const i={};Qt?i.CSSGroupingRule=n.CSSGroupingRule:(qt&&(i.CSSMediaRule=n.CSSMediaRule),en&&(i.CSSConditionRule=n.CSSConditionRule),Jt&&(i.CSSSupportsRule=n.CSSSupportsRule));const a={};return Object.entries(i).forEach(([l,c])=>{a[l]={insertRule:c.prototype.insertRule,deleteRule:c.prototype.deleteRule},c.prototype.insertRule=function(s,u){const d=t.getId(this.parentStyleSheet.ownerNode);return d!==-1&&e({id:d,adds:[{rule:s,index:[...ze(this),u||0]}]}),a[l].insertRule.apply(this,[s,u])},c.prototype.deleteRule=function(s){const u=t.getId(this.parentStyleSheet.ownerNode);return u!==-1&&e({id:u,removes:[{index:[...ze(this),s]}]}),a[l].deleteRule.apply(this,[s])}}),()=>{n.CSSStyleSheet.prototype.insertRule=r,n.CSSStyleSheet.prototype.deleteRule=o,Object.entries(i).forEach(([l,c])=>{c.prototype.insertRule=a[l].insertRule,c.prototype.deleteRule=a[l].deleteRule})}}function Yr({styleDeclarationCb:e,mirror:t},{win:n}){const r=n.CSSStyleDeclaration.prototype.setProperty;n.CSSStyleDeclaration.prototype.setProperty=function(i,a,l){var c,s;const u=t.getId((s=(c=this.parentRule)==null?void 0:c.parentStyleSheet)==null?void 0:s.ownerNode);return u!==-1&&e({id:u,set:{property:i,value:a,priority:l},index:ze(this.parentRule)}),r.apply(this,[i,a,l])};const o=n.CSSStyleDeclaration.prototype.removeProperty;return n.CSSStyleDeclaration.prototype.removeProperty=function(i){var a,l;const c=t.getId((l=(a=this.parentRule)==null?void 0:a.parentStyleSheet)==null?void 0:l.ownerNode);return c!==-1&&e({id:c,remove:{property:i},index:ze(this.parentRule)}),o.apply(this,[i])},()=>{n.CSSStyleDeclaration.prototype.setProperty=r,n.CSSStyleDeclaration.prototype.removeProperty=o}}function Hr({mediaInteractionCb:e,blockClass:t,mirror:n,sampling:r}){const o=a=>Te(l=>{const c=Pe(l);if(!c||ne(c,t,!0))return;const{currentTime:s,volume:u,muted:d}=c;e({type:a,id:n.getId(c),currentTime:s,volume:u,muted:d})},r.media||500),i=[te("play",o(fe.Play)),te("pause",o(fe.Pause)),te("seeked",o(fe.Seeked)),te("volumechange",o(fe.VolumeChange))];return()=>{i.forEach(a=>a())}}function Xr({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,i=n.FontFace;n.FontFace=function(l,c,s){const u=new i(l,c,s);return o.set(u,{family:l,buffer:typeof c!="string",descriptors:s,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),u};const a=pe(t.fonts,"add",function(l){return function(c){return setTimeout(()=>{const s=o.get(c);s&&(e(s),o.delete(c))},0),l.apply(this,[c])}});return r.push(()=>{n.FontFace=i}),r.push(a),()=>{r.forEach(l=>l())}}function Zr(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:a,inputCb:l,mediaInteractionCb:c,styleSheetRuleCb:s,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h}=e;e.mutationCb=(...m)=>{t.mutation&&t.mutation(...m),n(...m)},e.mousemoveCb=(...m)=>{t.mousemove&&t.mousemove(...m),r(...m)},e.mouseInteractionCb=(...m)=>{t.mouseInteraction&&t.mouseInteraction(...m),o(...m)},e.scrollCb=(...m)=>{t.scroll&&t.scroll(...m),i(...m)},e.viewportResizeCb=(...m)=>{t.viewportResize&&t.viewportResize(...m),a(...m)},e.inputCb=(...m)=>{t.input&&t.input(...m),l(...m)},e.mediaInteractionCb=(...m)=>{t.mediaInteaction&&t.mediaInteaction(...m),c(...m)},e.styleSheetRuleCb=(...m)=>{t.styleSheetRule&&t.styleSheetRule(...m),s(...m)},e.styleDeclarationCb=(...m)=>{t.styleDeclaration&&t.styleDeclaration(...m),u(...m)},e.canvasMutationCb=(...m)=>{t.canvasMutation&&t.canvasMutation(...m),d(...m)},e.fontCb=(...m)=>{t.font&&t.font(...m),h(...m)}}function Kr(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};Zr(e,t);const r=tn(e,e.doc),o=Vr(e),i=Ur(e),a=nn(e),l=Gr(e),c=Br(e),s=Hr(e),u=zr(e,{win:n}),d=Yr(e,{win:n}),h=e.collectFonts?Xr(e):()=>{},m=[];for(const p of e.plugins)m.push(p.observer(p.callback,n,p.options));return()=>{ve.forEach(p=>p.reset()),r.disconnect(),o(),i(),a(),l(),c(),s(),u(),d(),h(),m.forEach(p=>p())}}class Qr{constructor(t){this.iframes=new WeakMap,this.mutationCb=t.mutationCb}addIframe(t){this.iframes.set(t,!0)}addLoadListener(t){this.loadListener=t}attachIframe(t,n,r){var o;this.mutationCb({adds:[{parentId:r.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(o=this.loadListener)==null||o.call(this,t)}}var qr=Object.defineProperty,Jr=Object.defineProperties,eo=Object.getOwnPropertyDescriptors,sn=Object.getOwnPropertySymbols,to=Object.prototype.hasOwnProperty,no=Object.prototype.propertyIsEnumerable,an=(e,t,n)=>t in e?qr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ln=(e,t)=>{for(var n in t||(t={}))to.call(t,n)&&an(e,n,t[n]);if(sn)for(var n of sn(t))no.call(t,n)&&an(e,n,t[n]);return e},cn=(e,t)=>Jr(e,eo(t));class ro{constructor(t){this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;const n=this;this.restorePatches.push(pe(HTMLElement.prototype,"attachShadow",function(r){return function(o){const i=r.call(this,o);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,this.ownerDocument),i}}))}addShadowRoot(t,n){!Re(t)||(tn(cn(ln({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),nn(cn(ln({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror})))}observeAttachShadow(t){if(t.contentWindow){const n=this;this.restorePatches.push(pe(t.contentWindow.HTMLElement.prototype,"attachShadow",function(r){return function(o){const i=r.call(this,o);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,t.contentDocument),i}}))}}reset(){this.restorePatches.forEach(t=>t())}}for(var we="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Fe=typeof Uint8Array>"u"?[]:new Uint8Array(256),Ye=0;Ye<we.length;Ye++)Fe[we.charCodeAt(Ye)]=Ye;var oo=function(e){var t=new Uint8Array(e),n,r=t.length,o="";for(n=0;n<r;n+=3)o+=we[t[n]>>2],o+=we[(t[n]&3)<<4|t[n+1]>>4],o+=we[(t[n+1]&15)<<2|t[n+2]>>6],o+=we[t[n+2]&63];return r%3===2?o=o.substring(0,o.length-1)+"=":r%3===1&&(o=o.substring(0,o.length-2)+"=="),o},io=function(e){var t=e.length*.75,n=e.length,r,o=0,i,a,l,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var s=new ArrayBuffer(t),u=new Uint8Array(s);for(r=0;r<n;r+=4)i=Fe[e.charCodeAt(r)],a=Fe[e.charCodeAt(r+1)],l=Fe[e.charCodeAt(r+2)],c=Fe[e.charCodeAt(r+3)],u[o++]=i<<2|a>>4,u[o++]=(a&15)<<4|l>>2,u[o++]=(l&3)<<6|c&63;return s};const un=new Map;function so(e,t){let n=un.get(e);return n||(n=new Map,un.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}const dn=(e,t,n)=>{if(!e||!(mn(e,t)||typeof e=="object"))return;const r=e.constructor.name,o=so(n,r);let i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};function He(e,t,n){if(e instanceof Array)return e.map(r=>He(r,t,n));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){const r=e.constructor.name,o=oo(e);return{rr_type:r,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[He(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const r=e.constructor.name,{src:o}=e;return{rr_type:r,src:o}}else if(e instanceof HTMLCanvasElement){const r="HTMLImageElement",o=e.toDataURL();return{rr_type:r,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[He(e.data,t,n),e.width,e.height]};if(mn(e,t)||typeof e=="object"){const r=e.constructor.name,o=dn(e,t,n);return{rr_type:r,index:o}}}}return e}const hn=(e,t,n)=>[...e].map(r=>He(r,t,n)),mn=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(r=>typeof t[r]=="function");return Boolean(n.find(r=>e instanceof t[r]))};function ao(e,t,n,r){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of i)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;const l=pe(t.CanvasRenderingContext2D.prototype,a,function(c){return function(...s){return ne(this.canvas,n,!0)||setTimeout(()=>{const u=hn([...s],t,this);e(this.canvas,{type:ue["2D"],property:a,args:u})},0),c.apply(this,s)}});o.push(l)}catch{const c=Le(t.CanvasRenderingContext2D.prototype,a,{set(s){e(this.canvas,{type:ue["2D"],property:a,args:[s],setter:!0})}});o.push(c)}return()=>{o.forEach(a=>a())}}function pn(e,t){const n=[];try{const r=pe(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(i,...a){return ne(this,t,!0)||"__context"in this||(this.__context=i),o.apply(this,[i,...a])}});n.push(r)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(r=>r())}}function fn(e,t,n,r,o,i){const a=[],l=Object.getOwnPropertyNames(e);for(const c of l)try{if(typeof e[c]!="function")continue;const s=pe(e,c,function(u){return function(...d){const h=u.apply(this,d);if(dn(h,i,e),!ne(this.canvas,r,!0)){const m=hn([...d],i,e),p={type:t,property:c,args:m};n(this.canvas,p)}return h}});a.push(s)}catch{const u=Le(e,c,{set(d){n(this.canvas,{type:t,property:c,args:[d],setter:!0})}});a.push(u)}return a}function lo(e,t,n,r){const o=[];return o.push(...fn(t.WebGLRenderingContext.prototype,ue.WebGL,e,n,r,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...fn(t.WebGL2RenderingContext.prototype,ue.WebGL2,e,n,r,t)),()=>{o.forEach(i=>i())}}function co(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,i=n.length;o<i;++o)r[o]=n.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}function uo(e,t,n){var r=t===void 0?null:t,o=n===void 0?!1:n,i=co(e,o),a=i.indexOf(`
5
- `,10)+1,l=i.substring(a)+(r?"//# sourceMappingURL="+r:""),c=new Blob([l],{type:"application/javascript"});return URL.createObjectURL(c)}function ho(e,t,n){var r;return function(i){return r=r||uo(e,t,n),new Worker(r,i)}}var mo=ho("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Zm9yKHZhciByPSJBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OSsvIixsPXR5cGVvZiBVaW50OEFycmF5PiJ1Ij9bXTpuZXcgVWludDhBcnJheSgyNTYpLGY9MDtmPHIubGVuZ3RoO2YrKylsW3IuY2hhckNvZGVBdChmKV09Zjt2YXIgZD1mdW5jdGlvbihzKXt2YXIgZT1uZXcgVWludDhBcnJheShzKSxuLGE9ZS5sZW5ndGgsdD0iIjtmb3Iobj0wO248YTtuKz0zKXQrPXJbZVtuXT4+Ml0sdCs9clsoZVtuXSYzKTw8NHxlW24rMV0+PjRdLHQrPXJbKGVbbisxXSYxNSk8PDJ8ZVtuKzJdPj42XSx0Kz1yW2VbbisyXSY2M107cmV0dXJuIGElMz09PTI/dD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTEpKyI9IjphJTM9PT0xJiYodD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTIpKyI9PSIpLHR9O2NvbnN0IGM9bmV3IE1hcCx1PW5ldyBNYXA7YXN5bmMgZnVuY3Rpb24gcChzLGUpe2NvbnN0IG49YCR7c30tJHtlfWA7aWYodS5oYXMobikpcmV0dXJuIHUuZ2V0KG4pO2NvbnN0IGE9bmV3IE9mZnNjcmVlbkNhbnZhcyhzLGUpO2EuZ2V0Q29udGV4dCgiMmQiKTtjb25zdCB0PWF3YWl0KGF3YWl0IGEuY29udmVydFRvQmxvYigpKS5hcnJheUJ1ZmZlcigpLGc9ZCh0KTtyZXR1cm4gdS5zZXQobixnKSxnfWNvbnN0IGk9c2VsZjtpLm9ubWVzc2FnZT1hc3luYyBmdW5jdGlvbihzKXtpZighKCJPZmZzY3JlZW5DYW52YXMiaW4gZ2xvYmFsVGhpcykpcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOnMuZGF0YS5pZH0pO2NvbnN0e2lkOmUsYml0bWFwOm4sd2lkdGg6YSxoZWlnaHQ6dH09cy5kYXRhLGc9cChhLHQpLGg9bmV3IE9mZnNjcmVlbkNhbnZhcyhhLHQpO2guZ2V0Q29udGV4dCgiMmQiKS5kcmF3SW1hZ2UobiwwLDApLG4uY2xvc2UoKTtjb25zdCB3PWF3YWl0IGguY29udmVydFRvQmxvYigpLHk9dy50eXBlLGI9YXdhaXQgdy5hcnJheUJ1ZmZlcigpLG89ZChiKTtpZighYy5oYXMoZSkmJmF3YWl0IGc9PT1vKXJldHVybiBjLnNldChlLG8pLGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpZihjLmdldChlKT09PW8pcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpLnBvc3RNZXNzYWdlKHtpZDplLHR5cGU6eSxiYXNlNjQ6byx3aWR0aDphLGhlaWdodDp0fSksYy5zZXQoZSxvKX19KSgpOwoK",null,!1),vn=Object.getOwnPropertySymbols,po=Object.prototype.hasOwnProperty,fo=Object.prototype.propertyIsEnumerable,vo=(e,t)=>{var n={};for(var r in e)po.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&vn)for(var r of vn(e))t.indexOf(r)<0&&fo.call(e,r)&&(n[r]=e[r]);return n},go=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{l(n.next(c))}catch(s){o(s)}},a=c=>{try{l(n.throw(c))}catch(s){o(s)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,a);l((n=n.apply(e,t)).next())});class yo{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(a,l)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(l)};const{sampling:n="all",win:r,blockClass:o,recordCanvas:i}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,i&&n==="all"&&this.initCanvasMutationObserver(r,o),i&&typeof n=="number"&&this.initCanvasFPSObserver(n,r,o)}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,n,r){const o=pn(n,r),i=new Map,a=new mo;a.onmessage=d=>{const{id:h}=d.data;if(i.set(h,!1),!("base64"in d.data))return;const{base64:m,type:p,width:v,height:N}=d.data;this.mutationCb({id:h,type:ue["2D"],commands:[{property:"clearRect",args:[0,0,v,N]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:m}],type:p}]},0,0]}]})};const l=1e3/t;let c=0,s;const u=d=>{if(c&&d-c<l){s=requestAnimationFrame(u);return}c=d,n.document.querySelectorAll(`canvas:not(.${r} *)`).forEach(h=>go(this,null,function*(){var m;const p=this.mirror.getId(h);if(i.get(p))return;if(i.set(p,!0),["webgl","webgl2"].includes(h.__context)){const N=h.getContext(h.__context);((m=N?.getContextAttributes())==null?void 0:m.preserveDrawingBuffer)===!1&&N?.clear(N.COLOR_BUFFER_BIT)}if(h.width===0||h.height===0)return;const v=yield createImageBitmap(h);a.postMessage({id:p,bitmap:v,width:h.width,height:h.height},[v])})),s=requestAnimationFrame(u)};s=requestAnimationFrame(u),this.resetObservers=()=>{o(),cancelAnimationFrame(s)}}initCanvasMutationObserver(t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=pn(t,n),o=ao(this.processMutation.bind(this),t,n,this.mirror),i=lo(this.processMutation.bind(this),t,n,this.mirror);this.resetObservers=()=>{r(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=n=>{this.rafStamps.latestId=n,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,n)=>{const r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,n){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(t);if(!r||n===-1)return;const o=r.map(a=>vo(a,["type"])),{type:i}=r[0];this.mutationCb({id:n,type:i,commands:o}),this.pendingCanvasMutations.delete(t)}}class bo{constructor(t){this.trackedStylesheets=new WeakSet,this.mutationCb=t.mutationCb}addStylesheet(t){this.trackedStylesheets.has(t)||(this.trackedStylesheets.add(t),this.trackStylesheet(t))}trackStylesheet(t){}attachStylesheet(t,n,r){this.mutationCb({adds:[{parentId:r.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[]}),this.addStylesheet(t)}}var So=Object.defineProperty,To=Object.defineProperties,No=Object.getOwnPropertyDescriptors,gn=Object.getOwnPropertySymbols,Eo=Object.prototype.hasOwnProperty,wo=Object.prototype.propertyIsEnumerable,yn=(e,t,n)=>t in e?So(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,re=(e,t)=>{for(var n in t||(t={}))Eo.call(t,n)&&yn(e,n,t[n]);if(gn)for(var n of gn(t))wo.call(t,n)&&yn(e,n,t[n]);return e},Co=(e,t)=>To(e,No(t));function K(e){return Co(re({},e),{timestamp:Date.now()})}let z,_e;const se=Ct();function ge(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="highlight-block",blockSelector:i=null,ignoreClass:a="highlight-ignore",maskTextClass:l="highlight-mask",maskTextSelector:c=null,inlineStylesheet:s=!0,maskAllInputs:u,maskInputOptions:d,slimDOMOptions:h,maskInputFn:m,maskTextFn:p,hooks:v,packFn:N,sampling:f={},mousemoveWait:b,recordCanvas:S=!1,userTriggeredOnInput:y=!1,collectFonts:M=!1,inlineImages:R=!1,plugins:A,keepIframeSrcFn:P=()=>!1,enableStrictPrivacy:L=!1}=e;if(!t)throw new Error("emit function is required");b!==void 0&&f.mousemove===void 0&&(f.mousemove=b),se.reset();const B=u===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:d!==void 0?d:{password:!0},$=h===!0||h==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:h==="all",headMetaDescKeywords:h==="all"}:h||{};st();let Q,Y=0;const j=E=>{for(const w of A||[])w.eventProcessor&&(E=w.eventProcessor(E));return N&&(E=N(E)),E};z=(E,w)=>{var q;if(((q=ve[0])==null?void 0:q.isFrozen())&&E.type!==C.FullSnapshot&&!(E.type===C.IncrementalSnapshot&&E.data.source===x.Mutation)&&ve.forEach(ee=>ee.unfreeze()),t(j(E),w),E.type===C.FullSnapshot)Q=E,Y=0;else if(E.type===C.IncrementalSnapshot){if(E.data.source===x.Mutation&&E.data.isAttachIframe)return;Y++;const ee=r&&Y>=r,le=n&&E.timestamp-Q.timestamp>n;(ee||le)&&_e(!0)}};const H=E=>{z(K({type:C.IncrementalSnapshot,data:re({source:x.Mutation},E)}))},Z=E=>z(K({type:C.IncrementalSnapshot,data:re({source:x.Scroll},E)})),F=E=>z(K({type:C.IncrementalSnapshot,data:re({source:x.CanvasMutation},E)})),G=new Qr({mutationCb:H}),T=new bo({mutationCb:H}),g=new yo({recordCanvas:S,mutationCb:F,win:window,blockClass:o,mirror:se,sampling:f.canvas}),I=new ro({mutationCb:H,scrollCb:Z,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:s,maskInputOptions:B,maskTextFn:p,maskInputFn:m,recordCanvas:S,inlineImages:R,sampling:f,slimDOMOptions:$,iframeManager:G,stylesheetManager:T,canvasManager:g,keepIframeSrcFn:P,enableStrictPrivacy:L},mirror:se});_e=(E=!1)=>{var w,q,ee,le;z(K({type:C.Meta,data:{href:window.location.href,width:rt(),height:nt()}}),E),ve.forEach(V=>V.lock());const _=Nr(document,{mirror:se,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:s,maskAllInputs:B,maskTextFn:p,slimDOM:$,recordCanvas:S,inlineImages:R,enableStrictPrivacy:L,onSerialize:V=>{Ne(V,se)&&G.addIframe(V),lt(V,se)&&T.addStylesheet(V),Ae(V)&&I.addShadowRoot(V.shadowRoot,document)},onIframeLoad:(V,xe)=>{G.attachIframe(V,xe,se),I.observeAttachShadow(V)},onStylesheetLoad:(V,xe)=>{T.attachStylesheet(V,xe,se)},keepIframeSrcFn:P});if(!_)return console.warn("Failed to snapshot the document");z(K({type:C.FullSnapshot,data:{node:_,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((q=(w=document?.body)==null?void 0:w.parentElement)==null?void 0:q.scrollLeft)||document?.body.scrollLeft||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((le=(ee=document?.body)==null?void 0:ee.parentElement)==null?void 0:le.scrollTop)||document?.body.scrollTop||0}}})),ve.forEach(V=>V.unlock())};try{const E=[];E.push(te("DOMContentLoaded",()=>{z(K({type:C.DomContentLoaded,data:{}}))}));const w=ee=>{var le;return Kr({mutationCb:H,mousemoveCb:(_,V)=>z(K({type:C.IncrementalSnapshot,data:{source:V,positions:_}})),mouseInteractionCb:_=>z(K({type:C.IncrementalSnapshot,data:re({source:x.MouseInteraction},_)})),scrollCb:Z,viewportResizeCb:_=>z(K({type:C.IncrementalSnapshot,data:re({source:x.ViewportResize},_)})),inputCb:_=>z(K({type:C.IncrementalSnapshot,data:re({source:x.Input},_)})),mediaInteractionCb:_=>z(K({type:C.IncrementalSnapshot,data:re({source:x.MediaInteraction},_)})),styleSheetRuleCb:_=>z(K({type:C.IncrementalSnapshot,data:re({source:x.StyleSheetRule},_)})),styleDeclarationCb:_=>z(K({type:C.IncrementalSnapshot,data:re({source:x.StyleDeclaration},_)})),canvasMutationCb:F,fontCb:_=>z(K({type:C.IncrementalSnapshot,data:re({source:x.Font},_)})),blockClass:o,ignoreClass:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:B,inlineStylesheet:s,sampling:f,recordCanvas:S,inlineImages:R,userTriggeredOnInput:y,collectFonts:M,doc:ee,maskInputFn:m,maskTextFn:p,keepIframeSrcFn:P,blockSelector:i,slimDOMOptions:$,mirror:se,iframeManager:G,stylesheetManager:T,shadowDomManager:I,canvasManager:g,enableStrictPrivacy:L,plugins:((le=A?.filter(_=>_.observer))==null?void 0:le.map(_=>({observer:_.observer,options:_.options,callback:V=>z(K({type:C.Plugin,data:{plugin:_.name,payload:V}}))})))||[]},v)};G.addLoadListener(ee=>{E.push(w(ee.contentDocument))});const q=()=>{_e(),E.push(w(document))};return document.readyState==="interactive"||document.readyState==="complete"?q():E.push(te("load",()=>{z(K({type:C.Load,data:{}})),q()},window)),()=>{E.forEach(ee=>ee())}}catch(E){console.warn(E)}}ge.addCustomEvent=(e,t)=>{!z||z(K({type:C.Custom,data:{tag:e,payload:t}}))},ge.freezePage=()=>{ve.forEach(e=>e.freeze())},ge.takeFullSnapshot=e=>{if(!_e)throw new Error("please take full snapshot after start recording");_e(e)},ge.mirror=se;var D;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(D||(D={}));var Io=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var n;if(!t)return-1;var r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var n=this,r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(function(o){return n.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,n){var r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)},e.prototype.replace=function(t,n){this.idNodeMap.set(t,n)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function Mo(){return new Io}function xo(e){const t={},n=/;(?![^(]*\))/g,r=/:(.+)/,o=/\/\*.*?\*\//g;return e.replace(o,"").split(n).forEach(function(i){if(i){const a=i.split(r);a.length>1&&(t[ht(a[0].trim())]=a[1].trim())}}),t}function bn(e){const t=[];for(const n in e){const r=e[n];if(typeof r!="string")continue;const o=Oo(n);t.push(`${o}: ${r};`)}return t.join(" ")}const ko=/-([a-z])/g,Do=/^--[a-zA-Z0-9-]+$/,ht=e=>Do.test(e)?e:e.replace(ko,(t,n)=>n?n.toUpperCase():""),Ro=/\B([A-Z])/g,Oo=e=>e.replace(Ro,"-$1").toLowerCase();class oe{constructor(...t){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=U.ELEMENT_NODE,this.TEXT_NODE=U.TEXT_NODE}get firstChild(){return this.childNodes[0]||null}get lastChild(){return this.childNodes[this.childNodes.length-1]||null}get nextSibling(){const t=this.parentNode;if(!t)return null;const n=t.childNodes,r=n.indexOf(this);return n[r+1]||null}contains(t){if(t===this)return!0;for(const n of this.childNodes)if(n.contains(t))return!0;return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,n){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function Lo(e){return class qn extends e{constructor(){super(...arguments),this.nodeType=U.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=D.Document,this.textContent=null}get documentElement(){return this.childNodes.find(n=>n.RRNodeType===D.Element&&n.tagName==="HTML")||null}get body(){var n;return((n=this.documentElement)===null||n===void 0?void 0:n.childNodes.find(r=>r.RRNodeType===D.Element&&r.tagName==="BODY"))||null}get head(){var n;return((n=this.documentElement)===null||n===void 0?void 0:n.childNodes.find(r=>r.RRNodeType===D.Element&&r.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(n){const r=n.RRNodeType;if((r===D.Element||r===D.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${r===D.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);return n.parentElement=null,n.parentNode=this,this.childNodes.push(n),n}insertBefore(n,r){const o=n.RRNodeType;if((o===D.Element||o===D.DocumentType)&&this.childNodes.some(a=>a.RRNodeType===o))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${o===D.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);if(r===null)return this.appendChild(n);const i=this.childNodes.indexOf(r);if(i==-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(i,0,n),n.parentElement=null,n.parentNode=this,n}removeChild(n){const r=this.childNodes.indexOf(n);if(r===-1)throw new Error("Failed to execute 'removeChild' on 'RRDocument': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(r,1),n.parentElement=null,n.parentNode=null,n}open(){this.childNodes=[]}close(){}write(n){let r;if(n==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?r="-//W3C//DTD XHTML 1.0 Transitional//EN":n==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(r="-//W3C//DTD HTML 4.0 Transitional//EN"),r){const o=this.createDocumentType("html",r,"");this.open(),this.appendChild(o)}}createDocument(n,r,o){return new qn}createDocumentType(n,r,o){const i=new(Sn(oe))(n,r,o);return i.ownerDocument=this,i}createElement(n){const r=new(Tn(oe))(n);return r.ownerDocument=this,r}createElementNS(n,r){return this.createElement(r)}createTextNode(n){const r=new(Nn(oe))(n);return r.ownerDocument=this,r}createComment(n){const r=new(En(oe))(n);return r.ownerDocument=this,r}createCDATASection(n){const r=new(wn(oe))(n);return r.ownerDocument=this,r}toString(){return"RRDocument"}}}function Sn(e){return class extends e{constructor(t,n,r){super(),this.nodeType=U.DOCUMENT_TYPE_NODE,this.RRNodeType=D.DocumentType,this.textContent=null,this.name=t,this.publicId=n,this.systemId=r,this.nodeName=t}toString(){return"RRDocumentType"}}}function Tn(e){return class extends e{constructor(t){super(),this.nodeType=U.ELEMENT_NODE,this.RRNodeType=D.Element,this.attributes={},this.shadowRoot=null,this.tagName=t.toUpperCase(),this.nodeName=t.toUpperCase()}get textContent(){let t="";return this.childNodes.forEach(n=>t+=n.textContent),t}set textContent(t){this.childNodes=[this.ownerDocument.createTextNode(t)]}get classList(){return new Po(this.attributes.class,t=>{this.attributes.class=t})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const t=this.attributes.style?xo(this.attributes.style):{},n=/\B([A-Z])/g;return t.setProperty=(r,o,i)=>{if(n.test(r))return;const a=ht(r);o?t[a]=o:delete t[a],i==="important"&&(t[a]+=" !important"),this.attributes.style=bn(t)},t.removeProperty=r=>{if(n.test(r))return"";const o=ht(r),i=t[o]||"";return delete t[o],this.attributes.style=bn(t),i},t}getAttribute(t){return this.attributes[t]||null}setAttribute(t,n){this.attributes[t]=n}setAttributeNS(t,n,r){this.setAttribute(n,r)}removeAttribute(t){delete this.attributes[t]}appendChild(t){return this.childNodes.push(t),t.parentNode=this,t.parentElement=this,t}insertBefore(t,n){if(n===null)return this.appendChild(t);const r=this.childNodes.indexOf(n);if(r==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(r,0,t),t.parentElement=this,t.parentNode=this,t}removeChild(t){const n=this.childNodes.indexOf(t);if(n===-1)throw new Error("Failed to execute 'removeChild' on 'RRElement': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(n,1),t.parentElement=null,t.parentNode=null,t}attachShadow(t){const n=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=n,n}dispatchEvent(t){return!0}toString(){let t="";for(const n in this.attributes)t+=`${n}="${this.attributes[n]}" `;return`${this.tagName} ${t}`}}}function Ao(e){return class extends e{attachShadow(t){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}}function Nn(e){return class extends e{constructor(t){super(),this.nodeType=U.TEXT_NODE,this.nodeName="#text",this.RRNodeType=D.Text,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function En(e){return class extends e{constructor(t){super(),this.nodeType=U.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=D.Comment,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function wn(e){return class extends e{constructor(t){super(),this.nodeName="#cdata-section",this.nodeType=U.CDATA_SECTION_NODE,this.RRNodeType=D.CDATA,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class Po{constructor(t,n){if(this.classes=[],this.add=(...r)=>{for(const o of r){const i=String(o);this.classes.indexOf(i)>=0||this.classes.push(i)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...r)=>{this.classes=this.classes.filter(o=>r.indexOf(o)===-1),this.onChange&&this.onChange(this.classes.join(" "))},t){const r=t.trim().split(/\s+/);this.classes.push(...r)}this.onChange=n}}var U;(function(e){e[e.PLACEHOLDER=0]="PLACEHOLDER",e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"})(U||(U={}));const mt={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},Fo={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 ae(e,t,n,r){const o=e.childNodes,i=t.childNodes;r=r||t.mirror||t.ownerDocument.mirror,(o.length>0||i.length>0)&&Cn(Array.from(o),i,e,n,r);let a=null,l=null;switch(t.RRNodeType){case D.Document:{l=t.scrollData;break}case D.Element:{const c=e,s=t;switch(_o(c,s,r),l=s.scrollData,a=s.inputData,s.tagName){case"AUDIO":case"VIDEO":{const u=e,d=s;d.paused!==void 0&&(d.paused?u.pause():u.play()),d.muted!==void 0&&(u.muted=d.muted),d.volume!==void 0&&(u.volume=d.volume),d.currentTime!==void 0&&(u.currentTime=d.currentTime);break}case"CANVAS":{const u=t;if(u.rr_dataURL!==null){const d=document.createElement("img");d.onload=()=>{const h=c.getContext("2d");h&&h.drawImage(d,0,0,d.width,d.height)},d.src=u.rr_dataURL}u.canvasMutations.forEach(d=>n.applyCanvas(d.event,d.mutation,e))}break;case"STYLE":Wo(c,t.rules);break}if(s.shadowRoot){c.shadowRoot||c.attachShadow({mode:"open"});const u=c.shadowRoot.childNodes,d=s.shadowRoot.childNodes;(u.length>0||d.length>0)&&Cn(Array.from(u),d,c.shadowRoot,n,r)}break}case D.Text:case D.Comment:case D.CDATA:e.textContent!==t.data&&(e.textContent=t.data);break}if(l&&n.applyScroll(l,!0),a&&n.applyInput(a),t.nodeName==="IFRAME"){const c=e.contentDocument,s=t;if(c){const u=r.getMeta(s.contentDocument);u&&n.mirror.add(c,Object.assign({},u)),ae(c,s.contentDocument,n,r)}}}function _o(e,t,n){const r=e.attributes,o=t.attributes;for(const i in o){const a=o[i],l=n.getMeta(t);if(l&&"isSVG"in l&&l.isSVG&&mt[i])e.setAttributeNS(mt[i],i,a);else if(t.tagName==="CANVAS"&&i==="rr_dataURL"){const c=document.createElement("img");c.src=a,c.onload=()=>{const s=e.getContext("2d");s&&s.drawImage(c,0,0,c.width,c.height)}}else e.setAttribute(i,a)}for(const{name:i}of Array.from(r))i in o||e.removeAttribute(i);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function Cn(e,t,n,r,o){var i;let a=0,l=e.length-1,c=0,s=t.length-1,u=e[a],d=e[l],h=t[c],m=t[s],p,v;for(;a<=l&&c<=s;){const N=r.mirror.getId(u),f=r.mirror.getId(d),b=o.getId(h),S=o.getId(m);if(u===void 0)u=e[++a];else if(d===void 0)d=e[--l];else if(N!==-1&&N===b)ae(u,h,r,o),u=e[++a],h=t[++c];else if(f!==-1&&f===S)ae(d,m,r,o),d=e[--l],m=t[--s];else if(N!==-1&&N===S)n.insertBefore(u,d.nextSibling),ae(u,m,r,o),u=e[++a],m=t[--s];else if(f!==-1&&f===b)n.insertBefore(d,u),ae(d,h,r,o),d=e[--l],h=t[++c];else{if(!p){p={};for(let y=a;y<=l;y++){const M=e[y];M&&r.mirror.hasNode(M)&&(p[r.mirror.getId(M)]=y)}}if(v=p[o.getId(h)],v){const y=e[v];n.insertBefore(y,u),ae(y,h,r,o),e[v]=void 0}else{const y=pt(h,r.mirror,o);n.nodeName==="#document"&&((i=r.mirror.getMeta(y))===null||i===void 0?void 0:i.type)===D.Element&&n.documentElement&&(n.removeChild(n.documentElement),e[a]=void 0,u=void 0),n.insertBefore(y,u||null),ae(y,h,r,o)}h=t[++c]}}if(a>l){const N=t[s+1];let f=null;for(N&&n.childNodes.forEach(b=>{r.mirror.getId(b)===o.getId(N)&&(f=b)});c<=s;++c){const b=pt(t[c],r.mirror,o);n.insertBefore(b,f),ae(b,t[c],r,o)}}else if(c>s)for(;a<=l;a++){const N=e[a];N&&(n.removeChild(N),r.mirror.removeNodeFromMap(N))}}function pt(e,t,n){const r=n.getId(e),o=n.getMeta(e);let i=null;if(r>-1&&(i=t.getNode(r)),i!==null)return i;switch(e.RRNodeType){case D.Document:i=new Document;break;case D.DocumentType:i=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case D.Element:{let a=e.tagName.toLowerCase();a=Fo[a]||a,o&&"isSVG"in o&&o?.isSVG?i=document.createElementNS(mt.svg,a):i=document.createElement(e.tagName);break}case D.Text:i=document.createTextNode(e.data);break;case D.Comment:i=document.createComment(e.data);break;case D.CDATA:i=document.createCDATASection(e.data);break}return o&&t.add(i,Object.assign({},o)),i}function We(e,t){const n=e[t[0]];return t.length===1?n:We(n.cssRules[t[1]].cssRules,t.slice(2))}var ie;(function(e){e[e.Insert=0]="Insert",e[e.Remove=1]="Remove",e[e.Snapshot=2]="Snapshot",e[e.SetProperty=3]="SetProperty",e[e.RemoveProperty=4]="RemoveProperty"})(ie||(ie={}));function In(e){const t=[...e],n=t.pop();return{positions:t,index:n}}function Wo(e,t){const n=e.sheet;t.forEach(r=>{if(r.type===ie.Insert)try{if(Array.isArray(r.index)){const{positions:o,index:i}=In(r.index);We(n.cssRules,o).insertRule(r.cssText,i)}else n.insertRule(r.cssText,r.index)}catch{}else if(r.type===ie.Remove)try{if(Array.isArray(r.index)){const{positions:o,index:i}=In(r.index);We(n.cssRules,o).deleteRule(i||0)}else n.deleteRule(r.index)}catch{}else r.type===ie.SetProperty?We(n.cssRules,r.index).style.setProperty(r.property,r.value,r.priority):r.type===ie.RemoveProperty&&We(n.cssRules,r.index).style.removeProperty(r.property)})}class Ce extends Lo(oe){constructor(t){super(),this._unserializedId=-1,this.mirror=Zo(),this.scrollData=null,t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,n,r){return new Ce}createDocumentType(t,n,r){const o=new $o(t,n,r);return o.ownerDocument=this,o}createElement(t){const n=t.toUpperCase();let r;switch(n){case"AUDIO":case"VIDEO":r=new Vo(n);break;case"IFRAME":r=new jo(n,this.mirror);break;case"CANVAS":r=new Uo(n);break;case"STYLE":r=new Go(n);break;default:r=new $e(n);break}return r.ownerDocument=this,r}createComment(t){const n=new zo(t);return n.ownerDocument=this,n}createCDATASection(t){const n=new Yo(t);return n.ownerDocument=this,n}createTextNode(t){const n=new Bo(t);return n.ownerDocument=this,n}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=-1}}const $o=Sn(oe);class $e extends Tn(oe){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class Vo extends Ao($e){}class Uo extends $e{constructor(){super(...arguments),this.rr_dataURL=null,this.canvasMutations=[]}getContext(){return null}}class Go extends $e{constructor(){super(...arguments),this.rules=[]}}class jo extends $e{constructor(t,n){super(t),this.contentDocument=new Ce,this.contentDocument.mirror=n}}const Bo=Nn(oe),zo=En(oe),Yo=wn(oe);function Ho(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function Mn(e,t,n,r){let o;switch(e.nodeType){case U.DOCUMENT_NODE:r&&r.nodeName==="IFRAME"?o=r.contentDocument:(o=t,o.compatMode=e.compatMode);break;case U.DOCUMENT_TYPE_NODE:{const a=e;o=t.createDocumentType(a.name,a.publicId,a.systemId);break}case U.ELEMENT_NODE:{const a=e,l=Ho(a);o=t.createElement(l);const c=o;for(const{name:s,value:u}of Array.from(a.attributes))c.attributes[s]=u;a.scrollLeft&&(c.scrollLeft=a.scrollLeft),a.scrollTop&&(c.scrollTop=a.scrollTop);break}case U.TEXT_NODE:o=t.createTextNode(e.textContent||"");break;case U.CDATA_SECTION_NODE:o=t.createCDATASection(e.data);break;case U.COMMENT_NODE:o=t.createComment(e.textContent||"");break;case U.DOCUMENT_FRAGMENT_NODE:o=r.attachShadow({mode:"open"});break;default:return null}let i=n.getMeta(e);return t instanceof Ce&&(i||(i=xn(o,t.unserializedId),n.add(e,i)),t.mirror.add(o,Object.assign({},i))),o}function Xo(e,t=Mo(),n=new Ce){function r(o,i){const a=Mn(o,n,t,i);a!==null&&(i?.nodeName!=="IFRAME"&&o.nodeType!==U.DOCUMENT_FRAGMENT_NODE&&(i?.appendChild(a),a.parentNode=i,a.parentElement=i),o.nodeName==="IFRAME"?r(o.contentDocument,a):(o.nodeType===U.DOCUMENT_NODE||o.nodeType===U.ELEMENT_NODE||o.nodeType===U.DOCUMENT_FRAGMENT_NODE)&&(o.nodeType===U.ELEMENT_NODE&&o.shadowRoot&&r(o.shadowRoot,a),o.childNodes.forEach(l=>r(l,a))))}return r(e,null),n}function Zo(){return new Ko}class Ko{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){var n;if(!t)return-1;const r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){const r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function xn(e,t){switch(e.RRNodeType){case D.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case D.DocumentType:{const n=e;return{id:t,type:e.RRNodeType,name:n.name,publicId:n.publicId,systemId:n.systemId}}case D.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case D.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case D.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case D.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}function kn(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(o){o(n)}),(r=e.get("*"))&&r.slice().map(function(o){o(t,n)})}}}var Qo=Object.freeze({__proto__:null,default:kn});function qo(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;const n=e.HTMLElement||e.Element,r=468,o={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:n.prototype.scroll||c,scrollIntoView:n.prototype.scrollIntoView},i=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function a(f){const b=["MSIE ","Trident/","Edge/"];return new RegExp(b.join("|")).test(f)}const l=a(e.navigator.userAgent)?1:0;function c(f,b){this.scrollLeft=f,this.scrollTop=b}function s(f){return .5*(1-Math.cos(Math.PI*f))}function u(f){if(f===null||typeof f!="object"||f.behavior===void 0||f.behavior==="auto"||f.behavior==="instant")return!0;if(typeof f=="object"&&f.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+f.behavior+" is not a valid value for enumeration ScrollBehavior.")}function d(f,b){if(b==="Y")return f.clientHeight+l<f.scrollHeight;if(b==="X")return f.clientWidth+l<f.scrollWidth}function h(f,b){const S=e.getComputedStyle(f,null)["overflow"+b];return S==="auto"||S==="scroll"}function m(f){const b=d(f,"Y")&&h(f,"Y"),S=d(f,"X")&&h(f,"X");return b||S}function p(f){for(;f!==t.body&&m(f)===!1;)f=f.parentNode||f.host;return f}function v(f){const b=i();let S,y,M,R=(b-f.startTime)/r;R=R>1?1:R,S=s(R),y=f.startX+(f.x-f.startX)*S,M=f.startY+(f.y-f.startY)*S,f.method.call(f.scrollable,y,M),(y!==f.x||M!==f.y)&&e.requestAnimationFrame(v.bind(e,f))}function N(f,b,S){let y,M,R,A;const P=i();f===t.body?(y=e,M=e.scrollX||e.pageXOffset,R=e.scrollY||e.pageYOffset,A=o.scroll):(y=f,M=f.scrollLeft,R=f.scrollTop,A=c),v({scrollable:y,method:A,startTime:P,startX:M,startY:R,x:b,y:S})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset);return}N.call(e,t.body,arguments[0].left!==void 0?~~arguments[0].left:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:e.scrollY||e.pageYOffset)}},e.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])){o.scrollBy.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}N.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset))}},n.prototype.scroll=n.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(u(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const f=arguments[0].left,b=arguments[0].top;N.call(this,this,typeof f>"u"?this.scrollLeft:~~f,typeof b>"u"?this.scrollTop:~~b)},n.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},n.prototype.scrollIntoView=function(){if(u(arguments[0])===!0){o.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const f=p(this),b=f.getBoundingClientRect(),S=this.getBoundingClientRect();f!==t.body?(N.call(this,f,f.scrollLeft+S.left-b.left,f.scrollTop+S.top-b.top),e.getComputedStyle(f).position!=="fixed"&&e.scrollBy({left:b.left,top:b.top,behavior:"smooth"})):e.scrollBy({left:S.left,top:S.top,behavior:"smooth"})}}class Jo{constructor(t=[],n){this.timeOffset=0,this.raf=null,this.actions=t,this.speed=n}addAction(t){const n=this.findActionIndex(t);this.actions.splice(n,0,t)}addActions(t){this.actions=this.actions.concat(t)}replaceActions(t){this.actions.length=0,this.actions.splice(0,0,...t)}start(){this.timeOffset=0;let t=performance.now();const{actions:n}=this,r=()=>{const o=performance.now();for(this.timeOffset+=(o-t)*this.speed,t=o;n.length;){const i=n[0];if(this.timeOffset>=i.delay)n.shift(),i.doAction();else break}(n.length>0||this.liveMode)&&(this.raf=requestAnimationFrame(r))};this.raf=requestAnimationFrame(r)}clear(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(t){this.speed=t}toggleLiveMode(t){this.liveMode=t}isActive(){return this.raf!==null}findActionIndex(t){let n=0,r=this.actions.length-1;for(;n<=r;){const o=Math.floor((n+r)/2);if(this.actions[o].delay<t.delay)n=o+1;else if(this.actions[o].delay>t.delay)r=o-1;else return o+1}return n}}function ft(e,t){if(e.type===C.IncrementalSnapshot&&e.data.source===x.MouseMove){const n=e.data.positions[0].timeOffset,r=e.timestamp+n;return e.delay=r-t,r-t}return e.delay=e.timestamp-t,e.delay}/*! *****************************************************************************
4
+ or you can use record.mirror to access the mirror instance during recording.`;J.mirror={map:{},getId(){return console.error(Se),-1},getNode(){return console.error(Se),null},removeNodeFromMap(){console.error(Se)},has(){return console.error(Se),!1},reset(){console.error(Se)}},typeof window<"u"&&window.Proxy&&window.Reflect&&(J.mirror=new Proxy(J.mirror,{get(e,t,n){return t==="map"&&console.error(Se),Reflect.get(e,t,n)}}));function Te(e,t,n={}){let r=null,o=0;return function(...i){const a=Date.now();!o&&n.leading===!1&&(o=a);const l=t-(a-o),c=this;l<=0||l>t?(r&&(clearTimeout(r),r=null),o=a,e.apply(c,i)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{o=n.leading===!1?0:Date.now(),r=null,e.apply(c,i)},l))}}function Le(e,t,n,r,o=window){const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(a){setTimeout(()=>{n.set.call(this,a)},0),i&&i.set&&i.set.call(this,a)}}),()=>Le(e,t,i||{},!0)}function pe(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}function rt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ot(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}const Wt=e=>{try{if(e instanceof HTMLElement)return e.tagName==="CANVAS"}catch{return!1}return!1};function ne(e,t,n){if(!e)return!1;const r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!r)return!1;if(typeof t=="string"){if(r.classList.contains(t)||n&&r.closest("."+t)!==null)return!0}else if(Ge(r,t,n))return!0;return!1}function $t(e,t){return t.getId(e)!==-1}function Be(e,t){return t.getId(e)===Oe}function it(e,t){if(De(e))return!1;const n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?it(e.parentNode,t):!0:!0}function st(e){return Boolean(e.changedTouches)}function at(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let n=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function Vt(e){const t={},n=(o,i)=>{const a={value:o,parent:i,children:[]};return t[o.node.id]=a,a},r=[];for(const o of e){const{nextId:i,parentId:a}=o;if(i&&i in t){const l=t[i];if(l.parent){const c=l.parent.children.indexOf(l);l.parent.children.splice(c,0,n(o,l.parent))}else{const c=r.indexOf(l);r.splice(c,0,n(o,null))}continue}if(a in t){const l=t[a];l.children.push(n(o,l));continue}r.push(n(o,null))}return r}function lt(e,t){t(e.value);for(let n=e.children.length-1;n>=0;n--)lt(e.children[n],t)}function Ne(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function ct(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function ut(e,t){var n,r;const o=(r=(n=e.ownerDocument)==null?void 0:n.defaultView)==null?void 0:r.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const i=o.getBoundingClientRect(),a=ut(o,t),l=i.height/o.clientHeight;return{x:i.x*a.relativeScale+a.x,y:i.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}}function Ae(e){return Boolean(e?.shadowRoot)}function Ee(e,t){const n=e[t[0]];return t.length===1?n:Ee(n.cssRules[t[1]].cssRules,t.slice(2))}function dt(e){const t=[...e],n=t.pop();return{positions:t,index:n}}function Ut(e){const t=new Set,n=[];for(let r=e.length;r--;){const o=e[r];t.has(o.id)||(n.push(o),t.add(o.id))}return n}var Rr=Object.freeze({__proto__:null,on:te,get _mirror(){return J.mirror},throttle:Te,hookSetter:Le,patch:pe,getWindowHeight:rt,getWindowWidth:ot,isCanvasNode:Wt,isBlocked:ne,isSerialized:$t,isIgnored:Be,isAncestorRemoved:it,isTouchEvent:st,polyfill:at,queueToResolveTrees:Vt,iterateResolveTree:lt,isSerializedIframe:Ne,isSerializedStylesheet:ct,getBaseDimension:ut,hasShadowRoot:Ae,getNestedRule:Ee,getPositionsAndIndex:dt,uniqueTextMutations:Ut}),C=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(C||{}),x=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e))(x||{}),X=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(X||{}),ue=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ue||{}),fe=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(fe||{}),O=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e))(O||{});function Gt(e){return"__ln"in e}class Or{constructor(){this.length=0,this.head=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=n?.next||null;return n}addNode(t){const n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&Gt(t.previousSibling)){const r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&Gt(t.nextSibling)&&t.nextSibling.__ln.previous){const r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;this.length++}removeNode(t){const n=t.__ln;!this.head||(n.previous?(n.previous.next=n.next,n.next&&(n.next.previous=n.previous)):(this.head=n.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}}const jt=(e,t)=>`${e}@${t}`;class Lr{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],n=new Or,r=l=>{let c=l,s=Oe;for(;s===Oe;)c=c&&c.nextSibling,s=c&&this.mirror.getId(c);return s},o=l=>{var c,s,u,d,h;const m=l.getRootNode?(c=l.getRootNode())==null?void 0:c.host:null;let p=m;for(;(u=(s=p?.getRootNode)==null?void 0:s.call(p))!=null&&u.host;)p=((h=(d=p?.getRootNode)==null?void 0:d.call(p))==null?void 0:h.host)||null;const v=!this.doc.contains(l)&&(!p||!this.doc.contains(p));if(!l.parentNode||v)return;const N=De(l.parentNode)?this.mirror.getId(m):this.mirror.getId(l.parentNode),f=r(l);if(N===-1||f===-1)return n.addNode(l);const b=me(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,enableStrictPrivacy:this.enableStrictPrivacy,onSerialize:S=>{Ne(S,this.mirror)&&this.iframeManager.addIframe(S),ct(S,this.mirror)&&this.stylesheetManager.addStylesheet(S),Ae(l)&&this.shadowDomManager.addShadowRoot(l.shadowRoot,document)},onIframeLoad:(S,y)=>{this.iframeManager.attachIframe(S,y,this.mirror),this.shadowDomManager.observeAttachShadow(S)},onStylesheetLoad:(S,y)=>{this.stylesheetManager.attachStylesheet(S,y,this.mirror)}});b&&t.push({parentId:N,nextId:f,node:b})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const l of Array.from(this.movedSet.values()))Bt(this.removes,l,this.mirror)&&!this.movedSet.has(l.parentNode)||o(l);for(const l of Array.from(this.addedSet.values()))!Yt(this.droppedSet,l)&&!Bt(this.removes,l,this.mirror)||Yt(this.movedSet,l)?o(l):this.droppedSet.add(l);let i=null;for(;n.length;){let l=null;if(i){const c=this.mirror.getId(i.value.parentNode),s=r(i.value);c!==-1&&s!==-1&&(l=i)}if(!l)for(let c=n.length-1;c>=0;c--){const s=n.get(c);if(s){const u=this.mirror.getId(s.value.parentNode),d=r(s.value);if(u!==-1&&d!==-1){l=s;break}}}if(!l){for(;n.head;)n.removeNode(n.head.value);break}i=l.previous,n.removeNode(l.value),o(l.value)}const a={texts:this.texts.map(l=>{let c=l.value;return this.enableStrictPrivacy&&c&&(c=Je(c)),{id:this.mirror.getId(l.node),value:c}}).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>({id:this.mirror.getId(l.node),attributes:l.attributes})).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:t};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.processMutation=t=>{if(!Be(t.target,this.mirror))switch(t.type){case"characterData":{const n=t.target.textContent;!ne(t.target,this.blockClass,!1)&&n!==t.oldValue&&this.texts.push({value:Dt(t.target,this.maskTextClass,this.maskTextSelector)&&n?this.maskTextFn?this.maskTextFn(n):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{const n=t.target;let r=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(r=qe({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:r,maskInputFn:this.maskInputFn})),ne(t.target,this.blockClass,!1)||r===t.oldValue)return;let o=this.attributes.find(i=>i.node===t.target);if(n.tagName==="IFRAME"&&t.attributeName==="src"&&!this.keepIframeSrcFn(r))if(!n.contentDocument)t.attributeName="rr_src";else return;if(o||(o={node:t.target,attributes:{}},this.attributes.push(o)),t.attributeName==="style"){const i=this.doc.createElement("span");t.oldValue&&i.setAttribute("style",t.oldValue),(o.attributes.style===void 0||o.attributes.style===null)&&(o.attributes.style={});const a=o.attributes.style;for(const l of Array.from(n.style)){const c=n.style.getPropertyValue(l),s=n.style.getPropertyPriority(l);(c!==i.style.getPropertyValue(l)||s!==i.style.getPropertyPriority(l))&&(s===""?a[l]=c:a[l]=[c,s])}for(const l of Array.from(i.style))n.style.getPropertyValue(l)===""&&(a[l]=!1)}else{if(t.target.tagName==="INPUT"){const i=t.target;if(i.type==="password"){o.attributes.value="*".repeat(i.value.length);break}}o.attributes[t.attributeName]=kt(this.doc,n.tagName,t.attributeName,r)}break}case"childList":{if(ne(t.target,this.blockClass,!0))return;t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{const r=this.mirror.getId(n),o=De(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);ne(t.target,this.blockClass,!1)||Be(n,this.mirror)||!$t(n,this.mirror)||(this.addedSet.has(n)?(ht(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||it(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[jt(r,o)]?ht(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:De(t.target)&&Re(t.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(t,n)=>{if(this.mirror.hasNode(t)){if(Be(t,this.mirror))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[jt(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);ne(t,this.blockClass,!1)||t.childNodes.forEach(r=>this.genAdds(r))}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","enableStrictPrivacy"].forEach(n=>{this[n]=t[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function ht(e,t){e.delete(t),t.childNodes.forEach(n=>ht(e,n))}function Bt(e,t,n){return e.length===0?!1:zt(e,t,n)}function zt(e,t,n){const{parentNode:r}=t;if(!r)return!1;const o=n.getId(r);return e.some(i=>i.id===o)?!0:zt(e,r,n)}function Yt(e,t){return e.size===0?!1:Ht(e,t)}function Ht(e,t){const{parentNode:n}=t;return n?e.has(n)?!0:Ht(e,n):!1}var Ar=Object.defineProperty,Pr=Object.defineProperties,Fr=Object.getOwnPropertyDescriptors,Xt=Object.getOwnPropertySymbols,_r=Object.prototype.hasOwnProperty,Wr=Object.prototype.propertyIsEnumerable,Zt=(e,t,n)=>t in e?Ar(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kt=(e,t)=>{for(var n in t||(t={}))_r.call(t,n)&&Zt(e,n,t[n]);if(Xt)for(var n of Xt(t))Wr.call(t,n)&&Zt(e,n,t[n]);return e},$r=(e,t)=>Pr(e,Fr(t));const ve=[],Qt=typeof CSSGroupingRule<"u",qt=typeof CSSMediaRule<"u",Jt=typeof CSSSupportsRule<"u",en=typeof CSSConditionRule<"u";function Pe(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch{return e.target}}function tn(e,t){var n,r;const o=new Lr;ve.push(o),o.init(e);let i=window.MutationObserver||window.__rrMutationObserver;const a=(r=(n=window?.Zone)==null?void 0:n.__symbol__)==null?void 0:r.call(n,"MutationObserver");a&&window[a]&&(i=window[a]);const l=new i(o.processMutations.bind(o));return l.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),l}function Vr({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let a=[],l;const c=Te(d=>{const h=Date.now()-l;e(a.map(m=>(m.timeOffset-=h,m)),d),a=[],l=null},i),s=Te(d=>{const h=Pe(d),{clientX:m,clientY:p}=st(d)?d.changedTouches[0]:d;l||(l=Date.now()),a.push({x:m,y:p,id:r.getId(h),timeOffset:Date.now()-l}),c(typeof DragEvent<"u"&&d instanceof DragEvent?x.Drag:d instanceof MouseEvent?x.MouseMove:x.TouchMove)},o,{trailing:!1}),u=[te("mousemove",s,n),te("touchmove",s,n),te("drag",s,n)];return()=>{u.forEach(d=>d())}}function Ur({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const i=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[],l=c=>s=>{const u=Pe(s);if(ne(u,r,!0)||Wt(u))return;const d=st(s)?s.changedTouches[0]:s;if(!d)return;const h=n.getId(u),{clientX:m,clientY:p}=d;e({type:X[c],id:h,x:m,y:p})};return Object.keys(X).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&i[c]!==!1).forEach(c=>{const s=c.toLowerCase(),u=l(c);a.push(te(s,u,t))}),()=>{a.forEach(c=>c())}}function nn({scrollCb:e,doc:t,mirror:n,blockClass:r,sampling:o}){const i=Te(a=>{const l=Pe(a);if(!l||ne(l,r,!0))return;const c=n.getId(l);if(l===t){const s=t.scrollingElement||t.documentElement;e({id:c,x:s.scrollLeft,y:s.scrollTop})}else e({id:c,x:l.scrollLeft,y:l.scrollTop})},o.scroll||100);return te("scroll",i,t)}function Gr({viewportResizeCb:e}){let t=-1,n=-1;const r=Te(()=>{const o=rt(),i=ot();(t!==o||n!==i)&&(e({width:Number(i),height:Number(o)}),t=o,n=i)},200);return te("resize",r,window)}function rn(e,t){const n=Kt({},e);return t||delete n.userTriggered,n}const jr=["INPUT","TEXTAREA","SELECT"],on=new WeakMap;function Br({inputCb:e,doc:t,mirror:n,blockClass:r,ignoreClass:o,maskInputOptions:i,maskInputFn:a,sampling:l,userTriggeredOnInput:c}){function s(p){let v=Pe(p);const N=p.isTrusted;if(v&&v.tagName==="OPTION"&&(v=v.parentElement),!v||!v.tagName||jr.indexOf(v.tagName)<0||ne(v,r,!0))return;const f=v.type;if(v.classList.contains(o))return;let b=v.value,S=!1;f==="radio"||f==="checkbox"?S=v.checked:(i[v.tagName.toLowerCase()]||i[f])&&(b=qe({maskInputOptions:i,tagName:v.tagName,type:f,value:b,maskInputFn:a})),u(v,rn({text:b,isChecked:S,userTriggered:N},c));const y=v.name;f==="radio"&&y&&S&&t.querySelectorAll(`input[type="radio"][name="${y}"]`).forEach(M=>{M!==v&&u(M,rn({text:M.value,isChecked:!S,userTriggered:!1},c))})}function u(p,v){const N=on.get(p);if(!N||N.text!==v.text||N.isChecked!==v.isChecked){on.set(p,v);const f=n.getId(p);e($r(Kt({},v),{id:f}))}}const d=(l.input==="last"?["change"]:["input","change"]).map(p=>te(p,s,t)),h=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),m=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return h&&h.set&&d.push(...m.map(p=>Le(p[0],p[1],{set(){s({target:this})}}))),()=>{d.forEach(p=>p())}}function ze(e){const t=[];function n(r,o){if(Qt&&r.parentRule instanceof CSSGroupingRule||qt&&r.parentRule instanceof CSSMediaRule||Jt&&r.parentRule instanceof CSSSupportsRule||en&&r.parentRule instanceof CSSConditionRule){const i=Array.from(r.parentRule.cssRules).indexOf(r);o.unshift(i)}else{const i=Array.from(r.parentStyleSheet.cssRules).indexOf(r);o.unshift(i)}return o}return n(e,t)}function zr({styleSheetRuleCb:e,mirror:t},{win:n}){const r=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=function(l,c){const s=t.getId(this.ownerNode);return s!==-1&&e({id:s,adds:[{rule:l,index:c}]}),r.apply(this,[l,c])};const o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=function(l){const c=t.getId(this.ownerNode);return c!==-1&&e({id:c,removes:[{index:l}]}),o.apply(this,[l])};const i={};Qt?i.CSSGroupingRule=n.CSSGroupingRule:(qt&&(i.CSSMediaRule=n.CSSMediaRule),en&&(i.CSSConditionRule=n.CSSConditionRule),Jt&&(i.CSSSupportsRule=n.CSSSupportsRule));const a={};return Object.entries(i).forEach(([l,c])=>{a[l]={insertRule:c.prototype.insertRule,deleteRule:c.prototype.deleteRule},c.prototype.insertRule=function(s,u){const d=t.getId(this.parentStyleSheet.ownerNode);return d!==-1&&e({id:d,adds:[{rule:s,index:[...ze(this),u||0]}]}),a[l].insertRule.apply(this,[s,u])},c.prototype.deleteRule=function(s){const u=t.getId(this.parentStyleSheet.ownerNode);return u!==-1&&e({id:u,removes:[{index:[...ze(this),s]}]}),a[l].deleteRule.apply(this,[s])}}),()=>{n.CSSStyleSheet.prototype.insertRule=r,n.CSSStyleSheet.prototype.deleteRule=o,Object.entries(i).forEach(([l,c])=>{c.prototype.insertRule=a[l].insertRule,c.prototype.deleteRule=a[l].deleteRule})}}function Yr({styleDeclarationCb:e,mirror:t},{win:n}){const r=n.CSSStyleDeclaration.prototype.setProperty;n.CSSStyleDeclaration.prototype.setProperty=function(i,a,l){var c,s;const u=t.getId((s=(c=this.parentRule)==null?void 0:c.parentStyleSheet)==null?void 0:s.ownerNode);return u!==-1&&e({id:u,set:{property:i,value:a,priority:l},index:ze(this.parentRule)}),r.apply(this,[i,a,l])};const o=n.CSSStyleDeclaration.prototype.removeProperty;return n.CSSStyleDeclaration.prototype.removeProperty=function(i){var a,l;const c=t.getId((l=(a=this.parentRule)==null?void 0:a.parentStyleSheet)==null?void 0:l.ownerNode);return c!==-1&&e({id:c,remove:{property:i},index:ze(this.parentRule)}),o.apply(this,[i])},()=>{n.CSSStyleDeclaration.prototype.setProperty=r,n.CSSStyleDeclaration.prototype.removeProperty=o}}function Hr({mediaInteractionCb:e,blockClass:t,mirror:n,sampling:r}){const o=a=>Te(l=>{const c=Pe(l);if(!c||ne(c,t,!0))return;const{currentTime:s,volume:u,muted:d}=c;e({type:a,id:n.getId(c),currentTime:s,volume:u,muted:d})},r.media||500),i=[te("play",o(fe.Play)),te("pause",o(fe.Pause)),te("seeked",o(fe.Seeked)),te("volumechange",o(fe.VolumeChange))];return()=>{i.forEach(a=>a())}}function Xr({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,i=n.FontFace;n.FontFace=function(l,c,s){const u=new i(l,c,s);return o.set(u,{family:l,buffer:typeof c!="string",descriptors:s,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),u};const a=pe(t.fonts,"add",function(l){return function(c){return setTimeout(()=>{const s=o.get(c);s&&(e(s),o.delete(c))},0),l.apply(this,[c])}});return r.push(()=>{n.FontFace=i}),r.push(a),()=>{r.forEach(l=>l())}}function Zr(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:a,inputCb:l,mediaInteractionCb:c,styleSheetRuleCb:s,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h}=e;e.mutationCb=(...m)=>{t.mutation&&t.mutation(...m),n(...m)},e.mousemoveCb=(...m)=>{t.mousemove&&t.mousemove(...m),r(...m)},e.mouseInteractionCb=(...m)=>{t.mouseInteraction&&t.mouseInteraction(...m),o(...m)},e.scrollCb=(...m)=>{t.scroll&&t.scroll(...m),i(...m)},e.viewportResizeCb=(...m)=>{t.viewportResize&&t.viewportResize(...m),a(...m)},e.inputCb=(...m)=>{t.input&&t.input(...m),l(...m)},e.mediaInteractionCb=(...m)=>{t.mediaInteaction&&t.mediaInteaction(...m),c(...m)},e.styleSheetRuleCb=(...m)=>{t.styleSheetRule&&t.styleSheetRule(...m),s(...m)},e.styleDeclarationCb=(...m)=>{t.styleDeclaration&&t.styleDeclaration(...m),u(...m)},e.canvasMutationCb=(...m)=>{t.canvasMutation&&t.canvasMutation(...m),d(...m)},e.fontCb=(...m)=>{t.font&&t.font(...m),h(...m)}}function Kr(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};Zr(e,t);const r=tn(e,e.doc),o=Vr(e),i=Ur(e),a=nn(e),l=Gr(e),c=Br(e),s=Hr(e),u=zr(e,{win:n}),d=Yr(e,{win:n}),h=e.collectFonts?Xr(e):()=>{},m=[];for(const p of e.plugins)m.push(p.observer(p.callback,n,p.options));return()=>{ve.forEach(p=>p.reset()),r.disconnect(),o(),i(),a(),l(),c(),s(),u(),d(),h(),m.forEach(p=>p())}}class Qr{constructor(t){this.iframes=new WeakMap,this.mutationCb=t.mutationCb}addIframe(t){this.iframes.set(t,!0)}addLoadListener(t){this.loadListener=t}attachIframe(t,n,r){var o;this.mutationCb({adds:[{parentId:r.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(o=this.loadListener)==null||o.call(this,t)}}var qr=Object.defineProperty,Jr=Object.defineProperties,eo=Object.getOwnPropertyDescriptors,sn=Object.getOwnPropertySymbols,to=Object.prototype.hasOwnProperty,no=Object.prototype.propertyIsEnumerable,an=(e,t,n)=>t in e?qr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ln=(e,t)=>{for(var n in t||(t={}))to.call(t,n)&&an(e,n,t[n]);if(sn)for(var n of sn(t))no.call(t,n)&&an(e,n,t[n]);return e},cn=(e,t)=>Jr(e,eo(t));class ro{constructor(t){this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;const n=this;this.restorePatches.push(pe(HTMLElement.prototype,"attachShadow",function(r){return function(o){const i=r.call(this,o);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,this.ownerDocument),i}}))}addShadowRoot(t,n){!Re(t)||(tn(cn(ln({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),nn(cn(ln({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror})))}observeAttachShadow(t){if(t.contentWindow){const n=this;this.restorePatches.push(pe(t.contentWindow.HTMLElement.prototype,"attachShadow",function(r){return function(o){const i=r.call(this,o);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,t.contentDocument),i}}))}}reset(){this.restorePatches.forEach(t=>t())}}for(var we="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Fe=typeof Uint8Array>"u"?[]:new Uint8Array(256),Ye=0;Ye<we.length;Ye++)Fe[we.charCodeAt(Ye)]=Ye;var oo=function(e){var t=new Uint8Array(e),n,r=t.length,o="";for(n=0;n<r;n+=3)o+=we[t[n]>>2],o+=we[(t[n]&3)<<4|t[n+1]>>4],o+=we[(t[n+1]&15)<<2|t[n+2]>>6],o+=we[t[n+2]&63];return r%3===2?o=o.substring(0,o.length-1)+"=":r%3===1&&(o=o.substring(0,o.length-2)+"=="),o},io=function(e){var t=e.length*.75,n=e.length,r,o=0,i,a,l,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var s=new ArrayBuffer(t),u=new Uint8Array(s);for(r=0;r<n;r+=4)i=Fe[e.charCodeAt(r)],a=Fe[e.charCodeAt(r+1)],l=Fe[e.charCodeAt(r+2)],c=Fe[e.charCodeAt(r+3)],u[o++]=i<<2|a>>4,u[o++]=(a&15)<<4|l>>2,u[o++]=(l&3)<<6|c&63;return s};const un=new Map;function so(e,t){let n=un.get(e);return n||(n=new Map,un.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}const dn=(e,t,n)=>{if(!e||!(mn(e,t)||typeof e=="object"))return;const r=e.constructor.name,o=so(n,r);let i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};function He(e,t,n){if(e instanceof Array)return e.map(r=>He(r,t,n));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){const r=e.constructor.name,o=oo(e);return{rr_type:r,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[He(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const r=e.constructor.name,{src:o}=e;return{rr_type:r,src:o}}else if(e instanceof HTMLCanvasElement){const r="HTMLImageElement",o=e.toDataURL();return{rr_type:r,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[He(e.data,t,n),e.width,e.height]};if(mn(e,t)||typeof e=="object"){const r=e.constructor.name,o=dn(e,t,n);return{rr_type:r,index:o}}}}return e}const hn=(e,t,n)=>[...e].map(r=>He(r,t,n)),mn=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(r=>typeof t[r]=="function");return Boolean(n.find(r=>e instanceof t[r]))};function ao(e,t,n,r){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of i)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;const l=pe(t.CanvasRenderingContext2D.prototype,a,function(c){return function(...s){return ne(this.canvas,n,!0)||setTimeout(()=>{const u=hn([...s],t,this);e(this.canvas,{type:ue["2D"],property:a,args:u})},0),c.apply(this,s)}});o.push(l)}catch{const c=Le(t.CanvasRenderingContext2D.prototype,a,{set(s){e(this.canvas,{type:ue["2D"],property:a,args:[s],setter:!0})}});o.push(c)}return()=>{o.forEach(a=>a())}}function pn(e,t){const n=[];try{const r=pe(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(i,...a){return ne(this,t,!0)||"__context"in this||(this.__context=i),o.apply(this,[i,...a])}});n.push(r)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(r=>r())}}function fn(e,t,n,r,o,i){const a=[],l=Object.getOwnPropertyNames(e);for(const c of l)try{if(typeof e[c]!="function")continue;const s=pe(e,c,function(u){return function(...d){const h=u.apply(this,d);if(dn(h,i,e),!ne(this.canvas,r,!0)){const m=hn([...d],i,e),p={type:t,property:c,args:m};n(this.canvas,p)}return h}});a.push(s)}catch{const u=Le(e,c,{set(d){n(this.canvas,{type:t,property:c,args:[d],setter:!0})}});a.push(u)}return a}function lo(e,t,n,r){const o=[];return o.push(...fn(t.WebGLRenderingContext.prototype,ue.WebGL,e,n,r,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...fn(t.WebGL2RenderingContext.prototype,ue.WebGL2,e,n,r,t)),()=>{o.forEach(i=>i())}}function co(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,i=n.length;o<i;++o)r[o]=n.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}function uo(e,t,n){var r=t===void 0?null:t,o=n===void 0?!1:n,i=co(e,o),a=i.indexOf(`
5
+ `,10)+1,l=i.substring(a)+(r?"//# sourceMappingURL="+r:""),c=new Blob([l],{type:"application/javascript"});return URL.createObjectURL(c)}function ho(e,t,n){var r;return function(i){return r=r||uo(e,t,n),new Worker(r,i)}}var mo=ho("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Zm9yKHZhciByPSJBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OSsvIixsPXR5cGVvZiBVaW50OEFycmF5PiJ1Ij9bXTpuZXcgVWludDhBcnJheSgyNTYpLGY9MDtmPHIubGVuZ3RoO2YrKylsW3IuY2hhckNvZGVBdChmKV09Zjt2YXIgZD1mdW5jdGlvbihzKXt2YXIgZT1uZXcgVWludDhBcnJheShzKSxuLGE9ZS5sZW5ndGgsdD0iIjtmb3Iobj0wO248YTtuKz0zKXQrPXJbZVtuXT4+Ml0sdCs9clsoZVtuXSYzKTw8NHxlW24rMV0+PjRdLHQrPXJbKGVbbisxXSYxNSk8PDJ8ZVtuKzJdPj42XSx0Kz1yW2VbbisyXSY2M107cmV0dXJuIGElMz09PTI/dD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTEpKyI9IjphJTM9PT0xJiYodD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTIpKyI9PSIpLHR9O2NvbnN0IGM9bmV3IE1hcCx1PW5ldyBNYXA7YXN5bmMgZnVuY3Rpb24gcChzLGUpe2NvbnN0IG49YCR7c30tJHtlfWA7aWYodS5oYXMobikpcmV0dXJuIHUuZ2V0KG4pO2NvbnN0IGE9bmV3IE9mZnNjcmVlbkNhbnZhcyhzLGUpO2EuZ2V0Q29udGV4dCgiMmQiKTtjb25zdCB0PWF3YWl0KGF3YWl0IGEuY29udmVydFRvQmxvYigpKS5hcnJheUJ1ZmZlcigpLGc9ZCh0KTtyZXR1cm4gdS5zZXQobixnKSxnfWNvbnN0IGk9c2VsZjtpLm9ubWVzc2FnZT1hc3luYyBmdW5jdGlvbihzKXtpZighKCJPZmZzY3JlZW5DYW52YXMiaW4gZ2xvYmFsVGhpcykpcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOnMuZGF0YS5pZH0pO2NvbnN0e2lkOmUsYml0bWFwOm4sd2lkdGg6YSxoZWlnaHQ6dH09cy5kYXRhLGc9cChhLHQpLGg9bmV3IE9mZnNjcmVlbkNhbnZhcyhhLHQpO2guZ2V0Q29udGV4dCgiMmQiKS5kcmF3SW1hZ2UobiwwLDApLG4uY2xvc2UoKTtjb25zdCB3PWF3YWl0IGguY29udmVydFRvQmxvYigpLHk9dy50eXBlLGI9YXdhaXQgdy5hcnJheUJ1ZmZlcigpLG89ZChiKTtpZighYy5oYXMoZSkmJmF3YWl0IGc9PT1vKXJldHVybiBjLnNldChlLG8pLGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpZihjLmdldChlKT09PW8pcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpLnBvc3RNZXNzYWdlKHtpZDplLHR5cGU6eSxiYXNlNjQ6byx3aWR0aDphLGhlaWdodDp0fSksYy5zZXQoZSxvKX19KSgpOwoK",null,!1),vn=Object.getOwnPropertySymbols,po=Object.prototype.hasOwnProperty,fo=Object.prototype.propertyIsEnumerable,vo=(e,t)=>{var n={};for(var r in e)po.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&vn)for(var r of vn(e))t.indexOf(r)<0&&fo.call(e,r)&&(n[r]=e[r]);return n},go=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{l(n.next(c))}catch(s){o(s)}},a=c=>{try{l(n.throw(c))}catch(s){o(s)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,a);l((n=n.apply(e,t)).next())});class yo{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(a,l)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(l)};const{sampling:n="all",win:r,blockClass:o,recordCanvas:i}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,i&&n==="all"&&this.initCanvasMutationObserver(r,o),i&&typeof n=="number"&&this.initCanvasFPSObserver(n,r,o)}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,n,r){const o=pn(n,r),i=new Map,a=new mo;a.onmessage=d=>{const{id:h}=d.data;if(i.set(h,!1),!("base64"in d.data))return;const{base64:m,type:p,width:v,height:N}=d.data;this.mutationCb({id:h,type:ue["2D"],commands:[{property:"clearRect",args:[0,0,v,N]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:m}],type:p}]},0,0]}]})};const l=1e3/t;let c=0,s;const u=d=>{if(c&&d-c<l){s=requestAnimationFrame(u);return}c=d,n.document.querySelectorAll(`canvas:not(.${r} *)`).forEach(h=>go(this,null,function*(){var m;const p=this.mirror.getId(h);if(i.get(p))return;if(i.set(p,!0),["webgl","webgl2"].includes(h.__context)){const N=h.getContext(h.__context);((m=N?.getContextAttributes())==null?void 0:m.preserveDrawingBuffer)===!1&&N?.clear(N.COLOR_BUFFER_BIT)}if(h.width===0||h.height===0)return;const v=yield createImageBitmap(h);a.postMessage({id:p,bitmap:v,width:h.width,height:h.height},[v])})),s=requestAnimationFrame(u)};s=requestAnimationFrame(u),this.resetObservers=()=>{o(),cancelAnimationFrame(s)}}initCanvasMutationObserver(t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=pn(t,n),o=ao(this.processMutation.bind(this),t,n,this.mirror),i=lo(this.processMutation.bind(this),t,n,this.mirror);this.resetObservers=()=>{r(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=n=>{this.rafStamps.latestId=n,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,n)=>{const r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,n){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(t);if(!r||n===-1)return;const o=r.map(a=>vo(a,["type"])),{type:i}=r[0];this.mutationCb({id:n,type:i,commands:o}),this.pendingCanvasMutations.delete(t)}}class bo{constructor(t){this.trackedStylesheets=new WeakSet,this.mutationCb=t.mutationCb}addStylesheet(t){this.trackedStylesheets.has(t)||(this.trackedStylesheets.add(t),this.trackStylesheet(t))}trackStylesheet(t){}attachStylesheet(t,n,r){this.mutationCb({adds:[{parentId:r.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[]}),this.addStylesheet(t)}}var So=Object.defineProperty,To=Object.defineProperties,No=Object.getOwnPropertyDescriptors,gn=Object.getOwnPropertySymbols,Eo=Object.prototype.hasOwnProperty,wo=Object.prototype.propertyIsEnumerable,yn=(e,t,n)=>t in e?So(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,re=(e,t)=>{for(var n in t||(t={}))Eo.call(t,n)&&yn(e,n,t[n]);if(gn)for(var n of gn(t))wo.call(t,n)&&yn(e,n,t[n]);return e},Co=(e,t)=>To(e,No(t));function K(e){return Co(re({},e),{timestamp:Date.now()})}let z,_e;const se=It();function ge(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="highlight-block",blockSelector:i=null,ignoreClass:a="highlight-ignore",maskTextClass:l="highlight-mask",maskTextSelector:c=null,inlineStylesheet:s=!0,maskAllInputs:u,maskInputOptions:d,slimDOMOptions:h,maskInputFn:m,maskTextFn:p=Je,hooks:v,packFn:N,sampling:f={},mousemoveWait:b,recordCanvas:S=!1,userTriggeredOnInput:y=!1,collectFonts:M=!1,inlineImages:R=!1,plugins:A,keepIframeSrcFn:P=()=>!1,enableStrictPrivacy:L=!1}=e;if(!t)throw new Error("emit function is required");b!==void 0&&f.mousemove===void 0&&(f.mousemove=b),se.reset();const B=u===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:d!==void 0?d:{password:!0},$=h===!0||h==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:h==="all",headMetaDescKeywords:h==="all"}:h||{};at();let Q,Y=0;const j=E=>{for(const w of A||[])w.eventProcessor&&(E=w.eventProcessor(E));return N&&(E=N(E)),E};z=(E,w)=>{var q;if(((q=ve[0])==null?void 0:q.isFrozen())&&E.type!==C.FullSnapshot&&!(E.type===C.IncrementalSnapshot&&E.data.source===x.Mutation)&&ve.forEach(ee=>ee.unfreeze()),t(j(E),w),E.type===C.FullSnapshot)Q=E,Y=0;else if(E.type===C.IncrementalSnapshot){if(E.data.source===x.Mutation&&E.data.isAttachIframe)return;Y++;const ee=r&&Y>=r,le=n&&E.timestamp-Q.timestamp>n;(ee||le)&&_e(!0)}};const H=E=>{z(K({type:C.IncrementalSnapshot,data:re({source:x.Mutation},E)}))},Z=E=>z(K({type:C.IncrementalSnapshot,data:re({source:x.Scroll},E)})),F=E=>z(K({type:C.IncrementalSnapshot,data:re({source:x.CanvasMutation},E)})),G=new Qr({mutationCb:H}),T=new bo({mutationCb:H}),g=new yo({recordCanvas:S,mutationCb:F,win:window,blockClass:o,mirror:se,sampling:f.canvas}),I=new ro({mutationCb:H,scrollCb:Z,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:s,maskInputOptions:B,maskTextFn:p,maskInputFn:m,recordCanvas:S,inlineImages:R,sampling:f,slimDOMOptions:$,iframeManager:G,stylesheetManager:T,canvasManager:g,keepIframeSrcFn:P,enableStrictPrivacy:L},mirror:se});_e=(E=!1)=>{var w,q,ee,le;z(K({type:C.Meta,data:{href:window.location.href,width:ot(),height:rt()}}),E),ve.forEach(V=>V.lock());const _=Nr(document,{mirror:se,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:s,maskAllInputs:B,maskTextFn:p,slimDOM:$,recordCanvas:S,inlineImages:R,enableStrictPrivacy:L,onSerialize:V=>{Ne(V,se)&&G.addIframe(V),ct(V,se)&&T.addStylesheet(V),Ae(V)&&I.addShadowRoot(V.shadowRoot,document)},onIframeLoad:(V,xe)=>{G.attachIframe(V,xe,se),I.observeAttachShadow(V)},onStylesheetLoad:(V,xe)=>{T.attachStylesheet(V,xe,se)},keepIframeSrcFn:P});if(!_)return console.warn("Failed to snapshot the document");z(K({type:C.FullSnapshot,data:{node:_,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((q=(w=document?.body)==null?void 0:w.parentElement)==null?void 0:q.scrollLeft)||document?.body.scrollLeft||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((le=(ee=document?.body)==null?void 0:ee.parentElement)==null?void 0:le.scrollTop)||document?.body.scrollTop||0}}})),ve.forEach(V=>V.unlock())};try{const E=[];E.push(te("DOMContentLoaded",()=>{z(K({type:C.DomContentLoaded,data:{}}))}));const w=ee=>{var le;return Kr({mutationCb:H,mousemoveCb:(_,V)=>z(K({type:C.IncrementalSnapshot,data:{source:V,positions:_}})),mouseInteractionCb:_=>z(K({type:C.IncrementalSnapshot,data:re({source:x.MouseInteraction},_)})),scrollCb:Z,viewportResizeCb:_=>z(K({type:C.IncrementalSnapshot,data:re({source:x.ViewportResize},_)})),inputCb:_=>z(K({type:C.IncrementalSnapshot,data:re({source:x.Input},_)})),mediaInteractionCb:_=>z(K({type:C.IncrementalSnapshot,data:re({source:x.MediaInteraction},_)})),styleSheetRuleCb:_=>z(K({type:C.IncrementalSnapshot,data:re({source:x.StyleSheetRule},_)})),styleDeclarationCb:_=>z(K({type:C.IncrementalSnapshot,data:re({source:x.StyleDeclaration},_)})),canvasMutationCb:F,fontCb:_=>z(K({type:C.IncrementalSnapshot,data:re({source:x.Font},_)})),blockClass:o,ignoreClass:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:B,inlineStylesheet:s,sampling:f,recordCanvas:S,inlineImages:R,userTriggeredOnInput:y,collectFonts:M,doc:ee,maskInputFn:m,maskTextFn:p,keepIframeSrcFn:P,blockSelector:i,slimDOMOptions:$,mirror:se,iframeManager:G,stylesheetManager:T,shadowDomManager:I,canvasManager:g,enableStrictPrivacy:L,plugins:((le=A?.filter(_=>_.observer))==null?void 0:le.map(_=>({observer:_.observer,options:_.options,callback:V=>z(K({type:C.Plugin,data:{plugin:_.name,payload:V}}))})))||[]},v)};G.addLoadListener(ee=>{E.push(w(ee.contentDocument))});const q=()=>{_e(),E.push(w(document))};return document.readyState==="interactive"||document.readyState==="complete"?q():E.push(te("load",()=>{z(K({type:C.Load,data:{}})),q()},window)),()=>{E.forEach(ee=>ee())}}catch(E){console.warn(E)}}ge.addCustomEvent=(e,t)=>{!z||z(K({type:C.Custom,data:{tag:e,payload:t}}))},ge.freezePage=()=>{ve.forEach(e=>e.freeze())},ge.takeFullSnapshot=e=>{if(!_e)throw new Error("please take full snapshot after start recording");_e(e)},ge.mirror=se;var D;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(D||(D={}));var Io=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var n;if(!t)return-1;var r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var n=this,r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(function(o){return n.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,n){var r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)},e.prototype.replace=function(t,n){this.idNodeMap.set(t,n)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function Mo(){return new Io}function xo(e){const t={},n=/;(?![^(]*\))/g,r=/:(.+)/,o=/\/\*.*?\*\//g;return e.replace(o,"").split(n).forEach(function(i){if(i){const a=i.split(r);a.length>1&&(t[mt(a[0].trim())]=a[1].trim())}}),t}function bn(e){const t=[];for(const n in e){const r=e[n];if(typeof r!="string")continue;const o=Oo(n);t.push(`${o}: ${r};`)}return t.join(" ")}const ko=/-([a-z])/g,Do=/^--[a-zA-Z0-9-]+$/,mt=e=>Do.test(e)?e:e.replace(ko,(t,n)=>n?n.toUpperCase():""),Ro=/\B([A-Z])/g,Oo=e=>e.replace(Ro,"-$1").toLowerCase();class oe{constructor(...t){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=U.ELEMENT_NODE,this.TEXT_NODE=U.TEXT_NODE}get firstChild(){return this.childNodes[0]||null}get lastChild(){return this.childNodes[this.childNodes.length-1]||null}get nextSibling(){const t=this.parentNode;if(!t)return null;const n=t.childNodes,r=n.indexOf(this);return n[r+1]||null}contains(t){if(t===this)return!0;for(const n of this.childNodes)if(n.contains(t))return!0;return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,n){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function Lo(e){return class qn extends e{constructor(){super(...arguments),this.nodeType=U.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=D.Document,this.textContent=null}get documentElement(){return this.childNodes.find(n=>n.RRNodeType===D.Element&&n.tagName==="HTML")||null}get body(){var n;return((n=this.documentElement)===null||n===void 0?void 0:n.childNodes.find(r=>r.RRNodeType===D.Element&&r.tagName==="BODY"))||null}get head(){var n;return((n=this.documentElement)===null||n===void 0?void 0:n.childNodes.find(r=>r.RRNodeType===D.Element&&r.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(n){const r=n.RRNodeType;if((r===D.Element||r===D.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${r===D.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);return n.parentElement=null,n.parentNode=this,this.childNodes.push(n),n}insertBefore(n,r){const o=n.RRNodeType;if((o===D.Element||o===D.DocumentType)&&this.childNodes.some(a=>a.RRNodeType===o))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${o===D.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);if(r===null)return this.appendChild(n);const i=this.childNodes.indexOf(r);if(i==-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(i,0,n),n.parentElement=null,n.parentNode=this,n}removeChild(n){const r=this.childNodes.indexOf(n);if(r===-1)throw new Error("Failed to execute 'removeChild' on 'RRDocument': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(r,1),n.parentElement=null,n.parentNode=null,n}open(){this.childNodes=[]}close(){}write(n){let r;if(n==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?r="-//W3C//DTD XHTML 1.0 Transitional//EN":n==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(r="-//W3C//DTD HTML 4.0 Transitional//EN"),r){const o=this.createDocumentType("html",r,"");this.open(),this.appendChild(o)}}createDocument(n,r,o){return new qn}createDocumentType(n,r,o){const i=new(Sn(oe))(n,r,o);return i.ownerDocument=this,i}createElement(n){const r=new(Tn(oe))(n);return r.ownerDocument=this,r}createElementNS(n,r){return this.createElement(r)}createTextNode(n){const r=new(Nn(oe))(n);return r.ownerDocument=this,r}createComment(n){const r=new(En(oe))(n);return r.ownerDocument=this,r}createCDATASection(n){const r=new(wn(oe))(n);return r.ownerDocument=this,r}toString(){return"RRDocument"}}}function Sn(e){return class extends e{constructor(t,n,r){super(),this.nodeType=U.DOCUMENT_TYPE_NODE,this.RRNodeType=D.DocumentType,this.textContent=null,this.name=t,this.publicId=n,this.systemId=r,this.nodeName=t}toString(){return"RRDocumentType"}}}function Tn(e){return class extends e{constructor(t){super(),this.nodeType=U.ELEMENT_NODE,this.RRNodeType=D.Element,this.attributes={},this.shadowRoot=null,this.tagName=t.toUpperCase(),this.nodeName=t.toUpperCase()}get textContent(){let t="";return this.childNodes.forEach(n=>t+=n.textContent),t}set textContent(t){this.childNodes=[this.ownerDocument.createTextNode(t)]}get classList(){return new Po(this.attributes.class,t=>{this.attributes.class=t})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const t=this.attributes.style?xo(this.attributes.style):{},n=/\B([A-Z])/g;return t.setProperty=(r,o,i)=>{if(n.test(r))return;const a=mt(r);o?t[a]=o:delete t[a],i==="important"&&(t[a]+=" !important"),this.attributes.style=bn(t)},t.removeProperty=r=>{if(n.test(r))return"";const o=mt(r),i=t[o]||"";return delete t[o],this.attributes.style=bn(t),i},t}getAttribute(t){return this.attributes[t]||null}setAttribute(t,n){this.attributes[t]=n}setAttributeNS(t,n,r){this.setAttribute(n,r)}removeAttribute(t){delete this.attributes[t]}appendChild(t){return this.childNodes.push(t),t.parentNode=this,t.parentElement=this,t}insertBefore(t,n){if(n===null)return this.appendChild(t);const r=this.childNodes.indexOf(n);if(r==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(r,0,t),t.parentElement=this,t.parentNode=this,t}removeChild(t){const n=this.childNodes.indexOf(t);if(n===-1)throw new Error("Failed to execute 'removeChild' on 'RRElement': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(n,1),t.parentElement=null,t.parentNode=null,t}attachShadow(t){const n=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=n,n}dispatchEvent(t){return!0}toString(){let t="";for(const n in this.attributes)t+=`${n}="${this.attributes[n]}" `;return`${this.tagName} ${t}`}}}function Ao(e){return class extends e{attachShadow(t){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}}function Nn(e){return class extends e{constructor(t){super(),this.nodeType=U.TEXT_NODE,this.nodeName="#text",this.RRNodeType=D.Text,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function En(e){return class extends e{constructor(t){super(),this.nodeType=U.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=D.Comment,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function wn(e){return class extends e{constructor(t){super(),this.nodeName="#cdata-section",this.nodeType=U.CDATA_SECTION_NODE,this.RRNodeType=D.CDATA,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class Po{constructor(t,n){if(this.classes=[],this.add=(...r)=>{for(const o of r){const i=String(o);this.classes.indexOf(i)>=0||this.classes.push(i)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...r)=>{this.classes=this.classes.filter(o=>r.indexOf(o)===-1),this.onChange&&this.onChange(this.classes.join(" "))},t){const r=t.trim().split(/\s+/);this.classes.push(...r)}this.onChange=n}}var U;(function(e){e[e.PLACEHOLDER=0]="PLACEHOLDER",e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"})(U||(U={}));const pt={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},Fo={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 ae(e,t,n,r){const o=e.childNodes,i=t.childNodes;r=r||t.mirror||t.ownerDocument.mirror,(o.length>0||i.length>0)&&Cn(Array.from(o),i,e,n,r);let a=null,l=null;switch(t.RRNodeType){case D.Document:{l=t.scrollData;break}case D.Element:{const c=e,s=t;switch(_o(c,s,r),l=s.scrollData,a=s.inputData,s.tagName){case"AUDIO":case"VIDEO":{const u=e,d=s;d.paused!==void 0&&(d.paused?u.pause():u.play()),d.muted!==void 0&&(u.muted=d.muted),d.volume!==void 0&&(u.volume=d.volume),d.currentTime!==void 0&&(u.currentTime=d.currentTime);break}case"CANVAS":{const u=t;if(u.rr_dataURL!==null){const d=document.createElement("img");d.onload=()=>{const h=c.getContext("2d");h&&h.drawImage(d,0,0,d.width,d.height)},d.src=u.rr_dataURL}u.canvasMutations.forEach(d=>n.applyCanvas(d.event,d.mutation,e))}break;case"STYLE":Wo(c,t.rules);break}if(s.shadowRoot){c.shadowRoot||c.attachShadow({mode:"open"});const u=c.shadowRoot.childNodes,d=s.shadowRoot.childNodes;(u.length>0||d.length>0)&&Cn(Array.from(u),d,c.shadowRoot,n,r)}break}case D.Text:case D.Comment:case D.CDATA:e.textContent!==t.data&&(e.textContent=t.data);break}if(l&&n.applyScroll(l,!0),a&&n.applyInput(a),t.nodeName==="IFRAME"){const c=e.contentDocument,s=t;if(c){const u=r.getMeta(s.contentDocument);u&&n.mirror.add(c,Object.assign({},u)),ae(c,s.contentDocument,n,r)}}}function _o(e,t,n){const r=e.attributes,o=t.attributes;for(const i in o){const a=o[i],l=n.getMeta(t);if(l&&"isSVG"in l&&l.isSVG&&pt[i])e.setAttributeNS(pt[i],i,a);else if(t.tagName==="CANVAS"&&i==="rr_dataURL"){const c=document.createElement("img");c.src=a,c.onload=()=>{const s=e.getContext("2d");s&&s.drawImage(c,0,0,c.width,c.height)}}else e.setAttribute(i,a)}for(const{name:i}of Array.from(r))i in o||e.removeAttribute(i);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function Cn(e,t,n,r,o){var i;let a=0,l=e.length-1,c=0,s=t.length-1,u=e[a],d=e[l],h=t[c],m=t[s],p,v;for(;a<=l&&c<=s;){const N=r.mirror.getId(u),f=r.mirror.getId(d),b=o.getId(h),S=o.getId(m);if(u===void 0)u=e[++a];else if(d===void 0)d=e[--l];else if(N!==-1&&N===b)ae(u,h,r,o),u=e[++a],h=t[++c];else if(f!==-1&&f===S)ae(d,m,r,o),d=e[--l],m=t[--s];else if(N!==-1&&N===S)n.insertBefore(u,d.nextSibling),ae(u,m,r,o),u=e[++a],m=t[--s];else if(f!==-1&&f===b)n.insertBefore(d,u),ae(d,h,r,o),d=e[--l],h=t[++c];else{if(!p){p={};for(let y=a;y<=l;y++){const M=e[y];M&&r.mirror.hasNode(M)&&(p[r.mirror.getId(M)]=y)}}if(v=p[o.getId(h)],v){const y=e[v];n.insertBefore(y,u),ae(y,h,r,o),e[v]=void 0}else{const y=ft(h,r.mirror,o);n.nodeName==="#document"&&((i=r.mirror.getMeta(y))===null||i===void 0?void 0:i.type)===D.Element&&n.documentElement&&(n.removeChild(n.documentElement),e[a]=void 0,u=void 0),n.insertBefore(y,u||null),ae(y,h,r,o)}h=t[++c]}}if(a>l){const N=t[s+1];let f=null;for(N&&n.childNodes.forEach(b=>{r.mirror.getId(b)===o.getId(N)&&(f=b)});c<=s;++c){const b=ft(t[c],r.mirror,o);n.insertBefore(b,f),ae(b,t[c],r,o)}}else if(c>s)for(;a<=l;a++){const N=e[a];N&&(n.removeChild(N),r.mirror.removeNodeFromMap(N))}}function ft(e,t,n){const r=n.getId(e),o=n.getMeta(e);let i=null;if(r>-1&&(i=t.getNode(r)),i!==null)return i;switch(e.RRNodeType){case D.Document:i=new Document;break;case D.DocumentType:i=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case D.Element:{let a=e.tagName.toLowerCase();a=Fo[a]||a,o&&"isSVG"in o&&o?.isSVG?i=document.createElementNS(pt.svg,a):i=document.createElement(e.tagName);break}case D.Text:i=document.createTextNode(e.data);break;case D.Comment:i=document.createComment(e.data);break;case D.CDATA:i=document.createCDATASection(e.data);break}return o&&t.add(i,Object.assign({},o)),i}function We(e,t){const n=e[t[0]];return t.length===1?n:We(n.cssRules[t[1]].cssRules,t.slice(2))}var ie;(function(e){e[e.Insert=0]="Insert",e[e.Remove=1]="Remove",e[e.Snapshot=2]="Snapshot",e[e.SetProperty=3]="SetProperty",e[e.RemoveProperty=4]="RemoveProperty"})(ie||(ie={}));function In(e){const t=[...e],n=t.pop();return{positions:t,index:n}}function Wo(e,t){const n=e.sheet;t.forEach(r=>{if(r.type===ie.Insert)try{if(Array.isArray(r.index)){const{positions:o,index:i}=In(r.index);We(n.cssRules,o).insertRule(r.cssText,i)}else n.insertRule(r.cssText,r.index)}catch{}else if(r.type===ie.Remove)try{if(Array.isArray(r.index)){const{positions:o,index:i}=In(r.index);We(n.cssRules,o).deleteRule(i||0)}else n.deleteRule(r.index)}catch{}else r.type===ie.SetProperty?We(n.cssRules,r.index).style.setProperty(r.property,r.value,r.priority):r.type===ie.RemoveProperty&&We(n.cssRules,r.index).style.removeProperty(r.property)})}class Ce extends Lo(oe){constructor(t){super(),this._unserializedId=-1,this.mirror=Zo(),this.scrollData=null,t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,n,r){return new Ce}createDocumentType(t,n,r){const o=new $o(t,n,r);return o.ownerDocument=this,o}createElement(t){const n=t.toUpperCase();let r;switch(n){case"AUDIO":case"VIDEO":r=new Vo(n);break;case"IFRAME":r=new jo(n,this.mirror);break;case"CANVAS":r=new Uo(n);break;case"STYLE":r=new Go(n);break;default:r=new $e(n);break}return r.ownerDocument=this,r}createComment(t){const n=new zo(t);return n.ownerDocument=this,n}createCDATASection(t){const n=new Yo(t);return n.ownerDocument=this,n}createTextNode(t){const n=new Bo(t);return n.ownerDocument=this,n}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=-1}}const $o=Sn(oe);class $e extends Tn(oe){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class Vo extends Ao($e){}class Uo extends $e{constructor(){super(...arguments),this.rr_dataURL=null,this.canvasMutations=[]}getContext(){return null}}class Go extends $e{constructor(){super(...arguments),this.rules=[]}}class jo extends $e{constructor(t,n){super(t),this.contentDocument=new Ce,this.contentDocument.mirror=n}}const Bo=Nn(oe),zo=En(oe),Yo=wn(oe);function Ho(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function Mn(e,t,n,r){let o;switch(e.nodeType){case U.DOCUMENT_NODE:r&&r.nodeName==="IFRAME"?o=r.contentDocument:(o=t,o.compatMode=e.compatMode);break;case U.DOCUMENT_TYPE_NODE:{const a=e;o=t.createDocumentType(a.name,a.publicId,a.systemId);break}case U.ELEMENT_NODE:{const a=e,l=Ho(a);o=t.createElement(l);const c=o;for(const{name:s,value:u}of Array.from(a.attributes))c.attributes[s]=u;a.scrollLeft&&(c.scrollLeft=a.scrollLeft),a.scrollTop&&(c.scrollTop=a.scrollTop);break}case U.TEXT_NODE:o=t.createTextNode(e.textContent||"");break;case U.CDATA_SECTION_NODE:o=t.createCDATASection(e.data);break;case U.COMMENT_NODE:o=t.createComment(e.textContent||"");break;case U.DOCUMENT_FRAGMENT_NODE:o=r.attachShadow({mode:"open"});break;default:return null}let i=n.getMeta(e);return t instanceof Ce&&(i||(i=xn(o,t.unserializedId),n.add(e,i)),t.mirror.add(o,Object.assign({},i))),o}function Xo(e,t=Mo(),n=new Ce){function r(o,i){const a=Mn(o,n,t,i);a!==null&&(i?.nodeName!=="IFRAME"&&o.nodeType!==U.DOCUMENT_FRAGMENT_NODE&&(i?.appendChild(a),a.parentNode=i,a.parentElement=i),o.nodeName==="IFRAME"?r(o.contentDocument,a):(o.nodeType===U.DOCUMENT_NODE||o.nodeType===U.ELEMENT_NODE||o.nodeType===U.DOCUMENT_FRAGMENT_NODE)&&(o.nodeType===U.ELEMENT_NODE&&o.shadowRoot&&r(o.shadowRoot,a),o.childNodes.forEach(l=>r(l,a))))}return r(e,null),n}function Zo(){return new Ko}class Ko{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){var n;if(!t)return-1;const r=(n=this.getMeta(t))===null||n===void 0?void 0:n.id;return r??-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){const r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function xn(e,t){switch(e.RRNodeType){case D.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case D.DocumentType:{const n=e;return{id:t,type:e.RRNodeType,name:n.name,publicId:n.publicId,systemId:n.systemId}}case D.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case D.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case D.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case D.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}function kn(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(o){o(n)}),(r=e.get("*"))&&r.slice().map(function(o){o(t,n)})}}}var Qo=Object.freeze({__proto__:null,default:kn});function qo(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;const n=e.HTMLElement||e.Element,r=468,o={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:n.prototype.scroll||c,scrollIntoView:n.prototype.scrollIntoView},i=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function a(f){const b=["MSIE ","Trident/","Edge/"];return new RegExp(b.join("|")).test(f)}const l=a(e.navigator.userAgent)?1:0;function c(f,b){this.scrollLeft=f,this.scrollTop=b}function s(f){return .5*(1-Math.cos(Math.PI*f))}function u(f){if(f===null||typeof f!="object"||f.behavior===void 0||f.behavior==="auto"||f.behavior==="instant")return!0;if(typeof f=="object"&&f.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+f.behavior+" is not a valid value for enumeration ScrollBehavior.")}function d(f,b){if(b==="Y")return f.clientHeight+l<f.scrollHeight;if(b==="X")return f.clientWidth+l<f.scrollWidth}function h(f,b){const S=e.getComputedStyle(f,null)["overflow"+b];return S==="auto"||S==="scroll"}function m(f){const b=d(f,"Y")&&h(f,"Y"),S=d(f,"X")&&h(f,"X");return b||S}function p(f){for(;f!==t.body&&m(f)===!1;)f=f.parentNode||f.host;return f}function v(f){const b=i();let S,y,M,R=(b-f.startTime)/r;R=R>1?1:R,S=s(R),y=f.startX+(f.x-f.startX)*S,M=f.startY+(f.y-f.startY)*S,f.method.call(f.scrollable,y,M),(y!==f.x||M!==f.y)&&e.requestAnimationFrame(v.bind(e,f))}function N(f,b,S){let y,M,R,A;const P=i();f===t.body?(y=e,M=e.scrollX||e.pageXOffset,R=e.scrollY||e.pageYOffset,A=o.scroll):(y=f,M=f.scrollLeft,R=f.scrollTop,A=c),v({scrollable:y,method:A,startTime:P,startX:M,startY:R,x:b,y:S})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset);return}N.call(e,t.body,arguments[0].left!==void 0?~~arguments[0].left:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:e.scrollY||e.pageYOffset)}},e.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])){o.scrollBy.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}N.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset))}},n.prototype.scroll=n.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(u(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const f=arguments[0].left,b=arguments[0].top;N.call(this,this,typeof f>"u"?this.scrollLeft:~~f,typeof b>"u"?this.scrollTop:~~b)},n.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},n.prototype.scrollIntoView=function(){if(u(arguments[0])===!0){o.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const f=p(this),b=f.getBoundingClientRect(),S=this.getBoundingClientRect();f!==t.body?(N.call(this,f,f.scrollLeft+S.left-b.left,f.scrollTop+S.top-b.top),e.getComputedStyle(f).position!=="fixed"&&e.scrollBy({left:b.left,top:b.top,behavior:"smooth"})):e.scrollBy({left:S.left,top:S.top,behavior:"smooth"})}}class Jo{constructor(t=[],n){this.timeOffset=0,this.raf=null,this.actions=t,this.speed=n}addAction(t){const n=this.findActionIndex(t);this.actions.splice(n,0,t)}addActions(t){this.actions=this.actions.concat(t)}replaceActions(t){this.actions.length=0,this.actions.splice(0,0,...t)}start(){this.timeOffset=0;let t=performance.now();const{actions:n}=this,r=()=>{const o=performance.now();for(this.timeOffset+=(o-t)*this.speed,t=o;n.length;){const i=n[0];if(this.timeOffset>=i.delay)n.shift(),i.doAction();else break}(n.length>0||this.liveMode)&&(this.raf=requestAnimationFrame(r))};this.raf=requestAnimationFrame(r)}clear(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(t){this.speed=t}toggleLiveMode(t){this.liveMode=t}isActive(){return this.raf!==null}findActionIndex(t){let n=0,r=this.actions.length-1;for(;n<=r;){const o=Math.floor((n+r)/2);if(this.actions[o].delay<t.delay)n=o+1;else if(this.actions[o].delay>t.delay)r=o-1;else return o+1}return n}}function vt(e,t){if(e.type===C.IncrementalSnapshot&&e.data.source===x.MouseMove){const n=e.data.positions[0].timeOffset,r=e.timestamp+n;return e.delay=r-t,r-t}return e.delay=e.timestamp-t,e.delay}/*! *****************************************************************************
6
6
  Copyright (c) Microsoft Corporation.
7
7
 
8
8
  Permission to use, copy, modify, and/or distribute this software for any
@@ -15,4 +15,4 @@ or you can use record.mirror to access the mirror instance during recording.`;J.
15
15
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
16
16
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17
17
  PERFORMANCE OF THIS SOFTWARE.
18
- ***************************************************************************** */function Dn(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(l){o={error:l}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}var Ie;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Ie||(Ie={}));var Rn={type:"xstate.init"};function vt(e){return e===void 0?[]:[].concat(e)}function ye(e){return{type:"xstate.assign",assignment:e}}function On(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 Xe(e){return function(t){return e===t}}function Ln(e){return typeof e=="string"?{type:e}:e}function An(e,t){return{value:e,context:t,actions:[],changed:!1,matches:Xe(e)}}function Pn(e,t,n){var r=t,o=!1;return[e.filter(function(i){if(i.type==="xstate.assign"){o=!0;var a=Object.assign({},r);return typeof i.assignment=="function"?a=i.assignment(r,n):Object.keys(i.assignment).forEach(function(l){a[l]=typeof i.assignment[l]=="function"?i.assignment[l](r,n):i.assignment[l]}),r=a,!1}return!0}),r,o]}function Fn(e,t){t===void 0&&(t={});var n=Dn(Pn(vt(e.states[e.initial].entry).map(function(a){return On(a,t.actions)}),e.context,Rn),2),r=n[0],o=n[1],i={config:e,_options:t,initialState:{value:e.initial,actions:r,context:o,matches:Xe(e.initial)},transition:function(a,l){var c,s,u=typeof a=="string"?{value:a,context:e.context}:a,d=u.value,h=u.context,m=Ln(l),p=e.states[d];if(p.on){var v=vt(p.on[m.type]);try{for(var N=function(F){var G=typeof Symbol=="function"&&Symbol.iterator,T=G&&F[G],g=0;if(T)return T.call(F);if(F&&typeof F.length=="number")return{next:function(){return F&&g>=F.length&&(F=void 0),{value:F&&F[g++],done:!F}}};throw new TypeError(G?"Object is not iterable.":"Symbol.iterator is not defined.")}(v),f=N.next();!f.done;f=N.next()){var b=f.value;if(b===void 0)return An(d,h);var S=typeof b=="string"?{target:b}:b,y=S.target,M=S.actions,R=M===void 0?[]:M,A=S.cond,P=A===void 0?function(){return!0}:A,L=y===void 0,B=y??d,$=e.states[B];if(P(h,m)){var Q=Dn(Pn((L?vt(R):[].concat(p.exit,R,$.entry).filter(function(F){return F})).map(function(F){return On(F,i._options.actions)}),h,m),3),Y=Q[0],j=Q[1],H=Q[2],Z=y??d;return{value:Z,context:j,actions:Y,changed:y!==d||Y.length>0||H,matches:Xe(Z)}}}}catch(F){c={error:F}}finally{try{f&&!f.done&&(s=N.return)&&s.call(N)}finally{if(c)throw c.error}}}return An(d,h)}};return i}var _n=function(e,t){return e.actions.forEach(function(n){var r=n.exec;return r&&r(e.context,t)})};function Wn(e){var t=e.initialState,n=Ie.NotStarted,r=new Set,o={_machine:e,send:function(i){n===Ie.Running&&(t=e.transition(t,i),_n(t,Ln(i)),r.forEach(function(a){return a(t)}))},subscribe:function(i){return r.add(i),i(t),{unsubscribe:function(){return r.delete(i)}}},start:function(i){if(i){var a=typeof i=="object"?i:{context:e.config.context,value:i};t={value:a.value,actions:[],context:a.context,matches:Xe(a.value)}}return n=Ie.Running,_n(t,Rn),o},stop:function(){return n=Ie.Stopped,r.clear(),o},get state(){return t},get status(){return n}};return o}var ei=Object.defineProperty,ti=Object.defineProperties,ni=Object.getOwnPropertyDescriptors,$n=Object.getOwnPropertySymbols,ri=Object.prototype.hasOwnProperty,oi=Object.prototype.propertyIsEnumerable,Vn=(e,t,n)=>t in e?ei(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ze=(e,t)=>{for(var n in t||(t={}))ri.call(t,n)&&Vn(e,n,t[n]);if($n)for(var n of $n(t))oi.call(t,n)&&Vn(e,n,t[n]);return e},Ke=(e,t)=>ti(e,ni(t));function ii(e,t){for(let n=e.length-1;n>=0;n--){const r=e[n];if(r.type===C.Meta&&r.timestamp<=t)return e.slice(n)}return e}function si(e,{getCastFn:t,applyEventsSynchronously:n,emitter:r}){const o=Fn({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]},REPLACE_EVENTS:{target:"playing",actions:["replaceEvents"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]},REPLACE_EVENTS:{target:"paused",actions:["replaceEvents"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:ye({lastPlayedEvent:(i,a)=>a.type==="CAST_EVENT"?a.payload.event:i.lastPlayedEvent}),recordTimeOffset:ye((i,a)=>{let l=i.timeOffset;return"payload"in a&&"timeOffset"in a.payload&&(l=a.payload.timeOffset),Ke(Ze({},i),{timeOffset:l,baselineTime:i.events[0].timestamp+l})}),play(i){var a;const{timer:l,events:c,baselineTime:s,lastPlayedEvent:u}=i;l.clear();for(const v of c)ft(v,s);const d=ii(c,s);let h=u?.timestamp;u?.type===C.IncrementalSnapshot&&u.data.source===x.MouseMove&&(h=u.timestamp+((a=u.data.positions[0])==null?void 0:a.timeOffset)),s<(h||0)&&r.emit(O.PlayBack);const m=new Array,p=new Array;for(const v of d)if(!(h&&h<s&&(v.timestamp<=h||v===u)))if(v.timestamp<s)m.push(v);else{const N=t(v,!1);p.push({doAction:()=>{N()},delay:v.delay})}n(m),r.emit(O.Flush),l.addActions(p),l.start()},pause(i){i.timer.clear()},resetLastPlayedEvent:ye(i=>Ke(Ze({},i),{lastPlayedEvent:null})),startLive:ye({baselineTime:(i,a)=>(i.timer.toggleLiveMode(!0),i.timer.start(),a.type==="TO_LIVE"&&a.payload.baselineTime?a.payload.baselineTime:Date.now())}),replaceEvents:ye((i,a)=>{const{events:l,timer:c,baselineTime:s}=i;if(a.type==="REPLACE_EVENTS"){const{events:u}=a.payload;l.length=0;const d=[];for(const h of u)if(ft(h,s),l.push(h),h.timestamp>=c.timeOffset+s){const m=t(h,!1);d.push({doAction:()=>{m()},delay:h.delay})}c.isActive()&&c.replaceActions(d)}return Ke(Ze({},i),{events:l})}),addEvent:ye((i,a)=>{const{baselineTime:l,timer:c,events:s}=i;if(a.type==="ADD_EVENT"){const{event:u}=a.payload;ft(u,l);let d=s.length-1;if(!s[d]||s[d].timestamp<=u.timestamp)s.push(u);else{let p=-1,v=0;for(;v<=d;){const N=Math.floor((v+d)/2);s[N].timestamp<=u.timestamp?v=N+1:d=N-1}p===-1&&(p=v),s.splice(p,0,u)}const h=u.timestamp<l,m=t(u,h);h?m():c.isActive()&&c.addAction({doAction:()=>{m()},delay:u.delay})}return Ke(Ze({},i),{events:s})})}});return Wn(o)}function ai(e){const t=Fn({id:"speed",context:e,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(n,r)=>{"payload"in r&&n.timer.setSpeed(r.payload.speed)},recordSpeed:ye({normalSpeed:n=>n.timer.speed}),restoreSpeed:n=>{n.timer.setSpeed(n.normalSpeed)}}});return Wn(t)}const li=e=>["noscript { display: none !important; }",`.${e} { background: currentColor; border-radius: 5px; }`,`.${e}:hover::after {content: 'Redacted'; color: white; background: black; text-align: center; width: 100%; display: block;}`];var ci=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{l(n.next(c))}catch(s){o(s)}},a=c=>{try{l(n.throw(c))}catch(s){o(s)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,a);l((n=n.apply(e,t)).next())});const Un=new Map;function Gn(e,t){let n=Un.get(e);return n||(n=new Map,Un.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}function he(e,t,n){return r=>ci(this,null,function*(){if(r&&typeof r=="object"&&"rr_type"in r)if(n&&(n.isUnchanged=!1),r.rr_type==="ImageBitmap"&&"args"in r){const o=yield he(e,t,n)(r.args);return yield createImageBitmap.apply(null,o)}else if("index"in r){if(n||t===null)return r;const{rr_type:o,index:i}=r;return Gn(t,o)[i]}else if("args"in r){const{rr_type:o,args:i}=r,a=window[o];return new a(...yield Promise.all(i.map(he(e,t,n))))}else{if("base64"in r)return io(r.base64);if("src"in r){const o=e.get(r.src);if(o)return o;{const i=new Image;return i.src=r.src,e.set(r.src,i),i}}else if("data"in r&&r.rr_type==="Blob"){const o=yield Promise.all(r.data.map(he(e,t,n)));return new Blob(o,{type:r.type})}}else if(Array.isArray(r))return yield Promise.all(r.map(he(e,t,n)));return r})}var ui=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{l(n.next(c))}catch(s){o(s)}},a=c=>{try{l(n.throw(c))}catch(s){o(s)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,a);l((n=n.apply(e,t)).next())});function di(e,t){try{return t===ue.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}const hi=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function mi(e,t){if(!(t!=null&&t.constructor))return;const{name:n}=t.constructor;if(!hi.includes(n))return;const r=Gn(e,n);r.includes(t)||r.push(t)}function pi(e){return ui(this,arguments,function*({mutation:t,target:n,type:r,imageMap:o,errorHandler:i}){try{const a=di(n,r);if(!a)return;if(t.setter){a[t.property]=t.args[0];return}const l=a[t.property],c=yield Promise.all(t.args.map(he(o,a))),s=l.apply(a,c);mi(a,s)}catch(a){i(t,a)}})}var fi=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{l(n.next(c))}catch(s){o(s)}},a=c=>{try{l(n.throw(c))}catch(s){o(s)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,a);l((n=n.apply(e,t)).next())});function vi(e){return fi(this,arguments,function*({event:t,mutation:n,target:r,imageMap:o,errorHandler:i}){try{const a=r.getContext("2d");if(n.setter){a[n.property]=n.args[0];return}const l=a[n.property];if(n.property==="drawImage"&&typeof n.args[0]=="string")o.get(t),l.apply(a,n.args);else{const c=yield Promise.all(n.args.map(he(o,a)));l.apply(a,c)}}catch(a){i(n,a)}})}var gi=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{l(n.next(c))}catch(s){o(s)}},a=c=>{try{l(n.throw(c))}catch(s){o(s)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,a);l((n=n.apply(e,t)).next())});function jn(e){return gi(this,arguments,function*({event:t,mutation:n,target:r,imageMap:o,canvasEventMap:i,errorHandler:a}){try{const l=i.get(t)||n,c="commands"in l?l.commands:[l];if([ue.WebGL,ue.WebGL2].includes(n.type)){for(let s=0;s<c.length;s++){const u=c[s];yield pi({mutation:u,type:n.type,target:r,imageMap:o,errorHandler:a})}return}for(let s=0;s<c.length;s++){const u=c[s];yield vi({event:t,mutation:u,target:r,imageMap:o,errorHandler:a})}}catch(l){a(n,l)}})}var yi=Object.defineProperty,bi=Object.defineProperties,Si=Object.getOwnPropertyDescriptors,Bn=Object.getOwnPropertySymbols,Ti=Object.prototype.hasOwnProperty,Ni=Object.prototype.propertyIsEnumerable,zn=(e,t,n)=>t in e?yi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Me=(e,t)=>{for(var n in t||(t={}))Ti.call(t,n)&&zn(e,n,t[n]);if(Bn)for(var n of Bn(t))Ni.call(t,n)&&zn(e,n,t[n]);return e},gt=(e,t)=>bi(e,Si(t)),yt=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{l(n.next(c))}catch(s){o(s)}},a=c=>{try{l(n.throw(c))}catch(s){o(s)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,a);l((n=n.apply(e,t)).next())});const Yn=10*1e3,Hn=2*1e3,Xn=1*1e3,Zn=60*60*1e3,Ei=kn||Qo,bt="[replayer]",St={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Tt(e){return e.type==C.IncrementalSnapshot&&(e.data.source==x.TouchMove||e.data.source==x.MouseInteraction&&e.data.type==X.TouchStart)}class wi{constructor(t,n){if(this.usingVirtualDom=!1,this.virtualDom=new Ce,this.mouseTail=null,this.tailPositions=[],this.emitter=Ei(),this.activityIntervals=[],this.legacy_missingNodeRetryMap={},this.cache=_t(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=Ct(),this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,this.handleResize=l=>{this.iframe.style.display="inherit";for(const c of[this.mouseTail,this.iframe])!c||(c.setAttribute("width",String(l.width)),c.setAttribute("height",String(l.height)))},this.applyEventsSynchronously=l=>{for(const c of l){switch(c.type){case C.DomContentLoaded:case C.Load:case C.Custom:continue;case C.FullSnapshot:case C.Meta:case C.Plugin:case C.IncrementalSnapshot:break}this.getCastFn(c,!0)()}this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null},this.getCastFn=(l,c=!1)=>{let s;switch(l.type){case C.DomContentLoaded:case C.Load:break;case C.Custom:s=()=>{this.emitter.emit(O.CustomEvent,l)};break;case C.Meta:s=()=>this.emitter.emit(O.Resize,{width:l.data.width,height:l.data.height});break;case C.FullSnapshot:s=()=>{if(this.firstFullSnapshot){if(this.firstFullSnapshot===l){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(l,c),this.iframe.contentWindow.scrollTo(l.data.initialOffset)};break;case C.IncrementalSnapshot:s=()=>{if(this.applyIncremental(l,c),!c&&(this.handleInactivity(l.timestamp),l===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const u of this.service.state.context.events)if(!(u.timestamp<=l.timestamp)&&this.isUserInteraction(u)){u.delay-l.delay>Yn*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=u);break}if(this.nextUserInteractionEvent){const u=this.nextUserInteractionEvent.delay-l.delay,d={speed:Math.min(Math.round(u/Hn),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:d}),this.emitter.emit(O.SkipStart,d)}}};break}return()=>{s&&s();for(const d of this.config.plugins||[])d.handler(l,c,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:l}});const u=this.service.state.context.events.length-1;if(l===this.service.state.context.events[u]){const d=()=>{u<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(O.Finish))};l.type===C.IncrementalSnapshot&&l.data.source===x.MouseMove&&l.data.positions.length?setTimeout(()=>{d()},Math.max(0,-l.data.positions[0].timeOffset+50)):d()}this.emitter.emit(O.EventCast,l)}},!(n!=null&&n.liveMode)&&t.length<2)throw new Error("Replayer need at least 2 events.");const r={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"highlight-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:St,useVirtualDom:!0,inactiveThreshold:.02,inactiveSkipTime:Hn};this.config=Object.assign({},r,n),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(O.Resize,this.handleResize),this.setupDom(),this.emitter.on(O.Flush,()=>{if(this.usingVirtualDom){const l={mirror:this.mirror,applyCanvas:(c,s,u)=>{jn({event:c,mutation:s,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this)};if(ae(this.iframe.contentDocument,this.virtualDom,l,this.virtualDom.mirror),this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const c in this.legacy_missingNodeRetryMap)try{const s=this.legacy_missingNodeRetryMap[c],u=pt(s.node,this.mirror,this.virtualDom.mirror);ae(u,s.node,l,this.virtualDom.mirror),s.node=u}catch(s){this.config.showWarning&&console.warn(s)}}this.mousePos&&this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null}),this.emitter.on(O.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset()});const o=new Jo([],n?.speed||r.speed);this.service=si({events:t.map(l=>n&&n.unpackFn?n.unpackFn(l):l).sort((l,c)=>l.timestamp-c.timestamp),timer:o,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(l=>{this.emitter.emit(O.StateChange,{player:l})}),this.speedService=ai({normalSpeed:-1,timer:o}),this.speedService.start(),this.speedService.subscribe(l=>{this.emitter.emit(O.StateChange,{speed:l})});const i=this.service.state.context.events.find(l=>l.type===C.Meta),a=this.service.state.context.events.find(l=>l.type===C.FullSnapshot);if(i){const{width:l,height:c}=i.data;setTimeout(()=>{this.emitter.emit(O.Resize,{width:l,height:c})},0)}a&&setTimeout(()=>{this.firstFullSnapshot||(this.firstFullSnapshot=a,this.rebuildFullSnapshot(a),this.iframe.contentWindow.scrollTo(a.data.initialOffset))},1),this.service.state.context.events.find(Tt)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(t,n){return this.emitter.on(t,n),this}off(t,n){return this.emitter.off(t,n),this}setConfig(t){Object.keys(t).forEach(n=>{t[n],this.config[n]=t[n]}),this.config.skipInactive||this.backToNormal(),typeof t.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:t.speed}}),typeof t.mouseTail<"u"&&(t.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getActivityIntervals(){if(this.activityIntervals.length==0){const t=[],n=this.getMetaData(),r=[{timestamp:n.startTime},...this.service.state.context.events.filter(a=>this.isUserInteraction(a)),{timestamp:n.endTime}];for(let a=1;a<r.length;a++){const l=r[a-1],c=r[a];c.timestamp-l.timestamp>Yn?t.push({startTime:l.timestamp,endTime:c.timestamp,duration:c.timestamp-l.timestamp,active:!1}):t.push({startTime:l.timestamp,endTime:c.timestamp,duration:c.timestamp-l.timestamp,active:!0})}const o=[];let i=t[0];for(let a=1;a<t.length;a++)t[a].active!=t[a-1].active&&(o.push({startTime:i.startTime,endTime:t[a-1].endTime,duration:t[a-1].endTime-i.startTime,active:t[a-1].active}),i=t[a]);i&&t.length>0&&o.push({startTime:i.startTime,endTime:t[t.length-1].endTime,duration:t[t.length-1].endTime-i.startTime,active:t[t.length-1].active}),i=o[0];for(let a=1;a<o.length;a++)(!o[a].active&&o[a].duration>this.config.inactiveThreshold*n.totalTime||!o[a-1].active&&o[a-1].duration>this.config.inactiveThreshold*n.totalTime)&&(this.activityIntervals.push({startTime:i.startTime,endTime:o[a-1].endTime,duration:o[a-1].endTime-i.startTime,active:o[a-1].active}),i=o[a]);i&&o.length>0&&this.activityIntervals.push({startTime:i.startTime,endTime:o[o.length-1].endTime,duration:o[o.length-1].endTime-i.startTime,active:o[o.length-1].active})}return this.activityIntervals}getMetaData(){const t=this.service.state.context.events[0],n=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:t.timestamp,endTime:n.timestamp,totalTime:n.timestamp-t.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:t,events:n}=this.service.state.context;return t-n[0].timestamp}getMirror(){return this.mirror}play(t=0){var n,r;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:t}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:t}})),(r=(n=this.iframe.contentDocument)==null?void 0:n.getElementsByTagName("html")[0])==null||r.classList.remove("rrweb-paused"),this.emitter.emit(O.Start),this.handleInactivity(this.getMetaData().startTime+t,!0)}pause(t){var n,r;t===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof t=="number"&&(this.play(t),this.service.send({type:"PAUSE"})),(r=(n=this.iframe.contentDocument)==null?void 0:n.getElementsByTagName("html")[0])==null||r.classList.add("rrweb-paused"),this.emitter.emit(O.Pause)}resume(t=0){console.warn("The 'resume' will be departed in 1.0. Please use 'play' method which has the same interface."),this.play(t),this.emitter.emit(O.Resume)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){const n=this.config.unpackFn?this.config.unpackFn(t):t;Tt(n)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:n}}))}replaceEvents(t){for(const n of t)if(Tt(n)){this.mouse.classList.add("touch-device");break}this.service.send({type:"REPLACE_EVENTS",payload:{events:t}})}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=_t()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");const t=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&t.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",t.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(qo(this.iframe.contentWindow,this.iframe.contentDocument),st(this.iframe.contentWindow))}handleInactivity(t,n){if((t===this.inactiveEndTimestamp||n)&&(this.inactiveEndTimestamp=null,this.backToNormal()),this.config.skipInactive&&!this.inactiveEndTimestamp){for(const r of this.getActivityIntervals())if(t>=r.startTime&&t<r.endTime&&!r.active){this.inactiveEndTimestamp=r.endTime;break}if(this.inactiveEndTimestamp){const r=this.inactiveEndTimestamp-t,o={speed:r/Zn*this.config.inactiveSkipTime<Xn?r/Xn:Math.round(Math.max(r,Zn)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:o}),this.emitter.emit(O.SkipStart,o)}}}rebuildFullSnapshot(t,n=!1){if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const r=[];Dr(t.data.node,{doc:this.iframe.contentDocument,afterAppend:a=>{this.collectIframeAndAttachDocument(r,a)},cache:this.cache,mirror:this.mirror});for(const{mutationInQueue:a,builtNode:l}of r)this.attachDocumentToIframe(a,l),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==a);const{documentElement:o,head:i}=this.iframe.contentDocument;this.insertStyleRules(o,i),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(O.FullsnapshotRebuilded,t),n||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,n){const r=li(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&r.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,xn(o,this.virtualDom.unserializedId)),t.insertBefore(o,n);for(let i=0;i<r.length;i++)o.rules.push({cssText:r[i],type:ie.Insert,index:i})}else{const o=document.createElement("style");t.insertBefore(o,n);for(let i=0;i<r.length;i++)o.sheet.insertRule(r[i],i)}}attachDocumentToIframe(t,n){const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,o=[];je(t.node,{doc:n.contentDocument,mirror:r,hackCss:!0,skipChild:!1,afterAppend:i=>{this.collectIframeAndAttachDocument(o,i);const a=r.getMeta(i);if(a?.type===k.Element&&a?.tagName.toUpperCase()==="HTML"){const{documentElement:l,head:c}=n.contentDocument;this.insertStyleRules(l,c)}},cache:this.cache});for(const{mutationInQueue:i,builtNode:a}of o)this.attachDocumentToIframe(i,a),this.newDocumentQueue=this.newDocumentQueue.filter(l=>l!==i)}collectIframeAndAttachDocument(t,n){if(Ne(n,this.mirror)){const r=this.newDocumentQueue.find(o=>o.parentId===this.mirror.getId(n));r&&t.push({mutationInQueue:r,builtNode:n})}}waitForStylesheetLoad(){var t;const n=(t=this.iframe.contentDocument)==null?void 0:t.head;if(n){const r=new Set;let o,i=this.service.state;const a=()=>{i=this.service.state};this.emitter.on(O.Start,a),this.emitter.on(O.Pause,a);const l=()=>{this.emitter.off(O.Start,a),this.emitter.off(O.Pause,a)};n.querySelectorAll('link[rel="stylesheet"]').forEach(c=>{c.sheet||(r.add(c),c.addEventListener("load",()=>{r.delete(c),r.size===0&&o!==-1&&(i.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(O.LoadStylesheetEnd),o&&clearTimeout(o),l())}))}),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(O.LoadStylesheetStart),o=setTimeout(()=>{i.matches("playing")&&this.play(this.getCurrentTime()),o=-1,l()},this.config.loadTimeout))}}preloadAllImages(){return yt(this,null,function*(){this.service.state;const t=()=>{this.service.state};this.emitter.on(O.Start,t),this.emitter.on(O.Pause,t);const n=[];for(const r of this.service.state.context.events)r.type===C.IncrementalSnapshot&&r.data.source===x.CanvasMutation&&(n.push(this.deserializeAndPreloadCanvasEvents(r.data,r)),("commands"in r.data?r.data.commands:[r.data]).forEach(o=>{this.preloadImages(o,r)}));return Promise.all(n)})}preloadImages(t,n){if(t.property==="drawImage"&&typeof t.args[0]=="string"&&!this.imageMap.has(n)){const r=document.createElement("canvas"),o=r.getContext("2d"),i=o?.createImageData(r.width,r.height);i?.data,JSON.parse(t.args[0]),o?.putImageData(i,0,0)}}deserializeAndPreloadCanvasEvents(t,n){return yt(this,null,function*(){if(!this.canvasEventMap.has(n)){const r={isUnchanged:!0};if("commands"in t){const o=yield Promise.all(t.commands.map(i=>yt(this,null,function*(){const a=yield Promise.all(i.args.map(he(this.imageMap,null,r)));return gt(Me({},i),{args:a})})));r.isUnchanged===!1&&this.canvasEventMap.set(n,gt(Me({},t),{commands:o}))}else{const o=yield Promise.all(t.args.map(he(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(n,gt(Me({},t),{args:o}))}}})}applyIncremental(t,n){var r,o,i,a,l,c;const{data:s}=t;switch(s.source){case x.Mutation:{try{this.applyMutation(s,n)}catch(u){this.warn(`Exception in mutation ${u.message||u}`,s)}break}case x.Drag:case x.TouchMove:case x.MouseMove:if(n){const u=s.positions[s.positions.length-1];this.mousePos={x:u.x,y:u.y,id:u.id,debugData:s}}else s.positions.forEach(u=>{const d={doAction:()=>{this.moveAndHover(u.x,u.y,u.id,n,s)},delay:u.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(d)}),this.timer.addAction({doAction(){},delay:t.delay-((r=s.positions[0])==null?void 0:r.timeOffset)});break;case x.MouseInteraction:{if(s.id===-1||n)break;const u=new Event(X[s.type].toLowerCase()),d=this.mirror.getNode(s.id);if(!d)return this.debugNodeNotFound(s,s.id);this.emitter.emit(O.MouseInteraction,{type:s.type,target:d});const{triggerFocus:h}=this.config;switch(s.type){case X.Blur:"blur"in d&&d.blur();break;case X.Focus:h&&d.focus&&d.focus({preventScroll:!0});break;case X.Click:case X.TouchStart:case X.TouchEnd:n?(s.type===X.TouchStart?this.touchActive=!0:s.type===X.TouchEnd&&(this.touchActive=!1),this.mousePos={x:s.x,y:s.y,id:s.id,debugData:s}):(s.type===X.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(s.x,s.y,s.id,n,s),s.type===X.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):s.type===X.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):s.type===X.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case X.TouchCancel:n?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:d.dispatchEvent(u)}break}case x.Scroll:{if(s.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);u.scrollData=s;break}this.applyScroll(s,n);break}case x.ViewportResize:this.emitter.emit(O.Resize,{width:s.width,height:s.height});break;case x.Input:{if(s.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);u.inputData=s;break}this.applyInput(s);break}case x.MediaInteraction:{const u=this.usingVirtualDom?this.virtualDom.mirror.getNode(s.id):this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u;try{s.currentTime&&(d.currentTime=s.currentTime),s.volume&&(d.volume=s.volume),s.muted&&(d.muted=s.muted),s.type===fe.Pause&&d.pause(),s.type===fe.Play&&d.play()}catch(h){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${h.message||h}`)}break}case x.StyleSheetRule:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.rules;(o=s.adds)==null||o.forEach(({rule:h,index:m})=>d?.push({cssText:h,index:m,type:ie.Insert})),(i=s.removes)==null||i.forEach(({index:h})=>d?.push({index:h,type:ie.Remove}))}else{const u=this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.sheet;(a=s.adds)==null||a.forEach(({rule:h,index:m})=>{try{if(Array.isArray(m)){const{positions:p,index:v}=ut(m);Ee(d.cssRules,p).insertRule(h,v)}else{const p=m===void 0?void 0:Math.min(m,d.cssRules.length);d.insertRule(h,p)}}catch{}}),(l=s.removes)==null||l.forEach(({index:h})=>{try{if(Array.isArray(h)){const{positions:m,index:p}=ut(h);Ee(d.cssRules,m).deleteRule(p||0)}else d?.deleteRule(h)}catch{}})}break}case x.StyleDeclaration:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.rules;s.set&&d.push(Me({type:ie.SetProperty,index:s.index},s.set)),s.remove&&d.push(Me({type:ie.RemoveProperty,index:s.index},s.remove))}else{const u=this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.sheet;s.set&&Ee(d.rules,s.index).style.setProperty(s.set.property,s.set.value,s.set.priority),s.remove&&Ee(d.rules,s.index).style.removeProperty(s.remove.property)}break}case x.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);u.canvasMutations.push({event:t,mutation:s})}else{const u=this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);jn({event:t,mutation:s,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case x.Font:{try{const u=new FontFace(s.family,s.buffer?new Uint8Array(JSON.parse(s.fontSource)):s.fontSource,s.descriptors);(c=this.iframe.contentDocument)==null||c.fonts.add(u)}catch(u){this.config.showWarning&&console.warn(u)}break}}}applyMutation(t,n){if(this.config.useVirtualDom&&!this.usingVirtualDom&&n&&(this.usingVirtualDom=!0,Xo(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const s in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[s],d=Mn(u.node,this.virtualDom,this.mirror);d&&(u.node=d)}catch(u){this.config.showWarning&&console.warn(u)}const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;t.removes.forEach(s=>{var u;const d=r.getNode(s.id);if(!d)return t.removes.find(m=>m.id===s.parentId)?void 0:this.warnNodeNotFound(t,s.id);let h=r.getNode(s.parentId);if(!h)return this.warnNodeNotFound(t,s.parentId);if(s.isShadow&&Ae(h)&&(h=h.shadowRoot),r.removeNodeFromMap(d),h)try{h.removeChild(d),this.usingVirtualDom&&d.nodeName==="#text"&&h.nodeName==="STYLE"&&((u=h.rules)==null?void 0:u.length)>0&&(h.rules=[])}catch(m){if(m instanceof DOMException)this.warn("parent could not remove child in mutation",h,d,t);else throw m}});const o=Me({},this.legacy_missingNodeRetryMap),i=[],a=s=>{let u=null;return s.nextId&&(u=r.getNode(s.nextId)),s.nextId!==null&&s.nextId!==void 0&&s.nextId!==-1&&!u},l=s=>{var u;if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");let d=r.getNode(s.parentId);if(!d)return s.node.type===k.Document?this.newDocumentQueue.push(s):i.push(s);s.node.isShadow&&(Ae(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let h=null,m=null;if(s.previousId&&(h=r.getNode(s.previousId)),s.nextId&&(m=r.getNode(s.nextId)),a(s))return i.push(s);if(s.node.rootId&&!r.getNode(s.node.rootId))return;const p=s.node.rootId?r.getNode(s.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Ne(d,r)){this.attachDocumentToIframe(s,d);return}const v=je(s.node,{doc:p,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache});if(s.previousId===-1||s.nextId===-1){o[s.node.id]={node:v,mutation:s};return}const N=r.getMeta(d);if(N&&N.type===k.Element&&N.tagName==="textarea"&&s.node.type===k.Text){const f=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);for(const b of f)b.nodeType===d.TEXT_NODE&&d.removeChild(b)}if(h&&h.nextSibling&&h.nextSibling.parentNode)d.insertBefore(v,h.nextSibling);else if(m&&m.parentNode)d.contains(m)?d.insertBefore(v,m):d.insertBefore(v,null);else{if(d===p)for(;p.firstChild;)p.removeChild(p.firstChild);d.appendChild(v)}if(this.usingVirtualDom&&v.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)==null?void 0:u.length)>0&&(d.rules=[]),Ne(v,this.mirror)){const f=this.mirror.getId(v),b=this.newDocumentQueue.find(S=>S.parentId===f);b&&(this.attachDocumentToIframe(b,v),this.newDocumentQueue=this.newDocumentQueue.filter(S=>S!==b))}(s.previousId||s.nextId)&&this.legacy_resolveMissingNode(o,d,v,s)};t.adds.forEach(s=>{l(s)});const c=Date.now();for(;i.length;){const s=Vt(i);if(i.length=0,Date.now()-c>500){this.warn("Timeout in the loop, please check the resolve tree data:",s);break}for(const u of s)r.getNode(u.value.parentId)?at(u,d=>{l(d)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(o).length&&Object.assign(this.legacy_missingNodeRetryMap,o),Ut(t.texts).forEach(s=>{var u;const d=r.getNode(s.id);if(!d)return t.removes.find(h=>h.id===s.id)?void 0:this.warnNodeNotFound(t,s.id);if(d.textContent=s.value,this.usingVirtualDom){const h=d.parentNode;((u=h?.rules)==null?void 0:u.length)>0&&(h.rules=[])}}),t.attributes.forEach(s=>{const u=r.getNode(s.id);if(!u)return t.removes.find(d=>d.id===s.id)?void 0:this.warnNodeNotFound(t,s.id);for(const d in s.attributes)if(typeof d=="string"){const h=s.attributes[d];if(h===null)u.removeAttribute(d);else if(typeof h=="string")try{u.setAttribute(d,h)}catch(m){this.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",m)}else if(d==="style"){const m=h,p=u;for(const v in m)if(m[v]===!1)p.style.removeProperty(v);else if(m[v]instanceof Array){const N=m[v];p.style.setProperty(v,N[0],N[1])}else{const N=m[v];p.style.setProperty(v,N)}}}})}applyScroll(t,n){const r=this.mirror.getNode(t.id);if(!r)return this.debugNodeNotFound(t,t.id);const o=this.mirror.getMeta(r);if(r===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:t.y,left:t.x,behavior:n?"auto":"smooth"});else if(o?.type===k.Document)r.defaultView.scrollTo({top:t.y,left:t.x,behavior:n?"auto":"smooth"});else try{r.scrollTop=t.y,r.scrollLeft=t.x}catch{}}applyInput(t){const n=this.mirror.getNode(t.id);if(!n)return this.debugNodeNotFound(t,t.id);try{n.checked=t.isChecked,n.value=t.text}catch{}}legacy_resolveMissingNode(t,n,r,o){const{previousId:i,nextId:a}=o,l=i&&t[i],c=a&&t[a];if(l){const{node:s,mutation:u}=l;n.insertBefore(s,r),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,n,s,u)}if(c){const{node:s,mutation:u}=c;n.insertBefore(s,r.nextSibling),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,n,s,u)}}moveAndHover(t,n,r,o,i){const a=this.mirror.getNode(r);if(!a)return this.debugNodeNotFound(i,r);const l=ct(a,this.iframe),c=t*l.absoluteScale+l.x,s=n*l.absoluteScale+l.y;this.mouse.style.left=`${c}px`,this.mouse.style.top=`${s}px`,o||this.drawMouseTail({x:c,y:s}),this.hoverElements(a)}drawMouseTail(t){if(!this.mouseTail)return;const{lineCap:n,lineWidth:r,strokeStyle:o,duration:i}=this.config.mouseTail===!0?St:Object.assign({},St,this.config.mouseTail),a=()=>{if(!this.mouseTail)return;const l=this.mouseTail.getContext("2d");!l||!this.tailPositions.length||(l.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),l.beginPath(),l.lineWidth=r,l.lineCap=n,l.strokeStyle=o,l.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(c=>l.lineTo(c.x,c.y)),l.stroke())};this.tailPositions.push(t),a(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(l=>l!==t),a()},i/this.speedService.state.context.timer.speed)}hoverElements(t){var n;(n=this.iframe.contentDocument)==null||n.querySelectorAll(".\\:hover").forEach(o=>{o.classList.remove(":hover")});let r=t;for(;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement}isUserInteraction(t){return t.type!==C.IncrementalSnapshot?!1:t.data.source>x.Mutation&&t.data.source<=x.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(O.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(t,n){this.warn(`Node with id '${n}' not found. `,t)}warnCanvasMutationFailed(t,n){this.warn("Has error on canvas update",n,"canvas mutation:",t)}debugNodeNotFound(t,n){this.debug(bt,`Node with id '${n}' not found. `,t)}warn(...t){!this.config.showWarning||console.warn(bt,...t)}debug(...t){!this.config.showDebug||console.log(bt,...t)}}const{addCustomEvent:Ci}=ge,{freezePage:Ii}=ge;return J.EventType=C,J.IncrementalSource=x,J.MouseInteractions=X,J.Replayer=wi,J.ReplayerEvents=O,J.addCustomEvent=Ci,J.freezePage=Ii,J.record=ge,J.utils=Rr,Object.defineProperty(J,"__esModule",{value:!0}),J}({});
18
+ ***************************************************************************** */function Dn(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(l){o={error:l}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}var Ie;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Ie||(Ie={}));var Rn={type:"xstate.init"};function gt(e){return e===void 0?[]:[].concat(e)}function ye(e){return{type:"xstate.assign",assignment:e}}function On(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 Xe(e){return function(t){return e===t}}function Ln(e){return typeof e=="string"?{type:e}:e}function An(e,t){return{value:e,context:t,actions:[],changed:!1,matches:Xe(e)}}function Pn(e,t,n){var r=t,o=!1;return[e.filter(function(i){if(i.type==="xstate.assign"){o=!0;var a=Object.assign({},r);return typeof i.assignment=="function"?a=i.assignment(r,n):Object.keys(i.assignment).forEach(function(l){a[l]=typeof i.assignment[l]=="function"?i.assignment[l](r,n):i.assignment[l]}),r=a,!1}return!0}),r,o]}function Fn(e,t){t===void 0&&(t={});var n=Dn(Pn(gt(e.states[e.initial].entry).map(function(a){return On(a,t.actions)}),e.context,Rn),2),r=n[0],o=n[1],i={config:e,_options:t,initialState:{value:e.initial,actions:r,context:o,matches:Xe(e.initial)},transition:function(a,l){var c,s,u=typeof a=="string"?{value:a,context:e.context}:a,d=u.value,h=u.context,m=Ln(l),p=e.states[d];if(p.on){var v=gt(p.on[m.type]);try{for(var N=function(F){var G=typeof Symbol=="function"&&Symbol.iterator,T=G&&F[G],g=0;if(T)return T.call(F);if(F&&typeof F.length=="number")return{next:function(){return F&&g>=F.length&&(F=void 0),{value:F&&F[g++],done:!F}}};throw new TypeError(G?"Object is not iterable.":"Symbol.iterator is not defined.")}(v),f=N.next();!f.done;f=N.next()){var b=f.value;if(b===void 0)return An(d,h);var S=typeof b=="string"?{target:b}:b,y=S.target,M=S.actions,R=M===void 0?[]:M,A=S.cond,P=A===void 0?function(){return!0}:A,L=y===void 0,B=y??d,$=e.states[B];if(P(h,m)){var Q=Dn(Pn((L?gt(R):[].concat(p.exit,R,$.entry).filter(function(F){return F})).map(function(F){return On(F,i._options.actions)}),h,m),3),Y=Q[0],j=Q[1],H=Q[2],Z=y??d;return{value:Z,context:j,actions:Y,changed:y!==d||Y.length>0||H,matches:Xe(Z)}}}}catch(F){c={error:F}}finally{try{f&&!f.done&&(s=N.return)&&s.call(N)}finally{if(c)throw c.error}}}return An(d,h)}};return i}var _n=function(e,t){return e.actions.forEach(function(n){var r=n.exec;return r&&r(e.context,t)})};function Wn(e){var t=e.initialState,n=Ie.NotStarted,r=new Set,o={_machine:e,send:function(i){n===Ie.Running&&(t=e.transition(t,i),_n(t,Ln(i)),r.forEach(function(a){return a(t)}))},subscribe:function(i){return r.add(i),i(t),{unsubscribe:function(){return r.delete(i)}}},start:function(i){if(i){var a=typeof i=="object"?i:{context:e.config.context,value:i};t={value:a.value,actions:[],context:a.context,matches:Xe(a.value)}}return n=Ie.Running,_n(t,Rn),o},stop:function(){return n=Ie.Stopped,r.clear(),o},get state(){return t},get status(){return n}};return o}var ei=Object.defineProperty,ti=Object.defineProperties,ni=Object.getOwnPropertyDescriptors,$n=Object.getOwnPropertySymbols,ri=Object.prototype.hasOwnProperty,oi=Object.prototype.propertyIsEnumerable,Vn=(e,t,n)=>t in e?ei(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ze=(e,t)=>{for(var n in t||(t={}))ri.call(t,n)&&Vn(e,n,t[n]);if($n)for(var n of $n(t))oi.call(t,n)&&Vn(e,n,t[n]);return e},Ke=(e,t)=>ti(e,ni(t));function ii(e,t){for(let n=e.length-1;n>=0;n--){const r=e[n];if(r.type===C.Meta&&r.timestamp<=t)return e.slice(n)}return e}function si(e,{getCastFn:t,applyEventsSynchronously:n,emitter:r}){const o=Fn({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]},REPLACE_EVENTS:{target:"playing",actions:["replaceEvents"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]},REPLACE_EVENTS:{target:"paused",actions:["replaceEvents"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:ye({lastPlayedEvent:(i,a)=>a.type==="CAST_EVENT"?a.payload.event:i.lastPlayedEvent}),recordTimeOffset:ye((i,a)=>{let l=i.timeOffset;return"payload"in a&&"timeOffset"in a.payload&&(l=a.payload.timeOffset),Ke(Ze({},i),{timeOffset:l,baselineTime:i.events[0].timestamp+l})}),play(i){var a;const{timer:l,events:c,baselineTime:s,lastPlayedEvent:u}=i;l.clear();for(const v of c)vt(v,s);const d=ii(c,s);let h=u?.timestamp;u?.type===C.IncrementalSnapshot&&u.data.source===x.MouseMove&&(h=u.timestamp+((a=u.data.positions[0])==null?void 0:a.timeOffset)),s<(h||0)&&r.emit(O.PlayBack);const m=new Array,p=new Array;for(const v of d)if(!(h&&h<s&&(v.timestamp<=h||v===u)))if(v.timestamp<s)m.push(v);else{const N=t(v,!1);p.push({doAction:()=>{N()},delay:v.delay})}n(m),r.emit(O.Flush),l.addActions(p),l.start()},pause(i){i.timer.clear()},resetLastPlayedEvent:ye(i=>Ke(Ze({},i),{lastPlayedEvent:null})),startLive:ye({baselineTime:(i,a)=>(i.timer.toggleLiveMode(!0),i.timer.start(),a.type==="TO_LIVE"&&a.payload.baselineTime?a.payload.baselineTime:Date.now())}),replaceEvents:ye((i,a)=>{const{events:l,timer:c,baselineTime:s}=i;if(a.type==="REPLACE_EVENTS"){const{events:u}=a.payload;l.length=0;const d=[];for(const h of u)if(vt(h,s),l.push(h),h.timestamp>=c.timeOffset+s){const m=t(h,!1);d.push({doAction:()=>{m()},delay:h.delay})}c.isActive()&&c.replaceActions(d)}return Ke(Ze({},i),{events:l})}),addEvent:ye((i,a)=>{const{baselineTime:l,timer:c,events:s}=i;if(a.type==="ADD_EVENT"){const{event:u}=a.payload;vt(u,l);let d=s.length-1;if(!s[d]||s[d].timestamp<=u.timestamp)s.push(u);else{let p=-1,v=0;for(;v<=d;){const N=Math.floor((v+d)/2);s[N].timestamp<=u.timestamp?v=N+1:d=N-1}p===-1&&(p=v),s.splice(p,0,u)}const h=u.timestamp<l,m=t(u,h);h?m():c.isActive()&&c.addAction({doAction:()=>{m()},delay:u.delay})}return Ke(Ze({},i),{events:s})})}});return Wn(o)}function ai(e){const t=Fn({id:"speed",context:e,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(n,r)=>{"payload"in r&&n.timer.setSpeed(r.payload.speed)},recordSpeed:ye({normalSpeed:n=>n.timer.speed}),restoreSpeed:n=>{n.timer.setSpeed(n.normalSpeed)}}});return Wn(t)}const li=e=>["noscript { display: none !important; }",`.${e} { background: currentColor; border-radius: 5px; }`,`.${e}:hover::after {content: 'Redacted'; color: white; background: black; text-align: center; width: 100%; display: block;}`];var ci=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{l(n.next(c))}catch(s){o(s)}},a=c=>{try{l(n.throw(c))}catch(s){o(s)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,a);l((n=n.apply(e,t)).next())});const Un=new Map;function Gn(e,t){let n=Un.get(e);return n||(n=new Map,Un.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}function he(e,t,n){return r=>ci(this,null,function*(){if(r&&typeof r=="object"&&"rr_type"in r)if(n&&(n.isUnchanged=!1),r.rr_type==="ImageBitmap"&&"args"in r){const o=yield he(e,t,n)(r.args);return yield createImageBitmap.apply(null,o)}else if("index"in r){if(n||t===null)return r;const{rr_type:o,index:i}=r;return Gn(t,o)[i]}else if("args"in r){const{rr_type:o,args:i}=r,a=window[o];return new a(...yield Promise.all(i.map(he(e,t,n))))}else{if("base64"in r)return io(r.base64);if("src"in r){const o=e.get(r.src);if(o)return o;{const i=new Image;return i.src=r.src,e.set(r.src,i),i}}else if("data"in r&&r.rr_type==="Blob"){const o=yield Promise.all(r.data.map(he(e,t,n)));return new Blob(o,{type:r.type})}}else if(Array.isArray(r))return yield Promise.all(r.map(he(e,t,n)));return r})}var ui=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{l(n.next(c))}catch(s){o(s)}},a=c=>{try{l(n.throw(c))}catch(s){o(s)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,a);l((n=n.apply(e,t)).next())});function di(e,t){try{return t===ue.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}const hi=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function mi(e,t){if(!(t!=null&&t.constructor))return;const{name:n}=t.constructor;if(!hi.includes(n))return;const r=Gn(e,n);r.includes(t)||r.push(t)}function pi(e){return ui(this,arguments,function*({mutation:t,target:n,type:r,imageMap:o,errorHandler:i}){try{const a=di(n,r);if(!a)return;if(t.setter){a[t.property]=t.args[0];return}const l=a[t.property],c=yield Promise.all(t.args.map(he(o,a))),s=l.apply(a,c);mi(a,s)}catch(a){i(t,a)}})}var fi=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{l(n.next(c))}catch(s){o(s)}},a=c=>{try{l(n.throw(c))}catch(s){o(s)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,a);l((n=n.apply(e,t)).next())});function vi(e){return fi(this,arguments,function*({event:t,mutation:n,target:r,imageMap:o,errorHandler:i}){try{const a=r.getContext("2d");if(n.setter){a[n.property]=n.args[0];return}const l=a[n.property];if(n.property==="drawImage"&&typeof n.args[0]=="string")o.get(t),l.apply(a,n.args);else{const c=yield Promise.all(n.args.map(he(o,a)));l.apply(a,c)}}catch(a){i(n,a)}})}var gi=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{l(n.next(c))}catch(s){o(s)}},a=c=>{try{l(n.throw(c))}catch(s){o(s)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,a);l((n=n.apply(e,t)).next())});function jn(e){return gi(this,arguments,function*({event:t,mutation:n,target:r,imageMap:o,canvasEventMap:i,errorHandler:a}){try{const l=i.get(t)||n,c="commands"in l?l.commands:[l];if([ue.WebGL,ue.WebGL2].includes(n.type)){for(let s=0;s<c.length;s++){const u=c[s];yield pi({mutation:u,type:n.type,target:r,imageMap:o,errorHandler:a})}return}for(let s=0;s<c.length;s++){const u=c[s];yield vi({event:t,mutation:u,target:r,imageMap:o,errorHandler:a})}}catch(l){a(n,l)}})}var yi=Object.defineProperty,bi=Object.defineProperties,Si=Object.getOwnPropertyDescriptors,Bn=Object.getOwnPropertySymbols,Ti=Object.prototype.hasOwnProperty,Ni=Object.prototype.propertyIsEnumerable,zn=(e,t,n)=>t in e?yi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Me=(e,t)=>{for(var n in t||(t={}))Ti.call(t,n)&&zn(e,n,t[n]);if(Bn)for(var n of Bn(t))Ni.call(t,n)&&zn(e,n,t[n]);return e},yt=(e,t)=>bi(e,Si(t)),bt=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{l(n.next(c))}catch(s){o(s)}},a=c=>{try{l(n.throw(c))}catch(s){o(s)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,a);l((n=n.apply(e,t)).next())});const Yn=10*1e3,Hn=2*1e3,Xn=1*1e3,Zn=60*60*1e3,Ei=kn||Qo,St="[replayer]",Tt={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Nt(e){return e.type==C.IncrementalSnapshot&&(e.data.source==x.TouchMove||e.data.source==x.MouseInteraction&&e.data.type==X.TouchStart)}class wi{constructor(t,n){if(this.usingVirtualDom=!1,this.virtualDom=new Ce,this.mouseTail=null,this.tailPositions=[],this.emitter=Ei(),this.activityIntervals=[],this.legacy_missingNodeRetryMap={},this.cache=_t(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=It(),this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,this.handleResize=l=>{this.iframe.style.display="inherit";for(const c of[this.mouseTail,this.iframe])!c||(c.setAttribute("width",String(l.width)),c.setAttribute("height",String(l.height)))},this.applyEventsSynchronously=l=>{for(const c of l){switch(c.type){case C.DomContentLoaded:case C.Load:case C.Custom:continue;case C.FullSnapshot:case C.Meta:case C.Plugin:case C.IncrementalSnapshot:break}this.getCastFn(c,!0)()}this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null},this.getCastFn=(l,c=!1)=>{let s;switch(l.type){case C.DomContentLoaded:case C.Load:break;case C.Custom:s=()=>{this.emitter.emit(O.CustomEvent,l)};break;case C.Meta:s=()=>this.emitter.emit(O.Resize,{width:l.data.width,height:l.data.height});break;case C.FullSnapshot:s=()=>{if(this.firstFullSnapshot){if(this.firstFullSnapshot===l){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(l,c),this.iframe.contentWindow.scrollTo(l.data.initialOffset)};break;case C.IncrementalSnapshot:s=()=>{if(this.applyIncremental(l,c),!c&&(this.handleInactivity(l.timestamp),l===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const u of this.service.state.context.events)if(!(u.timestamp<=l.timestamp)&&this.isUserInteraction(u)){u.delay-l.delay>Yn*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=u);break}if(this.nextUserInteractionEvent){const u=this.nextUserInteractionEvent.delay-l.delay,d={speed:Math.min(Math.round(u/Hn),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:d}),this.emitter.emit(O.SkipStart,d)}}};break}return()=>{s&&s();for(const d of this.config.plugins||[])d.handler(l,c,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:l}});const u=this.service.state.context.events.length-1;if(l===this.service.state.context.events[u]){const d=()=>{u<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(O.Finish))};l.type===C.IncrementalSnapshot&&l.data.source===x.MouseMove&&l.data.positions.length?setTimeout(()=>{d()},Math.max(0,-l.data.positions[0].timeOffset+50)):d()}this.emitter.emit(O.EventCast,l)}},!(n!=null&&n.liveMode)&&t.length<2)throw new Error("Replayer need at least 2 events.");const r={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"highlight-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:Tt,useVirtualDom:!0,inactiveThreshold:.02,inactiveSkipTime:Hn};this.config=Object.assign({},r,n),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(O.Resize,this.handleResize),this.setupDom(),this.emitter.on(O.Flush,()=>{if(this.usingVirtualDom){const l={mirror:this.mirror,applyCanvas:(c,s,u)=>{jn({event:c,mutation:s,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this)};if(ae(this.iframe.contentDocument,this.virtualDom,l,this.virtualDom.mirror),this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const c in this.legacy_missingNodeRetryMap)try{const s=this.legacy_missingNodeRetryMap[c],u=ft(s.node,this.mirror,this.virtualDom.mirror);ae(u,s.node,l,this.virtualDom.mirror),s.node=u}catch(s){this.config.showWarning&&console.warn(s)}}this.mousePos&&this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null}),this.emitter.on(O.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset()});const o=new Jo([],n?.speed||r.speed);this.service=si({events:t.map(l=>n&&n.unpackFn?n.unpackFn(l):l).sort((l,c)=>l.timestamp-c.timestamp),timer:o,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(l=>{this.emitter.emit(O.StateChange,{player:l})}),this.speedService=ai({normalSpeed:-1,timer:o}),this.speedService.start(),this.speedService.subscribe(l=>{this.emitter.emit(O.StateChange,{speed:l})});const i=this.service.state.context.events.find(l=>l.type===C.Meta),a=this.service.state.context.events.find(l=>l.type===C.FullSnapshot);if(i){const{width:l,height:c}=i.data;setTimeout(()=>{this.emitter.emit(O.Resize,{width:l,height:c})},0)}a&&setTimeout(()=>{this.firstFullSnapshot||(this.firstFullSnapshot=a,this.rebuildFullSnapshot(a),this.iframe.contentWindow.scrollTo(a.data.initialOffset))},1),this.service.state.context.events.find(Nt)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(t,n){return this.emitter.on(t,n),this}off(t,n){return this.emitter.off(t,n),this}setConfig(t){Object.keys(t).forEach(n=>{t[n],this.config[n]=t[n]}),this.config.skipInactive||this.backToNormal(),typeof t.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:t.speed}}),typeof t.mouseTail<"u"&&(t.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getActivityIntervals(){if(this.activityIntervals.length==0){const t=[],n=this.getMetaData(),r=[{timestamp:n.startTime},...this.service.state.context.events.filter(a=>this.isUserInteraction(a)),{timestamp:n.endTime}];for(let a=1;a<r.length;a++){const l=r[a-1],c=r[a];c.timestamp-l.timestamp>Yn?t.push({startTime:l.timestamp,endTime:c.timestamp,duration:c.timestamp-l.timestamp,active:!1}):t.push({startTime:l.timestamp,endTime:c.timestamp,duration:c.timestamp-l.timestamp,active:!0})}const o=[];let i=t[0];for(let a=1;a<t.length;a++)t[a].active!=t[a-1].active&&(o.push({startTime:i.startTime,endTime:t[a-1].endTime,duration:t[a-1].endTime-i.startTime,active:t[a-1].active}),i=t[a]);i&&t.length>0&&o.push({startTime:i.startTime,endTime:t[t.length-1].endTime,duration:t[t.length-1].endTime-i.startTime,active:t[t.length-1].active}),i=o[0];for(let a=1;a<o.length;a++)(!o[a].active&&o[a].duration>this.config.inactiveThreshold*n.totalTime||!o[a-1].active&&o[a-1].duration>this.config.inactiveThreshold*n.totalTime)&&(this.activityIntervals.push({startTime:i.startTime,endTime:o[a-1].endTime,duration:o[a-1].endTime-i.startTime,active:o[a-1].active}),i=o[a]);i&&o.length>0&&this.activityIntervals.push({startTime:i.startTime,endTime:o[o.length-1].endTime,duration:o[o.length-1].endTime-i.startTime,active:o[o.length-1].active})}return this.activityIntervals}getMetaData(){const t=this.service.state.context.events[0],n=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:t.timestamp,endTime:n.timestamp,totalTime:n.timestamp-t.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:t,events:n}=this.service.state.context;return t-n[0].timestamp}getMirror(){return this.mirror}play(t=0){var n,r;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:t}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:t}})),(r=(n=this.iframe.contentDocument)==null?void 0:n.getElementsByTagName("html")[0])==null||r.classList.remove("rrweb-paused"),this.emitter.emit(O.Start),this.handleInactivity(this.getMetaData().startTime+t,!0)}pause(t){var n,r;t===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof t=="number"&&(this.play(t),this.service.send({type:"PAUSE"})),(r=(n=this.iframe.contentDocument)==null?void 0:n.getElementsByTagName("html")[0])==null||r.classList.add("rrweb-paused"),this.emitter.emit(O.Pause)}resume(t=0){console.warn("The 'resume' will be departed in 1.0. Please use 'play' method which has the same interface."),this.play(t),this.emitter.emit(O.Resume)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){const n=this.config.unpackFn?this.config.unpackFn(t):t;Nt(n)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:n}}))}replaceEvents(t){for(const n of t)if(Nt(n)){this.mouse.classList.add("touch-device");break}this.service.send({type:"REPLACE_EVENTS",payload:{events:t}})}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=_t()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");const t=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&t.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",t.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(qo(this.iframe.contentWindow,this.iframe.contentDocument),at(this.iframe.contentWindow))}handleInactivity(t,n){if((t===this.inactiveEndTimestamp||n)&&(this.inactiveEndTimestamp=null,this.backToNormal()),this.config.skipInactive&&!this.inactiveEndTimestamp){for(const r of this.getActivityIntervals())if(t>=r.startTime&&t<r.endTime&&!r.active){this.inactiveEndTimestamp=r.endTime;break}if(this.inactiveEndTimestamp){const r=this.inactiveEndTimestamp-t,o={speed:r/Zn*this.config.inactiveSkipTime<Xn?r/Xn:Math.round(Math.max(r,Zn)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:o}),this.emitter.emit(O.SkipStart,o)}}}rebuildFullSnapshot(t,n=!1){if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const r=[];Dr(t.data.node,{doc:this.iframe.contentDocument,afterAppend:a=>{this.collectIframeAndAttachDocument(r,a)},cache:this.cache,mirror:this.mirror});for(const{mutationInQueue:a,builtNode:l}of r)this.attachDocumentToIframe(a,l),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==a);const{documentElement:o,head:i}=this.iframe.contentDocument;this.insertStyleRules(o,i),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(O.FullsnapshotRebuilded,t),n||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,n){const r=li(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&r.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,xn(o,this.virtualDom.unserializedId)),t.insertBefore(o,n);for(let i=0;i<r.length;i++)o.rules.push({cssText:r[i],type:ie.Insert,index:i})}else{const o=document.createElement("style");t.insertBefore(o,n);for(let i=0;i<r.length;i++)o.sheet.insertRule(r[i],i)}}attachDocumentToIframe(t,n){const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,o=[];je(t.node,{doc:n.contentDocument,mirror:r,hackCss:!0,skipChild:!1,afterAppend:i=>{this.collectIframeAndAttachDocument(o,i);const a=r.getMeta(i);if(a?.type===k.Element&&a?.tagName.toUpperCase()==="HTML"){const{documentElement:l,head:c}=n.contentDocument;this.insertStyleRules(l,c)}},cache:this.cache});for(const{mutationInQueue:i,builtNode:a}of o)this.attachDocumentToIframe(i,a),this.newDocumentQueue=this.newDocumentQueue.filter(l=>l!==i)}collectIframeAndAttachDocument(t,n){if(Ne(n,this.mirror)){const r=this.newDocumentQueue.find(o=>o.parentId===this.mirror.getId(n));r&&t.push({mutationInQueue:r,builtNode:n})}}waitForStylesheetLoad(){var t;const n=(t=this.iframe.contentDocument)==null?void 0:t.head;if(n){const r=new Set;let o,i=this.service.state;const a=()=>{i=this.service.state};this.emitter.on(O.Start,a),this.emitter.on(O.Pause,a);const l=()=>{this.emitter.off(O.Start,a),this.emitter.off(O.Pause,a)};n.querySelectorAll('link[rel="stylesheet"]').forEach(c=>{c.sheet||(r.add(c),c.addEventListener("load",()=>{r.delete(c),r.size===0&&o!==-1&&(i.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(O.LoadStylesheetEnd),o&&clearTimeout(o),l())}))}),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(O.LoadStylesheetStart),o=setTimeout(()=>{i.matches("playing")&&this.play(this.getCurrentTime()),o=-1,l()},this.config.loadTimeout))}}preloadAllImages(){return bt(this,null,function*(){this.service.state;const t=()=>{this.service.state};this.emitter.on(O.Start,t),this.emitter.on(O.Pause,t);const n=[];for(const r of this.service.state.context.events)r.type===C.IncrementalSnapshot&&r.data.source===x.CanvasMutation&&(n.push(this.deserializeAndPreloadCanvasEvents(r.data,r)),("commands"in r.data?r.data.commands:[r.data]).forEach(o=>{this.preloadImages(o,r)}));return Promise.all(n)})}preloadImages(t,n){if(t.property==="drawImage"&&typeof t.args[0]=="string"&&!this.imageMap.has(n)){const r=document.createElement("canvas"),o=r.getContext("2d"),i=o?.createImageData(r.width,r.height);i?.data,JSON.parse(t.args[0]),o?.putImageData(i,0,0)}}deserializeAndPreloadCanvasEvents(t,n){return bt(this,null,function*(){if(!this.canvasEventMap.has(n)){const r={isUnchanged:!0};if("commands"in t){const o=yield Promise.all(t.commands.map(i=>bt(this,null,function*(){const a=yield Promise.all(i.args.map(he(this.imageMap,null,r)));return yt(Me({},i),{args:a})})));r.isUnchanged===!1&&this.canvasEventMap.set(n,yt(Me({},t),{commands:o}))}else{const o=yield Promise.all(t.args.map(he(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(n,yt(Me({},t),{args:o}))}}})}applyIncremental(t,n){var r,o,i,a,l,c;const{data:s}=t;switch(s.source){case x.Mutation:{try{this.applyMutation(s,n)}catch(u){this.warn(`Exception in mutation ${u.message||u}`,s)}break}case x.Drag:case x.TouchMove:case x.MouseMove:if(n){const u=s.positions[s.positions.length-1];this.mousePos={x:u.x,y:u.y,id:u.id,debugData:s}}else s.positions.forEach(u=>{const d={doAction:()=>{this.moveAndHover(u.x,u.y,u.id,n,s)},delay:u.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(d)}),this.timer.addAction({doAction(){},delay:t.delay-((r=s.positions[0])==null?void 0:r.timeOffset)});break;case x.MouseInteraction:{if(s.id===-1||n)break;const u=new Event(X[s.type].toLowerCase()),d=this.mirror.getNode(s.id);if(!d)return this.debugNodeNotFound(s,s.id);this.emitter.emit(O.MouseInteraction,{type:s.type,target:d});const{triggerFocus:h}=this.config;switch(s.type){case X.Blur:"blur"in d&&d.blur();break;case X.Focus:h&&d.focus&&d.focus({preventScroll:!0});break;case X.Click:case X.TouchStart:case X.TouchEnd:n?(s.type===X.TouchStart?this.touchActive=!0:s.type===X.TouchEnd&&(this.touchActive=!1),this.mousePos={x:s.x,y:s.y,id:s.id,debugData:s}):(s.type===X.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(s.x,s.y,s.id,n,s),s.type===X.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):s.type===X.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):s.type===X.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case X.TouchCancel:n?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:d.dispatchEvent(u)}break}case x.Scroll:{if(s.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);u.scrollData=s;break}this.applyScroll(s,n);break}case x.ViewportResize:this.emitter.emit(O.Resize,{width:s.width,height:s.height});break;case x.Input:{if(s.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);u.inputData=s;break}this.applyInput(s);break}case x.MediaInteraction:{const u=this.usingVirtualDom?this.virtualDom.mirror.getNode(s.id):this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u;try{s.currentTime&&(d.currentTime=s.currentTime),s.volume&&(d.volume=s.volume),s.muted&&(d.muted=s.muted),s.type===fe.Pause&&d.pause(),s.type===fe.Play&&d.play()}catch(h){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${h.message||h}`)}break}case x.StyleSheetRule:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.rules;(o=s.adds)==null||o.forEach(({rule:h,index:m})=>d?.push({cssText:h,index:m,type:ie.Insert})),(i=s.removes)==null||i.forEach(({index:h})=>d?.push({index:h,type:ie.Remove}))}else{const u=this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.sheet;(a=s.adds)==null||a.forEach(({rule:h,index:m})=>{try{if(Array.isArray(m)){const{positions:p,index:v}=dt(m);Ee(d.cssRules,p).insertRule(h,v)}else{const p=m===void 0?void 0:Math.min(m,d.cssRules.length);d.insertRule(h,p)}}catch{}}),(l=s.removes)==null||l.forEach(({index:h})=>{try{if(Array.isArray(h)){const{positions:m,index:p}=dt(h);Ee(d.cssRules,m).deleteRule(p||0)}else d?.deleteRule(h)}catch{}})}break}case x.StyleDeclaration:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.rules;s.set&&d.push(Me({type:ie.SetProperty,index:s.index},s.set)),s.remove&&d.push(Me({type:ie.RemoveProperty,index:s.index},s.remove))}else{const u=this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.sheet;s.set&&Ee(d.rules,s.index).style.setProperty(s.set.property,s.set.value,s.set.priority),s.remove&&Ee(d.rules,s.index).style.removeProperty(s.remove.property)}break}case x.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);u.canvasMutations.push({event:t,mutation:s})}else{const u=this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);jn({event:t,mutation:s,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case x.Font:{try{const u=new FontFace(s.family,s.buffer?new Uint8Array(JSON.parse(s.fontSource)):s.fontSource,s.descriptors);(c=this.iframe.contentDocument)==null||c.fonts.add(u)}catch(u){this.config.showWarning&&console.warn(u)}break}}}applyMutation(t,n){if(this.config.useVirtualDom&&!this.usingVirtualDom&&n&&(this.usingVirtualDom=!0,Xo(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const s in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[s],d=Mn(u.node,this.virtualDom,this.mirror);d&&(u.node=d)}catch(u){this.config.showWarning&&console.warn(u)}const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;t.removes.forEach(s=>{var u;const d=r.getNode(s.id);if(!d)return t.removes.find(m=>m.id===s.parentId)?void 0:this.warnNodeNotFound(t,s.id);let h=r.getNode(s.parentId);if(!h)return this.warnNodeNotFound(t,s.parentId);if(s.isShadow&&Ae(h)&&(h=h.shadowRoot),r.removeNodeFromMap(d),h)try{h.removeChild(d),this.usingVirtualDom&&d.nodeName==="#text"&&h.nodeName==="STYLE"&&((u=h.rules)==null?void 0:u.length)>0&&(h.rules=[])}catch(m){if(m instanceof DOMException)this.warn("parent could not remove child in mutation",h,d,t);else throw m}});const o=Me({},this.legacy_missingNodeRetryMap),i=[],a=s=>{let u=null;return s.nextId&&(u=r.getNode(s.nextId)),s.nextId!==null&&s.nextId!==void 0&&s.nextId!==-1&&!u},l=s=>{var u;if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");let d=r.getNode(s.parentId);if(!d)return s.node.type===k.Document?this.newDocumentQueue.push(s):i.push(s);s.node.isShadow&&(Ae(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let h=null,m=null;if(s.previousId&&(h=r.getNode(s.previousId)),s.nextId&&(m=r.getNode(s.nextId)),a(s))return i.push(s);if(s.node.rootId&&!r.getNode(s.node.rootId))return;const p=s.node.rootId?r.getNode(s.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Ne(d,r)){this.attachDocumentToIframe(s,d);return}const v=je(s.node,{doc:p,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache});if(s.previousId===-1||s.nextId===-1){o[s.node.id]={node:v,mutation:s};return}const N=r.getMeta(d);if(N&&N.type===k.Element&&N.tagName==="textarea"&&s.node.type===k.Text){const f=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);for(const b of f)b.nodeType===d.TEXT_NODE&&d.removeChild(b)}if(h&&h.nextSibling&&h.nextSibling.parentNode)d.insertBefore(v,h.nextSibling);else if(m&&m.parentNode)d.contains(m)?d.insertBefore(v,m):d.insertBefore(v,null);else{if(d===p)for(;p.firstChild;)p.removeChild(p.firstChild);d.appendChild(v)}if(this.usingVirtualDom&&v.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)==null?void 0:u.length)>0&&(d.rules=[]),Ne(v,this.mirror)){const f=this.mirror.getId(v),b=this.newDocumentQueue.find(S=>S.parentId===f);b&&(this.attachDocumentToIframe(b,v),this.newDocumentQueue=this.newDocumentQueue.filter(S=>S!==b))}(s.previousId||s.nextId)&&this.legacy_resolveMissingNode(o,d,v,s)};t.adds.forEach(s=>{l(s)});const c=Date.now();for(;i.length;){const s=Vt(i);if(i.length=0,Date.now()-c>500){this.warn("Timeout in the loop, please check the resolve tree data:",s);break}for(const u of s)r.getNode(u.value.parentId)?lt(u,d=>{l(d)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(o).length&&Object.assign(this.legacy_missingNodeRetryMap,o),Ut(t.texts).forEach(s=>{var u;const d=r.getNode(s.id);if(!d)return t.removes.find(h=>h.id===s.id)?void 0:this.warnNodeNotFound(t,s.id);if(d.textContent=s.value,this.usingVirtualDom){const h=d.parentNode;((u=h?.rules)==null?void 0:u.length)>0&&(h.rules=[])}}),t.attributes.forEach(s=>{const u=r.getNode(s.id);if(!u)return t.removes.find(d=>d.id===s.id)?void 0:this.warnNodeNotFound(t,s.id);for(const d in s.attributes)if(typeof d=="string"){const h=s.attributes[d];if(h===null)u.removeAttribute(d);else if(typeof h=="string")try{u.setAttribute(d,h)}catch(m){this.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",m)}else if(d==="style"){const m=h,p=u;for(const v in m)if(m[v]===!1)p.style.removeProperty(v);else if(m[v]instanceof Array){const N=m[v];p.style.setProperty(v,N[0],N[1])}else{const N=m[v];p.style.setProperty(v,N)}}}})}applyScroll(t,n){const r=this.mirror.getNode(t.id);if(!r)return this.debugNodeNotFound(t,t.id);const o=this.mirror.getMeta(r);if(r===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:t.y,left:t.x,behavior:n?"auto":"smooth"});else if(o?.type===k.Document)r.defaultView.scrollTo({top:t.y,left:t.x,behavior:n?"auto":"smooth"});else try{r.scrollTop=t.y,r.scrollLeft=t.x}catch{}}applyInput(t){const n=this.mirror.getNode(t.id);if(!n)return this.debugNodeNotFound(t,t.id);try{n.checked=t.isChecked,n.value=t.text}catch{}}legacy_resolveMissingNode(t,n,r,o){const{previousId:i,nextId:a}=o,l=i&&t[i],c=a&&t[a];if(l){const{node:s,mutation:u}=l;n.insertBefore(s,r),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,n,s,u)}if(c){const{node:s,mutation:u}=c;n.insertBefore(s,r.nextSibling),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,n,s,u)}}moveAndHover(t,n,r,o,i){const a=this.mirror.getNode(r);if(!a)return this.debugNodeNotFound(i,r);const l=ut(a,this.iframe),c=t*l.absoluteScale+l.x,s=n*l.absoluteScale+l.y;this.mouse.style.left=`${c}px`,this.mouse.style.top=`${s}px`,o||this.drawMouseTail({x:c,y:s}),this.hoverElements(a)}drawMouseTail(t){if(!this.mouseTail)return;const{lineCap:n,lineWidth:r,strokeStyle:o,duration:i}=this.config.mouseTail===!0?Tt:Object.assign({},Tt,this.config.mouseTail),a=()=>{if(!this.mouseTail)return;const l=this.mouseTail.getContext("2d");!l||!this.tailPositions.length||(l.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),l.beginPath(),l.lineWidth=r,l.lineCap=n,l.strokeStyle=o,l.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(c=>l.lineTo(c.x,c.y)),l.stroke())};this.tailPositions.push(t),a(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(l=>l!==t),a()},i/this.speedService.state.context.timer.speed)}hoverElements(t){var n;(n=this.iframe.contentDocument)==null||n.querySelectorAll(".\\:hover").forEach(o=>{o.classList.remove(":hover")});let r=t;for(;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement}isUserInteraction(t){return t.type!==C.IncrementalSnapshot?!1:t.data.source>x.Mutation&&t.data.source<=x.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(O.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(t,n){this.warn(`Node with id '${n}' not found. `,t)}warnCanvasMutationFailed(t,n){this.warn("Has error on canvas update",n,"canvas mutation:",t)}debugNodeNotFound(t,n){this.debug(St,`Node with id '${n}' not found. `,t)}warn(...t){!this.config.showWarning||console.warn(St,...t)}debug(...t){!this.config.showDebug||console.log(St,...t)}}const{addCustomEvent:Ci}=ge,{freezePage:Ii}=ge;return J.EventType=C,J.IncrementalSource=x,J.MouseInteractions=X,J.Replayer=wi,J.ReplayerEvents=O,J.addCustomEvent=Ci,J.freezePage=Ii,J.record=ge,J.utils=Rr,Object.defineProperty(J,"__esModule",{value:!0}),J}({});