@highlight-run/rrweb 2.0.6 → 2.0.7

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 (33) hide show
  1. package/dist/plugins/console-record.js +1 -1
  2. package/dist/plugins/console-record.min.js +1 -1
  3. package/dist/plugins/console-record.min.js.map +1 -1
  4. package/dist/plugins/console-replay.min.js.map +1 -1
  5. package/dist/record/rrweb-record-pack.min.js.map +1 -1
  6. package/dist/record/rrweb-record.js +3 -3
  7. package/dist/record/rrweb-record.min.js +3 -3
  8. package/dist/record/rrweb-record.min.js.map +1 -1
  9. package/dist/replay/rrweb-replay-unpack.js +4 -4
  10. package/dist/replay/rrweb-replay-unpack.min.js +4 -4
  11. package/dist/replay/rrweb-replay-unpack.min.js.map +1 -1
  12. package/dist/replay/rrweb-replay.js +3 -3
  13. package/dist/replay/rrweb-replay.min.js +3 -3
  14. package/dist/replay/rrweb-replay.min.js.map +1 -1
  15. package/dist/rrweb-all.js +12 -12
  16. package/dist/rrweb-all.min.js +12 -12
  17. package/dist/rrweb-all.min.js.map +1 -1
  18. package/dist/rrweb.js +5 -5
  19. package/dist/rrweb.min.js +5 -5
  20. package/dist/rrweb.min.js.map +1 -1
  21. package/es/rrweb/packages/rrweb/src/record/index.js +5 -2
  22. package/es/rrweb/packages/rrweb/src/record/mutation.js +23 -11
  23. package/es/rrweb/packages/rrweb/src/record/observer.js +6 -6
  24. package/es/rrweb/packages/rrweb/src/record/observers/canvas/2d.js +1 -1
  25. package/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas.js +2 -2
  26. package/es/rrweb/packages/rrweb/src/record/observers/canvas/webgl.js +1 -2
  27. package/es/rrweb/packages/rrweb/src/utils.js +16 -23
  28. package/es/rrweb/packages/rrweb-snapshot/es/rrweb-snapshot.js +282 -236
  29. package/lib/record/rrweb-record.js +333 -280
  30. package/lib/rrweb-all.js +333 -280
  31. package/lib/rrweb.js +333 -280
  32. package/package.json +4 -4
  33. package/typings/utils.d.ts +1 -1
