@highlight-run/rrweb 2.0.8 → 2.0.11

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 (41) hide show
  1. package/dist/plugins/console-record.js +5 -5
  2. package/dist/plugins/console-record.min.js +5 -5
  3. package/dist/plugins/console-record.min.js.map +1 -1
  4. package/dist/plugins/console-replay.js +3 -3
  5. package/dist/plugins/console-replay.min.js +3 -3
  6. package/dist/plugins/console-replay.min.js.map +1 -1
  7. package/dist/record/rrweb-record-pack.js +2 -2
  8. package/dist/record/rrweb-record-pack.min.js +2 -2
  9. package/dist/record/rrweb-record-pack.min.js.map +1 -1
  10. package/dist/record/rrweb-record.js +3 -3
  11. package/dist/record/rrweb-record.min.js +3 -3
  12. package/dist/record/rrweb-record.min.js.map +1 -1
  13. package/dist/replay/rrweb-replay-unpack.js +3 -4
  14. package/dist/replay/rrweb-replay-unpack.min.js +3 -4
  15. package/dist/replay/rrweb-replay-unpack.min.js.map +1 -1
  16. package/dist/replay/rrweb-replay.js +3 -4
  17. package/dist/replay/rrweb-replay.min.js +3 -4
  18. package/dist/replay/rrweb-replay.min.js.map +1 -1
  19. package/dist/rrweb-all.js +24 -25
  20. package/dist/rrweb-all.min.js +24 -25
  21. package/dist/rrweb-all.min.js.map +1 -1
  22. package/dist/rrweb.js +14 -15
  23. package/dist/rrweb.min.js +14 -15
  24. package/dist/rrweb.min.js.map +1 -1
  25. package/es/rrweb/packages/rrdom/es/virtual-dom.js +51 -90
  26. package/es/rrweb/packages/rrweb/src/index.js +1 -1
  27. package/es/rrweb/packages/rrweb/src/record/index.js +6 -3
  28. package/es/rrweb/packages/rrweb/src/record/mutation.js +1 -1
  29. package/es/rrweb/packages/rrweb/src/record/observer.js +1 -1
  30. package/es/rrweb/packages/rrweb/src/replay/index.js +1 -1
  31. package/es/rrweb/packages/rrweb/src/utils.js +1 -1
  32. package/lib/plugins/console-record.js +1 -9
  33. package/lib/plugins/console-replay.js +1 -9
  34. package/lib/record/rrweb-record-pack.js +3 -9
  35. package/lib/record/rrweb-record.js +21 -1061
  36. package/lib/replay/rrweb-replay-unpack.js +96 -1015
  37. package/lib/replay/rrweb-replay.js +96 -1015
  38. package/lib/rrweb-all.js +141 -2034
  39. package/lib/rrweb.js +141 -2034
  40. package/package.json +4 -4
  41. package/es/rrweb/packages/rrweb-snapshot/es/rrweb-snapshot.js +0 -1858