@@ -1,8 +1,8 @@
1
- var rrweb=function(q){"use strict";var j;(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"})(j||(j={}));function er(e){return e.nodeType===e.ELEMENT_NODE}function We(e){var t,r=(t=e)===null||t===void 0?void 0:t.host;return Boolean(r&&r.shadowRoot&&r.shadowRoot===e)}var pt=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var r;if(!t)return-1;var n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var r=this,n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(function(o){return r.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function tr(){return new pt}function ft(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,o=e.value,i=e.maskInputFn,l=o||"";return(t[r.toLowerCase()]||t[n])&&(i?l=i(l):l="*".repeat(l.length)),l}var rr="__rrweb_original__";function $n(e){var t=e.getContext("2d");if(!t)return!0;for(var r=50,n=0;n<e.width;n+=r)for(var o=0;o<e.height;o+=r){var i=t.getImageData,l=rr in i?i[rr]:i,c=new Uint32Array(l.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer);if(c.some(function(a){return a!==0}))return!1}return!0}function nr(e){return e=e.replace(/[^ -~]+/g,""),e=e?.split(" ").map(function(t){return Math.random().toString(20).substr(2,t.length)}).join(" ")||"",e}var Wn=1,jn=new RegExp("[^a-z0-9-_:]"),je=-2;function Vn(){return Wn++}function Un(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return jn.test(t)?"div":t}function vt(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(Gn).join(""):null}catch{return null}}function Gn(e){var t=e.cssText;if(Bn(e))try{t=vt(e.styleSheet)||t}catch{}return t}function Bn(e){return"styleSheet"in e}function zn(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function Hn(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var xe,or,Yn=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Xn=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,Zn=/^(data:)([^,]*),(.*)/i;function Qe(e,t){return(e||"").replace(Yn,function(r,n,o,i,l,c){var a=o||l||c,s=n||i||"";if(!a)return r;if(!Xn.test(a)||Zn.test(a))return"url("+s+a+s+")";if(a[0]==="/")return"url("+s+(Hn(t)+a)+s+")";var u=t.split("/"),d=a.split("/");u.pop();for(var m=0,h=d;m<h.length;m++){var v=h[m];v!=="."&&(v===".."?u.pop():u.push(v))}return"url("+s+u.join("/")+s+")"})}var Kn=/^[^ \t\n\r\u000c]+/,qn=/^[, \t\n\r\u000c]+/;function Jn(e,t){if(t.trim()==="")return t;var r=0;function n(s){var u,d=s.exec(t.substring(r));return d?(u=d[0],r+=u.length,u):""}for(var o=[];n(qn),!(r>=t.length);){var i=n(Kn);if(i.slice(-1)===",")i=et(e,i.substring(0,i.length-1)),o.push(i);else{var l="";i=et(e,i);for(var c=!1;;){var a=t.charAt(r);if(a===""){o.push((i+l).trim());break}else if(c)a===")"&&(c=!1);else if(a===","){r+=1,o.push((i+l).trim());break}else a==="("&&(c=!0);l+=a,r+=1}}}return o.join(", ")}function et(e,t){if(!t||t.trim()==="")return t;var r=e.createElement("a");return r.href=t,r.href}function Qn(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function gt(){var e=document.createElement("a");return e.href="",e.href}function ir(e,t,r,n){return r==="src"||r==="href"&&n||r==="xlink:href"&&n&&n[0]!=="#"||r==="background"&&n&&(t==="table"||t==="td"||t==="th")?et(e,n):r==="srcset"&&n?Jn(e,n):r==="style"&&n?Qe(n,gt()):t==="object"&&r==="data"&&n?et(e,n):n}function eo(e,t,r){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var n=0;n<e.classList.length;n++){var o=e.classList[n];if(t.test(o))return!0}return r?e.matches(r):!1}function tt(e,t,r){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var n=0;n<e.classList.length;n++){var o=e.classList[n];if(t.test(o))return!0}return r&&e.matches(r)?!0:tt(e.parentNode,t,r)}return e.nodeType,e.TEXT_NODE,tt(e.parentNode,t,r)}function to(e,t,r){var n=e.contentWindow;if(n){var o=!1,i;try{i=n.document.readyState}catch{return}if(i!=="complete"){var l=setTimeout(function(){o||(t(),o=!0)},r);e.addEventListener("load",function(){clearTimeout(l),o=!0,t()});return}var c="about:blank";if(n.location.href!==c||e.src===c||e.src===""){setTimeout(t,0);return}e.addEventListener("load",t)}}function ro(e){return e.getAttribute("href")?e.sheet!==null:!0}function no(e,t,r){var n=!1,o;try{o=e.sheet}catch{return}if(!o){var i=setTimeout(function(){n||(t(),n=!0)},r);e.addEventListener("load",function(){clearTimeout(i),n=!0,t()})}}function oo(e,t){var r,n=t.doc,o=t.mirror,i=t.blockClass,l=t.blockSelector,c=t.maskTextClass,a=t.maskTextSelector,s=t.inlineStylesheet,u=t.maskInputOptions,d=u===void 0?{}:u,m=t.maskTextFn,h=t.maskInputFn,v=t.dataURLOptions,p=v===void 0?{}:v,w=t.inlineImages,f=t.recordCanvas,S=t.keepIframeSrcFn,T=t.enableStrictPrivacy,I;if(o.getMeta(n)){var R=o.getId(n);I=R===1?void 0:R}switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:j.Document,childNodes:[],compatMode:e.compatMode,rootId:I}:{type:j.Document,childNodes:[],rootId:I};case e.DOCUMENT_TYPE_NODE:return{type:j.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:I};case e.ELEMENT_NODE:for(var M=eo(e,i,l),C=Un(e),y={},H=e.attributes.length,G=0;G<H;G++){var K=e.attributes[G];y[K.name]=ir(n,C,K.name,K.value)}if(C==="link"&&s){var V=Array.from(n.styleSheets).find(function(he){return he.href===e.href}),U=null;V&&(U=vt(V)),U&&(delete y.rel,delete y.href,y._cssText=Qe(U,V.href))}if(C==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var U=vt(e.sheet);U&&(y._cssText=Qe(U,gt()))}if(C==="input"||C==="textarea"||C==="select"){var Y=e.value;y.type!=="radio"&&y.type!=="checkbox"&&y.type!=="submit"&&y.type!=="button"&&Y?y.value=ft({type:y.type,tagName:C,value:Y,maskInputOptions:d,maskInputFn:h}):e.checked&&(y.checked=e.checked)}if(C==="option"&&(e.selected&&!d.select?y.selected=!0:delete y.selected),C==="canvas"&&f){if(e.__context==="2d")$n(e)||(y.rr_dataURL=e.toDataURL(p.type,p.quality));else if(!("__context"in e)){var B=e.toDataURL(p.type,p.quality),L=document.createElement("canvas");L.width=e.width,L.height=e.height;var x=L.toDataURL(p.type,p.quality);B!==x&&(y.rr_dataURL=B)}}if(C==="img"&&w){xe||(xe=n.createElement("canvas"),or=xe.getContext("2d"));var D=e,b=D.crossOrigin;D.crossOrigin="anonymous";var g=function(){try{xe.width=D.naturalWidth,xe.height=D.naturalHeight,or.drawImage(D,0,0),y.rr_dataURL=xe.toDataURL(p.type,p.quality)}catch(he){console.warn("Cannot inline img src="+D.currentSrc+"! Error: "+he)}b?y.crossOrigin=b:D.removeAttribute("crossorigin")};D.complete&&D.naturalWidth!==0?g():D.onload=g}if((C==="audio"||C==="video")&&(y.rr_mediaState=e.paused?"paused":"played",y.rr_mediaCurrentTime=e.currentTime),e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop),M||C==="img"&&T){var N=e.getBoundingClientRect(),E=N.width,F=N.height;y={class:y.class,rr_width:E+"px",rr_height:F+"px"},M=!0}return C==="iframe"&&!S(y.src)&&(e.contentDocument||(y.rr_src=y.src),delete y.src),{type:j.Element,tagName:C,attributes:y,childNodes:[],isSVG:Qn(e)||void 0,needBlock:M,rootId:I};case e.TEXT_NODE:var P=e.parentNode&&e.parentNode.tagName,k=e.textContent,ee=P==="STYLE"?!0:void 0,_=P==="SCRIPT"?!0:void 0,W=!1;if(ee&&k){try{e.nextSibling||e.previousSibling||!((r=e.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(k=zn(e.parentNode.sheet))}catch(he){console.warn("Cannot get CSS styles from text's parentNode. Error: "+he,e)}k=Qe(k,gt()),W=!0}if(_?(k="SCRIPT_PLACEHOLDER",W=!0):P==="NOSCRIPT"&&(k="",W=!0),!ee&&!_&&tt(e,c,a)&&k&&(k=m?m(k):k.replace(/[\S]/g,"*")),T&&!W&&P){var de=new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]);!de.has(P)&&k&&(k=nr(k))}return{type:j.Text,textContent:k||"",isStyle:ee,rootId:I};case e.CDATA_SECTION_NODE:return{type:j.CDATA,textContent:"",rootId:I};case e.COMMENT_NODE:return{type:j.Comment,textContent:e.textContent||"",rootId:I};default:return!1}}function X(e){return e===void 0?"":e.toLowerCase()}function io(e,t){return!!(t.comment&&e.type===j.Comment||e.type===j.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"&&(X(e.attributes.name).match(/^msapplication-tile(image|color)$/)||X(e.attributes.name)==="application-name"||X(e.attributes.rel)==="icon"||X(e.attributes.rel)==="apple-touch-icon"||X(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&X(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(X(e.attributes.property).match(/^(og|twitter|fb):/)||X(e.attributes.name).match(/^(og|twitter):/)||X(e.attributes.name)==="pinterest")||t.headMetaRobots&&(X(e.attributes.name)==="robots"||X(e.attributes.name)==="googlebot"||X(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&(X(e.attributes.name)==="author"||X(e.attributes.name)==="generator"||X(e.attributes.name)==="framework"||X(e.attributes.name)==="publisher"||X(e.attributes.name)==="progid"||X(e.attributes.property).match(/^article:/)||X(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(X(e.attributes.name)==="google-site-verification"||X(e.attributes.name)==="yandex-verification"||X(e.attributes.name)==="csrf-token"||X(e.attributes.name)==="p:domain_verify"||X(e.attributes.name)==="verify-v1"||X(e.attributes.name)==="verification"||X(e.attributes.name)==="shopify-checkout-api-token"))))}function ke(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,i=t.blockSelector,l=t.maskTextClass,c=t.maskTextSelector,a=t.skipChild,s=a===void 0?!1:a,u=t.inlineStylesheet,d=u===void 0?!0:u,m=t.maskInputOptions,h=m===void 0?{}:m,v=t.maskTextFn,p=t.maskInputFn,w=t.slimDOMOptions,f=t.dataURLOptions,S=f===void 0?{}:f,T=t.inlineImages,I=T===void 0?!1:T,R=t.recordCanvas,M=R===void 0?!1:R,C=t.onSerialize,y=t.onIframeLoad,H=t.iframeLoadTimeout,G=H===void 0?5e3:H,K=t.onStylesheetLoad,V=t.stylesheetLoadTimeout,U=V===void 0?5e3:V,Y=t.keepIframeSrcFn,B=Y===void 0?function(){return!1}:Y,L=t.enableStrictPrivacy,x=t.preserveWhiteSpace,D=x===void 0?!0:x,b=oo(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:h,maskTextFn:v,maskInputFn:p,dataURLOptions:S,inlineImages:I,recordCanvas:M,keepIframeSrcFn:B,enableStrictPrivacy:L});if(!b)return console.warn(e,"not serialized"),null;var g;if(n.hasNode(e)?g=n.getId(e):io(b,w)||!D&&b.type===j.Text&&!b.isStyle&&!b.textContent.replace(/^\s+|\s+$/gm,"").length?g=je:g=Vn(),g===je)return null;var N=Object.assign(b,{id:g});n.add(e,N),C&&C(e);var E=!s;if(N.type===j.Element){if(E=E&&!N.needBlock,N.needBlock&&N.tagName==="img"){var F=e.cloneNode();F.src="",n.add(F,N)}delete N.needBlock,e.shadowRoot&&(N.isShadowHost=!0)}if((N.type===j.Document||N.type===j.Element)&&E){w.headWhitespace&&N.type===j.Element&&N.tagName==="head"&&(D=!1);for(var P={doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:s,inlineStylesheet:d,maskInputOptions:h,maskTextFn:v,maskInputFn:p,slimDOMOptions:w,dataURLOptions:S,inlineImages:I,recordCanvas:M,preserveWhiteSpace:D,onSerialize:C,onIframeLoad:y,iframeLoadTimeout:G,onStylesheetLoad:K,stylesheetLoadTimeout:U,keepIframeSrcFn:B,enableStrictPrivacy:L},k=0,ee=Array.from(e.childNodes);k<ee.length;k++){var _=ee[k],W=ke(_,P);W&&N.childNodes.push(W)}if(er(e)&&e.shadowRoot)for(var de=0,he=Array.from(e.shadowRoot.childNodes);de<he.length;de++){var _=he[de],W=ke(_,P);W&&(W.isShadow=!0,N.childNodes.push(W))}}return e.parentNode&&We(e.parentNode)&&(N.isShadow=!0),N.type===j.Element&&N.tagName==="iframe"&&to(e,function(){var ye=e.contentDocument;if(ye&&y){var Je=ke(ye,{doc:ye,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:h,maskTextFn:v,maskInputFn:p,slimDOMOptions:w,dataURLOptions:S,inlineImages:I,recordCanvas:M,preserveWhiteSpace:D,onSerialize:C,onIframeLoad:y,iframeLoadTimeout:G,keepIframeSrcFn:B,enableStrictPrivacy:L});Je&&y(e,Je)}},G),N.type===j.Element&&N.tagName==="link"&&N.attributes.rel==="stylesheet"&&(no(e,function(){if(K){var ye=ke(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:h,maskTextFn:v,maskInputFn:p,slimDOMOptions:w,dataURLOptions:S,inlineImages:I,recordCanvas:M,preserveWhiteSpace:D,onSerialize:C,onIframeLoad:y,onStylesheetLoad:K,iframeLoadTimeout:G,keepIframeSrcFn:B,enableStrictPrivacy:L});ye&&K(e,ye)}},U),ro(e)===!1)?null:N}function so(e,t){var r=t||{},n=r.mirror,o=n===void 0?new pt:n,i=r.blockClass,l=i===void 0?"highlight-block":i,c=r.blockSelector,a=c===void 0?null:c,s=r.maskTextClass,u=s===void 0?"highlight-mask":s,d=r.maskTextSelector,m=d===void 0?null:d,h=r.inlineStylesheet,v=h===void 0?!0:h,p=r.inlineImages,w=p===void 0?!1:p,f=r.recordCanvas,S=f===void 0?!1:f,T=r.maskAllInputs,I=T===void 0?!1:T,R=r.maskTextFn,M=r.maskInputFn,C=r.slimDOM,y=C===void 0?!1:C,H=r.dataURLOptions,G=r.preserveWhiteSpace,K=r.onSerialize,V=r.onIframeLoad,U=r.iframeLoadTimeout,Y=r.onStylesheetLoad,B=r.stylesheetLoadTimeout,L=r.keepIframeSrcFn,x=L===void 0?function(){return!1}:L,D=r.enableStrictPrivacy,b=D===void 0?!1:D,g=I===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:I===!1?{password:!0}:I,N=y===!0||y==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:y==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:y===!1?{}:y;return ke(e,{doc:e,mirror:o,blockClass:l,blockSelector:a,maskTextClass:u,maskTextSelector:m,skipChild:!1,inlineStylesheet:v,maskInputOptions:g,maskTextFn:R,maskInputFn:M,slimDOMOptions:N,dataURLOptions:H,inlineImages:w,recordCanvas:S,preserveWhiteSpace:G,onSerialize:K,onIframeLoad:V,iframeLoadTimeout:U,onStylesheetLoad:Y,stylesheetLoadTimeout:B,keepIframeSrcFn:x,enableStrictPrivacy:b})}var sr=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function ao(e,t){t===void 0&&(t={});var r=1,n=1;function o(b){var g=b.match(/\n/g);g&&(r+=g.length);var N=b.lastIndexOf(`
2
- `);n=N===-1?n+b.length:b.length-N}function i(){var b={line:r,column:n};return function(g){return g.position=new l(b),v(),g}}var l=function(){function b(g){this.start=g,this.end={line:r,column:n},this.source=t.source}return b}();l.prototype.content=e;var c=[];function a(b){var g=new Error(t.source+":"+r+":"+n+": "+b);if(g.reason=b,g.filename=t.source,g.line=r,g.column=n,g.source=e,t.silent)c.push(g);else throw g}function s(){var b=m();return{type:"stylesheet",stylesheet:{source:t.source,rules:b,parsingErrors:c}}}function u(){return h(/^{\s*/)}function d(){return h(/^}/)}function m(){var b,g=[];for(v(),p(g);e.length&&e.charAt(0)!=="}"&&(b=x()||D());)b!==!1&&(g.push(b),p(g));return g}function h(b){var g=b.exec(e);if(g){var N=g[0];return o(N),e=e.slice(N.length),g}}function v(){h(/^\s*/)}function p(b){b===void 0&&(b=[]);for(var g;g=w();)g!==!1&&b.push(g),g=w();return b}function w(){var b=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 a("End of comment missing");var N=e.slice(2,g-2);return n+=2,o(N),e=e.slice(g),n+=2,b({type:"comment",comment:N})}}function f(){var b=h(/^([^{]+)/);if(b)return fe(b[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 S(){var b=i(),g=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(g){var N=fe(g[0]);if(!h(/^:\s*/))return a("property missing ':'");var E=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),F=b({type:"declaration",property:N.replace(sr,""),value:E?fe(E[0]).replace(sr,""):""});return h(/^[;\s]*/),F}}function T(){var b=[];if(!u())return a("missing '{'");p(b);for(var g;g=S();)g!==!1&&(b.push(g),p(b)),g=S();return d()?b:a("missing '}'")}function I(){for(var b,g=[],N=i();b=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)g.push(b[1]),h(/^,\s*/);if(g.length)return N({type:"keyframe",values:g,declarations:T()})}function R(){var b=i(),g=h(/^@([-\w]+)?keyframes\s*/);if(g){var N=g[1];if(g=h(/^([-\w]+)\s*/),!g)return a("@keyframes missing name");var E=g[1];if(!u())return a("@keyframes missing '{'");for(var F,P=p();F=I();)P.push(F),P=P.concat(p());return d()?b({type:"keyframes",name:E,vendor:N,keyframes:P}):a("@keyframes missing '}'")}}function M(){var b=i(),g=h(/^@supports *([^{]+)/);if(g){var N=fe(g[1]);if(!u())return a("@supports missing '{'");var E=p().concat(m());return d()?b({type:"supports",supports:N,rules:E}):a("@supports missing '}'")}}function C(){var b=i(),g=h(/^@host\s*/);if(g){if(!u())return a("@host missing '{'");var N=p().concat(m());return d()?b({type:"host",rules:N}):a("@host missing '}'")}}function y(){var b=i(),g=h(/^@media *([^{]+)/);if(g){var N=fe(g[1]);if(!u())return a("@media missing '{'");var E=p().concat(m());return d()?b({type:"media",media:N,rules:E}):a("@media missing '}'")}}function H(){var b=i(),g=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(g)return b({type:"custom-media",name:fe(g[1]),media:fe(g[2])})}function G(){var b=i(),g=h(/^@page */);if(g){var N=f()||[];if(!u())return a("@page missing '{'");for(var E=p(),F;F=S();)E.push(F),E=E.concat(p());return d()?b({type:"page",selectors:N,declarations:E}):a("@page missing '}'")}}function K(){var b=i(),g=h(/^@([-\w]+)?document *([^{]+)/);if(g){var N=fe(g[1]),E=fe(g[2]);if(!u())return a("@document missing '{'");var F=p().concat(m());return d()?b({type:"document",document:E,vendor:N,rules:F}):a("@document missing '}'")}}function V(){var b=i(),g=h(/^@font-face\s*/);if(g){if(!u())return a("@font-face missing '{'");for(var N=p(),E;E=S();)N.push(E),N=N.concat(p());return d()?b({type:"font-face",declarations:N}):a("@font-face missing '}'")}}var U=L("import"),Y=L("charset"),B=L("namespace");function L(b){var g=new RegExp("^@"+b+"\\s*([^;]+);");return function(){var N=i(),E=h(g);if(E){var F={type:b};return F[b]=E[1].trim(),N(F)}}}function x(){if(e[0]==="@")return R()||y()||H()||M()||U()||Y()||B()||K()||G()||C()||V()}function D(){var b=i(),g=f();return g?(p(),b({type:"rule",selectors:g,declarations:T()})):a("selector missing")}return yt(s())}function fe(e){return e?e.replace(/^\s+|\s+$/g,""):""}function yt(e,t){for(var r=e&&typeof e.type=="string",n=r?e:t,o=0,i=Object.keys(e);o<i.length;o++){var l=i[o],c=e[l];Array.isArray(c)?c.forEach(function(a){yt(a,n)}):c&&typeof c=="object"&&yt(c,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var ar={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 lo(e){var t=ar[e.tagName]?ar[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function co(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var lr=/([^\\]):hover/,uo=new RegExp(lr.source,"g");function cr(e,t){var r;if(!(!((r=window?.HIG_CONFIGURATION)===null||r===void 0)&&r.enableOnHoverClass))return e;var n=t?.stylesWithHoverClass.get(e);if(n)return n;var o=ao(e,{silent:!0});if(!o.stylesheet)return e;var i=[];if(o.stylesheet.rules.forEach(function(a){"selectors"in a&&(a.selectors||[]).forEach(function(s){lr.test(s)&&i.push(s)})}),i.length===0)return e;var l=new RegExp(i.filter(function(a,s){return i.indexOf(a)===s}).sort(function(a,s){return s.length-a.length}).map(function(a){return co(a)}).join("|"),"g"),c=e.replace(l,function(a){var s=a.replace(uo,"$1.\\:hover");return a+", "+s});return t?.stylesWithHoverClass.set(e,c),c}function ur(){var e=new Map;return{stylesWithHoverClass:e}}function ho(e,t){var r=t.doc,n=t.hackCss,o=t.cache;switch(e.type){case j.Document:return r.implementation.createDocument(null,"",null);case j.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case j.Element:var i=lo(e),l;e.isSVG?l=r.createElementNS("http://www.w3.org/2000/svg",i):l=r.createElement(i);var c=function(s){if(!e.attributes.hasOwnProperty(s))return"continue";var u=e.attributes[s];if(i==="option"&&s==="selected"&&u===!1)return"continue";if(u=typeof u=="boolean"||typeof u=="number"?"":u,s.startsWith("rr_")){if(i==="canvas"&&s==="rr_dataURL"){var d=document.createElement("img");d.src=u,d.onload=function(){var C=l.getContext("2d");C&&C.drawImage(d,0,0,d.width,d.height)}}else if(i==="img"&&s==="rr_dataURL"){var m=l;m.currentSrc.startsWith("data:")||(m.setAttribute("rrweb-original-src",e.attributes.src),m.src=u)}if(s==="rr_width")l.style.width=u;else if(s==="rr_height")l.style.height=u;else if(s==="rr_mediaCurrentTime")l.currentTime=e.attributes.rr_mediaCurrentTime;else if(s==="rr_mediaState")switch(u){case"played":l.play().catch(function(C){return console.warn("media playback error",C)});break;case"paused":l.pause();break}}else{var h=i==="textarea"&&s==="value",v=i==="style"&&s==="_cssText";if(v&&n&&(u=cr(u,o),typeof u=="string")){for(var p=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,w=void 0,f=[],S="https://replay-cors-proxy.highlightrun.workers.dev";(w=p.exec(u))!==null;)w.index===p.lastIndex&&p.lastIndex++,w.forEach(function(C,y){if(y===0){var H=C.slice(5,C.length-2);f.push({originalUrl:H,proxyUrl:H.replace(H,S+"?url="+H)})}});f.forEach(function(C){u=u.replace(C.originalUrl,C.proxyUrl)})}if(h||v){for(var T=r.createTextNode(u),I=0,R=Array.from(l.childNodes);I<R.length;I++){var M=R[I];M.nodeType===l.TEXT_NODE&&l.removeChild(M)}return l.appendChild(T),"continue"}try{if(e.isSVG&&s==="xlink:href")l.setAttributeNS("http://www.w3.org/1999/xlink",s,u);else if(s==="onload"||s==="onclick"||s.substring(0,7)==="onmouse")l.setAttribute("_"+s,u);else{if(i==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&s==="content")return l.setAttribute("csp-content",u),"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?l.setAttribute("rrweb-original-srcset",e.attributes.srcset):l.setAttribute(s,u))}}catch{}}};for(var a in e.attributes)c(a);if(e.isShadowHost)if(!l.shadowRoot)l.attachShadow({mode:"open"});else for(;l.shadowRoot.firstChild;)l.shadowRoot.removeChild(l.shadowRoot.firstChild);return l;case j.Text:return r.createTextNode(e.isStyle&&n?cr(e.textContent,o):e.textContent);case j.CDATA:return r.createCDATASection(e.textContent);case j.Comment:return r.createComment(e.textContent);default:return null}}function rt(e,t){var r=t.doc,n=t.mirror,o=t.skipChild,i=o===void 0?!1:o,l=t.hackCss,c=l===void 0?!0:l,a=t.afterAppend,s=t.cache,u=ho(e,{doc:r,hackCss:c,cache:s});if(!u)return null;if(e.rootId&&console.assert(n.getNode(e.rootId)===r,"Target document should have the same root id."),e.type===j.Document&&(r.close(),r.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==j.DocumentType&&(e.childNodes[0].type===j.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),u=r),n.add(u,e),(e.type===j.Document||e.type===j.Element)&&!i)for(var d=0,m=e.childNodes;d<m.length;d++){var h=m[d],v=rt(h,{doc:r,mirror:n,skipChild:!1,hackCss:c,afterAppend:a,cache:s});if(!v){console.warn("Failed to rebuild",h);continue}h.isShadow&&er(u)&&u.shadowRoot?u.shadowRoot.appendChild(v):u.appendChild(v),a&&a(v)}return u}function mo(e,t){function r(l){t(l)}for(var n=0,o=e.getIds();n<o.length;n++){var i=o[n];e.has(i)&&r(e.getNode(i))}}function po(e,t){var r=t.getMeta(e);if(r?.type===j.Element){var n=e;for(var o in r.attributes)if(r.attributes.hasOwnProperty(o)&&o.startsWith("rr_")){var i=r.attributes[o];o==="rr_scrollLeft"&&(n.scrollLeft=i),o==="rr_scrollTop"&&(n.scrollTop=i)}}}function fo(e,t){var r=t.doc,n=t.onVisit,o=t.hackCss,i=o===void 0?!0:o,l=t.afterAppend,c=t.cache,a=t.mirror,s=a===void 0?new pt:a,u=rt(e,{doc:r,mirror:s,skipChild:!1,hackCss:i,afterAppend:l,cache:c});return mo(s,function(d){n&&n(d),po(d,s)}),u}function se(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const Oe=`Please stop import mirror directly. Instead of that,\r
1
+ var rrweb=function(q){"use strict";var _;(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"})(_||(_={}));function er(e){return e.nodeType===e.ELEMENT_NODE}function Ve(e){var t,r=(t=e)===null||t===void 0?void 0:t.host;return Boolean(r?.shadowRoot===e)}var vt=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var r;if(!t)return-1;var n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var r=this,n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(function(o){return r.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function tr(){return new vt}function gt(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,o=e.value,i=e.maskInputFn,l=o||"";return(t[r.toLowerCase()]||t[n])&&(i?l=i(l):l="*".repeat(l.length)),l}var rr="__rrweb_original__";function Un(e){var t=e.getContext("2d");if(!t)return!0;for(var r=50,n=0;n<e.width;n+=r)for(var o=0;o<e.height;o+=r){var i=t.getImageData,l=rr in i?i[rr]:i,c=new Uint32Array(l.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer);if(c.some(function(a){return a!==0}))return!1}return!0}function nr(e){return e=e.replace(/[^ -~]+/g,""),e=e?.split(" ").map(function(t){return Math.random().toString(20).substr(2,t.length)}).join(" ")||"",e}var Gn=1,zn=new RegExp("[^a-z0-9-_:]"),Ue=-2;function Bn(){return Gn++}function Hn(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return zn.test(t)?"div":t}function yt(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(Yn).join(""):null}catch{return null}}function Yn(e){var t=e.cssText;if(Xn(e))try{t=yt(e.styleSheet)||t}catch{}return t}function Xn(e){return"styleSheet"in e}function Zn(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function Kn(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var ke,or,qn=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Jn=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,Qn=/^(data:)([^,]*),(.*)/i;function tt(e,t){return(e||"").replace(qn,function(r,n,o,i,l,c){var a=o||l||c,s=n||i||"";if(!a)return r;if(!Jn.test(a)||Qn.test(a))return"url("+s+a+s+")";if(a[0]==="/")return"url("+s+(Kn(t)+a)+s+")";var u=t.split("/"),d=a.split("/");u.pop();for(var m=0,h=d;m<h.length;m++){var p=h[m];p!=="."&&(p===".."?u.pop():u.push(p))}return"url("+s+u.join("/")+s+")"})}var eo=/^[^ \t\n\r\u000c]+/,to=/^[, \t\n\r\u000c]+/;function ro(e,t){if(t.trim()==="")return t;var r=0;function n(s){var u,d=s.exec(t.substring(r));return d?(u=d[0],r+=u.length,u):""}for(var o=[];n(to),!(r>=t.length);){var i=n(eo);if(i.slice(-1)===",")i=rt(e,i.substring(0,i.length-1)),o.push(i);else{var l="";i=rt(e,i);for(var c=!1;;){var a=t.charAt(r);if(a===""){o.push((i+l).trim());break}else if(c)a===")"&&(c=!1);else if(a===","){r+=1,o.push((i+l).trim());break}else a==="("&&(c=!0);l+=a,r+=1}}}return o.join(", ")}function rt(e,t){if(!t||t.trim()==="")return t;var r=e.createElement("a");return r.href=t,r.href}function no(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function bt(){var e=document.createElement("a");return e.href="",e.href}function ir(e,t,r,n){return r==="src"||r==="href"&&n||r==="xlink:href"&&n&&n[0]!=="#"||r==="background"&&n&&(t==="table"||t==="td"||t==="th")?rt(e,n):r==="srcset"&&n?ro(e,n):r==="style"&&n?tt(n,bt()):t==="object"&&r==="data"&&n?rt(e,n):n}function oo(e,t,r){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return r?e.matches(r):!1}function nt(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?nt(e.parentNode,t,r):!1;for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return r?nt(e.parentNode,t,r):!1}function sr(e,t,r){var n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(n===null)return!1;if(typeof t=="string"){if(n.classList.contains(t)||n.closest("."+t))return!0}else if(nt(n,t,!0))return!0;return!!(r&&(n.matches(r)||n.closest(r)))}function io(e,t,r){var n=e.contentWindow;if(n){var o=!1,i;try{i=n.document.readyState}catch{return}if(i!=="complete"){var l=setTimeout(function(){o||(t(),o=!0)},r);e.addEventListener("load",function(){clearTimeout(l),o=!0,t()});return}var c="about:blank";if(n.location.href!==c||e.src===c||e.src===""){setTimeout(t,0);return}e.addEventListener("load",t)}}function so(e){return e.getAttribute("href")?e.sheet!==null:!0}function ao(e,t,r){var n=!1,o;try{o=e.sheet}catch{return}if(!o){var i=setTimeout(function(){n||(t(),n=!0)},r);e.addEventListener("load",function(){clearTimeout(i),n=!0,t()})}}function lo(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,i=t.blockSelector,l=t.maskTextClass,c=t.maskTextSelector,a=t.inlineStylesheet,s=t.maskInputOptions,u=s===void 0?{}:s,d=t.maskTextFn,m=t.maskInputFn,h=t.dataURLOptions,p=h===void 0?{}:h,v=t.inlineImages,b=t.recordCanvas,f=t.keepIframeSrcFn,S=t.newlyAddedElement,y=S===void 0?!1:S,N=t.enableStrictPrivacy,x=co(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:_.Document,childNodes:[],compatMode:e.compatMode,rootId:x}:{type:_.Document,childNodes:[],rootId:x};case e.DOCUMENT_TYPE_NODE:return{type:_.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:x};case e.ELEMENT_NODE:return ho(e,{doc:r,blockClass:o,blockSelector:i,inlineStylesheet:a,maskInputOptions:u,maskInputFn:m,dataURLOptions:p,inlineImages:v,recordCanvas:b,keepIframeSrcFn:f,newlyAddedElement:y,enableStrictPrivacy:N,rootId:x});case e.TEXT_NODE:return uo(e,{maskTextClass:l,maskTextSelector:c,maskTextFn:d,enableStrictPrivacy:N,rootId:x});case e.CDATA_SECTION_NODE:return{type:_.CDATA,textContent:"",rootId:x};case e.COMMENT_NODE:return{type:_.Comment,textContent:e.textContent||"",rootId:x};default:return!1}}function co(e,t){if(t.hasNode(e)){var r=t.getId(e);return r===1?void 0:r}}function uo(e,t){var r,n=t.maskTextClass,o=t.maskTextSelector,i=t.maskTextFn,l=t.enableStrictPrivacy,c=t.rootId,a=e.parentNode&&e.parentNode.tagName,s=e.textContent,u=a==="STYLE"?!0:void 0,d=a==="SCRIPT"?!0:void 0,m=!1;if(u&&s){try{e.nextSibling||e.previousSibling||!((r=e.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(s=Zn(e.parentNode.sheet))}catch(p){console.warn("Cannot get CSS styles from text's parentNode. Error: "+p,e)}s=tt(s,bt()),m=!0}if(d?(s="SCRIPT_PLACEHOLDER",m=!0):a==="NOSCRIPT"&&(s="",m=!0),!u&&!d&&s&&sr(e,n,o)&&(s=i?i(s):s.replace(/[\S]/g,"*")),l&&!m&&a){var h=new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]);!h.has(a)&&s&&(s=nr(s))}return{type:_.Text,textContent:s||"",isStyle:u,rootId:c}}function ho(e,t){for(var r=t.doc,n=t.blockClass,o=t.blockSelector,i=t.inlineStylesheet,l=t.maskInputOptions,c=l===void 0?{}:l,a=t.maskInputFn,s=t.dataURLOptions,u=s===void 0?{}:s,d=t.inlineImages,m=t.recordCanvas,h=t.keepIframeSrcFn,p=t.newlyAddedElement,v=p===void 0?!1:p,b=t.enableStrictPrivacy,f=t.rootId,S=oo(e,n,o),y=Hn(e),N={},x=e.attributes.length,M=0;M<x;M++){var I=e.attributes[M];N[I.name]=ir(r,y,I.name,I.value)}if(y==="link"&&i){var E=Array.from(r.styleSheets).find(function(g){return g.href===e.href}),F=null;E&&(F=yt(E)),F&&(delete N.rel,delete N.href,N._cssText=tt(F,E.href))}if(y==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var F=yt(e.sheet);F&&(N._cssText=tt(F,bt()))}if(y==="input"||y==="textarea"||y==="select"){var U=e.value;N.type!=="radio"&&N.type!=="checkbox"&&N.type!=="submit"&&N.type!=="button"&&U?N.value=gt({type:N.type,tagName:y,value:U,maskInputOptions:c,maskInputFn:a}):e.checked&&(N.checked=e.checked)}if(y==="option"&&(e.selected&&!c.select?N.selected=!0:delete N.selected),y==="canvas"&&m){if(e.__context==="2d")Un(e)||(N.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var K=e.toDataURL(u.type,u.quality),W=document.createElement("canvas");W.width=e.width,W.height=e.height;var H=W.toDataURL(u.type,u.quality);K!==H&&(N.rr_dataURL=K)}}if(y==="img"&&d){ke||(ke=r.createElement("canvas"),or=ke.getContext("2d"));var L=e,V=L.crossOrigin;L.crossOrigin="anonymous";var A=function(){try{ke.width=L.naturalWidth,ke.height=L.naturalHeight,or.drawImage(L,0,0),N.rr_dataURL=ke.toDataURL(u.type,u.quality)}catch(g){console.warn("Cannot inline img src="+L.currentSrc+"! Error: "+g)}V?N.crossOrigin=V:L.removeAttribute("crossorigin")};L.complete&&L.naturalWidth!==0?A():L.onload=A}if((y==="audio"||y==="video")&&(N.rr_mediaState=e.paused?"paused":"played",N.rr_mediaCurrentTime=e.currentTime),v||(e.scrollLeft&&(N.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(N.rr_scrollTop=e.scrollTop)),S||y==="img"&&b){var O=e.getBoundingClientRect(),$=O.width,w=O.height;N={class:N.class,rr_width:$+"px",rr_height:w+"px"},S=!0}return y==="iframe"&&!h(N.src)&&(e.contentDocument||(N.rr_src=N.src),delete N.src),{type:_.Element,tagName:y,attributes:N,childNodes:[],isSVG:no(e)||void 0,needBlock:S,rootId:f}}function X(e){return e===void 0?"":e.toLowerCase()}function mo(e,t){return!!(t.comment&&e.type===_.Comment||e.type===_.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"&&(X(e.attributes.name).match(/^msapplication-tile(image|color)$/)||X(e.attributes.name)==="application-name"||X(e.attributes.rel)==="icon"||X(e.attributes.rel)==="apple-touch-icon"||X(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&X(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(X(e.attributes.property).match(/^(og|twitter|fb):/)||X(e.attributes.name).match(/^(og|twitter):/)||X(e.attributes.name)==="pinterest")||t.headMetaRobots&&(X(e.attributes.name)==="robots"||X(e.attributes.name)==="googlebot"||X(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&(X(e.attributes.name)==="author"||X(e.attributes.name)==="generator"||X(e.attributes.name)==="framework"||X(e.attributes.name)==="publisher"||X(e.attributes.name)==="progid"||X(e.attributes.property).match(/^article:/)||X(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(X(e.attributes.name)==="google-site-verification"||X(e.attributes.name)==="yandex-verification"||X(e.attributes.name)==="csrf-token"||X(e.attributes.name)==="p:domain_verify"||X(e.attributes.name)==="verify-v1"||X(e.attributes.name)==="verification"||X(e.attributes.name)==="shopify-checkout-api-token"))))}function xe(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,i=t.blockSelector,l=t.maskTextClass,c=t.maskTextSelector,a=t.skipChild,s=a===void 0?!1:a,u=t.inlineStylesheet,d=u===void 0?!0:u,m=t.maskInputOptions,h=m===void 0?{}:m,p=t.maskTextFn,v=t.maskInputFn,b=t.slimDOMOptions,f=t.dataURLOptions,S=f===void 0?{}:f,y=t.inlineImages,N=y===void 0?!1:y,x=t.recordCanvas,M=x===void 0?!1:x,I=t.onSerialize,E=t.onIframeLoad,F=t.iframeLoadTimeout,U=F===void 0?5e3:F,K=t.onStylesheetLoad,W=t.stylesheetLoadTimeout,H=W===void 0?5e3:W,L=t.keepIframeSrcFn,V=L===void 0?function(){return!1}:L,A=t.newlyAddedElement,O=A===void 0?!1:A,$=t.enableStrictPrivacy,w=t.preserveWhiteSpace,g=w===void 0?!0:w,C=lo(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:h,maskTextFn:p,maskInputFn:v,dataURLOptions:S,inlineImages:N,recordCanvas:M,keepIframeSrcFn:V,newlyAddedElement:O,enableStrictPrivacy:$});if(!C)return console.warn(e,"not serialized"),null;var T;if(n.hasNode(e)?T=n.getId(e):mo(C,b)||!g&&C.type===_.Text&&!C.isStyle&&!C.textContent.replace(/^\s+|\s+$/gm,"").length?T=Ue:T=Bn(),T===Ue)return null;var k=Object.assign(C,{id:T});n.add(e,k),I&&I(e);var G=!s;if(k.type===_.Element){if(G=G&&!k.needBlock,k.needBlock&&k.tagName==="img"){var z=e.cloneNode();z.src="",n.add(z,k)}delete k.needBlock,e.shadowRoot&&(k.isShadowHost=!0)}if((k.type===_.Document||k.type===_.Element)&&G){b.headWhitespace&&k.type===_.Element&&k.tagName==="head"&&(g=!1);for(var oe={doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:s,inlineStylesheet:d,maskInputOptions:h,maskTextFn:p,maskInputFn:v,slimDOMOptions:b,dataURLOptions:S,inlineImages:N,recordCanvas:M,preserveWhiteSpace:g,onSerialize:I,onIframeLoad:E,iframeLoadTimeout:U,onStylesheetLoad:K,stylesheetLoadTimeout:H,keepIframeSrcFn:V,enableStrictPrivacy:$},j=0,Y=Array.from(e.childNodes);j<Y.length;j++){var ge=Y[j],ye=xe(ge,oe);ye&&k.childNodes.push(ye)}if(er(e)&&e.shadowRoot)for(var $e=0,et=Array.from(e.shadowRoot.childNodes);$e<et.length;$e++){var ge=et[$e],ye=xe(ge,oe);ye&&(ye.isShadow=!0,k.childNodes.push(ye))}}return e.parentNode&&Ve(e.parentNode)&&(k.isShadow=!0),k.type===_.Element&&k.tagName==="iframe"&&io(e,function(){var We=e.contentDocument;if(We&&E){var je=xe(We,{doc:We,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:h,maskTextFn:p,maskInputFn:v,slimDOMOptions:b,dataURLOptions:S,inlineImages:N,recordCanvas:M,preserveWhiteSpace:g,onSerialize:I,onIframeLoad:E,iframeLoadTimeout:U,onStylesheetLoad:K,stylesheetLoadTimeout:H,keepIframeSrcFn:V,enableStrictPrivacy:$});je&&E(e,je)}},U),k.type===_.Element&&k.tagName==="link"&&k.attributes.rel==="stylesheet"&&(ao(e,function(){if(K){var We=xe(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:h,maskTextFn:p,maskInputFn:v,slimDOMOptions:b,dataURLOptions:S,inlineImages:N,recordCanvas:M,preserveWhiteSpace:g,onSerialize:I,onIframeLoad:E,iframeLoadTimeout:U,onStylesheetLoad:K,stylesheetLoadTimeout:H,keepIframeSrcFn:V,enableStrictPrivacy:$});We&&K(e,We)}},H),so(e)===!1)?null:k}function po(e,t){var r=t||{},n=r.mirror,o=n===void 0?new vt:n,i=r.blockClass,l=i===void 0?"highlight-block":i,c=r.blockSelector,a=c===void 0?null:c,s=r.maskTextClass,u=s===void 0?"highlight-mask":s,d=r.maskTextSelector,m=d===void 0?null:d,h=r.inlineStylesheet,p=h===void 0?!0:h,v=r.inlineImages,b=v===void 0?!1:v,f=r.recordCanvas,S=f===void 0?!1:f,y=r.maskAllInputs,N=y===void 0?!1:y,x=r.maskTextFn,M=r.maskInputFn,I=r.slimDOM,E=I===void 0?!1:I,F=r.dataURLOptions,U=r.preserveWhiteSpace,K=r.onSerialize,W=r.onIframeLoad,H=r.iframeLoadTimeout,L=r.onStylesheetLoad,V=r.stylesheetLoadTimeout,A=r.keepIframeSrcFn,O=A===void 0?function(){return!1}:A,$=r.enableStrictPrivacy,w=$===void 0?!1:$,g=N===!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}:N===!1?{password:!0}:N,C=E===!0||E==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:E==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:E===!1?{}:E;return xe(e,{doc:e,mirror:o,blockClass:l,blockSelector:a,maskTextClass:u,maskTextSelector:m,skipChild:!1,inlineStylesheet:p,maskInputOptions:g,maskTextFn:x,maskInputFn:M,slimDOMOptions:C,dataURLOptions:F,inlineImages:b,recordCanvas:S,preserveWhiteSpace:U,onSerialize:K,onIframeLoad:W,iframeLoadTimeout:H,onStylesheetLoad:L,stylesheetLoadTimeout:V,keepIframeSrcFn:O,newlyAddedElement:!1,enableStrictPrivacy:w})}var ar=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function fo(e,t){t===void 0&&(t={});var r=1,n=1;function o(w){var g=w.match(/\n/g);g&&(r+=g.length);var C=w.lastIndexOf(`
2
+ `);n=C===-1?n+w.length:w.length-C}function i(){var w={line:r,column:n};return function(g){return g.position=new l(w),p(),g}}var l=function(){function w(g){this.start=g,this.end={line:r,column:n},this.source=t.source}return w}();l.prototype.content=e;var c=[];function a(w){var g=new Error(t.source+":"+r+":"+n+": "+w);if(g.reason=w,g.filename=t.source,g.line=r,g.column=n,g.source=e,t.silent)c.push(g);else throw g}function s(){var w=m();return{type:"stylesheet",stylesheet:{source:t.source,rules:w,parsingErrors:c}}}function u(){return h(/^{\s*/)}function d(){return h(/^}/)}function m(){var w,g=[];for(p(),v(g);e.length&&e.charAt(0)!=="}"&&(w=O()||$());)w!==!1&&(g.push(w),v(g));return g}function h(w){var g=w.exec(e);if(g){var C=g[0];return o(C),e=e.slice(C.length),g}}function p(){h(/^\s*/)}function v(w){w===void 0&&(w=[]);for(var g;g=b();)g!==!1&&w.push(g),g=b();return w}function b(){var w=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 a("End of comment missing");var C=e.slice(2,g-2);return n+=2,o(C),e=e.slice(g),n+=2,w({type:"comment",comment:C})}}function f(){var w=h(/^([^{]+)/);if(w)return pe(w[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 S(){var w=i(),g=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(g){var C=pe(g[0]);if(!h(/^:\s*/))return a("property missing ':'");var T=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),k=w({type:"declaration",property:C.replace(ar,""),value:T?pe(T[0]).replace(ar,""):""});return h(/^[;\s]*/),k}}function y(){var w=[];if(!u())return a("missing '{'");v(w);for(var g;g=S();)g!==!1&&(w.push(g),v(w)),g=S();return d()?w:a("missing '}'")}function N(){for(var w,g=[],C=i();w=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)g.push(w[1]),h(/^,\s*/);if(g.length)return C({type:"keyframe",values:g,declarations:y()})}function x(){var w=i(),g=h(/^@([-\w]+)?keyframes\s*/);if(g){var C=g[1];if(g=h(/^([-\w]+)\s*/),!g)return a("@keyframes missing name");var T=g[1];if(!u())return a("@keyframes missing '{'");for(var k,G=v();k=N();)G.push(k),G=G.concat(v());return d()?w({type:"keyframes",name:T,vendor:C,keyframes:G}):a("@keyframes missing '}'")}}function M(){var w=i(),g=h(/^@supports *([^{]+)/);if(g){var C=pe(g[1]);if(!u())return a("@supports missing '{'");var T=v().concat(m());return d()?w({type:"supports",supports:C,rules:T}):a("@supports missing '}'")}}function I(){var w=i(),g=h(/^@host\s*/);if(g){if(!u())return a("@host missing '{'");var C=v().concat(m());return d()?w({type:"host",rules:C}):a("@host missing '}'")}}function E(){var w=i(),g=h(/^@media *([^{]+)/);if(g){var C=pe(g[1]);if(!u())return a("@media missing '{'");var T=v().concat(m());return d()?w({type:"media",media:C,rules:T}):a("@media missing '}'")}}function F(){var w=i(),g=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(g)return w({type:"custom-media",name:pe(g[1]),media:pe(g[2])})}function U(){var w=i(),g=h(/^@page */);if(g){var C=f()||[];if(!u())return a("@page missing '{'");for(var T=v(),k;k=S();)T.push(k),T=T.concat(v());return d()?w({type:"page",selectors:C,declarations:T}):a("@page missing '}'")}}function K(){var w=i(),g=h(/^@([-\w]+)?document *([^{]+)/);if(g){var C=pe(g[1]),T=pe(g[2]);if(!u())return a("@document missing '{'");var k=v().concat(m());return d()?w({type:"document",document:T,vendor:C,rules:k}):a("@document missing '}'")}}function W(){var w=i(),g=h(/^@font-face\s*/);if(g){if(!u())return a("@font-face missing '{'");for(var C=v(),T;T=S();)C.push(T),C=C.concat(v());return d()?w({type:"font-face",declarations:C}):a("@font-face missing '}'")}}var H=A("import"),L=A("charset"),V=A("namespace");function A(w){var g=new RegExp("^@"+w+"\\s*([^;]+);");return function(){var C=i(),T=h(g);if(T){var k={type:w};return k[w]=T[1].trim(),C(k)}}}function O(){if(e[0]==="@")return x()||E()||F()||M()||H()||L()||V()||K()||U()||I()||W()}function $(){var w=i(),g=f();return g?(v(),w({type:"rule",selectors:g,declarations:y()})):a("selector missing")}return St(s())}function pe(e){return e?e.replace(/^\s+|\s+$/g,""):""}function St(e,t){for(var r=e&&typeof e.type=="string",n=r?e:t,o=0,i=Object.keys(e);o<i.length;o++){var l=i[o],c=e[l];Array.isArray(c)?c.forEach(function(a){St(a,n)}):c&&typeof c=="object"&&St(c,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var lr={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 vo(e){var t=lr[e.tagName]?lr[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function go(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var cr=/([^\\]):hover/,yo=new RegExp(cr.source,"g");function ur(e,t){var r;if(!(!((r=window?.HIG_CONFIGURATION)===null||r===void 0)&&r.enableOnHoverClass))return e;var n=t?.stylesWithHoverClass.get(e);if(n)return n;var o=fo(e,{silent:!0});if(!o.stylesheet)return e;var i=[];if(o.stylesheet.rules.forEach(function(a){"selectors"in a&&(a.selectors||[]).forEach(function(s){cr.test(s)&&i.push(s)})}),i.length===0)return e;var l=new RegExp(i.filter(function(a,s){return i.indexOf(a)===s}).sort(function(a,s){return s.length-a.length}).map(function(a){return go(a)}).join("|"),"g"),c=e.replace(l,function(a){var s=a.replace(yo,"$1.\\:hover");return a+", "+s});return t?.stylesWithHoverClass.set(e,c),c}function dr(){var e=new Map;return{stylesWithHoverClass:e}}function bo(e,t){var r=t.doc,n=t.hackCss,o=t.cache;switch(e.type){case _.Document:return r.implementation.createDocument(null,"",null);case _.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case _.Element:var i=vo(e),l;e.isSVG?l=r.createElementNS("http://www.w3.org/2000/svg",i):l=r.createElement(i);var c=function(s){if(!e.attributes.hasOwnProperty(s))return"continue";var u=e.attributes[s];if(i==="option"&&s==="selected"&&u===!1)return"continue";if(u=typeof u=="boolean"||typeof u=="number"?"":u,s.startsWith("rr_")){if(i==="canvas"&&s==="rr_dataURL"){var d=document.createElement("img");d.src=u,d.onload=function(){var I=l.getContext("2d");I&&I.drawImage(d,0,0,d.width,d.height)}}else if(i==="img"&&s==="rr_dataURL"){var m=l;m.currentSrc.startsWith("data:")||(m.setAttribute("rrweb-original-src",e.attributes.src),m.src=u)}if(s==="rr_width")l.style.width=u;else if(s==="rr_height")l.style.height=u;else if(s==="rr_mediaCurrentTime")l.currentTime=e.attributes.rr_mediaCurrentTime;else if(s==="rr_mediaState")switch(u){case"played":l.play().catch(function(I){return console.warn("media playback error",I)});break;case"paused":l.pause();break}}else{var h=i==="textarea"&&s==="value",p=i==="style"&&s==="_cssText";if(p&&n&&(u=ur(u,o),typeof u=="string")){for(var v=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,b=void 0,f=[],S="https://replay-cors-proxy.highlightrun.workers.dev";(b=v.exec(u))!==null;)b.index===v.lastIndex&&v.lastIndex++,b.forEach(function(I,E){if(E===0){var F=I.slice(5,I.length-2);f.push({originalUrl:F,proxyUrl:F.replace(F,S+"?url="+F)})}});f.forEach(function(I){u=u.replace(I.originalUrl,I.proxyUrl)})}if(h||p){for(var y=r.createTextNode(u),N=0,x=Array.from(l.childNodes);N<x.length;N++){var M=x[N];M.nodeType===l.TEXT_NODE&&l.removeChild(M)}return l.appendChild(y),"continue"}try{if(e.isSVG&&s==="xlink:href")l.setAttributeNS("http://www.w3.org/1999/xlink",s,u);else if(s==="onload"||s==="onclick"||s.substring(0,7)==="onmouse")l.setAttribute("_"+s,u);else{if(i==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&s==="content")return l.setAttribute("csp-content",u),"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?l.setAttribute("rrweb-original-srcset",e.attributes.srcset):l.setAttribute(s,u))}}catch{}}};for(var a in e.attributes)c(a);if(e.isShadowHost)if(!l.shadowRoot)l.attachShadow({mode:"open"});else for(;l.shadowRoot.firstChild;)l.shadowRoot.removeChild(l.shadowRoot.firstChild);return l;case _.Text:return r.createTextNode(e.isStyle&&n?ur(e.textContent,o):e.textContent);case _.CDATA:return r.createCDATASection(e.textContent);case _.Comment:return r.createComment(e.textContent);default:return null}}function ot(e,t){var r=t.doc,n=t.mirror,o=t.skipChild,i=o===void 0?!1:o,l=t.hackCss,c=l===void 0?!0:l,a=t.afterAppend,s=t.cache,u=bo(e,{doc:r,hackCss:c,cache:s});if(!u)return null;if(e.rootId&&console.assert(n.getNode(e.rootId)===r,"Target document should have the same root id."),e.type===_.Document&&(r.close(),r.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==_.DocumentType&&(e.childNodes[0].type===_.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),u=r),n.add(u,e),(e.type===_.Document||e.type===_.Element)&&!i)for(var d=0,m=e.childNodes;d<m.length;d++){var h=m[d],p=ot(h,{doc:r,mirror:n,skipChild:!1,hackCss:c,afterAppend:a,cache:s});if(!p){console.warn("Failed to rebuild",h);continue}h.isShadow&&er(u)&&u.shadowRoot?u.shadowRoot.appendChild(p):u.appendChild(p),a&&a(p)}return u}function So(e,t){function r(l){t(l)}for(var n=0,o=e.getIds();n<o.length;n++){var i=o[n];e.has(i)&&r(e.getNode(i))}}function wo(e,t){var r=t.getMeta(e);if(r?.type===_.Element){var n=e;for(var o in r.attributes)if(r.attributes.hasOwnProperty(o)&&o.startsWith("rr_")){var i=r.attributes[o];o==="rr_scrollLeft"&&(n.scrollLeft=i),o==="rr_scrollTop"&&(n.scrollTop=i)}}}function No(e,t){var r=t.doc,n=t.onVisit,o=t.hackCss,i=o===void 0?!0:o,l=t.afterAppend,c=t.cache,a=t.mirror,s=a===void 0?new vt:a,u=ot(e,{doc:r,mirror:s,skipChild:!1,hackCss:i,afterAppend:l,cache:c});return So(s,function(d){n&&n(d),wo(d,s)}),u}function ie(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const Me=`Please stop import mirror directly. Instead of that,\r
3
3
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
4
- or you can use record.mirror to access the mirror instance during recording.`;q.mirror={map:{},getId(){return console.error(Oe),-1},getNode(){return console.error(Oe),null},removeNodeFromMap(){console.error(Oe)},has(){return console.error(Oe),!1},reset(){console.error(Oe)}},typeof window<"u"&&window.Proxy&&window.Reflect&&(q.mirror=new Proxy(q.mirror,{get(e,t,r){return t==="map"&&console.error(Oe),Reflect.get(e,t,r)}}));function De(e,t,r={}){let n=null,o=0;return function(i){const l=Date.now();!o&&r.leading===!1&&(o=l);const c=t-(l-o),a=this,s=arguments;c<=0||c>t?(n&&(clearTimeout(n),n=null),o=l,e.apply(a,s)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{o=r.leading===!1?0:Date.now(),n=null,e.apply(a,s)},c))}}function Ve(e,t,r,n,o=window){const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(l){setTimeout(()=>{r.set.call(this,l)},0),i&&i.set&&i.set.call(this,l)}}),()=>Ve(e,t,i||{},!0)}function be(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],o=r(n);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,()=>{e[t]=n}}catch{return()=>{}}}function bt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function wt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}const dr=e=>{try{if(e instanceof HTMLElement)return e.tagName==="CANVAS"}catch{return!1}return!1};function oe(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){let r=!1;if(typeof t=="string"){if(e.closest!==void 0)return e.closest("."+t)!==null;r=e.classList.contains(t)}else e.classList.forEach(n=>{t.test(n)&&(r=!0)});return r||oe(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,oe(e.parentNode,t)}function hr(e,t){return t.getId(e)!==-1}function nt(e,t){return t.getId(e)===je}function St(e,t){if(We(e))return!1;const r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?St(e.parentNode,t):!0:!0}function Nt(e){return Boolean(e.changedTouches)}function Tt(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(t){if(!(0 in arguments))throw new TypeError("1 argument is required");do if(this===t)return!0;while(t=t&&t.parentNode);return!1})}function mr(e){const t={},r=(o,i)=>{const l={value:o,parent:i,children:[]};return t[o.node.id]=l,l},n=[];for(const o of e){const{nextId:i,parentId:l}=o;if(i&&i in t){const c=t[i];if(c.parent){const a=c.parent.children.indexOf(c);c.parent.children.splice(a,0,r(o,c.parent))}else{const a=n.indexOf(c);n.splice(a,0,r(o,null))}continue}if(l in t){const c=t[l];c.children.push(r(o,c));continue}n.push(r(o,null))}return n}function Et(e,t){t(e.value);for(let r=e.children.length-1;r>=0;r--)Et(e.children[r],t)}function Re(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function pr(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 r,n;const o=(n=(r=e.ownerDocument)==null?void 0:r.defaultView)==null?void 0:n.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const i=o.getBoundingClientRect(),l=Ct(o,t),c=i.height/o.clientHeight;return{x:i.x*l.relativeScale+l.x,y:i.y*l.relativeScale+l.y,relativeScale:c,absoluteScale:l.absoluteScale*c}}function Ue(e){return Boolean(e?.shadowRoot)}function Le(e,t){const r=e[t[0]];return t.length===1?r:Le(r.cssRules[t[1]].cssRules,t.slice(2))}function It(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function fr(e){const t=new Set,r=[];for(let n=e.length;n--;){const o=e[n];t.has(o.id)||(r.push(o),t.add(o.id))}return r}var vo=Object.freeze({__proto__:null,on:se,get _mirror(){return q.mirror},throttle:De,hookSetter:Ve,patch:be,getWindowHeight:bt,getWindowWidth:wt,isCanvasNode:dr,isBlocked:oe,isSerialized:hr,isIgnored:nt,isAncestorRemoved:St,isTouchEvent:Nt,polyfill:Tt,queueToResolveTrees:mr,iterateResolveTree:Et,isSerializedIframe:Re,isSerializedStylesheet:pr,getBaseDimension:Ct,hasShadowRoot:Ue,getNestedRule:Le,getPositionsAndIndex:It,uniqueTextMutations:fr}),O=(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))(O||{}),A=(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))(A||{}),te=(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))(te||{}),ve=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ve||{}),Ee=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(Ee||{}),z=(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))(z||{});function vr(e){return"__ln"in e}class go{constructor(){this.length=0,this.head=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=r?.next||null;return r}addNode(t){const r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&vr(t.previousSibling)){const n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&vr(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;this.length++}removeNode(t){const r=t.__ln;!this.head||(r.previous?(r.previous.next=r.next,r.next&&(r.next.previous=r.previous)):(this.head=r.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}}const gr=(e,t)=>`${e}@${t}`;class yo{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],r=new go,n=c=>{let a=c,s=je;for(;s===je;)a=a&&a.nextSibling,s=a&&this.mirror.getId(a);return s},o=c=>{var a,s,u,d,m;const h=c.getRootNode?(a=c.getRootNode())==null?void 0:a.host:null;let v=h;for(;(u=(s=v?.getRootNode)==null?void 0:s.call(v))!=null&&u.host;)v=((m=(d=v?.getRootNode)==null?void 0:d.call(v))==null?void 0:m.host)||null;const p=!this.doc.contains(c)&&(!v||!this.doc.contains(v));if(!c.parentNode||p)return;const w=We(c.parentNode)?this.mirror.getId(h):this.mirror.getId(c.parentNode),f=n(c);if(w===-1||f===-1)return r.addNode(c);const S=ke(c,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,enableStrictPrivacy:this.enableStrictPrivacy,onSerialize:T=>{Re(T,this.mirror)&&this.iframeManager.addIframe(T),pr(T,this.mirror)&&this.stylesheetManager.addStylesheet(T),Ue(c)&&this.shadowDomManager.addShadowRoot(c.shadowRoot,document)},onIframeLoad:(T,I)=>{this.iframeManager.attachIframe(T,I,this.mirror),this.shadowDomManager.observeAttachShadow(T)},onStylesheetLoad:(T,I)=>{this.stylesheetManager.attachStylesheet(T,I,this.mirror)}});S&&t.push({parentId:w,nextId:f,node:S})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const c of Array.from(this.movedSet.values()))xt(this.removes,c,this.mirror)&&!this.movedSet.has(c.parentNode)||o(c);for(const c of Array.from(this.addedSet.values()))!kt(this.droppedSet,c)&&!xt(this.removes,c,this.mirror)||kt(this.movedSet,c)?o(c):this.droppedSet.add(c);let i=null;for(;r.length;){let c=null;if(i){const a=this.mirror.getId(i.value.parentNode),s=n(i.value);a!==-1&&s!==-1&&(c=i)}if(!c)for(let a=r.length-1;a>=0;a--){const s=r.get(a);if(s){const u=this.mirror.getId(s.value.parentNode),d=n(s.value);if(u!==-1&&d!==-1){c=s;break}}}if(!c){for(;r.head;)r.removeNode(r.head.value);break}i=c.previous,r.removeNode(c.value),o(c.value)}const l={texts:this.texts.map(c=>{let a=c.value;return this.enableStrictPrivacy&&a&&(a=nr(a)),{id:this.mirror.getId(c.node),value:a}}).filter(c=>this.mirror.has(c.id)),attributes:this.attributes.map(c=>({id:this.mirror.getId(c.node),attributes:c.attributes})).filter(c=>this.mirror.has(c.id)),removes:this.removes,adds:t};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(l))},this.processMutation=t=>{if(!nt(t.target,this.mirror))switch(t.type){case"characterData":{const r=t.target.textContent;!oe(t.target,this.blockClass)&&r!==t.oldValue&&this.texts.push({value:tt(t.target,this.maskTextClass,this.maskTextSelector)&&r?this.maskTextFn?this.maskTextFn(r):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let n=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(n=ft({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),oe(t.target,this.blockClass)||n===t.oldValue)return;let o=this.attributes.find(i=>i.node===t.target);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 l=o.attributes.style;for(const c of Array.from(r.style)){const a=r.style.getPropertyValue(c),s=r.style.getPropertyPriority(c);(a!==i.style.getPropertyValue(c)||s!==i.style.getPropertyPriority(c))&&(s===""?l[c]=a:l[c]=[a,s])}for(const c of Array.from(i.style))r.style.getPropertyValue(c)===""&&(l[c]=!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]=ir(this.doc,t.target.tagName,t.attributeName,n)}break}case"childList":{t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{const n=this.mirror.getId(r),o=We(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);oe(t.target,this.blockClass)||nt(r,this.mirror)||!hr(r,this.mirror)||(this.addedSet.has(r)?(Mt(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||St(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[gr(n,o)]?Mt(this.movedSet,r):this.removes.push({parentId:o,id:n,isShadow:We(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,r)=>{if(!(r&&oe(r,this.blockClass))){if(this.mirror.getMeta(t)){if(nt(t,this.mirror))return;this.movedSet.add(t);let n=null;r&&this.mirror.getMeta(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[gr(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);oe(t,this.blockClass)||t.childNodes.forEach(n=>this.genAdds(n))}}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","enableStrictPrivacy"].forEach(r=>{this[r]=t[r]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Mt(e,t){e.delete(t),t.childNodes.forEach(r=>Mt(e,r))}function xt(e,t,r){const{parentNode:n}=t;if(!n)return!1;const o=r.getId(n);return e.some(i=>i.id===o)?!0:xt(e,n,r)}function kt(e,t){const{parentNode:r}=t;return r?e.has(r)?!0:kt(e,r):!1}var bo=Object.defineProperty,wo=Object.defineProperties,So=Object.getOwnPropertyDescriptors,yr=Object.getOwnPropertySymbols,No=Object.prototype.hasOwnProperty,To=Object.prototype.propertyIsEnumerable,br=(e,t,r)=>t in e?bo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wr=(e,t)=>{for(var r in t||(t={}))No.call(t,r)&&br(e,r,t[r]);if(yr)for(var r of yr(t))To.call(t,r)&&br(e,r,t[r]);return e},Eo=(e,t)=>wo(e,So(t));const Ce=[],Sr=typeof CSSGroupingRule<"u",Nr=typeof CSSMediaRule<"u",Tr=typeof CSSSupportsRule<"u",Er=typeof CSSConditionRule<"u";function Ge(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 Cr(e,t){var r,n;const o=new yo;Ce.push(o),o.init(e);let i=window.MutationObserver||window.__rrMutationObserver;const l=(n=(r=window?.Zone)==null?void 0:r.__symbol__)==null?void 0:n.call(r,"MutationObserver");l&&window[l]&&(i=window[l]);const c=new i(o.processMutations.bind(o));return c.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),c}function Co({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let l=[],c;const a=De(d=>{const m=Date.now()-c;e(l.map(h=>(h.timeOffset-=m,h)),d),l=[],c=null},i),s=De(d=>{const m=Ge(d),{clientX:h,clientY:v}=Nt(d)?d.changedTouches[0]:d;c||(c=Date.now()),l.push({x:h,y:v,id:n.getId(m),timeOffset:Date.now()-c}),a(typeof DragEvent<"u"&&d instanceof DragEvent?A.Drag:d instanceof MouseEvent?A.MouseMove:A.TouchMove)},o,{trailing:!1}),u=[se("mousemove",s,r),se("touchmove",s,r),se("drag",s,r)];return()=>{u.forEach(d=>d())}}function Io({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const i=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,l=[],c=a=>s=>{const u=Ge(s);if(oe(u,n)||dr(u))return;const d=Nt(s)?s.changedTouches[0]:s;if(!d)return;const m=r.getId(u),{clientX:h,clientY:v}=d;e({type:te[a],id:m,x:h,y:v})};return Object.keys(te).filter(a=>Number.isNaN(Number(a))&&!a.endsWith("_Departed")&&i[a]!==!1).forEach(a=>{const s=a.toLowerCase(),u=c(a);l.push(se(s,u,t))}),()=>{l.forEach(a=>a())}}function Ir({scrollCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){const i=De(l=>{const c=Ge(l);if(!c||oe(c,n))return;const a=r.getId(c);if(c===t){const s=t.scrollingElement||t.documentElement;e({id:a,x:s.scrollLeft,y:s.scrollTop})}else e({id:a,x:c.scrollLeft,y:c.scrollTop})},o.scroll||100);return se("scroll",i,t)}function Mo({viewportResizeCb:e}){let t=-1,r=-1;const n=De(()=>{const o=bt(),i=wt();(t!==o||r!==i)&&(e({width:Number(i),height:Number(o)}),t=o,r=i)},200);return se("resize",n,window)}function Mr(e,t){const r=wr({},e);return t||delete r.userTriggered,r}const xo=["INPUT","TEXTAREA","SELECT"],xr=new WeakMap;function ko({inputCb:e,doc:t,mirror:r,blockClass:n,ignoreClass:o,maskInputOptions:i,maskInputFn:l,sampling:c,userTriggeredOnInput:a}){function s(v){let p=Ge(v);const w=v.isTrusted;if(p&&p.tagName==="OPTION"&&(p=p.parentElement),!p||!p.tagName||xo.indexOf(p.tagName)<0||oe(p,n))return;const f=p.type;if(p.classList.contains(o))return;let S=p.value,T=!1;f==="radio"||f==="checkbox"?T=p.checked:(i[p.tagName.toLowerCase()]||i[f])&&(S=ft({maskInputOptions:i,tagName:p.tagName,type:f,value:S,maskInputFn:l})),u(p,Mr({text:S,isChecked:T,userTriggered:w},a));const I=p.name;f==="radio"&&I&&T&&t.querySelectorAll(`input[type="radio"][name="${I}"]`).forEach(R=>{R!==p&&u(R,Mr({text:R.value,isChecked:!T,userTriggered:!1},a))})}function u(v,p){const w=xr.get(v);if(!w||w.text!==p.text||w.isChecked!==p.isChecked){xr.set(v,p);const f=r.getId(v);e(Eo(wr({},p),{id:f}))}}const d=(c.input==="last"?["change"]:["input","change"]).map(v=>se(v,s,t)),m=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),h=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return m&&m.set&&d.push(...h.map(v=>Ve(v[0],v[1],{set(){s({target:this})}}))),()=>{d.forEach(v=>v())}}function ot(e){const t=[];function r(n,o){if(Sr&&n.parentRule instanceof CSSGroupingRule||Nr&&n.parentRule instanceof CSSMediaRule||Tr&&n.parentRule instanceof CSSSupportsRule||Er&&n.parentRule instanceof CSSConditionRule){const i=Array.from(n.parentRule.cssRules).indexOf(n);o.unshift(i)}else{const i=Array.from(n.parentStyleSheet.cssRules).indexOf(n);o.unshift(i)}return o}return r(e,t)}function Oo({styleSheetRuleCb:e,mirror:t},{win:r}){const n=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=function(c,a){const s=t.getId(this.ownerNode);return s!==-1&&e({id:s,adds:[{rule:c,index:a}]}),n.apply(this,arguments)};const o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=function(c){const a=t.getId(this.ownerNode);return a!==-1&&e({id:a,removes:[{index:c}]}),o.apply(this,arguments)};const i={};Sr?i.CSSGroupingRule=r.CSSGroupingRule:(Nr&&(i.CSSMediaRule=r.CSSMediaRule),Er&&(i.CSSConditionRule=r.CSSConditionRule),Tr&&(i.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(i).forEach(([c,a])=>{l[c]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=function(s,u){const d=t.getId(this.parentStyleSheet.ownerNode);return d!==-1&&e({id:d,adds:[{rule:s,index:[...ot(this),u||0]}]}),l[c].insertRule.apply(this,arguments)},a.prototype.deleteRule=function(s){const u=t.getId(this.parentStyleSheet.ownerNode);return u!==-1&&e({id:u,removes:[{index:[...ot(this),s]}]}),l[c].deleteRule.apply(this,arguments)}}),()=>{r.CSSStyleSheet.prototype.insertRule=n,r.CSSStyleSheet.prototype.deleteRule=o,Object.entries(i).forEach(([c,a])=>{a.prototype.insertRule=l[c].insertRule,a.prototype.deleteRule=l[c].deleteRule})}}function Do({styleDeclarationCb:e,mirror:t},{win:r}){const n=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=function(i,l,c){var a,s;const u=t.getId((s=(a=this.parentRule)==null?void 0:a.parentStyleSheet)==null?void 0:s.ownerNode);return u!==-1&&e({id:u,set:{property:i,value:l,priority:c},index:ot(this.parentRule)}),n.apply(this,arguments)};const o=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=function(i){var l,c;const a=t.getId((c=(l=this.parentRule)==null?void 0:l.parentStyleSheet)==null?void 0:c.ownerNode);return a!==-1&&e({id:a,remove:{property:i},index:ot(this.parentRule)}),o.apply(this,arguments)},()=>{r.CSSStyleDeclaration.prototype.setProperty=n,r.CSSStyleDeclaration.prototype.removeProperty=o}}function Ro({mediaInteractionCb:e,blockClass:t,mirror:r,sampling:n}){const o=l=>De(c=>{const a=Ge(c);if(!a||oe(a,t))return;const{currentTime:s,volume:u,muted:d}=a;e({type:l,id:r.getId(a),currentTime:s,volume:u,muted:d})},n.media||500),i=[se("play",o(Ee.Play)),se("pause",o(Ee.Pause)),se("seeked",o(Ee.Seeked)),se("volumechange",o(Ee.VolumeChange))];return()=>{i.forEach(l=>l())}}function Lo({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],o=new WeakMap,i=r.FontFace;r.FontFace=function(c,a,s){const u=new i(c,a,s);return o.set(u,{family:c,buffer:typeof a!="string",descriptors:s,fontSource:typeof a=="string"?a:JSON.stringify(Array.from(new Uint8Array(a)))}),u};const l=be(t.fonts,"add",function(c){return function(a){return setTimeout(()=>{const s=o.get(a);s&&(e(s),o.delete(a))},0),c.apply(this,[a])}});return n.push(()=>{r.FontFace=i}),n.push(l),()=>{n.forEach(c=>c())}}function Ao(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:l,inputCb:c,mediaInteractionCb:a,styleSheetRuleCb:s,styleDeclarationCb:u,canvasMutationCb:d,fontCb:m}=e;e.mutationCb=(...h)=>{t.mutation&&t.mutation(...h),r(...h)},e.mousemoveCb=(...h)=>{t.mousemove&&t.mousemove(...h),n(...h)},e.mouseInteractionCb=(...h)=>{t.mouseInteraction&&t.mouseInteraction(...h),o(...h)},e.scrollCb=(...h)=>{t.scroll&&t.scroll(...h),i(...h)},e.viewportResizeCb=(...h)=>{t.viewportResize&&t.viewportResize(...h),l(...h)},e.inputCb=(...h)=>{t.input&&t.input(...h),c(...h)},e.mediaInteractionCb=(...h)=>{t.mediaInteaction&&t.mediaInteaction(...h),a(...h)},e.styleSheetRuleCb=(...h)=>{t.styleSheetRule&&t.styleSheetRule(...h),s(...h)},e.styleDeclarationCb=(...h)=>{t.styleDeclaration&&t.styleDeclaration(...h),u(...h)},e.canvasMutationCb=(...h)=>{t.canvasMutation&&t.canvasMutation(...h),d(...h)},e.fontCb=(...h)=>{t.font&&t.font(...h),m(...h)}}function Fo(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};Ao(e,t);const n=Cr(e,e.doc),o=Co(e),i=Io(e),l=Ir(e),c=Mo(e),a=ko(e),s=Ro(e),u=Oo(e,{win:r}),d=Do(e,{win:r}),m=e.collectFonts?Lo(e):()=>{},h=[];for(const v of e.plugins)h.push(v.observer(v.callback,r,v.options));return()=>{Ce.forEach(v=>v.reset()),n.disconnect(),o(),i(),l(),c(),a(),s(),u(),d(),m(),h.forEach(v=>v())}}class Po{constructor(t){this.iframes=new WeakMap,this.mutationCb=t.mutationCb}addIframe(t){this.iframes.set(t,!0)}addLoadListener(t){this.loadListener=t}attachIframe(t,r,n){var o;this.mutationCb({adds:[{parentId:n.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(o=this.loadListener)==null||o.call(this,t)}}var _o=Object.defineProperty,$o=Object.defineProperties,Wo=Object.getOwnPropertyDescriptors,kr=Object.getOwnPropertySymbols,jo=Object.prototype.hasOwnProperty,Vo=Object.prototype.propertyIsEnumerable,Or=(e,t,r)=>t in e?_o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Dr=(e,t)=>{for(var r in t||(t={}))jo.call(t,r)&&Or(e,r,t[r]);if(kr)for(var r of kr(t))Vo.call(t,r)&&Or(e,r,t[r]);return e},Rr=(e,t)=>$o(e,Wo(t));class Uo{constructor(t){this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;const r=this;this.restorePatches.push(be(HTMLElement.prototype,"attachShadow",function(n){return function(){const o=n.apply(this,arguments);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,this.ownerDocument),o}}))}addShadowRoot(t,r){Cr(Rr(Dr({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),Ir(Rr(Dr({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}observeAttachShadow(t){if(t.contentWindow){const r=this;this.restorePatches.push(be(t.contentWindow.HTMLElement.prototype,"attachShadow",function(n){return function(){const o=n.apply(this,arguments);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,t.contentDocument),o}}))}}reset(){this.restorePatches.forEach(t=>t())}}for(var Ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Be=typeof Uint8Array>"u"?[]:new Uint8Array(256),it=0;it<Ae.length;it++)Be[Ae.charCodeAt(it)]=it;var Go=function(e){var t=new Uint8Array(e),r,n=t.length,o="";for(r=0;r<n;r+=3)o+=Ae[t[r]>>2],o+=Ae[(t[r]&3)<<4|t[r+1]>>4],o+=Ae[(t[r+1]&15)<<2|t[r+2]>>6],o+=Ae[t[r+2]&63];return n%3===2?o=o.substring(0,o.length-1)+"=":n%3===1&&(o=o.substring(0,o.length-2)+"=="),o},Bo=function(e){var t=e.length*.75,r=e.length,n,o=0,i,l,c,a;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var s=new ArrayBuffer(t),u=new Uint8Array(s);for(n=0;n<r;n+=4)i=Be[e.charCodeAt(n)],l=Be[e.charCodeAt(n+1)],c=Be[e.charCodeAt(n+2)],a=Be[e.charCodeAt(n+3)],u[o++]=i<<2|l>>4,u[o++]=(l&15)<<4|c>>2,u[o++]=(c&3)<<6|a&63;return s};const Lr=new Map;function zo(e,t){let r=Lr.get(e);return r||(r=new Map,Lr.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}const Ar=(e,t,r)=>{if(!e||!(Pr(e,t)||typeof e=="object"))return;const n=e.constructor.name,o=zo(r,n);let i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};function st(e,t,r){if(e instanceof Array)return e.map(n=>st(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){const n=e.constructor.name,o=Go(e);return{rr_type:n,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[st(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const n=e.constructor.name,{src:o}=e;return{rr_type:n,src:o}}else if(e instanceof HTMLCanvasElement){const n="HTMLImageElement",o=e.toDataURL();return{rr_type:n,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[st(e.data,t,r),e.width,e.height]};if(Pr(e,t)||typeof e=="object"){const n=e.constructor.name,o=Ar(e,t,r);return{rr_type:n,index:o}}}}return e}const Fr=(e,t,r)=>[...e].map(n=>st(n,t,r)),Pr=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(n=>typeof t[n]=="function");return Boolean(r.find(n=>e instanceof t[n]))};function Ho(e,t,r,n){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const l of i)try{if(typeof t.CanvasRenderingContext2D.prototype[l]!="function")continue;const c=be(t.CanvasRenderingContext2D.prototype,l,function(a){return function(...s){return oe(this.canvas,r)||setTimeout(()=>{const u=Fr([...s],t,this);e(this.canvas,{type:ve["2D"],property:l,args:u})},0),a.apply(this,s)}});o.push(c)}catch{const a=Ve(t.CanvasRenderingContext2D.prototype,l,{set(s){e(this.canvas,{type:ve["2D"],property:l,args:[s],setter:!0})}});o.push(a)}return()=>{o.forEach(l=>l())}}function _r(e,t){const r=[];try{const n=be(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(i,...l){return oe(this,t)||"__context"in this||(this.__context=i),o.apply(this,[i,...l])}});r.push(n)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(n=>n())}}function $r(e,t,r,n,o,i){const l=[],c=Object.getOwnPropertyNames(e);for(const a of c)try{if(typeof e[a]!="function")continue;const s=be(e,a,function(u){return function(...d){const m=u.apply(this,d);if(Ar(m,i,e),!oe(this.canvas,n)){const h=o.getId(this.canvas),v=Fr([...d],i,e),p={type:t,property:a,args:v};r(this.canvas,p)}return m}});l.push(s)}catch{const u=Ve(e,a,{set(d){r(this.canvas,{type:t,property:a,args:[d],setter:!0})}});l.push(u)}return l}function Yo(e,t,r,n){const o=[];return o.push(...$r(t.WebGLRenderingContext.prototype,ve.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...$r(t.WebGL2RenderingContext.prototype,ve.WebGL2,e,r,n,t)),()=>{o.forEach(i=>i())}}function Xo(e,t){var r=atob(e);if(t){for(var n=new Uint8Array(r.length),o=0,i=r.length;o<i;++o)n[o]=r.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}function Zo(e,t,r){var n=t===void 0?null:t,o=r===void 0?!1:r,i=Xo(e,o),l=i.indexOf(`
5
- `,10)+1,c=i.substring(l)+(n?"//# sourceMappingURL="+n:""),a=new Blob([c],{type:"application/javascript"});return URL.createObjectURL(a)}function Ko(e,t,r){var n;return function(i){return n=n||Zo(e,t,r),new Worker(n,i)}}var qo=Ko("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Zm9yKHZhciByPSJBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OSsvIixsPXR5cGVvZiBVaW50OEFycmF5PiJ1Ij9bXTpuZXcgVWludDhBcnJheSgyNTYpLGY9MDtmPHIubGVuZ3RoO2YrKylsW3IuY2hhckNvZGVBdChmKV09Zjt2YXIgZD1mdW5jdGlvbihzKXt2YXIgZT1uZXcgVWludDhBcnJheShzKSxuLGE9ZS5sZW5ndGgsdD0iIjtmb3Iobj0wO248YTtuKz0zKXQrPXJbZVtuXT4+Ml0sdCs9clsoZVtuXSYzKTw8NHxlW24rMV0+PjRdLHQrPXJbKGVbbisxXSYxNSk8PDJ8ZVtuKzJdPj42XSx0Kz1yW2VbbisyXSY2M107cmV0dXJuIGElMz09PTI/dD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTEpKyI9IjphJTM9PT0xJiYodD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTIpKyI9PSIpLHR9O2NvbnN0IGM9bmV3IE1hcCx1PW5ldyBNYXA7YXN5bmMgZnVuY3Rpb24gcChzLGUpe2NvbnN0IG49YCR7c30tJHtlfWA7aWYodS5oYXMobikpcmV0dXJuIHUuZ2V0KG4pO2NvbnN0IGE9bmV3IE9mZnNjcmVlbkNhbnZhcyhzLGUpO2EuZ2V0Q29udGV4dCgiMmQiKTtjb25zdCB0PWF3YWl0KGF3YWl0IGEuY29udmVydFRvQmxvYigpKS5hcnJheUJ1ZmZlcigpLGc9ZCh0KTtyZXR1cm4gdS5zZXQobixnKSxnfWNvbnN0IGk9c2VsZjtpLm9ubWVzc2FnZT1hc3luYyBmdW5jdGlvbihzKXtpZighKCJPZmZzY3JlZW5DYW52YXMiaW4gZ2xvYmFsVGhpcykpcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOnMuZGF0YS5pZH0pO2NvbnN0e2lkOmUsYml0bWFwOm4sd2lkdGg6YSxoZWlnaHQ6dH09cy5kYXRhLGc9cChhLHQpLGg9bmV3IE9mZnNjcmVlbkNhbnZhcyhhLHQpO2guZ2V0Q29udGV4dCgiMmQiKS5kcmF3SW1hZ2UobiwwLDApLG4uY2xvc2UoKTtjb25zdCB3PWF3YWl0IGguY29udmVydFRvQmxvYigpLHk9dy50eXBlLGI9YXdhaXQgdy5hcnJheUJ1ZmZlcigpLG89ZChiKTtpZighYy5oYXMoZSkmJmF3YWl0IGc9PT1vKXJldHVybiBjLnNldChlLG8pLGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpZihjLmdldChlKT09PW8pcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpLnBvc3RNZXNzYWdlKHtpZDplLHR5cGU6eSxiYXNlNjQ6byx3aWR0aDphLGhlaWdodDp0fSksYy5zZXQoZSxvKX19KSgpOwoK",null,!1),Wr=Object.getOwnPropertySymbols,Jo=Object.prototype.hasOwnProperty,Qo=Object.prototype.propertyIsEnumerable,ei=(e,t)=>{var r={};for(var n in e)Jo.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Wr)for(var n of Wr(e))t.indexOf(n)<0&&Qo.call(e,n)&&(r[n]=e[n]);return r},ti=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});class ri{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(l,c){(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(c)};const{sampling:r="all",win:n,blockClass:o,recordCanvas:i}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,i&&r==="all"&&this.initCanvasMutationObserver(n,o),i&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,o)}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,n){const o=_r(r,n),i=new Map,l=new qo;l.onmessage=d=>{const{id:m}=d.data;if(i.set(m,!1),!("base64"in d.data))return;const{base64:h,type:v,width:p,height:w}=d.data;this.mutationCb({id:m,type:ve["2D"],commands:[{property:"clearRect",args:[0,0,p,w]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:h}],type:v}]},0,0]}]})};const c=1e3/t;let a=0,s;const u=d=>{if(a&&d-a<c){s=requestAnimationFrame(u);return}a=d,r.document.querySelectorAll(`canvas:not(.${n} *)`).forEach(m=>ti(this,null,function*(){var h;const v=this.mirror.getId(m);if(i.get(v))return;if(i.set(v,!0),["webgl","webgl2"].includes(m.__context)){const w=m.getContext(m.__context);((h=w?.getContextAttributes())==null?void 0:h.preserveDrawingBuffer)===!1&&w?.clear(w.COLOR_BUFFER_BIT)}const p=yield createImageBitmap(m);l.postMessage({id:v,bitmap:p,width:m.width,height:m.height},[p])})),s=requestAnimationFrame(u)};s=requestAnimationFrame(u),this.resetObservers=()=>{o(),cancelAnimationFrame(s)}}initCanvasMutationObserver(t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=_r(t,r),o=Ho(this.processMutation.bind(this),t,r,this.mirror),i=Yo(this.processMutation.bind(this),t,r,this.mirror);this.resetObservers=()=>{n(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;const o=n.map(l=>ei(l,["type"])),{type:i}=n[0];this.mutationCb({id:r,type:i,commands:o}),this.pendingCanvasMutations.delete(t)}}class ni{constructor(t){this.trackedStylesheets=new WeakSet,this.mutationCb=t.mutationCb}addStylesheet(t){this.trackedStylesheets.has(t)||(this.trackedStylesheets.add(t),this.trackStylesheet(t))}trackStylesheet(t){}attachStylesheet(t,r,n){this.mutationCb({adds:[{parentId:n.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[]}),this.addStylesheet(t)}}var oi=Object.defineProperty,ii=Object.defineProperties,si=Object.getOwnPropertyDescriptors,jr=Object.getOwnPropertySymbols,ai=Object.prototype.hasOwnProperty,li=Object.prototype.propertyIsEnumerable,Vr=(e,t,r)=>t in e?oi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ae=(e,t)=>{for(var r in t||(t={}))ai.call(t,r)&&Vr(e,r,t[r]);if(jr)for(var r of jr(t))li.call(t,r)&&Vr(e,r,t[r]);return e},ci=(e,t)=>ii(e,si(t));function re(e){return ci(ae({},e),{timestamp:Date.now()})}let Q,ze;const we=tr();function Ie(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="highlight-block",blockSelector:i=null,ignoreClass:l="highlight-ignore",maskTextClass:c="highlight-mask",maskTextSelector:a=null,inlineStylesheet:s=!0,maskAllInputs:u,maskInputOptions:d,slimDOMOptions:m,maskInputFn:h,maskTextFn:v,hooks:p,packFn:w,sampling:f={},mousemoveWait:S,recordCanvas:T=!1,userTriggeredOnInput:I=!1,collectFonts:R=!1,inlineImages:M=!1,plugins:C,keepIframeSrcFn:y=()=>!1,enableStrictPrivacy:H=!1}=e;if(!t)throw new Error("emit function is required");S!==void 0&&f.mousemove===void 0&&(f.mousemove=S),we.reset();const G=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},K=m===!0||m==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:m==="all",headMetaDescKeywords:m==="all"}:m||{};Tt();let V,U=0;const Y=E=>{for(const F of C||[])F.eventProcessor&&(E=F.eventProcessor(E));return w&&(E=w(E)),E};Q=(E,F)=>{var P;if(((P=Ce[0])==null?void 0:P.isFrozen())&&E.type!==O.FullSnapshot&&!(E.type===O.IncrementalSnapshot&&E.data.source===A.Mutation)&&Ce.forEach(k=>k.unfreeze()),t(Y(E),F),E.type===O.FullSnapshot)V=E,U=0;else if(E.type===O.IncrementalSnapshot){if(E.data.source===A.Mutation&&E.data.isAttachIframe)return;U++;const k=n&&U>=n,ee=r&&E.timestamp-V.timestamp>r;(k||ee)&&ze(!0)}};const B=E=>{Q(re({type:O.IncrementalSnapshot,data:ae({source:A.Mutation},E)}))},L=E=>Q(re({type:O.IncrementalSnapshot,data:ae({source:A.Scroll},E)})),x=E=>Q(re({type:O.IncrementalSnapshot,data:ae({source:A.CanvasMutation},E)})),D=new Po({mutationCb:B}),b=new ni({mutationCb:B}),g=new ri({recordCanvas:T,mutationCb:x,win:window,blockClass:o,mirror:we,sampling:f.canvas}),N=new Uo({mutationCb:B,scrollCb:L,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:a,inlineStylesheet:s,maskInputOptions:G,maskTextFn:v,maskInputFn:h,recordCanvas:T,inlineImages:M,sampling:f,slimDOMOptions:K,iframeManager:D,stylesheetManager:b,canvasManager:g,enableStrictPrivacy:H},mirror:we});ze=(E=!1)=>{var F,P,k,ee;Q(re({type:O.Meta,data:{href:window.location.href,width:wt(),height:bt()}}),E),Ce.forEach(W=>W.lock());const _=so(document,{mirror:we,blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:a,inlineStylesheet:s,maskAllInputs:G,maskTextFn:v,slimDOM:K,recordCanvas:T,inlineImages:M,enableStrictPrivacy:H,onSerialize:W=>{Re(W,we)&&D.addIframe(W),Ue(W)&&N.addShadowRoot(W.shadowRoot,document)},onIframeLoad:(W,de)=>{D.attachIframe(W,de,we),N.observeAttachShadow(W)},onStylesheetLoad:(W,de)=>{this.stylesheetManager.attachStylesheet(W,de,this.mirror)},keepIframeSrcFn:y});if(!_)return console.warn("Failed to snapshot the document");Q(re({type:O.FullSnapshot,data:{node:_,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((P=(F=document?.body)==null?void 0:F.parentElement)==null?void 0:P.scrollLeft)||document?.body.scrollLeft||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((ee=(k=document?.body)==null?void 0:k.parentElement)==null?void 0:ee.scrollTop)||document?.body.scrollTop||0}}})),Ce.forEach(W=>W.unlock())};try{const E=[];E.push(se("DOMContentLoaded",()=>{Q(re({type:O.DomContentLoaded,data:{}}))}));const F=k=>{var ee;return Fo({mutationCb:B,mousemoveCb:(_,W)=>Q(re({type:O.IncrementalSnapshot,data:{source:W,positions:_}})),mouseInteractionCb:_=>Q(re({type:O.IncrementalSnapshot,data:ae({source:A.MouseInteraction},_)})),scrollCb:L,viewportResizeCb:_=>Q(re({type:O.IncrementalSnapshot,data:ae({source:A.ViewportResize},_)})),inputCb:_=>Q(re({type:O.IncrementalSnapshot,data:ae({source:A.Input},_)})),mediaInteractionCb:_=>Q(re({type:O.IncrementalSnapshot,data:ae({source:A.MediaInteraction},_)})),styleSheetRuleCb:_=>Q(re({type:O.IncrementalSnapshot,data:ae({source:A.StyleSheetRule},_)})),styleDeclarationCb:_=>Q(re({type:O.IncrementalSnapshot,data:ae({source:A.StyleDeclaration},_)})),canvasMutationCb:x,fontCb:_=>Q(re({type:O.IncrementalSnapshot,data:ae({source:A.Font},_)})),blockClass:o,ignoreClass:l,maskTextClass:c,maskTextSelector:a,maskInputOptions:G,inlineStylesheet:s,sampling:f,recordCanvas:T,inlineImages:M,userTriggeredOnInput:I,collectFonts:R,doc:k,maskInputFn:h,maskTextFn:v,blockSelector:i,slimDOMOptions:K,mirror:we,iframeManager:D,stylesheetManager:b,shadowDomManager:N,canvasManager:g,enableStrictPrivacy:H,plugins:((ee=C?.filter(_=>_.observer))==null?void 0:ee.map(_=>({observer:_.observer,options:_.options,callback:W=>Q(re({type:O.Plugin,data:{plugin:_.name,payload:W}}))})))||[]},p)};D.addLoadListener(k=>{E.push(F(k.contentDocument))});const P=()=>{ze(),E.push(F(document))};return document.readyState==="interactive"||document.readyState==="complete"?P():E.push(se("load",()=>{Q(re({type:O.Load,data:{}})),P()},window)),()=>{E.forEach(k=>k())}}catch(E){console.warn(E)}}Ie.addCustomEvent=(e,t)=>{!Q||Q(re({type:O.Custom,data:{tag:e,payload:t}}))},Ie.freezePage=()=>{Ce.forEach(e=>e.freeze())},Ie.takeFullSnapshot=e=>{if(!ze)throw new Error("please take full snapshot after start recording");ze(e)},Ie.mirror=we;var $;(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"})($||($={}));var ui=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var r;if(!t)return-1;var n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var r=this,n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(function(o){return r.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function di(){return new ui}function hi(e){const t={},r=/;(?![^(]*\))/g,n=/:(.+)/,o=/\/\*.*?\*\//g;return e.replace(o,"").split(r).forEach(function(i){if(i){const l=i.split(n);l.length>1&&(t[Ot(l[0].trim())]=l[1].trim())}}),t}function Ur(e){const t=[];for(const r in e){const n=e[r];if(typeof n!="string")continue;const o=vi(r);t.push(`${o}: ${n};`)}return t.join(" ")}const mi=/-([a-z])/g,pi=/^--[a-zA-Z0-9-]+$/,Ot=e=>pi.test(e)?e:e.replace(mi,(t,r)=>r?r.toUpperCase():""),fi=/\B([A-Z])/g,vi=e=>e.replace(fi,"-$1").toLowerCase();class le{constructor(...t){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=J.ELEMENT_NODE,this.TEXT_NODE=J.TEXT_NODE}get firstChild(){return this.childNodes[0]||null}get lastChild(){return this.childNodes[this.childNodes.length-1]||null}get nextSibling(){const t=this.parentNode;if(!t)return null;const r=t.childNodes,n=r.indexOf(this);return r[n+1]||null}contains(t){if(t===this)return!0;for(const r of this.childNodes)if(r.contains(t))return!0;return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,r){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function gi(e){return class _n extends e{constructor(){super(...arguments),this.nodeType=J.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=$.Document,this.textContent=null}get documentElement(){return this.childNodes.find(r=>r.RRNodeType===$.Element&&r.tagName==="HTML")||null}get body(){var r;return((r=this.documentElement)===null||r===void 0?void 0:r.childNodes.find(n=>n.RRNodeType===$.Element&&n.tagName==="BODY"))||null}get head(){var r;return((r=this.documentElement)===null||r===void 0?void 0:r.childNodes.find(n=>n.RRNodeType===$.Element&&n.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(r){const n=r.RRNodeType;if((n===$.Element||n===$.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===n))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${n===$.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);return r.parentElement=null,r.parentNode=this,this.childNodes.push(r),r}insertBefore(r,n){const o=r.RRNodeType;if((o===$.Element||o===$.DocumentType)&&this.childNodes.some(l=>l.RRNodeType===o))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${o===$.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);if(n===null)return this.appendChild(r);const i=this.childNodes.indexOf(n);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,r),r.parentElement=null,r.parentNode=this,r}removeChild(r){const n=this.childNodes.indexOf(r);if(n===-1)throw new Error("Failed to execute 'removeChild' on 'RRDocument': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(n,1),r.parentElement=null,r.parentNode=null,r}open(){this.childNodes=[]}close(){}write(r){let n;if(r==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?n="-//W3C//DTD XHTML 1.0 Transitional//EN":r==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(n="-//W3C//DTD HTML 4.0 Transitional//EN"),n){const o=this.createDocumentType("html",n,"");this.open(),this.appendChild(o)}}createDocument(r,n,o){return new _n}createDocumentType(r,n,o){const i=new(Gr(le))(r,n,o);return i.ownerDocument=this,i}createElement(r){const n=new(Br(le))(r);return n.ownerDocument=this,n}createElementNS(r,n){return this.createElement(n)}createTextNode(r){const n=new(zr(le))(r);return n.ownerDocument=this,n}createComment(r){const n=new(Hr(le))(r);return n.ownerDocument=this,n}createCDATASection(r){const n=new(Yr(le))(r);return n.ownerDocument=this,n}toString(){return"RRDocument"}}}function Gr(e){return class extends e{constructor(t,r,n){super(),this.nodeType=J.DOCUMENT_TYPE_NODE,this.RRNodeType=$.DocumentType,this.textContent=null,this.name=t,this.publicId=r,this.systemId=n,this.nodeName=t}toString(){return"RRDocumentType"}}}function Br(e){return class extends e{constructor(t){super(),this.nodeType=J.ELEMENT_NODE,this.RRNodeType=$.Element,this.attributes={},this.shadowRoot=null,this.tagName=t.toUpperCase(),this.nodeName=t.toUpperCase()}get textContent(){let t="";return this.childNodes.forEach(r=>t+=r.textContent),t}set textContent(t){this.childNodes=[this.ownerDocument.createTextNode(t)]}get classList(){return new bi(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?hi(this.attributes.style):{},r=/\B([A-Z])/g;return t.setProperty=(n,o,i)=>{if(r.test(n))return;const l=Ot(n);o?t[l]=o:delete t[l],i==="important"&&(t[l]+=" !important"),this.attributes.style=Ur(t)},t.removeProperty=n=>{if(r.test(n))return"";const o=Ot(n),i=t[o]||"";return delete t[o],this.attributes.style=Ur(t),i},t}getAttribute(t){return this.attributes[t]||null}setAttribute(t,r){this.attributes[t]=r}setAttributeNS(t,r,n){this.setAttribute(r,n)}removeAttribute(t){delete this.attributes[t]}appendChild(t){return this.childNodes.push(t),t.parentNode=this,t.parentElement=this,t}insertBefore(t,r){if(r===null)return this.appendChild(t);const n=this.childNodes.indexOf(r);if(n==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(n,0,t),t.parentElement=this,t.parentNode=this,t}removeChild(t){const r=this.childNodes.indexOf(t);if(r===-1)throw new Error("Failed to execute 'removeChild' on 'RRElement': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(r,1),t.parentElement=null,t.parentNode=null,t}attachShadow(t){const r=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=r,r}dispatchEvent(t){return!0}toString(){let t="";for(const r in this.attributes)t+=`${r}="${this.attributes[r]}" `;return`${this.tagName} ${t}`}}}function yi(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 zr(e){return class extends e{constructor(t){super(),this.nodeType=J.TEXT_NODE,this.nodeName="#text",this.RRNodeType=$.Text,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function Hr(e){return class extends e{constructor(t){super(),this.nodeType=J.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=$.Comment,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function Yr(e){return class extends e{constructor(t){super(),this.nodeName="#cdata-section",this.nodeType=J.CDATA_SECTION_NODE,this.RRNodeType=$.CDATA,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class bi{constructor(t,r){if(this.classes=[],this.add=(...n)=>{for(const o of n){const i=String(o);this.classes.indexOf(i)>=0||this.classes.push(i)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...n)=>{this.classes=this.classes.filter(o=>n.indexOf(o)===-1),this.onChange&&this.onChange(this.classes.join(" "))},t){const n=t.trim().split(/\s+/);this.classes.push(...n)}this.onChange=r}}var J;(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"})(J||(J={}));const Dt={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"};function me(e,t,r,n){const o=e.childNodes,i=t.childNodes;n=n||t.mirror||t.ownerDocument.mirror,(o.length>0||i.length>0)&&Xr(Array.from(o),i,e,r,n);let l=null,c=null;switch(t.RRNodeType){case $.Document:{c=t.scrollData;break}case $.Element:{const a=e,s=t;switch(wi(a,s,n),c=s.scrollData,l=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":t.canvasMutations.forEach(u=>r.applyCanvas(u.event,u.mutation,e));break;case"STYLE":Si(a,t.rules);break}if(s.shadowRoot){a.shadowRoot||a.attachShadow({mode:"open"});const u=a.shadowRoot.childNodes,d=s.shadowRoot.childNodes;(u.length>0||d.length>0)&&Xr(Array.from(u),d,a.shadowRoot,r,n)}break}case $.Text:case $.Comment:case $.CDATA:e.textContent!==t.data&&(e.textContent=t.data);break}if(c&&r.applyScroll(c,!0),l&&r.applyInput(l),t.nodeName==="IFRAME"){const a=e.contentDocument,s=t;if(a){const u=n.getMeta(s.contentDocument);u&&r.mirror.add(a,Object.assign({},u)),me(a,s.contentDocument,r,n)}}}function wi(e,t,r){const n=e.attributes,o=t.attributes;for(const i in o){const l=o[i],c=r.getMeta(t);if(c&&"isSVG"in c&&c.isSVG&&Dt[i])e.setAttributeNS(Dt[i],i,l);else if(t.tagName==="CANVAS"&&i==="rr_dataURL"){const a=document.createElement("img");a.src=l,a.onload=()=>{const s=e.getContext("2d");s&&s.drawImage(a,0,0,a.width,a.height)}}else e.setAttribute(i,l)}for(const{name:i}of Array.from(n))i in o||e.removeAttribute(i);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function Xr(e,t,r,n,o){var i,l;let c=0,a=e.length-1,s=0,u=t.length-1,d=e[c],m=e[a],h=t[s],v=t[u],p,w;for(;c<=a&&s<=u;)if(d===void 0)d=e[++c];else if(m===void 0)m=e[--a];else if(n.mirror.getId(d)===o.getId(h))me(d,h,n,o),d=e[++c],h=t[++s];else if(n.mirror.getId(m)===o.getId(v))me(m,v,n,o),m=e[--a],v=t[--u];else if(n.mirror.getId(d)===o.getId(v))r.insertBefore(d,m.nextSibling),me(d,v,n,o),d=e[++c],v=t[--u];else if(n.mirror.getId(m)===o.getId(h))r.insertBefore(m,d),me(m,h,n,o),m=e[--a],h=t[++s];else{if(!p){p={};for(let f=c;f<=a;f++){const S=e[f];S&&n.mirror.hasNode(S)&&(p[n.mirror.getId(S)]=f)}}if(w=p[o.getId(h)],w){const f=e[w];r.insertBefore(f,d),me(f,h,n,o),e[w]=void 0}else{const f=Rt(h,n.mirror,o);((i=n.mirror.getMeta(r))===null||i===void 0?void 0:i.type)===$.Document&&((l=n.mirror.getMeta(f))===null||l===void 0?void 0:l.type)===$.Element&&r.documentElement&&(r.removeChild(r.documentElement),e[c]=void 0,d=void 0),r.insertBefore(f,d||null),me(f,h,n,o)}h=t[++s]}if(c>a){const f=t[u+1];let S=null;for(f&&r.childNodes.forEach(T=>{n.mirror.getId(T)===o.getId(f)&&(S=T)});s<=u;++s){const T=Rt(t[s],n.mirror,o);r.insertBefore(T,S),me(T,t[s],n,o)}}else if(s>u)for(;c<=a;c++){const f=e[c];f&&(r.removeChild(f),n.mirror.removeNodeFromMap(f))}}function Rt(e,t,r){let n=t.getNode(r.getId(e));const o=r.getMeta(e);if(n!==null)return n;switch(e.RRNodeType){case $.Document:n=new Document;break;case $.DocumentType:n=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case $.Element:{e.tagName.toLowerCase(),o&&"isSVG"in o&&o?.isSVG?n=document.createElementNS(Dt.svg,e.tagName.toLowerCase()):n=document.createElement(e.tagName);break}case $.Text:n=document.createTextNode(e.data);break;case $.Comment:n=document.createComment(e.data);break;case $.CDATA:n=document.createCDATASection(e.data);break}return o&&t.add(n,Object.assign({},o)),n}function He(e,t){const r=e[t[0]];return t.length===1?r:He(r.cssRules[t[1]].cssRules,t.slice(2))}var ce;(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"})(ce||(ce={}));function Zr(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function Si(e,t){const r=e.sheet;t.forEach(n=>{if(n.type===ce.Insert)try{if(Array.isArray(n.index)){const{positions:o,index:i}=Zr(n.index);He(r.cssRules,o).insertRule(n.cssText,i)}else r.insertRule(n.cssText,n.index)}catch{}else if(n.type===ce.Remove)try{if(Array.isArray(n.index)){const{positions:o,index:i}=Zr(n.index);He(r.cssRules,o).deleteRule(i||0)}else r.deleteRule(n.index)}catch{}else n.type===ce.SetProperty?He(r.cssRules,n.index).style.setProperty(n.property,n.value,n.priority):n.type===ce.RemoveProperty&&He(r.cssRules,n.index).style.removeProperty(n.property)})}class Fe extends gi(le){constructor(t){super(),this._unserializedId=-1,this.mirror=Ri(),this.scrollData=null,t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,r,n){return new Fe}createDocumentType(t,r,n){const o=new Ni(t,r,n);return o.ownerDocument=this,o}createElement(t){const r=t.toUpperCase();let n;switch(r){case"AUDIO":case"VIDEO":n=new Ti(r);break;case"IFRAME":n=new Ii(r,this.mirror);break;case"CANVAS":n=new Ei(r);break;case"STYLE":n=new Ci(r);break;default:n=new Ye(r);break}return n.ownerDocument=this,n}createComment(t){const r=new xi(t);return r.ownerDocument=this,r}createCDATASection(t){const r=new ki(t);return r.ownerDocument=this,r}createTextNode(t){const r=new Mi(t);return r.ownerDocument=this,r}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=-1}}const Ni=Gr(le);class Ye extends Br(le){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class Ti extends yi(Ye){}class Ei extends Ye{constructor(){super(...arguments),this.canvasMutations=[]}getContext(){return null}}class Ci extends Ye{constructor(){super(...arguments),this.rules=[]}}class Ii extends Ye{constructor(t,r){super(t),this.contentDocument=new Fe,this.contentDocument.mirror=r}}const Mi=zr(le),xi=Hr(le),ki=Yr(le);function Oi(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function Kr(e,t,r,n){let o;switch(e.nodeType){case J.DOCUMENT_NODE:n&&n.nodeName==="IFRAME"?o=n.contentDocument:(o=t,o.compatMode=e.compatMode);break;case J.DOCUMENT_TYPE_NODE:const l=e;o=t.createDocumentType(l.name,l.publicId,l.systemId);break;case J.ELEMENT_NODE:const c=e,a=Oi(c);o=t.createElement(a);const s=o;for(const{name:u,value:d}of Array.from(c.attributes))s.attributes[u]=d;c.scrollLeft&&(s.scrollLeft=c.scrollLeft),c.scrollTop&&(s.scrollTop=c.scrollTop);break;case J.TEXT_NODE:o=t.createTextNode(e.textContent||"");break;case J.CDATA_SECTION_NODE:o=t.createCDATASection(e.data);break;case J.COMMENT_NODE:o=t.createComment(e.textContent||"");break;case J.DOCUMENT_FRAGMENT_NODE:o=n.attachShadow({mode:"open"});break;default:return null}let i=r.getMeta(e);return t instanceof Fe&&(i||(i=qr(o,t.unserializedId),r.add(e,i)),t.mirror.add(o,Object.assign({},i))),o}function Di(e,t=di(),r=new Fe){function n(o,i){const l=Kr(o,r,t,i);l!==null&&(i?.nodeName!=="IFRAME"&&o.nodeType!==J.DOCUMENT_FRAGMENT_NODE&&(i?.appendChild(l),l.parentNode=i,l.parentElement=i),o.nodeName==="IFRAME"?n(o.contentDocument,l):(o.nodeType===J.DOCUMENT_NODE||o.nodeType===J.ELEMENT_NODE||o.nodeType===J.DOCUMENT_FRAGMENT_NODE)&&(o.nodeType===J.ELEMENT_NODE&&o.shadowRoot&&n(o.shadowRoot,l),o.childNodes.forEach(c=>n(c,l))))}return n(e,null),r}function Ri(){return new Li}class Li{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){var r;if(!t)return-1;const n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){const n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function qr(e,t){switch(e.RRNodeType){case $.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case $.DocumentType:const r=e;return{id:t,type:e.RRNodeType,name:r.name,publicId:r.publicId,systemId:r.systemId};case $.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case $.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case $.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case $.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}function Jr(e){return e=e||Object.create(null),{on:function(r,n){(e[r]||(e[r]=[])).push(n)},off:function(r,n){e[r]&&e[r].splice(e[r].indexOf(n)>>>0,1)},emit:function(r,n){(e[r]||[]).slice().map(function(o){o(n)}),(e["*"]||[]).slice().map(function(o){o(r,n)})}}}var Ai=Object.freeze({__proto__:null,default:Jr});function Fi(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;const r=e.HTMLElement||e.Element,n=468,o={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||a,scrollIntoView:r.prototype.scrollIntoView},i=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function l(f){const S=["MSIE ","Trident/","Edge/"];return new RegExp(S.join("|")).test(f)}const c=l(e.navigator.userAgent)?1:0;function a(f,S){this.scrollLeft=f,this.scrollTop=S}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,S){if(S==="Y")return f.clientHeight+c<f.scrollHeight;if(S==="X")return f.clientWidth+c<f.scrollWidth}function m(f,S){const T=e.getComputedStyle(f,null)["overflow"+S];return T==="auto"||T==="scroll"}function h(f){const S=d(f,"Y")&&m(f,"Y"),T=d(f,"X")&&m(f,"X");return S||T}function v(f){for(;f!==t.body&&h(f)===!1;)f=f.parentNode||f.host;return f}function p(f){const S=i();let T,I,R,M=(S-f.startTime)/n;M=M>1?1:M,T=s(M),I=f.startX+(f.x-f.startX)*T,R=f.startY+(f.y-f.startY)*T,f.method.call(f.scrollable,I,R),(I!==f.x||R!==f.y)&&e.requestAnimationFrame(p.bind(e,f))}function w(f,S,T){let I,R,M,C;const y=i();f===t.body?(I=e,R=e.scrollX||e.pageXOffset,M=e.scrollY||e.pageYOffset,C=o.scroll):(I=f,R=f.scrollLeft,M=f.scrollTop,C=a),p({scrollable:I,method:C,startTime:y,startX:R,startY:M,x:S,y:T})}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}w.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}w.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset))}},r.prototype.scroll=r.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(u(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const f=arguments[0].left,S=arguments[0].top;w.call(this,this,typeof f>"u"?this.scrollLeft:~~f,typeof S>"u"?this.scrollTop:~~S)},r.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},r.prototype.scrollIntoView=function(){if(u(arguments[0])===!0){o.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const f=v(this),S=f.getBoundingClientRect(),T=this.getBoundingClientRect();f!==t.body?(w.call(this,f,f.scrollLeft+T.left-S.left,f.scrollTop+T.top-S.top),e.getComputedStyle(f).position!=="fixed"&&e.scrollBy({left:S.left,top:S.top,behavior:"smooth"})):e.scrollBy({left:T.left,top:T.top,behavior:"smooth"})}}class Pi{constructor(t=[],r){this.timeOffset=0,this.raf=null,this.actions=t,this.speed=r}addAction(t){const r=this.findActionIndex(t);this.actions.splice(r,0,t)}addActions(t){this.actions=this.actions.concat(t)}replaceActions(t){this.actions.length=0,this.actions.splice(0,0,...t)}start(){this.timeOffset=0;let t=performance.now();const{actions:r}=this,n=this;function o(){const i=performance.now();for(n.timeOffset+=(i-t)*n.speed,t=i;r.length;){const l=r[0];if(n.timeOffset>=l.delay)r.shift(),l.doAction();else break}(r.length>0||n.liveMode)&&(n.raf=requestAnimationFrame(o))}this.raf=requestAnimationFrame(o)}clear(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(t){this.speed=t}toggleLiveMode(t){this.liveMode=t}isActive(){return this.raf!==null}findActionIndex(t){let r=0,n=this.actions.length-1;for(;r<=n;){const o=Math.floor((r+n)/2);if(this.actions[o].delay<t.delay)r=o+1;else if(this.actions[o].delay>t.delay)n=o-1;else return o+1}return r}}function Lt(e,t){if(e.type===O.IncrementalSnapshot&&e.data.source===A.MouseMove){const r=e.data.positions[0].timeOffset,n=e.timestamp+r;return e.delay=n-t,n-t}return e.delay=e.timestamp-t,e.delay}/*! *****************************************************************************
4
+ or you can use record.mirror to access the mirror instance during recording.`;q.mirror={map:{},getId(){return console.error(Me),-1},getNode(){return console.error(Me),null},removeNodeFromMap(){console.error(Me)},has(){return console.error(Me),!1},reset(){console.error(Me)}},typeof window<"u"&&window.Proxy&&window.Reflect&&(q.mirror=new Proxy(q.mirror,{get(e,t,r){return t==="map"&&console.error(Me),Reflect.get(e,t,r)}}));function Oe(e,t,r={}){let n=null,o=0;return function(i){const l=Date.now();!o&&r.leading===!1&&(o=l);const c=t-(l-o),a=this,s=arguments;c<=0||c>t?(n&&(clearTimeout(n),n=null),o=l,e.apply(a,s)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{o=r.leading===!1?0:Date.now(),n=null,e.apply(a,s)},c))}}function Ge(e,t,r,n,o=window){const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(l){setTimeout(()=>{r.set.call(this,l)},0),i&&i.set&&i.set.call(this,l)}}),()=>Ge(e,t,i||{},!0)}function be(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],o=r(n);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,()=>{e[t]=n}}catch{return()=>{}}}function wt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Nt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}const hr=e=>{try{if(e instanceof HTMLElement)return e.tagName==="CANVAS"}catch{return!1}return!1};function se(e,t,r){if(!e)return!1;const n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!n)return!1;if(typeof t=="string"){if(n.classList.contains(t)||r&&n.closest("."+t)!==null)return!0}else if(nt(n,t,r))return!0;return!1}function mr(e,t){return t.getId(e)!==-1}function it(e,t){return t.getId(e)===Ue}function Tt(e,t){if(Ve(e))return!1;const r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?Tt(e.parentNode,t):!0:!0}function Et(e){return Boolean(e.changedTouches)}function Ct(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(t){if(!(0 in arguments))throw new TypeError("1 argument is required");do if(this===t)return!0;while(t=t&&t.parentNode);return!1})}function pr(e){const t={},r=(o,i)=>{const l={value:o,parent:i,children:[]};return t[o.node.id]=l,l},n=[];for(const o of e){const{nextId:i,parentId:l}=o;if(i&&i in t){const c=t[i];if(c.parent){const a=c.parent.children.indexOf(c);c.parent.children.splice(a,0,r(o,c.parent))}else{const a=n.indexOf(c);n.splice(a,0,r(o,null))}continue}if(l in t){const c=t[l];c.children.push(r(o,c));continue}n.push(r(o,null))}return n}function It(e,t){t(e.value);for(let r=e.children.length-1;r>=0;r--)It(e.children[r],t)}function Re(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function kt(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function xt(e,t){var r,n;const o=(n=(r=e.ownerDocument)==null?void 0:r.defaultView)==null?void 0:n.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const i=o.getBoundingClientRect(),l=xt(o,t),c=i.height/o.clientHeight;return{x:i.x*l.relativeScale+l.x,y:i.y*l.relativeScale+l.y,relativeScale:c,absoluteScale:l.absoluteScale*c}}function ze(e){return Boolean(e?.shadowRoot)}function De(e,t){const r=e[t[0]];return t.length===1?r:De(r.cssRules[t[1]].cssRules,t.slice(2))}function Mt(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function fr(e){const t=new Set,r=[];for(let n=e.length;n--;){const o=e[n];t.has(o.id)||(r.push(o),t.add(o.id))}return r}var To=Object.freeze({__proto__:null,on:ie,get _mirror(){return q.mirror},throttle:Oe,hookSetter:Ge,patch:be,getWindowHeight:wt,getWindowWidth:Nt,isCanvasNode:hr,isBlocked:se,isSerialized:mr,isIgnored:it,isAncestorRemoved:Tt,isTouchEvent:Et,polyfill:Ct,queueToResolveTrees:pr,iterateResolveTree:It,isSerializedIframe:Re,isSerializedStylesheet:kt,getBaseDimension:xt,hasShadowRoot:ze,getNestedRule:De,getPositionsAndIndex:Mt,uniqueTextMutations:fr}),R=(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))(R||{}),D=(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))(D||{}),ee=(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))(ee||{}),fe=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(fe||{}),Te=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(Te||{}),B=(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))(B||{});function vr(e){return"__ln"in e}class Eo{constructor(){this.length=0,this.head=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=r?.next||null;return r}addNode(t){const r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&vr(t.previousSibling)){const n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&vr(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;this.length++}removeNode(t){const r=t.__ln;!this.head||(r.previous?(r.previous.next=r.next,r.next&&(r.next.previous=r.previous)):(this.head=r.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}}const gr=(e,t)=>`${e}@${t}`;class Co{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],r=new Eo,n=c=>{let a=c,s=Ue;for(;s===Ue;)a=a&&a.nextSibling,s=a&&this.mirror.getId(a);return s},o=c=>{var a,s,u,d,m;const h=c.getRootNode?(a=c.getRootNode())==null?void 0:a.host:null;let p=h;for(;(u=(s=p?.getRootNode)==null?void 0:s.call(p))!=null&&u.host;)p=((m=(d=p?.getRootNode)==null?void 0:d.call(p))==null?void 0:m.host)||null;const v=!this.doc.contains(c)&&(!p||!this.doc.contains(p));if(!c.parentNode||v)return;const b=Ve(c.parentNode)?this.mirror.getId(h):this.mirror.getId(c.parentNode),f=n(c);if(b===-1||f===-1)return r.addNode(c);const S=xe(c,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,enableStrictPrivacy:this.enableStrictPrivacy,onSerialize:y=>{Re(y,this.mirror)&&this.iframeManager.addIframe(y),kt(y,this.mirror)&&this.stylesheetManager.addStylesheet(y),ze(c)&&this.shadowDomManager.addShadowRoot(c.shadowRoot,document)},onIframeLoad:(y,N)=>{this.iframeManager.attachIframe(y,N,this.mirror),this.shadowDomManager.observeAttachShadow(y)},onStylesheetLoad:(y,N)=>{this.stylesheetManager.attachStylesheet(y,N,this.mirror)},newlyAddedElement:!0});S&&t.push({parentId:b,nextId:f,node:S})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const c of Array.from(this.movedSet.values()))yr(this.removes,c,this.mirror)&&!this.movedSet.has(c.parentNode)||o(c);for(const c of Array.from(this.addedSet.values()))!Sr(this.droppedSet,c)&&!yr(this.removes,c,this.mirror)||Sr(this.movedSet,c)?o(c):this.droppedSet.add(c);let i=null;for(;r.length;){let c=null;if(i){const a=this.mirror.getId(i.value.parentNode),s=n(i.value);a!==-1&&s!==-1&&(c=i)}if(!c)for(let a=r.length-1;a>=0;a--){const s=r.get(a);if(s){const u=this.mirror.getId(s.value.parentNode),d=n(s.value);if(u!==-1&&d!==-1){c=s;break}}}if(!c){for(;r.head;)r.removeNode(r.head.value);break}i=c.previous,r.removeNode(c.value),o(c.value)}const l={texts:this.texts.map(c=>{let a=c.value;return this.enableStrictPrivacy&&a&&(a=nr(a)),{id:this.mirror.getId(c.node),value:a}}).filter(c=>this.mirror.has(c.id)),attributes:this.attributes.map(c=>({id:this.mirror.getId(c.node),attributes:c.attributes})).filter(c=>this.mirror.has(c.id)),removes:this.removes,adds:t};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(l))},this.processMutation=t=>{if(!it(t.target,this.mirror))switch(t.type){case"characterData":{const r=t.target.textContent;!se(t.target,this.blockClass,!1)&&r!==t.oldValue&&this.texts.push({value:sr(t.target,this.maskTextClass,this.maskTextSelector)&&r?this.maskTextFn?this.maskTextFn(r):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let n=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(n=gt({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),se(t.target,this.blockClass,!1)||n===t.oldValue)return;let o=this.attributes.find(i=>i.node===t.target);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 l=o.attributes.style;for(const c of Array.from(r.style)){const a=r.style.getPropertyValue(c),s=r.style.getPropertyPriority(c);(a!==i.style.getPropertyValue(c)||s!==i.style.getPropertyPriority(c))&&(s===""?l[c]=a:l[c]=[a,s])}for(const c of Array.from(i.style))r.style.getPropertyValue(c)===""&&(l[c]=!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]=ir(this.doc,t.target.tagName,t.attributeName,n)}break}case"childList":{if(se(t.target,this.blockClass,!0))return;t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{const n=this.mirror.getId(r),o=Ve(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);se(t.target,this.blockClass,!1)||it(r,this.mirror)||!mr(r,this.mirror)||(this.addedSet.has(r)?(Ot(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||Tt(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[gr(n,o)]?Ot(this.movedSet,r):this.removes.push({parentId:o,id:n,isShadow:Ve(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,r)=>{if(this.mirror.hasNode(t)){if(it(t,this.mirror))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[gr(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);se(t,this.blockClass,!1)||t.childNodes.forEach(n=>this.genAdds(n))}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","enableStrictPrivacy"].forEach(r=>{this[r]=t[r]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Ot(e,t){e.delete(t),t.childNodes.forEach(r=>Ot(e,r))}function yr(e,t,r){return e.length===0?!1:br(e,t,r)}function br(e,t,r){const{parentNode:n}=t;if(!n)return!1;const o=r.getId(n);return e.some(i=>i.id===o)?!0:br(e,n,r)}function Sr(e,t){return e.size===0?!1:wr(e,t)}function wr(e,t){const{parentNode:r}=t;return r?e.has(r)?!0:wr(e,r):!1}var Io=Object.defineProperty,ko=Object.defineProperties,xo=Object.getOwnPropertyDescriptors,Nr=Object.getOwnPropertySymbols,Mo=Object.prototype.hasOwnProperty,Oo=Object.prototype.propertyIsEnumerable,Tr=(e,t,r)=>t in e?Io(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Er=(e,t)=>{for(var r in t||(t={}))Mo.call(t,r)&&Tr(e,r,t[r]);if(Nr)for(var r of Nr(t))Oo.call(t,r)&&Tr(e,r,t[r]);return e},Ro=(e,t)=>ko(e,xo(t));const Ee=[],Cr=typeof CSSGroupingRule<"u",Ir=typeof CSSMediaRule<"u",kr=typeof CSSSupportsRule<"u",xr=typeof CSSConditionRule<"u";function Be(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 Mr(e,t){var r,n;const o=new Co;Ee.push(o),o.init(e);let i=window.MutationObserver||window.__rrMutationObserver;const l=(n=(r=window?.Zone)==null?void 0:r.__symbol__)==null?void 0:n.call(r,"MutationObserver");l&&window[l]&&(i=window[l]);const c=new i(o.processMutations.bind(o));return c.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),c}function Do({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let l=[],c;const a=Oe(d=>{const m=Date.now()-c;e(l.map(h=>(h.timeOffset-=m,h)),d),l=[],c=null},i),s=Oe(d=>{const m=Be(d),{clientX:h,clientY:p}=Et(d)?d.changedTouches[0]:d;c||(c=Date.now()),l.push({x:h,y:p,id:n.getId(m),timeOffset:Date.now()-c}),a(typeof DragEvent<"u"&&d instanceof DragEvent?D.Drag:d instanceof MouseEvent?D.MouseMove:D.TouchMove)},o,{trailing:!1}),u=[ie("mousemove",s,r),ie("touchmove",s,r),ie("drag",s,r)];return()=>{u.forEach(d=>d())}}function Lo({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const i=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,l=[],c=a=>s=>{const u=Be(s);if(se(u,n,!0)||hr(u))return;const d=Et(s)?s.changedTouches[0]:s;if(!d)return;const m=r.getId(u),{clientX:h,clientY:p}=d;e({type:ee[a],id:m,x:h,y:p})};return Object.keys(ee).filter(a=>Number.isNaN(Number(a))&&!a.endsWith("_Departed")&&i[a]!==!1).forEach(a=>{const s=a.toLowerCase(),u=c(a);l.push(ie(s,u,t))}),()=>{l.forEach(a=>a())}}function Or({scrollCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){const i=Oe(l=>{const c=Be(l);if(!c||se(c,n,!0))return;const a=r.getId(c);if(c===t){const s=t.scrollingElement||t.documentElement;e({id:a,x:s.scrollLeft,y:s.scrollTop})}else e({id:a,x:c.scrollLeft,y:c.scrollTop})},o.scroll||100);return ie("scroll",i,t)}function Ao({viewportResizeCb:e}){let t=-1,r=-1;const n=Oe(()=>{const o=wt(),i=Nt();(t!==o||r!==i)&&(e({width:Number(i),height:Number(o)}),t=o,r=i)},200);return ie("resize",n,window)}function Rr(e,t){const r=Er({},e);return t||delete r.userTriggered,r}const Po=["INPUT","TEXTAREA","SELECT"],Dr=new WeakMap;function Fo({inputCb:e,doc:t,mirror:r,blockClass:n,ignoreClass:o,maskInputOptions:i,maskInputFn:l,sampling:c,userTriggeredOnInput:a}){function s(p){let v=Be(p);const b=p.isTrusted;if(v&&v.tagName==="OPTION"&&(v=v.parentElement),!v||!v.tagName||Po.indexOf(v.tagName)<0||se(v,n,!0))return;const f=v.type;if(v.classList.contains(o))return;let S=v.value,y=!1;f==="radio"||f==="checkbox"?y=v.checked:(i[v.tagName.toLowerCase()]||i[f])&&(S=gt({maskInputOptions:i,tagName:v.tagName,type:f,value:S,maskInputFn:l})),u(v,Rr({text:S,isChecked:y,userTriggered:b},a));const N=v.name;f==="radio"&&N&&y&&t.querySelectorAll(`input[type="radio"][name="${N}"]`).forEach(x=>{x!==v&&u(x,Rr({text:x.value,isChecked:!y,userTriggered:!1},a))})}function u(p,v){const b=Dr.get(p);if(!b||b.text!==v.text||b.isChecked!==v.isChecked){Dr.set(p,v);const f=r.getId(p);e(Ro(Er({},v),{id:f}))}}const d=(c.input==="last"?["change"]:["input","change"]).map(p=>ie(p,s,t)),m=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),h=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return m&&m.set&&d.push(...h.map(p=>Ge(p[0],p[1],{set(){s({target:this})}}))),()=>{d.forEach(p=>p())}}function st(e){const t=[];function r(n,o){if(Cr&&n.parentRule instanceof CSSGroupingRule||Ir&&n.parentRule instanceof CSSMediaRule||kr&&n.parentRule instanceof CSSSupportsRule||xr&&n.parentRule instanceof CSSConditionRule){const i=Array.from(n.parentRule.cssRules).indexOf(n);o.unshift(i)}else{const i=Array.from(n.parentStyleSheet.cssRules).indexOf(n);o.unshift(i)}return o}return r(e,t)}function _o({styleSheetRuleCb:e,mirror:t},{win:r}){const n=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=function(c,a){const s=t.getId(this.ownerNode);return s!==-1&&e({id:s,adds:[{rule:c,index:a}]}),n.apply(this,arguments)};const o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=function(c){const a=t.getId(this.ownerNode);return a!==-1&&e({id:a,removes:[{index:c}]}),o.apply(this,arguments)};const i={};Cr?i.CSSGroupingRule=r.CSSGroupingRule:(Ir&&(i.CSSMediaRule=r.CSSMediaRule),xr&&(i.CSSConditionRule=r.CSSConditionRule),kr&&(i.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(i).forEach(([c,a])=>{l[c]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=function(s,u){const d=t.getId(this.parentStyleSheet.ownerNode);return d!==-1&&e({id:d,adds:[{rule:s,index:[...st(this),u||0]}]}),l[c].insertRule.apply(this,arguments)},a.prototype.deleteRule=function(s){const u=t.getId(this.parentStyleSheet.ownerNode);return u!==-1&&e({id:u,removes:[{index:[...st(this),s]}]}),l[c].deleteRule.apply(this,arguments)}}),()=>{r.CSSStyleSheet.prototype.insertRule=n,r.CSSStyleSheet.prototype.deleteRule=o,Object.entries(i).forEach(([c,a])=>{a.prototype.insertRule=l[c].insertRule,a.prototype.deleteRule=l[c].deleteRule})}}function $o({styleDeclarationCb:e,mirror:t},{win:r}){const n=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=function(i,l,c){var a,s;const u=t.getId((s=(a=this.parentRule)==null?void 0:a.parentStyleSheet)==null?void 0:s.ownerNode);return u!==-1&&e({id:u,set:{property:i,value:l,priority:c},index:st(this.parentRule)}),n.apply(this,arguments)};const o=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=function(i){var l,c;const a=t.getId((c=(l=this.parentRule)==null?void 0:l.parentStyleSheet)==null?void 0:c.ownerNode);return a!==-1&&e({id:a,remove:{property:i},index:st(this.parentRule)}),o.apply(this,arguments)},()=>{r.CSSStyleDeclaration.prototype.setProperty=n,r.CSSStyleDeclaration.prototype.removeProperty=o}}function Wo({mediaInteractionCb:e,blockClass:t,mirror:r,sampling:n}){const o=l=>Oe(c=>{const a=Be(c);if(!a||se(a,t,!0))return;const{currentTime:s,volume:u,muted:d}=a;e({type:l,id:r.getId(a),currentTime:s,volume:u,muted:d})},n.media||500),i=[ie("play",o(Te.Play)),ie("pause",o(Te.Pause)),ie("seeked",o(Te.Seeked)),ie("volumechange",o(Te.VolumeChange))];return()=>{i.forEach(l=>l())}}function jo({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],o=new WeakMap,i=r.FontFace;r.FontFace=function(c,a,s){const u=new i(c,a,s);return o.set(u,{family:c,buffer:typeof a!="string",descriptors:s,fontSource:typeof a=="string"?a:JSON.stringify(Array.from(new Uint8Array(a)))}),u};const l=be(t.fonts,"add",function(c){return function(a){return setTimeout(()=>{const s=o.get(a);s&&(e(s),o.delete(a))},0),c.apply(this,[a])}});return n.push(()=>{r.FontFace=i}),n.push(l),()=>{n.forEach(c=>c())}}function Vo(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:l,inputCb:c,mediaInteractionCb:a,styleSheetRuleCb:s,styleDeclarationCb:u,canvasMutationCb:d,fontCb:m}=e;e.mutationCb=(...h)=>{t.mutation&&t.mutation(...h),r(...h)},e.mousemoveCb=(...h)=>{t.mousemove&&t.mousemove(...h),n(...h)},e.mouseInteractionCb=(...h)=>{t.mouseInteraction&&t.mouseInteraction(...h),o(...h)},e.scrollCb=(...h)=>{t.scroll&&t.scroll(...h),i(...h)},e.viewportResizeCb=(...h)=>{t.viewportResize&&t.viewportResize(...h),l(...h)},e.inputCb=(...h)=>{t.input&&t.input(...h),c(...h)},e.mediaInteractionCb=(...h)=>{t.mediaInteaction&&t.mediaInteaction(...h),a(...h)},e.styleSheetRuleCb=(...h)=>{t.styleSheetRule&&t.styleSheetRule(...h),s(...h)},e.styleDeclarationCb=(...h)=>{t.styleDeclaration&&t.styleDeclaration(...h),u(...h)},e.canvasMutationCb=(...h)=>{t.canvasMutation&&t.canvasMutation(...h),d(...h)},e.fontCb=(...h)=>{t.font&&t.font(...h),m(...h)}}function Uo(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};Vo(e,t);const n=Mr(e,e.doc),o=Do(e),i=Lo(e),l=Or(e),c=Ao(e),a=Fo(e),s=Wo(e),u=_o(e,{win:r}),d=$o(e,{win:r}),m=e.collectFonts?jo(e):()=>{},h=[];for(const p of e.plugins)h.push(p.observer(p.callback,r,p.options));return()=>{Ee.forEach(p=>p.reset()),n.disconnect(),o(),i(),l(),c(),a(),s(),u(),d(),m(),h.forEach(p=>p())}}class Go{constructor(t){this.iframes=new WeakMap,this.mutationCb=t.mutationCb}addIframe(t){this.iframes.set(t,!0)}addLoadListener(t){this.loadListener=t}attachIframe(t,r,n){var o;this.mutationCb({adds:[{parentId:n.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(o=this.loadListener)==null||o.call(this,t)}}var zo=Object.defineProperty,Bo=Object.defineProperties,Ho=Object.getOwnPropertyDescriptors,Lr=Object.getOwnPropertySymbols,Yo=Object.prototype.hasOwnProperty,Xo=Object.prototype.propertyIsEnumerable,Ar=(e,t,r)=>t in e?zo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Pr=(e,t)=>{for(var r in t||(t={}))Yo.call(t,r)&&Ar(e,r,t[r]);if(Lr)for(var r of Lr(t))Xo.call(t,r)&&Ar(e,r,t[r]);return e},Fr=(e,t)=>Bo(e,Ho(t));class Zo{constructor(t){this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;const r=this;this.restorePatches.push(be(HTMLElement.prototype,"attachShadow",function(n){return function(){const o=n.apply(this,arguments);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,this.ownerDocument),o}}))}addShadowRoot(t,r){Mr(Fr(Pr({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),Or(Fr(Pr({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}observeAttachShadow(t){if(t.contentWindow){const r=this;this.restorePatches.push(be(t.contentWindow.HTMLElement.prototype,"attachShadow",function(n){return function(){const o=n.apply(this,arguments);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,t.contentDocument),o}}))}}reset(){this.restorePatches.forEach(t=>t())}}for(var Le="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",He=typeof Uint8Array>"u"?[]:new Uint8Array(256),at=0;at<Le.length;at++)He[Le.charCodeAt(at)]=at;var Ko=function(e){var t=new Uint8Array(e),r,n=t.length,o="";for(r=0;r<n;r+=3)o+=Le[t[r]>>2],o+=Le[(t[r]&3)<<4|t[r+1]>>4],o+=Le[(t[r+1]&15)<<2|t[r+2]>>6],o+=Le[t[r+2]&63];return n%3===2?o=o.substring(0,o.length-1)+"=":n%3===1&&(o=o.substring(0,o.length-2)+"=="),o},qo=function(e){var t=e.length*.75,r=e.length,n,o=0,i,l,c,a;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var s=new ArrayBuffer(t),u=new Uint8Array(s);for(n=0;n<r;n+=4)i=He[e.charCodeAt(n)],l=He[e.charCodeAt(n+1)],c=He[e.charCodeAt(n+2)],a=He[e.charCodeAt(n+3)],u[o++]=i<<2|l>>4,u[o++]=(l&15)<<4|c>>2,u[o++]=(c&3)<<6|a&63;return s};const _r=new Map;function Jo(e,t){let r=_r.get(e);return r||(r=new Map,_r.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}const $r=(e,t,r)=>{if(!e||!(jr(e,t)||typeof e=="object"))return;const n=e.constructor.name,o=Jo(r,n);let i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};function lt(e,t,r){if(e instanceof Array)return e.map(n=>lt(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){const n=e.constructor.name,o=Ko(e);return{rr_type:n,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[lt(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const n=e.constructor.name,{src:o}=e;return{rr_type:n,src:o}}else if(e instanceof HTMLCanvasElement){const n="HTMLImageElement",o=e.toDataURL();return{rr_type:n,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[lt(e.data,t,r),e.width,e.height]};if(jr(e,t)||typeof e=="object"){const n=e.constructor.name,o=$r(e,t,r);return{rr_type:n,index:o}}}}return e}const Wr=(e,t,r)=>[...e].map(n=>lt(n,t,r)),jr=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(n=>typeof t[n]=="function");return Boolean(r.find(n=>e instanceof t[n]))};function Qo(e,t,r,n){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const l of i)try{if(typeof t.CanvasRenderingContext2D.prototype[l]!="function")continue;const c=be(t.CanvasRenderingContext2D.prototype,l,function(a){return function(...s){return se(this.canvas,r,!0)||setTimeout(()=>{const u=Wr([...s],t,this);e(this.canvas,{type:fe["2D"],property:l,args:u})},0),a.apply(this,s)}});o.push(c)}catch{const a=Ge(t.CanvasRenderingContext2D.prototype,l,{set(s){e(this.canvas,{type:fe["2D"],property:l,args:[s],setter:!0})}});o.push(a)}return()=>{o.forEach(l=>l())}}function Vr(e,t){const r=[];try{const n=be(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(i,...l){return se(this,t,!0)||"__context"in this||(this.__context=i),o.apply(this,[i,...l])}});r.push(n)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(n=>n())}}function Ur(e,t,r,n,o,i){const l=[],c=Object.getOwnPropertyNames(e);for(const a of c)try{if(typeof e[a]!="function")continue;const s=be(e,a,function(u){return function(...d){const m=u.apply(this,d);if($r(m,i,e),!se(this.canvas,n,!0)){const h=Wr([...d],i,e),p={type:t,property:a,args:h};r(this.canvas,p)}return m}});l.push(s)}catch{const u=Ge(e,a,{set(d){r(this.canvas,{type:t,property:a,args:[d],setter:!0})}});l.push(u)}return l}function ei(e,t,r,n){const o=[];return o.push(...Ur(t.WebGLRenderingContext.prototype,fe.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...Ur(t.WebGL2RenderingContext.prototype,fe.WebGL2,e,r,n,t)),()=>{o.forEach(i=>i())}}function ti(e,t){var r=atob(e);if(t){for(var n=new Uint8Array(r.length),o=0,i=r.length;o<i;++o)n[o]=r.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}function ri(e,t,r){var n=t===void 0?null:t,o=r===void 0?!1:r,i=ti(e,o),l=i.indexOf(`
5
+ `,10)+1,c=i.substring(l)+(n?"//# sourceMappingURL="+n:""),a=new Blob([c],{type:"application/javascript"});return URL.createObjectURL(a)}function ni(e,t,r){var n;return function(i){return n=n||ri(e,t,r),new Worker(n,i)}}var oi=ni("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Zm9yKHZhciByPSJBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OSsvIixsPXR5cGVvZiBVaW50OEFycmF5PiJ1Ij9bXTpuZXcgVWludDhBcnJheSgyNTYpLGY9MDtmPHIubGVuZ3RoO2YrKylsW3IuY2hhckNvZGVBdChmKV09Zjt2YXIgZD1mdW5jdGlvbihzKXt2YXIgZT1uZXcgVWludDhBcnJheShzKSxuLGE9ZS5sZW5ndGgsdD0iIjtmb3Iobj0wO248YTtuKz0zKXQrPXJbZVtuXT4+Ml0sdCs9clsoZVtuXSYzKTw8NHxlW24rMV0+PjRdLHQrPXJbKGVbbisxXSYxNSk8PDJ8ZVtuKzJdPj42XSx0Kz1yW2VbbisyXSY2M107cmV0dXJuIGElMz09PTI/dD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTEpKyI9IjphJTM9PT0xJiYodD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTIpKyI9PSIpLHR9O2NvbnN0IGM9bmV3IE1hcCx1PW5ldyBNYXA7YXN5bmMgZnVuY3Rpb24gcChzLGUpe2NvbnN0IG49YCR7c30tJHtlfWA7aWYodS5oYXMobikpcmV0dXJuIHUuZ2V0KG4pO2NvbnN0IGE9bmV3IE9mZnNjcmVlbkNhbnZhcyhzLGUpO2EuZ2V0Q29udGV4dCgiMmQiKTtjb25zdCB0PWF3YWl0KGF3YWl0IGEuY29udmVydFRvQmxvYigpKS5hcnJheUJ1ZmZlcigpLGc9ZCh0KTtyZXR1cm4gdS5zZXQobixnKSxnfWNvbnN0IGk9c2VsZjtpLm9ubWVzc2FnZT1hc3luYyBmdW5jdGlvbihzKXtpZighKCJPZmZzY3JlZW5DYW52YXMiaW4gZ2xvYmFsVGhpcykpcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOnMuZGF0YS5pZH0pO2NvbnN0e2lkOmUsYml0bWFwOm4sd2lkdGg6YSxoZWlnaHQ6dH09cy5kYXRhLGc9cChhLHQpLGg9bmV3IE9mZnNjcmVlbkNhbnZhcyhhLHQpO2guZ2V0Q29udGV4dCgiMmQiKS5kcmF3SW1hZ2UobiwwLDApLG4uY2xvc2UoKTtjb25zdCB3PWF3YWl0IGguY29udmVydFRvQmxvYigpLHk9dy50eXBlLGI9YXdhaXQgdy5hcnJheUJ1ZmZlcigpLG89ZChiKTtpZighYy5oYXMoZSkmJmF3YWl0IGc9PT1vKXJldHVybiBjLnNldChlLG8pLGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpZihjLmdldChlKT09PW8pcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpLnBvc3RNZXNzYWdlKHtpZDplLHR5cGU6eSxiYXNlNjQ6byx3aWR0aDphLGhlaWdodDp0fSksYy5zZXQoZSxvKX19KSgpOwoK",null,!1),Gr=Object.getOwnPropertySymbols,ii=Object.prototype.hasOwnProperty,si=Object.prototype.propertyIsEnumerable,ai=(e,t)=>{var r={};for(var n in e)ii.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Gr)for(var n of Gr(e))t.indexOf(n)<0&&si.call(e,n)&&(r[n]=e[n]);return r},li=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});class ci{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(l,c){(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(c)};const{sampling:r="all",win:n,blockClass:o,recordCanvas:i}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,i&&r==="all"&&this.initCanvasMutationObserver(n,o),i&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,o)}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,n){const o=Vr(r,n),i=new Map,l=new oi;l.onmessage=d=>{const{id:m}=d.data;if(i.set(m,!1),!("base64"in d.data))return;const{base64:h,type:p,width:v,height:b}=d.data;this.mutationCb({id:m,type:fe["2D"],commands:[{property:"clearRect",args:[0,0,v,b]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:h}],type:p}]},0,0]}]})};const c=1e3/t;let a=0,s;const u=d=>{if(a&&d-a<c){s=requestAnimationFrame(u);return}a=d,r.document.querySelectorAll(`canvas:not(.${n} *)`).forEach(m=>li(this,null,function*(){var h;const p=this.mirror.getId(m);if(i.get(p))return;if(i.set(p,!0),["webgl","webgl2"].includes(m.__context)){const b=m.getContext(m.__context);((h=b?.getContextAttributes())==null?void 0:h.preserveDrawingBuffer)===!1&&b?.clear(b.COLOR_BUFFER_BIT)}const v=yield createImageBitmap(m);l.postMessage({id:p,bitmap:v,width:m.width,height:m.height},[v])})),s=requestAnimationFrame(u)};s=requestAnimationFrame(u),this.resetObservers=()=>{o(),cancelAnimationFrame(s)}}initCanvasMutationObserver(t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=Vr(t,r),o=Qo(this.processMutation.bind(this),t,r,this.mirror),i=ei(this.processMutation.bind(this),t,r,this.mirror);this.resetObservers=()=>{n(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;const o=n.map(l=>ai(l,["type"])),{type:i}=n[0];this.mutationCb({id:r,type:i,commands:o}),this.pendingCanvasMutations.delete(t)}}class ui{constructor(t){this.trackedStylesheets=new WeakSet,this.mutationCb=t.mutationCb}addStylesheet(t){this.trackedStylesheets.has(t)||(this.trackedStylesheets.add(t),this.trackStylesheet(t))}trackStylesheet(t){}attachStylesheet(t,r,n){this.mutationCb({adds:[{parentId:n.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[]}),this.addStylesheet(t)}}var di=Object.defineProperty,hi=Object.defineProperties,mi=Object.getOwnPropertyDescriptors,zr=Object.getOwnPropertySymbols,pi=Object.prototype.hasOwnProperty,fi=Object.prototype.propertyIsEnumerable,Br=(e,t,r)=>t in e?di(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ae=(e,t)=>{for(var r in t||(t={}))pi.call(t,r)&&Br(e,r,t[r]);if(zr)for(var r of zr(t))fi.call(t,r)&&Br(e,r,t[r]);return e},vi=(e,t)=>hi(e,mi(t));function te(e){return vi(ae({},e),{timestamp:Date.now()})}let Q,Ye;const de=tr();function Ce(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="highlight-block",blockSelector:i=null,ignoreClass:l="highlight-ignore",maskTextClass:c="highlight-mask",maskTextSelector:a=null,inlineStylesheet:s=!0,maskAllInputs:u,maskInputOptions:d,slimDOMOptions:m,maskInputFn:h,maskTextFn:p,hooks:v,packFn:b,sampling:f={},mousemoveWait:S,recordCanvas:y=!1,userTriggeredOnInput:N=!1,collectFonts:x=!1,inlineImages:M=!1,plugins:I,keepIframeSrcFn:E=()=>!1,enableStrictPrivacy:F=!1}=e;if(!t)throw new Error("emit function is required");S!==void 0&&f.mousemove===void 0&&(f.mousemove=S),de.reset();const U=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},K=m===!0||m==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:m==="all",headMetaDescKeywords:m==="all"}:m||{};Ct();let W,H=0;const L=T=>{for(const k of I||[])k.eventProcessor&&(T=k.eventProcessor(T));return b&&(T=b(T)),T};Q=(T,k)=>{var G;if(((G=Ee[0])==null?void 0:G.isFrozen())&&T.type!==R.FullSnapshot&&!(T.type===R.IncrementalSnapshot&&T.data.source===D.Mutation)&&Ee.forEach(z=>z.unfreeze()),t(L(T),k),T.type===R.FullSnapshot)W=T,H=0;else if(T.type===R.IncrementalSnapshot){if(T.data.source===D.Mutation&&T.data.isAttachIframe)return;H++;const z=n&&H>=n,oe=r&&T.timestamp-W.timestamp>r;(z||oe)&&Ye(!0)}};const V=T=>{Q(te({type:R.IncrementalSnapshot,data:ae({source:D.Mutation},T)}))},A=T=>Q(te({type:R.IncrementalSnapshot,data:ae({source:D.Scroll},T)})),O=T=>Q(te({type:R.IncrementalSnapshot,data:ae({source:D.CanvasMutation},T)})),$=new Go({mutationCb:V}),w=new ui({mutationCb:V}),g=new ci({recordCanvas:y,mutationCb:O,win:window,blockClass:o,mirror:de,sampling:f.canvas}),C=new Zo({mutationCb:V,scrollCb:A,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:a,inlineStylesheet:s,maskInputOptions:U,maskTextFn:p,maskInputFn:h,recordCanvas:y,inlineImages:M,sampling:f,slimDOMOptions:K,iframeManager:$,stylesheetManager:w,canvasManager:g,enableStrictPrivacy:F},mirror:de});Ye=(T=!1)=>{var k,G,z,oe;Q(te({type:R.Meta,data:{href:window.location.href,width:Nt(),height:wt()}}),T),Ee.forEach(Y=>Y.lock());const j=po(document,{mirror:de,blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:a,inlineStylesheet:s,maskAllInputs:U,maskTextFn:p,slimDOM:K,recordCanvas:y,inlineImages:M,enableStrictPrivacy:F,onSerialize:Y=>{Re(Y,de)&&$.addIframe(Y),kt(Y,de)&&w.addStylesheet(Y),ze(Y)&&C.addShadowRoot(Y.shadowRoot,document)},onIframeLoad:(Y,ge)=>{$.attachIframe(Y,ge,de),C.observeAttachShadow(Y)},onStylesheetLoad:(Y,ge)=>{w.attachStylesheet(Y,ge,de)},keepIframeSrcFn:E});if(!j)return console.warn("Failed to snapshot the document");Q(te({type:R.FullSnapshot,data:{node:j,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((G=(k=document?.body)==null?void 0:k.parentElement)==null?void 0:G.scrollLeft)||document?.body.scrollLeft||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((oe=(z=document?.body)==null?void 0:z.parentElement)==null?void 0:oe.scrollTop)||document?.body.scrollTop||0}}})),Ee.forEach(Y=>Y.unlock())};try{const T=[];T.push(ie("DOMContentLoaded",()=>{Q(te({type:R.DomContentLoaded,data:{}}))}));const k=z=>{var oe;return Uo({mutationCb:V,mousemoveCb:(j,Y)=>Q(te({type:R.IncrementalSnapshot,data:{source:Y,positions:j}})),mouseInteractionCb:j=>Q(te({type:R.IncrementalSnapshot,data:ae({source:D.MouseInteraction},j)})),scrollCb:A,viewportResizeCb:j=>Q(te({type:R.IncrementalSnapshot,data:ae({source:D.ViewportResize},j)})),inputCb:j=>Q(te({type:R.IncrementalSnapshot,data:ae({source:D.Input},j)})),mediaInteractionCb:j=>Q(te({type:R.IncrementalSnapshot,data:ae({source:D.MediaInteraction},j)})),styleSheetRuleCb:j=>Q(te({type:R.IncrementalSnapshot,data:ae({source:D.StyleSheetRule},j)})),styleDeclarationCb:j=>Q(te({type:R.IncrementalSnapshot,data:ae({source:D.StyleDeclaration},j)})),canvasMutationCb:O,fontCb:j=>Q(te({type:R.IncrementalSnapshot,data:ae({source:D.Font},j)})),blockClass:o,ignoreClass:l,maskTextClass:c,maskTextSelector:a,maskInputOptions:U,inlineStylesheet:s,sampling:f,recordCanvas:y,inlineImages:M,userTriggeredOnInput:N,collectFonts:x,doc:z,maskInputFn:h,maskTextFn:p,blockSelector:i,slimDOMOptions:K,mirror:de,iframeManager:$,stylesheetManager:w,shadowDomManager:C,canvasManager:g,enableStrictPrivacy:F,plugins:((oe=I?.filter(j=>j.observer))==null?void 0:oe.map(j=>({observer:j.observer,options:j.options,callback:Y=>Q(te({type:R.Plugin,data:{plugin:j.name,payload:Y}}))})))||[]},v)};$.addLoadListener(z=>{T.push(k(z.contentDocument))});const G=()=>{Ye(),T.push(k(document))};return document.readyState==="interactive"||document.readyState==="complete"?G():T.push(ie("load",()=>{Q(te({type:R.Load,data:{}})),G()},window)),()=>{T.forEach(z=>z())}}catch(T){console.warn(T)}}Ce.addCustomEvent=(e,t)=>{!Q||Q(te({type:R.Custom,data:{tag:e,payload:t}}))},Ce.freezePage=()=>{Ee.forEach(e=>e.freeze())},Ce.takeFullSnapshot=e=>{if(!Ye)throw new Error("please take full snapshot after start recording");Ye(e)},Ce.mirror=de;var P;(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"})(P||(P={}));var gi=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var r;if(!t)return-1;var n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var r=this,n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(function(o){return r.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function yi(){return new gi}function bi(e){const t={},r=/;(?![^(]*\))/g,n=/:(.+)/,o=/\/\*.*?\*\//g;return e.replace(o,"").split(r).forEach(function(i){if(i){const l=i.split(n);l.length>1&&(t[Rt(l[0].trim())]=l[1].trim())}}),t}function Hr(e){const t=[];for(const r in e){const n=e[r];if(typeof n!="string")continue;const o=Ti(r);t.push(`${o}: ${n};`)}return t.join(" ")}const Si=/-([a-z])/g,wi=/^--[a-zA-Z0-9-]+$/,Rt=e=>wi.test(e)?e:e.replace(Si,(t,r)=>r?r.toUpperCase():""),Ni=/\B([A-Z])/g,Ti=e=>e.replace(Ni,"-$1").toLowerCase();class le{constructor(...t){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=J.ELEMENT_NODE,this.TEXT_NODE=J.TEXT_NODE}get firstChild(){return this.childNodes[0]||null}get lastChild(){return this.childNodes[this.childNodes.length-1]||null}get nextSibling(){const t=this.parentNode;if(!t)return null;const r=t.childNodes,n=r.indexOf(this);return r[n+1]||null}contains(t){if(t===this)return!0;for(const r of this.childNodes)if(r.contains(t))return!0;return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,r){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function Ei(e){return class Vn extends e{constructor(){super(...arguments),this.nodeType=J.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=P.Document,this.textContent=null}get documentElement(){return this.childNodes.find(r=>r.RRNodeType===P.Element&&r.tagName==="HTML")||null}get body(){var r;return((r=this.documentElement)===null||r===void 0?void 0:r.childNodes.find(n=>n.RRNodeType===P.Element&&n.tagName==="BODY"))||null}get head(){var r;return((r=this.documentElement)===null||r===void 0?void 0:r.childNodes.find(n=>n.RRNodeType===P.Element&&n.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(r){const n=r.RRNodeType;if((n===P.Element||n===P.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===n))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${n===P.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);return r.parentElement=null,r.parentNode=this,this.childNodes.push(r),r}insertBefore(r,n){const o=r.RRNodeType;if((o===P.Element||o===P.DocumentType)&&this.childNodes.some(l=>l.RRNodeType===o))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${o===P.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);if(n===null)return this.appendChild(r);const i=this.childNodes.indexOf(n);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,r),r.parentElement=null,r.parentNode=this,r}removeChild(r){const n=this.childNodes.indexOf(r);if(n===-1)throw new Error("Failed to execute 'removeChild' on 'RRDocument': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(n,1),r.parentElement=null,r.parentNode=null,r}open(){this.childNodes=[]}close(){}write(r){let n;if(r==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?n="-//W3C//DTD XHTML 1.0 Transitional//EN":r==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(n="-//W3C//DTD HTML 4.0 Transitional//EN"),n){const o=this.createDocumentType("html",n,"");this.open(),this.appendChild(o)}}createDocument(r,n,o){return new Vn}createDocumentType(r,n,o){const i=new(Yr(le))(r,n,o);return i.ownerDocument=this,i}createElement(r){const n=new(Xr(le))(r);return n.ownerDocument=this,n}createElementNS(r,n){return this.createElement(n)}createTextNode(r){const n=new(Zr(le))(r);return n.ownerDocument=this,n}createComment(r){const n=new(Kr(le))(r);return n.ownerDocument=this,n}createCDATASection(r){const n=new(qr(le))(r);return n.ownerDocument=this,n}toString(){return"RRDocument"}}}function Yr(e){return class extends e{constructor(t,r,n){super(),this.nodeType=J.DOCUMENT_TYPE_NODE,this.RRNodeType=P.DocumentType,this.textContent=null,this.name=t,this.publicId=r,this.systemId=n,this.nodeName=t}toString(){return"RRDocumentType"}}}function Xr(e){return class extends e{constructor(t){super(),this.nodeType=J.ELEMENT_NODE,this.RRNodeType=P.Element,this.attributes={},this.shadowRoot=null,this.tagName=t.toUpperCase(),this.nodeName=t.toUpperCase()}get textContent(){let t="";return this.childNodes.forEach(r=>t+=r.textContent),t}set textContent(t){this.childNodes=[this.ownerDocument.createTextNode(t)]}get classList(){return new Ii(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?bi(this.attributes.style):{},r=/\B([A-Z])/g;return t.setProperty=(n,o,i)=>{if(r.test(n))return;const l=Rt(n);o?t[l]=o:delete t[l],i==="important"&&(t[l]+=" !important"),this.attributes.style=Hr(t)},t.removeProperty=n=>{if(r.test(n))return"";const o=Rt(n),i=t[o]||"";return delete t[o],this.attributes.style=Hr(t),i},t}getAttribute(t){return this.attributes[t]||null}setAttribute(t,r){this.attributes[t]=r}setAttributeNS(t,r,n){this.setAttribute(r,n)}removeAttribute(t){delete this.attributes[t]}appendChild(t){return this.childNodes.push(t),t.parentNode=this,t.parentElement=this,t}insertBefore(t,r){if(r===null)return this.appendChild(t);const n=this.childNodes.indexOf(r);if(n==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(n,0,t),t.parentElement=this,t.parentNode=this,t}removeChild(t){const r=this.childNodes.indexOf(t);if(r===-1)throw new Error("Failed to execute 'removeChild' on 'RRElement': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(r,1),t.parentElement=null,t.parentNode=null,t}attachShadow(t){const r=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=r,r}dispatchEvent(t){return!0}toString(){let t="";for(const r in this.attributes)t+=`${r}="${this.attributes[r]}" `;return`${this.tagName} ${t}`}}}function Ci(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 Zr(e){return class extends e{constructor(t){super(),this.nodeType=J.TEXT_NODE,this.nodeName="#text",this.RRNodeType=P.Text,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function Kr(e){return class extends e{constructor(t){super(),this.nodeType=J.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=P.Comment,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function qr(e){return class extends e{constructor(t){super(),this.nodeName="#cdata-section",this.nodeType=J.CDATA_SECTION_NODE,this.RRNodeType=P.CDATA,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class Ii{constructor(t,r){if(this.classes=[],this.add=(...n)=>{for(const o of n){const i=String(o);this.classes.indexOf(i)>=0||this.classes.push(i)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...n)=>{this.classes=this.classes.filter(o=>n.indexOf(o)===-1),this.onChange&&this.onChange(this.classes.join(" "))},t){const n=t.trim().split(/\s+/);this.classes.push(...n)}this.onChange=r}}var J;(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"})(J||(J={}));const Dt={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"};function he(e,t,r,n){const o=e.childNodes,i=t.childNodes;n=n||t.mirror||t.ownerDocument.mirror,(o.length>0||i.length>0)&&Jr(Array.from(o),i,e,r,n);let l=null,c=null;switch(t.RRNodeType){case P.Document:{c=t.scrollData;break}case P.Element:{const a=e,s=t;switch(ki(a,s,n),c=s.scrollData,l=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":t.canvasMutations.forEach(u=>r.applyCanvas(u.event,u.mutation,e));break;case"STYLE":xi(a,t.rules);break}if(s.shadowRoot){a.shadowRoot||a.attachShadow({mode:"open"});const u=a.shadowRoot.childNodes,d=s.shadowRoot.childNodes;(u.length>0||d.length>0)&&Jr(Array.from(u),d,a.shadowRoot,r,n)}break}case P.Text:case P.Comment:case P.CDATA:e.textContent!==t.data&&(e.textContent=t.data);break}if(c&&r.applyScroll(c,!0),l&&r.applyInput(l),t.nodeName==="IFRAME"){const a=e.contentDocument,s=t;if(a){const u=n.getMeta(s.contentDocument);u&&r.mirror.add(a,Object.assign({},u)),he(a,s.contentDocument,r,n)}}}function ki(e,t,r){const n=e.attributes,o=t.attributes;for(const i in o){const l=o[i],c=r.getMeta(t);if(c&&"isSVG"in c&&c.isSVG&&Dt[i])e.setAttributeNS(Dt[i],i,l);else if(t.tagName==="CANVAS"&&i==="rr_dataURL"){const a=document.createElement("img");a.src=l,a.onload=()=>{const s=e.getContext("2d");s&&s.drawImage(a,0,0,a.width,a.height)}}else e.setAttribute(i,l)}for(const{name:i}of Array.from(n))i in o||e.removeAttribute(i);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function Jr(e,t,r,n,o){var i,l;let c=0,a=e.length-1,s=0,u=t.length-1,d=e[c],m=e[a],h=t[s],p=t[u],v,b;for(;c<=a&&s<=u;)if(d===void 0)d=e[++c];else if(m===void 0)m=e[--a];else if(n.mirror.getId(d)===o.getId(h))he(d,h,n,o),d=e[++c],h=t[++s];else if(n.mirror.getId(m)===o.getId(p))he(m,p,n,o),m=e[--a],p=t[--u];else if(n.mirror.getId(d)===o.getId(p))r.insertBefore(d,m.nextSibling),he(d,p,n,o),d=e[++c],p=t[--u];else if(n.mirror.getId(m)===o.getId(h))r.insertBefore(m,d),he(m,h,n,o),m=e[--a],h=t[++s];else{if(!v){v={};for(let f=c;f<=a;f++){const S=e[f];S&&n.mirror.hasNode(S)&&(v[n.mirror.getId(S)]=f)}}if(b=v[o.getId(h)],b){const f=e[b];r.insertBefore(f,d),he(f,h,n,o),e[b]=void 0}else{const f=Lt(h,n.mirror,o);((i=n.mirror.getMeta(r))===null||i===void 0?void 0:i.type)===P.Document&&((l=n.mirror.getMeta(f))===null||l===void 0?void 0:l.type)===P.Element&&r.documentElement&&(r.removeChild(r.documentElement),e[c]=void 0,d=void 0),r.insertBefore(f,d||null),he(f,h,n,o)}h=t[++s]}if(c>a){const f=t[u+1];let S=null;for(f&&r.childNodes.forEach(y=>{n.mirror.getId(y)===o.getId(f)&&(S=y)});s<=u;++s){const y=Lt(t[s],n.mirror,o);r.insertBefore(y,S),he(y,t[s],n,o)}}else if(s>u)for(;c<=a;c++){const f=e[c];f&&(r.removeChild(f),n.mirror.removeNodeFromMap(f))}}function Lt(e,t,r){let n=t.getNode(r.getId(e));const o=r.getMeta(e);if(n!==null)return n;switch(e.RRNodeType){case P.Document:n=new Document;break;case P.DocumentType:n=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case P.Element:{e.tagName.toLowerCase(),o&&"isSVG"in o&&o?.isSVG?n=document.createElementNS(Dt.svg,e.tagName.toLowerCase()):n=document.createElement(e.tagName);break}case P.Text:n=document.createTextNode(e.data);break;case P.Comment:n=document.createComment(e.data);break;case P.CDATA:n=document.createCDATASection(e.data);break}return o&&t.add(n,Object.assign({},o)),n}function Xe(e,t){const r=e[t[0]];return t.length===1?r:Xe(r.cssRules[t[1]].cssRules,t.slice(2))}var ce;(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"})(ce||(ce={}));function Qr(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function xi(e,t){const r=e.sheet;t.forEach(n=>{if(n.type===ce.Insert)try{if(Array.isArray(n.index)){const{positions:o,index:i}=Qr(n.index);Xe(r.cssRules,o).insertRule(n.cssText,i)}else r.insertRule(n.cssText,n.index)}catch{}else if(n.type===ce.Remove)try{if(Array.isArray(n.index)){const{positions:o,index:i}=Qr(n.index);Xe(r.cssRules,o).deleteRule(i||0)}else r.deleteRule(n.index)}catch{}else n.type===ce.SetProperty?Xe(r.cssRules,n.index).style.setProperty(n.property,n.value,n.priority):n.type===ce.RemoveProperty&&Xe(r.cssRules,n.index).style.removeProperty(n.property)})}class Ae extends Ei(le){constructor(t){super(),this._unserializedId=-1,this.mirror=Wi(),this.scrollData=null,t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,r,n){return new Ae}createDocumentType(t,r,n){const o=new Mi(t,r,n);return o.ownerDocument=this,o}createElement(t){const r=t.toUpperCase();let n;switch(r){case"AUDIO":case"VIDEO":n=new Oi(r);break;case"IFRAME":n=new Li(r,this.mirror);break;case"CANVAS":n=new Ri(r);break;case"STYLE":n=new Di(r);break;default:n=new Ze(r);break}return n.ownerDocument=this,n}createComment(t){const r=new Pi(t);return r.ownerDocument=this,r}createCDATASection(t){const r=new Fi(t);return r.ownerDocument=this,r}createTextNode(t){const r=new Ai(t);return r.ownerDocument=this,r}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=-1}}const Mi=Yr(le);class Ze extends Xr(le){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class Oi extends Ci(Ze){}class Ri extends Ze{constructor(){super(...arguments),this.canvasMutations=[]}getContext(){return null}}class Di extends Ze{constructor(){super(...arguments),this.rules=[]}}class Li extends Ze{constructor(t,r){super(t),this.contentDocument=new Ae,this.contentDocument.mirror=r}}const Ai=Zr(le),Pi=Kr(le),Fi=qr(le);function _i(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function en(e,t,r,n){let o;switch(e.nodeType){case J.DOCUMENT_NODE:n&&n.nodeName==="IFRAME"?o=n.contentDocument:(o=t,o.compatMode=e.compatMode);break;case J.DOCUMENT_TYPE_NODE:const l=e;o=t.createDocumentType(l.name,l.publicId,l.systemId);break;case J.ELEMENT_NODE:const c=e,a=_i(c);o=t.createElement(a);const s=o;for(const{name:u,value:d}of Array.from(c.attributes))s.attributes[u]=d;c.scrollLeft&&(s.scrollLeft=c.scrollLeft),c.scrollTop&&(s.scrollTop=c.scrollTop);break;case J.TEXT_NODE:o=t.createTextNode(e.textContent||"");break;case J.CDATA_SECTION_NODE:o=t.createCDATASection(e.data);break;case J.COMMENT_NODE:o=t.createComment(e.textContent||"");break;case J.DOCUMENT_FRAGMENT_NODE:o=n.attachShadow({mode:"open"});break;default:return null}let i=r.getMeta(e);return t instanceof Ae&&(i||(i=tn(o,t.unserializedId),r.add(e,i)),t.mirror.add(o,Object.assign({},i))),o}function $i(e,t=yi(),r=new Ae){function n(o,i){const l=en(o,r,t,i);l!==null&&(i?.nodeName!=="IFRAME"&&o.nodeType!==J.DOCUMENT_FRAGMENT_NODE&&(i?.appendChild(l),l.parentNode=i,l.parentElement=i),o.nodeName==="IFRAME"?n(o.contentDocument,l):(o.nodeType===J.DOCUMENT_NODE||o.nodeType===J.ELEMENT_NODE||o.nodeType===J.DOCUMENT_FRAGMENT_NODE)&&(o.nodeType===J.ELEMENT_NODE&&o.shadowRoot&&n(o.shadowRoot,l),o.childNodes.forEach(c=>n(c,l))))}return n(e,null),r}function Wi(){return new ji}class ji{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){var r;if(!t)return-1;const n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){const n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function tn(e,t){switch(e.RRNodeType){case P.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case P.DocumentType:const r=e;return{id:t,type:e.RRNodeType,name:r.name,publicId:r.publicId,systemId:r.systemId};case P.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case P.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case P.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case P.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}function rn(e){return e=e||Object.create(null),{on:function(r,n){(e[r]||(e[r]=[])).push(n)},off:function(r,n){e[r]&&e[r].splice(e[r].indexOf(n)>>>0,1)},emit:function(r,n){(e[r]||[]).slice().map(function(o){o(n)}),(e["*"]||[]).slice().map(function(o){o(r,n)})}}}var Vi=Object.freeze({__proto__:null,default:rn});function Ui(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;const r=e.HTMLElement||e.Element,n=468,o={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||a,scrollIntoView:r.prototype.scrollIntoView},i=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function l(f){const S=["MSIE ","Trident/","Edge/"];return new RegExp(S.join("|")).test(f)}const c=l(e.navigator.userAgent)?1:0;function a(f,S){this.scrollLeft=f,this.scrollTop=S}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,S){if(S==="Y")return f.clientHeight+c<f.scrollHeight;if(S==="X")return f.clientWidth+c<f.scrollWidth}function m(f,S){const y=e.getComputedStyle(f,null)["overflow"+S];return y==="auto"||y==="scroll"}function h(f){const S=d(f,"Y")&&m(f,"Y"),y=d(f,"X")&&m(f,"X");return S||y}function p(f){for(;f!==t.body&&h(f)===!1;)f=f.parentNode||f.host;return f}function v(f){const S=i();let y,N,x,M=(S-f.startTime)/n;M=M>1?1:M,y=s(M),N=f.startX+(f.x-f.startX)*y,x=f.startY+(f.y-f.startY)*y,f.method.call(f.scrollable,N,x),(N!==f.x||x!==f.y)&&e.requestAnimationFrame(v.bind(e,f))}function b(f,S,y){let N,x,M,I;const E=i();f===t.body?(N=e,x=e.scrollX||e.pageXOffset,M=e.scrollY||e.pageYOffset,I=o.scroll):(N=f,x=f.scrollLeft,M=f.scrollTop,I=a),v({scrollable:N,method:I,startTime:E,startX:x,startY:M,x:S,y})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset);return}b.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}b.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset))}},r.prototype.scroll=r.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(u(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const f=arguments[0].left,S=arguments[0].top;b.call(this,this,typeof f>"u"?this.scrollLeft:~~f,typeof S>"u"?this.scrollTop:~~S)},r.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},r.prototype.scrollIntoView=function(){if(u(arguments[0])===!0){o.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const f=p(this),S=f.getBoundingClientRect(),y=this.getBoundingClientRect();f!==t.body?(b.call(this,f,f.scrollLeft+y.left-S.left,f.scrollTop+y.top-S.top),e.getComputedStyle(f).position!=="fixed"&&e.scrollBy({left:S.left,top:S.top,behavior:"smooth"})):e.scrollBy({left:y.left,top:y.top,behavior:"smooth"})}}class Gi{constructor(t=[],r){this.timeOffset=0,this.raf=null,this.actions=t,this.speed=r}addAction(t){const r=this.findActionIndex(t);this.actions.splice(r,0,t)}addActions(t){this.actions=this.actions.concat(t)}replaceActions(t){this.actions.length=0,this.actions.splice(0,0,...t)}start(){this.timeOffset=0;let t=performance.now();const{actions:r}=this,n=this;function o(){const i=performance.now();for(n.timeOffset+=(i-t)*n.speed,t=i;r.length;){const l=r[0];if(n.timeOffset>=l.delay)r.shift(),l.doAction();else break}(r.length>0||n.liveMode)&&(n.raf=requestAnimationFrame(o))}this.raf=requestAnimationFrame(o)}clear(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(t){this.speed=t}toggleLiveMode(t){this.liveMode=t}isActive(){return this.raf!==null}findActionIndex(t){let r=0,n=this.actions.length-1;for(;r<=n;){const o=Math.floor((r+n)/2);if(this.actions[o].delay<t.delay)r=o+1;else if(this.actions[o].delay>t.delay)n=o-1;else return o+1}return r}}function At(e,t){if(e.type===R.IncrementalSnapshot&&e.data.source===D.MouseMove){const r=e.data.positions[0].timeOffset,n=e.timestamp+r;return e.delay=n-t,n-t}return e.delay=e.timestamp-t,e.delay}/*! *****************************************************************************
6
6
  Copyright (c) Microsoft Corporation.
7
7
 
8
8
  Permission to use, copy, modify, and/or distribute this software for any
@@ -15,15 +15,15 @@ or you can use record.mirror to access the mirror instance during recording.`;q.
15
15
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
16
16
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17
17
  PERFORMANCE OF THIS SOFTWARE.
18
- ***************************************************************************** */function Qr(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),l=[];try{for(;(t===void 0||t-- >0)&&!(n=i.next()).done;)l.push(n.value)}catch(c){o={error:c}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return l}var Pe;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Pe||(Pe={}));var en={type:"xstate.init"};function At(e){return e===void 0?[]:[].concat(e)}function Me(e){return{type:"xstate.assign",assignment:e}}function tn(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 at(e){return function(t){return e===t}}function rn(e){return typeof e=="string"?{type:e}:e}function nn(e,t){return{value:e,context:t,actions:[],changed:!1,matches:at(e)}}function on(e,t,r){var n=t,o=!1;return[e.filter(function(i){if(i.type==="xstate.assign"){o=!0;var l=Object.assign({},n);return typeof i.assignment=="function"?l=i.assignment(n,r):Object.keys(i.assignment).forEach(function(c){l[c]=typeof i.assignment[c]=="function"?i.assignment[c](n,r):i.assignment[c]}),n=l,!1}return!0}),n,o]}function sn(e,t){t===void 0&&(t={});var r=Qr(on(At(e.states[e.initial].entry).map(function(l){return tn(l,t.actions)}),e.context,en),2),n=r[0],o=r[1],i={config:e,_options:t,initialState:{value:e.initial,actions:n,context:o,matches:at(e.initial)},transition:function(l,c){var a,s,u=typeof l=="string"?{value:l,context:e.context}:l,d=u.value,m=u.context,h=rn(c),v=e.states[d];if(v.on){var p=At(v.on[h.type]);try{for(var w=function(x){var D=typeof Symbol=="function"&&Symbol.iterator,b=D&&x[D],g=0;if(b)return b.call(x);if(x&&typeof x.length=="number")return{next:function(){return x&&g>=x.length&&(x=void 0),{value:x&&x[g++],done:!x}}};throw new TypeError(D?"Object is not iterable.":"Symbol.iterator is not defined.")}(p),f=w.next();!f.done;f=w.next()){var S=f.value;if(S===void 0)return nn(d,m);var T=typeof S=="string"?{target:S}:S,I=T.target,R=T.actions,M=R===void 0?[]:R,C=T.cond,y=C===void 0?function(){return!0}:C,H=I===void 0,G=I??d,K=e.states[G];if(y(m,h)){var V=Qr(on((H?At(M):[].concat(v.exit,M,K.entry).filter(function(x){return x})).map(function(x){return tn(x,i._options.actions)}),m,h),3),U=V[0],Y=V[1],B=V[2],L=I??d;return{value:L,context:Y,actions:U,changed:I!==d||U.length>0||B,matches:at(L)}}}}catch(x){a={error:x}}finally{try{f&&!f.done&&(s=w.return)&&s.call(w)}finally{if(a)throw a.error}}}return nn(d,m)}};return i}var an=function(e,t){return e.actions.forEach(function(r){var n=r.exec;return n&&n(e.context,t)})};function ln(e){var t=e.initialState,r=Pe.NotStarted,n=new Set,o={_machine:e,send:function(i){r===Pe.Running&&(t=e.transition(t,i),an(t,rn(i)),n.forEach(function(l){return l(t)}))},subscribe:function(i){return n.add(i),i(t),{unsubscribe:function(){return n.delete(i)}}},start:function(i){if(i){var l=typeof i=="object"?i:{context:e.config.context,value:i};t={value:l.value,actions:[],context:l.context,matches:at(l.value)}}return r=Pe.Running,an(t,en),o},stop:function(){return r=Pe.Stopped,n.clear(),o},get state(){return t},get status(){return r}};return o}var _i=Object.defineProperty,$i=Object.defineProperties,Wi=Object.getOwnPropertyDescriptors,cn=Object.getOwnPropertySymbols,ji=Object.prototype.hasOwnProperty,Vi=Object.prototype.propertyIsEnumerable,un=(e,t,r)=>t in e?_i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,lt=(e,t)=>{for(var r in t||(t={}))ji.call(t,r)&&un(e,r,t[r]);if(cn)for(var r of cn(t))Vi.call(t,r)&&un(e,r,t[r]);return e},ct=(e,t)=>$i(e,Wi(t));function Ui(e,t){for(let r=e.length-1;r>=0;r--){const n=e[r];if(n.type===O.Meta&&n.timestamp<=t)return e.slice(r)}return e}function Gi(e,{getCastFn:t,applyEventsSynchronously:r,emitter:n}){const o=sn({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:Me({lastPlayedEvent:(i,l)=>l.type==="CAST_EVENT"?l.payload.event:i.lastPlayedEvent}),recordTimeOffset:Me((i,l)=>{let c=i.timeOffset;return"payload"in l&&"timeOffset"in l.payload&&(c=l.payload.timeOffset),ct(lt({},i),{timeOffset:c,baselineTime:i.events[0].timestamp+c})}),play(i){var l;const{timer:c,events:a,baselineTime:s,lastPlayedEvent:u}=i;c.clear();for(const p of a)Lt(p,s);const d=Ui(a,s);let m=u?.timestamp;u?.type===O.IncrementalSnapshot&&u.data.source===A.MouseMove&&(m=u.timestamp+((l=u.data.positions[0])==null?void 0:l.timeOffset)),s<(m||0)&&n.emit(z.PlayBack);const h=new Array,v=new Array;for(const p of d)if(!(m&&m<s&&(p.timestamp<=m||p===u)))if(p.timestamp<s)h.push(p);else{const w=t(p,!1);v.push({doAction:()=>{w()},delay:p.delay})}r(h),n.emit(z.Flush),c.addActions(v),c.start()},pause(i){i.timer.clear()},resetLastPlayedEvent:Me(i=>ct(lt({},i),{lastPlayedEvent:null})),startLive:Me({baselineTime:(i,l)=>(i.timer.toggleLiveMode(!0),i.timer.start(),l.type==="TO_LIVE"&&l.payload.baselineTime?l.payload.baselineTime:Date.now())}),replaceEvents:Me((i,l)=>{const{events:c,timer:a,baselineTime:s}=i;if(l.type==="REPLACE_EVENTS"){const{events:u}=l.payload;c.length=0;const d=[];for(const m of u)if(Lt(m,s),c.push(m),m.timestamp>=a.timeOffset+s){const h=t(m,!1);d.push({doAction:()=>{h()},delay:m.delay})}a.isActive()&&a.replaceActions(d)}return ct(lt({},i),{events:c})}),addEvent:Me((i,l)=>{const{baselineTime:c,timer:a,events:s}=i;if(l.type==="ADD_EVENT"){const{event:u}=l.payload;Lt(u,c);let d=s.length-1;if(!s[d]||s[d].timestamp<=u.timestamp)s.push(u);else{let v=-1,p=0;for(;p<=d;){const w=Math.floor((p+d)/2);s[w].timestamp<=u.timestamp?p=w+1:d=w-1}v===-1&&(v=p),s.splice(v,0,u)}const m=u.timestamp<c,h=t(u,m);m?h():a.isActive()&&a.addAction({doAction:()=>{h()},delay:u.delay})}return ct(lt({},i),{events:s})})}});return ln(o)}function Bi(e){const t=sn({id:"speed",context:e,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(r,n)=>{"payload"in n&&r.timer.setSpeed(n.payload.speed)},recordSpeed:Me({normalSpeed:r=>r.timer.speed}),restoreSpeed:r=>{r.timer.setSpeed(r.normalSpeed)}}});return ln(t)}const zi=e=>[`.${e} { background: currentColor }`,"noscript { display: none !important; }",`.${e} { background: currentColor; border-radius: 5px; }`,`.${e}:hover::after {content: 'Redacted'; color: white; background: black; text-align: center; width: 100%; display: block;}`];var Hi=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});const dn=new Map;function hn(e,t){let r=dn.get(e);return r||(r=new Map,dn.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}function Se(e,t,r){return n=>Hi(this,null,function*(){if(n&&typeof n=="object"&&"rr_type"in n)if(r&&(r.isUnchanged=!1),n.rr_type==="ImageBitmap"&&"args"in n){const o=yield Se(e,t,r)(n.args);return yield createImageBitmap.apply(null,o)}else if("index"in n){if(r||t===null)return n;const{rr_type:o,index:i}=n;return hn(t,o)[i]}else if("args"in n){const{rr_type:o,args:i}=n,l=window[o];return new l(...yield Promise.all(i.map(Se(e,t,r))))}else{if("base64"in n)return Bo(n.base64);if("src"in n){const o=e.get(n.src);if(o)return o;{const i=new Image;return i.src=n.src,e.set(n.src,i),i}}else if("data"in n&&n.rr_type==="Blob"){const o=yield Promise.all(n.data.map(Se(e,t,r)));return new Blob(o,{type:n.type})}}else if(Array.isArray(n))return yield Promise.all(n.map(Se(e,t,r)));return n})}var Yi=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});function Xi(e,t){try{return t===ve.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}const Zi=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function Ki(e,t){if(!(t!=null&&t.constructor))return;const{name:r}=t.constructor;if(!Zi.includes(r))return;const n=hn(e,r);n.includes(t)||n.push(t)}function qi(e){return Yi(this,arguments,function*({mutation:t,target:r,type:n,imageMap:o,errorHandler:i}){try{const l=Xi(r,n);if(!l)return;if(t.setter){l[t.property]=t.args[0];return}const c=l[t.property],a=yield Promise.all(t.args.map(Se(o,l))),s=c.apply(l,a);Ki(l,s)}catch(l){i(t,l)}})}var Ji=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});function Qi(e){return Ji(this,arguments,function*({event:t,mutation:r,target:n,imageMap:o,errorHandler:i}){try{const l=n.getContext("2d");if(r.setter){l[r.property]=r.args[0];return}const c=l[r.property];if(r.property==="drawImage"&&typeof r.args[0]=="string"){const a=o.get(t);c.apply(l,r.args)}else{const a=yield Promise.all(r.args.map(Se(o,l)));c.apply(l,a)}}catch(l){i(r,l)}})}var es=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});function mn(e){return es(this,arguments,function*({event:t,mutation:r,target:n,imageMap:o,canvasEventMap:i,errorHandler:l}){try{const c=i.get(t)||r,a="commands"in c?c.commands:[c];if([ve.WebGL,ve.WebGL2].includes(r.type)){for(let s=0;s<a.length;s++){const u=a[s];yield qi({mutation:u,type:r.type,target:n,imageMap:o,errorHandler:l})}return}for(let s=0;s<a.length;s++){const u=a[s];yield Qi({event:t,mutation:u,target:n,imageMap:o,errorHandler:l})}}catch(c){l(r,c)}})}var ts=Object.defineProperty,rs=Object.defineProperties,ns=Object.getOwnPropertyDescriptors,pn=Object.getOwnPropertySymbols,os=Object.prototype.hasOwnProperty,is=Object.prototype.propertyIsEnumerable,fn=(e,t,r)=>t in e?ts(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_e=(e,t)=>{for(var r in t||(t={}))os.call(t,r)&&fn(e,r,t[r]);if(pn)for(var r of pn(t))is.call(t,r)&&fn(e,r,t[r]);return e},Ft=(e,t)=>rs(e,ns(t)),Pt=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});const vn=10*1e3,gn=2*1e3,yn=1*1e3,bn=60*60*1e3,ss=Jr||Ai,_t="[replayer]",$t={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Wt(e){return e.type==O.IncrementalSnapshot&&(e.data.source==A.TouchMove||e.data.source==A.MouseInteraction&&e.data.type==te.TouchStart)}class as{constructor(t,r){if(this.usingVirtualDom=!1,this.virtualDom=new Fe,this.mouseTail=null,this.tailPositions=[],this.emitter=ss(),this.activityIntervals=[],this.legacy_missingNodeRetryMap={},this.cache=ur(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=tr(),this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,!(r!=null&&r.liveMode)&&t.length<2)throw new Error("Replayer need at least 2 events.");const n={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"highlight-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:$t,useVirtualDom:!0,inactiveThreshold:.02,inactiveSkipTime:gn};this.config=Object.assign({},n,r),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(z.Resize,this.handleResize),this.setupDom(),this.emitter.on(z.Flush,()=>{if(this.usingVirtualDom){const c={mirror:this.mirror,applyCanvas:(a,s,u)=>{mn({event:a,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(me(this.iframe.contentDocument,this.virtualDom,c,this.virtualDom.mirror),this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const a in this.legacy_missingNodeRetryMap)try{const s=this.legacy_missingNodeRetryMap[a],u=Rt(s.node,this.mirror,this.virtualDom.mirror);me(u,s.node,c,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(z.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset()});const o=new Pi([],r?.speed||n.speed);this.service=Gi({events:t.map(c=>r&&r.unpackFn?r.unpackFn(c):c).sort((c,a)=>c.timestamp-a.timestamp),timer:o,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(c=>{this.emitter.emit(z.StateChange,{player:c})}),this.speedService=Bi({normalSpeed:-1,timer:o}),this.speedService.start(),this.speedService.subscribe(c=>{this.emitter.emit(z.StateChange,{speed:c})});const i=this.service.state.context.events.find(c=>c.type===O.Meta),l=this.service.state.context.events.find(c=>c.type===O.FullSnapshot);if(i){const{width:c,height:a}=i.data;setTimeout(()=>{this.emitter.emit(z.Resize,{width:c,height:a})},0)}l&&setTimeout(()=>{this.firstFullSnapshot||(this.firstFullSnapshot=l,this.rebuildFullSnapshot(l),this.iframe.contentWindow.scrollTo(l.data.initialOffset))},1),this.service.state.context.events.find(Wt)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(t,r){return this.emitter.on(t,r),this}off(t,r){return this.emitter.off(t,r),this}setConfig(t){Object.keys(t).forEach(r=>{this.config[r]=t[r]}),this.config.skipInactive||this.backToNormal(),typeof t.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:t.speed}}),typeof t.mouseTail<"u"&&(t.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getActivityIntervals(){if(this.activityIntervals.length==0){const t=[],r=this.getMetaData(),n=[{timestamp:r.startTime},...this.service.state.context.events.filter(l=>this.isUserInteraction(l)),{timestamp:r.endTime}];for(let l=1;l<n.length;l++){const c=n[l-1],a=n[l];a.timestamp-c.timestamp>vn?t.push({startTime:c.timestamp,endTime:a.timestamp,duration:a.timestamp-c.timestamp,active:!1}):t.push({startTime:c.timestamp,endTime:a.timestamp,duration:a.timestamp-c.timestamp,active:!0})}const o=[];let i=t[0];for(let l=1;l<t.length;l++)t[l].active!=t[l-1].active&&(o.push({startTime:i.startTime,endTime:t[l-1].endTime,duration:t[l-1].endTime-i.startTime,active:t[l-1].active}),i=t[l]);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 l=1;l<o.length;l++)(!o[l].active&&o[l].duration>this.config.inactiveThreshold*r.totalTime||!o[l-1].active&&o[l-1].duration>this.config.inactiveThreshold*r.totalTime)&&(this.activityIntervals.push({startTime:i.startTime,endTime:o[l-1].endTime,duration:o[l-1].endTime-i.startTime,active:o[l-1].active}),i=o[l]);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],r=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:t.timestamp,endTime:r.timestamp,totalTime:r.timestamp-t.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:t,events:r}=this.service.state.context;return t-r[0].timestamp}getMirror(){return this.mirror}play(t=0){var r,n;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:t}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:t}})),(n=(r=this.iframe.contentDocument)==null?void 0:r.getElementsByTagName("html")[0])==null||n.classList.remove("rrweb-paused"),this.emitter.emit(z.Start),this.handleInactivity(this.getMetaData().startTime+t,!0)}pause(t){var r,n;t===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof t=="number"&&(this.play(t),this.service.send({type:"PAUSE"})),(n=(r=this.iframe.contentDocument)==null?void 0:r.getElementsByTagName("html")[0])==null||n.classList.add("rrweb-paused"),this.emitter.emit(z.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(z.Resume)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){const r=this.config.unpackFn?this.config.unpackFn(t):t;Wt(r)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:r}}))}replaceEvents(t){for(const r of t)if(Wt(r)){this.mouse.classList.add("touch-device");break}this.service.send({type:"REPLACE_EVENTS",payload:{events:t}})}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=ur()}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&&(Fi(this.iframe.contentWindow,this.iframe.contentDocument),Tt(this.iframe.contentWindow))}handleResize(t){this.iframe.style.display="inherit";for(const r of[this.mouseTail,this.iframe])!r||(r.setAttribute("width",String(t.width)),r.setAttribute("height",String(t.height)))}applyEventsSynchronously(t){for(const r of t){switch(r.type){case O.DomContentLoaded:case O.Load:case O.Custom:continue;case O.FullSnapshot:case O.Meta:case O.Plugin:case O.IncrementalSnapshot:break}this.getCastFn(r,!0)()}this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null}getCastFn(t,r=!1){let n;switch(t.type){case O.DomContentLoaded:case O.Load:break;case O.Custom:n=()=>{this.emitter.emit(z.CustomEvent,t)};break;case O.Meta:n=()=>this.emitter.emit(z.Resize,{width:t.data.width,height:t.data.height});break;case O.FullSnapshot:n=()=>{if(this.firstFullSnapshot){if(this.firstFullSnapshot===t){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(t,r),this.iframe.contentWindow.scrollTo(t.data.initialOffset)};break;case O.IncrementalSnapshot:n=()=>{if(this.applyIncremental(t,r),!r&&(this.handleInactivity(t.timestamp),t===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const o of this.service.state.context.events)if(!(o.timestamp<=t.timestamp)&&this.isUserInteraction(o)){o.delay-t.delay>vn*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=o);break}if(this.nextUserInteractionEvent){const o=this.nextUserInteractionEvent.delay-t.delay,i={speed:Math.min(Math.round(o/gn),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:i}),this.emitter.emit(z.SkipStart,i)}}};break}return()=>{n&&n();for(const i of this.config.plugins||[])i.handler(t,r,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:t}});const o=this.service.state.context.events.length-1;if(t===this.service.state.context.events[o]){const i=()=>{o<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(z.Finish))};t.type===O.IncrementalSnapshot&&t.data.source===A.MouseMove&&t.data.positions.length?setTimeout(()=>{i()},Math.max(0,-t.data.positions[0].timeOffset+50)):i()}this.emitter.emit(z.EventCast,t)}}handleInactivity(t,r){if((t===this.inactiveEndTimestamp||r)&&(this.inactiveEndTimestamp=null,this.backToNormal()),this.config.skipInactive&&!this.inactiveEndTimestamp){for(const n of this.getActivityIntervals())if(t>=n.startTime&&t<n.endTime&&!n.active){this.inactiveEndTimestamp=n.endTime;break}if(this.inactiveEndTimestamp){const n=this.inactiveEndTimestamp-t,o={speed:n/bn*this.config.inactiveSkipTime<yn?n/yn:Math.round(Math.max(n,bn)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:o}),this.emitter.emit(z.SkipStart,o)}}}rebuildFullSnapshot(t,r=!1){if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const n=[];fo(t.data.node,{doc:this.iframe.contentDocument,afterAppend:l=>{this.collectIframeAndAttachDocument(n,l)},cache:this.cache,mirror:this.mirror});for(const{mutationInQueue:l,builtNode:c}of n)this.attachDocumentToIframe(l,c),this.newDocumentQueue=this.newDocumentQueue.filter(a=>a!==l);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(z.FullsnapshotRebuilded,t),r||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,r){const n=zi(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&n.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,qr(o,this.virtualDom.unserializedId)),t.insertBefore(o,r);for(let i=0;i<n.length;i++)o.rules.push({cssText:n[i],type:ce.Insert,index:i})}else{const o=document.createElement("style");t.insertBefore(o,r);for(let i=0;i<n.length;i++)o.sheet.insertRule(n[i],i)}}attachDocumentToIframe(t,r){const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,o=[];rt(t.node,{doc:r.contentDocument,mirror:n,hackCss:!0,skipChild:!1,afterAppend:i=>{this.collectIframeAndAttachDocument(o,i);const l=n.getMeta(i);if(l?.type===j.Element&&l?.tagName.toUpperCase()==="HTML"){const{documentElement:c,head:a}=r.contentDocument;this.insertStyleRules(c,a)}},cache:this.cache});for(const{mutationInQueue:i,builtNode:l}of o)this.attachDocumentToIframe(i,l),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==i)}collectIframeAndAttachDocument(t,r){if(Re(r,this.mirror)){const n=this.newDocumentQueue.find(o=>o.parentId===this.mirror.getId(r));n&&t.push({mutationInQueue:n,builtNode:r})}}waitForStylesheetLoad(){var t;const r=(t=this.iframe.contentDocument)==null?void 0:t.head;if(r){const n=new Set;let o,i=this.service.state;const l=()=>{i=this.service.state};this.emitter.on(z.Start,l),this.emitter.on(z.Pause,l);const c=()=>{this.emitter.off(z.Start,l),this.emitter.off(z.Pause,l)};r.querySelectorAll('link[rel="stylesheet"]').forEach(a=>{a.sheet||(n.add(a),a.addEventListener("load",()=>{n.delete(a),n.size===0&&o!==-1&&(i.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(z.LoadStylesheetEnd),o&&clearTimeout(o),c())}))}),n.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(z.LoadStylesheetStart),o=setTimeout(()=>{i.matches("playing")&&this.play(this.getCurrentTime()),o=-1,c()},this.config.loadTimeout))}}hasImageArg(t){for(const r of t)if(!(!r||typeof r!="object")){if("rr_type"in r&&"args"in r){if(this.hasImageArg(r.args))return!0}else if("rr_type"in r&&r.rr_type==="HTMLImageElement"||r instanceof Array&&this.hasImageArg(r))return!0}return!1}getImageArgs(t){const r=[];for(const n of t)!n||typeof n!="object"||("rr_type"in n&&"args"in n?r.push(...this.getImageArgs(n.args)):"rr_type"in n&&n.rr_type==="HTMLImageElement"?r.push(n.src):n instanceof Array&&r.push(...this.getImageArgs(n)));return r}preloadAllImages(){return Pt(this,null,function*(){this.service.state;const t=()=>{this.service.state};this.emitter.on(z.Start,t),this.emitter.on(z.Pause,t);const r=[];for(const n of this.service.state.context.events)n.type===O.IncrementalSnapshot&&n.data.source===A.CanvasMutation&&(r.push(this.deserializeAndPreloadCanvasEvents(n.data,n)),("commands"in n.data?n.data.commands:[n.data]).forEach(o=>{this.preloadImages(o,n)}));return Promise.all(r)})}preloadImages(t,r){if(t.property==="drawImage"&&typeof t.args[0]=="string"&&!this.imageMap.has(r)){const n=document.createElement("canvas"),o=n.getContext("2d"),i=o?.createImageData(n.width,n.height);i?.data,JSON.parse(t.args[0]),o?.putImageData(i,0,0)}}deserializeAndPreloadCanvasEvents(t,r){return Pt(this,null,function*(){if(!this.canvasEventMap.has(r)){const n={isUnchanged:!0};if("commands"in t){const o=yield Promise.all(t.commands.map(i=>Pt(this,null,function*(){const l=yield Promise.all(i.args.map(Se(this.imageMap,null,n)));return Ft(_e({},i),{args:l})})));n.isUnchanged===!1&&this.canvasEventMap.set(r,Ft(_e({},t),{commands:o}))}else{const o=yield Promise.all(t.args.map(Se(this.imageMap,null,n)));n.isUnchanged===!1&&this.canvasEventMap.set(r,Ft(_e({},t),{args:o}))}}})}applyIncremental(t,r){var n,o,i,l,c,a;const{data:s}=t;switch(s.source){case A.Mutation:{try{this.applyMutation(s,r)}catch(u){this.warn(`Exception in mutation ${u.message||u}`,s)}break}case A.Drag:case A.TouchMove:case A.MouseMove:if(r){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,r,s)},delay:u.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(d)}),this.timer.addAction({doAction(){},delay:t.delay-((n=s.positions[0])==null?void 0:n.timeOffset)});break;case A.MouseInteraction:{if(s.id===-1||r)break;const u=new Event(te[s.type].toLowerCase()),d=this.mirror.getNode(s.id);if(!d)return this.debugNodeNotFound(s,s.id);this.emitter.emit(z.MouseInteraction,{type:s.type,target:d});const{triggerFocus:m}=this.config;switch(s.type){case te.Blur:"blur"in d&&d.blur();break;case te.Focus:m&&d.focus&&d.focus({preventScroll:!0});break;case te.Click:case te.TouchStart:case te.TouchEnd:r?(s.type===te.TouchStart?this.touchActive=!0:s.type===te.TouchEnd&&(this.touchActive=!1),this.mousePos={x:s.x,y:s.y,id:s.id,debugData:s}):(s.type===te.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(s.x,s.y,s.id,r,s),s.type===te.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):s.type===te.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):s.type===te.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case te.TouchCancel:r?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:d.dispatchEvent(u)}break}case A.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,r);break}case A.ViewportResize:this.emitter.emit(z.Resize,{width:s.width,height:s.height});break;case A.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 A.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===Ee.Pause&&d.pause(),s.type===Ee.Play&&d.play()}catch(m){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${m.message||m}`)}break}case A.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:m,index:h})=>d?.push({cssText:m,index:h,type:ce.Insert})),(i=s.removes)==null||i.forEach(({index:m})=>d?.push({index:m,type:ce.Remove}))}else{const u=this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.sheet;(l=s.adds)==null||l.forEach(({rule:m,index:h})=>{try{if(Array.isArray(h)){const{positions:v,index:p}=It(h);Le(d.cssRules,v).insertRule(m,p)}else{const v=h===void 0?void 0:Math.min(h,d.cssRules.length);d.insertRule(m,v)}}catch{}}),(c=s.removes)==null||c.forEach(({index:m})=>{try{if(Array.isArray(m)){const{positions:h,index:v}=It(m);Le(d.cssRules,h).deleteRule(v||0)}else d?.deleteRule(m)}catch{}})}break}case A.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(_e({type:ce.SetProperty,index:s.index},s.set)),s.remove&&d.push(_e({type:ce.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&&Le(d.rules,s.index).style.setProperty(s.set.property,s.set.value,s.set.priority),s.remove&&Le(d.rules,s.index).style.removeProperty(s.remove.property)}break}case A.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);mn({event:t,mutation:s,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case A.Font:{try{const u=new FontFace(s.family,s.buffer?new Uint8Array(JSON.parse(s.fontSource)):s.fontSource,s.descriptors);(a=this.iframe.contentDocument)==null||a.fonts.add(u)}catch(u){this.config.showWarning&&console.warn(u)}break}}}applyMutation(t,r){if(this.config.useVirtualDom&&!this.usingVirtualDom&&r&&(this.usingVirtualDom=!0,Di(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=Kr(u.node,this.virtualDom,this.mirror);d&&(u.node=d)}catch(u){this.config.showWarning&&console.warn(u)}const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;t.removes.forEach(s=>{var u;const d=n.getNode(s.id);if(!d)return t.removes.find(h=>h.id===s.parentId)?void 0:this.warnNodeNotFound(t,s.id);let m=n.getNode(s.parentId);if(!m)return this.warnNodeNotFound(t,s.parentId);if(s.isShadow&&Ue(m)&&(m=m.shadowRoot),n.removeNodeFromMap(d),m)try{m.removeChild(d),this.usingVirtualDom&&d.nodeName==="#text"&&m.nodeName==="STYLE"&&((u=m.rules)==null?void 0:u.length)>0&&(m.rules=[])}catch(h){if(h instanceof DOMException)this.warn("parent could not remove child in mutation",m,d,t);else throw h}});const o=_e({},this.legacy_missingNodeRetryMap),i=[],l=s=>{let u=null;return s.nextId&&(u=n.getNode(s.nextId)),s.nextId!==null&&s.nextId!==void 0&&s.nextId!==-1&&!u},c=s=>{var u;if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");let d=n.getNode(s.parentId);if(!d)return s.node.type===j.Document?this.newDocumentQueue.push(s):i.push(s);s.node.isShadow&&(Ue(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let m=null,h=null;if(s.previousId&&(m=n.getNode(s.previousId)),s.nextId&&(h=n.getNode(s.nextId)),l(s))return i.push(s);if(s.node.rootId&&!n.getNode(s.node.rootId))return;const v=s.node.rootId?n.getNode(s.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Re(d,n)){this.attachDocumentToIframe(s,d);return}const p=rt(s.node,{doc:v,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache});if(s.previousId===-1||s.nextId===-1){o[s.node.id]={node:p,mutation:s};return}const w=n.getMeta(d);if(w&&w.type===j.Element&&w.tagName==="textarea"&&s.node.type===j.Text){const f=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);for(const S of f)S.nodeType===d.TEXT_NODE&&d.removeChild(S)}if(m&&m.nextSibling&&m.nextSibling.parentNode)d.insertBefore(p,m.nextSibling);else if(h&&h.parentNode)d.contains(h)?d.insertBefore(p,h):d.insertBefore(p,null);else{if(d===v)for(;v.firstChild;)v.removeChild(v.firstChild);d.appendChild(p)}if(this.usingVirtualDom&&p.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)==null?void 0:u.length)>0&&(d.rules=[]),Re(p,this.mirror)){const f=this.mirror.getId(p),S=this.newDocumentQueue.find(T=>T.parentId===f);S&&(this.attachDocumentToIframe(S,p),this.newDocumentQueue=this.newDocumentQueue.filter(T=>T!==S))}(s.previousId||s.nextId)&&this.legacy_resolveMissingNode(o,d,p,s)};t.adds.forEach(s=>{c(s)});const a=Date.now();for(;i.length;){const s=mr(i);if(i.length=0,Date.now()-a>500){this.warn("Timeout in the loop, please check the resolve tree data:",s);break}for(const u of s)n.getNode(u.value.parentId)?Et(u,d=>{c(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),fr(t.texts).forEach(s=>{var u;const d=n.getNode(s.id);if(!d)return t.removes.find(m=>m.id===s.id)?void 0:this.warnNodeNotFound(t,s.id);if(d.textContent=s.value,this.usingVirtualDom){const m=d.parentNode;((u=m?.rules)==null?void 0:u.length)>0&&(m.rules=[])}}),t.attributes.forEach(s=>{const u=n.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 m=s.attributes[d];if(m===null)u.removeAttribute(d);else if(typeof m=="string")try{u.setAttribute(d,m)}catch(h){this.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",h)}else if(d==="style"){const h=m,v=u;for(const p in h)if(h[p]===!1)v.style.removeProperty(p);else if(h[p]instanceof Array){const w=h[p];v.style.setProperty(p,w[0],w[1])}else{const w=h[p];v.style.setProperty(p,w)}}}})}applyScroll(t,r){const n=this.mirror.getNode(t.id);if(!n)return this.debugNodeNotFound(t,t.id);const o=this.mirror.getMeta(n);if(n===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else if(o?.type===j.Document)n.defaultView.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else try{n.scrollTop=t.y,n.scrollLeft=t.x}catch{}}applyInput(t){const r=this.mirror.getNode(t.id);if(!r)return this.debugNodeNotFound(t,t.id);try{r.checked=t.isChecked,r.value=t.text}catch{}}legacy_resolveMissingNode(t,r,n,o){const{previousId:i,nextId:l}=o,c=i&&t[i],a=l&&t[l];if(c){const{node:s,mutation:u}=c;r.insertBefore(s,n),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,r,s,u)}if(a){const{node:s,mutation:u}=a;r.insertBefore(s,n.nextSibling),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,r,s,u)}}moveAndHover(t,r,n,o,i){const l=this.mirror.getNode(n);if(!l)return this.debugNodeNotFound(i,n);const c=Ct(l,this.iframe),a=t*c.absoluteScale+c.x,s=r*c.absoluteScale+c.y;this.mouse.style.left=`${a}px`,this.mouse.style.top=`${s}px`,o||this.drawMouseTail({x:a,y:s}),this.hoverElements(l)}drawMouseTail(t){if(!this.mouseTail)return;const{lineCap:r,lineWidth:n,strokeStyle:o,duration:i}=this.config.mouseTail===!0?$t:Object.assign({},$t,this.config.mouseTail),l=()=>{if(!this.mouseTail)return;const c=this.mouseTail.getContext("2d");!c||!this.tailPositions.length||(c.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),c.beginPath(),c.lineWidth=n,c.lineCap=r,c.strokeStyle=o,c.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(a=>c.lineTo(a.x,a.y)),c.stroke())};this.tailPositions.push(t),l(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(c=>c!==t),l()},i/this.speedService.state.context.timer.speed)}hoverElements(t){var r;(r=this.iframe.contentDocument)==null||r.querySelectorAll(".\\:hover").forEach(o=>{o.classList.remove(":hover")});let n=t;for(;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement}isUserInteraction(t){return t.type!==O.IncrementalSnapshot?!1:t.data.source>A.Mutation&&t.data.source<=A.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(z.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(t,r){this.warn(`Node with id '${r}' not found. `,t)}warnCanvasMutationFailed(t,r){this.warn("Has error on canvas update",r,"canvas mutation:",t)}debugNodeNotFound(t,r){this.debug(_t,`Node with id '${r}' not found. `,t)}warn(...t){!this.config.showWarning||console.warn(_t,...t)}debug(...t){!this.config.showDebug||console.log(_t,...t)}}const{addCustomEvent:ls}=Ie,{freezePage:cs}=Ie;var ne=Uint8Array,ie=Uint16Array,Xe=Uint32Array,ut=new ne([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),dt=new ne([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),jt=new ne([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),wn=function(e,t){for(var r=new ie(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var o=new Xe(r[30]),n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)o[i]=i-r[n]<<5|n;return[r,o]},Sn=wn(ut,2),Nn=Sn[0],Vt=Sn[1];Nn[28]=258,Vt[258]=28;for(var Tn=wn(dt,0),us=Tn[0],En=Tn[1],Ut=new ie(32768),Z=0;Z<32768;++Z){var Ne=(Z&43690)>>>1|(Z&21845)<<1;Ne=(Ne&52428)>>>2|(Ne&13107)<<2,Ne=(Ne&61680)>>>4|(Ne&3855)<<4,Ut[Z]=((Ne&65280)>>>8|(Ne&255)<<8)>>>1}for(var pe=function(e,t,r){for(var n=e.length,o=0,i=new ie(t);o<n;++o)++i[e[o]-1];var l=new ie(t);for(o=0;o<t;++o)l[o]=l[o-1]+i[o-1]<<1;var c;if(r){c=new ie(1<<t);var a=15-t;for(o=0;o<n;++o)if(e[o])for(var s=o<<4|e[o],u=t-e[o],d=l[e[o]-1]++<<u,m=d|(1<<u)-1;d<=m;++d)c[Ut[d]>>>a]=s}else for(c=new ie(n),o=0;o<n;++o)c[o]=Ut[l[e[o]-1]++]>>>15-e[o];return c},Te=new ne(288),Z=0;Z<144;++Z)Te[Z]=8;for(var Z=144;Z<256;++Z)Te[Z]=9;for(var Z=256;Z<280;++Z)Te[Z]=7;for(var Z=280;Z<288;++Z)Te[Z]=8;for(var Ze=new ne(32),Z=0;Z<32;++Z)Ze[Z]=5;var ds=pe(Te,9,0),hs=pe(Te,9,1),ms=pe(Ze,5,0),ps=pe(Ze,5,1),Gt=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},ue=function(e,t,r){var n=t/8>>0;return(e[n]|e[n+1]<<8)>>>(t&7)&r},Bt=function(e,t){var r=t/8>>0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>>(t&7)},zt=function(e){return(e/8>>0)+(e&7&&1)},Ht=function(e,t,r){(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length);var n=new(e instanceof ie?ie:e instanceof Xe?Xe:ne)(r-t);return n.set(e.subarray(t,r)),n},fs=function(e,t,r){var n=e.length,o=!t||r,i=!r||r.i;r||(r={}),t||(t=new ne(n*3));var l=function(ee){var _=t.length;if(ee>_){var W=new ne(Math.max(_*2,ee));W.set(t),t=W}},c=r.f||0,a=r.p||0,s=r.b||0,u=r.l,d=r.d,m=r.m,h=r.n,v=n*8;do{if(!u){r.f=c=ue(e,a,1);var p=ue(e,a+1,3);if(a+=3,p)if(p==1)u=hs,d=ps,m=9,h=5;else if(p==2){var T=ue(e,a,31)+257,I=ue(e,a+10,15)+4,R=T+ue(e,a+5,31)+1;a+=14;for(var M=new ne(R),C=new ne(19),y=0;y<I;++y)C[jt[y]]=ue(e,a+y*3,7);a+=I*3;var H=Gt(C),G=(1<<H)-1;if(!i&&a+R*(H+7)>v)break;for(var K=pe(C,H,1),y=0;y<R;){var V=K[ue(e,a,G)];a+=V&15;var w=V>>>4;if(w<16)M[y++]=w;else{var U=0,Y=0;for(w==16?(Y=3+ue(e,a,3),a+=2,U=M[y-1]):w==17?(Y=3+ue(e,a,7),a+=3):w==18&&(Y=11+ue(e,a,127),a+=7);Y--;)M[y++]=U}}var B=M.subarray(0,T),L=M.subarray(T);m=Gt(B),h=Gt(L),u=pe(B,m,1),d=pe(L,h,1)}else throw"invalid block type";else{var w=zt(a)+4,f=e[w-4]|e[w-3]<<8,S=w+f;if(S>n){if(i)throw"unexpected EOF";break}o&&l(s+f),t.set(e.subarray(w,S),s),r.b=s+=f,r.p=a=S*8;continue}if(a>v)throw"unexpected EOF"}o&&l(s+131072);for(var x=(1<<m)-1,D=(1<<h)-1,b=m+h+18;i||a+b<v;){var U=u[Bt(e,a)&x],g=U>>>4;if(a+=U&15,a>v)throw"unexpected EOF";if(!U)throw"invalid length/literal";if(g<256)t[s++]=g;else if(g==256){u=null;break}else{var N=g-254;if(g>264){var y=g-257,E=ut[y];N=ue(e,a,(1<<E)-1)+Nn[y],a+=E}var F=d[Bt(e,a)&D],P=F>>>4;if(!F)throw"invalid distance";a+=F&15;var L=us[P];if(P>3){var E=dt[P];L+=Bt(e,a)&(1<<E)-1,a+=E}if(a>v)throw"unexpected EOF";o&&l(s+131072);for(var k=s+N;s<k;s+=4)t[s]=t[s-L],t[s+1]=t[s+1-L],t[s+2]=t[s+2-L],t[s+3]=t[s+3-L];s=k}}r.l=u,r.p=a,r.b=s,u&&(c=1,r.m=m,r.d=d,r.n=h)}while(!c);return s==t.length?t:Ht(t,0,s)},ge=function(e,t,r){r<<=t&7;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8},Ke=function(e,t,r){r<<=t&7;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},Yt=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var o=r.length,i=r.slice();if(!o)return[new ne(0),0];if(o==1){var l=new ne(r[0].s+1);return l[r[0].s]=1,[l,1]}r.sort(function(R,M){return R.f-M.f}),r.push({s:-1,f:25001});var c=r[0],a=r[1],s=0,u=1,d=2;for(r[0]={s:-1,f:c.f+a.f,l:c,r:a};u!=o-1;)c=r[r[s].f<r[d].f?s++:d++],a=r[s!=u&&r[s].f<r[d].f?s++:d++],r[u++]={s:-1,f:c.f+a.f,l:c,r:a};for(var m=i[0].s,n=1;n<o;++n)i[n].s>m&&(m=i[n].s);var h=new ie(m+1),v=Xt(r[u-1],h,0);if(v>t){var n=0,p=0,w=v-t,f=1<<w;for(i.sort(function(M,C){return h[C.s]-h[M.s]||M.f-C.f});n<o;++n){var S=i[n].s;if(h[S]>t)p+=f-(1<<v-h[S]),h[S]=t;else break}for(p>>>=w;p>0;){var T=i[n].s;h[T]<t?p-=1<<t-h[T]++-1:++n}for(;n>=0&&p;--n){var I=i[n].s;h[I]==t&&(--h[I],++p)}v=t}return[new ne(h),v]},Xt=function(e,t,r){return e.s==-1?Math.max(Xt(e.l,t,r+1),Xt(e.r,t,r+1)):t[e.s]=r},Cn=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new ie(++t),n=0,o=e[0],i=1,l=function(a){r[n++]=a},c=1;c<=t;++c)if(e[c]==o&&c!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)l(32754);i>2&&(l(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(l(o),--i;i>6;i-=6)l(8304);i>2&&(l(i-3<<5|8208),i=0)}for(;i--;)l(o);i=1,o=e[c]}return[r.subarray(0,n),t]},qe=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},ht=function(e,t,r){var n=r.length,o=zt(t+2);e[o]=n&255,e[o+1]=n>>>8,e[o+2]=e[o]^255,e[o+3]=e[o+1]^255;for(var i=0;i<n;++i)e[o+i+4]=r[i];return(o+4+n)*8},In=function(e,t,r,n,o,i,l,c,a,s,u){ge(t,u++,r),++o[256];for(var d=Yt(o,15),m=d[0],h=d[1],v=Yt(i,15),p=v[0],w=v[1],f=Cn(m),S=f[0],T=f[1],I=Cn(p),R=I[0],M=I[1],C=new ie(19),y=0;y<S.length;++y)C[S[y]&31]++;for(var y=0;y<R.length;++y)C[R[y]&31]++;for(var H=Yt(C,7),G=H[0],K=H[1],V=19;V>4&&!G[jt[V-1]];--V);var U=s+5<<3,Y=qe(o,Te)+qe(i,Ze)+l,B=qe(o,m)+qe(i,p)+l+14+3*V+qe(C,G)+(2*C[16]+3*C[17]+7*C[18]);if(U<=Y&&U<=B)return ht(t,u,e.subarray(a,a+s));var L,x,D,b;if(ge(t,u,1+(B<Y)),u+=2,B<Y){L=pe(m,h,0),x=m,D=pe(p,w,0),b=p;var g=pe(G,K,0);ge(t,u,T-257),ge(t,u+5,M-1),ge(t,u+10,V-4),u+=14;for(var y=0;y<V;++y)ge(t,u+3*y,G[jt[y]]);u+=3*V;for(var N=[S,R],E=0;E<2;++E)for(var F=N[E],y=0;y<F.length;++y){var P=F[y]&31;ge(t,u,g[P]),u+=G[P],P>15&&(ge(t,u,F[y]>>>5&127),u+=F[y]>>>12)}}else L=ds,x=Te,D=ms,b=Ze;for(var y=0;y<c;++y)if(n[y]>255){var P=n[y]>>>18&31;Ke(t,u,L[P+257]),u+=x[P+257],P>7&&(ge(t,u,n[y]>>>23&31),u+=ut[P]);var k=n[y]&31;Ke(t,u,D[k]),u+=b[k],k>3&&(Ke(t,u,n[y]>>>5&8191),u+=dt[k])}else Ke(t,u,L[n[y]]),u+=x[n[y]];return Ke(t,u,L[256]),u+x[256]},vs=new Xe([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),gs=new ne(0),ys=function(e,t,r,n,o,i){var l=e.length,c=new ne(n+l+5*(1+Math.floor(l/7e3))+o),a=c.subarray(n,c.length-o),s=0;if(!t||l<8)for(var u=0;u<=l;u+=65535){var d=u+65535;d<l?s=ht(a,s,e.subarray(u,d)):(a[u]=i,s=ht(a,s,e.subarray(u,l)))}else{for(var m=vs[t-1],h=m>>>13,v=m&8191,p=(1<<r)-1,w=new ie(32768),f=new ie(p+1),S=Math.ceil(r/3),T=2*S,I=function(Qt){return(e[Qt]^e[Qt+1]<<S^e[Qt+2]<<T)&p},R=new Xe(25e3),M=new ie(288),C=new ie(32),y=0,H=0,u=0,G=0,K=0,V=0;u<l;++u){var U=I(u),Y=u&32767,B=f[U];if(w[Y]=B,f[U]=Y,K<=u){var L=l-u;if((y>7e3||G>24576)&&L>423){s=In(e,a,0,R,M,C,H,G,V,u-V,s),G=y=H=0,V=u;for(var x=0;x<286;++x)M[x]=0;for(var x=0;x<30;++x)C[x]=0}var D=2,b=0,g=v,N=Y-B&32767;if(L>2&&U==I(u-N))for(var E=Math.min(h,L)-1,F=Math.min(32767,u),P=Math.min(258,L);N<=F&&--g&&Y!=B;){if(e[u+D]==e[u+D-N]){for(var k=0;k<P&&e[u+k]==e[u+k-N];++k);if(k>D){if(D=k,b=N,k>E)break;for(var ee=Math.min(N,k-2),_=0,x=0;x<ee;++x){var W=u-N+x+32768&32767,de=w[W],he=W-de+32768&32767;he>_&&(_=he,B=W)}}}Y=B,B=w[Y],N+=Y-B+32768&32767}if(b){R[G++]=268435456|Vt[D]<<18|En[b];var ye=Vt[D]&31,Je=En[b]&31;H+=ut[ye]+dt[Je],++M[257+ye],++C[Je],K=u+D,++y}else R[G++]=e[u],++M[e[u]]}}s=In(e,a,i,R,M,C,H,G,V,u-V,s),i||(s=ht(a,s,gs))}return Ht(c,0,n+zt(s)+o)},bs=function(){var e=1,t=0;return{p:function(r){for(var n=e,o=t,i=r.length,l=0;l!=i;){for(var c=Math.min(l+5552,i);l<c;++l)n+=r[l],o+=n;n%=65521,o%=65521}e=n,t=o},d:function(){return(e>>>8<<16|(t&255)<<8|t>>>8)+((e&255)<<23)*2}}},ws=function(e,t,r,n,o){return ys(e,t.level==null?6:t.level,t.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):12+t.mem,r,n,!o)},Ss=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},Ns=function(e,t){var r=t.level,n=r==0?0:r<6?1:r==9?3:2;e[0]=120,e[1]=n<<6|(n?32-2*n:1)},Ts=function(e){if((e[0]&15)!=8||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(e[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function Es(e,t){t===void 0&&(t={});var r=bs();r.p(e);var n=ws(e,t,2,4);return Ns(n,t),Ss(n,n.length-4,r.d()),n}function Cs(e,t){return fs((Ts(e),e.subarray(2,-4)),t)}function Mn(e,t){var r=e.length;if(!t&&typeof TextEncoder<"u")return new TextEncoder().encode(e);for(var n=new ne(e.length+(e.length>>>1)),o=0,i=function(s){n[o++]=s},l=0;l<r;++l){if(o+5>n.length){var c=new ne(o+8+(r-l<<1));c.set(n),n=c}var a=e.charCodeAt(l);a<128||t?i(a):a<2048?(i(192|a>>>6),i(128|a&63)):a>55295&&a<57344?(a=65536+(a&1047552)|e.charCodeAt(++l)&1023,i(240|a>>>18),i(128|a>>>12&63),i(128|a>>>6&63),i(128|a&63)):(i(224|a>>>12),i(128|a>>>6&63),i(128|a&63))}return Ht(n,0,o)}function xn(e,t){var r="";if(!t&&typeof TextDecoder<"u")return new TextDecoder().decode(e);for(var n=0;n<e.length;){var o=e[n++];o<128||t?r+=String.fromCharCode(o):o<224?r+=String.fromCharCode((o&31)<<6|e[n++]&63):o<240?r+=String.fromCharCode((o&15)<<12|(e[n++]&63)<<6|e[n++]&63):(o=((o&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,r+=String.fromCharCode(55296|o>>10,56320|o&1023))}return r}const Zt="v1";var Is=Object.defineProperty,Ms=Object.defineProperties,xs=Object.getOwnPropertyDescriptors,kn=Object.getOwnPropertySymbols,ks=Object.prototype.hasOwnProperty,Os=Object.prototype.propertyIsEnumerable,On=(e,t,r)=>t in e?Is(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ds=(e,t)=>{for(var r in t||(t={}))ks.call(t,r)&&On(e,r,t[r]);if(kn)for(var r of kn(t))Os.call(t,r)&&On(e,r,t[r]);return e},Rs=(e,t)=>Ms(e,xs(t));const Ls=e=>{const t=Rs(Ds({},e),{v:Zt});return xn(Es(Mn(JSON.stringify(t))),!0)},As=e=>{if(typeof e!="string")return e;try{const t=JSON.parse(e);if(t.timestamp)return t}catch{}try{const t=JSON.parse(xn(Cs(Mn(e,!0))));if(t.v===Zt)return t;throw new Error(`These events were packed with packer ${t.v} which is incompatible with current packer ${Zt}.`)}catch(t){throw console.error(t),new Error("Unknown data format.")}};class $e{constructor(t){this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){const t=this.lineNumber||"",r=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+r+")":this.fileName+":"+t+":"+r}}const Fs=/(^|@)\S+:\d+/,Dn=/^\s*at .*(\S+:\d+|\(native\))/m,Ps=/^(eval@)?(\[native code])?$/,Rn={parse:function(e){if(!e)return[];if(typeof e.stacktrace<"u"||typeof e["opera#sourceloc"]<"u")return this.parseOpera(e);if(e.stack&&e.stack.match(Dn))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(e.indexOf(":")===-1)return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error(`Cannot parse given url: ${e}`);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split(`
19
- `).filter(function(t){return!!t.match(Dn)},this).map(function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let r=t.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=r.match(/ (\((.+):(\d+):(\d+)\)$)/);r=n?r.replace(n[0],""):r;const o=r.split(/\s+/).slice(1),i=this.extractLocation(n?n[1]:o.pop()),l=o.join(" ")||void 0,c=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new $e({functionName:l,fileName:c,lineNumber:i[1],columnNumber:i[2]})},this)},parseFFOrSafari:function(e){return e.stack.split(`
20
- `).filter(function(t){return!t.match(Ps)},this).map(function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),t.indexOf("@")===-1&&t.indexOf(":")===-1)return new $e({functionName:t});{const r=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=t.match(r),o=n&&n[1]?n[1]:void 0,i=this.extractLocation(t.replace(r,""));return new $e({functionName:o,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf(`
18
+ ***************************************************************************** */function nn(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),l=[];try{for(;(t===void 0||t-- >0)&&!(n=i.next()).done;)l.push(n.value)}catch(c){o={error:c}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return l}var Pe;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Pe||(Pe={}));var on={type:"xstate.init"};function Pt(e){return e===void 0?[]:[].concat(e)}function Ie(e){return{type:"xstate.assign",assignment:e}}function sn(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 ct(e){return function(t){return e===t}}function an(e){return typeof e=="string"?{type:e}:e}function ln(e,t){return{value:e,context:t,actions:[],changed:!1,matches:ct(e)}}function cn(e,t,r){var n=t,o=!1;return[e.filter(function(i){if(i.type==="xstate.assign"){o=!0;var l=Object.assign({},n);return typeof i.assignment=="function"?l=i.assignment(n,r):Object.keys(i.assignment).forEach(function(c){l[c]=typeof i.assignment[c]=="function"?i.assignment[c](n,r):i.assignment[c]}),n=l,!1}return!0}),n,o]}function un(e,t){t===void 0&&(t={});var r=nn(cn(Pt(e.states[e.initial].entry).map(function(l){return sn(l,t.actions)}),e.context,on),2),n=r[0],o=r[1],i={config:e,_options:t,initialState:{value:e.initial,actions:n,context:o,matches:ct(e.initial)},transition:function(l,c){var a,s,u=typeof l=="string"?{value:l,context:e.context}:l,d=u.value,m=u.context,h=an(c),p=e.states[d];if(p.on){var v=Pt(p.on[h.type]);try{for(var b=function(O){var $=typeof Symbol=="function"&&Symbol.iterator,w=$&&O[$],g=0;if(w)return w.call(O);if(O&&typeof O.length=="number")return{next:function(){return O&&g>=O.length&&(O=void 0),{value:O&&O[g++],done:!O}}};throw new TypeError($?"Object is not iterable.":"Symbol.iterator is not defined.")}(v),f=b.next();!f.done;f=b.next()){var S=f.value;if(S===void 0)return ln(d,m);var y=typeof S=="string"?{target:S}:S,N=y.target,x=y.actions,M=x===void 0?[]:x,I=y.cond,E=I===void 0?function(){return!0}:I,F=N===void 0,U=N??d,K=e.states[U];if(E(m,h)){var W=nn(cn((F?Pt(M):[].concat(p.exit,M,K.entry).filter(function(O){return O})).map(function(O){return sn(O,i._options.actions)}),m,h),3),H=W[0],L=W[1],V=W[2],A=N??d;return{value:A,context:L,actions:H,changed:N!==d||H.length>0||V,matches:ct(A)}}}}catch(O){a={error:O}}finally{try{f&&!f.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}}return ln(d,m)}};return i}var dn=function(e,t){return e.actions.forEach(function(r){var n=r.exec;return n&&n(e.context,t)})};function hn(e){var t=e.initialState,r=Pe.NotStarted,n=new Set,o={_machine:e,send:function(i){r===Pe.Running&&(t=e.transition(t,i),dn(t,an(i)),n.forEach(function(l){return l(t)}))},subscribe:function(i){return n.add(i),i(t),{unsubscribe:function(){return n.delete(i)}}},start:function(i){if(i){var l=typeof i=="object"?i:{context:e.config.context,value:i};t={value:l.value,actions:[],context:l.context,matches:ct(l.value)}}return r=Pe.Running,dn(t,on),o},stop:function(){return r=Pe.Stopped,n.clear(),o},get state(){return t},get status(){return r}};return o}var zi=Object.defineProperty,Bi=Object.defineProperties,Hi=Object.getOwnPropertyDescriptors,mn=Object.getOwnPropertySymbols,Yi=Object.prototype.hasOwnProperty,Xi=Object.prototype.propertyIsEnumerable,pn=(e,t,r)=>t in e?zi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ut=(e,t)=>{for(var r in t||(t={}))Yi.call(t,r)&&pn(e,r,t[r]);if(mn)for(var r of mn(t))Xi.call(t,r)&&pn(e,r,t[r]);return e},dt=(e,t)=>Bi(e,Hi(t));function Zi(e,t){for(let r=e.length-1;r>=0;r--){const n=e[r];if(n.type===R.Meta&&n.timestamp<=t)return e.slice(r)}return e}function Ki(e,{getCastFn:t,applyEventsSynchronously:r,emitter:n}){const o=un({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:Ie({lastPlayedEvent:(i,l)=>l.type==="CAST_EVENT"?l.payload.event:i.lastPlayedEvent}),recordTimeOffset:Ie((i,l)=>{let c=i.timeOffset;return"payload"in l&&"timeOffset"in l.payload&&(c=l.payload.timeOffset),dt(ut({},i),{timeOffset:c,baselineTime:i.events[0].timestamp+c})}),play(i){var l;const{timer:c,events:a,baselineTime:s,lastPlayedEvent:u}=i;c.clear();for(const v of a)At(v,s);const d=Zi(a,s);let m=u?.timestamp;u?.type===R.IncrementalSnapshot&&u.data.source===D.MouseMove&&(m=u.timestamp+((l=u.data.positions[0])==null?void 0:l.timeOffset)),s<(m||0)&&n.emit(B.PlayBack);const h=new Array,p=new Array;for(const v of d)if(!(m&&m<s&&(v.timestamp<=m||v===u)))if(v.timestamp<s)h.push(v);else{const b=t(v,!1);p.push({doAction:()=>{b()},delay:v.delay})}r(h),n.emit(B.Flush),c.addActions(p),c.start()},pause(i){i.timer.clear()},resetLastPlayedEvent:Ie(i=>dt(ut({},i),{lastPlayedEvent:null})),startLive:Ie({baselineTime:(i,l)=>(i.timer.toggleLiveMode(!0),i.timer.start(),l.type==="TO_LIVE"&&l.payload.baselineTime?l.payload.baselineTime:Date.now())}),replaceEvents:Ie((i,l)=>{const{events:c,timer:a,baselineTime:s}=i;if(l.type==="REPLACE_EVENTS"){const{events:u}=l.payload;c.length=0;const d=[];for(const m of u)if(At(m,s),c.push(m),m.timestamp>=a.timeOffset+s){const h=t(m,!1);d.push({doAction:()=>{h()},delay:m.delay})}a.isActive()&&a.replaceActions(d)}return dt(ut({},i),{events:c})}),addEvent:Ie((i,l)=>{const{baselineTime:c,timer:a,events:s}=i;if(l.type==="ADD_EVENT"){const{event:u}=l.payload;At(u,c);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 b=Math.floor((v+d)/2);s[b].timestamp<=u.timestamp?v=b+1:d=b-1}p===-1&&(p=v),s.splice(p,0,u)}const m=u.timestamp<c,h=t(u,m);m?h():a.isActive()&&a.addAction({doAction:()=>{h()},delay:u.delay})}return dt(ut({},i),{events:s})})}});return hn(o)}function qi(e){const t=un({id:"speed",context:e,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(r,n)=>{"payload"in n&&r.timer.setSpeed(n.payload.speed)},recordSpeed:Ie({normalSpeed:r=>r.timer.speed}),restoreSpeed:r=>{r.timer.setSpeed(r.normalSpeed)}}});return hn(t)}const Ji=e=>[`.${e} { background: currentColor }`,"noscript { display: none !important; }",`.${e} { background: currentColor; border-radius: 5px; }`,`.${e}:hover::after {content: 'Redacted'; color: white; background: black; text-align: center; width: 100%; display: block;}`];var Qi=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});const fn=new Map;function vn(e,t){let r=fn.get(e);return r||(r=new Map,fn.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}function Se(e,t,r){return n=>Qi(this,null,function*(){if(n&&typeof n=="object"&&"rr_type"in n)if(r&&(r.isUnchanged=!1),n.rr_type==="ImageBitmap"&&"args"in n){const o=yield Se(e,t,r)(n.args);return yield createImageBitmap.apply(null,o)}else if("index"in n){if(r||t===null)return n;const{rr_type:o,index:i}=n;return vn(t,o)[i]}else if("args"in n){const{rr_type:o,args:i}=n,l=window[o];return new l(...yield Promise.all(i.map(Se(e,t,r))))}else{if("base64"in n)return qo(n.base64);if("src"in n){const o=e.get(n.src);if(o)return o;{const i=new Image;return i.src=n.src,e.set(n.src,i),i}}else if("data"in n&&n.rr_type==="Blob"){const o=yield Promise.all(n.data.map(Se(e,t,r)));return new Blob(o,{type:n.type})}}else if(Array.isArray(n))return yield Promise.all(n.map(Se(e,t,r)));return n})}var es=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});function ts(e,t){try{return t===fe.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}const rs=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function ns(e,t){if(!(t!=null&&t.constructor))return;const{name:r}=t.constructor;if(!rs.includes(r))return;const n=vn(e,r);n.includes(t)||n.push(t)}function os(e){return es(this,arguments,function*({mutation:t,target:r,type:n,imageMap:o,errorHandler:i}){try{const l=ts(r,n);if(!l)return;if(t.setter){l[t.property]=t.args[0];return}const c=l[t.property],a=yield Promise.all(t.args.map(Se(o,l))),s=c.apply(l,a);ns(l,s)}catch(l){i(t,l)}})}var is=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});function ss(e){return is(this,arguments,function*({event:t,mutation:r,target:n,imageMap:o,errorHandler:i}){try{const l=n.getContext("2d");if(r.setter){l[r.property]=r.args[0];return}const c=l[r.property];if(r.property==="drawImage"&&typeof r.args[0]=="string"){const a=o.get(t);c.apply(l,r.args)}else{const a=yield Promise.all(r.args.map(Se(o,l)));c.apply(l,a)}}catch(l){i(r,l)}})}var as=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});function gn(e){return as(this,arguments,function*({event:t,mutation:r,target:n,imageMap:o,canvasEventMap:i,errorHandler:l}){try{const c=i.get(t)||r,a="commands"in c?c.commands:[c];if([fe.WebGL,fe.WebGL2].includes(r.type)){for(let s=0;s<a.length;s++){const u=a[s];yield os({mutation:u,type:r.type,target:n,imageMap:o,errorHandler:l})}return}for(let s=0;s<a.length;s++){const u=a[s];yield ss({event:t,mutation:u,target:n,imageMap:o,errorHandler:l})}}catch(c){l(r,c)}})}var ls=Object.defineProperty,cs=Object.defineProperties,us=Object.getOwnPropertyDescriptors,yn=Object.getOwnPropertySymbols,ds=Object.prototype.hasOwnProperty,hs=Object.prototype.propertyIsEnumerable,bn=(e,t,r)=>t in e?ls(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Fe=(e,t)=>{for(var r in t||(t={}))ds.call(t,r)&&bn(e,r,t[r]);if(yn)for(var r of yn(t))hs.call(t,r)&&bn(e,r,t[r]);return e},Ft=(e,t)=>cs(e,us(t)),_t=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});const Sn=10*1e3,wn=2*1e3,Nn=1*1e3,Tn=60*60*1e3,ms=rn||Vi,$t="[replayer]",Wt={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function jt(e){return e.type==R.IncrementalSnapshot&&(e.data.source==D.TouchMove||e.data.source==D.MouseInteraction&&e.data.type==ee.TouchStart)}class ps{constructor(t,r){if(this.usingVirtualDom=!1,this.virtualDom=new Ae,this.mouseTail=null,this.tailPositions=[],this.emitter=ms(),this.activityIntervals=[],this.legacy_missingNodeRetryMap={},this.cache=dr(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=tr(),this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,!(r!=null&&r.liveMode)&&t.length<2)throw new Error("Replayer need at least 2 events.");const n={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"highlight-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:Wt,useVirtualDom:!0,inactiveThreshold:.02,inactiveSkipTime:wn};this.config=Object.assign({},n,r),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(B.Resize,this.handleResize),this.setupDom(),this.emitter.on(B.Flush,()=>{if(this.usingVirtualDom){const c={mirror:this.mirror,applyCanvas:(a,s,u)=>{gn({event:a,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(he(this.iframe.contentDocument,this.virtualDom,c,this.virtualDom.mirror),this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const a in this.legacy_missingNodeRetryMap)try{const s=this.legacy_missingNodeRetryMap[a],u=Lt(s.node,this.mirror,this.virtualDom.mirror);he(u,s.node,c,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(B.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset()});const o=new Gi([],r?.speed||n.speed);this.service=Ki({events:t.map(c=>r&&r.unpackFn?r.unpackFn(c):c).sort((c,a)=>c.timestamp-a.timestamp),timer:o,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(c=>{this.emitter.emit(B.StateChange,{player:c})}),this.speedService=qi({normalSpeed:-1,timer:o}),this.speedService.start(),this.speedService.subscribe(c=>{this.emitter.emit(B.StateChange,{speed:c})});const i=this.service.state.context.events.find(c=>c.type===R.Meta),l=this.service.state.context.events.find(c=>c.type===R.FullSnapshot);if(i){const{width:c,height:a}=i.data;setTimeout(()=>{this.emitter.emit(B.Resize,{width:c,height:a})},0)}l&&setTimeout(()=>{this.firstFullSnapshot||(this.firstFullSnapshot=l,this.rebuildFullSnapshot(l),this.iframe.contentWindow.scrollTo(l.data.initialOffset))},1),this.service.state.context.events.find(jt)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(t,r){return this.emitter.on(t,r),this}off(t,r){return this.emitter.off(t,r),this}setConfig(t){Object.keys(t).forEach(r=>{this.config[r]=t[r]}),this.config.skipInactive||this.backToNormal(),typeof t.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:t.speed}}),typeof t.mouseTail<"u"&&(t.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getActivityIntervals(){if(this.activityIntervals.length==0){const t=[],r=this.getMetaData(),n=[{timestamp:r.startTime},...this.service.state.context.events.filter(l=>this.isUserInteraction(l)),{timestamp:r.endTime}];for(let l=1;l<n.length;l++){const c=n[l-1],a=n[l];a.timestamp-c.timestamp>Sn?t.push({startTime:c.timestamp,endTime:a.timestamp,duration:a.timestamp-c.timestamp,active:!1}):t.push({startTime:c.timestamp,endTime:a.timestamp,duration:a.timestamp-c.timestamp,active:!0})}const o=[];let i=t[0];for(let l=1;l<t.length;l++)t[l].active!=t[l-1].active&&(o.push({startTime:i.startTime,endTime:t[l-1].endTime,duration:t[l-1].endTime-i.startTime,active:t[l-1].active}),i=t[l]);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 l=1;l<o.length;l++)(!o[l].active&&o[l].duration>this.config.inactiveThreshold*r.totalTime||!o[l-1].active&&o[l-1].duration>this.config.inactiveThreshold*r.totalTime)&&(this.activityIntervals.push({startTime:i.startTime,endTime:o[l-1].endTime,duration:o[l-1].endTime-i.startTime,active:o[l-1].active}),i=o[l]);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],r=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:t.timestamp,endTime:r.timestamp,totalTime:r.timestamp-t.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:t,events:r}=this.service.state.context;return t-r[0].timestamp}getMirror(){return this.mirror}play(t=0){var r,n;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:t}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:t}})),(n=(r=this.iframe.contentDocument)==null?void 0:r.getElementsByTagName("html")[0])==null||n.classList.remove("rrweb-paused"),this.emitter.emit(B.Start),this.handleInactivity(this.getMetaData().startTime+t,!0)}pause(t){var r,n;t===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof t=="number"&&(this.play(t),this.service.send({type:"PAUSE"})),(n=(r=this.iframe.contentDocument)==null?void 0:r.getElementsByTagName("html")[0])==null||n.classList.add("rrweb-paused"),this.emitter.emit(B.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(B.Resume)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){const r=this.config.unpackFn?this.config.unpackFn(t):t;jt(r)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:r}}))}replaceEvents(t){for(const r of t)if(jt(r)){this.mouse.classList.add("touch-device");break}this.service.send({type:"REPLACE_EVENTS",payload:{events:t}})}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=dr()}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&&(Ui(this.iframe.contentWindow,this.iframe.contentDocument),Ct(this.iframe.contentWindow))}handleResize(t){this.iframe.style.display="inherit";for(const r of[this.mouseTail,this.iframe])!r||(r.setAttribute("width",String(t.width)),r.setAttribute("height",String(t.height)))}applyEventsSynchronously(t){for(const r of t){switch(r.type){case R.DomContentLoaded:case R.Load:case R.Custom:continue;case R.FullSnapshot:case R.Meta:case R.Plugin:case R.IncrementalSnapshot:break}this.getCastFn(r,!0)()}this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null}getCastFn(t,r=!1){let n;switch(t.type){case R.DomContentLoaded:case R.Load:break;case R.Custom:n=()=>{this.emitter.emit(B.CustomEvent,t)};break;case R.Meta:n=()=>this.emitter.emit(B.Resize,{width:t.data.width,height:t.data.height});break;case R.FullSnapshot:n=()=>{if(this.firstFullSnapshot){if(this.firstFullSnapshot===t){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(t,r),this.iframe.contentWindow.scrollTo(t.data.initialOffset)};break;case R.IncrementalSnapshot:n=()=>{if(this.applyIncremental(t,r),!r&&(this.handleInactivity(t.timestamp),t===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const o of this.service.state.context.events)if(!(o.timestamp<=t.timestamp)&&this.isUserInteraction(o)){o.delay-t.delay>Sn*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=o);break}if(this.nextUserInteractionEvent){const o=this.nextUserInteractionEvent.delay-t.delay,i={speed:Math.min(Math.round(o/wn),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:i}),this.emitter.emit(B.SkipStart,i)}}};break}return()=>{n&&n();for(const i of this.config.plugins||[])i.handler(t,r,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:t}});const o=this.service.state.context.events.length-1;if(t===this.service.state.context.events[o]){const i=()=>{o<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(B.Finish))};t.type===R.IncrementalSnapshot&&t.data.source===D.MouseMove&&t.data.positions.length?setTimeout(()=>{i()},Math.max(0,-t.data.positions[0].timeOffset+50)):i()}this.emitter.emit(B.EventCast,t)}}handleInactivity(t,r){if((t===this.inactiveEndTimestamp||r)&&(this.inactiveEndTimestamp=null,this.backToNormal()),this.config.skipInactive&&!this.inactiveEndTimestamp){for(const n of this.getActivityIntervals())if(t>=n.startTime&&t<n.endTime&&!n.active){this.inactiveEndTimestamp=n.endTime;break}if(this.inactiveEndTimestamp){const n=this.inactiveEndTimestamp-t,o={speed:n/Tn*this.config.inactiveSkipTime<Nn?n/Nn:Math.round(Math.max(n,Tn)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:o}),this.emitter.emit(B.SkipStart,o)}}}rebuildFullSnapshot(t,r=!1){if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const n=[];No(t.data.node,{doc:this.iframe.contentDocument,afterAppend:l=>{this.collectIframeAndAttachDocument(n,l)},cache:this.cache,mirror:this.mirror});for(const{mutationInQueue:l,builtNode:c}of n)this.attachDocumentToIframe(l,c),this.newDocumentQueue=this.newDocumentQueue.filter(a=>a!==l);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(B.FullsnapshotRebuilded,t),r||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,r){const n=Ji(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&n.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,tn(o,this.virtualDom.unserializedId)),t.insertBefore(o,r);for(let i=0;i<n.length;i++)o.rules.push({cssText:n[i],type:ce.Insert,index:i})}else{const o=document.createElement("style");t.insertBefore(o,r);for(let i=0;i<n.length;i++)o.sheet.insertRule(n[i],i)}}attachDocumentToIframe(t,r){const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,o=[];ot(t.node,{doc:r.contentDocument,mirror:n,hackCss:!0,skipChild:!1,afterAppend:i=>{this.collectIframeAndAttachDocument(o,i);const l=n.getMeta(i);if(l?.type===_.Element&&l?.tagName.toUpperCase()==="HTML"){const{documentElement:c,head:a}=r.contentDocument;this.insertStyleRules(c,a)}},cache:this.cache});for(const{mutationInQueue:i,builtNode:l}of o)this.attachDocumentToIframe(i,l),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==i)}collectIframeAndAttachDocument(t,r){if(Re(r,this.mirror)){const n=this.newDocumentQueue.find(o=>o.parentId===this.mirror.getId(r));n&&t.push({mutationInQueue:n,builtNode:r})}}waitForStylesheetLoad(){var t;const r=(t=this.iframe.contentDocument)==null?void 0:t.head;if(r){const n=new Set;let o,i=this.service.state;const l=()=>{i=this.service.state};this.emitter.on(B.Start,l),this.emitter.on(B.Pause,l);const c=()=>{this.emitter.off(B.Start,l),this.emitter.off(B.Pause,l)};r.querySelectorAll('link[rel="stylesheet"]').forEach(a=>{a.sheet||(n.add(a),a.addEventListener("load",()=>{n.delete(a),n.size===0&&o!==-1&&(i.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(B.LoadStylesheetEnd),o&&clearTimeout(o),c())}))}),n.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(B.LoadStylesheetStart),o=setTimeout(()=>{i.matches("playing")&&this.play(this.getCurrentTime()),o=-1,c()},this.config.loadTimeout))}}hasImageArg(t){for(const r of t)if(!(!r||typeof r!="object")){if("rr_type"in r&&"args"in r){if(this.hasImageArg(r.args))return!0}else if("rr_type"in r&&r.rr_type==="HTMLImageElement"||r instanceof Array&&this.hasImageArg(r))return!0}return!1}getImageArgs(t){const r=[];for(const n of t)!n||typeof n!="object"||("rr_type"in n&&"args"in n?r.push(...this.getImageArgs(n.args)):"rr_type"in n&&n.rr_type==="HTMLImageElement"?r.push(n.src):n instanceof Array&&r.push(...this.getImageArgs(n)));return r}preloadAllImages(){return _t(this,null,function*(){this.service.state;const t=()=>{this.service.state};this.emitter.on(B.Start,t),this.emitter.on(B.Pause,t);const r=[];for(const n of this.service.state.context.events)n.type===R.IncrementalSnapshot&&n.data.source===D.CanvasMutation&&(r.push(this.deserializeAndPreloadCanvasEvents(n.data,n)),("commands"in n.data?n.data.commands:[n.data]).forEach(o=>{this.preloadImages(o,n)}));return Promise.all(r)})}preloadImages(t,r){if(t.property==="drawImage"&&typeof t.args[0]=="string"&&!this.imageMap.has(r)){const n=document.createElement("canvas"),o=n.getContext("2d"),i=o?.createImageData(n.width,n.height);i?.data,JSON.parse(t.args[0]),o?.putImageData(i,0,0)}}deserializeAndPreloadCanvasEvents(t,r){return _t(this,null,function*(){if(!this.canvasEventMap.has(r)){const n={isUnchanged:!0};if("commands"in t){const o=yield Promise.all(t.commands.map(i=>_t(this,null,function*(){const l=yield Promise.all(i.args.map(Se(this.imageMap,null,n)));return Ft(Fe({},i),{args:l})})));n.isUnchanged===!1&&this.canvasEventMap.set(r,Ft(Fe({},t),{commands:o}))}else{const o=yield Promise.all(t.args.map(Se(this.imageMap,null,n)));n.isUnchanged===!1&&this.canvasEventMap.set(r,Ft(Fe({},t),{args:o}))}}})}applyIncremental(t,r){var n,o,i,l,c,a;const{data:s}=t;switch(s.source){case D.Mutation:{try{this.applyMutation(s,r)}catch(u){this.warn(`Exception in mutation ${u.message||u}`,s)}break}case D.Drag:case D.TouchMove:case D.MouseMove:if(r){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,r,s)},delay:u.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(d)}),this.timer.addAction({doAction(){},delay:t.delay-((n=s.positions[0])==null?void 0:n.timeOffset)});break;case D.MouseInteraction:{if(s.id===-1||r)break;const u=new Event(ee[s.type].toLowerCase()),d=this.mirror.getNode(s.id);if(!d)return this.debugNodeNotFound(s,s.id);this.emitter.emit(B.MouseInteraction,{type:s.type,target:d});const{triggerFocus:m}=this.config;switch(s.type){case ee.Blur:"blur"in d&&d.blur();break;case ee.Focus:m&&d.focus&&d.focus({preventScroll:!0});break;case ee.Click:case ee.TouchStart:case ee.TouchEnd:r?(s.type===ee.TouchStart?this.touchActive=!0:s.type===ee.TouchEnd&&(this.touchActive=!1),this.mousePos={x:s.x,y:s.y,id:s.id,debugData:s}):(s.type===ee.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(s.x,s.y,s.id,r,s),s.type===ee.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):s.type===ee.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):s.type===ee.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case ee.TouchCancel:r?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:d.dispatchEvent(u)}break}case D.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,r);break}case D.ViewportResize:this.emitter.emit(B.Resize,{width:s.width,height:s.height});break;case D.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 D.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===Te.Pause&&d.pause(),s.type===Te.Play&&d.play()}catch(m){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${m.message||m}`)}break}case D.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:m,index:h})=>d?.push({cssText:m,index:h,type:ce.Insert})),(i=s.removes)==null||i.forEach(({index:m})=>d?.push({index:m,type:ce.Remove}))}else{const u=this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.sheet;(l=s.adds)==null||l.forEach(({rule:m,index:h})=>{try{if(Array.isArray(h)){const{positions:p,index:v}=Mt(h);De(d.cssRules,p).insertRule(m,v)}else{const p=h===void 0?void 0:Math.min(h,d.cssRules.length);d.insertRule(m,p)}}catch{}}),(c=s.removes)==null||c.forEach(({index:m})=>{try{if(Array.isArray(m)){const{positions:h,index:p}=Mt(m);De(d.cssRules,h).deleteRule(p||0)}else d?.deleteRule(m)}catch{}})}break}case D.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(Fe({type:ce.SetProperty,index:s.index},s.set)),s.remove&&d.push(Fe({type:ce.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&&De(d.rules,s.index).style.setProperty(s.set.property,s.set.value,s.set.priority),s.remove&&De(d.rules,s.index).style.removeProperty(s.remove.property)}break}case D.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);gn({event:t,mutation:s,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case D.Font:{try{const u=new FontFace(s.family,s.buffer?new Uint8Array(JSON.parse(s.fontSource)):s.fontSource,s.descriptors);(a=this.iframe.contentDocument)==null||a.fonts.add(u)}catch(u){this.config.showWarning&&console.warn(u)}break}}}applyMutation(t,r){if(this.config.useVirtualDom&&!this.usingVirtualDom&&r&&(this.usingVirtualDom=!0,$i(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=en(u.node,this.virtualDom,this.mirror);d&&(u.node=d)}catch(u){this.config.showWarning&&console.warn(u)}const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;t.removes.forEach(s=>{var u;const d=n.getNode(s.id);if(!d)return t.removes.find(h=>h.id===s.parentId)?void 0:this.warnNodeNotFound(t,s.id);let m=n.getNode(s.parentId);if(!m)return this.warnNodeNotFound(t,s.parentId);if(s.isShadow&&ze(m)&&(m=m.shadowRoot),n.removeNodeFromMap(d),m)try{m.removeChild(d),this.usingVirtualDom&&d.nodeName==="#text"&&m.nodeName==="STYLE"&&((u=m.rules)==null?void 0:u.length)>0&&(m.rules=[])}catch(h){if(h instanceof DOMException)this.warn("parent could not remove child in mutation",m,d,t);else throw h}});const o=Fe({},this.legacy_missingNodeRetryMap),i=[],l=s=>{let u=null;return s.nextId&&(u=n.getNode(s.nextId)),s.nextId!==null&&s.nextId!==void 0&&s.nextId!==-1&&!u},c=s=>{var u;if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");let d=n.getNode(s.parentId);if(!d)return s.node.type===_.Document?this.newDocumentQueue.push(s):i.push(s);s.node.isShadow&&(ze(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let m=null,h=null;if(s.previousId&&(m=n.getNode(s.previousId)),s.nextId&&(h=n.getNode(s.nextId)),l(s))return i.push(s);if(s.node.rootId&&!n.getNode(s.node.rootId))return;const p=s.node.rootId?n.getNode(s.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Re(d,n)){this.attachDocumentToIframe(s,d);return}const v=ot(s.node,{doc:p,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache});if(s.previousId===-1||s.nextId===-1){o[s.node.id]={node:v,mutation:s};return}const b=n.getMeta(d);if(b&&b.type===_.Element&&b.tagName==="textarea"&&s.node.type===_.Text){const f=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);for(const S of f)S.nodeType===d.TEXT_NODE&&d.removeChild(S)}if(m&&m.nextSibling&&m.nextSibling.parentNode)d.insertBefore(v,m.nextSibling);else if(h&&h.parentNode)d.contains(h)?d.insertBefore(v,h):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=[]),Re(v,this.mirror)){const f=this.mirror.getId(v),S=this.newDocumentQueue.find(y=>y.parentId===f);S&&(this.attachDocumentToIframe(S,v),this.newDocumentQueue=this.newDocumentQueue.filter(y=>y!==S))}(s.previousId||s.nextId)&&this.legacy_resolveMissingNode(o,d,v,s)};t.adds.forEach(s=>{c(s)});const a=Date.now();for(;i.length;){const s=pr(i);if(i.length=0,Date.now()-a>500){this.warn("Timeout in the loop, please check the resolve tree data:",s);break}for(const u of s)n.getNode(u.value.parentId)?It(u,d=>{c(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),fr(t.texts).forEach(s=>{var u;const d=n.getNode(s.id);if(!d)return t.removes.find(m=>m.id===s.id)?void 0:this.warnNodeNotFound(t,s.id);if(d.textContent=s.value,this.usingVirtualDom){const m=d.parentNode;((u=m?.rules)==null?void 0:u.length)>0&&(m.rules=[])}}),t.attributes.forEach(s=>{const u=n.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 m=s.attributes[d];if(m===null)u.removeAttribute(d);else if(typeof m=="string")try{u.setAttribute(d,m)}catch(h){this.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",h)}else if(d==="style"){const h=m,p=u;for(const v in h)if(h[v]===!1)p.style.removeProperty(v);else if(h[v]instanceof Array){const b=h[v];p.style.setProperty(v,b[0],b[1])}else{const b=h[v];p.style.setProperty(v,b)}}}})}applyScroll(t,r){const n=this.mirror.getNode(t.id);if(!n)return this.debugNodeNotFound(t,t.id);const o=this.mirror.getMeta(n);if(n===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else if(o?.type===_.Document)n.defaultView.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else try{n.scrollTop=t.y,n.scrollLeft=t.x}catch{}}applyInput(t){const r=this.mirror.getNode(t.id);if(!r)return this.debugNodeNotFound(t,t.id);try{r.checked=t.isChecked,r.value=t.text}catch{}}legacy_resolveMissingNode(t,r,n,o){const{previousId:i,nextId:l}=o,c=i&&t[i],a=l&&t[l];if(c){const{node:s,mutation:u}=c;r.insertBefore(s,n),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,r,s,u)}if(a){const{node:s,mutation:u}=a;r.insertBefore(s,n.nextSibling),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,r,s,u)}}moveAndHover(t,r,n,o,i){const l=this.mirror.getNode(n);if(!l)return this.debugNodeNotFound(i,n);const c=xt(l,this.iframe),a=t*c.absoluteScale+c.x,s=r*c.absoluteScale+c.y;this.mouse.style.left=`${a}px`,this.mouse.style.top=`${s}px`,o||this.drawMouseTail({x:a,y:s}),this.hoverElements(l)}drawMouseTail(t){if(!this.mouseTail)return;const{lineCap:r,lineWidth:n,strokeStyle:o,duration:i}=this.config.mouseTail===!0?Wt:Object.assign({},Wt,this.config.mouseTail),l=()=>{if(!this.mouseTail)return;const c=this.mouseTail.getContext("2d");!c||!this.tailPositions.length||(c.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),c.beginPath(),c.lineWidth=n,c.lineCap=r,c.strokeStyle=o,c.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(a=>c.lineTo(a.x,a.y)),c.stroke())};this.tailPositions.push(t),l(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(c=>c!==t),l()},i/this.speedService.state.context.timer.speed)}hoverElements(t){var r;(r=this.iframe.contentDocument)==null||r.querySelectorAll(".\\:hover").forEach(o=>{o.classList.remove(":hover")});let n=t;for(;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement}isUserInteraction(t){return t.type!==R.IncrementalSnapshot?!1:t.data.source>D.Mutation&&t.data.source<=D.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(B.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(t,r){this.warn(`Node with id '${r}' not found. `,t)}warnCanvasMutationFailed(t,r){this.warn("Has error on canvas update",r,"canvas mutation:",t)}debugNodeNotFound(t,r){this.debug($t,`Node with id '${r}' not found. `,t)}warn(...t){!this.config.showWarning||console.warn($t,...t)}debug(...t){!this.config.showDebug||console.log($t,...t)}}const{addCustomEvent:fs}=Ce,{freezePage:vs}=Ce;var re=Uint8Array,ne=Uint16Array,Ke=Uint32Array,ht=new re([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),mt=new re([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Vt=new re([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),En=function(e,t){for(var r=new ne(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var o=new Ke(r[30]),n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)o[i]=i-r[n]<<5|n;return[r,o]},Cn=En(ht,2),In=Cn[0],Ut=Cn[1];In[28]=258,Ut[258]=28;for(var kn=En(mt,0),gs=kn[0],xn=kn[1],Gt=new ne(32768),Z=0;Z<32768;++Z){var we=(Z&43690)>>>1|(Z&21845)<<1;we=(we&52428)>>>2|(we&13107)<<2,we=(we&61680)>>>4|(we&3855)<<4,Gt[Z]=((we&65280)>>>8|(we&255)<<8)>>>1}for(var me=function(e,t,r){for(var n=e.length,o=0,i=new ne(t);o<n;++o)++i[e[o]-1];var l=new ne(t);for(o=0;o<t;++o)l[o]=l[o-1]+i[o-1]<<1;var c;if(r){c=new ne(1<<t);var a=15-t;for(o=0;o<n;++o)if(e[o])for(var s=o<<4|e[o],u=t-e[o],d=l[e[o]-1]++<<u,m=d|(1<<u)-1;d<=m;++d)c[Gt[d]>>>a]=s}else for(c=new ne(n),o=0;o<n;++o)c[o]=Gt[l[e[o]-1]++]>>>15-e[o];return c},Ne=new re(288),Z=0;Z<144;++Z)Ne[Z]=8;for(var Z=144;Z<256;++Z)Ne[Z]=9;for(var Z=256;Z<280;++Z)Ne[Z]=7;for(var Z=280;Z<288;++Z)Ne[Z]=8;for(var qe=new re(32),Z=0;Z<32;++Z)qe[Z]=5;var ys=me(Ne,9,0),bs=me(Ne,9,1),Ss=me(qe,5,0),ws=me(qe,5,1),zt=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},ue=function(e,t,r){var n=t/8>>0;return(e[n]|e[n+1]<<8)>>>(t&7)&r},Bt=function(e,t){var r=t/8>>0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>>(t&7)},Ht=function(e){return(e/8>>0)+(e&7&&1)},Yt=function(e,t,r){(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length);var n=new(e instanceof ne?ne:e instanceof Ke?Ke:re)(r-t);return n.set(e.subarray(t,r)),n},Ns=function(e,t,r){var n=e.length,o=!t||r,i=!r||r.i;r||(r={}),t||(t=new re(n*3));var l=function(oe){var j=t.length;if(oe>j){var Y=new re(Math.max(j*2,oe));Y.set(t),t=Y}},c=r.f||0,a=r.p||0,s=r.b||0,u=r.l,d=r.d,m=r.m,h=r.n,p=n*8;do{if(!u){r.f=c=ue(e,a,1);var v=ue(e,a+1,3);if(a+=3,v)if(v==1)u=bs,d=ws,m=9,h=5;else if(v==2){var y=ue(e,a,31)+257,N=ue(e,a+10,15)+4,x=y+ue(e,a+5,31)+1;a+=14;for(var M=new re(x),I=new re(19),E=0;E<N;++E)I[Vt[E]]=ue(e,a+E*3,7);a+=N*3;var F=zt(I),U=(1<<F)-1;if(!i&&a+x*(F+7)>p)break;for(var K=me(I,F,1),E=0;E<x;){var W=K[ue(e,a,U)];a+=W&15;var b=W>>>4;if(b<16)M[E++]=b;else{var H=0,L=0;for(b==16?(L=3+ue(e,a,3),a+=2,H=M[E-1]):b==17?(L=3+ue(e,a,7),a+=3):b==18&&(L=11+ue(e,a,127),a+=7);L--;)M[E++]=H}}var V=M.subarray(0,y),A=M.subarray(y);m=zt(V),h=zt(A),u=me(V,m,1),d=me(A,h,1)}else throw"invalid block type";else{var b=Ht(a)+4,f=e[b-4]|e[b-3]<<8,S=b+f;if(S>n){if(i)throw"unexpected EOF";break}o&&l(s+f),t.set(e.subarray(b,S),s),r.b=s+=f,r.p=a=S*8;continue}if(a>p)throw"unexpected EOF"}o&&l(s+131072);for(var O=(1<<m)-1,$=(1<<h)-1,w=m+h+18;i||a+w<p;){var H=u[Bt(e,a)&O],g=H>>>4;if(a+=H&15,a>p)throw"unexpected EOF";if(!H)throw"invalid length/literal";if(g<256)t[s++]=g;else if(g==256){u=null;break}else{var C=g-254;if(g>264){var E=g-257,T=ht[E];C=ue(e,a,(1<<T)-1)+In[E],a+=T}var k=d[Bt(e,a)&$],G=k>>>4;if(!k)throw"invalid distance";a+=k&15;var A=gs[G];if(G>3){var T=mt[G];A+=Bt(e,a)&(1<<T)-1,a+=T}if(a>p)throw"unexpected EOF";o&&l(s+131072);for(var z=s+C;s<z;s+=4)t[s]=t[s-A],t[s+1]=t[s+1-A],t[s+2]=t[s+2-A],t[s+3]=t[s+3-A];s=z}}r.l=u,r.p=a,r.b=s,u&&(c=1,r.m=m,r.d=d,r.n=h)}while(!c);return s==t.length?t:Yt(t,0,s)},ve=function(e,t,r){r<<=t&7;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8},Je=function(e,t,r){r<<=t&7;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},Xt=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var o=r.length,i=r.slice();if(!o)return[new re(0),0];if(o==1){var l=new re(r[0].s+1);return l[r[0].s]=1,[l,1]}r.sort(function(x,M){return x.f-M.f}),r.push({s:-1,f:25001});var c=r[0],a=r[1],s=0,u=1,d=2;for(r[0]={s:-1,f:c.f+a.f,l:c,r:a};u!=o-1;)c=r[r[s].f<r[d].f?s++:d++],a=r[s!=u&&r[s].f<r[d].f?s++:d++],r[u++]={s:-1,f:c.f+a.f,l:c,r:a};for(var m=i[0].s,n=1;n<o;++n)i[n].s>m&&(m=i[n].s);var h=new ne(m+1),p=Zt(r[u-1],h,0);if(p>t){var n=0,v=0,b=p-t,f=1<<b;for(i.sort(function(M,I){return h[I.s]-h[M.s]||M.f-I.f});n<o;++n){var S=i[n].s;if(h[S]>t)v+=f-(1<<p-h[S]),h[S]=t;else break}for(v>>>=b;v>0;){var y=i[n].s;h[y]<t?v-=1<<t-h[y]++-1:++n}for(;n>=0&&v;--n){var N=i[n].s;h[N]==t&&(--h[N],++v)}p=t}return[new re(h),p]},Zt=function(e,t,r){return e.s==-1?Math.max(Zt(e.l,t,r+1),Zt(e.r,t,r+1)):t[e.s]=r},Mn=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new ne(++t),n=0,o=e[0],i=1,l=function(a){r[n++]=a},c=1;c<=t;++c)if(e[c]==o&&c!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)l(32754);i>2&&(l(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(l(o),--i;i>6;i-=6)l(8304);i>2&&(l(i-3<<5|8208),i=0)}for(;i--;)l(o);i=1,o=e[c]}return[r.subarray(0,n),t]},Qe=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},pt=function(e,t,r){var n=r.length,o=Ht(t+2);e[o]=n&255,e[o+1]=n>>>8,e[o+2]=e[o]^255,e[o+3]=e[o+1]^255;for(var i=0;i<n;++i)e[o+i+4]=r[i];return(o+4+n)*8},On=function(e,t,r,n,o,i,l,c,a,s,u){ve(t,u++,r),++o[256];for(var d=Xt(o,15),m=d[0],h=d[1],p=Xt(i,15),v=p[0],b=p[1],f=Mn(m),S=f[0],y=f[1],N=Mn(v),x=N[0],M=N[1],I=new ne(19),E=0;E<S.length;++E)I[S[E]&31]++;for(var E=0;E<x.length;++E)I[x[E]&31]++;for(var F=Xt(I,7),U=F[0],K=F[1],W=19;W>4&&!U[Vt[W-1]];--W);var H=s+5<<3,L=Qe(o,Ne)+Qe(i,qe)+l,V=Qe(o,m)+Qe(i,v)+l+14+3*W+Qe(I,U)+(2*I[16]+3*I[17]+7*I[18]);if(H<=L&&H<=V)return pt(t,u,e.subarray(a,a+s));var A,O,$,w;if(ve(t,u,1+(V<L)),u+=2,V<L){A=me(m,h,0),O=m,$=me(v,b,0),w=v;var g=me(U,K,0);ve(t,u,y-257),ve(t,u+5,M-1),ve(t,u+10,W-4),u+=14;for(var E=0;E<W;++E)ve(t,u+3*E,U[Vt[E]]);u+=3*W;for(var C=[S,x],T=0;T<2;++T)for(var k=C[T],E=0;E<k.length;++E){var G=k[E]&31;ve(t,u,g[G]),u+=U[G],G>15&&(ve(t,u,k[E]>>>5&127),u+=k[E]>>>12)}}else A=ys,O=Ne,$=Ss,w=qe;for(var E=0;E<c;++E)if(n[E]>255){var G=n[E]>>>18&31;Je(t,u,A[G+257]),u+=O[G+257],G>7&&(ve(t,u,n[E]>>>23&31),u+=ht[G]);var z=n[E]&31;Je(t,u,$[z]),u+=w[z],z>3&&(Je(t,u,n[E]>>>5&8191),u+=mt[z])}else Je(t,u,A[n[E]]),u+=O[n[E]];return Je(t,u,A[256]),u+O[256]},Ts=new Ke([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Es=new re(0),Cs=function(e,t,r,n,o,i){var l=e.length,c=new re(n+l+5*(1+Math.floor(l/7e3))+o),a=c.subarray(n,c.length-o),s=0;if(!t||l<8)for(var u=0;u<=l;u+=65535){var d=u+65535;d<l?s=pt(a,s,e.subarray(u,d)):(a[u]=i,s=pt(a,s,e.subarray(u,l)))}else{for(var m=Ts[t-1],h=m>>>13,p=m&8191,v=(1<<r)-1,b=new ne(32768),f=new ne(v+1),S=Math.ceil(r/3),y=2*S,N=function(je){return(e[je]^e[je+1]<<S^e[je+2]<<y)&v},x=new Ke(25e3),M=new ne(288),I=new ne(32),E=0,F=0,u=0,U=0,K=0,W=0;u<l;++u){var H=N(u),L=u&32767,V=f[H];if(b[L]=V,f[H]=L,K<=u){var A=l-u;if((E>7e3||U>24576)&&A>423){s=On(e,a,0,x,M,I,F,U,W,u-W,s),U=E=F=0,W=u;for(var O=0;O<286;++O)M[O]=0;for(var O=0;O<30;++O)I[O]=0}var $=2,w=0,g=p,C=L-V&32767;if(A>2&&H==N(u-C))for(var T=Math.min(h,A)-1,k=Math.min(32767,u),G=Math.min(258,A);C<=k&&--g&&L!=V;){if(e[u+$]==e[u+$-C]){for(var z=0;z<G&&e[u+z]==e[u+z-C];++z);if(z>$){if($=z,w=C,z>T)break;for(var oe=Math.min(C,z-2),j=0,O=0;O<oe;++O){var Y=u-C+O+32768&32767,ge=b[Y],ye=Y-ge+32768&32767;ye>j&&(j=ye,V=Y)}}}L=V,V=b[L],C+=L-V+32768&32767}if(w){x[U++]=268435456|Ut[$]<<18|xn[w];var $e=Ut[$]&31,et=xn[w]&31;F+=ht[$e]+mt[et],++M[257+$e],++I[et],K=u+$,++E}else x[U++]=e[u],++M[e[u]]}}s=On(e,a,i,x,M,I,F,U,W,u-W,s),i||(s=pt(a,s,Es))}return Yt(c,0,n+Ht(s)+o)},Is=function(){var e=1,t=0;return{p:function(r){for(var n=e,o=t,i=r.length,l=0;l!=i;){for(var c=Math.min(l+5552,i);l<c;++l)n+=r[l],o+=n;n%=65521,o%=65521}e=n,t=o},d:function(){return(e>>>8<<16|(t&255)<<8|t>>>8)+((e&255)<<23)*2}}},ks=function(e,t,r,n,o){return Cs(e,t.level==null?6:t.level,t.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):12+t.mem,r,n,!o)},xs=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},Ms=function(e,t){var r=t.level,n=r==0?0:r<6?1:r==9?3:2;e[0]=120,e[1]=n<<6|(n?32-2*n:1)},Os=function(e){if((e[0]&15)!=8||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(e[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function Rs(e,t){t===void 0&&(t={});var r=Is();r.p(e);var n=ks(e,t,2,4);return Ms(n,t),xs(n,n.length-4,r.d()),n}function Ds(e,t){return Ns((Os(e),e.subarray(2,-4)),t)}function Rn(e,t){var r=e.length;if(!t&&typeof TextEncoder<"u")return new TextEncoder().encode(e);for(var n=new re(e.length+(e.length>>>1)),o=0,i=function(s){n[o++]=s},l=0;l<r;++l){if(o+5>n.length){var c=new re(o+8+(r-l<<1));c.set(n),n=c}var a=e.charCodeAt(l);a<128||t?i(a):a<2048?(i(192|a>>>6),i(128|a&63)):a>55295&&a<57344?(a=65536+(a&1047552)|e.charCodeAt(++l)&1023,i(240|a>>>18),i(128|a>>>12&63),i(128|a>>>6&63),i(128|a&63)):(i(224|a>>>12),i(128|a>>>6&63),i(128|a&63))}return Yt(n,0,o)}function Dn(e,t){var r="";if(!t&&typeof TextDecoder<"u")return new TextDecoder().decode(e);for(var n=0;n<e.length;){var o=e[n++];o<128||t?r+=String.fromCharCode(o):o<224?r+=String.fromCharCode((o&31)<<6|e[n++]&63):o<240?r+=String.fromCharCode((o&15)<<12|(e[n++]&63)<<6|e[n++]&63):(o=((o&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,r+=String.fromCharCode(55296|o>>10,56320|o&1023))}return r}const Kt="v1";var Ls=Object.defineProperty,As=Object.defineProperties,Ps=Object.getOwnPropertyDescriptors,Ln=Object.getOwnPropertySymbols,Fs=Object.prototype.hasOwnProperty,_s=Object.prototype.propertyIsEnumerable,An=(e,t,r)=>t in e?Ls(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$s=(e,t)=>{for(var r in t||(t={}))Fs.call(t,r)&&An(e,r,t[r]);if(Ln)for(var r of Ln(t))_s.call(t,r)&&An(e,r,t[r]);return e},Ws=(e,t)=>As(e,Ps(t));const js=e=>{const t=Ws($s({},e),{v:Kt});return Dn(Rs(Rn(JSON.stringify(t))),!0)},Vs=e=>{if(typeof e!="string")return e;try{const t=JSON.parse(e);if(t.timestamp)return t}catch{}try{const t=JSON.parse(Dn(Ds(Rn(e,!0))));if(t.v===Kt)return t;throw new Error(`These events were packed with packer ${t.v} which is incompatible with current packer ${Kt}.`)}catch(t){throw console.error(t),new Error("Unknown data format.")}};class _e{constructor(t){this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){const t=this.lineNumber||"",r=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+r+")":this.fileName+":"+t+":"+r}}const Us=/(^|@)\S+:\d+/,Pn=/^\s*at .*(\S+:\d+|\(native\))/m,Gs=/^(eval@)?(\[native code])?$/,Fn={parse:function(e){if(!e)return[];if(typeof e.stacktrace<"u"||typeof e["opera#sourceloc"]<"u")return this.parseOpera(e);if(e.stack&&e.stack.match(Pn))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(e.indexOf(":")===-1)return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error(`Cannot parse given url: ${e}`);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split(`
19
+ `).filter(function(t){return!!t.match(Pn)},this).map(function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let r=t.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=r.match(/ (\((.+):(\d+):(\d+)\)$)/);r=n?r.replace(n[0],""):r;const o=r.split(/\s+/).slice(1),i=this.extractLocation(n?n[1]:o.pop()),l=o.join(" ")||void 0,c=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new _e({functionName:l,fileName:c,lineNumber:i[1],columnNumber:i[2]})},this)},parseFFOrSafari:function(e){return e.stack.split(`
20
+ `).filter(function(t){return!t.match(Gs)},this).map(function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),t.indexOf("@")===-1&&t.indexOf(":")===-1)return new _e({functionName:t});{const r=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=t.match(r),o=n&&n[1]?n[1]:void 0,i=this.extractLocation(t.replace(r,""));return new _e({functionName:o,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf(`
21
21
  `)>-1&&e.message.split(`
22
22
  `).length>e.stacktrace.split(`
23
23
  `).length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){const t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split(`
24
- `),n=[];for(let o=2,i=r.length;o<i;o+=2){const l=t.exec(r[o]);l&&n.push(new $e({fileName:l[2],lineNumber:parseFloat(l[1])}))}return n},parseOpera10:function(e){const t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split(`
25
- `),n=[];for(let o=0,i=r.length;o<i;o+=2){const l=t.exec(r[o]);l&&n.push(new $e({functionName:l[3]||void 0,fileName:l[2],lineNumber:parseFloat(l[1])}))}return n},parseOpera11:function(e){return e.stack.split(`
26
- `).filter(function(t){return!!t.match(Fs)&&!t.match(/^Error created at/)},this).map(function(t){const r=t.split("@"),n=this.extractLocation(r.pop()),o=(r.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new $e({functionName:o,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function _s(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let r=e.localName;if(!r)break;r=r.toLowerCase();const n=e.parentElement,o=[];if(n.children&&n.children.length>0)for(let i=0;i<n.children.length;i++){const l=n.children[i];l.localName&&l.localName.toLowerCase&&l.localName.toLowerCase()===r&&o.push(l)}o.length>1&&(r+=":eq("+o.indexOf(e)+")"),t=r+(t?">"+t:""),e=n}return t}function Kt(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ln(e,t){if(t===0)return!0;const r=Object.keys(e);for(const n of r)if(Kt(e[n])&&Ln(e[n],t-1))return!0;return!1}function qt(e,t){const r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);const n=[],o=[];return JSON.stringify(e,function(c,a){if(n.length>0){const s=n.indexOf(this);~s?n.splice(s+1):n.push(this),~s?o.splice(s,1/0,c):o.push(c),~n.indexOf(a)&&(n[0]===a?a="[Circular ~]":a="[Circular ~."+o.slice(0,n.indexOf(a)).join(".")+"]")}else n.push(a);if(a==null)return a;if(i(a))return l(a);if(a instanceof Event){const s={};for(const u in a){const d=a[u];Array.isArray(d)?s[u]=_s(d.length?d[0]:null):s[u]=d}return s}else{if(a instanceof Node)return a instanceof HTMLElement?a?a.outerHTML:"":a.nodeName;if(a instanceof Error)return a.stack?a.stack+`
27
- End of stack for Error object`:a.name+": "+a.message}return a});function i(c){return!!(Kt(c)&&Object.keys(c).length>r.numOfKeysLimit||typeof c=="function"||Kt(c)&&Ln(c,r.depthOfLimit))}function l(c){let a=c.toString();return r.stringLengthLimit&&a.length>r.stringLengthLimit&&(a=`${a.slice(0,r.stringLengthLimit)}...`),a}}const An={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function $s(e,t,r){const n=r.logger;if(!n)return()=>{};let o;typeof n=="string"?o=t[n]:o=n;let i=0;const l=[];if(r.level.includes("error")&&window){const a=s=>{const{message:u,error:d}=s,m=Rn.parse(d).map(v=>v.toString()),h=[qt(u,r.stringifyOptions)];e({level:"error",trace:m,payload:h})};window.addEventListener("error",a),l.push(()=>{window&&window.removeEventListener("error",a)})}for(const a of r.level)l.push(c(o,a));return()=>{l.forEach(a=>a())};function c(a,s){return a[s]?be(a,s,u=>(...d)=>{u.apply(this,d);try{const m=Rn.parse(new Error).map(v=>v.toString()).splice(1),h=d.map(v=>qt(v,r.stringifyOptions));i++,i<r.lengthThreshold?e({level:s,trace:m,payload:h}):i===r.lengthThreshold&&e({level:"warn",trace:[],payload:[qt("The number of log records reached the threshold.")]})}catch(m){u("rrweb logger error:",m,...d)}}):()=>{}}}const Jt="rrweb/console@1",Ws=e=>({name:Jt,observer:$s,options:e?Object.assign({},An,e):An}),mt="__rrweb_original__",js={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],replayLogger:void 0};class Vs{constructor(t){this.config=Object.assign(js,t)}getConsoleLogger(){const t={};for(const r of this.config.level)r==="trace"?t[r]=n=>{(console.log[mt]?console.log[mt]:console.log)(...n.payload.map(o=>JSON.parse(o)),this.formatMessage(n))}:t[r]=n=>{(console[r][mt]?console[r][mt]:console[r])(...n.payload.map(o=>JSON.parse(o)),this.formatMessage(n))};return t}formatMessage(t){if(t.trace.length===0)return"";const r=`
28
- at `;let n=r;return n+=t.trace.join(r),n}}const Us=e=>{const t=e?.replayLogger||new Vs(e).getConsoleLogger();return{handler(r,n,o){let i=null;if(r.type===O.IncrementalSnapshot&&r.data.source===A.Log?i=r.data:r.type===O.Plugin&&r.data.plugin===Jt&&(i=r.data.payload),i)try{typeof t[i.level]=="function"&&t[i.level](i)}catch(l){o.replayer.config.showWarning&&console.warn(l)}}}},Fn={key:"_sid"},Gs="rrweb/sequential-id@1",Bs=e=>{const t=e?Object.assign({},Fn,e):Fn;let r=0;return{name:Gs,eventProcessor(n){return Object.assign(n,{[t.key]:++r}),n},options:t}},Pn={key:"_sid",warnOnMissingId:!0},zs=e=>{const{key:t,warnOnMissingId:r}=e?Object.assign({},Pn,e):Pn;let n=1;return{handler(o){if(t in o){const i=o[t];i!==n?console.error(`[sequential-id-plugin]: expect to get an id with value "${n}", but got "${i}"`):n++}else r&&console.warn(`[sequential-id-plugin]: failed to get id in key: "${t}"`)}}};return q.EventType=O,q.IncrementalSource=A,q.MouseInteractions=te,q.PLUGIN_NAME=Jt,q.Replayer=as,q.ReplayerEvents=z,q.addCustomEvent=ls,q.freezePage=cs,q.getRecordConsolePlugin=Ws,q.getRecordSequentialIdPlugin=Bs,q.getReplayConsolePlugin=Us,q.getReplaySequentialIdPlugin=zs,q.pack=Ls,q.record=Ie,q.unpack=As,q.utils=vo,Object.defineProperty(q,"__esModule",{value:!0}),q}({});
24
+ `),n=[];for(let o=2,i=r.length;o<i;o+=2){const l=t.exec(r[o]);l&&n.push(new _e({fileName:l[2],lineNumber:parseFloat(l[1])}))}return n},parseOpera10:function(e){const t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split(`
25
+ `),n=[];for(let o=0,i=r.length;o<i;o+=2){const l=t.exec(r[o]);l&&n.push(new _e({functionName:l[3]||void 0,fileName:l[2],lineNumber:parseFloat(l[1])}))}return n},parseOpera11:function(e){return e.stack.split(`
26
+ `).filter(function(t){return!!t.match(Us)&&!t.match(/^Error created at/)},this).map(function(t){const r=t.split("@"),n=this.extractLocation(r.pop()),o=(r.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new _e({functionName:o,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function zs(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let r=e.localName;if(!r)break;r=r.toLowerCase();const n=e.parentElement,o=[];if(n.children&&n.children.length>0)for(let i=0;i<n.children.length;i++){const l=n.children[i];l.localName&&l.localName.toLowerCase&&l.localName.toLowerCase()===r&&o.push(l)}o.length>1&&(r+=":eq("+o.indexOf(e)+")"),t=r+(t?">"+t:""),e=n}return t}function qt(e){return Object.prototype.toString.call(e)==="[object Object]"}function _n(e,t){if(t===0)return!0;const r=Object.keys(e);for(const n of r)if(qt(e[n])&&_n(e[n],t-1))return!0;return!1}function Jt(e,t){const r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);const n=[],o=[];return JSON.stringify(e,function(c,a){if(n.length>0){const s=n.indexOf(this);~s?n.splice(s+1):n.push(this),~s?o.splice(s,1/0,c):o.push(c),~n.indexOf(a)&&(n[0]===a?a="[Circular ~]":a="[Circular ~."+o.slice(0,n.indexOf(a)).join(".")+"]")}else n.push(a);if(a==null)return a;if(i(a))return l(a);if(a instanceof Event){const s={};for(const u in a){const d=a[u];Array.isArray(d)?s[u]=zs(d.length?d[0]:null):s[u]=d}return s}else{if(a instanceof Node)return a instanceof HTMLElement?a?a.outerHTML:"":a.nodeName;if(a instanceof Error)return a.stack?a.stack+`
27
+ End of stack for Error object`:a.name+": "+a.message}return a});function i(c){return!!(qt(c)&&Object.keys(c).length>r.numOfKeysLimit||typeof c=="function"||qt(c)&&_n(c,r.depthOfLimit))}function l(c){let a=c.toString();return r.stringLengthLimit&&a.length>r.stringLengthLimit&&(a=`${a.slice(0,r.stringLengthLimit)}...`),a}}const $n={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Bs(e,t,r){const n=r.logger;if(!n)return()=>{};let o;typeof n=="string"?o=t[n]:o=n;let i=0;const l=[];if(r.level.includes("error")&&window){const a=s=>{const{message:u,error:d}=s,m=Fn.parse(d).map(p=>p.toString()),h=[Jt(u,r.stringifyOptions)];e({level:"error",trace:m,payload:h})};window.addEventListener("error",a),l.push(()=>{window&&window.removeEventListener("error",a)})}for(const a of r.level)l.push(c(o,a));return()=>{l.forEach(a=>a())};function c(a,s){return a[s]?be(a,s,u=>(...d)=>{u.apply(this,d);try{const m=Fn.parse(new Error).map(p=>p.toString()).splice(1),h=d.map(p=>Jt(p,r.stringifyOptions));i++,i<r.lengthThreshold?e({level:s,trace:m,payload:h}):i===r.lengthThreshold&&e({level:"warn",trace:[],payload:[Jt("The number of log records reached the threshold.")]})}catch(m){u("rrweb logger error:",m,...d)}}):()=>{}}}const Qt="rrweb/console@1",Hs=e=>({name:Qt,observer:Bs,options:e?Object.assign({},$n,e):$n}),ft="__rrweb_original__",Ys={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],replayLogger:void 0};class Xs{constructor(t){this.config=Object.assign(Ys,t)}getConsoleLogger(){const t={};for(const r of this.config.level)r==="trace"?t[r]=n=>{(console.log[ft]?console.log[ft]:console.log)(...n.payload.map(o=>JSON.parse(o)),this.formatMessage(n))}:t[r]=n=>{(console[r][ft]?console[r][ft]:console[r])(...n.payload.map(o=>JSON.parse(o)),this.formatMessage(n))};return t}formatMessage(t){if(t.trace.length===0)return"";const r=`
28
+ at `;let n=r;return n+=t.trace.join(r),n}}const Zs=e=>{const t=e?.replayLogger||new Xs(e).getConsoleLogger();return{handler(r,n,o){let i=null;if(r.type===R.IncrementalSnapshot&&r.data.source===D.Log?i=r.data:r.type===R.Plugin&&r.data.plugin===Qt&&(i=r.data.payload),i)try{typeof t[i.level]=="function"&&t[i.level](i)}catch(l){o.replayer.config.showWarning&&console.warn(l)}}}},Wn={key:"_sid"},Ks="rrweb/sequential-id@1",qs=e=>{const t=e?Object.assign({},Wn,e):Wn;let r=0;return{name:Ks,eventProcessor(n){return Object.assign(n,{[t.key]:++r}),n},options:t}},jn={key:"_sid",warnOnMissingId:!0},Js=e=>{const{key:t,warnOnMissingId:r}=e?Object.assign({},jn,e):jn;let n=1;return{handler(o){if(t in o){const i=o[t];i!==n?console.error(`[sequential-id-plugin]: expect to get an id with value "${n}", but got "${i}"`):n++}else r&&console.warn(`[sequential-id-plugin]: failed to get id in key: "${t}"`)}}};return q.EventType=R,q.IncrementalSource=D,q.MouseInteractions=ee,q.PLUGIN_NAME=Qt,q.Replayer=ps,q.ReplayerEvents=B,q.addCustomEvent=fs,q.freezePage=vs,q.getRecordConsolePlugin=Hs,q.getRecordSequentialIdPlugin=qs,q.getReplayConsolePlugin=Zs,q.getReplaySequentialIdPlugin=Js,q.pack=js,q.record=Ce,q.unpack=Vs,q.utils=To,Object.defineProperty(q,"__esModule",{value:!0}),q}({});
29
29
  //# sourceMappingURL=rrweb-all.min.js.map