@@ -1,29 +1,28 @@
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 Qt(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 er(){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 tr="__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=tr in i?i[tr]: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 rr(e){return e=e.replace(/[^ -~]+/g,""),e=e?.split(" ").map(function(t){return Math.random().toString(20).substr(2,t.length)}).join(" ")||"",e}var Bn=1,Gn=new RegExp("[^a-z0-9-_:]"),Ue=-2;function zn(){return Bn++}function Hn(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return Gn.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,nr,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 or(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 ir(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&&ir(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=rr(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]=or(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"),nr=ke.getContext("2d"));var L=e,V=L.crossOrigin;L.crossOrigin="anonymous";var A=function(){try{ke.width=L.naturalWidth,ke.height=L.naturalHeight,nr.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=zn(),T===Ue)return null;var k=Object.assign(C,{id:T});n.add(e,k),I&&I(e);var B=!s;if(k.type===_.Element){if(B=B&&!k.needBlock,k.needBlock&&k.tagName==="img"){var G=e.cloneNode();G.src="",n.add(G,k)}delete k.needBlock,e.shadowRoot&&(k.isShadowHost=!0)}if((k.type===_.Document||k.type===_.Element)&&B){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 ve=Y[j],ge=xe(ve,oe);ge&&k.childNodes.push(ge)}if(Qt(e)&&e.shadowRoot)for(var $e=0,et=Array.from(e.shadowRoot.childNodes);$e<et.length;$e++){var ve=et[$e],ge=xe(ve,oe);ge&&(ge.isShadow=!0,k.childNodes.push(ge))}}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,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,onStylesheetLoad:K,iframeLoadTimeout:U,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 sr=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//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 me(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=me(g[0]);if(!h(/^:\s*/))return a("property missing ':'");var T=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),k=w({type:"declaration",property:C.replace(sr,""),value:T?me(T[0]).replace(sr,""):""});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,B=v();k=N();)B.push(k),B=B.concat(v());return d()?w({type:"keyframes",name:T,vendor:C,keyframes:B}):a("@keyframes missing '}'")}}function M(){var w=i(),g=h(/^@supports *([^{]+)/);if(g){var C=me(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=me(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:me(g[1]),media:me(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=me(g[1]),T=me(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 me(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 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 vo(e){var t=ar[e.tagName]?ar[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function go(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var lr=/([^\\]):hover/,yo=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=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){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 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 ur(){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=cr(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?cr(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&&Qt(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
1
+ var rrweb=function(V,b){"use strict";function te(t,e,n=document){const r={capture:!0,passive:!0};return n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)}const Ee=`Please stop import mirror directly. Instead of that,\r
3
2
  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(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 Be(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)}}),()=>Be(e,t,i||{},!0)}function ye(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 dr=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 hr(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 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 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 pr(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function kt(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=kt(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 Ge(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 xt(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:Be,patch:ye,getWindowHeight:wt,getWindowWidth:Nt,isCanvasNode:dr,isBlocked:se,isSerialized:hr,isIgnored:it,isAncestorRemoved:Tt,isTouchEvent:Et,polyfill:Ct,queueToResolveTrees:mr,iterateResolveTree:It,isSerializedIframe:Re,isSerializedStylesheet:pr,getBaseDimension:kt,hasShadowRoot:Ge,getNestedRule:De,getPositionsAndIndex:xt,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||{}),pe=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(pe||{}),Te=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(Te||{}),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 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),pr(y,this.mirror)&&this.stylesheetManager.addStylesheet(y),Ge(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=rr(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:ir(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]=or(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)||!hr(r,this.mirror)||(this.addedSet.has(r)?(Mt(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)]?Mt(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 Mt(e,t){e.delete(t),t.childNodes.forEach(r=>Mt(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 ze(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=ze(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=ze(s);if(se(u,n,!0)||dr(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=ze(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=ze(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=>Be(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=ze(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=ye(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 Bo{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 Go=Object.defineProperty,zo=Object.defineProperties,Ho=Object.getOwnPropertyDescriptors,Lr=Object.getOwnPropertySymbols,Yo=Object.prototype.hasOwnProperty,Xo=Object.prototype.propertyIsEnumerable,Ar=(e,t,r)=>t in e?Go(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)=>zo(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(ye(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(ye(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=ye(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:pe["2D"],property:l,args:u})},0),a.apply(this,s)}});o.push(c)}catch{const a=Be(t.CanvasRenderingContext2D.prototype,l,{set(s){e(this.canvas,{type:pe["2D"],property:l,args:[s],setter:!0})}});o.push(a)}return()=>{o.forEach(l=>l())}}function Vr(e,t){const r=[];try{const n=ye(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=ye(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=Be(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,pe.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...Ur(t.WebGL2RenderingContext.prototype,pe.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),Br=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&&Br)for(var n of Br(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:pe["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,Gr=Object.getOwnPropertySymbols,pi=Object.prototype.hasOwnProperty,fi=Object.prototype.propertyIsEnumerable,zr=(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)&&zr(e,r,t[r]);if(Gr)for(var r of Gr(t))fi.call(t,r)&&zr(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 be=er();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),be.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 B;if(((B=Ee[0])==null?void 0:B.isFrozen())&&T.type!==R.FullSnapshot&&!(T.type===R.IncrementalSnapshot&&T.data.source===D.Mutation)&&Ee.forEach(G=>G.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 G=n&&H>=n,oe=r&&T.timestamp-W.timestamp>r;(G||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 Bo({mutationCb:V}),w=new ui({mutationCb:V}),g=new ci({recordCanvas:y,mutationCb:O,win:window,blockClass:o,mirror:be,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:be});Ye=(T=!1)=>{var k,B,G,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:be,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,be)&&$.addIframe(Y),Ge(Y)&&C.addShadowRoot(Y.shadowRoot,document)},onIframeLoad:(Y,ve)=>{$.attachIframe(Y,ve,be),C.observeAttachShadow(Y)},onStylesheetLoad:(Y,ve)=>{this.stylesheetManager.attachStylesheet(Y,ve,this.mirror)},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||((B=(k=document?.body)==null?void 0:k.parentElement)==null?void 0:B.scrollLeft)||document?.body.scrollLeft||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((oe=(G=document?.body)==null?void 0:G.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=G=>{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:G,maskInputFn:h,maskTextFn:p,blockSelector:i,slimDOMOptions:K,mirror:be,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(G=>{T.push(k(G.contentDocument))});const B=()=>{Ye(),T.push(k(document))};return document.readyState==="interactive"||document.readyState==="complete"?B():T.push(ie("load",()=>{Q(te({type:R.Load,data:{}})),B()},window)),()=>{T.forEach(G=>G())}}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=be;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[Ot(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-]+$/,Ot=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=Ot(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=Ot(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 Rt={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"};function de(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)),de(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&&Rt[i])e.setAttributeNS(Rt[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))de(d,h,n,o),d=e[++c],h=t[++s];else if(n.mirror.getId(m)===o.getId(p))de(m,p,n,o),m=e[--a],p=t[--u];else if(n.mirror.getId(d)===o.getId(p))r.insertBefore(d,m.nextSibling),de(d,p,n,o),d=e[++c],p=t[--u];else if(n.mirror.getId(m)===o.getId(h))r.insertBefore(m,d),de(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),de(f,h,n,o),e[b]=void 0}else{const f=Dt(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),de(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=Dt(t[s],n.mirror,o);r.insertBefore(y,S),de(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 Dt(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(Rt.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 Bi{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===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
- Copyright (c) Microsoft Corporation.
3
+ or you can use record.mirror to access the mirror instance during recording.`;V.mirror={map:{},getId(){return console.error(Ee),-1},getNode(){return console.error(Ee),null},removeNodeFromMap(){console.error(Ee)},has(){return console.error(Ee),!1},reset(){console.error(Ee)}},typeof window<"u"&&window.Proxy&&window.Reflect&&(V.mirror=new Proxy(V.mirror,{get(t,e,n){return e==="map"&&console.error(Ee),Reflect.get(t,e,n)}}));function Se(t,e,n={}){let r=null,o=0;return function(i){const l=Date.now();!o&&n.leading===!1&&(o=l);const c=e-(l-o),a=this,s=arguments;c<=0||c>e?(r&&(clearTimeout(r),r=null),o=l,t.apply(a,s)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{o=n.leading===!1?0:Date.now(),r=null,t.apply(a,s)},c))}}function De(t,e,n,r,o=window){const i=o.Object.getOwnPropertyDescriptor(t,e);return o.Object.defineProperty(t,e,r?n:{set(l){setTimeout(()=>{n.set.call(this,l)},0),i&&i.set&&i.set.call(this,l)}}),()=>De(t,e,i||{},!0)}function pe(t,e,n){try{if(!(e in t))return()=>{};const r=t[e],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),t[e]=o,()=>{t[e]=r}}catch{return()=>{}}}function et(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function tt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}const Lt=t=>{try{if(t instanceof HTMLElement)return t.tagName==="CANVAS"}catch{return!1}return!1};function ne(t,e,n){if(!t)return!1;const r=t.nodeType===t.ELEMENT_NODE?t:t.parentElement;if(!r)return!1;if(typeof e=="string"){if(r.classList.contains(e)||n&&r.closest("."+e)!==null)return!0}else if(b.classMatchesRegex(r,e,n))return!0;return!1}function Pt(t,e){return e.getId(t)!==-1}function Ue(t,e){return e.getId(t)===b.IGNORED_NODE}function nt(t,e){if(b.isShadowRoot(t))return!1;const n=e.getId(t);return e.has(n)?t.parentNode&&t.parentNode.nodeType===t.DOCUMENT_NODE?!1:t.parentNode?nt(t.parentNode,e):!0:!0}function rt(t){return Boolean(t.changedTouches)}function ot(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(e){if(!(0 in arguments))throw new TypeError("1 argument is required");do if(this===e)return!0;while(e=e&&e.parentNode);return!1})}function Ft(t){const e={},n=(o,i)=>{const l={value:o,parent:i,children:[]};return e[o.node.id]=l,l},r=[];for(const o of t){const{nextId:i,parentId:l}=o;if(i&&i in e){const c=e[i];if(c.parent){const a=c.parent.children.indexOf(c);c.parent.children.splice(a,0,n(o,c.parent))}else{const a=r.indexOf(c);r.splice(a,0,n(o,null))}continue}if(l in e){const c=e[l];c.children.push(n(o,c));continue}r.push(n(o,null))}return r}function it(t,e){e(t.value);for(let n=t.children.length-1;n>=0;n--)it(t.children[n],e)}function we(t,e){return Boolean(t.nodeName==="IFRAME"&&e.getMeta(t))}function st(t,e){return Boolean(t.nodeName==="LINK"&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&t.getAttribute("rel")==="stylesheet"&&e.getMeta(t))}function at(t,e){var n,r;const o=(r=(n=t.ownerDocument)==null?void 0:n.defaultView)==null?void 0:r.frameElement;if(!o||o===e)return{x:0,y:0,relativeScale:1,absoluteScale:1};const i=o.getBoundingClientRect(),l=at(o,e),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 ke(t){return Boolean(t?.shadowRoot)}function Ce(t,e){const n=t[e[0]];return e.length===1?n:Ce(n.cssRules[e[1]].cssRules,e.slice(2))}function lt(t){const e=[...t],n=e.pop();return{positions:e,index:n}}function _t(t){const e=new Set,n=[];for(let r=t.length;r--;){const o=t[r];e.has(o.id)||(n.push(o),e.add(o.id))}return n}var mr=Object.freeze({__proto__:null,on:te,get _mirror(){return V.mirror},throttle:Se,hookSetter:De,patch:pe,getWindowHeight:et,getWindowWidth:tt,isCanvasNode:Lt,isBlocked:ne,isSerialized:Pt,isIgnored:Ue,isAncestorRemoved:nt,isTouchEvent:rt,polyfill:ot,queueToResolveTrees:Ft,iterateResolveTree:it,isSerializedIframe:we,isSerializedStylesheet:st,getBaseDimension:at,hasShadowRoot:ke,getNestedRule:Ce,getPositionsAndIndex:lt,uniqueTextMutations:_t}),E=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(E||{}),w=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t))(w||{}),H=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(H||{}),he=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(he||{}),ye=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t))(ye||{}),M=(t=>(t.Start="start",t.Pause="pause",t.Resume="resume",t.Resize="resize",t.Finish="finish",t.FullsnapshotRebuilded="fullsnapshot-rebuilded",t.LoadStylesheetStart="load-stylesheet-start",t.LoadStylesheetEnd="load-stylesheet-end",t.SkipStart="skip-start",t.SkipEnd="skip-end",t.MouseInteraction="mouse-interaction",t.EventCast="event-cast",t.CustomEvent="custom-event",t.Flush="flush",t.StateChange="state-change",t.PlayBack="play-back",t))(M||{});function $t(t){return"__ln"in t}class pr{constructor(){this.length=0,this.head=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<e;r++)n=n?.next||null;return n}addNode(e){const n={value:e,previous:null,next:null};if(e.__ln=n,e.previousSibling&&$t(e.previousSibling)){const r=e.previousSibling.__ln.next;n.next=r,n.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(e.nextSibling&&$t(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;n.previous=r,n.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;this.length++}removeNode(e){const n=e.__ln;!this.head||(n.previous?(n.previous.next=n.next,n.next&&(n.next.previous=n.previous)):(this.head=n.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)}}const Vt=(t,e)=>`${t}@${e}`;class fr{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=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],n=new pr,r=c=>{let a=c,s=b.IGNORED_NODE;for(;s===b.IGNORED_NODE;)a=a&&a.nextSibling,s=a&&this.mirror.getId(a);return s},o=c=>{var a,s,u,d,h;const m=c.getRootNode?(a=c.getRootNode())==null?void 0:a.host:null;let f=m;for(;(u=(s=f?.getRootNode)==null?void 0:s.call(f))!=null&&u.host;)f=((h=(d=f?.getRootNode)==null?void 0:d.call(f))==null?void 0:h.host)||null;const v=!this.doc.contains(c)&&(!f||!this.doc.contains(f));if(!c.parentNode||v)return;const g=b.isShadowRoot(c.parentNode)?this.mirror.getId(m):this.mirror.getId(c.parentNode),p=r(c);if(g===-1||p===-1)return n.addNode(c);const y=b.serializeNodeWithId(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:N=>{we(N,this.mirror)&&this.iframeManager.addIframe(N),st(N,this.mirror)&&this.stylesheetManager.addStylesheet(N),ke(c)&&this.shadowDomManager.addShadowRoot(c.shadowRoot,document)},onIframeLoad:(N,I)=>{this.iframeManager.attachIframe(N,I,this.mirror),this.shadowDomManager.observeAttachShadow(N)},onStylesheetLoad:(N,I)=>{this.stylesheetManager.attachStylesheet(N,I,this.mirror)},newlyAddedElement:!0});y&&e.push({parentId:g,nextId:p,node:y})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const c of Array.from(this.movedSet.values()))Wt(this.removes,c,this.mirror)&&!this.movedSet.has(c.parentNode)||o(c);for(const c of Array.from(this.addedSet.values()))!Gt(this.droppedSet,c)&&!Wt(this.removes,c,this.mirror)||Gt(this.movedSet,c)?o(c):this.droppedSet.add(c);let i=null;for(;n.length;){let c=null;if(i){const a=this.mirror.getId(i.value.parentNode),s=r(i.value);a!==-1&&s!==-1&&(c=i)}if(!c)for(let a=n.length-1;a>=0;a--){const s=n.get(a);if(s){const u=this.mirror.getId(s.value.parentNode),d=r(s.value);if(u!==-1&&d!==-1){c=s;break}}}if(!c){for(;n.head;)n.removeNode(n.head.value);break}i=c.previous,n.removeNode(c.value),o(c.value)}const l={texts:this.texts.map(c=>{let a=c.value;return this.enableStrictPrivacy&&a&&(a=b.obfuscateText(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:e};!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=e=>{if(!Ue(e.target,this.mirror))switch(e.type){case"characterData":{const n=e.target.textContent;!ne(e.target,this.blockClass,!1)&&n!==e.oldValue&&this.texts.push({value:b.needMaskingText(e.target,this.maskTextClass,this.maskTextSelector)&&n?this.maskTextFn?this.maskTextFn(n):n.replace(/[\S]/g,"*"):n,node:e.target});break}case"attributes":{const n=e.target;let r=e.target.getAttribute(e.attributeName);if(e.attributeName==="value"&&(r=b.maskInputValue({maskInputOptions:this.maskInputOptions,tagName:e.target.tagName,type:e.target.getAttribute("type"),value:r,maskInputFn:this.maskInputFn})),ne(e.target,this.blockClass,!1)||r===e.oldValue)return;let o=this.attributes.find(i=>i.node===e.target);if(o||(o={node:e.target,attributes:{}},this.attributes.push(o)),e.attributeName==="style"){const i=this.doc.createElement("span");e.oldValue&&i.setAttribute("style",e.oldValue),(o.attributes.style===void 0||o.attributes.style===null)&&(o.attributes.style={});const l=o.attributes.style;for(const c of Array.from(n.style)){const a=n.style.getPropertyValue(c),s=n.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))n.style.getPropertyValue(c)===""&&(l[c]=!1)}else{if(e.target.tagName==="INPUT"){const i=e.target;if(i.type==="password"){o.attributes.value="*".repeat(i.value.length);break}}o.attributes[e.attributeName]=b.transformAttribute(this.doc,e.target.tagName,e.attributeName,r)}break}case"childList":{if(ne(e.target,this.blockClass,!0))return;e.addedNodes.forEach(n=>this.genAdds(n,e.target)),e.removedNodes.forEach(n=>{const r=this.mirror.getId(n),o=b.isShadowRoot(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);ne(e.target,this.blockClass,!1)||Ue(n,this.mirror)||!Pt(n,this.mirror)||(this.addedSet.has(n)?(ct(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(e.target)&&r===-1||nt(e.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[Vt(r,o)]?ct(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:b.isShadowRoot(e.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(e,n)=>{if(this.mirror.hasNode(e)){if(Ue(e,this.mirror))return;this.movedSet.add(e);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[Vt(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ne(e,this.blockClass,!1)||e.childNodes.forEach(r=>this.genAdds(r))}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","enableStrictPrivacy"].forEach(n=>{this[n]=e[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function ct(t,e){t.delete(e),e.childNodes.forEach(n=>ct(t,n))}function Wt(t,e,n){return t.length===0?!1:jt(t,e,n)}function jt(t,e,n){const{parentNode:r}=e;if(!r)return!1;const o=n.getId(r);return t.some(i=>i.id===o)?!0:jt(t,r,n)}function Gt(t,e){return t.size===0?!1:Ut(t,e)}function Ut(t,e){const{parentNode:n}=e;return n?t.has(n)?!0:Ut(t,n):!1}var vr=Object.defineProperty,gr=Object.defineProperties,yr=Object.getOwnPropertyDescriptors,zt=Object.getOwnPropertySymbols,br=Object.prototype.hasOwnProperty,Nr=Object.prototype.propertyIsEnumerable,Bt=(t,e,n)=>e in t?vr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Yt=(t,e)=>{for(var n in e||(e={}))br.call(e,n)&&Bt(t,n,e[n]);if(zt)for(var n of zt(e))Nr.call(e,n)&&Bt(t,n,e[n]);return t},Tr=(t,e)=>gr(t,yr(e));const be=[],Ht=typeof CSSGroupingRule<"u",Xt=typeof CSSMediaRule<"u",Zt=typeof CSSSupportsRule<"u",Kt=typeof CSSConditionRule<"u";function Ae(t){try{if("composedPath"in t){const e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0];return t.target}catch{return t.target}}function Jt(t,e){var n,r;const o=new fr;be.push(o),o.init(t);let i=window.MutationObserver||window.__rrMutationObserver;const l=(r=(n=window?.Zone)==null?void 0:n.__symbol__)==null?void 0:r.call(n,"MutationObserver");l&&window[l]&&(i=window[l]);const c=new i(o.processMutations.bind(o));return c.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),c}function Er({mousemoveCb:t,sampling:e,doc:n,mirror:r}){if(e.mousemove===!1)return()=>{};const o=typeof e.mousemove=="number"?e.mousemove:50,i=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let l=[],c;const a=Se(d=>{const h=Date.now()-c;t(l.map(m=>(m.timeOffset-=h,m)),d),l=[],c=null},i),s=Se(d=>{const h=Ae(d),{clientX:m,clientY:f}=rt(d)?d.changedTouches[0]:d;c||(c=Date.now()),l.push({x:m,y:f,id:r.getId(h),timeOffset:Date.now()-c}),a(typeof DragEvent<"u"&&d instanceof DragEvent?w.Drag:d instanceof MouseEvent?w.MouseMove:w.TouchMove)},o,{trailing:!1}),u=[te("mousemove",s,n),te("touchmove",s,n),te("drag",s,n)];return()=>{u.forEach(d=>d())}}function Sr({mouseInteractionCb:t,doc:e,mirror:n,blockClass:r,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const i=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,l=[],c=a=>s=>{const u=Ae(s);if(ne(u,r,!0)||Lt(u))return;const d=rt(s)?s.changedTouches[0]:s;if(!d)return;const h=n.getId(u),{clientX:m,clientY:f}=d;t({type:H[a],id:h,x:m,y:f})};return Object.keys(H).filter(a=>Number.isNaN(Number(a))&&!a.endsWith("_Departed")&&i[a]!==!1).forEach(a=>{const s=a.toLowerCase(),u=c(a);l.push(te(s,u,e))}),()=>{l.forEach(a=>a())}}function Qt({scrollCb:t,doc:e,mirror:n,blockClass:r,sampling:o}){const i=Se(l=>{const c=Ae(l);if(!c||ne(c,r,!0))return;const a=n.getId(c);if(c===e){const s=e.scrollingElement||e.documentElement;t({id:a,x:s.scrollLeft,y:s.scrollTop})}else t({id:a,x:c.scrollLeft,y:c.scrollTop})},o.scroll||100);return te("scroll",i,e)}function wr({viewportResizeCb:t}){let e=-1,n=-1;const r=Se(()=>{const o=et(),i=tt();(e!==o||n!==i)&&(t({width:Number(i),height:Number(o)}),e=o,n=i)},200);return te("resize",r,window)}function qt(t,e){const n=Yt({},t);return e||delete n.userTriggered,n}const Cr=["INPUT","TEXTAREA","SELECT"],en=new WeakMap;function Ir({inputCb:t,doc:e,mirror:n,blockClass:r,ignoreClass:o,maskInputOptions:i,maskInputFn:l,sampling:c,userTriggeredOnInput:a}){function s(f){let v=Ae(f);const g=f.isTrusted;if(v&&v.tagName==="OPTION"&&(v=v.parentElement),!v||!v.tagName||Cr.indexOf(v.tagName)<0||ne(v,r,!0))return;const p=v.type;if(v.classList.contains(o))return;let y=v.value,N=!1;p==="radio"||p==="checkbox"?N=v.checked:(i[v.tagName.toLowerCase()]||i[p])&&(y=b.maskInputValue({maskInputOptions:i,tagName:v.tagName,type:p,value:y,maskInputFn:l})),u(v,qt({text:y,isChecked:N,userTriggered:g},a));const I=v.name;p==="radio"&&I&&N&&e.querySelectorAll(`input[type="radio"][name="${I}"]`).forEach(x=>{x!==v&&u(x,qt({text:x.value,isChecked:!N,userTriggered:!1},a))})}function u(f,v){const g=en.get(f);if(!g||g.text!==v.text||g.isChecked!==v.isChecked){en.set(f,v);const p=n.getId(f);t(Tr(Yt({},v),{id:p}))}}const d=(c.input==="last"?["change"]:["input","change"]).map(f=>te(f,s,e)),h=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),m=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return h&&h.set&&d.push(...m.map(f=>De(f[0],f[1],{set(){s({target:this})}}))),()=>{d.forEach(f=>f())}}function ze(t){const e=[];function n(r,o){if(Ht&&r.parentRule instanceof CSSGroupingRule||Xt&&r.parentRule instanceof CSSMediaRule||Zt&&r.parentRule instanceof CSSSupportsRule||Kt&&r.parentRule instanceof CSSConditionRule){const i=Array.from(r.parentRule.cssRules).indexOf(r);o.unshift(i)}else{const i=Array.from(r.parentStyleSheet.cssRules).indexOf(r);o.unshift(i)}return o}return n(t,e)}function Rr({styleSheetRuleCb:t,mirror:e},{win:n}){const r=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=function(c,a){const s=e.getId(this.ownerNode);return s!==-1&&t({id:s,adds:[{rule:c,index:a}]}),r.apply(this,arguments)};const o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=function(c){const a=e.getId(this.ownerNode);return a!==-1&&t({id:a,removes:[{index:c}]}),o.apply(this,arguments)};const i={};Ht?i.CSSGroupingRule=n.CSSGroupingRule:(Xt&&(i.CSSMediaRule=n.CSSMediaRule),Kt&&(i.CSSConditionRule=n.CSSConditionRule),Zt&&(i.CSSSupportsRule=n.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=e.getId(this.parentStyleSheet.ownerNode);return d!==-1&&t({id:d,adds:[{rule:s,index:[...ze(this),u||0]}]}),l[c].insertRule.apply(this,arguments)},a.prototype.deleteRule=function(s){const u=e.getId(this.parentStyleSheet.ownerNode);return u!==-1&&t({id:u,removes:[{index:[...ze(this),s]}]}),l[c].deleteRule.apply(this,arguments)}}),()=>{n.CSSStyleSheet.prototype.insertRule=r,n.CSSStyleSheet.prototype.deleteRule=o,Object.entries(i).forEach(([c,a])=>{a.prototype.insertRule=l[c].insertRule,a.prototype.deleteRule=l[c].deleteRule})}}function Mr({styleDeclarationCb:t,mirror:e},{win:n}){const r=n.CSSStyleDeclaration.prototype.setProperty;n.CSSStyleDeclaration.prototype.setProperty=function(i,l,c){var a,s;const u=e.getId((s=(a=this.parentRule)==null?void 0:a.parentStyleSheet)==null?void 0:s.ownerNode);return u!==-1&&t({id:u,set:{property:i,value:l,priority:c},index:ze(this.parentRule)}),r.apply(this,arguments)};const o=n.CSSStyleDeclaration.prototype.removeProperty;return n.CSSStyleDeclaration.prototype.removeProperty=function(i){var l,c;const a=e.getId((c=(l=this.parentRule)==null?void 0:l.parentStyleSheet)==null?void 0:c.ownerNode);return a!==-1&&t({id:a,remove:{property:i},index:ze(this.parentRule)}),o.apply(this,arguments)},()=>{n.CSSStyleDeclaration.prototype.setProperty=r,n.CSSStyleDeclaration.prototype.removeProperty=o}}function xr({mediaInteractionCb:t,blockClass:e,mirror:n,sampling:r}){const o=l=>Se(c=>{const a=Ae(c);if(!a||ne(a,e,!0))return;const{currentTime:s,volume:u,muted:d}=a;t({type:l,id:n.getId(a),currentTime:s,volume:u,muted:d})},r.media||500),i=[te("play",o(ye.Play)),te("pause",o(ye.Pause)),te("seeked",o(ye.Seeked)),te("volumechange",o(ye.VolumeChange))];return()=>{i.forEach(l=>l())}}function Or({fontCb:t,doc:e}){const n=e.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,i=n.FontFace;n.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=pe(e.fonts,"add",function(c){return function(a){return setTimeout(()=>{const s=o.get(a);s&&(t(s),o.delete(a))},0),c.apply(this,[a])}});return r.push(()=>{n.FontFace=i}),r.push(l),()=>{r.forEach(c=>c())}}function Dr(t,e){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:l,inputCb:c,mediaInteractionCb:a,styleSheetRuleCb:s,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h}=t;t.mutationCb=(...m)=>{e.mutation&&e.mutation(...m),n(...m)},t.mousemoveCb=(...m)=>{e.mousemove&&e.mousemove(...m),r(...m)},t.mouseInteractionCb=(...m)=>{e.mouseInteraction&&e.mouseInteraction(...m),o(...m)},t.scrollCb=(...m)=>{e.scroll&&e.scroll(...m),i(...m)},t.viewportResizeCb=(...m)=>{e.viewportResize&&e.viewportResize(...m),l(...m)},t.inputCb=(...m)=>{e.input&&e.input(...m),c(...m)},t.mediaInteractionCb=(...m)=>{e.mediaInteaction&&e.mediaInteaction(...m),a(...m)},t.styleSheetRuleCb=(...m)=>{e.styleSheetRule&&e.styleSheetRule(...m),s(...m)},t.styleDeclarationCb=(...m)=>{e.styleDeclaration&&e.styleDeclaration(...m),u(...m)},t.canvasMutationCb=(...m)=>{e.canvasMutation&&e.canvasMutation(...m),d(...m)},t.fontCb=(...m)=>{e.font&&e.font(...m),h(...m)}}function kr(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};Dr(t,e);const r=Jt(t,t.doc),o=Er(t),i=Sr(t),l=Qt(t),c=wr(t),a=Ir(t),s=xr(t),u=Rr(t,{win:n}),d=Mr(t,{win:n}),h=t.collectFonts?Or(t):()=>{},m=[];for(const f of t.plugins)m.push(f.observer(f.callback,n,f.options));return()=>{be.forEach(f=>f.reset()),r.disconnect(),o(),i(),l(),c(),a(),s(),u(),d(),h(),m.forEach(f=>f())}}class Ar{constructor(e){this.iframes=new WeakMap,this.mutationCb=e.mutationCb}addIframe(e){this.iframes.set(e,!0)}addLoadListener(e){this.loadListener=e}attachIframe(e,n,r){var o;this.mutationCb({adds:[{parentId:r.getId(e),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(o=this.loadListener)==null||o.call(this,e)}}var Lr=Object.defineProperty,Pr=Object.defineProperties,Fr=Object.getOwnPropertyDescriptors,tn=Object.getOwnPropertySymbols,_r=Object.prototype.hasOwnProperty,$r=Object.prototype.propertyIsEnumerable,nn=(t,e,n)=>e in t?Lr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,rn=(t,e)=>{for(var n in e||(e={}))_r.call(e,n)&&nn(t,n,e[n]);if(tn)for(var n of tn(e))$r.call(e,n)&&nn(t,n,e[n]);return t},on=(t,e)=>Pr(t,Fr(e));class Vr{constructor(e){this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;const n=this;this.restorePatches.push(pe(HTMLElement.prototype,"attachShadow",function(r){return function(){const o=r.apply(this,arguments);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,this.ownerDocument),o}}))}addShadowRoot(e,n){Jt(on(rn({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),Qt(on(rn({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))}observeAttachShadow(e){if(e.contentWindow){const n=this;this.restorePatches.push(pe(e.contentWindow.HTMLElement.prototype,"attachShadow",function(r){return function(){const o=r.apply(this,arguments);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,e.contentDocument),o}}))}}reset(){this.restorePatches.forEach(e=>e())}}for(var Ie="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Le=typeof Uint8Array>"u"?[]:new Uint8Array(256),Be=0;Be<Ie.length;Be++)Le[Ie.charCodeAt(Be)]=Be;var Wr=function(t){var e=new Uint8Array(t),n,r=e.length,o="";for(n=0;n<r;n+=3)o+=Ie[e[n]>>2],o+=Ie[(e[n]&3)<<4|e[n+1]>>4],o+=Ie[(e[n+1]&15)<<2|e[n+2]>>6],o+=Ie[e[n+2]&63];return r%3===2?o=o.substring(0,o.length-1)+"=":r%3===1&&(o=o.substring(0,o.length-2)+"=="),o},jr=function(t){var e=t.length*.75,n=t.length,r,o=0,i,l,c,a;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);var s=new ArrayBuffer(e),u=new Uint8Array(s);for(r=0;r<n;r+=4)i=Le[t.charCodeAt(r)],l=Le[t.charCodeAt(r+1)],c=Le[t.charCodeAt(r+2)],a=Le[t.charCodeAt(r+3)],u[o++]=i<<2|l>>4,u[o++]=(l&15)<<4|c>>2,u[o++]=(c&3)<<6|a&63;return s};const sn=new Map;function Gr(t,e){let n=sn.get(t);return n||(n=new Map,sn.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}const an=(t,e,n)=>{if(!t||!(cn(t,e)||typeof t=="object"))return;const r=t.constructor.name,o=Gr(n,r);let i=o.indexOf(t);return i===-1&&(i=o.length,o.push(t)),i};function Ye(t,e,n){if(t instanceof Array)return t.map(r=>Ye(r,e,n));if(t===null)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer){const r=t.constructor.name,o=Wr(t);return{rr_type:r,base64:o}}else{if(t instanceof DataView)return{rr_type:t.constructor.name,args:[Ye(t.buffer,e,n),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){const r=t.constructor.name,{src:o}=t;return{rr_type:r,src:o}}else if(t instanceof HTMLCanvasElement){const r="HTMLImageElement",o=t.toDataURL();return{rr_type:r,src:o}}else{if(t instanceof ImageData)return{rr_type:t.constructor.name,args:[Ye(t.data,e,n),t.width,t.height]};if(cn(t,e)||typeof t=="object"){const r=t.constructor.name,o=an(t,e,n);return{rr_type:r,index:o}}}}return t}const ln=(t,e,n)=>[...t].map(r=>Ye(r,e,n)),cn=(t,e)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(r=>typeof e[r]=="function");return Boolean(n.find(r=>t instanceof e[r]))};function Ur(t,e,n,r){const o=[],i=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const l of i)try{if(typeof e.CanvasRenderingContext2D.prototype[l]!="function")continue;const c=pe(e.CanvasRenderingContext2D.prototype,l,function(a){return function(...s){return ne(this.canvas,n,!0)||setTimeout(()=>{const u=ln([...s],e,this);t(this.canvas,{type:he["2D"],property:l,args:u})},0),a.apply(this,s)}});o.push(c)}catch{const a=De(e.CanvasRenderingContext2D.prototype,l,{set(s){t(this.canvas,{type:he["2D"],property:l,args:[s],setter:!0})}});o.push(a)}return()=>{o.forEach(l=>l())}}function un(t,e){const n=[];try{const r=pe(t.HTMLCanvasElement.prototype,"getContext",function(o){return function(i,...l){return ne(this,e,!0)||"__context"in this||(this.__context=i),o.apply(this,[i,...l])}});n.push(r)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(r=>r())}}function dn(t,e,n,r,o,i){const l=[],c=Object.getOwnPropertyNames(t);for(const a of c)try{if(typeof t[a]!="function")continue;const s=pe(t,a,function(u){return function(...d){const h=u.apply(this,d);if(an(h,i,t),!ne(this.canvas,r,!0)){const m=ln([...d],i,t),f={type:e,property:a,args:m};n(this.canvas,f)}return h}});l.push(s)}catch{const u=De(t,a,{set(d){n(this.canvas,{type:e,property:a,args:[d],setter:!0})}});l.push(u)}return l}function zr(t,e,n,r){const o=[];return o.push(...dn(e.WebGLRenderingContext.prototype,he.WebGL,t,n,r,e)),typeof e.WebGL2RenderingContext<"u"&&o.push(...dn(e.WebGL2RenderingContext.prototype,he.WebGL2,t,n,r,e)),()=>{o.forEach(i=>i())}}function Br(t,e){var n=atob(t);if(e){for(var r=new Uint8Array(n.length),o=0,i=n.length;o<i;++o)r[o]=n.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}function Yr(t,e,n){var r=e===void 0?null:e,o=n===void 0?!1:n,i=Br(t,o),l=i.indexOf(`
4
+ `,10)+1,c=i.substring(l)+(r?"//# sourceMappingURL="+r:""),a=new Blob([c],{type:"application/javascript"});return URL.createObjectURL(a)}function Hr(t,e,n){var r;return function(i){return r=r||Yr(t,e,n),new Worker(r,i)}}var Xr=Hr("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Zm9yKHZhciByPSJBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OSsvIixsPXR5cGVvZiBVaW50OEFycmF5PiJ1Ij9bXTpuZXcgVWludDhBcnJheSgyNTYpLGY9MDtmPHIubGVuZ3RoO2YrKylsW3IuY2hhckNvZGVBdChmKV09Zjt2YXIgZD1mdW5jdGlvbihzKXt2YXIgZT1uZXcgVWludDhBcnJheShzKSxuLGE9ZS5sZW5ndGgsdD0iIjtmb3Iobj0wO248YTtuKz0zKXQrPXJbZVtuXT4+Ml0sdCs9clsoZVtuXSYzKTw8NHxlW24rMV0+PjRdLHQrPXJbKGVbbisxXSYxNSk8PDJ8ZVtuKzJdPj42XSx0Kz1yW2VbbisyXSY2M107cmV0dXJuIGElMz09PTI/dD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTEpKyI9IjphJTM9PT0xJiYodD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTIpKyI9PSIpLHR9O2NvbnN0IGM9bmV3IE1hcCx1PW5ldyBNYXA7YXN5bmMgZnVuY3Rpb24gcChzLGUpe2NvbnN0IG49YCR7c30tJHtlfWA7aWYodS5oYXMobikpcmV0dXJuIHUuZ2V0KG4pO2NvbnN0IGE9bmV3IE9mZnNjcmVlbkNhbnZhcyhzLGUpO2EuZ2V0Q29udGV4dCgiMmQiKTtjb25zdCB0PWF3YWl0KGF3YWl0IGEuY29udmVydFRvQmxvYigpKS5hcnJheUJ1ZmZlcigpLGc9ZCh0KTtyZXR1cm4gdS5zZXQobixnKSxnfWNvbnN0IGk9c2VsZjtpLm9ubWVzc2FnZT1hc3luYyBmdW5jdGlvbihzKXtpZighKCJPZmZzY3JlZW5DYW52YXMiaW4gZ2xvYmFsVGhpcykpcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOnMuZGF0YS5pZH0pO2NvbnN0e2lkOmUsYml0bWFwOm4sd2lkdGg6YSxoZWlnaHQ6dH09cy5kYXRhLGc9cChhLHQpLGg9bmV3IE9mZnNjcmVlbkNhbnZhcyhhLHQpO2guZ2V0Q29udGV4dCgiMmQiKS5kcmF3SW1hZ2UobiwwLDApLG4uY2xvc2UoKTtjb25zdCB3PWF3YWl0IGguY29udmVydFRvQmxvYigpLHk9dy50eXBlLGI9YXdhaXQgdy5hcnJheUJ1ZmZlcigpLG89ZChiKTtpZighYy5oYXMoZSkmJmF3YWl0IGc9PT1vKXJldHVybiBjLnNldChlLG8pLGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpZihjLmdldChlKT09PW8pcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpLnBvc3RNZXNzYWdlKHtpZDplLHR5cGU6eSxiYXNlNjQ6byx3aWR0aDphLGhlaWdodDp0fSksYy5zZXQoZSxvKX19KSgpOwoK",null,!1),hn=Object.getOwnPropertySymbols,Zr=Object.prototype.hasOwnProperty,Kr=Object.prototype.propertyIsEnumerable,Jr=(t,e)=>{var n={};for(var r in t)Zr.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&hn)for(var r of hn(t))e.indexOf(r)<0&&Kr.call(t,r)&&(n[r]=t[r]);return n},Qr=(t,e,n)=>new Promise((r,o)=>{var i=a=>{try{c(n.next(a))}catch(s){o(s)}},l=a=>{try{c(n.throw(a))}catch(s){o(s)}},c=a=>a.done?r(a.value):Promise.resolve(a.value).then(i,l);c((n=n.apply(t,e)).next())});class qr{constructor(e){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:n="all",win:r,blockClass:o,recordCanvas:i}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,i&&n==="all"&&this.initCanvasMutationObserver(r,o),i&&typeof n=="number"&&this.initCanvasFPSObserver(n,r,o)}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,n,r){const o=un(n,r),i=new Map,l=new Xr;l.onmessage=d=>{const{id:h}=d.data;if(i.set(h,!1),!("base64"in d.data))return;const{base64:m,type:f,width:v,height:g}=d.data;this.mutationCb({id:h,type:he["2D"],commands:[{property:"clearRect",args:[0,0,v,g]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:m}],type:f}]},0,0]}]})};const c=1e3/e;let a=0,s;const u=d=>{if(a&&d-a<c){s=requestAnimationFrame(u);return}a=d,n.document.querySelectorAll(`canvas:not(.${r} *)`).forEach(h=>Qr(this,null,function*(){var m;const f=this.mirror.getId(h);if(i.get(f))return;if(i.set(f,!0),["webgl","webgl2"].includes(h.__context)){const g=h.getContext(h.__context);((m=g?.getContextAttributes())==null?void 0:m.preserveDrawingBuffer)===!1&&g?.clear(g.COLOR_BUFFER_BIT)}const v=yield createImageBitmap(h);l.postMessage({id:f,bitmap:v,width:h.width,height:h.height},[v])})),s=requestAnimationFrame(u)};s=requestAnimationFrame(u),this.resetObservers=()=>{o(),cancelAnimationFrame(s)}}initCanvasMutationObserver(e,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=un(e,n),o=Ur(this.processMutation.bind(this),e,n,this.mirror),i=zr(this.processMutation.bind(this),e,n,this.mirror);this.resetObservers=()=>{r(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=n=>{this.rafStamps.latestId=n,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,n)=>{const r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,n){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||n===-1)return;const o=r.map(l=>Jr(l,["type"])),{type:i}=r[0];this.mutationCb({id:n,type:i,commands:o}),this.pendingCanvasMutations.delete(e)}}class eo{constructor(e){this.trackedStylesheets=new WeakSet,this.mutationCb=e.mutationCb}addStylesheet(e){this.trackedStylesheets.has(e)||(this.trackedStylesheets.add(e),this.trackStylesheet(e))}trackStylesheet(e){}attachStylesheet(e,n,r){this.mutationCb({adds:[{parentId:r.getId(e),nextId:null,node:n}],removes:[],texts:[],attributes:[]}),this.addStylesheet(e)}}var to=Object.defineProperty,no=Object.defineProperties,ro=Object.getOwnPropertyDescriptors,mn=Object.getOwnPropertySymbols,oo=Object.prototype.hasOwnProperty,io=Object.prototype.propertyIsEnumerable,pn=(t,e,n)=>e in t?to(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ie=(t,e)=>{for(var n in e||(e={}))oo.call(e,n)&&pn(t,n,e[n]);if(mn)for(var n of mn(e))io.call(e,n)&&pn(t,n,e[n]);return t},so=(t,e)=>no(t,ro(e));function Z(t){return so(ie({},t),{timestamp:Date.now()})}let Y,Pe;const ce=b.createMirror();function Ne(t={}){const{emit:e,checkoutEveryNms:n,checkoutEveryNth:r,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:h,maskInputFn:m,maskTextFn:f,hooks:v,packFn:g,sampling:p={},mousemoveWait:y,recordCanvas:N=!1,userTriggeredOnInput:I=!1,collectFonts:x=!1,inlineImages:R=!1,plugins:O,keepIframeSrcFn:T=()=>!1,enableStrictPrivacy:J=!1}=t;if(!e)throw new Error("emit function is required");y!==void 0&&p.mousemove===void 0&&(p.mousemove=y),ce.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},re=h===!0||h==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:h==="all",headMetaDescKeywords:h==="all"}:h||{};ot();let F,z=0;const B=S=>{for(const G of O||[])G.eventProcessor&&(S=G.eventProcessor(S));return g&&(S=g(S)),S};Y=(S,G)=>{var $;if((($=be[0])==null?void 0:$.isFrozen())&&S.type!==E.FullSnapshot&&!(S.type===E.IncrementalSnapshot&&S.data.source===w.Mutation)&&be.forEach(k=>k.unfreeze()),e(B(S),G),S.type===E.FullSnapshot)F=S,z=0;else if(S.type===E.IncrementalSnapshot){if(S.data.source===w.Mutation&&S.data.isAttachIframe)return;z++;const k=r&&z>=r,oe=n&&S.timestamp-F.timestamp>n;(k||oe)&&Pe(!0)}};const j=S=>{Y(Z({type:E.IncrementalSnapshot,data:ie({source:w.Mutation},S)}))},P=S=>Y(Z({type:E.IncrementalSnapshot,data:ie({source:w.Scroll},S)})),C=S=>Y(Z({type:E.IncrementalSnapshot,data:ie({source:w.CanvasMutation},S)})),_=new Ar({mutationCb:j}),X=new eo({mutationCb:j}),q=new qr({recordCanvas:N,mutationCb:C,win:window,blockClass:o,mirror:ce,sampling:p.canvas}),Q=new Vr({mutationCb:j,scrollCb:P,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:a,inlineStylesheet:s,maskInputOptions:U,maskTextFn:f,maskInputFn:m,recordCanvas:N,inlineImages:R,sampling:p,slimDOMOptions:re,iframeManager:_,stylesheetManager:X,canvasManager:q,enableStrictPrivacy:J},mirror:ce});Pe=(S=!1)=>{var G,$,k,oe;Y(Z({type:E.Meta,data:{href:window.location.href,width:tt(),height:et()}}),S),be.forEach(A=>A.lock());const D=b.snapshot(document,{mirror:ce,blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:a,inlineStylesheet:s,maskAllInputs:U,maskTextFn:f,slimDOM:re,recordCanvas:N,inlineImages:R,enableStrictPrivacy:J,onSerialize:A=>{we(A,ce)&&_.addIframe(A),st(A,ce)&&X.addStylesheet(A),ke(A)&&Q.addShadowRoot(A.shadowRoot,document)},onIframeLoad:(A,Ge)=>{_.attachIframe(A,Ge,ce),Q.observeAttachShadow(A)},onStylesheetLoad:(A,Ge)=>{X.attachStylesheet(A,Ge,ce)},keepIframeSrcFn:T});if(!D)return console.warn("Failed to snapshot the document");Y(Z({type:E.FullSnapshot,data:{node:D,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||(($=(G=document?.body)==null?void 0:G.parentElement)==null?void 0:$.scrollLeft)||document?.body.scrollLeft||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((oe=(k=document?.body)==null?void 0:k.parentElement)==null?void 0:oe.scrollTop)||document?.body.scrollTop||0}}})),be.forEach(A=>A.unlock())};try{const S=[];S.push(te("DOMContentLoaded",()=>{Y(Z({type:E.DomContentLoaded,data:{}}))}));const G=k=>{var oe;return kr({mutationCb:j,mousemoveCb:(D,A)=>Y(Z({type:E.IncrementalSnapshot,data:{source:A,positions:D}})),mouseInteractionCb:D=>Y(Z({type:E.IncrementalSnapshot,data:ie({source:w.MouseInteraction},D)})),scrollCb:P,viewportResizeCb:D=>Y(Z({type:E.IncrementalSnapshot,data:ie({source:w.ViewportResize},D)})),inputCb:D=>Y(Z({type:E.IncrementalSnapshot,data:ie({source:w.Input},D)})),mediaInteractionCb:D=>Y(Z({type:E.IncrementalSnapshot,data:ie({source:w.MediaInteraction},D)})),styleSheetRuleCb:D=>Y(Z({type:E.IncrementalSnapshot,data:ie({source:w.StyleSheetRule},D)})),styleDeclarationCb:D=>Y(Z({type:E.IncrementalSnapshot,data:ie({source:w.StyleDeclaration},D)})),canvasMutationCb:C,fontCb:D=>Y(Z({type:E.IncrementalSnapshot,data:ie({source:w.Font},D)})),blockClass:o,ignoreClass:l,maskTextClass:c,maskTextSelector:a,maskInputOptions:U,inlineStylesheet:s,sampling:p,recordCanvas:N,inlineImages:R,userTriggeredOnInput:I,collectFonts:x,doc:k,maskInputFn:m,maskTextFn:f,blockSelector:i,slimDOMOptions:re,mirror:ce,iframeManager:_,stylesheetManager:X,shadowDomManager:Q,canvasManager:q,enableStrictPrivacy:J,plugins:((oe=O?.filter(D=>D.observer))==null?void 0:oe.map(D=>({observer:D.observer,options:D.options,callback:A=>Y(Z({type:E.Plugin,data:{plugin:D.name,payload:A}}))})))||[]},v)};_.addLoadListener(k=>{S.push(G(k.contentDocument))});const $=()=>{Pe(),S.push(G(document))};return document.readyState==="interactive"||document.readyState==="complete"?$():S.push(te("load",()=>{Y(Z({type:E.Load,data:{}})),$()},window)),()=>{S.forEach(k=>k())}}catch(S){console.warn(S)}}Ne.addCustomEvent=(t,e)=>{!Y||Y(Z({type:E.Custom,data:{tag:t,payload:e}}))},Ne.freezePage=()=>{be.forEach(t=>t.freeze())},Ne.takeFullSnapshot=t=>{if(!Pe)throw new Error("please take full snapshot after start recording");Pe(t)},Ne.mirror=ce;function ao(t){const e={},n=/;(?![^(]*\))/g,r=/:(.+)/,o=/\/\*.*?\*\//g;return t.replace(o,"").split(n).forEach(function(i){if(i){const l=i.split(r);l.length>1&&(e[ut(l[0].trim())]=l[1].trim())}}),e}function fn(t){const e=[];for(const n in t){const r=t[n];if(typeof r!="string")continue;const o=ho(n);e.push(`${o}: ${r};`)}return e.join(" ")}const lo=/-([a-z])/g,co=/^--[a-zA-Z0-9-]+$/,ut=t=>co.test(t)?t:t.replace(lo,(e,n)=>n?n.toUpperCase():""),uo=/\B([A-Z])/g,ho=t=>t.replace(uo,"-$1").toLowerCase();class se{constructor(...e){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=W.ELEMENT_NODE,this.TEXT_NODE=W.TEXT_NODE}get firstChild(){return this.childNodes[0]||null}get lastChild(){return this.childNodes[this.childNodes.length-1]||null}get nextSibling(){const e=this.parentNode;if(!e)return null;const n=e.childNodes,r=n.indexOf(this);return n[r+1]||null}contains(e){if(e===this)return!0;for(const n of this.childNodes)if(n.contains(e))return!0;return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,n){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function mo(t){return class hr extends t{constructor(){super(...arguments),this.nodeType=W.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=b.NodeType.Document,this.textContent=null}get documentElement(){return this.childNodes.find(n=>n.RRNodeType===b.NodeType.Element&&n.tagName==="HTML")||null}get body(){var n;return((n=this.documentElement)===null||n===void 0?void 0:n.childNodes.find(r=>r.RRNodeType===b.NodeType.Element&&r.tagName==="BODY"))||null}get head(){var n;return((n=this.documentElement)===null||n===void 0?void 0:n.childNodes.find(r=>r.RRNodeType===b.NodeType.Element&&r.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(n){const r=n.RRNodeType;if((r===b.NodeType.Element||r===b.NodeType.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${r===b.NodeType.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);return n.parentElement=null,n.parentNode=this,this.childNodes.push(n),n}insertBefore(n,r){const o=n.RRNodeType;if((o===b.NodeType.Element||o===b.NodeType.DocumentType)&&this.childNodes.some(l=>l.RRNodeType===o))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${o===b.NodeType.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);if(r===null)return this.appendChild(n);const i=this.childNodes.indexOf(r);if(i==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(i,0,n),n.parentElement=null,n.parentNode=this,n}removeChild(n){const r=this.childNodes.indexOf(n);if(r===-1)throw new Error("Failed to execute 'removeChild' on 'RRDocument': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(r,1),n.parentElement=null,n.parentNode=null,n}open(){this.childNodes=[]}close(){}write(n){let r;if(n==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?r="-//W3C//DTD XHTML 1.0 Transitional//EN":n==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(r="-//W3C//DTD HTML 4.0 Transitional//EN"),r){const o=this.createDocumentType("html",r,"");this.open(),this.appendChild(o)}}createDocument(n,r,o){return new hr}createDocumentType(n,r,o){const i=new(vn(se))(n,r,o);return i.ownerDocument=this,i}createElement(n){const r=new(gn(se))(n);return r.ownerDocument=this,r}createElementNS(n,r){return this.createElement(r)}createTextNode(n){const r=new(yn(se))(n);return r.ownerDocument=this,r}createComment(n){const r=new(bn(se))(n);return r.ownerDocument=this,r}createCDATASection(n){const r=new(Nn(se))(n);return r.ownerDocument=this,r}toString(){return"RRDocument"}}}function vn(t){return class extends t{constructor(e,n,r){super(),this.nodeType=W.DOCUMENT_TYPE_NODE,this.RRNodeType=b.NodeType.DocumentType,this.textContent=null,this.name=e,this.publicId=n,this.systemId=r,this.nodeName=e}toString(){return"RRDocumentType"}}}function gn(t){return class extends t{constructor(e){super(),this.nodeType=W.ELEMENT_NODE,this.RRNodeType=b.NodeType.Element,this.attributes={},this.shadowRoot=null,this.tagName=e.toUpperCase(),this.nodeName=e.toUpperCase()}get textContent(){let e="";return this.childNodes.forEach(n=>e+=n.textContent),e}set textContent(e){this.childNodes=[this.ownerDocument.createTextNode(e)]}get classList(){return new fo(this.attributes.class,e=>{this.attributes.class=e})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const e=this.attributes.style?ao(this.attributes.style):{},n=/\B([A-Z])/g;return e.setProperty=(r,o,i)=>{if(n.test(r))return;const l=ut(r);o?e[l]=o:delete e[l],i==="important"&&(e[l]+=" !important"),this.attributes.style=fn(e)},e.removeProperty=r=>{if(n.test(r))return"";const o=ut(r),i=e[o]||"";return delete e[o],this.attributes.style=fn(e),i},e}getAttribute(e){return this.attributes[e]||null}setAttribute(e,n){this.attributes[e]=n}setAttributeNS(e,n,r){this.setAttribute(n,r)}removeAttribute(e){delete this.attributes[e]}appendChild(e){return this.childNodes.push(e),e.parentNode=this,e.parentElement=this,e}insertBefore(e,n){if(n===null)return this.appendChild(e);const r=this.childNodes.indexOf(n);if(r==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(r,0,e),e.parentElement=this,e.parentNode=this,e}removeChild(e){const n=this.childNodes.indexOf(e);if(n===-1)throw new Error("Failed to execute 'removeChild' on 'RRElement': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(n,1),e.parentElement=null,e.parentNode=null,e}attachShadow(e){const n=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=n,n}dispatchEvent(e){return!0}toString(){let e="";for(const n in this.attributes)e+=`${n}="${this.attributes[n]}" `;return`${this.tagName} ${e}`}}}function po(t){return class extends t{attachShadow(e){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 yn(t){return class extends t{constructor(e){super(),this.nodeType=W.TEXT_NODE,this.nodeName="#text",this.RRNodeType=b.NodeType.Text,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function bn(t){return class extends t{constructor(e){super(),this.nodeType=W.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=b.NodeType.Comment,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function Nn(t){return class extends t{constructor(e){super(),this.nodeName="#cdata-section",this.nodeType=W.CDATA_SECTION_NODE,this.RRNodeType=b.NodeType.CDATA,this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class fo{constructor(e,n){if(this.classes=[],this.add=(...r)=>{for(const o of r){const i=String(o);this.classes.indexOf(i)>=0||this.classes.push(i)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...r)=>{this.classes=this.classes.filter(o=>r.indexOf(o)===-1),this.onChange&&this.onChange(this.classes.join(" "))},e){const r=e.trim().split(/\s+/);this.classes.push(...r)}this.onChange=n}}var W;(function(t){t[t.PLACEHOLDER=0]="PLACEHOLDER",t[t.ELEMENT_NODE=1]="ELEMENT_NODE",t[t.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",t[t.TEXT_NODE=3]="TEXT_NODE",t[t.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",t[t.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",t[t.ENTITY_NODE=6]="ENTITY_NODE",t[t.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",t[t.COMMENT_NODE=8]="COMMENT_NODE",t[t.DOCUMENT_NODE=9]="DOCUMENT_NODE",t[t.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",t[t.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"})(W||(W={}));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 ue(t,e,n,r){const o=t.childNodes,i=e.childNodes;r=r||e.mirror||e.ownerDocument.mirror,(o.length>0||i.length>0)&&Tn(Array.from(o),i,t,n,r);let l=null,c=null;switch(e.RRNodeType){case b.NodeType.Document:{c=e.scrollData;break}case b.NodeType.Element:{const a=t,s=e;switch(vo(a,s,r),c=s.scrollData,l=s.inputData,s.tagName){case"AUDIO":case"VIDEO":{const u=t,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":e.canvasMutations.forEach(u=>n.applyCanvas(u.event,u.mutation,t));break;case"STYLE":go(a,e.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)&&Tn(Array.from(u),d,a.shadowRoot,n,r)}break}case b.NodeType.Text:case b.NodeType.Comment:case b.NodeType.CDATA:t.textContent!==e.data&&(t.textContent=e.data);break}if(c&&n.applyScroll(c,!0),l&&n.applyInput(l),e.nodeName==="IFRAME"){const a=t.contentDocument,s=e;if(a){const u=r.getMeta(s.contentDocument);u&&n.mirror.add(a,Object.assign({},u)),ue(a,s.contentDocument,n,r)}}}function vo(t,e,n){const r=t.attributes,o=e.attributes;for(const i in o){const l=o[i],c=n.getMeta(e);if(c&&"isSVG"in c&&c.isSVG&&dt[i])t.setAttributeNS(dt[i],i,l);else if(e.tagName==="CANVAS"&&i==="rr_dataURL"){const a=document.createElement("img");a.src=l,a.onload=()=>{const s=t.getContext("2d");s&&s.drawImage(a,0,0,a.width,a.height)}}else t.setAttribute(i,l)}for(const{name:i}of Array.from(r))i in o||t.removeAttribute(i);e.scrollLeft&&(t.scrollLeft=e.scrollLeft),e.scrollTop&&(t.scrollTop=e.scrollTop)}function Tn(t,e,n,r,o){var i;let l=0,c=t.length-1,a=0,s=e.length-1,u=t[l],d=t[c],h=e[a],m=e[s],f,v;for(;l<=c&&a<=s;)if(u===void 0)u=t[++l];else if(d===void 0)d=t[--c];else if(r.mirror.getId(u)===o.getId(h))ue(u,h,r,o),u=t[++l],h=e[++a];else if(r.mirror.getId(d)===o.getId(m))ue(d,m,r,o),d=t[--c],m=e[--s];else if(r.mirror.getId(u)===o.getId(m))try{n.insertBefore(u,d.nextSibling),ue(u,m,r,o),u=t[++l],m=e[--s]}catch(g){console.error(g,n,u,d)}else if(r.mirror.getId(d)===o.getId(h))try{n.insertBefore(d,u),ue(d,h,r,o),d=t[--c],h=e[++a]}catch(g){console.error(g,n,d,u)}else{if(!f){f={};for(let g=l;g<=c;g++){const p=t[g];p&&r.mirror.hasNode(p)&&(f[r.mirror.getId(p)]=g)}}if(v=f[o.getId(h)],v){const g=t[v];try{n.insertBefore(g,u),ue(g,h,r,o),t[v]=void 0}catch(p){console.error(p,n,g,u)}}else{const g=ht(h,r.mirror,o);n.nodeName==="#document"&&((i=r.mirror.getMeta(g))===null||i===void 0?void 0:i.type)===b.NodeType.Element&&n.documentElement&&(n.removeChild(n.documentElement),t[l]=void 0,u=void 0);try{n.insertBefore(g,u||null),ue(g,h,r,o)}catch(p){console.error(p,n,g,u||null)}}h=e[++a]}if(l>c){const g=e[s+1];let p=null;for(g&&n.childNodes.forEach(y=>{r.mirror.getId(y)===o.getId(g)&&(p=y)});a<=s;++a){const y=ht(e[a],r.mirror,o);try{n.insertBefore(y,p),ue(y,e[a],r,o)}catch(N){console.error(N,n,y,p)}}}else if(a>s)for(;l<=c;l++){const g=t[l];g&&(n.removeChild(g),r.mirror.removeNodeFromMap(g))}}function ht(t,e,n){let r=e.getNode(n.getId(t));const o=n.getMeta(t);if(r!==null)return r;switch(t.RRNodeType){case b.NodeType.Document:r=new Document;break;case b.NodeType.DocumentType:r=document.implementation.createDocumentType(t.name,t.publicId,t.systemId);break;case b.NodeType.Element:{t.tagName.toLowerCase(),o&&"isSVG"in o&&o?.isSVG?r=document.createElementNS(dt.svg,t.tagName.toLowerCase()):r=document.createElement(t.tagName);break}case b.NodeType.Text:r=document.createTextNode(t.data);break;case b.NodeType.Comment:r=document.createComment(t.data);break;case b.NodeType.CDATA:r=document.createCDATASection(t.data);break}return o&&e.add(r,Object.assign({},o)),r}function Fe(t,e){const n=t[e[0]];return e.length===1?n:Fe(n.cssRules[e[1]].cssRules,e.slice(2))}var ae;(function(t){t[t.Insert=0]="Insert",t[t.Remove=1]="Remove",t[t.Snapshot=2]="Snapshot",t[t.SetProperty=3]="SetProperty",t[t.RemoveProperty=4]="RemoveProperty"})(ae||(ae={}));function En(t){const e=[...t],n=e.pop();return{positions:e,index:n}}function go(t,e){const n=t.sheet;e.forEach(r=>{if(r.type===ae.Insert)try{if(Array.isArray(r.index)){const{positions:o,index:i}=En(r.index);Fe(n.cssRules,o).insertRule(r.cssText,i)}else n.insertRule(r.cssText,r.index)}catch{}else if(r.type===ae.Remove)try{if(Array.isArray(r.index)){const{positions:o,index:i}=En(r.index);Fe(n.cssRules,o).deleteRule(i||0)}else n.deleteRule(r.index)}catch{}else r.type===ae.SetProperty?Fe(n.cssRules,r.index).style.setProperty(r.property,r.value,r.priority):r.type===ae.RemoveProperty&&Fe(n.cssRules,r.index).style.removeProperty(r.property)})}class Re extends mo(se){constructor(e){super(),this._unserializedId=-1,this.mirror=Mo(),this.scrollData=null,e&&(this.mirror=e)}get unserializedId(){return this._unserializedId--}createDocument(e,n,r){return new Re}createDocumentType(e,n,r){const o=new yo(e,n,r);return o.ownerDocument=this,o}createElement(e){const n=e.toUpperCase();let r;switch(n){case"AUDIO":case"VIDEO":r=new bo(n);break;case"IFRAME":r=new Eo(n,this.mirror);break;case"CANVAS":r=new No(n);break;case"STYLE":r=new To(n);break;default:r=new _e(n);break}return r.ownerDocument=this,r}createComment(e){const n=new wo(e);return n.ownerDocument=this,n}createCDATASection(e){const n=new Co(e);return n.ownerDocument=this,n}createTextNode(e){const n=new So(e);return n.ownerDocument=this,n}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=-1}}const yo=vn(se);class _e extends gn(se){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class bo extends po(_e){}class No extends _e{constructor(){super(...arguments),this.canvasMutations=[]}getContext(){return null}}class To extends _e{constructor(){super(...arguments),this.rules=[]}}class Eo extends _e{constructor(e,n){super(e),this.contentDocument=new Re,this.contentDocument.mirror=n}}const So=yn(se),wo=bn(se),Co=Nn(se);function Io(t){return t instanceof HTMLFormElement?"FORM":t.tagName.toUpperCase()}function Sn(t,e,n,r){let o;switch(t.nodeType){case W.DOCUMENT_NODE:r&&r.nodeName==="IFRAME"?o=r.contentDocument:(o=e,o.compatMode=t.compatMode);break;case W.DOCUMENT_TYPE_NODE:const l=t;o=e.createDocumentType(l.name,l.publicId,l.systemId);break;case W.ELEMENT_NODE:const c=t,a=Io(c);o=e.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 W.TEXT_NODE:o=e.createTextNode(t.textContent||"");break;case W.CDATA_SECTION_NODE:o=e.createCDATASection(t.data);break;case W.COMMENT_NODE:o=e.createComment(t.textContent||"");break;case W.DOCUMENT_FRAGMENT_NODE:o=r.attachShadow({mode:"open"});break;default:return null}let i=n.getMeta(t);return e instanceof Re&&(i||(i=wn(o,e.unserializedId),n.add(t,i)),e.mirror.add(o,Object.assign({},i))),o}function Ro(t,e=b.createMirror(),n=new Re){function r(o,i){const l=Sn(o,n,e,i);l!==null&&(i?.nodeName!=="IFRAME"&&o.nodeType!==W.DOCUMENT_FRAGMENT_NODE&&(i?.appendChild(l),l.parentNode=i,l.parentElement=i),o.nodeName==="IFRAME"?r(o.contentDocument,l):(o.nodeType===W.DOCUMENT_NODE||o.nodeType===W.ELEMENT_NODE||o.nodeType===W.DOCUMENT_FRAGMENT_NODE)&&(o.nodeType===W.ELEMENT_NODE&&o.shadowRoot&&r(o.shadowRoot,l),o.childNodes.forEach(c=>r(c,l))))}return r(t,null),n}function Mo(){return new xo}class xo{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var n;if(!e)return-1;const r=(n=this.getMeta(e))===null||n===void 0?void 0:n.id;return r??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,n){const r=n.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,n)}replace(e,n){this.idNodeMap.set(e,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function wn(t,e){switch(t.RRNodeType){case b.NodeType.Document:return{id:e,type:t.RRNodeType,childNodes:[]};case b.NodeType.DocumentType:const n=t;return{id:e,type:t.RRNodeType,name:n.name,publicId:n.publicId,systemId:n.systemId};case b.NodeType.Element:return{id:e,type:t.RRNodeType,tagName:t.tagName.toLowerCase(),attributes:{},childNodes:[]};case b.NodeType.Text:return{id:e,type:t.RRNodeType,textContent:t.textContent||""};case b.NodeType.Comment:return{id:e,type:t.RRNodeType,textContent:t.textContent||""};case b.NodeType.CDATA:return{id:e,type:t.RRNodeType,textContent:""}}}function Cn(t){return t=t||Object.create(null),{on:function(n,r){(t[n]||(t[n]=[])).push(r)},off:function(n,r){t[n]&&t[n].splice(t[n].indexOf(r)>>>0,1)},emit:function(n,r){(t[n]||[]).slice().map(function(o){o(r)}),(t["*"]||[]).slice().map(function(o){o(n,r)})}}}var Oo=Object.freeze({__proto__:null,default:Cn});function Do(t=window,e=document){if("scrollBehavior"in e.documentElement.style&&t.__forceSmoothScrollPolyfill__!==!0)return;const n=t.HTMLElement||t.Element,r=468,o={scroll:t.scroll||t.scrollTo,scrollBy:t.scrollBy,elementScroll:n.prototype.scroll||a,scrollIntoView:n.prototype.scrollIntoView},i=t.performance&&t.performance.now?t.performance.now.bind(t.performance):Date.now;function l(p){const y=["MSIE ","Trident/","Edge/"];return new RegExp(y.join("|")).test(p)}const c=l(t.navigator.userAgent)?1:0;function a(p,y){this.scrollLeft=p,this.scrollTop=y}function s(p){return .5*(1-Math.cos(Math.PI*p))}function u(p){if(p===null||typeof p!="object"||p.behavior===void 0||p.behavior==="auto"||p.behavior==="instant")return!0;if(typeof p=="object"&&p.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+p.behavior+" is not a valid value for enumeration ScrollBehavior.")}function d(p,y){if(y==="Y")return p.clientHeight+c<p.scrollHeight;if(y==="X")return p.clientWidth+c<p.scrollWidth}function h(p,y){const N=t.getComputedStyle(p,null)["overflow"+y];return N==="auto"||N==="scroll"}function m(p){const y=d(p,"Y")&&h(p,"Y"),N=d(p,"X")&&h(p,"X");return y||N}function f(p){for(;p!==e.body&&m(p)===!1;)p=p.parentNode||p.host;return p}function v(p){const y=i();let N,I,x,R=(y-p.startTime)/r;R=R>1?1:R,N=s(R),I=p.startX+(p.x-p.startX)*N,x=p.startY+(p.y-p.startY)*N,p.method.call(p.scrollable,I,x),(I!==p.x||x!==p.y)&&t.requestAnimationFrame(v.bind(t,p))}function g(p,y,N){let I,x,R,O;const T=i();p===e.body?(I=t,x=t.scrollX||t.pageXOffset,R=t.scrollY||t.pageYOffset,O=o.scroll):(I=p,x=p.scrollLeft,R=p.scrollTop,O=a),v({scrollable:I,method:O,startTime:T,startX:x,startY:R,x:y,y:N})}t.scroll=t.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.scroll.call(t,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:t.scrollX||t.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:t.scrollY||t.pageYOffset);return}g.call(t,e.body,arguments[0].left!==void 0?~~arguments[0].left:t.scrollX||t.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:t.scrollY||t.pageYOffset)}},t.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])){o.scrollBy.call(t,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}g.call(t,e.body,~~arguments[0].left+(t.scrollX||t.pageXOffset),~~arguments[0].top+(t.scrollY||t.pageYOffset))}},n.prototype.scroll=n.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(u(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const p=arguments[0].left,y=arguments[0].top;g.call(this,this,typeof p>"u"?this.scrollLeft:~~p,typeof y>"u"?this.scrollTop:~~y)},n.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},n.prototype.scrollIntoView=function(){if(u(arguments[0])===!0){o.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const p=f(this),y=p.getBoundingClientRect(),N=this.getBoundingClientRect();p!==e.body?(g.call(this,p,p.scrollLeft+N.left-y.left,p.scrollTop+N.top-y.top),t.getComputedStyle(p).position!=="fixed"&&t.scrollBy({left:y.left,top:y.top,behavior:"smooth"})):t.scrollBy({left:N.left,top:N.top,behavior:"smooth"})}}class ko{constructor(e=[],n){this.timeOffset=0,this.raf=null,this.actions=e,this.speed=n}addAction(e){const n=this.findActionIndex(e);this.actions.splice(n,0,e)}addActions(e){this.actions=this.actions.concat(e)}replaceActions(e){this.actions.length=0,this.actions.splice(0,0,...e)}start(){this.timeOffset=0;let e=performance.now();const{actions:n}=this,r=this;function o(){const i=performance.now();for(r.timeOffset+=(i-e)*r.speed,e=i;n.length;){const l=n[0];if(r.timeOffset>=l.delay)n.shift(),l.doAction();else break}(n.length>0||r.liveMode)&&(r.raf=requestAnimationFrame(o))}this.raf=requestAnimationFrame(o)}clear(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(e){this.speed=e}toggleLiveMode(e){this.liveMode=e}isActive(){return this.raf!==null}findActionIndex(e){let n=0,r=this.actions.length-1;for(;n<=r;){const o=Math.floor((n+r)/2);if(this.actions[o].delay<e.delay)n=o+1;else if(this.actions[o].delay>e.delay)r=o-1;else return o+1}return n}}function mt(t,e){if(t.type===E.IncrementalSnapshot&&t.data.source===w.MouseMove){const n=t.data.positions[0].timeOffset,r=t.timestamp+n;return t.delay=r-e,r-e}return t.delay=t.timestamp-e,t.delay}/*! *****************************************************************************
5
+ Copyright (c) Microsoft Corporation.
7
6
 
8
- Permission to use, copy, modify, and/or distribute this software for any
9
- purpose with or without fee is hereby granted.
7
+ Permission to use, copy, modify, and/or distribute this software for any
8
+ purpose with or without fee is hereby granted.
10
9
 
11
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
12
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
14
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
16
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17
- PERFORMANCE OF THIS SOFTWARE.
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 At(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(At(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=At(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?At(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 Gi=Object.defineProperty,zi=Object.defineProperties,Hi=Object.getOwnPropertyDescriptors,mn=Object.getOwnPropertySymbols,Yi=Object.prototype.hasOwnProperty,Xi=Object.prototype.propertyIsEnumerable,pn=(e,t,r)=>t in e?Gi(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)=>zi(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)Lt(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(z.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(z.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(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 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;Lt(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===pe.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([pe.WebGL,pe.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},Pt=(e,t)=>cs(e,us(t)),Ft=(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]",$t={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Wt(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=ur(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=er(),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: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(z.Resize,this.handleResize),this.setupDom(),this.emitter.on(z.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(de(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=Dt(s.node,this.mirror,this.virtualDom.mirror);de(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 Bi([],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(z.StateChange,{player:c})}),this.speedService=qi({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===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(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>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(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&&(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(z.CustomEvent,t)};break;case R.Meta:n=()=>this.emitter.emit(z.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(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===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(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/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(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=[];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(z.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(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 Ft(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===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 Ft(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=>Ft(this,null,function*(){const l=yield Promise.all(i.args.map(Se(this.imageMap,null,n)));return Pt(Fe({},i),{args:l})})));n.isUnchanged===!1&&this.canvasEventMap.set(r,Pt(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,Pt(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(z.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(z.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}=xt(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}=xt(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&&Ge(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&&(Ge(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=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)?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=kt(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!==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(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: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]),jt=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],Vt=Cn[1];In[28]=258,Vt[258]=28;for(var kn=En(mt,0),gs=kn[0],xn=kn[1],Ut=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,Ut[Z]=((we&65280)>>>8|(we&255)<<8)>>>1}for(var he=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[Ut[d]>>>a]=s}else for(c=new ne(n),o=0;o<n;++o)c[o]=Ut[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=he(Ne,9,0),bs=he(Ne,9,1),Ss=he(qe,5,0),ws=he(qe,5,1),Bt=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},Gt=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 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[jt[E]]=ue(e,a+E*3,7);a+=N*3;var F=Bt(I),U=(1<<F)-1;if(!i&&a+x*(F+7)>p)break;for(var K=he(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=Bt(V),h=Bt(A),u=he(V,m,1),d=he(A,h,1)}else throw"invalid block type";else{var b=zt(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[Gt(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[Gt(e,a)&$],B=k>>>4;if(!k)throw"invalid distance";a+=k&15;var A=gs[B];if(B>3){var T=mt[B];A+=Gt(e,a)&(1<<T)-1,a+=T}if(a>p)throw"unexpected EOF";o&&l(s+131072);for(var G=s+C;s<G;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=G}}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)},fe=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},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 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=Xt(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]},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},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=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},On=function(e,t,r,n,o,i,l,c,a,s,u){fe(t,u++,r),++o[256];for(var d=Yt(o,15),m=d[0],h=d[1],p=Yt(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=Yt(I,7),U=F[0],K=F[1],W=19;W>4&&!U[jt[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(fe(t,u,1+(V<L)),u+=2,V<L){A=he(m,h,0),O=m,$=he(v,b,0),w=v;var g=he(U,K,0);fe(t,u,y-257),fe(t,u+5,M-1),fe(t,u+10,W-4),u+=14;for(var E=0;E<W;++E)fe(t,u+3*E,U[jt[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 B=k[E]&31;fe(t,u,g[B]),u+=U[B],B>15&&(fe(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 B=n[E]>>>18&31;Je(t,u,A[B+257]),u+=O[B+257],B>7&&(fe(t,u,n[E]>>>23&31),u+=ht[B]);var G=n[E]&31;Je(t,u,$[G]),u+=w[G],G>3&&(Je(t,u,n[E]>>>5&8191),u+=mt[G])}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),B=Math.min(258,A);C<=k&&--g&&L!=V;){if(e[u+$]==e[u+$-C]){for(var G=0;G<B&&e[u+G]==e[u+G-C];++G);if(G>$){if($=G,w=C,G>T)break;for(var oe=Math.min(C,G-2),j=0,O=0;O<oe;++O){var Y=u-C+O+32768&32767,ve=b[Y],ge=Y-ve+32768&32767;ge>j&&(j=ge,V=Y)}}}L=V,V=b[L],C+=L-V+32768&32767}if(w){x[U++]=268435456|Vt[$]<<18|xn[w];var $e=Vt[$]&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 Ht(c,0,n+zt(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 Ht(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 Zt="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:Zt});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===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 Us=/(^|@)\S+:\d+/,Pn=/^\s*at .*(\S+:\d+|\(native\))/m,Bs=/^(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(Bs)},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
- `)>-1&&e.message.split(`
22
- `).length>e.stacktrace.split(`
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(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 Gs(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 _n(e,t){if(t===0)return!0;const r=Object.keys(e);for(const n of r)if(Kt(e[n])&&_n(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]=Gs(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)&&_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 zs(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=[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]?ye(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=>qt(p,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",Hs=e=>({name:Jt,observer:zs,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===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)}}}},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=Jt,q.Replayer=ps,q.ReplayerEvents=z,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}({});
10
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
11
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
13
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
15
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16
+ PERFORMANCE OF THIS SOFTWARE.
17
+ ***************************************************************************** */function In(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),l=[];try{for(;(e===void 0||e-- >0)&&!(r=i.next()).done;)l.push(r.value)}catch(c){o={error:c}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return l}var Me;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(Me||(Me={}));var Rn={type:"xstate.init"};function pt(t){return t===void 0?[]:[].concat(t)}function Te(t){return{type:"xstate.assign",assignment:t}}function Mn(t,e){return typeof(t=typeof t=="string"&&e&&e[t]?e[t]:t)=="string"?{type:t}:typeof t=="function"?{type:t.name,exec:t}:t}function He(t){return function(e){return t===e}}function xn(t){return typeof t=="string"?{type:t}:t}function On(t,e){return{value:t,context:e,actions:[],changed:!1,matches:He(t)}}function Dn(t,e,n){var r=e,o=!1;return[t.filter(function(i){if(i.type==="xstate.assign"){o=!0;var l=Object.assign({},r);return typeof i.assignment=="function"?l=i.assignment(r,n):Object.keys(i.assignment).forEach(function(c){l[c]=typeof i.assignment[c]=="function"?i.assignment[c](r,n):i.assignment[c]}),r=l,!1}return!0}),r,o]}function kn(t,e){e===void 0&&(e={});var n=In(Dn(pt(t.states[t.initial].entry).map(function(l){return Mn(l,e.actions)}),t.context,Rn),2),r=n[0],o=n[1],i={config:t,_options:e,initialState:{value:t.initial,actions:r,context:o,matches:He(t.initial)},transition:function(l,c){var a,s,u=typeof l=="string"?{value:l,context:t.context}:l,d=u.value,h=u.context,m=xn(c),f=t.states[d];if(f.on){var v=pt(f.on[m.type]);try{for(var g=function(C){var _=typeof Symbol=="function"&&Symbol.iterator,X=_&&C[_],q=0;if(X)return X.call(C);if(C&&typeof C.length=="number")return{next:function(){return C&&q>=C.length&&(C=void 0),{value:C&&C[q++],done:!C}}};throw new TypeError(_?"Object is not iterable.":"Symbol.iterator is not defined.")}(v),p=g.next();!p.done;p=g.next()){var y=p.value;if(y===void 0)return On(d,h);var N=typeof y=="string"?{target:y}:y,I=N.target,x=N.actions,R=x===void 0?[]:x,O=N.cond,T=O===void 0?function(){return!0}:O,J=I===void 0,U=I??d,re=t.states[U];if(T(h,m)){var F=In(Dn((J?pt(R):[].concat(f.exit,R,re.entry).filter(function(C){return C})).map(function(C){return Mn(C,i._options.actions)}),h,m),3),z=F[0],B=F[1],j=F[2],P=I??d;return{value:P,context:B,actions:z,changed:I!==d||z.length>0||j,matches:He(P)}}}}catch(C){a={error:C}}finally{try{p&&!p.done&&(s=g.return)&&s.call(g)}finally{if(a)throw a.error}}}return On(d,h)}};return i}var An=function(t,e){return t.actions.forEach(function(n){var r=n.exec;return r&&r(t.context,e)})};function Ln(t){var e=t.initialState,n=Me.NotStarted,r=new Set,o={_machine:t,send:function(i){n===Me.Running&&(e=t.transition(e,i),An(e,xn(i)),r.forEach(function(l){return l(e)}))},subscribe:function(i){return r.add(i),i(e),{unsubscribe:function(){return r.delete(i)}}},start:function(i){if(i){var l=typeof i=="object"?i:{context:t.config.context,value:i};e={value:l.value,actions:[],context:l.context,matches:He(l.value)}}return n=Me.Running,An(e,Rn),o},stop:function(){return n=Me.Stopped,r.clear(),o},get state(){return e},get status(){return n}};return o}var Ao=Object.defineProperty,Lo=Object.defineProperties,Po=Object.getOwnPropertyDescriptors,Pn=Object.getOwnPropertySymbols,Fo=Object.prototype.hasOwnProperty,_o=Object.prototype.propertyIsEnumerable,Fn=(t,e,n)=>e in t?Ao(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Xe=(t,e)=>{for(var n in e||(e={}))Fo.call(e,n)&&Fn(t,n,e[n]);if(Pn)for(var n of Pn(e))_o.call(e,n)&&Fn(t,n,e[n]);return t},Ze=(t,e)=>Lo(t,Po(e));function $o(t,e){for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.type===E.Meta&&r.timestamp<=e)return t.slice(n)}return t}function Vo(t,{getCastFn:e,applyEventsSynchronously:n,emitter:r}){const o=kn({id:"player",context:t,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]},REPLACE_EVENTS:{target:"playing",actions:["replaceEvents"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]},REPLACE_EVENTS:{target:"paused",actions:["replaceEvents"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:Te({lastPlayedEvent:(i,l)=>l.type==="CAST_EVENT"?l.payload.event:i.lastPlayedEvent}),recordTimeOffset:Te((i,l)=>{let c=i.timeOffset;return"payload"in l&&"timeOffset"in l.payload&&(c=l.payload.timeOffset),Ze(Xe({},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)mt(v,s);const d=$o(a,s);let h=u?.timestamp;u?.type===E.IncrementalSnapshot&&u.data.source===w.MouseMove&&(h=u.timestamp+((l=u.data.positions[0])==null?void 0:l.timeOffset)),s<(h||0)&&r.emit(M.PlayBack);const m=new Array,f=new Array;for(const v of d)if(!(h&&h<s&&(v.timestamp<=h||v===u)))if(v.timestamp<s)m.push(v);else{const g=e(v,!1);f.push({doAction:()=>{g()},delay:v.delay})}n(m),r.emit(M.Flush),c.addActions(f),c.start()},pause(i){i.timer.clear()},resetLastPlayedEvent:Te(i=>Ze(Xe({},i),{lastPlayedEvent:null})),startLive:Te({baselineTime:(i,l)=>(i.timer.toggleLiveMode(!0),i.timer.start(),l.type==="TO_LIVE"&&l.payload.baselineTime?l.payload.baselineTime:Date.now())}),replaceEvents:Te((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 h of u)if(mt(h,s),c.push(h),h.timestamp>=a.timeOffset+s){const m=e(h,!1);d.push({doAction:()=>{m()},delay:h.delay})}a.isActive()&&a.replaceActions(d)}return Ze(Xe({},i),{events:c})}),addEvent:Te((i,l)=>{const{baselineTime:c,timer:a,events:s}=i;if(l.type==="ADD_EVENT"){const{event:u}=l.payload;mt(u,c);let d=s.length-1;if(!s[d]||s[d].timestamp<=u.timestamp)s.push(u);else{let f=-1,v=0;for(;v<=d;){const g=Math.floor((v+d)/2);s[g].timestamp<=u.timestamp?v=g+1:d=g-1}f===-1&&(f=v),s.splice(f,0,u)}const h=u.timestamp<c,m=e(u,h);h?m():a.isActive()&&a.addAction({doAction:()=>{m()},delay:u.delay})}return Ze(Xe({},i),{events:s})})}});return Ln(o)}function Wo(t){const e=kn({id:"speed",context:t,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(n,r)=>{"payload"in r&&n.timer.setSpeed(r.payload.speed)},recordSpeed:Te({normalSpeed:n=>n.timer.speed}),restoreSpeed:n=>{n.timer.setSpeed(n.normalSpeed)}}});return Ln(e)}const jo=t=>[`.${t} { background: currentColor }`,"noscript { display: none !important; }",`.${t} { background: currentColor; border-radius: 5px; }`,`.${t}:hover::after {content: 'Redacted'; color: white; background: black; text-align: center; width: 100%; display: block;}`];var Go=(t,e,n)=>new Promise((r,o)=>{var i=a=>{try{c(n.next(a))}catch(s){o(s)}},l=a=>{try{c(n.throw(a))}catch(s){o(s)}},c=a=>a.done?r(a.value):Promise.resolve(a.value).then(i,l);c((n=n.apply(t,e)).next())});const _n=new Map;function $n(t,e){let n=_n.get(t);return n||(n=new Map,_n.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}function fe(t,e,n){return r=>Go(this,null,function*(){if(r&&typeof r=="object"&&"rr_type"in r)if(n&&(n.isUnchanged=!1),r.rr_type==="ImageBitmap"&&"args"in r){const o=yield fe(t,e,n)(r.args);return yield createImageBitmap.apply(null,o)}else if("index"in r){if(n||e===null)return r;const{rr_type:o,index:i}=r;return $n(e,o)[i]}else if("args"in r){const{rr_type:o,args:i}=r,l=window[o];return new l(...yield Promise.all(i.map(fe(t,e,n))))}else{if("base64"in r)return jr(r.base64);if("src"in r){const o=t.get(r.src);if(o)return o;{const i=new Image;return i.src=r.src,t.set(r.src,i),i}}else if("data"in r&&r.rr_type==="Blob"){const o=yield Promise.all(r.data.map(fe(t,e,n)));return new Blob(o,{type:r.type})}}else if(Array.isArray(r))return yield Promise.all(r.map(fe(t,e,n)));return r})}var Uo=(t,e,n)=>new Promise((r,o)=>{var i=a=>{try{c(n.next(a))}catch(s){o(s)}},l=a=>{try{c(n.throw(a))}catch(s){o(s)}},c=a=>a.done?r(a.value):Promise.resolve(a.value).then(i,l);c((n=n.apply(t,e)).next())});function zo(t,e){try{return e===he.WebGL?t.getContext("webgl")||t.getContext("experimental-webgl"):t.getContext("webgl2")}catch{return null}}const Bo=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function Yo(t,e){if(!(e!=null&&e.constructor))return;const{name:n}=e.constructor;if(!Bo.includes(n))return;const r=$n(t,n);r.includes(e)||r.push(e)}function Ho(t){return Uo(this,arguments,function*({mutation:e,target:n,type:r,imageMap:o,errorHandler:i}){try{const l=zo(n,r);if(!l)return;if(e.setter){l[e.property]=e.args[0];return}const c=l[e.property],a=yield Promise.all(e.args.map(fe(o,l))),s=c.apply(l,a);Yo(l,s)}catch(l){i(e,l)}})}var Xo=(t,e,n)=>new Promise((r,o)=>{var i=a=>{try{c(n.next(a))}catch(s){o(s)}},l=a=>{try{c(n.throw(a))}catch(s){o(s)}},c=a=>a.done?r(a.value):Promise.resolve(a.value).then(i,l);c((n=n.apply(t,e)).next())});function Zo(t){return Xo(this,arguments,function*({event:e,mutation:n,target:r,imageMap:o,errorHandler:i}){try{const l=r.getContext("2d");if(n.setter){l[n.property]=n.args[0];return}const c=l[n.property];if(n.property==="drawImage"&&typeof n.args[0]=="string"){const a=o.get(e);c.apply(l,n.args)}else{const a=yield Promise.all(n.args.map(fe(o,l)));c.apply(l,a)}}catch(l){i(n,l)}})}var Ko=(t,e,n)=>new Promise((r,o)=>{var i=a=>{try{c(n.next(a))}catch(s){o(s)}},l=a=>{try{c(n.throw(a))}catch(s){o(s)}},c=a=>a.done?r(a.value):Promise.resolve(a.value).then(i,l);c((n=n.apply(t,e)).next())});function Vn(t){return Ko(this,arguments,function*({event:e,mutation:n,target:r,imageMap:o,canvasEventMap:i,errorHandler:l}){try{const c=i.get(e)||n,a="commands"in c?c.commands:[c];if([he.WebGL,he.WebGL2].includes(n.type)){for(let s=0;s<a.length;s++){const u=a[s];yield Ho({mutation:u,type:n.type,target:r,imageMap:o,errorHandler:l})}return}for(let s=0;s<a.length;s++){const u=a[s];yield Zo({event:e,mutation:u,target:r,imageMap:o,errorHandler:l})}}catch(c){l(n,c)}})}var Jo=Object.defineProperty,Qo=Object.defineProperties,qo=Object.getOwnPropertyDescriptors,Wn=Object.getOwnPropertySymbols,ei=Object.prototype.hasOwnProperty,ti=Object.prototype.propertyIsEnumerable,jn=(t,e,n)=>e in t?Jo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,xe=(t,e)=>{for(var n in e||(e={}))ei.call(e,n)&&jn(t,n,e[n]);if(Wn)for(var n of Wn(e))ti.call(e,n)&&jn(t,n,e[n]);return t},ft=(t,e)=>Qo(t,qo(e)),vt=(t,e,n)=>new Promise((r,o)=>{var i=a=>{try{c(n.next(a))}catch(s){o(s)}},l=a=>{try{c(n.throw(a))}catch(s){o(s)}},c=a=>a.done?r(a.value):Promise.resolve(a.value).then(i,l);c((n=n.apply(t,e)).next())});const Gn=10*1e3,Un=2*1e3,zn=1*1e3,Bn=60*60*1e3,ni=Cn||Oo,gt="[replayer]",yt={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function bt(t){return t.type==E.IncrementalSnapshot&&(t.data.source==w.TouchMove||t.data.source==w.MouseInteraction&&t.data.type==H.TouchStart)}class ri{constructor(e,n){if(this.usingVirtualDom=!1,this.virtualDom=new Re,this.mouseTail=null,this.tailPositions=[],this.emitter=ni(),this.activityIntervals=[],this.legacy_missingNodeRetryMap={},this.cache=b.createCache(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=b.createMirror(),this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,!(n!=null&&n.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");const r={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"highlight-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:yt,useVirtualDom:!0,inactiveThreshold:.02,inactiveSkipTime:Un};this.config=Object.assign({},r,n),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(M.Resize,this.handleResize),this.setupDom(),this.emitter.on(M.Flush,()=>{if(this.usingVirtualDom){const c={mirror:this.mirror,applyCanvas:(a,s,u)=>{Vn({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(ue(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=ht(s.node,this.mirror,this.virtualDom.mirror);ue(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(M.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset()});const o=new ko([],n?.speed||r.speed);this.service=Vo({events:e.map(c=>n&&n.unpackFn?n.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(M.StateChange,{player:c})}),this.speedService=Wo({normalSpeed:-1,timer:o}),this.speedService.start(),this.speedService.subscribe(c=>{this.emitter.emit(M.StateChange,{speed:c})});const i=this.service.state.context.events.find(c=>c.type===E.Meta),l=this.service.state.context.events.find(c=>c.type===E.FullSnapshot);if(i){const{width:c,height:a}=i.data;setTimeout(()=>{this.emitter.emit(M.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(bt)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(e,n){return this.emitter.on(e,n),this}off(e,n){return this.emitter.off(e,n),this}setConfig(e){Object.keys(e).forEach(n=>{this.config[n]=e[n]}),this.config.skipInactive||this.backToNormal(),typeof e.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),typeof e.mouseTail<"u"&&(e.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 e=[],n=this.getMetaData(),r=[{timestamp:n.startTime},...this.service.state.context.events.filter(l=>this.isUserInteraction(l)),{timestamp:n.endTime}];for(let l=1;l<r.length;l++){const c=r[l-1],a=r[l];a.timestamp-c.timestamp>Gn?e.push({startTime:c.timestamp,endTime:a.timestamp,duration:a.timestamp-c.timestamp,active:!1}):e.push({startTime:c.timestamp,endTime:a.timestamp,duration:a.timestamp-c.timestamp,active:!0})}const o=[];let i=e[0];for(let l=1;l<e.length;l++)e[l].active!=e[l-1].active&&(o.push({startTime:i.startTime,endTime:e[l-1].endTime,duration:e[l-1].endTime-i.startTime,active:e[l-1].active}),i=e[l]);i&&e.length>0&&o.push({startTime:i.startTime,endTime:e[e.length-1].endTime,duration:e[e.length-1].endTime-i.startTime,active:e[e.length-1].active}),i=o[0];for(let l=1;l<o.length;l++)(!o[l].active&&o[l].duration>this.config.inactiveThreshold*n.totalTime||!o[l-1].active&&o[l-1].duration>this.config.inactiveThreshold*n.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 e=this.service.state.context.events[0],n=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:n.timestamp,totalTime:n.timestamp-e.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:e,events:n}=this.service.state.context;return e-n[0].timestamp}getMirror(){return this.mirror}play(e=0){var n,r;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:e}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}})),(r=(n=this.iframe.contentDocument)==null?void 0:n.getElementsByTagName("html")[0])==null||r.classList.remove("rrweb-paused"),this.emitter.emit(M.Start),this.handleInactivity(this.getMetaData().startTime+e,!0)}pause(e){var n,r;e===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof e=="number"&&(this.play(e),this.service.send({type:"PAUSE"})),(r=(n=this.iframe.contentDocument)==null?void 0:n.getElementsByTagName("html")[0])==null||r.classList.add("rrweb-paused"),this.emitter.emit(M.Pause)}resume(e=0){console.warn("The 'resume' will be departed in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(M.Resume)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){const n=this.config.unpackFn?this.config.unpackFn(e):e;bt(n)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:n}}))}replaceEvents(e){for(const n of e)if(bt(n)){this.mouse.classList.add("touch-device");break}this.service.send({type:"REPLACE_EVENTS",payload:{events:e}})}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=b.createCache()}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 e=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&e.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(Do(this.iframe.contentWindow,this.iframe.contentDocument),ot(this.iframe.contentWindow))}handleResize(e){this.iframe.style.display="inherit";for(const n of[this.mouseTail,this.iframe])!n||(n.setAttribute("width",String(e.width)),n.setAttribute("height",String(e.height)))}applyEventsSynchronously(e){for(const n of e){switch(n.type){case E.DomContentLoaded:case E.Load:case E.Custom:continue;case E.FullSnapshot:case E.Meta:case E.Plugin:case E.IncrementalSnapshot:break}this.getCastFn(n,!0)()}this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null}getCastFn(e,n=!1){let r;switch(e.type){case E.DomContentLoaded:case E.Load:break;case E.Custom:r=()=>{this.emitter.emit(M.CustomEvent,e)};break;case E.Meta:r=()=>this.emitter.emit(M.Resize,{width:e.data.width,height:e.data.height});break;case E.FullSnapshot:r=()=>{if(this.firstFullSnapshot){if(this.firstFullSnapshot===e){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(e,n),this.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case E.IncrementalSnapshot:r=()=>{if(this.applyIncremental(e,n),!n&&(this.handleInactivity(e.timestamp),e===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const o of this.service.state.context.events)if(!(o.timestamp<=e.timestamp)&&this.isUserInteraction(o)){o.delay-e.delay>Gn*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=o);break}if(this.nextUserInteractionEvent){const o=this.nextUserInteractionEvent.delay-e.delay,i={speed:Math.min(Math.round(o/Un),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:i}),this.emitter.emit(M.SkipStart,i)}}};break}return()=>{r&&r();for(const i of this.config.plugins||[])i.handler(e,n,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:e}});const o=this.service.state.context.events.length-1;if(e===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(M.Finish))};e.type===E.IncrementalSnapshot&&e.data.source===w.MouseMove&&e.data.positions.length?setTimeout(()=>{i()},Math.max(0,-e.data.positions[0].timeOffset+50)):i()}this.emitter.emit(M.EventCast,e)}}handleInactivity(e,n){if((e===this.inactiveEndTimestamp||n)&&(this.inactiveEndTimestamp=null,this.backToNormal()),this.config.skipInactive&&!this.inactiveEndTimestamp){for(const r of this.getActivityIntervals())if(e>=r.startTime&&e<r.endTime&&!r.active){this.inactiveEndTimestamp=r.endTime;break}if(this.inactiveEndTimestamp){const r=this.inactiveEndTimestamp-e,o={speed:r/Bn*this.config.inactiveSkipTime<zn?r/zn:Math.round(Math.max(r,Bn)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:o}),this.emitter.emit(M.SkipStart,o)}}}rebuildFullSnapshot(e,n=!1){if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const r=[];b.rebuild(e.data.node,{doc:this.iframe.contentDocument,afterAppend:l=>{this.collectIframeAndAttachDocument(r,l)},cache:this.cache,mirror:this.mirror});for(const{mutationInQueue:l,builtNode:c}of r)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(M.FullsnapshotRebuilded,e),n||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,n){const r=jo(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&r.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,wn(o,this.virtualDom.unserializedId)),e.insertBefore(o,n);for(let i=0;i<r.length;i++)o.rules.push({cssText:r[i],type:ae.Insert,index:i})}else{const o=document.createElement("style");e.insertBefore(o,n);for(let i=0;i<r.length;i++)o.sheet.insertRule(r[i],i)}}attachDocumentToIframe(e,n){const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,o=[];b.buildNodeWithSN(e.node,{doc:n.contentDocument,mirror:r,hackCss:!0,skipChild:!1,afterAppend:i=>{this.collectIframeAndAttachDocument(o,i);const l=r.getMeta(i);if(l?.type===b.NodeType.Element&&l?.tagName.toUpperCase()==="HTML"){const{documentElement:c,head:a}=n.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(e,n){if(we(n,this.mirror)){const r=this.newDocumentQueue.find(o=>o.parentId===this.mirror.getId(n));r&&e.push({mutationInQueue:r,builtNode:n})}}waitForStylesheetLoad(){var e;const n=(e=this.iframe.contentDocument)==null?void 0:e.head;if(n){const r=new Set;let o,i=this.service.state;const l=()=>{i=this.service.state};this.emitter.on(M.Start,l),this.emitter.on(M.Pause,l);const c=()=>{this.emitter.off(M.Start,l),this.emitter.off(M.Pause,l)};n.querySelectorAll('link[rel="stylesheet"]').forEach(a=>{a.sheet||(r.add(a),a.addEventListener("load",()=>{r.delete(a),r.size===0&&o!==-1&&(i.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(M.LoadStylesheetEnd),o&&clearTimeout(o),c())}))}),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(M.LoadStylesheetStart),o=setTimeout(()=>{i.matches("playing")&&this.play(this.getCurrentTime()),o=-1,c()},this.config.loadTimeout))}}hasImageArg(e){for(const n of e)if(!(!n||typeof n!="object")){if("rr_type"in n&&"args"in n){if(this.hasImageArg(n.args))return!0}else if("rr_type"in n&&n.rr_type==="HTMLImageElement"||n instanceof Array&&this.hasImageArg(n))return!0}return!1}getImageArgs(e){const n=[];for(const r of e)!r||typeof r!="object"||("rr_type"in r&&"args"in r?n.push(...this.getImageArgs(r.args)):"rr_type"in r&&r.rr_type==="HTMLImageElement"?n.push(r.src):r instanceof Array&&n.push(...this.getImageArgs(r)));return n}preloadAllImages(){return vt(this,null,function*(){this.service.state;const e=()=>{this.service.state};this.emitter.on(M.Start,e),this.emitter.on(M.Pause,e);const n=[];for(const r of this.service.state.context.events)r.type===E.IncrementalSnapshot&&r.data.source===w.CanvasMutation&&(n.push(this.deserializeAndPreloadCanvasEvents(r.data,r)),("commands"in r.data?r.data.commands:[r.data]).forEach(o=>{this.preloadImages(o,r)}));return Promise.all(n)})}preloadImages(e,n){if(e.property==="drawImage"&&typeof e.args[0]=="string"&&!this.imageMap.has(n)){const r=document.createElement("canvas"),o=r.getContext("2d"),i=o?.createImageData(r.width,r.height);i?.data,JSON.parse(e.args[0]),o?.putImageData(i,0,0)}}deserializeAndPreloadCanvasEvents(e,n){return vt(this,null,function*(){if(!this.canvasEventMap.has(n)){const r={isUnchanged:!0};if("commands"in e){const o=yield Promise.all(e.commands.map(i=>vt(this,null,function*(){const l=yield Promise.all(i.args.map(fe(this.imageMap,null,r)));return ft(xe({},i),{args:l})})));r.isUnchanged===!1&&this.canvasEventMap.set(n,ft(xe({},e),{commands:o}))}else{const o=yield Promise.all(e.args.map(fe(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(n,ft(xe({},e),{args:o}))}}})}applyIncremental(e,n){var r,o,i,l,c,a;const{data:s}=e;switch(s.source){case w.Mutation:{try{this.applyMutation(s,n)}catch(u){this.warn(`Exception in mutation ${u.message||u}`,s)}break}case w.Drag:case w.TouchMove:case w.MouseMove:if(n){const u=s.positions[s.positions.length-1];this.mousePos={x:u.x,y:u.y,id:u.id,debugData:s}}else s.positions.forEach(u=>{const d={doAction:()=>{this.moveAndHover(u.x,u.y,u.id,n,s)},delay:u.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(d)}),this.timer.addAction({doAction(){},delay:e.delay-((r=s.positions[0])==null?void 0:r.timeOffset)});break;case w.MouseInteraction:{if(s.id===-1||n)break;const u=new Event(H[s.type].toLowerCase()),d=this.mirror.getNode(s.id);if(!d)return this.debugNodeNotFound(s,s.id);this.emitter.emit(M.MouseInteraction,{type:s.type,target:d});const{triggerFocus:h}=this.config;switch(s.type){case H.Blur:"blur"in d&&d.blur();break;case H.Focus:h&&d.focus&&d.focus({preventScroll:!0});break;case H.Click:case H.TouchStart:case H.TouchEnd:n?(s.type===H.TouchStart?this.touchActive=!0:s.type===H.TouchEnd&&(this.touchActive=!1),this.mousePos={x:s.x,y:s.y,id:s.id,debugData:s}):(s.type===H.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(s.x,s.y,s.id,n,s),s.type===H.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):s.type===H.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):s.type===H.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case H.TouchCancel:n?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:d.dispatchEvent(u)}break}case w.Scroll:{if(s.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);u.scrollData=s;break}this.applyScroll(s,n);break}case w.ViewportResize:this.emitter.emit(M.Resize,{width:s.width,height:s.height});break;case w.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 w.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===ye.Pause&&d.pause(),s.type===ye.Play&&d.play()}catch(h){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${h.message||h}`)}break}case w.StyleSheetRule:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.rules;(o=s.adds)==null||o.forEach(({rule:h,index:m})=>d?.push({cssText:h,index:m,type:ae.Insert})),(i=s.removes)==null||i.forEach(({index:h})=>d?.push({index:h,type:ae.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:h,index:m})=>{try{if(Array.isArray(m)){const{positions:f,index:v}=lt(m);Ce(d.cssRules,f).insertRule(h,v)}else{const f=m===void 0?void 0:Math.min(m,d.cssRules.length);d.insertRule(h,f)}}catch{}}),(c=s.removes)==null||c.forEach(({index:h})=>{try{if(Array.isArray(h)){const{positions:m,index:f}=lt(h);Ce(d.cssRules,m).deleteRule(f||0)}else d?.deleteRule(h)}catch{}})}break}case w.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(xe({type:ae.SetProperty,index:s.index},s.set)),s.remove&&d.push(xe({type:ae.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&&Ce(d.rules,s.index).style.setProperty(s.set.property,s.set.value,s.set.priority),s.remove&&Ce(d.rules,s.index).style.removeProperty(s.remove.property)}break}case w.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:e,mutation:s})}else{const u=this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);Vn({event:e,mutation:s,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case w.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(e,n){if(this.config.useVirtualDom&&!this.usingVirtualDom&&n&&(this.usingVirtualDom=!0,Ro(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=Sn(u.node,this.virtualDom,this.mirror);d&&(u.node=d)}catch(u){this.config.showWarning&&console.warn(u)}const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes.forEach(s=>{var u;const d=r.getNode(s.id);if(!d)return e.removes.find(m=>m.id===s.parentId)?void 0:this.warnNodeNotFound(e,s.id);let h=r.getNode(s.parentId);if(!h)return this.warnNodeNotFound(e,s.parentId);if(s.isShadow&&ke(h)&&(h=h.shadowRoot),r.removeNodeFromMap(d),h)try{h.removeChild(d),this.usingVirtualDom&&d.nodeName==="#text"&&h.nodeName==="STYLE"&&((u=h.rules)==null?void 0:u.length)>0&&(h.rules=[])}catch(m){if(m instanceof DOMException)this.warn("parent could not remove child in mutation",h,d,e);else throw m}});const o=xe({},this.legacy_missingNodeRetryMap),i=[],l=s=>{let u=null;return s.nextId&&(u=r.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=r.getNode(s.parentId);if(!d)return s.node.type===b.NodeType.Document?this.newDocumentQueue.push(s):i.push(s);s.node.isShadow&&(ke(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let h=null,m=null;if(s.previousId&&(h=r.getNode(s.previousId)),s.nextId&&(m=r.getNode(s.nextId)),l(s))return i.push(s);if(s.node.rootId&&!r.getNode(s.node.rootId))return;const f=s.node.rootId?r.getNode(s.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(we(d,r)){this.attachDocumentToIframe(s,d);return}const v=b.buildNodeWithSN(s.node,{doc:f,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache});if(s.previousId===-1||s.nextId===-1){o[s.node.id]={node:v,mutation:s};return}const g=r.getMeta(d);if(g&&g.type===b.NodeType.Element&&g.tagName==="textarea"&&s.node.type===b.NodeType.Text){const p=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);for(const y of p)y.nodeType===d.TEXT_NODE&&d.removeChild(y)}if(h&&h.nextSibling&&h.nextSibling.parentNode)d.insertBefore(v,h.nextSibling);else if(m&&m.parentNode)d.contains(m)?d.insertBefore(v,m):d.insertBefore(v,null);else{if(d===f)for(;f.firstChild;)f.removeChild(f.firstChild);d.appendChild(v)}if(this.usingVirtualDom&&v.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)==null?void 0:u.length)>0&&(d.rules=[]),we(v,this.mirror)){const p=this.mirror.getId(v),y=this.newDocumentQueue.find(N=>N.parentId===p);y&&(this.attachDocumentToIframe(y,v),this.newDocumentQueue=this.newDocumentQueue.filter(N=>N!==y))}(s.previousId||s.nextId)&&this.legacy_resolveMissingNode(o,d,v,s)};e.adds.forEach(s=>{c(s)});const a=Date.now();for(;i.length;){const s=Ft(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)r.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),_t(e.texts).forEach(s=>{var u;const d=r.getNode(s.id);if(!d)return e.removes.find(h=>h.id===s.id)?void 0:this.warnNodeNotFound(e,s.id);if(d.textContent=s.value,this.usingVirtualDom){const h=d.parentNode;((u=h?.rules)==null?void 0:u.length)>0&&(h.rules=[])}}),e.attributes.forEach(s=>{const u=r.getNode(s.id);if(!u)return e.removes.find(d=>d.id===s.id)?void 0:this.warnNodeNotFound(e,s.id);for(const d in s.attributes)if(typeof d=="string"){const h=s.attributes[d];if(h===null)u.removeAttribute(d);else if(typeof h=="string")try{u.setAttribute(d,h)}catch(m){this.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",m)}else if(d==="style"){const m=h,f=u;for(const v in m)if(m[v]===!1)f.style.removeProperty(v);else if(m[v]instanceof Array){const g=m[v];f.style.setProperty(v,g[0],g[1])}else{const g=m[v];f.style.setProperty(v,g)}}}})}applyScroll(e,n){const r=this.mirror.getNode(e.id);if(!r)return this.debugNodeNotFound(e,e.id);const o=this.mirror.getMeta(r);if(r===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:e.y,left:e.x,behavior:n?"auto":"smooth"});else if(o?.type===b.NodeType.Document)r.defaultView.scrollTo({top:e.y,left:e.x,behavior:n?"auto":"smooth"});else try{r.scrollTop=e.y,r.scrollLeft=e.x}catch{}}applyInput(e){const n=this.mirror.getNode(e.id);if(!n)return this.debugNodeNotFound(e,e.id);try{n.checked=e.isChecked,n.value=e.text}catch{}}legacy_resolveMissingNode(e,n,r,o){const{previousId:i,nextId:l}=o,c=i&&e[i],a=l&&e[l];if(c){const{node:s,mutation:u}=c;n.insertBefore(s,r),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,n,s,u)}if(a){const{node:s,mutation:u}=a;n.insertBefore(s,r.nextSibling),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,n,s,u)}}moveAndHover(e,n,r,o,i){const l=this.mirror.getNode(r);if(!l)return this.debugNodeNotFound(i,r);const c=at(l,this.iframe),a=e*c.absoluteScale+c.x,s=n*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(e){if(!this.mouseTail)return;const{lineCap:n,lineWidth:r,strokeStyle:o,duration:i}=this.config.mouseTail===!0?yt:Object.assign({},yt,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=r,c.lineCap=n,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(e),l(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(c=>c!==e),l()},i/this.speedService.state.context.timer.speed)}hoverElements(e){var n;(n=this.iframe.contentDocument)==null||n.querySelectorAll(".\\:hover").forEach(o=>{o.classList.remove(":hover")});let r=e;for(;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement}isUserInteraction(e){return e.type!==E.IncrementalSnapshot?!1:e.data.source>w.Mutation&&e.data.source<=w.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(M.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,n){this.warn(`Node with id '${n}' not found. `,e)}warnCanvasMutationFailed(e,n){this.warn("Has error on canvas update",n,"canvas mutation:",e)}debugNodeNotFound(e,n){this.debug(gt,`Node with id '${n}' not found. `,e)}warn(...e){!this.config.showWarning||console.warn(gt,...e)}debug(...e){!this.config.showDebug||console.log(gt,...e)}}const{addCustomEvent:oi}=Ne,{freezePage:ii}=Ne;var K=Uint8Array,ee=Uint16Array,$e=Uint32Array,Ke=new K([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]),Je=new K([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]),Nt=new K([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Yn=function(t,e){for(var n=new ee(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];for(var o=new $e(n[30]),r=1;r<30;++r)for(var i=n[r];i<n[r+1];++i)o[i]=i-n[r]<<5|r;return[n,o]},Hn=Yn(Ke,2),Xn=Hn[0],Tt=Hn[1];Xn[28]=258,Tt[258]=28;for(var Zn=Yn(Je,0),si=Zn[0],Kn=Zn[1],Et=new ee(32768),L=0;L<32768;++L){var ve=(L&43690)>>>1|(L&21845)<<1;ve=(ve&52428)>>>2|(ve&13107)<<2,ve=(ve&61680)>>>4|(ve&3855)<<4,Et[L]=((ve&65280)>>>8|(ve&255)<<8)>>>1}for(var de=function(t,e,n){for(var r=t.length,o=0,i=new ee(e);o<r;++o)++i[t[o]-1];var l=new ee(e);for(o=0;o<e;++o)l[o]=l[o-1]+i[o-1]<<1;var c;if(n){c=new ee(1<<e);var a=15-e;for(o=0;o<r;++o)if(t[o])for(var s=o<<4|t[o],u=e-t[o],d=l[t[o]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)c[Et[d]>>>a]=s}else for(c=new ee(r),o=0;o<r;++o)c[o]=Et[l[t[o]-1]++]>>>15-t[o];return c},ge=new K(288),L=0;L<144;++L)ge[L]=8;for(var L=144;L<256;++L)ge[L]=9;for(var L=256;L<280;++L)ge[L]=7;for(var L=280;L<288;++L)ge[L]=8;for(var Ve=new K(32),L=0;L<32;++L)Ve[L]=5;var ai=de(ge,9,0),li=de(ge,9,1),ci=de(Ve,5,0),ui=de(Ve,5,1),St=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},le=function(t,e,n){var r=e/8>>0;return(t[r]|t[r+1]<<8)>>>(e&7)&n},wt=function(t,e){var n=e/8>>0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>>(e&7)},Ct=function(t){return(t/8>>0)+(t&7&&1)},It=function(t,e,n){(e==null||e<0)&&(e=0),(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof ee?ee:t instanceof $e?$e:K)(n-e);return r.set(t.subarray(e,n)),r},di=function(t,e,n){var r=t.length,o=!e||n,i=!n||n.i;n||(n={}),e||(e=new K(r*3));var l=function(oe){var D=e.length;if(oe>D){var A=new K(Math.max(D*2,oe));A.set(e),e=A}},c=n.f||0,a=n.p||0,s=n.b||0,u=n.l,d=n.d,h=n.m,m=n.n,f=r*8;do{if(!u){n.f=c=le(t,a,1);var v=le(t,a+1,3);if(a+=3,v)if(v==1)u=li,d=ui,h=9,m=5;else if(v==2){var N=le(t,a,31)+257,I=le(t,a+10,15)+4,x=N+le(t,a+5,31)+1;a+=14;for(var R=new K(x),O=new K(19),T=0;T<I;++T)O[Nt[T]]=le(t,a+T*3,7);a+=I*3;var J=St(O),U=(1<<J)-1;if(!i&&a+x*(J+7)>f)break;for(var re=de(O,J,1),T=0;T<x;){var F=re[le(t,a,U)];a+=F&15;var g=F>>>4;if(g<16)R[T++]=g;else{var z=0,B=0;for(g==16?(B=3+le(t,a,3),a+=2,z=R[T-1]):g==17?(B=3+le(t,a,7),a+=3):g==18&&(B=11+le(t,a,127),a+=7);B--;)R[T++]=z}}var j=R.subarray(0,N),P=R.subarray(N);h=St(j),m=St(P),u=de(j,h,1),d=de(P,m,1)}else throw"invalid block type";else{var g=Ct(a)+4,p=t[g-4]|t[g-3]<<8,y=g+p;if(y>r){if(i)throw"unexpected EOF";break}o&&l(s+p),e.set(t.subarray(g,y),s),n.b=s+=p,n.p=a=y*8;continue}if(a>f)throw"unexpected EOF"}o&&l(s+131072);for(var C=(1<<h)-1,_=(1<<m)-1,X=h+m+18;i||a+X<f;){var z=u[wt(t,a)&C],q=z>>>4;if(a+=z&15,a>f)throw"unexpected EOF";if(!z)throw"invalid length/literal";if(q<256)e[s++]=q;else if(q==256){u=null;break}else{var Q=q-254;if(q>264){var T=q-257,S=Ke[T];Q=le(t,a,(1<<S)-1)+Xn[T],a+=S}var G=d[wt(t,a)&_],$=G>>>4;if(!G)throw"invalid distance";a+=G&15;var P=si[$];if($>3){var S=Je[$];P+=wt(t,a)&(1<<S)-1,a+=S}if(a>f)throw"unexpected EOF";o&&l(s+131072);for(var k=s+Q;s<k;s+=4)e[s]=e[s-P],e[s+1]=e[s+1-P],e[s+2]=e[s+2-P],e[s+3]=e[s+3-P];s=k}}n.l=u,n.p=a,n.b=s,u&&(c=1,n.m=h,n.d=d,n.n=m)}while(!c);return s==e.length?e:It(e,0,s)},me=function(t,e,n){n<<=e&7;var r=e/8>>0;t[r]|=n,t[r+1]|=n>>>8},We=function(t,e,n){n<<=e&7;var r=e/8>>0;t[r]|=n,t[r+1]|=n>>>8,t[r+2]|=n>>>16},Rt=function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var o=n.length,i=n.slice();if(!o)return[new K(0),0];if(o==1){var l=new K(n[0].s+1);return l[n[0].s]=1,[l,1]}n.sort(function(x,R){return x.f-R.f}),n.push({s:-1,f:25001});var c=n[0],a=n[1],s=0,u=1,d=2;for(n[0]={s:-1,f:c.f+a.f,l:c,r:a};u!=o-1;)c=n[n[s].f<n[d].f?s++:d++],a=n[s!=u&&n[s].f<n[d].f?s++:d++],n[u++]={s:-1,f:c.f+a.f,l:c,r:a};for(var h=i[0].s,r=1;r<o;++r)i[r].s>h&&(h=i[r].s);var m=new ee(h+1),f=Mt(n[u-1],m,0);if(f>e){var r=0,v=0,g=f-e,p=1<<g;for(i.sort(function(R,O){return m[O.s]-m[R.s]||R.f-O.f});r<o;++r){var y=i[r].s;if(m[y]>e)v+=p-(1<<f-m[y]),m[y]=e;else break}for(v>>>=g;v>0;){var N=i[r].s;m[N]<e?v-=1<<e-m[N]++-1:++r}for(;r>=0&&v;--r){var I=i[r].s;m[I]==e&&(--m[I],++v)}f=e}return[new K(m),f]},Mt=function(t,e,n){return t.s==-1?Math.max(Mt(t.l,e,n+1),Mt(t.r,e,n+1)):e[t.s]=n},Jn=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new ee(++e),r=0,o=t[0],i=1,l=function(a){n[r++]=a},c=1;c<=e;++c)if(t[c]==o&&c!=e)++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=t[c]}return[n.subarray(0,r),e]},je=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},Qe=function(t,e,n){var r=n.length,o=Ct(e+2);t[o]=r&255,t[o+1]=r>>>8,t[o+2]=t[o]^255,t[o+3]=t[o+1]^255;for(var i=0;i<r;++i)t[o+i+4]=n[i];return(o+4+r)*8},Qn=function(t,e,n,r,o,i,l,c,a,s,u){me(e,u++,n),++o[256];for(var d=Rt(o,15),h=d[0],m=d[1],f=Rt(i,15),v=f[0],g=f[1],p=Jn(h),y=p[0],N=p[1],I=Jn(v),x=I[0],R=I[1],O=new ee(19),T=0;T<y.length;++T)O[y[T]&31]++;for(var T=0;T<x.length;++T)O[x[T]&31]++;for(var J=Rt(O,7),U=J[0],re=J[1],F=19;F>4&&!U[Nt[F-1]];--F);var z=s+5<<3,B=je(o,ge)+je(i,Ve)+l,j=je(o,h)+je(i,v)+l+14+3*F+je(O,U)+(2*O[16]+3*O[17]+7*O[18]);if(z<=B&&z<=j)return Qe(e,u,t.subarray(a,a+s));var P,C,_,X;if(me(e,u,1+(j<B)),u+=2,j<B){P=de(h,m,0),C=h,_=de(v,g,0),X=v;var q=de(U,re,0);me(e,u,N-257),me(e,u+5,R-1),me(e,u+10,F-4),u+=14;for(var T=0;T<F;++T)me(e,u+3*T,U[Nt[T]]);u+=3*F;for(var Q=[y,x],S=0;S<2;++S)for(var G=Q[S],T=0;T<G.length;++T){var $=G[T]&31;me(e,u,q[$]),u+=U[$],$>15&&(me(e,u,G[T]>>>5&127),u+=G[T]>>>12)}}else P=ai,C=ge,_=ci,X=Ve;for(var T=0;T<c;++T)if(r[T]>255){var $=r[T]>>>18&31;We(e,u,P[$+257]),u+=C[$+257],$>7&&(me(e,u,r[T]>>>23&31),u+=Ke[$]);var k=r[T]&31;We(e,u,_[k]),u+=X[k],k>3&&(We(e,u,r[T]>>>5&8191),u+=Je[k])}else We(e,u,P[r[T]]),u+=C[r[T]];return We(e,u,P[256]),u+C[256]},hi=new $e([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),mi=new K(0),pi=function(t,e,n,r,o,i){var l=t.length,c=new K(r+l+5*(1+Math.floor(l/7e3))+o),a=c.subarray(r,c.length-o),s=0;if(!e||l<8)for(var u=0;u<=l;u+=65535){var d=u+65535;d<l?s=Qe(a,s,t.subarray(u,d)):(a[u]=i,s=Qe(a,s,t.subarray(u,l)))}else{for(var h=hi[e-1],m=h>>>13,f=h&8191,v=(1<<n)-1,g=new ee(32768),p=new ee(v+1),y=Math.ceil(n/3),N=2*y,I=function(At){return(t[At]^t[At+1]<<y^t[At+2]<<N)&v},x=new $e(25e3),R=new ee(288),O=new ee(32),T=0,J=0,u=0,U=0,re=0,F=0;u<l;++u){var z=I(u),B=u&32767,j=p[z];if(g[B]=j,p[z]=B,re<=u){var P=l-u;if((T>7e3||U>24576)&&P>423){s=Qn(t,a,0,x,R,O,J,U,F,u-F,s),U=T=J=0,F=u;for(var C=0;C<286;++C)R[C]=0;for(var C=0;C<30;++C)O[C]=0}var _=2,X=0,q=f,Q=B-j&32767;if(P>2&&z==I(u-Q))for(var S=Math.min(m,P)-1,G=Math.min(32767,u),$=Math.min(258,P);Q<=G&&--q&&B!=j;){if(t[u+_]==t[u+_-Q]){for(var k=0;k<$&&t[u+k]==t[u+k-Q];++k);if(k>_){if(_=k,X=Q,k>S)break;for(var oe=Math.min(Q,k-2),D=0,C=0;C<oe;++C){var A=u-Q+C+32768&32767,Ge=g[A],cr=A-Ge+32768&32767;cr>D&&(D=cr,j=A)}}}B=j,j=g[B],Q+=B-j+32768&32767}if(X){x[U++]=268435456|Tt[_]<<18|Kn[X];var ur=Tt[_]&31,dr=Kn[X]&31;J+=Ke[ur]+Je[dr],++R[257+ur],++O[dr],re=u+_,++T}else x[U++]=t[u],++R[t[u]]}}s=Qn(t,a,i,x,R,O,J,U,F,u-F,s),i||(s=Qe(a,s,mi))}return It(c,0,r+Ct(s)+o)},fi=function(){var t=1,e=0;return{p:function(n){for(var r=t,o=e,i=n.length,l=0;l!=i;){for(var c=Math.min(l+5552,i);l<c;++l)r+=n[l],o+=r;r%=65521,o%=65521}t=r,e=o},d:function(){return(t>>>8<<16|(e&255)<<8|e>>>8)+((t&255)<<23)*2}}},vi=function(t,e,n,r,o){return pi(t,e.level==null?6:e.level,e.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):12+e.mem,n,r,!o)},gi=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},yi=function(t,e){var n=e.level,r=n==0?0:n<6?1:n==9?3:2;t[0]=120,t[1]=r<<6|(r?32-2*r:1)},bi=function(t){if((t[0]&15)!=8||t[0]>>>4>7||(t[0]<<8|t[1])%31)throw"invalid zlib data";if(t[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function Ni(t,e){e===void 0&&(e={});var n=fi();n.p(t);var r=vi(t,e,2,4);return yi(r,e),gi(r,r.length-4,n.d()),r}function Ti(t,e){return di((bi(t),t.subarray(2,-4)),e)}function qn(t,e){var n=t.length;if(!e&&typeof TextEncoder<"u")return new TextEncoder().encode(t);for(var r=new K(t.length+(t.length>>>1)),o=0,i=function(s){r[o++]=s},l=0;l<n;++l){if(o+5>r.length){var c=new K(o+8+(n-l<<1));c.set(r),r=c}var a=t.charCodeAt(l);a<128||e?i(a):a<2048?(i(192|a>>>6),i(128|a&63)):a>55295&&a<57344?(a=65536+(a&1047552)|t.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 It(r,0,o)}function er(t,e){var n="";if(!e&&typeof TextDecoder<"u")return new TextDecoder().decode(t);for(var r=0;r<t.length;){var o=t[r++];o<128||e?n+=String.fromCharCode(o):o<224?n+=String.fromCharCode((o&31)<<6|t[r++]&63):o<240?n+=String.fromCharCode((o&15)<<12|(t[r++]&63)<<6|t[r++]&63):(o=((o&15)<<18|(t[r++]&63)<<12|(t[r++]&63)<<6|t[r++]&63)-65536,n+=String.fromCharCode(55296|o>>10,56320|o&1023))}return n}const xt="v1";var Ei=Object.defineProperty,Si=Object.defineProperties,wi=Object.getOwnPropertyDescriptors,tr=Object.getOwnPropertySymbols,Ci=Object.prototype.hasOwnProperty,Ii=Object.prototype.propertyIsEnumerable,nr=(t,e,n)=>e in t?Ei(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ri=(t,e)=>{for(var n in e||(e={}))Ci.call(e,n)&&nr(t,n,e[n]);if(tr)for(var n of tr(e))Ii.call(e,n)&&nr(t,n,e[n]);return t},Mi=(t,e)=>Si(t,wi(e));const xi=t=>{const e=Mi(Ri({},t),{v:xt});return er(Ni(qn(JSON.stringify(e))),!0)},Oi=t=>{if(typeof t!="string")return t;try{const e=JSON.parse(t);if(e.timestamp)return e}catch{}try{const e=JSON.parse(er(Ti(qn(t,!0))));if(e.v===xt)return e;throw new Error(`These events were packed with packer ${e.v} which is incompatible with current packer ${xt}.`)}catch(e){throw console.error(e),new Error("Unknown data format.")}};class Oe{constructor(e){this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){const e=this.lineNumber||"",n=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+n+")":this.fileName+":"+e+":"+n}}const Di=/(^|@)\S+:\d+/,rr=/^\s*at .*(\S+:\d+|\(native\))/m,ki=/^(eval@)?(\[native code])?$/,or={parse:function(t){if(!t)return[];if(typeof t.stacktrace<"u"||typeof t["opera#sourceloc"]<"u")return this.parseOpera(t);if(t.stack&&t.stack.match(rr))return this.parseV8OrIE(t);if(t.stack)return this.parseFFOrSafari(t);throw new Error("Cannot parse given Error object")},extractLocation:function(t){if(t.indexOf(":")===-1)return[t];const e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error(`Cannot parse given url: ${t}`);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE:function(t){return t.stack.split(`
18
+ `).filter(function(e){return!!e.match(rr)},this).map(function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let n=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const r=n.match(/ (\((.+):(\d+):(\d+)\)$)/);n=r?n.replace(r[0],""):n;const o=n.split(/\s+/).slice(1),i=this.extractLocation(r?r[1]:o.pop()),l=o.join(" ")||void 0,c=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new Oe({functionName:l,fileName:c,lineNumber:i[1],columnNumber:i[2]})},this)},parseFFOrSafari:function(t){return t.stack.split(`
19
+ `).filter(function(e){return!e.match(ki)},this).map(function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),e.indexOf("@")===-1&&e.indexOf(":")===-1)return new Oe({functionName:e});{const n=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(n),o=r&&r[1]?r[1]:void 0,i=this.extractLocation(e.replace(n,""));return new Oe({functionName:o,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}},this)},parseOpera:function(t){return!t.stacktrace||t.message.indexOf(`
20
+ `)>-1&&t.message.split(`
21
+ `).length>t.stacktrace.split(`
22
+ `).length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(t){const e=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split(`
23
+ `),r=[];for(let o=2,i=n.length;o<i;o+=2){const l=e.exec(n[o]);l&&r.push(new Oe({fileName:l[2],lineNumber:parseFloat(l[1])}))}return r},parseOpera10:function(t){const e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=t.stacktrace.split(`
24
+ `),r=[];for(let o=0,i=n.length;o<i;o+=2){const l=e.exec(n[o]);l&&r.push(new Oe({functionName:l[3]||void 0,fileName:l[2],lineNumber:parseFloat(l[1])}))}return r},parseOpera11:function(t){return t.stack.split(`
25
+ `).filter(function(e){return!!e.match(Di)&&!e.match(/^Error created at/)},this).map(function(e){const n=e.split("@"),r=this.extractLocation(n.pop()),o=(n.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Oe({functionName:o,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)}};function Ai(t){if(!t||!t.outerHTML)return"";let e="";for(;t.parentElement;){let n=t.localName;if(!n)break;n=n.toLowerCase();const r=t.parentElement,o=[];if(r.children&&r.children.length>0)for(let i=0;i<r.children.length;i++){const l=r.children[i];l.localName&&l.localName.toLowerCase&&l.localName.toLowerCase()===n&&o.push(l)}o.length>1&&(n+=":eq("+o.indexOf(t)+")"),e=n+(e?">"+e:""),t=r}return e}function Ot(t){return Object.prototype.toString.call(t)==="[object Object]"}function ir(t,e){if(e===0)return!0;const n=Object.keys(t);for(const r of n)if(Ot(t[r])&&ir(t[r],e-1))return!0;return!1}function Dt(t,e){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,e);const r=[],o=[];return JSON.stringify(t,function(c,a){if(r.length>0){const s=r.indexOf(this);~s?r.splice(s+1):r.push(this),~s?o.splice(s,1/0,c):o.push(c),~r.indexOf(a)&&(r[0]===a?a="[Circular ~]":a="[Circular ~."+o.slice(0,r.indexOf(a)).join(".")+"]")}else r.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]=Ai(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+`
26
+ End of stack for Error object`:a.name+": "+a.message}return a});function i(c){return!!(Ot(c)&&Object.keys(c).length>n.numOfKeysLimit||typeof c=="function"||Ot(c)&&ir(c,n.depthOfLimit))}function l(c){let a=c.toString();return n.stringLengthLimit&&a.length>n.stringLengthLimit&&(a=`${a.slice(0,n.stringLengthLimit)}...`),a}}const sr={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 Li(t,e,n){const r=n.logger;if(!r)return()=>{};let o;typeof r=="string"?o=e[r]:o=r;let i=0;const l=[];if(n.level.includes("error")&&window){const a=s=>{const{message:u,error:d}=s,h=or.parse(d).map(f=>f.toString()),m=[Dt(u,n.stringifyOptions)];t({level:"error",trace:h,payload:m})};window.addEventListener("error",a),l.push(()=>{window&&window.removeEventListener("error",a)})}for(const a of n.level)l.push(c(o,a));return()=>{l.forEach(a=>a())};function c(a,s){return a[s]?pe(a,s,u=>(...d)=>{u.apply(this,d);try{const h=or.parse(new Error).map(f=>f.toString()).splice(1),m=d.map(f=>Dt(f,n.stringifyOptions));i++,i<n.lengthThreshold?t({level:s,trace:h,payload:m}):i===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Dt("The number of log records reached the threshold.")]})}catch(h){u("rrweb logger error:",h,...d)}}):()=>{}}}const kt="rrweb/console@1",Pi=t=>({name:kt,observer:Li,options:t?Object.assign({},sr,t):sr}),qe="__rrweb_original__",Fi={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],replayLogger:void 0};class _i{constructor(e){this.config=Object.assign(Fi,e)}getConsoleLogger(){const e={};for(const n of this.config.level)n==="trace"?e[n]=r=>{(console.log[qe]?console.log[qe]:console.log)(...r.payload.map(o=>JSON.parse(o)),this.formatMessage(r))}:e[n]=r=>{(console[n][qe]?console[n][qe]:console[n])(...r.payload.map(o=>JSON.parse(o)),this.formatMessage(r))};return e}formatMessage(e){if(e.trace.length===0)return"";const n=`
27
+ at `;let r=n;return r+=e.trace.join(n),r}}const $i=t=>{const e=t?.replayLogger||new _i(t).getConsoleLogger();return{handler(n,r,o){let i=null;if(n.type===E.IncrementalSnapshot&&n.data.source===w.Log?i=n.data:n.type===E.Plugin&&n.data.plugin===kt&&(i=n.data.payload),i)try{typeof e[i.level]=="function"&&e[i.level](i)}catch(l){o.replayer.config.showWarning&&console.warn(l)}}}},ar={key:"_sid"},Vi="rrweb/sequential-id@1",Wi=t=>{const e=t?Object.assign({},ar,t):ar;let n=0;return{name:Vi,eventProcessor(r){return Object.assign(r,{[e.key]:++n}),r},options:e}},lr={key:"_sid",warnOnMissingId:!0},ji=t=>{const{key:e,warnOnMissingId:n}=t?Object.assign({},lr,t):lr;let r=1;return{handler(o){if(e in o){const i=o[e];i!==r?console.error(`[sequential-id-plugin]: expect to get an id with value "${r}", but got "${i}"`):r++}else n&&console.warn(`[sequential-id-plugin]: failed to get id in key: "${e}"`)}}};return V.EventType=E,V.IncrementalSource=w,V.MouseInteractions=H,V.PLUGIN_NAME=kt,V.Replayer=ri,V.ReplayerEvents=M,V.addCustomEvent=oi,V.freezePage=ii,V.getRecordConsolePlugin=Pi,V.getRecordSequentialIdPlugin=Wi,V.getReplayConsolePlugin=$i,V.getReplaySequentialIdPlugin=ji,V.pack=xi,V.record=Ne,V.unpack=Oi,V.utils=mr,Object.defineProperty(V,"__esModule",{value:!0}),V}({},rrwebSnapshot);
29
28
  //# sourceMappingURL=rrweb-all.min.js.map