@highlight-run/rrweb 2.0.1 → 2.0.6

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 (118) hide show
  1. package/dist/plugins/console-record.js +12 -655
  2. package/dist/plugins/console-record.min.js +12 -15
  3. package/dist/plugins/console-record.min.js.map +1 -1
  4. package/dist/plugins/console-replay.js +4 -293
  5. package/dist/plugins/console-replay.min.js +4 -15
  6. package/dist/plugins/console-replay.min.js.map +1 -1
  7. package/dist/plugins/sequential-id-record.js +1 -33
  8. package/dist/plugins/sequential-id-record.min.js +1 -1
  9. package/dist/plugins/sequential-id-record.min.js.map +1 -1
  10. package/dist/plugins/sequential-id-replay.js +1 -37
  11. package/dist/plugins/sequential-id-replay.min.js +1 -1
  12. package/dist/plugins/sequential-id-replay.min.js.map +1 -1
  13. package/dist/record/rrweb-record-pack.js +3 -747
  14. package/dist/record/rrweb-record-pack.min.js +3 -15
  15. package/dist/record/rrweb-record-pack.min.js.map +1 -1
  16. package/dist/record/rrweb-record.js +4 -3318
  17. package/dist/record/rrweb-record.min.js +4 -15
  18. package/dist/record/rrweb-record.min.js.map +1 -1
  19. package/dist/replay/rrweb-replay-unpack.css +1 -0
  20. package/dist/replay/rrweb-replay-unpack.js +5 -4614
  21. package/dist/replay/rrweb-replay-unpack.min.js +5 -17
  22. package/dist/replay/rrweb-replay-unpack.min.js.map +1 -1
  23. package/dist/replay/rrweb-replay.css +1 -0
  24. package/dist/replay/rrweb-replay.js +5 -4204
  25. package/dist/replay/rrweb-replay.min.js +5 -17
  26. package/dist/replay/rrweb-replay.min.js.map +1 -1
  27. package/dist/rrweb-all.css +1 -0
  28. package/dist/rrweb-all.js +16 -8696
  29. package/dist/rrweb-all.min.js +16 -17
  30. package/dist/rrweb-all.min.js.map +1 -1
  31. package/dist/rrweb.css +1 -0
  32. package/dist/rrweb.js +6 -7282
  33. package/dist/rrweb.min.js +6 -17
  34. package/dist/rrweb.min.js.map +1 -1
  35. package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__auto__createBase64WorkerFactory.js +12 -0
  36. package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__auto__isNodeJS.js +7 -0
  37. package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js +31 -0
  38. package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__node__WorkerClass.js +11 -0
  39. package/es/rrweb/_virtual/_rollup-plugin-web-worker-loader__helper__node__createBase64WorkerFactory.js +18 -0
  40. package/es/rrweb/_virtual/image-bitmap-data-url-worker.js +6 -0
  41. package/es/rrweb/all.css +1 -0
  42. package/es/rrweb/ext/mitt/dist/mitt.es.js +1 -1
  43. package/es/rrweb/ext/tslib/tslib.es6.js +38 -0
  44. package/es/rrweb/packages/rrdom/es/virtual-dom.js +1099 -0
  45. package/es/rrweb/packages/rrweb/src/index.js +6 -4
  46. package/es/rrweb/packages/rrweb/src/packer/base.js +1 -1
  47. package/es/rrweb/packages/rrweb/src/packer/pack.js +4 -5
  48. package/es/rrweb/packages/rrweb/src/packer/unpack.js +24 -24
  49. package/es/rrweb/packages/rrweb/src/plugins/console/record/error-stack-parser.js +175 -176
  50. package/es/rrweb/packages/rrweb/src/plugins/console/record/index.js +109 -128
  51. package/es/rrweb/packages/rrweb/src/plugins/console/record/stringify.js +125 -138
  52. package/es/rrweb/packages/rrweb/src/plugins/console/replay/index.js +88 -105
  53. package/es/rrweb/packages/rrweb/src/plugins/sequential-id/record/index.js +19 -20
  54. package/es/rrweb/packages/rrweb/src/plugins/sequential-id/replay/index.js +25 -25
  55. package/es/rrweb/packages/rrweb/src/record/iframe-manager.js +29 -30
  56. package/es/rrweb/packages/rrweb/src/record/index.js +348 -373
  57. package/es/rrweb/packages/rrweb/src/record/mutation.js +487 -528
  58. package/es/rrweb/packages/rrweb/src/record/observer.js +584 -659
  59. package/es/rrweb/packages/rrweb/src/record/observers/canvas/2d.js +44 -73
  60. package/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas-manager.js +166 -87
  61. package/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas.js +21 -26
  62. package/es/rrweb/packages/rrweb/src/record/observers/canvas/serialize-args.js +119 -112
  63. package/es/rrweb/packages/rrweb/src/record/observers/canvas/webgl.js +53 -72
  64. package/es/rrweb/packages/rrweb/src/record/shadow-dom-manager.js +38 -40
  65. package/es/rrweb/packages/rrweb/src/record/stylesheet-manager.js +31 -0
  66. package/es/rrweb/packages/rrweb/src/replay/canvas/2d.js +27 -23
  67. package/es/rrweb/packages/rrweb/src/replay/canvas/deserialize-args.js +67 -0
  68. package/es/rrweb/packages/rrweb/src/replay/canvas/index.js +37 -29
  69. package/es/rrweb/packages/rrweb/src/replay/canvas/webgl.js +58 -120
  70. package/es/rrweb/packages/rrweb/src/replay/index.js +1545 -1854
  71. package/es/rrweb/packages/rrweb/src/replay/machine.js +275 -315
  72. package/es/rrweb/packages/rrweb/src/replay/smoothscroll.js +216 -218
  73. package/es/rrweb/packages/rrweb/src/replay/styles/inject-style.js +7 -7
  74. package/es/rrweb/packages/rrweb/src/replay/timer.js +87 -91
  75. package/es/rrweb/packages/rrweb/src/types.js +72 -72
  76. package/es/rrweb/packages/rrweb/src/utils.js +312 -506
  77. package/es/rrweb/packages/rrweb-snapshot/es/rrweb-snapshot.js +190 -72
  78. package/lib/plugins/console-record.js +469 -627
  79. package/lib/plugins/console-replay.js +198 -268
  80. package/lib/plugins/sequential-id-record.js +19 -20
  81. package/lib/plugins/sequential-id-replay.js +25 -25
  82. package/lib/record/rrweb-record-pack.js +184 -139
  83. package/lib/record/rrweb-record.js +2467 -2425
  84. package/lib/replay/rrweb-replay-unpack.css +1 -0
  85. package/lib/replay/rrweb-replay-unpack.js +3798 -3344
  86. package/lib/replay/rrweb-replay.css +1 -0
  87. package/lib/replay/rrweb-replay.js +3743 -3289
  88. package/lib/rrweb-all.css +1 -0
  89. package/lib/rrweb-all.js +6721 -6249
  90. package/lib/rrweb.css +1 -0
  91. package/lib/rrweb.js +6151 -5632
  92. package/package.json +14 -13
  93. package/typings/packer/base.d.ts +1 -1
  94. package/typings/plugins/console/record/index.d.ts +1 -1
  95. package/typings/plugins/console/record/stringify.d.ts +1 -1
  96. package/typings/plugins/sequential-id/record/index.d.ts +1 -1
  97. package/typings/plugins/sequential-id/replay/index.d.ts +1 -1
  98. package/typings/record/iframe-manager.d.ts +3 -3
  99. package/typings/record/index.d.ts +1 -1
  100. package/typings/record/mutation.d.ts +2 -1
  101. package/typings/record/observers/canvas/2d.d.ts +2 -1
  102. package/typings/record/observers/canvas/canvas-manager.d.ts +5 -2
  103. package/typings/record/observers/canvas/canvas.d.ts +1 -1
  104. package/typings/record/observers/canvas/serialize-args.d.ts +5 -5
  105. package/typings/record/observers/canvas/webgl.d.ts +2 -1
  106. package/typings/record/shadow-dom-manager.d.ts +2 -1
  107. package/typings/record/stylesheet-manager.d.ts +12 -0
  108. package/typings/record/workers/image-bitmap-data-url-worker.d.ts +5 -0
  109. package/typings/replay/canvas/2d.d.ts +3 -3
  110. package/typings/replay/canvas/deserialize-args.d.ts +7 -0
  111. package/typings/replay/canvas/index.d.ts +4 -3
  112. package/typings/replay/canvas/webgl.d.ts +3 -5
  113. package/typings/replay/index.d.ts +7 -10
  114. package/typings/types.d.ts +45 -17
  115. package/typings/utils.d.ts +17 -44
  116. package/es/rrweb/packages/rrweb/ext/tslib/tslib.es6.js +0 -78
  117. package/es/rrweb/packages/rrweb/src/replay/virtual-styles.js +0 -121
  118. package/typings/replay/virtual-styles.d.ts +0 -43
@@ -1,5 +1,8 @@
1
- var rrweb=function(e){"use strict";
2
- /*! *****************************************************************************
1
+ var rrweb=function(q){"use strict";var j;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(j||(j={}));function er(e){return e.nodeType===e.ELEMENT_NODE}function We(e){var t,r=(t=e)===null||t===void 0?void 0:t.host;return Boolean(r&&r.shadowRoot&&r.shadowRoot===e)}var pt=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var r;if(!t)return-1;var n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var r=this,n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(function(o){return r.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function tr(){return new pt}function ft(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,o=e.value,i=e.maskInputFn,l=o||"";return(t[r.toLowerCase()]||t[n])&&(i?l=i(l):l="*".repeat(l.length)),l}var rr="__rrweb_original__";function $n(e){var t=e.getContext("2d");if(!t)return!0;for(var r=50,n=0;n<e.width;n+=r)for(var o=0;o<e.height;o+=r){var i=t.getImageData,l=rr in i?i[rr]:i,c=new Uint32Array(l.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer);if(c.some(function(a){return a!==0}))return!1}return!0}function nr(e){return e=e.replace(/[^ -~]+/g,""),e=e?.split(" ").map(function(t){return Math.random().toString(20).substr(2,t.length)}).join(" ")||"",e}var Wn=1,jn=new RegExp("[^a-z0-9-_:]"),je=-2;function Vn(){return Wn++}function Un(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return jn.test(t)?"div":t}function vt(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(Gn).join(""):null}catch{return null}}function Gn(e){var t=e.cssText;if(Bn(e))try{t=vt(e.styleSheet)||t}catch{}return t}function Bn(e){return"styleSheet"in e}function zn(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function Hn(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var xe,or,Yn=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Xn=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,Zn=/^(data:)([^,]*),(.*)/i;function Qe(e,t){return(e||"").replace(Yn,function(r,n,o,i,l,c){var a=o||l||c,s=n||i||"";if(!a)return r;if(!Xn.test(a)||Zn.test(a))return"url("+s+a+s+")";if(a[0]==="/")return"url("+s+(Hn(t)+a)+s+")";var u=t.split("/"),d=a.split("/");u.pop();for(var m=0,h=d;m<h.length;m++){var v=h[m];v!=="."&&(v===".."?u.pop():u.push(v))}return"url("+s+u.join("/")+s+")"})}var Kn=/^[^ \t\n\r\u000c]+/,qn=/^[, \t\n\r\u000c]+/;function Jn(e,t){if(t.trim()==="")return t;var r=0;function n(s){var u,d=s.exec(t.substring(r));return d?(u=d[0],r+=u.length,u):""}for(var o=[];n(qn),!(r>=t.length);){var i=n(Kn);if(i.slice(-1)===",")i=et(e,i.substring(0,i.length-1)),o.push(i);else{var l="";i=et(e,i);for(var c=!1;;){var a=t.charAt(r);if(a===""){o.push((i+l).trim());break}else if(c)a===")"&&(c=!1);else if(a===","){r+=1,o.push((i+l).trim());break}else a==="("&&(c=!0);l+=a,r+=1}}}return o.join(", ")}function et(e,t){if(!t||t.trim()==="")return t;var r=e.createElement("a");return r.href=t,r.href}function Qn(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function gt(){var e=document.createElement("a");return e.href="",e.href}function ir(e,t,r,n){return r==="src"||r==="href"&&n||r==="xlink:href"&&n&&n[0]!=="#"||r==="background"&&n&&(t==="table"||t==="td"||t==="th")?et(e,n):r==="srcset"&&n?Jn(e,n):r==="style"&&n?Qe(n,gt()):t==="object"&&r==="data"&&n?et(e,n):n}function eo(e,t,r){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var n=0;n<e.classList.length;n++){var o=e.classList[n];if(t.test(o))return!0}return r?e.matches(r):!1}function tt(e,t,r){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var n=0;n<e.classList.length;n++){var o=e.classList[n];if(t.test(o))return!0}return r&&e.matches(r)?!0:tt(e.parentNode,t,r)}return e.nodeType,e.TEXT_NODE,tt(e.parentNode,t,r)}function to(e,t,r){var n=e.contentWindow;if(n){var o=!1,i;try{i=n.document.readyState}catch{return}if(i!=="complete"){var l=setTimeout(function(){o||(t(),o=!0)},r);e.addEventListener("load",function(){clearTimeout(l),o=!0,t()});return}var c="about:blank";if(n.location.href!==c||e.src===c||e.src===""){setTimeout(t,0);return}e.addEventListener("load",t)}}function ro(e){return e.getAttribute("href")?e.sheet!==null:!0}function no(e,t,r){var n=!1,o;try{o=e.sheet}catch{return}if(!o){var i=setTimeout(function(){n||(t(),n=!0)},r);e.addEventListener("load",function(){clearTimeout(i),n=!0,t()})}}function oo(e,t){var r,n=t.doc,o=t.mirror,i=t.blockClass,l=t.blockSelector,c=t.maskTextClass,a=t.maskTextSelector,s=t.inlineStylesheet,u=t.maskInputOptions,d=u===void 0?{}:u,m=t.maskTextFn,h=t.maskInputFn,v=t.dataURLOptions,p=v===void 0?{}:v,w=t.inlineImages,f=t.recordCanvas,S=t.keepIframeSrcFn,T=t.enableStrictPrivacy,I;if(o.getMeta(n)){var R=o.getId(n);I=R===1?void 0:R}switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:j.Document,childNodes:[],compatMode:e.compatMode,rootId:I}:{type:j.Document,childNodes:[],rootId:I};case e.DOCUMENT_TYPE_NODE:return{type:j.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:I};case e.ELEMENT_NODE:for(var M=eo(e,i,l),C=Un(e),y={},H=e.attributes.length,G=0;G<H;G++){var K=e.attributes[G];y[K.name]=ir(n,C,K.name,K.value)}if(C==="link"&&s){var V=Array.from(n.styleSheets).find(function(he){return he.href===e.href}),U=null;V&&(U=vt(V)),U&&(delete y.rel,delete y.href,y._cssText=Qe(U,V.href))}if(C==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var U=vt(e.sheet);U&&(y._cssText=Qe(U,gt()))}if(C==="input"||C==="textarea"||C==="select"){var Y=e.value;y.type!=="radio"&&y.type!=="checkbox"&&y.type!=="submit"&&y.type!=="button"&&Y?y.value=ft({type:y.type,tagName:C,value:Y,maskInputOptions:d,maskInputFn:h}):e.checked&&(y.checked=e.checked)}if(C==="option"&&(e.selected&&!d.select?y.selected=!0:delete y.selected),C==="canvas"&&f){if(e.__context==="2d")$n(e)||(y.rr_dataURL=e.toDataURL(p.type,p.quality));else if(!("__context"in e)){var B=e.toDataURL(p.type,p.quality),L=document.createElement("canvas");L.width=e.width,L.height=e.height;var x=L.toDataURL(p.type,p.quality);B!==x&&(y.rr_dataURL=B)}}if(C==="img"&&w){xe||(xe=n.createElement("canvas"),or=xe.getContext("2d"));var D=e,b=D.crossOrigin;D.crossOrigin="anonymous";var g=function(){try{xe.width=D.naturalWidth,xe.height=D.naturalHeight,or.drawImage(D,0,0),y.rr_dataURL=xe.toDataURL(p.type,p.quality)}catch(he){console.warn("Cannot inline img src="+D.currentSrc+"! Error: "+he)}b?y.crossOrigin=b:D.removeAttribute("crossorigin")};D.complete&&D.naturalWidth!==0?g():D.onload=g}if((C==="audio"||C==="video")&&(y.rr_mediaState=e.paused?"paused":"played",y.rr_mediaCurrentTime=e.currentTime),e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop),M||C==="img"&&T){var N=e.getBoundingClientRect(),E=N.width,F=N.height;y={class:y.class,rr_width:E+"px",rr_height:F+"px"},M=!0}return C==="iframe"&&!S(y.src)&&(e.contentDocument||(y.rr_src=y.src),delete y.src),{type:j.Element,tagName:C,attributes:y,childNodes:[],isSVG:Qn(e)||void 0,needBlock:M,rootId:I};case e.TEXT_NODE:var P=e.parentNode&&e.parentNode.tagName,k=e.textContent,ee=P==="STYLE"?!0:void 0,_=P==="SCRIPT"?!0:void 0,W=!1;if(ee&&k){try{e.nextSibling||e.previousSibling||!((r=e.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(k=zn(e.parentNode.sheet))}catch(he){console.warn("Cannot get CSS styles from text's parentNode. Error: "+he,e)}k=Qe(k,gt()),W=!0}if(_?(k="SCRIPT_PLACEHOLDER",W=!0):P==="NOSCRIPT"&&(k="",W=!0),!ee&&!_&&tt(e,c,a)&&k&&(k=m?m(k):k.replace(/[\S]/g,"*")),T&&!W&&P){var de=new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]);!de.has(P)&&k&&(k=nr(k))}return{type:j.Text,textContent:k||"",isStyle:ee,rootId:I};case e.CDATA_SECTION_NODE:return{type:j.CDATA,textContent:"",rootId:I};case e.COMMENT_NODE:return{type:j.Comment,textContent:e.textContent||"",rootId:I};default:return!1}}function X(e){return e===void 0?"":e.toLowerCase()}function io(e,t){return!!(t.comment&&e.type===j.Comment||e.type===j.Element&&(t.script&&(e.tagName==="script"||e.tagName==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js"))||t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(X(e.attributes.name).match(/^msapplication-tile(image|color)$/)||X(e.attributes.name)==="application-name"||X(e.attributes.rel)==="icon"||X(e.attributes.rel)==="apple-touch-icon"||X(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&X(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(X(e.attributes.property).match(/^(og|twitter|fb):/)||X(e.attributes.name).match(/^(og|twitter):/)||X(e.attributes.name)==="pinterest")||t.headMetaRobots&&(X(e.attributes.name)==="robots"||X(e.attributes.name)==="googlebot"||X(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&(X(e.attributes.name)==="author"||X(e.attributes.name)==="generator"||X(e.attributes.name)==="framework"||X(e.attributes.name)==="publisher"||X(e.attributes.name)==="progid"||X(e.attributes.property).match(/^article:/)||X(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(X(e.attributes.name)==="google-site-verification"||X(e.attributes.name)==="yandex-verification"||X(e.attributes.name)==="csrf-token"||X(e.attributes.name)==="p:domain_verify"||X(e.attributes.name)==="verify-v1"||X(e.attributes.name)==="verification"||X(e.attributes.name)==="shopify-checkout-api-token"))))}function ke(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,i=t.blockSelector,l=t.maskTextClass,c=t.maskTextSelector,a=t.skipChild,s=a===void 0?!1:a,u=t.inlineStylesheet,d=u===void 0?!0:u,m=t.maskInputOptions,h=m===void 0?{}:m,v=t.maskTextFn,p=t.maskInputFn,w=t.slimDOMOptions,f=t.dataURLOptions,S=f===void 0?{}:f,T=t.inlineImages,I=T===void 0?!1:T,R=t.recordCanvas,M=R===void 0?!1:R,C=t.onSerialize,y=t.onIframeLoad,H=t.iframeLoadTimeout,G=H===void 0?5e3:H,K=t.onStylesheetLoad,V=t.stylesheetLoadTimeout,U=V===void 0?5e3:V,Y=t.keepIframeSrcFn,B=Y===void 0?function(){return!1}:Y,L=t.enableStrictPrivacy,x=t.preserveWhiteSpace,D=x===void 0?!0:x,b=oo(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:h,maskTextFn:v,maskInputFn:p,dataURLOptions:S,inlineImages:I,recordCanvas:M,keepIframeSrcFn:B,enableStrictPrivacy:L});if(!b)return console.warn(e,"not serialized"),null;var g;if(n.hasNode(e)?g=n.getId(e):io(b,w)||!D&&b.type===j.Text&&!b.isStyle&&!b.textContent.replace(/^\s+|\s+$/gm,"").length?g=je:g=Vn(),g===je)return null;var N=Object.assign(b,{id:g});n.add(e,N),C&&C(e);var E=!s;if(N.type===j.Element){if(E=E&&!N.needBlock,N.needBlock&&N.tagName==="img"){var F=e.cloneNode();F.src="",n.add(F,N)}delete N.needBlock,e.shadowRoot&&(N.isShadowHost=!0)}if((N.type===j.Document||N.type===j.Element)&&E){w.headWhitespace&&N.type===j.Element&&N.tagName==="head"&&(D=!1);for(var P={doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:s,inlineStylesheet:d,maskInputOptions:h,maskTextFn:v,maskInputFn:p,slimDOMOptions:w,dataURLOptions:S,inlineImages:I,recordCanvas:M,preserveWhiteSpace:D,onSerialize:C,onIframeLoad:y,iframeLoadTimeout:G,onStylesheetLoad:K,stylesheetLoadTimeout:U,keepIframeSrcFn:B,enableStrictPrivacy:L},k=0,ee=Array.from(e.childNodes);k<ee.length;k++){var _=ee[k],W=ke(_,P);W&&N.childNodes.push(W)}if(er(e)&&e.shadowRoot)for(var de=0,he=Array.from(e.shadowRoot.childNodes);de<he.length;de++){var _=he[de],W=ke(_,P);W&&(W.isShadow=!0,N.childNodes.push(W))}}return e.parentNode&&We(e.parentNode)&&(N.isShadow=!0),N.type===j.Element&&N.tagName==="iframe"&&to(e,function(){var ye=e.contentDocument;if(ye&&y){var Je=ke(ye,{doc:ye,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:h,maskTextFn:v,maskInputFn:p,slimDOMOptions:w,dataURLOptions:S,inlineImages:I,recordCanvas:M,preserveWhiteSpace:D,onSerialize:C,onIframeLoad:y,iframeLoadTimeout:G,keepIframeSrcFn:B,enableStrictPrivacy:L});Je&&y(e,Je)}},G),N.type===j.Element&&N.tagName==="link"&&N.attributes.rel==="stylesheet"&&(no(e,function(){if(K){var ye=ke(e,{doc:r,mirror:n,blockClass:o,blockSelector:i,maskTextClass:l,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:h,maskTextFn:v,maskInputFn:p,slimDOMOptions:w,dataURLOptions:S,inlineImages:I,recordCanvas:M,preserveWhiteSpace:D,onSerialize:C,onIframeLoad:y,onStylesheetLoad:K,iframeLoadTimeout:G,keepIframeSrcFn:B,enableStrictPrivacy:L});ye&&K(e,ye)}},U),ro(e)===!1)?null:N}function so(e,t){var r=t||{},n=r.mirror,o=n===void 0?new pt:n,i=r.blockClass,l=i===void 0?"highlight-block":i,c=r.blockSelector,a=c===void 0?null:c,s=r.maskTextClass,u=s===void 0?"highlight-mask":s,d=r.maskTextSelector,m=d===void 0?null:d,h=r.inlineStylesheet,v=h===void 0?!0:h,p=r.inlineImages,w=p===void 0?!1:p,f=r.recordCanvas,S=f===void 0?!1:f,T=r.maskAllInputs,I=T===void 0?!1:T,R=r.maskTextFn,M=r.maskInputFn,C=r.slimDOM,y=C===void 0?!1:C,H=r.dataURLOptions,G=r.preserveWhiteSpace,K=r.onSerialize,V=r.onIframeLoad,U=r.iframeLoadTimeout,Y=r.onStylesheetLoad,B=r.stylesheetLoadTimeout,L=r.keepIframeSrcFn,x=L===void 0?function(){return!1}:L,D=r.enableStrictPrivacy,b=D===void 0?!1:D,g=I===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:I===!1?{password:!0}:I,N=y===!0||y==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:y==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:y===!1?{}:y;return ke(e,{doc:e,mirror:o,blockClass:l,blockSelector:a,maskTextClass:u,maskTextSelector:m,skipChild:!1,inlineStylesheet:v,maskInputOptions:g,maskTextFn:R,maskInputFn:M,slimDOMOptions:N,dataURLOptions:H,inlineImages:w,recordCanvas:S,preserveWhiteSpace:G,onSerialize:K,onIframeLoad:V,iframeLoadTimeout:U,onStylesheetLoad:Y,stylesheetLoadTimeout:B,keepIframeSrcFn:x,enableStrictPrivacy:b})}var sr=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function ao(e,t){t===void 0&&(t={});var r=1,n=1;function o(b){var g=b.match(/\n/g);g&&(r+=g.length);var N=b.lastIndexOf(`
2
+ `);n=N===-1?n+b.length:b.length-N}function i(){var b={line:r,column:n};return function(g){return g.position=new l(b),v(),g}}var l=function(){function b(g){this.start=g,this.end={line:r,column:n},this.source=t.source}return b}();l.prototype.content=e;var c=[];function a(b){var g=new Error(t.source+":"+r+":"+n+": "+b);if(g.reason=b,g.filename=t.source,g.line=r,g.column=n,g.source=e,t.silent)c.push(g);else throw g}function s(){var b=m();return{type:"stylesheet",stylesheet:{source:t.source,rules:b,parsingErrors:c}}}function u(){return h(/^{\s*/)}function d(){return h(/^}/)}function m(){var b,g=[];for(v(),p(g);e.length&&e.charAt(0)!=="}"&&(b=x()||D());)b!==!1&&(g.push(b),p(g));return g}function h(b){var g=b.exec(e);if(g){var N=g[0];return o(N),e=e.slice(N.length),g}}function v(){h(/^\s*/)}function p(b){b===void 0&&(b=[]);for(var g;g=w();)g!==!1&&b.push(g),g=w();return b}function w(){var b=i();if(!(e.charAt(0)!=="/"||e.charAt(1)!=="*")){for(var g=2;e.charAt(g)!==""&&(e.charAt(g)!=="*"||e.charAt(g+1)!=="/");)++g;if(g+=2,e.charAt(g-1)==="")return a("End of comment missing");var N=e.slice(2,g-2);return n+=2,o(N),e=e.slice(g),n+=2,b({type:"comment",comment:N})}}function f(){var b=h(/^([^{]+)/);if(b)return fe(b[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(g){return g.replace(/,/g,"\u200C")}).split(/\s*(?![^(]*\)),\s*/).map(function(g){return g.replace(/\u200C/g,",")})}function S(){var b=i(),g=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(g){var N=fe(g[0]);if(!h(/^:\s*/))return a("property missing ':'");var E=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),F=b({type:"declaration",property:N.replace(sr,""),value:E?fe(E[0]).replace(sr,""):""});return h(/^[;\s]*/),F}}function T(){var b=[];if(!u())return a("missing '{'");p(b);for(var g;g=S();)g!==!1&&(b.push(g),p(b)),g=S();return d()?b:a("missing '}'")}function I(){for(var b,g=[],N=i();b=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)g.push(b[1]),h(/^,\s*/);if(g.length)return N({type:"keyframe",values:g,declarations:T()})}function R(){var b=i(),g=h(/^@([-\w]+)?keyframes\s*/);if(g){var N=g[1];if(g=h(/^([-\w]+)\s*/),!g)return a("@keyframes missing name");var E=g[1];if(!u())return a("@keyframes missing '{'");for(var F,P=p();F=I();)P.push(F),P=P.concat(p());return d()?b({type:"keyframes",name:E,vendor:N,keyframes:P}):a("@keyframes missing '}'")}}function M(){var b=i(),g=h(/^@supports *([^{]+)/);if(g){var N=fe(g[1]);if(!u())return a("@supports missing '{'");var E=p().concat(m());return d()?b({type:"supports",supports:N,rules:E}):a("@supports missing '}'")}}function C(){var b=i(),g=h(/^@host\s*/);if(g){if(!u())return a("@host missing '{'");var N=p().concat(m());return d()?b({type:"host",rules:N}):a("@host missing '}'")}}function y(){var b=i(),g=h(/^@media *([^{]+)/);if(g){var N=fe(g[1]);if(!u())return a("@media missing '{'");var E=p().concat(m());return d()?b({type:"media",media:N,rules:E}):a("@media missing '}'")}}function H(){var b=i(),g=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(g)return b({type:"custom-media",name:fe(g[1]),media:fe(g[2])})}function G(){var b=i(),g=h(/^@page */);if(g){var N=f()||[];if(!u())return a("@page missing '{'");for(var E=p(),F;F=S();)E.push(F),E=E.concat(p());return d()?b({type:"page",selectors:N,declarations:E}):a("@page missing '}'")}}function K(){var b=i(),g=h(/^@([-\w]+)?document *([^{]+)/);if(g){var N=fe(g[1]),E=fe(g[2]);if(!u())return a("@document missing '{'");var F=p().concat(m());return d()?b({type:"document",document:E,vendor:N,rules:F}):a("@document missing '}'")}}function V(){var b=i(),g=h(/^@font-face\s*/);if(g){if(!u())return a("@font-face missing '{'");for(var N=p(),E;E=S();)N.push(E),N=N.concat(p());return d()?b({type:"font-face",declarations:N}):a("@font-face missing '}'")}}var U=L("import"),Y=L("charset"),B=L("namespace");function L(b){var g=new RegExp("^@"+b+"\\s*([^;]+);");return function(){var N=i(),E=h(g);if(E){var F={type:b};return F[b]=E[1].trim(),N(F)}}}function x(){if(e[0]==="@")return R()||y()||H()||M()||U()||Y()||B()||K()||G()||C()||V()}function D(){var b=i(),g=f();return g?(p(),b({type:"rule",selectors:g,declarations:T()})):a("selector missing")}return yt(s())}function fe(e){return e?e.replace(/^\s+|\s+$/g,""):""}function yt(e,t){for(var r=e&&typeof e.type=="string",n=r?e:t,o=0,i=Object.keys(e);o<i.length;o++){var l=i[o],c=e[l];Array.isArray(c)?c.forEach(function(a){yt(a,n)}):c&&typeof c=="object"&&yt(c,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var ar={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function lo(e){var t=ar[e.tagName]?ar[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function co(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var lr=/([^\\]):hover/,uo=new RegExp(lr.source,"g");function cr(e,t){var r;if(!(!((r=window?.HIG_CONFIGURATION)===null||r===void 0)&&r.enableOnHoverClass))return e;var n=t?.stylesWithHoverClass.get(e);if(n)return n;var o=ao(e,{silent:!0});if(!o.stylesheet)return e;var i=[];if(o.stylesheet.rules.forEach(function(a){"selectors"in a&&(a.selectors||[]).forEach(function(s){lr.test(s)&&i.push(s)})}),i.length===0)return e;var l=new RegExp(i.filter(function(a,s){return i.indexOf(a)===s}).sort(function(a,s){return s.length-a.length}).map(function(a){return co(a)}).join("|"),"g"),c=e.replace(l,function(a){var s=a.replace(uo,"$1.\\:hover");return a+", "+s});return t?.stylesWithHoverClass.set(e,c),c}function ur(){var e=new Map;return{stylesWithHoverClass:e}}function ho(e,t){var r=t.doc,n=t.hackCss,o=t.cache;switch(e.type){case j.Document:return r.implementation.createDocument(null,"",null);case j.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case j.Element:var i=lo(e),l;e.isSVG?l=r.createElementNS("http://www.w3.org/2000/svg",i):l=r.createElement(i);var c=function(s){if(!e.attributes.hasOwnProperty(s))return"continue";var u=e.attributes[s];if(i==="option"&&s==="selected"&&u===!1)return"continue";if(u=typeof u=="boolean"||typeof u=="number"?"":u,s.startsWith("rr_")){if(i==="canvas"&&s==="rr_dataURL"){var d=document.createElement("img");d.src=u,d.onload=function(){var C=l.getContext("2d");C&&C.drawImage(d,0,0,d.width,d.height)}}else if(i==="img"&&s==="rr_dataURL"){var m=l;m.currentSrc.startsWith("data:")||(m.setAttribute("rrweb-original-src",e.attributes.src),m.src=u)}if(s==="rr_width")l.style.width=u;else if(s==="rr_height")l.style.height=u;else if(s==="rr_mediaCurrentTime")l.currentTime=e.attributes.rr_mediaCurrentTime;else if(s==="rr_mediaState")switch(u){case"played":l.play().catch(function(C){return console.warn("media playback error",C)});break;case"paused":l.pause();break}}else{var h=i==="textarea"&&s==="value",v=i==="style"&&s==="_cssText";if(v&&n&&(u=cr(u,o),typeof u=="string")){for(var p=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,w=void 0,f=[],S="https://replay-cors-proxy.highlightrun.workers.dev";(w=p.exec(u))!==null;)w.index===p.lastIndex&&p.lastIndex++,w.forEach(function(C,y){if(y===0){var H=C.slice(5,C.length-2);f.push({originalUrl:H,proxyUrl:H.replace(H,S+"?url="+H)})}});f.forEach(function(C){u=u.replace(C.originalUrl,C.proxyUrl)})}if(h||v){for(var T=r.createTextNode(u),I=0,R=Array.from(l.childNodes);I<R.length;I++){var M=R[I];M.nodeType===l.TEXT_NODE&&l.removeChild(M)}return l.appendChild(T),"continue"}try{if(e.isSVG&&s==="xlink:href")l.setAttributeNS("http://www.w3.org/1999/xlink",s,u);else if(s==="onload"||s==="onclick"||s.substring(0,7)==="onmouse")l.setAttribute("_"+s,u);else{if(i==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&s==="content")return l.setAttribute("csp-content",u),"continue";i==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||i==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")||(i==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?l.setAttribute("rrweb-original-srcset",e.attributes.srcset):l.setAttribute(s,u))}}catch{}}};for(var a in e.attributes)c(a);if(e.isShadowHost)if(!l.shadowRoot)l.attachShadow({mode:"open"});else for(;l.shadowRoot.firstChild;)l.shadowRoot.removeChild(l.shadowRoot.firstChild);return l;case j.Text:return r.createTextNode(e.isStyle&&n?cr(e.textContent,o):e.textContent);case j.CDATA:return r.createCDATASection(e.textContent);case j.Comment:return r.createComment(e.textContent);default:return null}}function rt(e,t){var r=t.doc,n=t.mirror,o=t.skipChild,i=o===void 0?!1:o,l=t.hackCss,c=l===void 0?!0:l,a=t.afterAppend,s=t.cache,u=ho(e,{doc:r,hackCss:c,cache:s});if(!u)return null;if(e.rootId&&console.assert(n.getNode(e.rootId)===r,"Target document should have the same root id."),e.type===j.Document&&(r.close(),r.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==j.DocumentType&&(e.childNodes[0].type===j.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),u=r),n.add(u,e),(e.type===j.Document||e.type===j.Element)&&!i)for(var d=0,m=e.childNodes;d<m.length;d++){var h=m[d],v=rt(h,{doc:r,mirror:n,skipChild:!1,hackCss:c,afterAppend:a,cache:s});if(!v){console.warn("Failed to rebuild",h);continue}h.isShadow&&er(u)&&u.shadowRoot?u.shadowRoot.appendChild(v):u.appendChild(v),a&&a(v)}return u}function mo(e,t){function r(l){t(l)}for(var n=0,o=e.getIds();n<o.length;n++){var i=o[n];e.has(i)&&r(e.getNode(i))}}function po(e,t){var r=t.getMeta(e);if(r?.type===j.Element){var n=e;for(var o in r.attributes)if(r.attributes.hasOwnProperty(o)&&o.startsWith("rr_")){var i=r.attributes[o];o==="rr_scrollLeft"&&(n.scrollLeft=i),o==="rr_scrollTop"&&(n.scrollTop=i)}}}function fo(e,t){var r=t.doc,n=t.onVisit,o=t.hackCss,i=o===void 0?!0:o,l=t.afterAppend,c=t.cache,a=t.mirror,s=a===void 0?new pt:a,u=rt(e,{doc:r,mirror:s,skipChild:!1,hackCss:i,afterAppend:l,cache:c});return mo(s,function(d){n&&n(d),po(d,s)}),u}function se(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const Oe=`Please stop import mirror directly. Instead of that,\r
3
+ now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
4
+ or you can use record.mirror to access the mirror instance during recording.`;q.mirror={map:{},getId(){return console.error(Oe),-1},getNode(){return console.error(Oe),null},removeNodeFromMap(){console.error(Oe)},has(){return console.error(Oe),!1},reset(){console.error(Oe)}},typeof window<"u"&&window.Proxy&&window.Reflect&&(q.mirror=new Proxy(q.mirror,{get(e,t,r){return t==="map"&&console.error(Oe),Reflect.get(e,t,r)}}));function De(e,t,r={}){let n=null,o=0;return function(i){const l=Date.now();!o&&r.leading===!1&&(o=l);const c=t-(l-o),a=this,s=arguments;c<=0||c>t?(n&&(clearTimeout(n),n=null),o=l,e.apply(a,s)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{o=r.leading===!1?0:Date.now(),n=null,e.apply(a,s)},c))}}function Ve(e,t,r,n,o=window){const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(l){setTimeout(()=>{r.set.call(this,l)},0),i&&i.set&&i.set.call(this,l)}}),()=>Ve(e,t,i||{},!0)}function be(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],o=r(n);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,()=>{e[t]=n}}catch{return()=>{}}}function bt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function wt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}const dr=e=>{try{if(e instanceof HTMLElement)return e.tagName==="CANVAS"}catch{return!1}return!1};function oe(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){let r=!1;if(typeof t=="string"){if(e.closest!==void 0)return e.closest("."+t)!==null;r=e.classList.contains(t)}else e.classList.forEach(n=>{t.test(n)&&(r=!0)});return r||oe(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,oe(e.parentNode,t)}function hr(e,t){return t.getId(e)!==-1}function nt(e,t){return t.getId(e)===je}function St(e,t){if(We(e))return!1;const r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?St(e.parentNode,t):!0:!0}function Nt(e){return Boolean(e.changedTouches)}function Tt(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(t){if(!(0 in arguments))throw new TypeError("1 argument is required");do if(this===t)return!0;while(t=t&&t.parentNode);return!1})}function mr(e){const t={},r=(o,i)=>{const l={value:o,parent:i,children:[]};return t[o.node.id]=l,l},n=[];for(const o of e){const{nextId:i,parentId:l}=o;if(i&&i in t){const c=t[i];if(c.parent){const a=c.parent.children.indexOf(c);c.parent.children.splice(a,0,r(o,c.parent))}else{const a=n.indexOf(c);n.splice(a,0,r(o,null))}continue}if(l in t){const c=t[l];c.children.push(r(o,c));continue}n.push(r(o,null))}return n}function Et(e,t){t(e.value);for(let r=e.children.length-1;r>=0;r--)Et(e.children[r],t)}function Re(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function pr(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Ct(e,t){var r,n;const o=(n=(r=e.ownerDocument)==null?void 0:r.defaultView)==null?void 0:n.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const i=o.getBoundingClientRect(),l=Ct(o,t),c=i.height/o.clientHeight;return{x:i.x*l.relativeScale+l.x,y:i.y*l.relativeScale+l.y,relativeScale:c,absoluteScale:l.absoluteScale*c}}function Ue(e){return Boolean(e?.shadowRoot)}function Le(e,t){const r=e[t[0]];return t.length===1?r:Le(r.cssRules[t[1]].cssRules,t.slice(2))}function It(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function fr(e){const t=new Set,r=[];for(let n=e.length;n--;){const o=e[n];t.has(o.id)||(r.push(o),t.add(o.id))}return r}var vo=Object.freeze({__proto__:null,on:se,get _mirror(){return q.mirror},throttle:De,hookSetter:Ve,patch:be,getWindowHeight:bt,getWindowWidth:wt,isCanvasNode:dr,isBlocked:oe,isSerialized:hr,isIgnored:nt,isAncestorRemoved:St,isTouchEvent:Nt,polyfill:Tt,queueToResolveTrees:mr,iterateResolveTree:Et,isSerializedIframe:Re,isSerializedStylesheet:pr,getBaseDimension:Ct,hasShadowRoot:Ue,getNestedRule:Le,getPositionsAndIndex:It,uniqueTextMutations:fr}),O=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(O||{}),A=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e))(A||{}),te=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(te||{}),ve=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ve||{}),Ee=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e))(Ee||{}),z=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e))(z||{});function vr(e){return"__ln"in e}class go{constructor(){this.length=0,this.head=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=r?.next||null;return r}addNode(t){const r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&vr(t.previousSibling)){const n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&vr(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;this.length++}removeNode(t){const r=t.__ln;!this.head||(r.previous?(r.previous.next=r.next,r.next&&(r.next.previous=r.previous)):(this.head=r.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}}const gr=(e,t)=>`${e}@${t}`;class yo{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],r=new go,n=c=>{let a=c,s=je;for(;s===je;)a=a&&a.nextSibling,s=a&&this.mirror.getId(a);return s},o=c=>{var a,s,u,d,m;const h=c.getRootNode?(a=c.getRootNode())==null?void 0:a.host:null;let v=h;for(;(u=(s=v?.getRootNode)==null?void 0:s.call(v))!=null&&u.host;)v=((m=(d=v?.getRootNode)==null?void 0:d.call(v))==null?void 0:m.host)||null;const p=!this.doc.contains(c)&&(!v||!this.doc.contains(v));if(!c.parentNode||p)return;const w=We(c.parentNode)?this.mirror.getId(h):this.mirror.getId(c.parentNode),f=n(c);if(w===-1||f===-1)return r.addNode(c);const S=ke(c,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,enableStrictPrivacy:this.enableStrictPrivacy,onSerialize:T=>{Re(T,this.mirror)&&this.iframeManager.addIframe(T),pr(T,this.mirror)&&this.stylesheetManager.addStylesheet(T),Ue(c)&&this.shadowDomManager.addShadowRoot(c.shadowRoot,document)},onIframeLoad:(T,I)=>{this.iframeManager.attachIframe(T,I,this.mirror),this.shadowDomManager.observeAttachShadow(T)},onStylesheetLoad:(T,I)=>{this.stylesheetManager.attachStylesheet(T,I,this.mirror)}});S&&t.push({parentId:w,nextId:f,node:S})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const c of Array.from(this.movedSet.values()))xt(this.removes,c,this.mirror)&&!this.movedSet.has(c.parentNode)||o(c);for(const c of Array.from(this.addedSet.values()))!kt(this.droppedSet,c)&&!xt(this.removes,c,this.mirror)||kt(this.movedSet,c)?o(c):this.droppedSet.add(c);let i=null;for(;r.length;){let c=null;if(i){const a=this.mirror.getId(i.value.parentNode),s=n(i.value);a!==-1&&s!==-1&&(c=i)}if(!c)for(let a=r.length-1;a>=0;a--){const s=r.get(a);if(s){const u=this.mirror.getId(s.value.parentNode),d=n(s.value);if(u!==-1&&d!==-1){c=s;break}}}if(!c){for(;r.head;)r.removeNode(r.head.value);break}i=c.previous,r.removeNode(c.value),o(c.value)}const l={texts:this.texts.map(c=>{let a=c.value;return this.enableStrictPrivacy&&a&&(a=nr(a)),{id:this.mirror.getId(c.node),value:a}}).filter(c=>this.mirror.has(c.id)),attributes:this.attributes.map(c=>({id:this.mirror.getId(c.node),attributes:c.attributes})).filter(c=>this.mirror.has(c.id)),removes:this.removes,adds:t};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(l))},this.processMutation=t=>{if(!nt(t.target,this.mirror))switch(t.type){case"characterData":{const r=t.target.textContent;!oe(t.target,this.blockClass)&&r!==t.oldValue&&this.texts.push({value:tt(t.target,this.maskTextClass,this.maskTextSelector)&&r?this.maskTextFn?this.maskTextFn(r):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let n=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(n=ft({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),oe(t.target,this.blockClass)||n===t.oldValue)return;let o=this.attributes.find(i=>i.node===t.target);if(o||(o={node:t.target,attributes:{}},this.attributes.push(o)),t.attributeName==="style"){const i=this.doc.createElement("span");t.oldValue&&i.setAttribute("style",t.oldValue),(o.attributes.style===void 0||o.attributes.style===null)&&(o.attributes.style={});const l=o.attributes.style;for(const c of Array.from(r.style)){const a=r.style.getPropertyValue(c),s=r.style.getPropertyPriority(c);(a!==i.style.getPropertyValue(c)||s!==i.style.getPropertyPriority(c))&&(s===""?l[c]=a:l[c]=[a,s])}for(const c of Array.from(i.style))r.style.getPropertyValue(c)===""&&(l[c]=!1)}else{if(t.target.tagName==="INPUT"){const i=t.target;if(i.type==="password"){o.attributes.value="*".repeat(i.value.length);break}}o.attributes[t.attributeName]=ir(this.doc,t.target.tagName,t.attributeName,n)}break}case"childList":{t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{const n=this.mirror.getId(r),o=We(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);oe(t.target,this.blockClass)||nt(r,this.mirror)||!hr(r,this.mirror)||(this.addedSet.has(r)?(Mt(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||St(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[gr(n,o)]?Mt(this.movedSet,r):this.removes.push({parentId:o,id:n,isShadow:We(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,r)=>{if(!(r&&oe(r,this.blockClass))){if(this.mirror.getMeta(t)){if(nt(t,this.mirror))return;this.movedSet.add(t);let n=null;r&&this.mirror.getMeta(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[gr(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);oe(t,this.blockClass)||t.childNodes.forEach(n=>this.genAdds(n))}}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","enableStrictPrivacy"].forEach(r=>{this[r]=t[r]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Mt(e,t){e.delete(t),t.childNodes.forEach(r=>Mt(e,r))}function xt(e,t,r){const{parentNode:n}=t;if(!n)return!1;const o=r.getId(n);return e.some(i=>i.id===o)?!0:xt(e,n,r)}function kt(e,t){const{parentNode:r}=t;return r?e.has(r)?!0:kt(e,r):!1}var bo=Object.defineProperty,wo=Object.defineProperties,So=Object.getOwnPropertyDescriptors,yr=Object.getOwnPropertySymbols,No=Object.prototype.hasOwnProperty,To=Object.prototype.propertyIsEnumerable,br=(e,t,r)=>t in e?bo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wr=(e,t)=>{for(var r in t||(t={}))No.call(t,r)&&br(e,r,t[r]);if(yr)for(var r of yr(t))To.call(t,r)&&br(e,r,t[r]);return e},Eo=(e,t)=>wo(e,So(t));const Ce=[],Sr=typeof CSSGroupingRule<"u",Nr=typeof CSSMediaRule<"u",Tr=typeof CSSSupportsRule<"u",Er=typeof CSSConditionRule<"u";function Ge(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch{return e.target}}function Cr(e,t){var r,n;const o=new yo;Ce.push(o),o.init(e);let i=window.MutationObserver||window.__rrMutationObserver;const l=(n=(r=window?.Zone)==null?void 0:r.__symbol__)==null?void 0:n.call(r,"MutationObserver");l&&window[l]&&(i=window[l]);const c=new i(o.processMutations.bind(o));return c.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),c}function Co({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let l=[],c;const a=De(d=>{const m=Date.now()-c;e(l.map(h=>(h.timeOffset-=m,h)),d),l=[],c=null},i),s=De(d=>{const m=Ge(d),{clientX:h,clientY:v}=Nt(d)?d.changedTouches[0]:d;c||(c=Date.now()),l.push({x:h,y:v,id:n.getId(m),timeOffset:Date.now()-c}),a(typeof DragEvent<"u"&&d instanceof DragEvent?A.Drag:d instanceof MouseEvent?A.MouseMove:A.TouchMove)},o,{trailing:!1}),u=[se("mousemove",s,r),se("touchmove",s,r),se("drag",s,r)];return()=>{u.forEach(d=>d())}}function Io({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const i=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,l=[],c=a=>s=>{const u=Ge(s);if(oe(u,n)||dr(u))return;const d=Nt(s)?s.changedTouches[0]:s;if(!d)return;const m=r.getId(u),{clientX:h,clientY:v}=d;e({type:te[a],id:m,x:h,y:v})};return Object.keys(te).filter(a=>Number.isNaN(Number(a))&&!a.endsWith("_Departed")&&i[a]!==!1).forEach(a=>{const s=a.toLowerCase(),u=c(a);l.push(se(s,u,t))}),()=>{l.forEach(a=>a())}}function Ir({scrollCb:e,doc:t,mirror:r,blockClass:n,sampling:o}){const i=De(l=>{const c=Ge(l);if(!c||oe(c,n))return;const a=r.getId(c);if(c===t){const s=t.scrollingElement||t.documentElement;e({id:a,x:s.scrollLeft,y:s.scrollTop})}else e({id:a,x:c.scrollLeft,y:c.scrollTop})},o.scroll||100);return se("scroll",i,t)}function Mo({viewportResizeCb:e}){let t=-1,r=-1;const n=De(()=>{const o=bt(),i=wt();(t!==o||r!==i)&&(e({width:Number(i),height:Number(o)}),t=o,r=i)},200);return se("resize",n,window)}function Mr(e,t){const r=wr({},e);return t||delete r.userTriggered,r}const xo=["INPUT","TEXTAREA","SELECT"],xr=new WeakMap;function ko({inputCb:e,doc:t,mirror:r,blockClass:n,ignoreClass:o,maskInputOptions:i,maskInputFn:l,sampling:c,userTriggeredOnInput:a}){function s(v){let p=Ge(v);const w=v.isTrusted;if(p&&p.tagName==="OPTION"&&(p=p.parentElement),!p||!p.tagName||xo.indexOf(p.tagName)<0||oe(p,n))return;const f=p.type;if(p.classList.contains(o))return;let S=p.value,T=!1;f==="radio"||f==="checkbox"?T=p.checked:(i[p.tagName.toLowerCase()]||i[f])&&(S=ft({maskInputOptions:i,tagName:p.tagName,type:f,value:S,maskInputFn:l})),u(p,Mr({text:S,isChecked:T,userTriggered:w},a));const I=p.name;f==="radio"&&I&&T&&t.querySelectorAll(`input[type="radio"][name="${I}"]`).forEach(R=>{R!==p&&u(R,Mr({text:R.value,isChecked:!T,userTriggered:!1},a))})}function u(v,p){const w=xr.get(v);if(!w||w.text!==p.text||w.isChecked!==p.isChecked){xr.set(v,p);const f=r.getId(v);e(Eo(wr({},p),{id:f}))}}const d=(c.input==="last"?["change"]:["input","change"]).map(v=>se(v,s,t)),m=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),h=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return m&&m.set&&d.push(...h.map(v=>Ve(v[0],v[1],{set(){s({target:this})}}))),()=>{d.forEach(v=>v())}}function ot(e){const t=[];function r(n,o){if(Sr&&n.parentRule instanceof CSSGroupingRule||Nr&&n.parentRule instanceof CSSMediaRule||Tr&&n.parentRule instanceof CSSSupportsRule||Er&&n.parentRule instanceof CSSConditionRule){const i=Array.from(n.parentRule.cssRules).indexOf(n);o.unshift(i)}else{const i=Array.from(n.parentStyleSheet.cssRules).indexOf(n);o.unshift(i)}return o}return r(e,t)}function Oo({styleSheetRuleCb:e,mirror:t},{win:r}){const n=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=function(c,a){const s=t.getId(this.ownerNode);return s!==-1&&e({id:s,adds:[{rule:c,index:a}]}),n.apply(this,arguments)};const o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=function(c){const a=t.getId(this.ownerNode);return a!==-1&&e({id:a,removes:[{index:c}]}),o.apply(this,arguments)};const i={};Sr?i.CSSGroupingRule=r.CSSGroupingRule:(Nr&&(i.CSSMediaRule=r.CSSMediaRule),Er&&(i.CSSConditionRule=r.CSSConditionRule),Tr&&(i.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(i).forEach(([c,a])=>{l[c]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=function(s,u){const d=t.getId(this.parentStyleSheet.ownerNode);return d!==-1&&e({id:d,adds:[{rule:s,index:[...ot(this),u||0]}]}),l[c].insertRule.apply(this,arguments)},a.prototype.deleteRule=function(s){const u=t.getId(this.parentStyleSheet.ownerNode);return u!==-1&&e({id:u,removes:[{index:[...ot(this),s]}]}),l[c].deleteRule.apply(this,arguments)}}),()=>{r.CSSStyleSheet.prototype.insertRule=n,r.CSSStyleSheet.prototype.deleteRule=o,Object.entries(i).forEach(([c,a])=>{a.prototype.insertRule=l[c].insertRule,a.prototype.deleteRule=l[c].deleteRule})}}function Do({styleDeclarationCb:e,mirror:t},{win:r}){const n=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=function(i,l,c){var a,s;const u=t.getId((s=(a=this.parentRule)==null?void 0:a.parentStyleSheet)==null?void 0:s.ownerNode);return u!==-1&&e({id:u,set:{property:i,value:l,priority:c},index:ot(this.parentRule)}),n.apply(this,arguments)};const o=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=function(i){var l,c;const a=t.getId((c=(l=this.parentRule)==null?void 0:l.parentStyleSheet)==null?void 0:c.ownerNode);return a!==-1&&e({id:a,remove:{property:i},index:ot(this.parentRule)}),o.apply(this,arguments)},()=>{r.CSSStyleDeclaration.prototype.setProperty=n,r.CSSStyleDeclaration.prototype.removeProperty=o}}function Ro({mediaInteractionCb:e,blockClass:t,mirror:r,sampling:n}){const o=l=>De(c=>{const a=Ge(c);if(!a||oe(a,t))return;const{currentTime:s,volume:u,muted:d}=a;e({type:l,id:r.getId(a),currentTime:s,volume:u,muted:d})},n.media||500),i=[se("play",o(Ee.Play)),se("pause",o(Ee.Pause)),se("seeked",o(Ee.Seeked)),se("volumechange",o(Ee.VolumeChange))];return()=>{i.forEach(l=>l())}}function Lo({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],o=new WeakMap,i=r.FontFace;r.FontFace=function(c,a,s){const u=new i(c,a,s);return o.set(u,{family:c,buffer:typeof a!="string",descriptors:s,fontSource:typeof a=="string"?a:JSON.stringify(Array.from(new Uint8Array(a)))}),u};const l=be(t.fonts,"add",function(c){return function(a){return setTimeout(()=>{const s=o.get(a);s&&(e(s),o.delete(a))},0),c.apply(this,[a])}});return n.push(()=>{r.FontFace=i}),n.push(l),()=>{n.forEach(c=>c())}}function Ao(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:l,inputCb:c,mediaInteractionCb:a,styleSheetRuleCb:s,styleDeclarationCb:u,canvasMutationCb:d,fontCb:m}=e;e.mutationCb=(...h)=>{t.mutation&&t.mutation(...h),r(...h)},e.mousemoveCb=(...h)=>{t.mousemove&&t.mousemove(...h),n(...h)},e.mouseInteractionCb=(...h)=>{t.mouseInteraction&&t.mouseInteraction(...h),o(...h)},e.scrollCb=(...h)=>{t.scroll&&t.scroll(...h),i(...h)},e.viewportResizeCb=(...h)=>{t.viewportResize&&t.viewportResize(...h),l(...h)},e.inputCb=(...h)=>{t.input&&t.input(...h),c(...h)},e.mediaInteractionCb=(...h)=>{t.mediaInteaction&&t.mediaInteaction(...h),a(...h)},e.styleSheetRuleCb=(...h)=>{t.styleSheetRule&&t.styleSheetRule(...h),s(...h)},e.styleDeclarationCb=(...h)=>{t.styleDeclaration&&t.styleDeclaration(...h),u(...h)},e.canvasMutationCb=(...h)=>{t.canvasMutation&&t.canvasMutation(...h),d(...h)},e.fontCb=(...h)=>{t.font&&t.font(...h),m(...h)}}function Fo(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};Ao(e,t);const n=Cr(e,e.doc),o=Co(e),i=Io(e),l=Ir(e),c=Mo(e),a=ko(e),s=Ro(e),u=Oo(e,{win:r}),d=Do(e,{win:r}),m=e.collectFonts?Lo(e):()=>{},h=[];for(const v of e.plugins)h.push(v.observer(v.callback,r,v.options));return()=>{Ce.forEach(v=>v.reset()),n.disconnect(),o(),i(),l(),c(),a(),s(),u(),d(),m(),h.forEach(v=>v())}}class Po{constructor(t){this.iframes=new WeakMap,this.mutationCb=t.mutationCb}addIframe(t){this.iframes.set(t,!0)}addLoadListener(t){this.loadListener=t}attachIframe(t,r,n){var o;this.mutationCb({adds:[{parentId:n.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(o=this.loadListener)==null||o.call(this,t)}}var _o=Object.defineProperty,$o=Object.defineProperties,Wo=Object.getOwnPropertyDescriptors,kr=Object.getOwnPropertySymbols,jo=Object.prototype.hasOwnProperty,Vo=Object.prototype.propertyIsEnumerable,Or=(e,t,r)=>t in e?_o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Dr=(e,t)=>{for(var r in t||(t={}))jo.call(t,r)&&Or(e,r,t[r]);if(kr)for(var r of kr(t))Vo.call(t,r)&&Or(e,r,t[r]);return e},Rr=(e,t)=>$o(e,Wo(t));class Uo{constructor(t){this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;const r=this;this.restorePatches.push(be(HTMLElement.prototype,"attachShadow",function(n){return function(){const o=n.apply(this,arguments);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,this.ownerDocument),o}}))}addShadowRoot(t,r){Cr(Rr(Dr({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),Ir(Rr(Dr({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}observeAttachShadow(t){if(t.contentWindow){const r=this;this.restorePatches.push(be(t.contentWindow.HTMLElement.prototype,"attachShadow",function(n){return function(){const o=n.apply(this,arguments);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,t.contentDocument),o}}))}}reset(){this.restorePatches.forEach(t=>t())}}for(var Ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Be=typeof Uint8Array>"u"?[]:new Uint8Array(256),it=0;it<Ae.length;it++)Be[Ae.charCodeAt(it)]=it;var Go=function(e){var t=new Uint8Array(e),r,n=t.length,o="";for(r=0;r<n;r+=3)o+=Ae[t[r]>>2],o+=Ae[(t[r]&3)<<4|t[r+1]>>4],o+=Ae[(t[r+1]&15)<<2|t[r+2]>>6],o+=Ae[t[r+2]&63];return n%3===2?o=o.substring(0,o.length-1)+"=":n%3===1&&(o=o.substring(0,o.length-2)+"=="),o},Bo=function(e){var t=e.length*.75,r=e.length,n,o=0,i,l,c,a;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var s=new ArrayBuffer(t),u=new Uint8Array(s);for(n=0;n<r;n+=4)i=Be[e.charCodeAt(n)],l=Be[e.charCodeAt(n+1)],c=Be[e.charCodeAt(n+2)],a=Be[e.charCodeAt(n+3)],u[o++]=i<<2|l>>4,u[o++]=(l&15)<<4|c>>2,u[o++]=(c&3)<<6|a&63;return s};const Lr=new Map;function zo(e,t){let r=Lr.get(e);return r||(r=new Map,Lr.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}const Ar=(e,t,r)=>{if(!e||!(Pr(e,t)||typeof e=="object"))return;const n=e.constructor.name,o=zo(r,n);let i=o.indexOf(e);return i===-1&&(i=o.length,o.push(e)),i};function st(e,t,r){if(e instanceof Array)return e.map(n=>st(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){const n=e.constructor.name,o=Go(e);return{rr_type:n,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[st(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const n=e.constructor.name,{src:o}=e;return{rr_type:n,src:o}}else if(e instanceof HTMLCanvasElement){const n="HTMLImageElement",o=e.toDataURL();return{rr_type:n,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[st(e.data,t,r),e.width,e.height]};if(Pr(e,t)||typeof e=="object"){const n=e.constructor.name,o=Ar(e,t,r);return{rr_type:n,index:o}}}}return e}const Fr=(e,t,r)=>[...e].map(n=>st(n,t,r)),Pr=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(n=>typeof t[n]=="function");return Boolean(r.find(n=>e instanceof t[n]))};function Ho(e,t,r,n){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const l of i)try{if(typeof t.CanvasRenderingContext2D.prototype[l]!="function")continue;const c=be(t.CanvasRenderingContext2D.prototype,l,function(a){return function(...s){return oe(this.canvas,r)||setTimeout(()=>{const u=Fr([...s],t,this);e(this.canvas,{type:ve["2D"],property:l,args:u})},0),a.apply(this,s)}});o.push(c)}catch{const a=Ve(t.CanvasRenderingContext2D.prototype,l,{set(s){e(this.canvas,{type:ve["2D"],property:l,args:[s],setter:!0})}});o.push(a)}return()=>{o.forEach(l=>l())}}function _r(e,t){const r=[];try{const n=be(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(i,...l){return oe(this,t)||"__context"in this||(this.__context=i),o.apply(this,[i,...l])}});r.push(n)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(n=>n())}}function $r(e,t,r,n,o,i){const l=[],c=Object.getOwnPropertyNames(e);for(const a of c)try{if(typeof e[a]!="function")continue;const s=be(e,a,function(u){return function(...d){const m=u.apply(this,d);if(Ar(m,i,e),!oe(this.canvas,n)){const h=o.getId(this.canvas),v=Fr([...d],i,e),p={type:t,property:a,args:v};r(this.canvas,p)}return m}});l.push(s)}catch{const u=Ve(e,a,{set(d){r(this.canvas,{type:t,property:a,args:[d],setter:!0})}});l.push(u)}return l}function Yo(e,t,r,n){const o=[];return o.push(...$r(t.WebGLRenderingContext.prototype,ve.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...$r(t.WebGL2RenderingContext.prototype,ve.WebGL2,e,r,n,t)),()=>{o.forEach(i=>i())}}function Xo(e,t){var r=atob(e);if(t){for(var n=new Uint8Array(r.length),o=0,i=r.length;o<i;++o)n[o]=r.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}function Zo(e,t,r){var n=t===void 0?null:t,o=r===void 0?!1:r,i=Xo(e,o),l=i.indexOf(`
5
+ `,10)+1,c=i.substring(l)+(n?"//# sourceMappingURL="+n:""),a=new Blob([c],{type:"application/javascript"});return URL.createObjectURL(a)}function Ko(e,t,r){var n;return function(i){return n=n||Zo(e,t,r),new Worker(n,i)}}var qo=Ko("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Zm9yKHZhciByPSJBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OSsvIixsPXR5cGVvZiBVaW50OEFycmF5PiJ1Ij9bXTpuZXcgVWludDhBcnJheSgyNTYpLGY9MDtmPHIubGVuZ3RoO2YrKylsW3IuY2hhckNvZGVBdChmKV09Zjt2YXIgZD1mdW5jdGlvbihzKXt2YXIgZT1uZXcgVWludDhBcnJheShzKSxuLGE9ZS5sZW5ndGgsdD0iIjtmb3Iobj0wO248YTtuKz0zKXQrPXJbZVtuXT4+Ml0sdCs9clsoZVtuXSYzKTw8NHxlW24rMV0+PjRdLHQrPXJbKGVbbisxXSYxNSk8PDJ8ZVtuKzJdPj42XSx0Kz1yW2VbbisyXSY2M107cmV0dXJuIGElMz09PTI/dD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTEpKyI9IjphJTM9PT0xJiYodD10LnN1YnN0cmluZygwLHQubGVuZ3RoLTIpKyI9PSIpLHR9O2NvbnN0IGM9bmV3IE1hcCx1PW5ldyBNYXA7YXN5bmMgZnVuY3Rpb24gcChzLGUpe2NvbnN0IG49YCR7c30tJHtlfWA7aWYodS5oYXMobikpcmV0dXJuIHUuZ2V0KG4pO2NvbnN0IGE9bmV3IE9mZnNjcmVlbkNhbnZhcyhzLGUpO2EuZ2V0Q29udGV4dCgiMmQiKTtjb25zdCB0PWF3YWl0KGF3YWl0IGEuY29udmVydFRvQmxvYigpKS5hcnJheUJ1ZmZlcigpLGc9ZCh0KTtyZXR1cm4gdS5zZXQobixnKSxnfWNvbnN0IGk9c2VsZjtpLm9ubWVzc2FnZT1hc3luYyBmdW5jdGlvbihzKXtpZighKCJPZmZzY3JlZW5DYW52YXMiaW4gZ2xvYmFsVGhpcykpcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOnMuZGF0YS5pZH0pO2NvbnN0e2lkOmUsYml0bWFwOm4sd2lkdGg6YSxoZWlnaHQ6dH09cy5kYXRhLGc9cChhLHQpLGg9bmV3IE9mZnNjcmVlbkNhbnZhcyhhLHQpO2guZ2V0Q29udGV4dCgiMmQiKS5kcmF3SW1hZ2UobiwwLDApLG4uY2xvc2UoKTtjb25zdCB3PWF3YWl0IGguY29udmVydFRvQmxvYigpLHk9dy50eXBlLGI9YXdhaXQgdy5hcnJheUJ1ZmZlcigpLG89ZChiKTtpZighYy5oYXMoZSkmJmF3YWl0IGc9PT1vKXJldHVybiBjLnNldChlLG8pLGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpZihjLmdldChlKT09PW8pcmV0dXJuIGkucG9zdE1lc3NhZ2Uoe2lkOmV9KTtpLnBvc3RNZXNzYWdlKHtpZDplLHR5cGU6eSxiYXNlNjQ6byx3aWR0aDphLGhlaWdodDp0fSksYy5zZXQoZSxvKX19KSgpOwoK",null,!1),Wr=Object.getOwnPropertySymbols,Jo=Object.prototype.hasOwnProperty,Qo=Object.prototype.propertyIsEnumerable,ei=(e,t)=>{var r={};for(var n in e)Jo.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Wr)for(var n of Wr(e))t.indexOf(n)<0&&Qo.call(e,n)&&(r[n]=e[n]);return r},ti=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});class ri{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(l,c){(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(c)};const{sampling:r="all",win:n,blockClass:o,recordCanvas:i}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,i&&r==="all"&&this.initCanvasMutationObserver(n,o),i&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,o)}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,n){const o=_r(r,n),i=new Map,l=new qo;l.onmessage=d=>{const{id:m}=d.data;if(i.set(m,!1),!("base64"in d.data))return;const{base64:h,type:v,width:p,height:w}=d.data;this.mutationCb({id:m,type:ve["2D"],commands:[{property:"clearRect",args:[0,0,p,w]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:h}],type:v}]},0,0]}]})};const c=1e3/t;let a=0,s;const u=d=>{if(a&&d-a<c){s=requestAnimationFrame(u);return}a=d,r.document.querySelectorAll(`canvas:not(.${n} *)`).forEach(m=>ti(this,null,function*(){var h;const v=this.mirror.getId(m);if(i.get(v))return;if(i.set(v,!0),["webgl","webgl2"].includes(m.__context)){const w=m.getContext(m.__context);((h=w?.getContextAttributes())==null?void 0:h.preserveDrawingBuffer)===!1&&w?.clear(w.COLOR_BUFFER_BIT)}const p=yield createImageBitmap(m);l.postMessage({id:v,bitmap:p,width:m.width,height:m.height},[p])})),s=requestAnimationFrame(u)};s=requestAnimationFrame(u),this.resetObservers=()=>{o(),cancelAnimationFrame(s)}}initCanvasMutationObserver(t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=_r(t,r),o=Ho(this.processMutation.bind(this),t,r,this.mirror),i=Yo(this.processMutation.bind(this),t,r,this.mirror);this.resetObservers=()=>{n(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;const o=n.map(l=>ei(l,["type"])),{type:i}=n[0];this.mutationCb({id:r,type:i,commands:o}),this.pendingCanvasMutations.delete(t)}}class ni{constructor(t){this.trackedStylesheets=new WeakSet,this.mutationCb=t.mutationCb}addStylesheet(t){this.trackedStylesheets.has(t)||(this.trackedStylesheets.add(t),this.trackStylesheet(t))}trackStylesheet(t){}attachStylesheet(t,r,n){this.mutationCb({adds:[{parentId:n.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[]}),this.addStylesheet(t)}}var oi=Object.defineProperty,ii=Object.defineProperties,si=Object.getOwnPropertyDescriptors,jr=Object.getOwnPropertySymbols,ai=Object.prototype.hasOwnProperty,li=Object.prototype.propertyIsEnumerable,Vr=(e,t,r)=>t in e?oi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ae=(e,t)=>{for(var r in t||(t={}))ai.call(t,r)&&Vr(e,r,t[r]);if(jr)for(var r of jr(t))li.call(t,r)&&Vr(e,r,t[r]);return e},ci=(e,t)=>ii(e,si(t));function re(e){return ci(ae({},e),{timestamp:Date.now()})}let Q,ze;const we=tr();function Ie(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="highlight-block",blockSelector:i=null,ignoreClass:l="highlight-ignore",maskTextClass:c="highlight-mask",maskTextSelector:a=null,inlineStylesheet:s=!0,maskAllInputs:u,maskInputOptions:d,slimDOMOptions:m,maskInputFn:h,maskTextFn:v,hooks:p,packFn:w,sampling:f={},mousemoveWait:S,recordCanvas:T=!1,userTriggeredOnInput:I=!1,collectFonts:R=!1,inlineImages:M=!1,plugins:C,keepIframeSrcFn:y=()=>!1,enableStrictPrivacy:H=!1}=e;if(!t)throw new Error("emit function is required");S!==void 0&&f.mousemove===void 0&&(f.mousemove=S),we.reset();const G=u===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:d!==void 0?d:{password:!0},K=m===!0||m==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:m==="all",headMetaDescKeywords:m==="all"}:m||{};Tt();let V,U=0;const Y=E=>{for(const F of C||[])F.eventProcessor&&(E=F.eventProcessor(E));return w&&(E=w(E)),E};Q=(E,F)=>{var P;if(((P=Ce[0])==null?void 0:P.isFrozen())&&E.type!==O.FullSnapshot&&!(E.type===O.IncrementalSnapshot&&E.data.source===A.Mutation)&&Ce.forEach(k=>k.unfreeze()),t(Y(E),F),E.type===O.FullSnapshot)V=E,U=0;else if(E.type===O.IncrementalSnapshot){if(E.data.source===A.Mutation&&E.data.isAttachIframe)return;U++;const k=n&&U>=n,ee=r&&E.timestamp-V.timestamp>r;(k||ee)&&ze(!0)}};const B=E=>{Q(re({type:O.IncrementalSnapshot,data:ae({source:A.Mutation},E)}))},L=E=>Q(re({type:O.IncrementalSnapshot,data:ae({source:A.Scroll},E)})),x=E=>Q(re({type:O.IncrementalSnapshot,data:ae({source:A.CanvasMutation},E)})),D=new Po({mutationCb:B}),b=new ni({mutationCb:B}),g=new ri({recordCanvas:T,mutationCb:x,win:window,blockClass:o,mirror:we,sampling:f.canvas}),N=new Uo({mutationCb:B,scrollCb:L,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:a,inlineStylesheet:s,maskInputOptions:G,maskTextFn:v,maskInputFn:h,recordCanvas:T,inlineImages:M,sampling:f,slimDOMOptions:K,iframeManager:D,stylesheetManager:b,canvasManager:g,enableStrictPrivacy:H},mirror:we});ze=(E=!1)=>{var F,P,k,ee;Q(re({type:O.Meta,data:{href:window.location.href,width:wt(),height:bt()}}),E),Ce.forEach(W=>W.lock());const _=so(document,{mirror:we,blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:a,inlineStylesheet:s,maskAllInputs:G,maskTextFn:v,slimDOM:K,recordCanvas:T,inlineImages:M,enableStrictPrivacy:H,onSerialize:W=>{Re(W,we)&&D.addIframe(W),Ue(W)&&N.addShadowRoot(W.shadowRoot,document)},onIframeLoad:(W,de)=>{D.attachIframe(W,de,we),N.observeAttachShadow(W)},onStylesheetLoad:(W,de)=>{this.stylesheetManager.attachStylesheet(W,de,this.mirror)},keepIframeSrcFn:y});if(!_)return console.warn("Failed to snapshot the document");Q(re({type:O.FullSnapshot,data:{node:_,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((P=(F=document?.body)==null?void 0:F.parentElement)==null?void 0:P.scrollLeft)||document?.body.scrollLeft||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((ee=(k=document?.body)==null?void 0:k.parentElement)==null?void 0:ee.scrollTop)||document?.body.scrollTop||0}}})),Ce.forEach(W=>W.unlock())};try{const E=[];E.push(se("DOMContentLoaded",()=>{Q(re({type:O.DomContentLoaded,data:{}}))}));const F=k=>{var ee;return Fo({mutationCb:B,mousemoveCb:(_,W)=>Q(re({type:O.IncrementalSnapshot,data:{source:W,positions:_}})),mouseInteractionCb:_=>Q(re({type:O.IncrementalSnapshot,data:ae({source:A.MouseInteraction},_)})),scrollCb:L,viewportResizeCb:_=>Q(re({type:O.IncrementalSnapshot,data:ae({source:A.ViewportResize},_)})),inputCb:_=>Q(re({type:O.IncrementalSnapshot,data:ae({source:A.Input},_)})),mediaInteractionCb:_=>Q(re({type:O.IncrementalSnapshot,data:ae({source:A.MediaInteraction},_)})),styleSheetRuleCb:_=>Q(re({type:O.IncrementalSnapshot,data:ae({source:A.StyleSheetRule},_)})),styleDeclarationCb:_=>Q(re({type:O.IncrementalSnapshot,data:ae({source:A.StyleDeclaration},_)})),canvasMutationCb:x,fontCb:_=>Q(re({type:O.IncrementalSnapshot,data:ae({source:A.Font},_)})),blockClass:o,ignoreClass:l,maskTextClass:c,maskTextSelector:a,maskInputOptions:G,inlineStylesheet:s,sampling:f,recordCanvas:T,inlineImages:M,userTriggeredOnInput:I,collectFonts:R,doc:k,maskInputFn:h,maskTextFn:v,blockSelector:i,slimDOMOptions:K,mirror:we,iframeManager:D,stylesheetManager:b,shadowDomManager:N,canvasManager:g,enableStrictPrivacy:H,plugins:((ee=C?.filter(_=>_.observer))==null?void 0:ee.map(_=>({observer:_.observer,options:_.options,callback:W=>Q(re({type:O.Plugin,data:{plugin:_.name,payload:W}}))})))||[]},p)};D.addLoadListener(k=>{E.push(F(k.contentDocument))});const P=()=>{ze(),E.push(F(document))};return document.readyState==="interactive"||document.readyState==="complete"?P():E.push(se("load",()=>{Q(re({type:O.Load,data:{}})),P()},window)),()=>{E.forEach(k=>k())}}catch(E){console.warn(E)}}Ie.addCustomEvent=(e,t)=>{!Q||Q(re({type:O.Custom,data:{tag:e,payload:t}}))},Ie.freezePage=()=>{Ce.forEach(e=>e.freeze())},Ie.takeFullSnapshot=e=>{if(!ze)throw new Error("please take full snapshot after start recording");ze(e)},Ie.mirror=we;var $;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})($||($={}));var ui=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var r;if(!t)return-1;var n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var r=this,n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(function(o){return r.removeNodeFromMap(o)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function di(){return new ui}function hi(e){const t={},r=/;(?![^(]*\))/g,n=/:(.+)/,o=/\/\*.*?\*\//g;return e.replace(o,"").split(r).forEach(function(i){if(i){const l=i.split(n);l.length>1&&(t[Ot(l[0].trim())]=l[1].trim())}}),t}function Ur(e){const t=[];for(const r in e){const n=e[r];if(typeof n!="string")continue;const o=vi(r);t.push(`${o}: ${n};`)}return t.join(" ")}const mi=/-([a-z])/g,pi=/^--[a-zA-Z0-9-]+$/,Ot=e=>pi.test(e)?e:e.replace(mi,(t,r)=>r?r.toUpperCase():""),fi=/\B([A-Z])/g,vi=e=>e.replace(fi,"-$1").toLowerCase();class le{constructor(...t){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=J.ELEMENT_NODE,this.TEXT_NODE=J.TEXT_NODE}get firstChild(){return this.childNodes[0]||null}get lastChild(){return this.childNodes[this.childNodes.length-1]||null}get nextSibling(){const t=this.parentNode;if(!t)return null;const r=t.childNodes,n=r.indexOf(this);return r[n+1]||null}contains(t){if(t===this)return!0;for(const r of this.childNodes)if(r.contains(t))return!0;return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,r){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function gi(e){return class _n extends e{constructor(){super(...arguments),this.nodeType=J.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=$.Document,this.textContent=null}get documentElement(){return this.childNodes.find(r=>r.RRNodeType===$.Element&&r.tagName==="HTML")||null}get body(){var r;return((r=this.documentElement)===null||r===void 0?void 0:r.childNodes.find(n=>n.RRNodeType===$.Element&&n.tagName==="BODY"))||null}get head(){var r;return((r=this.documentElement)===null||r===void 0?void 0:r.childNodes.find(n=>n.RRNodeType===$.Element&&n.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(r){const n=r.RRNodeType;if((n===$.Element||n===$.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===n))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${n===$.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);return r.parentElement=null,r.parentNode=this,this.childNodes.push(r),r}insertBefore(r,n){const o=r.RRNodeType;if((o===$.Element||o===$.DocumentType)&&this.childNodes.some(l=>l.RRNodeType===o))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${o===$.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);if(n===null)return this.appendChild(r);const i=this.childNodes.indexOf(n);if(i==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(i,0,r),r.parentElement=null,r.parentNode=this,r}removeChild(r){const n=this.childNodes.indexOf(r);if(n===-1)throw new Error("Failed to execute 'removeChild' on 'RRDocument': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(n,1),r.parentElement=null,r.parentNode=null,r}open(){this.childNodes=[]}close(){}write(r){let n;if(r==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?n="-//W3C//DTD XHTML 1.0 Transitional//EN":r==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(n="-//W3C//DTD HTML 4.0 Transitional//EN"),n){const o=this.createDocumentType("html",n,"");this.open(),this.appendChild(o)}}createDocument(r,n,o){return new _n}createDocumentType(r,n,o){const i=new(Gr(le))(r,n,o);return i.ownerDocument=this,i}createElement(r){const n=new(Br(le))(r);return n.ownerDocument=this,n}createElementNS(r,n){return this.createElement(n)}createTextNode(r){const n=new(zr(le))(r);return n.ownerDocument=this,n}createComment(r){const n=new(Hr(le))(r);return n.ownerDocument=this,n}createCDATASection(r){const n=new(Yr(le))(r);return n.ownerDocument=this,n}toString(){return"RRDocument"}}}function Gr(e){return class extends e{constructor(t,r,n){super(),this.nodeType=J.DOCUMENT_TYPE_NODE,this.RRNodeType=$.DocumentType,this.textContent=null,this.name=t,this.publicId=r,this.systemId=n,this.nodeName=t}toString(){return"RRDocumentType"}}}function Br(e){return class extends e{constructor(t){super(),this.nodeType=J.ELEMENT_NODE,this.RRNodeType=$.Element,this.attributes={},this.shadowRoot=null,this.tagName=t.toUpperCase(),this.nodeName=t.toUpperCase()}get textContent(){let t="";return this.childNodes.forEach(r=>t+=r.textContent),t}set textContent(t){this.childNodes=[this.ownerDocument.createTextNode(t)]}get classList(){return new bi(this.attributes.class,t=>{this.attributes.class=t})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const t=this.attributes.style?hi(this.attributes.style):{},r=/\B([A-Z])/g;return t.setProperty=(n,o,i)=>{if(r.test(n))return;const l=Ot(n);o?t[l]=o:delete t[l],i==="important"&&(t[l]+=" !important"),this.attributes.style=Ur(t)},t.removeProperty=n=>{if(r.test(n))return"";const o=Ot(n),i=t[o]||"";return delete t[o],this.attributes.style=Ur(t),i},t}getAttribute(t){return this.attributes[t]||null}setAttribute(t,r){this.attributes[t]=r}setAttributeNS(t,r,n){this.setAttribute(r,n)}removeAttribute(t){delete this.attributes[t]}appendChild(t){return this.childNodes.push(t),t.parentNode=this,t.parentElement=this,t}insertBefore(t,r){if(r===null)return this.appendChild(t);const n=this.childNodes.indexOf(r);if(n==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(n,0,t),t.parentElement=this,t.parentNode=this,t}removeChild(t){const r=this.childNodes.indexOf(t);if(r===-1)throw new Error("Failed to execute 'removeChild' on 'RRElement': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(r,1),t.parentElement=null,t.parentNode=null,t}attachShadow(t){const r=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=r,r}dispatchEvent(t){return!0}toString(){let t="";for(const r in this.attributes)t+=`${r}="${this.attributes[r]}" `;return`${this.tagName} ${t}`}}}function yi(e){return class extends e{attachShadow(t){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}}function zr(e){return class extends e{constructor(t){super(),this.nodeType=J.TEXT_NODE,this.nodeName="#text",this.RRNodeType=$.Text,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function Hr(e){return class extends e{constructor(t){super(),this.nodeType=J.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=$.Comment,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function Yr(e){return class extends e{constructor(t){super(),this.nodeName="#cdata-section",this.nodeType=J.CDATA_SECTION_NODE,this.RRNodeType=$.CDATA,this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}class bi{constructor(t,r){if(this.classes=[],this.add=(...n)=>{for(const o of n){const i=String(o);this.classes.indexOf(i)>=0||this.classes.push(i)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...n)=>{this.classes=this.classes.filter(o=>n.indexOf(o)===-1),this.onChange&&this.onChange(this.classes.join(" "))},t){const n=t.trim().split(/\s+/);this.classes.push(...n)}this.onChange=r}}var J;(function(e){e[e.PLACEHOLDER=0]="PLACEHOLDER",e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"})(J||(J={}));const Dt={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"};function me(e,t,r,n){const o=e.childNodes,i=t.childNodes;n=n||t.mirror||t.ownerDocument.mirror,(o.length>0||i.length>0)&&Xr(Array.from(o),i,e,r,n);let l=null,c=null;switch(t.RRNodeType){case $.Document:{c=t.scrollData;break}case $.Element:{const a=e,s=t;switch(wi(a,s,n),c=s.scrollData,l=s.inputData,s.tagName){case"AUDIO":case"VIDEO":{const u=e,d=s;d.paused!==void 0&&(d.paused?u.pause():u.play()),d.muted!==void 0&&(u.muted=d.muted),d.volume!==void 0&&(u.volume=d.volume),d.currentTime!==void 0&&(u.currentTime=d.currentTime);break}case"CANVAS":t.canvasMutations.forEach(u=>r.applyCanvas(u.event,u.mutation,e));break;case"STYLE":Si(a,t.rules);break}if(s.shadowRoot){a.shadowRoot||a.attachShadow({mode:"open"});const u=a.shadowRoot.childNodes,d=s.shadowRoot.childNodes;(u.length>0||d.length>0)&&Xr(Array.from(u),d,a.shadowRoot,r,n)}break}case $.Text:case $.Comment:case $.CDATA:e.textContent!==t.data&&(e.textContent=t.data);break}if(c&&r.applyScroll(c,!0),l&&r.applyInput(l),t.nodeName==="IFRAME"){const a=e.contentDocument,s=t;if(a){const u=n.getMeta(s.contentDocument);u&&r.mirror.add(a,Object.assign({},u)),me(a,s.contentDocument,r,n)}}}function wi(e,t,r){const n=e.attributes,o=t.attributes;for(const i in o){const l=o[i],c=r.getMeta(t);if(c&&"isSVG"in c&&c.isSVG&&Dt[i])e.setAttributeNS(Dt[i],i,l);else if(t.tagName==="CANVAS"&&i==="rr_dataURL"){const a=document.createElement("img");a.src=l,a.onload=()=>{const s=e.getContext("2d");s&&s.drawImage(a,0,0,a.width,a.height)}}else e.setAttribute(i,l)}for(const{name:i}of Array.from(n))i in o||e.removeAttribute(i);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function Xr(e,t,r,n,o){var i,l;let c=0,a=e.length-1,s=0,u=t.length-1,d=e[c],m=e[a],h=t[s],v=t[u],p,w;for(;c<=a&&s<=u;)if(d===void 0)d=e[++c];else if(m===void 0)m=e[--a];else if(n.mirror.getId(d)===o.getId(h))me(d,h,n,o),d=e[++c],h=t[++s];else if(n.mirror.getId(m)===o.getId(v))me(m,v,n,o),m=e[--a],v=t[--u];else if(n.mirror.getId(d)===o.getId(v))r.insertBefore(d,m.nextSibling),me(d,v,n,o),d=e[++c],v=t[--u];else if(n.mirror.getId(m)===o.getId(h))r.insertBefore(m,d),me(m,h,n,o),m=e[--a],h=t[++s];else{if(!p){p={};for(let f=c;f<=a;f++){const S=e[f];S&&n.mirror.hasNode(S)&&(p[n.mirror.getId(S)]=f)}}if(w=p[o.getId(h)],w){const f=e[w];r.insertBefore(f,d),me(f,h,n,o),e[w]=void 0}else{const f=Rt(h,n.mirror,o);((i=n.mirror.getMeta(r))===null||i===void 0?void 0:i.type)===$.Document&&((l=n.mirror.getMeta(f))===null||l===void 0?void 0:l.type)===$.Element&&r.documentElement&&(r.removeChild(r.documentElement),e[c]=void 0,d=void 0),r.insertBefore(f,d||null),me(f,h,n,o)}h=t[++s]}if(c>a){const f=t[u+1];let S=null;for(f&&r.childNodes.forEach(T=>{n.mirror.getId(T)===o.getId(f)&&(S=T)});s<=u;++s){const T=Rt(t[s],n.mirror,o);r.insertBefore(T,S),me(T,t[s],n,o)}}else if(s>u)for(;c<=a;c++){const f=e[c];f&&(r.removeChild(f),n.mirror.removeNodeFromMap(f))}}function Rt(e,t,r){let n=t.getNode(r.getId(e));const o=r.getMeta(e);if(n!==null)return n;switch(e.RRNodeType){case $.Document:n=new Document;break;case $.DocumentType:n=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case $.Element:{e.tagName.toLowerCase(),o&&"isSVG"in o&&o?.isSVG?n=document.createElementNS(Dt.svg,e.tagName.toLowerCase()):n=document.createElement(e.tagName);break}case $.Text:n=document.createTextNode(e.data);break;case $.Comment:n=document.createComment(e.data);break;case $.CDATA:n=document.createCDATASection(e.data);break}return o&&t.add(n,Object.assign({},o)),n}function He(e,t){const r=e[t[0]];return t.length===1?r:He(r.cssRules[t[1]].cssRules,t.slice(2))}var ce;(function(e){e[e.Insert=0]="Insert",e[e.Remove=1]="Remove",e[e.Snapshot=2]="Snapshot",e[e.SetProperty=3]="SetProperty",e[e.RemoveProperty=4]="RemoveProperty"})(ce||(ce={}));function Zr(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function Si(e,t){const r=e.sheet;t.forEach(n=>{if(n.type===ce.Insert)try{if(Array.isArray(n.index)){const{positions:o,index:i}=Zr(n.index);He(r.cssRules,o).insertRule(n.cssText,i)}else r.insertRule(n.cssText,n.index)}catch{}else if(n.type===ce.Remove)try{if(Array.isArray(n.index)){const{positions:o,index:i}=Zr(n.index);He(r.cssRules,o).deleteRule(i||0)}else r.deleteRule(n.index)}catch{}else n.type===ce.SetProperty?He(r.cssRules,n.index).style.setProperty(n.property,n.value,n.priority):n.type===ce.RemoveProperty&&He(r.cssRules,n.index).style.removeProperty(n.property)})}class Fe extends gi(le){constructor(t){super(),this._unserializedId=-1,this.mirror=Ri(),this.scrollData=null,t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,r,n){return new Fe}createDocumentType(t,r,n){const o=new Ni(t,r,n);return o.ownerDocument=this,o}createElement(t){const r=t.toUpperCase();let n;switch(r){case"AUDIO":case"VIDEO":n=new Ti(r);break;case"IFRAME":n=new Ii(r,this.mirror);break;case"CANVAS":n=new Ei(r);break;case"STYLE":n=new Ci(r);break;default:n=new Ye(r);break}return n.ownerDocument=this,n}createComment(t){const r=new xi(t);return r.ownerDocument=this,r}createCDATASection(t){const r=new ki(t);return r.ownerDocument=this,r}createTextNode(t){const r=new Mi(t);return r.ownerDocument=this,r}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=-1}}const Ni=Gr(le);class Ye extends Br(le){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}}class Ti extends yi(Ye){}class Ei extends Ye{constructor(){super(...arguments),this.canvasMutations=[]}getContext(){return null}}class Ci extends Ye{constructor(){super(...arguments),this.rules=[]}}class Ii extends Ye{constructor(t,r){super(t),this.contentDocument=new Fe,this.contentDocument.mirror=r}}const Mi=zr(le),xi=Hr(le),ki=Yr(le);function Oi(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function Kr(e,t,r,n){let o;switch(e.nodeType){case J.DOCUMENT_NODE:n&&n.nodeName==="IFRAME"?o=n.contentDocument:(o=t,o.compatMode=e.compatMode);break;case J.DOCUMENT_TYPE_NODE:const l=e;o=t.createDocumentType(l.name,l.publicId,l.systemId);break;case J.ELEMENT_NODE:const c=e,a=Oi(c);o=t.createElement(a);const s=o;for(const{name:u,value:d}of Array.from(c.attributes))s.attributes[u]=d;c.scrollLeft&&(s.scrollLeft=c.scrollLeft),c.scrollTop&&(s.scrollTop=c.scrollTop);break;case J.TEXT_NODE:o=t.createTextNode(e.textContent||"");break;case J.CDATA_SECTION_NODE:o=t.createCDATASection(e.data);break;case J.COMMENT_NODE:o=t.createComment(e.textContent||"");break;case J.DOCUMENT_FRAGMENT_NODE:o=n.attachShadow({mode:"open"});break;default:return null}let i=r.getMeta(e);return t instanceof Fe&&(i||(i=qr(o,t.unserializedId),r.add(e,i)),t.mirror.add(o,Object.assign({},i))),o}function Di(e,t=di(),r=new Fe){function n(o,i){const l=Kr(o,r,t,i);l!==null&&(i?.nodeName!=="IFRAME"&&o.nodeType!==J.DOCUMENT_FRAGMENT_NODE&&(i?.appendChild(l),l.parentNode=i,l.parentElement=i),o.nodeName==="IFRAME"?n(o.contentDocument,l):(o.nodeType===J.DOCUMENT_NODE||o.nodeType===J.ELEMENT_NODE||o.nodeType===J.DOCUMENT_FRAGMENT_NODE)&&(o.nodeType===J.ELEMENT_NODE&&o.shadowRoot&&n(o.shadowRoot,l),o.childNodes.forEach(c=>n(c,l))))}return n(e,null),r}function Ri(){return new Li}class Li{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){var r;if(!t)return-1;const n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){const n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function qr(e,t){switch(e.RRNodeType){case $.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case $.DocumentType:const r=e;return{id:t,type:e.RRNodeType,name:r.name,publicId:r.publicId,systemId:r.systemId};case $.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case $.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case $.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case $.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}function Jr(e){return e=e||Object.create(null),{on:function(r,n){(e[r]||(e[r]=[])).push(n)},off:function(r,n){e[r]&&e[r].splice(e[r].indexOf(n)>>>0,1)},emit:function(r,n){(e[r]||[]).slice().map(function(o){o(n)}),(e["*"]||[]).slice().map(function(o){o(r,n)})}}}var Ai=Object.freeze({__proto__:null,default:Jr});function Fi(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;const r=e.HTMLElement||e.Element,n=468,o={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||a,scrollIntoView:r.prototype.scrollIntoView},i=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function l(f){const S=["MSIE ","Trident/","Edge/"];return new RegExp(S.join("|")).test(f)}const c=l(e.navigator.userAgent)?1:0;function a(f,S){this.scrollLeft=f,this.scrollTop=S}function s(f){return .5*(1-Math.cos(Math.PI*f))}function u(f){if(f===null||typeof f!="object"||f.behavior===void 0||f.behavior==="auto"||f.behavior==="instant")return!0;if(typeof f=="object"&&f.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+f.behavior+" is not a valid value for enumeration ScrollBehavior.")}function d(f,S){if(S==="Y")return f.clientHeight+c<f.scrollHeight;if(S==="X")return f.clientWidth+c<f.scrollWidth}function m(f,S){const T=e.getComputedStyle(f,null)["overflow"+S];return T==="auto"||T==="scroll"}function h(f){const S=d(f,"Y")&&m(f,"Y"),T=d(f,"X")&&m(f,"X");return S||T}function v(f){for(;f!==t.body&&h(f)===!1;)f=f.parentNode||f.host;return f}function p(f){const S=i();let T,I,R,M=(S-f.startTime)/n;M=M>1?1:M,T=s(M),I=f.startX+(f.x-f.startX)*T,R=f.startY+(f.y-f.startY)*T,f.method.call(f.scrollable,I,R),(I!==f.x||R!==f.y)&&e.requestAnimationFrame(p.bind(e,f))}function w(f,S,T){let I,R,M,C;const y=i();f===t.body?(I=e,R=e.scrollX||e.pageXOffset,M=e.scrollY||e.pageYOffset,C=o.scroll):(I=f,R=f.scrollLeft,M=f.scrollTop,C=a),p({scrollable:I,method:C,startTime:y,startX:R,startY:M,x:S,y:T})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset);return}w.call(e,t.body,arguments[0].left!==void 0?~~arguments[0].left:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:e.scrollY||e.pageYOffset)}},e.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])){o.scrollBy.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}w.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset))}},r.prototype.scroll=r.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(u(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const f=arguments[0].left,S=arguments[0].top;w.call(this,this,typeof f>"u"?this.scrollLeft:~~f,typeof S>"u"?this.scrollTop:~~S)},r.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){o.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},r.prototype.scrollIntoView=function(){if(u(arguments[0])===!0){o.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const f=v(this),S=f.getBoundingClientRect(),T=this.getBoundingClientRect();f!==t.body?(w.call(this,f,f.scrollLeft+T.left-S.left,f.scrollTop+T.top-S.top),e.getComputedStyle(f).position!=="fixed"&&e.scrollBy({left:S.left,top:S.top,behavior:"smooth"})):e.scrollBy({left:T.left,top:T.top,behavior:"smooth"})}}class Pi{constructor(t=[],r){this.timeOffset=0,this.raf=null,this.actions=t,this.speed=r}addAction(t){const r=this.findActionIndex(t);this.actions.splice(r,0,t)}addActions(t){this.actions=this.actions.concat(t)}replaceActions(t){this.actions.length=0,this.actions.splice(0,0,...t)}start(){this.timeOffset=0;let t=performance.now();const{actions:r}=this,n=this;function o(){const i=performance.now();for(n.timeOffset+=(i-t)*n.speed,t=i;r.length;){const l=r[0];if(n.timeOffset>=l.delay)r.shift(),l.doAction();else break}(r.length>0||n.liveMode)&&(n.raf=requestAnimationFrame(o))}this.raf=requestAnimationFrame(o)}clear(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(t){this.speed=t}toggleLiveMode(t){this.liveMode=t}isActive(){return this.raf!==null}findActionIndex(t){let r=0,n=this.actions.length-1;for(;r<=n;){const o=Math.floor((r+n)/2);if(this.actions[o].delay<t.delay)r=o+1;else if(this.actions[o].delay>t.delay)n=o-1;else return o+1}return r}}function Lt(e,t){if(e.type===O.IncrementalSnapshot&&e.data.source===A.MouseMove){const r=e.data.positions[0].timeOffset,n=e.timestamp+r;return e.delay=n-t,n-t}return e.delay=e.timestamp-t,e.delay}/*! *****************************************************************************
3
6
  Copyright (c) Microsoft Corporation.
4
7
 
5
8
  Permission to use, copy, modify, and/or distribute this software for any
@@ -12,19 +15,15 @@ var rrweb=function(e){"use strict";
12
15
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
16
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
17
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */var t,r=function(){return(r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function n(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function i(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function a(e){return e.nodeType===e.ELEMENT_NODE}function s(e){var t,r=null===(t=e)||void 0===t?void 0:t.host;return Boolean(r&&r.shadowRoot&&r.shadowRoot===e)}function l(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,o=e.value,i=e.maskInputFn,a=o||"";return(t[r.toLowerCase()]||t[n])&&(a=i?i(a):"*".repeat(a.length)),a}!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"}(t||(t={}));var c="__rrweb_original__";function u(e){return e=(null==(e=e.replace(/[^ -~]+/g,""))?void 0:e.split(" ").map((function(e){return Math.random().toString(20).substr(2,e.length)})).join(" "))||""}var d,f,p=1,h=new RegExp("[^a-z0-9-_:]");function m(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(v).join(""):null}catch(e){return null}}function v(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=m(e.styleSheet)||t}catch(e){}return t}var y=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,g=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,b=/^(data:)([^,]*),(.*)/i;function S(e,t){return(e||"").replace(y,(function(e,r,n,o,i,a){var s,l=n||i||a,c=r||o||"";if(!l)return e;if(!g.test(l))return"url("+c+l+c+")";if(b.test(l))return"url("+c+l+c+")";if("/"===l[0])return"url("+c+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+l)+c+")";var u=t.split("/"),d=l.split("/");u.pop();for(var f=0,p=d;f<p.length;f++){var h=p[f];"."!==h&&(".."===h?u.pop():u.push(h))}return"url("+c+u.join("/")+c+")"}))}var w=/^[^ \t\n\r\u000c]+/,x=/^[, \t\n\r\u000c]+/;function T(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function E(){var e=document.createElement("a");return e.href="",e.href}function I(e,t,r,n){return"src"===r||"href"===r&&n||"xlink:href"===r&&n&&"#"!==n[0]?T(e,n):"background"!==r||!n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r&&n?function(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,o=e.exec(t.substring(r));return o?(n=o[0],r+=n.length,n):""}for(var o=[];n(x),!(r>=t.length);){var i=n(w);if(","===i.slice(-1))i=T(e,i.substring(0,i.length-1)),o.push(i);else{var a="";i=T(e,i);for(var s=!1;;){var l=t.charAt(r);if(""===l){o.push((i+a).trim());break}if(s)")"===l&&(s=!1);else{if(","===l){r+=1,o.push((i+a).trim());break}"("===l&&(s=!0)}a+=l,r+=1}}}return o.join(", ")}(e,n):"style"===r&&n?S(n,E()):"object"===t&&"data"===r&&n?T(e,n):n:T(e,n)}function C(e,t,r){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=0;n<e.classList.length;n++){var o=e.classList[n];if(t.test(o))return!0}return!(!r||!e.matches(r))||C(e.parentNode,t,r)}return e.nodeType,e.TEXT_NODE,C(e.parentNode,t,r)}function M(e,r){var n,o,i,a,s=r.doc,p=r.blockClass,v=r.blockSelector,y=r.maskTextClass,g=r.maskTextSelector,b=r.inlineStylesheet,w=r.maskInputOptions,x=void 0===w?{}:w,T=r.maskTextFn,M=r.maskInputFn,k=r.dataURLOptions,N=void 0===k?{}:k,R=r.inlineImages,_=r.recordCanvas,O=r.keepIframeSrcFn,L=r.enableStrictPrivacy;if(s.__sn){var A=s.__sn.id;o=1===A?void 0:A}switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:t.Document,childNodes:[],compatMode:e.compatMode,rootId:o}:{type:t.Document,childNodes:[],rootId:o};case e.DOCUMENT_TYPE_NODE:return{type:t.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:o};case e.ELEMENT_NODE:for(var D=function(e,t,r){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=0;n<e.classList.length;n++){var o=e.classList[n];if(t.test(o))return!0}return!!r&&e.matches(r)}(e,p,v),F=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return h.test(t)?"div":t}(e),P={},W=0,j=Array.from(e.attributes);W<j.length;W++){var U=j[W],z=U.name,H=U.value;P[z]=I(s,F,z,H)}if("link"===F&&b){var V=Array.from(s.styleSheets).find((function(t){return t.href===e.href})),B=null;V&&(B=m(V)),B&&(delete P.rel,delete P.href,P._cssText=S(B,V.href))}if("style"===F&&e.sheet&&!(e.innerText||e.textContent||"").trim().length)(B=m(e.sheet))&&(P._cssText=S(B,E()));if("input"===F||"textarea"===F||"select"===F){H=e.value;"radio"!==P.type&&"checkbox"!==P.type&&"submit"!==P.type&&"button"!==P.type&&H?P.value=l({type:P.type,tagName:F,value:H,maskInputOptions:x,maskInputFn:M}):e.checked&&(P.checked=e.checked)}if("option"===F&&(e.selected&&!x.select?P.selected=!0:delete P.selected),"canvas"===F&&_)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;r<e.width;r+=50)for(var n=0;n<e.height;n+=50){var o=t.getImageData,i=c in o?o.__rrweb_original__:o;if(new Uint32Array(i.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((function(e){return 0!==e})))return!1}return!0})(e)||(P.rr_dataURL=e.toDataURL(N.type,N.quality));else if(!("__context"in e)){var G=e.toDataURL(N.type,N.quality),q=document.createElement("canvas");q.width=e.width,q.height=e.height,G!==q.toDataURL(N.type,N.quality)&&(P.rr_dataURL=G)}if("img"===F&&R){d||(d=s.createElement("canvas"),f=d.getContext("2d"));var Y=e,X=Y.crossOrigin;Y.crossOrigin="anonymous";var Q=function(){try{d.width=Y.naturalWidth,d.height=Y.naturalHeight,f.drawImage(Y,0,0),P.rr_dataURL=d.toDataURL(N.type,N.quality)}catch(e){console.warn("Cannot inline img src="+Y.currentSrc+"! Error: "+e)}X?P.crossOrigin=X:delete P.crossOrigin};Y.complete&&0!==Y.naturalWidth?Q():Y.onload=Q}if("audio"!==F&&"video"!==F||(P.rr_mediaState=e.paused?"paused":"played",P.rr_mediaCurrentTime=e.currentTime),e.scrollLeft&&(P.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(P.rr_scrollTop=e.scrollTop),D||"img"===F&&L){var $=e.getBoundingClientRect(),J=$.width,K=$.height;P={class:P.class,rr_width:J+"px",rr_height:K+"px"},D=!0}return"iframe"!==F||O(P.src)||(e.contentDocument||(P.rr_src=P.src),delete P.src),{type:t.Element,tagName:F,attributes:P,childNodes:[],isSVG:(a=e,Boolean("svg"===a.tagName||a.ownerSVGElement)||void 0),needBlock:D,rootId:o};case e.TEXT_NODE:var Z=e.parentNode&&e.parentNode.tagName,ee=e.textContent,te="STYLE"===Z||void 0,re="SCRIPT"===Z||void 0,ne=!1;if(te&&ee){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(ee=(i=e.parentNode.sheet).cssRules?Array.from(i.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: "+t,e)}ee=S(ee,E()),ne=!0}if(re?(ee="SCRIPT_PLACEHOLDER",ne=!0):"NOSCRIPT"===Z&&(ee="",ne=!0),!te&&!re&&C(e,y,g)&&ee&&(ee=T?T(ee):ee.replace(/[\S]/g,"*")),L&&!ne&&Z)!new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]).has(Z)&&ee&&(ee=u(ee));return{type:t.Text,textContent:ee||"",isStyle:te,rootId:o};case e.CDATA_SECTION_NODE:return{type:t.CDATA,textContent:"",rootId:o};case e.COMMENT_NODE:return{type:t.Comment,textContent:e.textContent||"",rootId:o};default:return!1}}function k(e){return void 0===e?"":e.toLowerCase()}function N(e,r){var n,o=r.doc,i=r.map,l=r.blockClass,c=r.blockSelector,u=r.maskTextClass,d=r.maskTextSelector,f=r.skipChild,h=void 0!==f&&f,m=r.inlineStylesheet,v=void 0===m||m,y=r.maskInputOptions,g=void 0===y?{}:y,b=r.maskTextFn,S=r.maskInputFn,w=r.slimDOMOptions,x=r.dataURLOptions,T=void 0===x?{}:x,E=r.inlineImages,I=void 0!==E&&E,C=r.recordCanvas,R=void 0!==C&&C,_=r.onSerialize,O=r.onIframeLoad,L=r.iframeLoadTimeout,A=void 0===L?5e3:L,D=r.keepIframeSrcFn,F=void 0===D?function(){return!1}:D,P=r.enableStrictPrivacy,W=r.preserveWhiteSpace,j=void 0===W||W,U=M(e,{doc:o,blockClass:l,blockSelector:c,maskTextClass:u,maskTextSelector:d,inlineStylesheet:v,maskInputOptions:g,maskTextFn:b,maskInputFn:S,dataURLOptions:T,inlineImages:I,recordCanvas:R,keepIframeSrcFn:F,enableStrictPrivacy:P});if(!U)return console.warn(e,"not serialized"),null;n="__sn"in e?e.__sn.id:!function(e,r){if(r.comment&&e.type===t.Comment)return!0;if(e.type===t.Element){if(r.script&&("script"===e.tagName||"link"===e.tagName&&"preload"===e.attributes.rel&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")))return!0;if(r.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(k(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===k(e.attributes.name)||"icon"===k(e.attributes.rel)||"apple-touch-icon"===k(e.attributes.rel)||"shortcut icon"===k(e.attributes.rel))))return!0;if("meta"===e.tagName){if(r.headMetaDescKeywords&&k(e.attributes.name).match(/^description|keywords$/))return!0;if(r.headMetaSocial&&(k(e.attributes.property).match(/^(og|twitter|fb):/)||k(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===k(e.attributes.name)))return!0;if(r.headMetaRobots&&("robots"===k(e.attributes.name)||"googlebot"===k(e.attributes.name)||"bingbot"===k(e.attributes.name)))return!0;if(r.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(r.headMetaAuthorship&&("author"===k(e.attributes.name)||"generator"===k(e.attributes.name)||"framework"===k(e.attributes.name)||"publisher"===k(e.attributes.name)||"progid"===k(e.attributes.name)||k(e.attributes.property).match(/^article:/)||k(e.attributes.property).match(/^product:/)))return!0;if(r.headMetaVerification&&("google-site-verification"===k(e.attributes.name)||"yandex-verification"===k(e.attributes.name)||"csrf-token"===k(e.attributes.name)||"p:domain_verify"===k(e.attributes.name)||"verify-v1"===k(e.attributes.name)||"verification"===k(e.attributes.name)||"shopify-checkout-api-token"===k(e.attributes.name)))return!0}}return!1}(U,w)&&(j||U.type!==t.Text||U.isStyle||U.textContent.replace(/^\s+|\s+$/gm,"").length)?p++:-2;var z=Object.assign(U,{id:n});if(e.__sn=z,-2===n)return null;i[n]=e,_&&_(e);var H=!h;if(z.type===t.Element){if(H=H&&!z.needBlock,z.needBlock&&"img"===z.tagName){var V=e.cloneNode();V.src="",i[n]=V}delete z.needBlock,e.shadowRoot&&(z.isShadowHost=!0)}if((z.type===t.Document||z.type===t.Element)&&H){w.headWhitespace&&U.type===t.Element&&"head"===U.tagName&&(j=!1);for(var B={doc:o,map:i,blockClass:l,blockSelector:c,maskTextClass:u,maskTextSelector:d,skipChild:h,inlineStylesheet:v,maskInputOptions:g,maskTextFn:b,maskInputFn:S,slimDOMOptions:w,dataURLOptions:T,inlineImages:I,recordCanvas:R,preserveWhiteSpace:j,onSerialize:_,onIframeLoad:O,iframeLoadTimeout:A,keepIframeSrcFn:F,enableStrictPrivacy:P},G=0,q=Array.from(e.childNodes);G<q.length;G++){(Q=N(q[G],B))&&z.childNodes.push(Q)}if(a(e)&&e.shadowRoot)for(var Y=0,X=Array.from(e.shadowRoot.childNodes);Y<X.length;Y++){var Q;(Q=N(X[Y],B))&&(Q.isShadow=!0,z.childNodes.push(Q))}}return e.parentNode&&s(e.parentNode)&&(z.isShadow=!0),z.type===t.Element&&"iframe"===z.tagName&&function(e,t,r){var n=e.contentWindow;if(n){var o,i=!1;try{o=n.document.readyState}catch(e){return}if("complete"===o){var a="about:blank";n.location.href===a&&e.src!==a&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0)}else{var s=setTimeout((function(){i||(t(),i=!0)}),r);e.addEventListener("load",(function(){clearTimeout(s),i=!0,t()}))}}}(e,(function(){var t=e.contentDocument;if(t&&O){var r=N(t,{doc:t,map:i,blockClass:l,blockSelector:c,maskTextClass:u,maskTextSelector:d,skipChild:!1,inlineStylesheet:v,maskInputOptions:g,maskTextFn:b,maskInputFn:S,slimDOMOptions:w,dataURLOptions:T,inlineImages:I,recordCanvas:R,preserveWhiteSpace:j,onSerialize:_,onIframeLoad:O,iframeLoadTimeout:A,keepIframeSrcFn:F,enableStrictPrivacy:P});r&&O(e,r)}}),A),z}var R=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function _(e,t){void 0===t&&(t={});var r=1,n=1;function o(e){var t=e.match(/\n/g);t&&(r+=t.length);var o=e.lastIndexOf("\n");n=-1===o?n+e.length:e.length-o}function i(){var e={line:r,column:n};return function(t){return t.position=new a(e),p(),t}}var a=function(e){this.start=e,this.end={line:r,column:n},this.source=t.source};a.prototype.content=e;var s=[];function l(o){var i=new Error(t.source+":"+r+":"+n+": "+o);if(i.reason=o,i.filename=t.source,i.line=r,i.column=n,i.source=e,!t.silent)throw i;s.push(i)}function c(){return f(/^{\s*/)}function u(){return f(/^}/)}function d(){var t,r=[];for(p(),h(r);e.length&&"}"!==e.charAt(0)&&(t=I()||C());)!1!==t&&(r.push(t),h(r));return r}function f(t){var r=t.exec(e);if(r){var n=r[0];return o(n),e=e.slice(n.length),r}}function p(){f(/^\s*/)}function h(e){var t;for(void 0===e&&(e=[]);t=m();)!1!==t&&e.push(t),t=m();return e}function m(){var t=i();if("/"===e.charAt(0)&&"*"===e.charAt(1)){for(var r=2;""!==e.charAt(r)&&("*"!==e.charAt(r)||"/"!==e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return l("End of comment missing");var a=e.slice(2,r-2);return n+=2,o(a),e=e.slice(r),n+=2,t({type:"comment",comment:a})}}function v(){var e=f(/^([^{]+)/);if(e)return O(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function y(){var e=i(),t=f(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=O(t[0]);if(!f(/^:\s*/))return l("property missing ':'");var n=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:r.replace(R,""),value:n?O(n[0]).replace(R,""):""});return f(/^[;\s]*/),o}}function g(){var e,t=[];if(!c())return l("missing '{'");for(h(t);e=y();)!1!==e&&(t.push(e),h(t)),e=y();return u()?t:l("missing '}'")}function b(){for(var e,t=[],r=i();e=f(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),f(/^,\s*/);if(t.length)return r({type:"keyframe",values:t,declarations:g()})}var S,w=E("import"),x=E("charset"),T=E("namespace");function E(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=i(),n=f(t);if(n){var o={type:e};return o[e]=n[1].trim(),r(o)}}}function I(){if("@"===e[0])return function(){var e=i(),t=f(/^@([-\w]+)?keyframes\s*/);if(t){var r=t[1];if(!(t=f(/^([-\w]+)\s*/)))return l("@keyframes missing name");var n,o=t[1];if(!c())return l("@keyframes missing '{'");for(var a=h();n=b();)a.push(n),a=a.concat(h());return u()?e({type:"keyframes",name:o,vendor:r,keyframes:a}):l("@keyframes missing '}'")}}()||function(){var e=i(),t=f(/^@media *([^{]+)/);if(t){var r=O(t[1]);if(!c())return l("@media missing '{'");var n=h().concat(d());return u()?e({type:"media",media:r,rules:n}):l("@media missing '}'")}}()||function(){var e=i(),t=f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:O(t[1]),media:O(t[2])})}()||function(){var e=i(),t=f(/^@supports *([^{]+)/);if(t){var r=O(t[1]);if(!c())return l("@supports missing '{'");var n=h().concat(d());return u()?e({type:"supports",supports:r,rules:n}):l("@supports missing '}'")}}()||w()||x()||T()||function(){var e=i(),t=f(/^@([-\w]+)?document *([^{]+)/);if(t){var r=O(t[1]),n=O(t[2]);if(!c())return l("@document missing '{'");var o=h().concat(d());return u()?e({type:"document",document:n,vendor:r,rules:o}):l("@document missing '}'")}}()||function(){var e=i();if(f(/^@page */)){var t=v()||[];if(!c())return l("@page missing '{'");for(var r,n=h();r=y();)n.push(r),n=n.concat(h());return u()?e({type:"page",selectors:t,declarations:n}):l("@page missing '}'")}}()||function(){var e=i();if(f(/^@host\s*/)){if(!c())return l("@host missing '{'");var t=h().concat(d());return u()?e({type:"host",rules:t}):l("@host missing '}'")}}()||function(){var e=i();if(f(/^@font-face\s*/)){if(!c())return l("@font-face missing '{'");for(var t,r=h();t=y();)r.push(t),r=r.concat(h());return u()?e({type:"font-face",declarations:r}):l("@font-face missing '}'")}}()}function C(){var e=i(),t=v();return t?(h(),e({type:"rule",selectors:t,declarations:g()})):l("selector missing")}return L((S=d(),{type:"stylesheet",stylesheet:{source:t.source,rules:S,parsingErrors:s}}))}function O(e){return e?e.replace(/^\s+|\s+$/g,""):""}function L(e,t){for(var r=e&&"string"==typeof e.type,n=r?e:t,o=0,i=Object.keys(e);o<i.length;o++){var a=e[i[o]];Array.isArray(a)?a.forEach((function(e){L(e,n)})):a&&"object"==typeof a&&L(a,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var A={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"};var D,F,P,W,j,U,z=/([^\\]):hover/,H=new RegExp(z.source,"g");function V(e,t){var r;if(!(null===(r=window.HIG_CONFIGURATION)||void 0===r?void 0:r.enableOnHoverClass))return e;var n=null==t?void 0:t.stylesWithHoverClass.get(e);if(n)return n;var o=_(e,{silent:!0});if(!o.stylesheet)return e;var i=[];if(o.stylesheet.rules.forEach((function(e){"selectors"in e&&(e.selectors||[]).forEach((function(e){z.test(e)&&i.push(e)}))})),0===i.length)return e;var a=new RegExp(i.filter((function(e,t){return i.indexOf(e)===t})).sort((function(e,t){return t.length-e.length})).map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})).join("|"),"g"),s=e.replace(a,(function(e){var t=e.replace(H,"$1.\\:hover");return e+", "+t}));return null==t||t.stylesWithHoverClass.set(e,s),s}function B(){return{stylesWithHoverClass:new Map}}function G(e,r){var n=r.doc,o=r.hackCss,i=r.cache;switch(e.type){case t.Document:return n.implementation.createDocument(null,"",null);case t.DocumentType:return n.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case t.Element:var a,s=function(e){var t=A[e.tagName]?A[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e);a=e.isSVG?n.createElementNS("http://www.w3.org/2000/svg",s):n.createElement(s);var l=function(t){if(!e.attributes.hasOwnProperty(t))return"continue";var r=e.attributes[t];if("option"===s&&"selected"===t&&!1===r)return"continue";if(r="boolean"==typeof r||"number"==typeof r?"":r,t.startsWith("rr_")){if("canvas"===s&&"rr_dataURL"===t){var l=document.createElement("img");l.src=r,l.onload=function(){var e=a.getContext("2d");e&&e.drawImage(l,0,0,l.width,l.height)}}else if("img"===s&&"rr_dataURL"===t){var c=a;c.currentSrc.startsWith("data:")||(c.setAttribute("rrweb-original-src",e.attributes.src),c.src=r)}if("rr_width"===t)a.style.width=r;else if("rr_height"===t)a.style.height=r;else if("rr_mediaCurrentTime"===t)a.currentTime=e.attributes.rr_mediaCurrentTime;else if("rr_mediaState"===t)switch(r){case"played":a.play().catch((function(e){return console.warn("media playback error",e)}));break;case"paused":a.pause()}}else{var u="textarea"===s&&"value"===t,d="style"===s&&"_cssText"===t;if(d&&o&&"string"==typeof(r=V(r,i))){for(var f=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,p=void 0,h=[];null!==(p=f.exec(r));)p.index===f.lastIndex&&f.lastIndex++,p.forEach((function(e,t){if(0===t){var r=e.slice(5,e.length-2);h.push({originalUrl:r,proxyUrl:r.replace(r,"https://replay-cors-proxy.highlightrun.workers.dev?url="+r)})}}));h.forEach((function(e){r=r.replace(e.originalUrl,e.proxyUrl)}))}if(u||d){for(var m=n.createTextNode(r),v=0,y=Array.from(a.childNodes);v<y.length;v++){var g=y[v];g.nodeType===a.TEXT_NODE&&a.removeChild(g)}return a.appendChild(m),"continue"}try{if(e.isSVG&&"xlink:href"===t)a.setAttributeNS("http://www.w3.org/1999/xlink",t,r);else if("onload"===t||"onclick"===t||"onmouse"===t.substring(0,7))a.setAttribute("_"+t,r);else{if("meta"===s&&"Content-Security-Policy"===e.attributes["http-equiv"]&&"content"===t)return a.setAttribute("csp-content",r),"continue";"link"===s&&"preload"===e.attributes.rel&&"script"===e.attributes.as||"link"===s&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")||("img"===s&&e.attributes.srcset&&e.attributes.rr_dataURL?a.setAttribute("rrweb-original-srcset",e.attributes.srcset):a.setAttribute(t,r))}}catch(e){}}};for(var c in e.attributes)l(c);if(e.isShadowHost)if(a.shadowRoot)for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);else a.attachShadow({mode:"open"});return a;case t.Text:return n.createTextNode(e.isStyle&&o?V(e.textContent,i):e.textContent);case t.CDATA:return n.createCDATASection(e.textContent);case t.Comment:return n.createComment(e.textContent);default:return null}}function q(e,r){var n=r.doc,o=r.map,i=r.skipChild,s=void 0!==i&&i,l=r.hackCss,c=void 0===l||l,u=r.afterAppend,d=r.cache,f=G(e,{doc:n,hackCss:c,cache:d});if(!f)return null;if(e.rootId&&console.assert(o[e.rootId]===n,"Target document should has the same root id."),e.type===t.Document&&(n.close(),n.open(),"BackCompat"===e.compatMode&&e.childNodes&&e.childNodes[0].type!==t.DocumentType&&(e.childNodes[0].type===t.Element&&"xmlns"in e.childNodes[0].attributes&&"http://www.w3.org/1999/xhtml"===e.childNodes[0].attributes.xmlns?n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),f=n),f.__sn=e,o[e.id]=f,(e.type===t.Document||e.type===t.Element)&&!s)for(var p=0,h=e.childNodes;p<h.length;p++){var m=h[p],v=q(m,{doc:n,map:o,skipChild:!1,hackCss:c,afterAppend:u,cache:d});v?(m.isShadow&&a(f)&&f.shadowRoot?f.shadowRoot.appendChild(v):f.appendChild(v),u&&u(v)):console.warn("Failed to rebuild",m)}return f}function Y(e,r){var n=r.doc,o=r.onVisit,i=r.hackCss,a={},s=q(e,{doc:n,map:a,skipChild:!1,hackCss:void 0===i||i,afterAppend:r.afterAppend,cache:r.cache});return function(e,t){for(var r in e)e[r]&&(n=e[r],t(n));var n}(a,(function(e){o&&o(e),function(e){var r=e.__sn;if(r.type===t.Element){var n=e;for(var o in r.attributes)if(r.attributes.hasOwnProperty(o)&&o.startsWith("rr_")){var i=r.attributes[o];"rr_scrollLeft"===o&&(n.scrollLeft=i),"rr_scrollTop"===o&&(n.scrollTop=i)}}}(e)})),[s,a]}function X(e,t,r){void 0===r&&(r=document);var n={capture:!0,passive:!0};return r.addEventListener(e,t,n),function(){return r.removeEventListener(e,t,n)}}function Q(){return{map:{},getId:function(e){return e&&e.__sn?e.__sn.id:-1},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,r=e.__sn&&e.__sn.id;delete this.map[r],e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}}}e.EventType=void 0,(D=e.EventType||(e.EventType={}))[D.DomContentLoaded=0]="DomContentLoaded",D[D.Load=1]="Load",D[D.FullSnapshot=2]="FullSnapshot",D[D.IncrementalSnapshot=3]="IncrementalSnapshot",D[D.Meta=4]="Meta",D[D.Custom=5]="Custom",D[D.Plugin=6]="Plugin",e.IncrementalSource=void 0,(F=e.IncrementalSource||(e.IncrementalSource={}))[F.Mutation=0]="Mutation",F[F.MouseMove=1]="MouseMove",F[F.MouseInteraction=2]="MouseInteraction",F[F.Scroll=3]="Scroll",F[F.ViewportResize=4]="ViewportResize",F[F.Input=5]="Input",F[F.TouchMove=6]="TouchMove",F[F.MediaInteraction=7]="MediaInteraction",F[F.StyleSheetRule=8]="StyleSheetRule",F[F.CanvasMutation=9]="CanvasMutation",F[F.Font=10]="Font",F[F.Log=11]="Log",F[F.Drag=12]="Drag",F[F.StyleDeclaration=13]="StyleDeclaration",e.MouseInteractions=void 0,(P=e.MouseInteractions||(e.MouseInteractions={}))[P.MouseUp=0]="MouseUp",P[P.MouseDown=1]="MouseDown",P[P.Click=2]="Click",P[P.ContextMenu=3]="ContextMenu",P[P.DblClick=4]="DblClick",P[P.Focus=5]="Focus",P[P.Blur=6]="Blur",P[P.TouchStart=7]="TouchStart",P[P.TouchMove_Departed=8]="TouchMove_Departed",P[P.TouchEnd=9]="TouchEnd",P[P.TouchCancel=10]="TouchCancel",function(e){e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2"}(W||(W={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange"}(j||(j={})),e.ReplayerEvents=void 0,(U=e.ReplayerEvents||(e.ReplayerEvents={})).Start="start",U.Pause="pause",U.Resume="resume",U.Resize="resize",U.Finish="finish",U.FullsnapshotRebuilded="fullsnapshot-rebuilded",U.LoadStylesheetStart="load-stylesheet-start",U.LoadStylesheetEnd="load-stylesheet-end",U.SkipStart="skip-start",U.SkipEnd="skip-end",U.MouseInteraction="mouse-interaction",U.EventCast="event-cast",U.CustomEvent="custom-event",U.Flush="flush",U.StateChange="state-change",U.PlayBack="play-back";var $="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";function J(e,t,r){void 0===r&&(r={});var n=null,o=0;return function(i){var a=Date.now();o||!1!==r.leading||(o=a);var s=t-(a-o),l=this,c=arguments;s<=0||s>t?(n&&(clearTimeout(n),n=null),o=a,e.apply(l,c)):n||!1===r.trailing||(n=setTimeout((function(){o=!1===r.leading?0:Date.now(),n=null,e.apply(l,c)}),s))}}function K(e,t,r,n,o){void 0===o&&(o=window);var i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set:function(e){var t=this;setTimeout((function(){r.set.call(t,e)}),0),i&&i.set&&i.set.call(this,e)}}),function(){return K(e,t,i||{},!0)}}function Z(e,t,r){try{if(!(t in e))return function(){};var n=e[t],o=r(n);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,function(){e[t]=n}}catch(e){return function(){}}}function ee(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function te(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}e.mirror={map:{},getId:function(){return console.error($),-1},getNode:function(){return console.error($),null},removeNodeFromMap:function(){console.error($)},has:function(){return console.error($),!1},reset:function(){console.error($)}},"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(e.mirror=new Proxy(e.mirror,{get:function(e,t,r){return"map"===t&&console.error($),Reflect.get(e,t,r)}}));var re=function(e){try{if(e instanceof HTMLElement)return"CANVAS"===e.tagName}catch(e){return!1}return!1};function ne(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var r=!1;if("string"==typeof t){if(void 0!==e.closest)return null!==e.closest("."+t);r=e.classList.contains(t)}else e.classList.forEach((function(e){t.test(e)&&(r=!0)}));return r||ne(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,ne(e.parentNode,t)}function oe(e){return"__sn"in e&&-2===e.__sn.id}function ie(e,t){if(s(e))return!1;var r=t.getId(e);return!t.has(r)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||ie(e.parentNode,t))}function ae(e){return Boolean(e.changedTouches)}function se(e){void 0===e&&(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(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})}var le=function(){function t(){this.reset()}return t.prototype.add=function(e){var t=this.indexes.get(e.parentId),r={id:e.node.id,mutation:e,children:[],texts:[],attributes:[]};t?(r.parent=t,t.children[r.id]=r):this.tree[r.id]=r,this.indexes.set(r.id,r)},t.prototype.remove=function(e,t){var r=this,n=this.indexes.get(e.parentId),o=this.indexes.get(e.id),i=function(e){r.removeIdSet.add(e);var n=t.getNode(e);null==n||n.childNodes.forEach((function(e){"__sn"in e&&i(e.__sn.id)}))},a=function(t){r.removeIdSet.add(t.id),Object.values(t.children).forEach((function(e){return a(e)}));var n=r.indexes.get(t.id);if(n){var o=n.parent;o&&(delete n.parent,delete o.children[n.id],r.indexes.delete(e.id))}};o?n?(delete o.parent,delete n.children[o.id],this.indexes.delete(e.id),a(o)):(delete this.tree[o.id],this.indexes.delete(o.id),a(o)):(this.removeNodeMutations.push(e),i(e.id))},t.prototype.text=function(e){var t=this.indexes.get(e.id);t?t.texts.push(e):this.textMutations.push(e)},t.prototype.attribute=function(e){var t=this.indexes.get(e.id);t?t.attributes.push(e):this.attributeMutations.push(e)},t.prototype.scroll=function(e){this.scrollMap.set(e.id,e)},t.prototype.input=function(e){this.inputMap.set(e.id,e)},t.prototype.flush=function(){var t,r,o,i,a=this,s=this,l=s.tree,c=s.removeNodeMutations,u=s.textMutations,d=s.attributeMutations,f={source:e.IncrementalSource.Mutation,removes:c,texts:u,attributes:d,adds:[]},p=function(e,t){t&&a.removeIdSet.add(e.id),f.texts=f.texts.concat(t?[]:e.texts).filter((function(e){return!a.removeIdSet.has(e.id)})),f.attributes=f.attributes.concat(t?[]:e.attributes).filter((function(e){return!a.removeIdSet.has(e.id)})),a.removeIdSet.has(e.id)||a.removeIdSet.has(e.mutation.parentId)||t?Object.values(e.children).forEach((function(e){return p(e,!0)})):(f.adds.push(e.mutation),e.children&&Object.values(e.children).forEach((function(e){return p(e,!1)})))};Object.values(l).forEach((function(e){return p(e,!1)}));try{for(var h=n(this.scrollMap.keys()),m=h.next();!m.done;m=h.next()){var v=m.value;this.removeIdSet.has(v)&&this.scrollMap.delete(v)}}catch(e){t={error:e}}finally{try{m&&!m.done&&(r=h.return)&&r.call(h)}finally{if(t)throw t.error}}try{for(var y=n(this.inputMap.keys()),g=y.next();!g.done;g=y.next()){v=g.value;this.removeIdSet.has(v)&&this.inputMap.delete(v)}}catch(e){o={error:e}}finally{try{g&&!g.done&&(i=y.return)&&i.call(y)}finally{if(o)throw o.error}}var b=new Map(this.scrollMap),S=new Map(this.inputMap);return this.reset(),{mutationData:f,scrollMap:b,inputMap:S}},t.prototype.reset=function(){this.tree=[],this.indexes=new Map,this.removeNodeMutations=[],this.textMutations=[],this.attributeMutations=[],this.removeIdSet=new Set,this.scrollMap=new Map,this.inputMap=new Map},t.prototype.idRemoved=function(e){return this.removeIdSet.has(e)},t}();function ce(e){var t,r,o={},i=function(e,t){var r={value:e,parent:t,children:[]};return o[e.node.id]=r,r},a=[];try{for(var s=n(e),l=s.next();!l.done;l=s.next()){var c=l.value,u=c.nextId,d=c.parentId;if(u&&u in o){var f=o[u];if(f.parent){var p=f.parent.children.indexOf(f);f.parent.children.splice(p,0,i(c,f.parent))}else{p=a.indexOf(f);a.splice(p,0,i(c,null))}}else if(d in o){var h=o[d];h.children.push(i(c,h))}else a.push(i(c,null))}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return a}function ue(e,t){t(e.value);for(var r=e.children.length-1;r>=0;r--)ue(e.children[r],t)}function de(e){return"__sn"in e&&(e.__sn.type===t.Element&&"iframe"===e.__sn.tagName)}function fe(e,t){var r,n,o=null===(n=null===(r=e.ownerDocument)||void 0===r?void 0:r.defaultView)||void 0===n?void 0:n.frameElement;if(!o||o===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};var i=o.getBoundingClientRect(),a=fe(o,t),s=i.height/o.clientHeight;return{x:i.x*a.relativeScale+a.x,y:i.y*a.relativeScale+a.y,relativeScale:s,absoluteScale:a.absoluteScale*s}}function pe(e){return Boolean(null==e?void 0:e.shadowRoot)}var he=Object.freeze({__proto__:null,on:X,createMirror:Q,get _mirror(){return e.mirror},throttle:J,hookSetter:K,patch:Z,getWindowHeight:ee,getWindowWidth:te,isCanvasNode:re,isBlocked:ne,isIgnored:oe,isAncestorRemoved:ie,isTouchEvent:ae,polyfill:se,TreeIndex:le,queueToResolveTrees:ce,iterateResolveTree:ue,isIframeINode:de,getBaseDimension:fe,hasShadowRoot:pe});function me(e){return"__ln"in e}var ve=function(){function e(){this.length=0,this.head=null}return e.prototype.get=function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;r<e;r++)t=(null==t?void 0:t.next)||null;return t},e.prototype.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&me(e.previousSibling)){var r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&me(e.nextSibling)&&e.nextSibling.__ln.previous){r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++},e.prototype.removeNode=function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)},e}(),ye=function(e,t){return"".concat(e,"@").concat(t)};function ge(e){return"__sn"in e}var be=function(){function e(){var e=this;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=function(t){t.forEach(e.processMutation),e.emit()},this.emit=function(){var t,r,o,i;if(!e.frozen&&!e.locked){for(var a=[],l=new ve,c=function(t){for(var r=t,n=-2;-2===n;)n=(r=r&&r.nextSibling)&&e.mirror.getId(r);return n},d=function(t){for(var r,n,o,i,u,d=t.getRootNode?null===(r=t.getRootNode())||void 0===r?void 0:r.host:null,f=d;null===(o=null===(n=null==f?void 0:f.getRootNode)||void 0===n?void 0:n.call(f))||void 0===o?void 0:o.host;)f=(null===(u=null===(i=null==f?void 0:f.getRootNode)||void 0===i?void 0:i.call(f))||void 0===u?void 0:u.host)||null;var p=!(e.doc.contains(t)||null!==f&&e.doc.contains(f));if(t.parentNode&&!p){var h=s(t.parentNode)?e.mirror.getId(d):e.mirror.getId(t.parentNode),m=c(t);if(-1===h||-1===m)return l.addNode(t);var v=N(t,{doc:e.doc,map:e.mirror.map,blockClass:e.blockClass,blockSelector:e.blockSelector,maskTextClass:e.maskTextClass,maskTextSelector:e.maskTextSelector,skipChild:!0,inlineStylesheet:e.inlineStylesheet,maskInputOptions:e.maskInputOptions,maskTextFn:e.maskTextFn,maskInputFn:e.maskInputFn,slimDOMOptions:e.slimDOMOptions,recordCanvas:e.recordCanvas,inlineImages:e.inlineImages,enableStrictPrivacy:e.enableStrictPrivacy,onSerialize:function(r){de(r)&&e.iframeManager.addIframe(r),pe(t)&&e.shadowDomManager.addShadowRoot(t.shadowRoot,document)},onIframeLoad:function(t,r){e.iframeManager.attachIframe(t,r),e.shadowDomManager.observeAttachShadow(t)}});v&&a.push({parentId:h,nextId:m,node:v})}};e.mapRemoves.length;)e.mirror.removeNodeFromMap(e.mapRemoves.shift());try{for(var f=n(e.movedSet),p=f.next();!p.done;p=f.next()){var h=p.value;we(e.removes,h,e.mirror)&&!e.movedSet.has(h.parentNode)||d(h)}}catch(e){t={error:e}}finally{try{p&&!p.done&&(r=f.return)&&r.call(f)}finally{if(t)throw t.error}}try{for(var m=n(e.addedSet),v=m.next();!v.done;v=m.next()){h=v.value;xe(e.droppedSet,h)||we(e.removes,h,e.mirror)?xe(e.movedSet,h)?d(h):e.droppedSet.add(h):d(h)}}catch(e){o={error:e}}finally{try{v&&!v.done&&(i=m.return)&&i.call(m)}finally{if(o)throw o.error}}for(var y=null;l.length;){var g=null;if(y){var b=e.mirror.getId(y.value.parentNode),S=c(y.value);-1!==b&&-1!==S&&(g=y)}if(!g)for(var w=l.length-1;w>=0;w--){var x=l.get(w);if(x){b=e.mirror.getId(x.value.parentNode),S=c(x.value);if(-1!==b&&-1!==S){g=x;break}}}if(!g){for(;l.head;)l.removeNode(l.head.value);break}y=g.previous,l.removeNode(g.value),d(g.value)}var T={texts:e.texts.map((function(t){var r=t.value;return e.enableStrictPrivacy&&r&&(r=u(r)),{id:e.mirror.getId(t.node),value:r}})).filter((function(t){return e.mirror.has(t.id)})),attributes:e.attributes.map((function(t){return{id:e.mirror.getId(t.node),attributes:t.attributes}})).filter((function(t){return e.mirror.has(t.id)})),removes:e.removes,adds:a};(T.texts.length||T.attributes.length||T.removes.length||T.adds.length)&&(e.texts=[],e.attributes=[],e.removes=[],e.addedSet=new Set,e.movedSet=new Set,e.droppedSet=new Set,e.movedMap={},e.mutationCb(T))}},this.processMutation=function(t){var r,o,i,a;if(!oe(t.target))switch(t.type){case"characterData":var c=t.target.textContent;ne(t.target,e.blockClass)||c===t.oldValue||e.texts.push({value:C(t.target,e.maskTextClass,e.maskTextSelector)&&c?e.maskTextFn?e.maskTextFn(c):c.replace(/[\S]/g,"*"):c,node:t.target});break;case"attributes":var u=t.target;c=t.target.getAttribute(t.attributeName);if("value"===t.attributeName&&(c=l({maskInputOptions:e.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:c,maskInputFn:e.maskInputFn})),ne(t.target,e.blockClass)||c===t.oldValue)return;var d=e.attributes.find((function(e){return e.node===t.target}));if(d||(d={node:t.target,attributes:{}},e.attributes.push(d)),"style"===t.attributeName){var f=e.doc.createElement("span");t.oldValue&&f.setAttribute("style",t.oldValue),void 0!==d.attributes.style&&null!==d.attributes.style||(d.attributes.style={});var p=d.attributes.style;try{for(var h=n(Array.from(u.style)),m=h.next();!m.done;m=h.next()){var v=m.value,y=u.style.getPropertyValue(v),g=u.style.getPropertyPriority(v);y===f.style.getPropertyValue(v)&&g===f.style.getPropertyPriority(v)||(p[v]=""===g?y:[y,g])}}catch(e){r={error:e}}finally{try{m&&!m.done&&(o=h.return)&&o.call(h)}finally{if(r)throw r.error}}try{for(var b=n(Array.from(f.style)),S=b.next();!S.done;S=b.next()){v=S.value;""===u.style.getPropertyValue(v)&&(p[v]=!1)}}catch(e){i={error:e}}finally{try{S&&!S.done&&(a=b.return)&&a.call(b)}finally{if(i)throw i.error}}}else{if("INPUT"===t.target.tagName){var w=t.target;if("password"===w.type){d.attributes.value="*".repeat(w.value.length);break}}d.attributes[t.attributeName]=I(e.doc,t.target.tagName,t.attributeName,c)}break;case"childList":t.addedNodes.forEach((function(r){return e.genAdds(r,t.target)})),t.removedNodes.forEach((function(r){var n=e.mirror.getId(r),o=s(t.target)?e.mirror.getId(t.target.host):e.mirror.getId(t.target);ne(t.target,e.blockClass)||oe(r)||(e.addedSet.has(r)?(Se(e.addedSet,r),e.droppedSet.add(r)):e.addedSet.has(t.target)&&-1===n||ie(t.target,e.mirror)||(e.movedSet.has(r)&&e.movedMap[ye(n,o)]?Se(e.movedSet,r):e.removes.push({parentId:o,id:n,isShadow:!!s(t.target)||void 0})),e.mapRemoves.push(r))}))}},this.genAdds=function(t,r){if(!r||!ne(r,e.blockClass)){if(ge(t)){if(oe(t))return;e.movedSet.add(t);var n=null;r&&ge(r)&&(n=r.__sn.id),n&&(e.movedMap[ye(t.__sn.id,n)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);ne(t,e.blockClass)||t.childNodes.forEach((function(t){return e.genAdds(t)}))}}}return e.prototype.init=function(e){var t=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","shadowDomManager","canvasManager","enableStrictPrivacy"].forEach((function(r){t[r]=e[r]}))},e.prototype.freeze=function(){this.frozen=!0,this.canvasManager.freeze()},e.prototype.unfreeze=function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()},e.prototype.isFrozen=function(){return this.frozen},e.prototype.lock=function(){this.locked=!0,this.canvasManager.lock()},e.prototype.unlock=function(){this.locked=!1,this.canvasManager.unlock(),this.emit()},e.prototype.reset=function(){this.shadowDomManager.reset(),this.canvasManager.reset()},e}();function Se(e,t){e.delete(t),t.childNodes.forEach((function(t){return Se(e,t)}))}function we(e,t,r){var n=t.parentNode;if(!n)return!1;var o=r.getId(n);return!!e.some((function(e){return e.id===o}))||we(e,n,r)}function xe(e,t){var r=t.parentNode;return!!r&&(!!e.has(r)||xe(e,r))}var Te=[],Ee="undefined"!=typeof CSSGroupingRule,Ie="undefined"!=typeof CSSMediaRule,Ce="undefined"!=typeof CSSSupportsRule,Me="undefined"!=typeof CSSConditionRule;function ke(e){try{if("composedPath"in e){var 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(t){return e.target}}function Ne(e,t){var r,n,o=new be;Te.push(o),o.init(e);var i=window.MutationObserver||window.__rrMutationObserver,a=null===(n=null===(r=null===window||void 0===window?void 0:window.Zone)||void 0===r?void 0:r.__symbol__)||void 0===n?void 0:n.call(r,"MutationObserver");a&&window[a]&&(i=window[a]);var s=new i(o.processMutations.bind(o));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function Re(t){var r=t.mouseInteractionCb,n=t.doc,o=t.mirror,i=t.blockClass,a=t.sampling;if(!1===a.mouseInteraction)return function(){};var s=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,l=[];return Object.keys(e.MouseInteractions).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]})).forEach((function(t){var a=t.toLowerCase(),s=function(t){return function(n){var a=ke(n);if(!ne(a,i)&&!re(a)){var s=ae(n)?n.changedTouches[0]:n;if(s){var l=o.getId(a),c=s.clientX,u=s.clientY;r({type:e.MouseInteractions[t],id:l,x:c,y:u})}}}}(t);l.push(X(a,s,n))})),function(){l.forEach((function(e){return e()}))}}function _e(e){var t=e.scrollCb,r=e.doc,n=e.mirror,o=e.blockClass;return X("scroll",J((function(e){var i=ke(e);if(i&&!ne(i,o)){var a=n.getId(i);if(i===r){var s=r.scrollingElement||r.documentElement;t({id:a,x:s.scrollLeft,y:s.scrollTop})}else t({id:a,x:i.scrollLeft,y:i.scrollTop})}}),e.sampling.scroll||100),r)}function Oe(e,t){var n=r({},e);return t||delete n.userTriggered,n}var Le=["INPUT","TEXTAREA","SELECT"],Ae=new WeakMap;function De(e){return function(e,t){if(Ee&&e.parentRule instanceof CSSGroupingRule||Ie&&e.parentRule instanceof CSSMediaRule||Ce&&e.parentRule instanceof CSSSupportsRule||Me&&e.parentRule instanceof CSSConditionRule){var r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else{r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function Fe(t,a){var s,c;void 0===a&&(a={});var u=t.doc.defaultView;if(!u)return function(){};!function(e,t){var r=e.mutationCb,n=e.mousemoveCb,a=e.mouseInteractionCb,s=e.scrollCb,l=e.viewportResizeCb,c=e.inputCb,u=e.mediaInteractionCb,d=e.styleSheetRuleCb,f=e.styleDeclarationCb,p=e.canvasMutationCb,h=e.fontCb;e.mutationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mutation&&t.mutation.apply(t,i([],o(e),!1)),r.apply(void 0,i([],o(e),!1))},e.mousemoveCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.mousemove&&t.mousemove.apply(t,i([],o(e),!1)),n.apply(void 0,i([],o(e),!1))},e.mouseInteractionCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.mouseInteraction&&t.mouseInteraction.apply(t,i([],o(e),!1)),a.apply(void 0,i([],o(e),!1))},e.scrollCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.scroll&&t.scroll.apply(t,i([],o(e),!1)),s.apply(void 0,i([],o(e),!1))},e.viewportResizeCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.viewportResize&&t.viewportResize.apply(t,i([],o(e),!1)),l.apply(void 0,i([],o(e),!1))},e.inputCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.input&&t.input.apply(t,i([],o(e),!1)),c.apply(void 0,i([],o(e),!1))},e.mediaInteractionCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.mediaInteaction&&t.mediaInteaction.apply(t,i([],o(e),!1)),u.apply(void 0,i([],o(e),!1))},e.styleSheetRuleCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.styleSheetRule&&t.styleSheetRule.apply(t,i([],o(e),!1)),d.apply(void 0,i([],o(e),!1))},e.styleDeclarationCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.styleDeclaration&&t.styleDeclaration.apply(t,i([],o(e),!1)),f.apply(void 0,i([],o(e),!1))},e.canvasMutationCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.canvasMutation&&t.canvasMutation.apply(t,i([],o(e),!1)),p.apply(void 0,i([],o(e),!1))},e.fontCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.font&&t.font.apply(t,i([],o(e),!1)),h.apply(void 0,i([],o(e),!1))}}(t,a);var d=Ne(t,t.doc),f=function(t){var r=t.mousemoveCb,n=t.sampling,o=t.doc,i=t.mirror;if(!1===n.mousemove)return function(){};var a,s="number"==typeof n.mousemove?n.mousemove:50,l="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500,c=[],u=J((function(e){var t=Date.now()-a;r(c.map((function(e){return e.timeOffset-=t,e})),e),c=[],a=null}),l),d=J((function(t){var r=ke(t),n=ae(t)?t.changedTouches[0]:t,o=n.clientX,s=n.clientY;a||(a=Date.now()),c.push({x:o,y:s,id:i.getId(r),timeOffset:Date.now()-a}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?e.IncrementalSource.Drag:t instanceof MouseEvent?e.IncrementalSource.MouseMove:e.IncrementalSource.TouchMove)}),s,{trailing:!1}),f=[X("mousemove",d,o),X("touchmove",d,o),X("drag",d,o)];return function(){f.forEach((function(e){return e()}))}}(t),p=Re(t),h=_e(t),m=function(e){var t=e.viewportResizeCb,r=-1,n=-1;return X("resize",J((function(){var e=ee(),o=te();r===e&&n===o||(t({width:Number(o),height:Number(e)}),r=e,n=o)}),200),window)}(t),v=function(e){var t=e.inputCb,n=e.doc,a=e.mirror,s=e.blockClass,c=e.ignoreClass,u=e.maskInputOptions,d=e.maskInputFn,f=e.sampling,p=e.userTriggeredOnInput;function h(e){var t=ke(e),r=e.isTrusted;if(t&&"OPTION"===t.tagName&&(t=t.parentElement),t&&t.tagName&&!(Le.indexOf(t.tagName)<0)&&!ne(t,s)){var o=t.type;if(!t.classList.contains(c)){var i=t.value,a=!1;"radio"===o||"checkbox"===o?a=t.checked:(u[t.tagName.toLowerCase()]||u[o])&&(i=l({maskInputOptions:u,tagName:t.tagName,type:o,value:i,maskInputFn:d})),m(t,Oe({text:i,isChecked:a,userTriggered:r},p));var f=t.name;"radio"===o&&f&&a&&n.querySelectorAll('input[type="radio"][name="'.concat(f,'"]')).forEach((function(e){e!==t&&m(e,Oe({text:e.value,isChecked:!a,userTriggered:!1},p))}))}}}function m(e,n){var o=Ae.get(e);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){Ae.set(e,n);var i=a.getId(e);t(r(r({},n),{id:i}))}}var v=("last"===f.input?["change"]:["input","change"]).map((function(e){return X(e,h,n)})),y=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),g=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return y&&y.set&&v.push.apply(v,i([],o(g.map((function(e){return K(e[0],e[1],{set:function(){h({target:this})}})}))),!1)),function(){v.forEach((function(e){return e()}))}}(t),y=function(e){var t=e.mediaInteractionCb,r=e.blockClass,n=e.mirror,o=e.sampling,i=function(e){return J((function(o){var i=ke(o);if(i&&!ne(i,r)){var a=i,s=a.currentTime,l=a.volume,c=a.muted;t({type:e,id:n.getId(i),currentTime:s,volume:l,muted:c})}}),o.media||500)},a=[X("play",i(0)),X("pause",i(1)),X("seeked",i(2)),X("volumechange",i(3))];return function(){a.forEach((function(e){return e()}))}}(t),g=function(e,t){var r=e.styleSheetRuleCb,n=e.mirror,a=t.win,s=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=function(e,t){var o=n.getId(this.ownerNode);return-1!==o&&r({id:o,adds:[{rule:e,index:t}]}),s.apply(this,arguments)};var l=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=function(e){var t=n.getId(this.ownerNode);return-1!==t&&r({id:t,removes:[{index:e}]}),l.apply(this,arguments)};var c={};Ee?c.CSSGroupingRule=a.CSSGroupingRule:(Ie&&(c.CSSMediaRule=a.CSSMediaRule),Me&&(c.CSSConditionRule=a.CSSConditionRule),Ce&&(c.CSSSupportsRule=a.CSSSupportsRule));var u={};return Object.entries(c).forEach((function(e){var t=o(e,2),a=t[0],s=t[1];u[a]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=function(e,t){var s=n.getId(this.parentStyleSheet.ownerNode);return-1!==s&&r({id:s,adds:[{rule:e,index:i(i([],o(De(this)),!1),[t||0],!1)}]}),u[a].insertRule.apply(this,arguments)},s.prototype.deleteRule=function(e){var t=n.getId(this.parentStyleSheet.ownerNode);return-1!==t&&r({id:t,removes:[{index:i(i([],o(De(this)),!1),[e],!1)}]}),u[a].deleteRule.apply(this,arguments)}})),function(){a.CSSStyleSheet.prototype.insertRule=s,a.CSSStyleSheet.prototype.deleteRule=l,Object.entries(c).forEach((function(e){var t=o(e,2),r=t[0],n=t[1];n.prototype.insertRule=u[r].insertRule,n.prototype.deleteRule=u[r].deleteRule}))}}(t,{win:u}),b=function(e,t){var r=e.styleDeclarationCb,n=e.mirror,o=t.win,i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=function(e,t,o){var a,s,l=n.getId(null===(s=null===(a=this.parentRule)||void 0===a?void 0:a.parentStyleSheet)||void 0===s?void 0:s.ownerNode);return-1!==l&&r({id:l,set:{property:e,value:t,priority:o},index:De(this.parentRule)}),i.apply(this,arguments)};var a=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=function(e){var t,o,i=n.getId(null===(o=null===(t=this.parentRule)||void 0===t?void 0:t.parentStyleSheet)||void 0===o?void 0:o.ownerNode);return-1!==i&&r({id:i,remove:{property:e},index:De(this.parentRule)}),a.apply(this,arguments)},function(){o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=a}}(t,{win:u}),S=t.collectFonts?function(e){var t=e.fontCb,r=e.doc,n=r.defaultView;if(!n)return function(){};var o=[],i=new WeakMap,a=n.FontFace;n.FontFace=function(e,t,r){var n=new a(e,t,r);return i.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};var s=Z(r.fonts,"add",(function(e){return function(r){return setTimeout((function(){var e=i.get(r);e&&(t(e),i.delete(r))}),0),e.apply(this,[r])}}));return o.push((function(){n.FontFace=a})),o.push(s),function(){o.forEach((function(e){return e()}))}}(t):function(){},w=[];try{for(var x=n(t.plugins),T=x.next();!T.done;T=x.next()){var E=T.value;w.push(E.observer(E.callback,u,E.options))}}catch(e){s={error:e}}finally{try{T&&!T.done&&(c=x.return)&&c.call(x)}finally{if(s)throw s.error}}return function(){Te.forEach((function(e){return e.reset()})),d.disconnect(),f(),p(),h(),m(),v(),y(),g(),b(),S(),w.forEach((function(e){return e()}))}}var Pe=function(){function e(e){this.iframes=new WeakMap,this.mutationCb=e.mutationCb}return e.prototype.addIframe=function(e){this.iframes.set(e,!0)},e.prototype.addLoadListener=function(e){this.loadListener=e},e.prototype.attachIframe=function(e,t){var r;this.mutationCb({adds:[{parentId:e.__sn.id,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(r=this.loadListener)||void 0===r||r.call(this,e)},e}(),We=function(){function e(e){this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;var t=this;this.restorePatches.push(Z(HTMLElement.prototype,"attachShadow",(function(e){return function(){var r=e.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),r}})))}return e.prototype.addShadowRoot=function(e,t){Ne(r(r({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),_e(r(r({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))},e.prototype.observeAttachShadow=function(e){if(e.contentWindow){var t=this;this.restorePatches.push(Z(e.contentWindow.HTMLElement.prototype,"attachShadow",(function(r){return function(){var n=r.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),n}})))}},e.prototype.reset=function(){this.restorePatches.forEach((function(e){return e()}))},e}();for(var je="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ue="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ze=0;ze<je.length;ze++)Ue[je.charCodeAt(ze)]=ze;var He=new Map;var Ve=function(e,t,r){if(e&&(qe(e,t)||"object"==typeof e)){var n=function(e,t){var r=He.get(e);return r||(r=new Map,He.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),o=n.indexOf(e);return-1===o&&(o=n.length,n.push(e)),o}};function Be(e,t,r){return e instanceof Array?e.map((function(e){return Be(e,t,r)})):null===e?e: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?{rr_type:e.constructor.name,args:[Object.values(e)]}:e instanceof ArrayBuffer?{rr_type:e.constructor.name,base64:function(e){var t,r=new Uint8Array(e),n=r.length,o="";for(t=0;t<n;t+=3)o+=je[r[t]>>2],o+=je[(3&r[t])<<4|r[t+1]>>4],o+=je[(15&r[t+1])<<2|r[t+2]>>6],o+=je[63&r[t+2]];return n%3==2?o=o.substring(0,o.length-1)+"=":n%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e)}:e instanceof DataView?{rr_type:e.constructor.name,args:[Be(e.buffer,t,r),e.byteOffset,e.byteLength]}:e instanceof HTMLImageElement?{rr_type:e.constructor.name,src:e.src}:e instanceof ImageData?{rr_type:e.constructor.name,args:[Be(e.data,t,r),e.width,e.height]}:qe(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:Ve(e,t,r)}:e}var Ge=function(e,t,r){return i([],o(e),!1).map((function(e){return Be(e,t,r)}))},qe=function(e,t){var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((function(e){return"function"==typeof t[e]}));return Boolean(r.find((function(r){return e instanceof t[r]})))};function Ye(e,t,r,a,s,l){var c,u,d=[],f=Object.getOwnPropertyNames(e),p=function(n){try{if("function"!=typeof e[n])return"continue";var c=Z(e,n,(function(c){return function(){for(var u=[],d=0;d<arguments.length;d++)u[d]=arguments[d];var f=c.apply(this,u);if(Ve(f,l,e),!ne(this.canvas,a)){s.getId(this.canvas);var p=Ge(i([],o(u),!1),l,e),h={type:t,property:n,args:p};r(this.canvas,h)}return f}}));d.push(c)}catch(o){var u=K(e,n,{set:function(e){r(this.canvas,{type:t,property:n,args:[e],setter:!0})}});d.push(u)}};try{for(var h=n(f),m=h.next();!m.done;m=h.next()){p(m.value)}}catch(e){c={error:e}}finally{try{m&&!m.done&&(u=h.return)&&u.call(h)}finally{if(c)throw c.error}}return d}var Xe,Qe,$e=function(){function e(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(e,t){!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)},this.mutationCb=e.mutationCb,this.mirror=e.mirror,!0===e.recordCanvas&&this.initCanvasMutationObserver(e.win,e.blockClass)}return e.prototype.reset=function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()},e.prototype.freeze=function(){this.frozen=!0},e.prototype.unfreeze=function(){this.frozen=!1},e.prototype.lock=function(){this.locked=!0},e.prototype.unlock=function(){this.locked=!1},e.prototype.initCanvasMutationObserver=function(e,t){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var r=function(e,t){var r=[];try{var n=Z(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(r){for(var n=[],a=1;a<arguments.length;a++)n[a-1]=arguments[a];return ne(this,t)||"__context"in this||(this.__context=r),e.apply(this,i([r],o(n),!1))}}));r.push(n)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){r.forEach((function(e){return e()}))}}(e,t),a=function(e,t,r,a){var s,l,c=[],u=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),d=function(n){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[n])return"continue";var a=Z(t.CanvasRenderingContext2D.prototype,n,(function(t){return function(){for(var a=this,s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];return ne(this.canvas,r)||setTimeout((function(){var t=i([],o(s),!1);if("drawImage"===n&&t[0]&&t[0]instanceof HTMLCanvasElement){var r=t[0],l=r.getContext("2d"),c=null==l?void 0:l.getImageData(0,0,r.width,r.height),u=null==c?void 0:c.data;t[0]=JSON.stringify(u)}e(a.canvas,{type:W["2D"],property:n,args:t})}),0),t.apply(this,s)}}));c.push(a)}catch(r){var s=K(t.CanvasRenderingContext2D.prototype,n,{set:function(t){e(this.canvas,{type:W["2D"],property:n,args:[t],setter:!0})}});c.push(s)}};try{for(var f=n(u),p=f.next();!p.done;p=f.next())d(p.value)}catch(e){s={error:e}}finally{try{p&&!p.done&&(l=f.return)&&l.call(f)}finally{if(s)throw s.error}}return function(){c.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,this.mirror),s=function(e,t,r,n){var a=[];return a.push.apply(a,i([],o(Ye(t.WebGLRenderingContext.prototype,W.WebGL,e,r,n,t)),!1)),void 0!==t.WebGL2RenderingContext&&a.push.apply(a,i([],o(Ye(t.WebGL2RenderingContext.prototype,W.WebGL2,e,r,n,t)),!1)),function(){a.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,this.mirror);this.resetObservers=function(){r(),a(),s()}},e.prototype.startPendingCanvasMutationFlusher=function(){var e=this;requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))},e.prototype.startRAFTimestamping=function(){var e=this,t=function(r){e.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)},e.prototype.flushPendingCanvasMutations=function(){var e=this;this.pendingCanvasMutations.forEach((function(t,r){var n=e.mirror.getId(r);e.flushPendingCanvasMutationFor(r,n)})),requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))},e.prototype.flushPendingCanvasMutationFor=function(e,t){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(e);if(r&&-1!==t){var n=r.map((function(e){return e.type,function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["type"])})),o=r[0].type;this.mutationCb({id:t,type:o,commands:n}),this.pendingCanvasMutations.delete(e)}}},e}();function Je(e){return r(r({},e),{timestamp:Date.now()})}var Ke={map:{},getId:function(e){return e&&e.__sn?e.__sn.id:-1},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,r=e.__sn&&e.__sn.id;delete this.map[r],e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}};function Ze(t){void 0===t&&(t={});var i=t.emit,a=t.checkoutEveryNms,s=t.checkoutEveryNth,l=t.blockClass,c=void 0===l?"highlight-block":l,u=t.blockSelector,d=void 0===u?null:u,f=t.ignoreClass,p=void 0===f?"highlight-ignore":f,h=t.maskTextClass,m=void 0===h?"highlight-mask":h,v=t.maskTextSelector,y=void 0===v?null:v,g=t.inlineStylesheet,b=void 0===g||g,S=t.maskAllInputs,w=t.maskInputOptions,x=t.slimDOMOptions,T=t.maskInputFn,E=t.maskTextFn,I=t.hooks,C=t.packFn,M=t.sampling,k=void 0===M?{}:M,R=t.mousemoveWait,_=t.recordCanvas,O=void 0!==_&&_,L=t.userTriggeredOnInput,A=void 0!==L&&L,D=t.collectFonts,F=void 0!==D&&D,P=t.inlineImages,W=void 0!==P&&P,j=t.plugins,U=t.keepIframeSrcFn,z=void 0===U?function(){return!1}:U,H=t.enableStrictPrivacy,V=void 0!==H&&H;if(!i)throw new Error("emit function is required");void 0!==R&&void 0===k.mousemove&&(k.mousemove=R);var B,G=!0===S?{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}:void 0!==w?w:{password:!0},q=!0===x||"all"===x?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===x,headMetaDescKeywords:"all"===x}:x||{};se();var Y=0;Xe=function(t,r){var o;if(!(null===(o=Te[0])||void 0===o?void 0:o.isFrozen())||t.type===e.EventType.FullSnapshot||t.type===e.EventType.IncrementalSnapshot&&t.data.source===e.IncrementalSource.Mutation||Te.forEach((function(e){return e.unfreeze()})),i(function(e){var t,r;try{for(var o=n(j||[]),i=o.next();!i.done;i=o.next()){var a=i.value;a.eventProcessor&&(e=a.eventProcessor(e))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return C&&(e=C(e)),e}(t),r),t.type===e.EventType.FullSnapshot)B=t,Y=0;else if(t.type===e.EventType.IncrementalSnapshot){if(t.data.source===e.IncrementalSource.Mutation&&t.data.isAttachIframe)return;Y++;var l=s&&Y>=s,c=a&&t.timestamp-B.timestamp>a;(l||c)&&Qe(!0)}};var Q=function(t){Xe(Je({type:e.EventType.IncrementalSnapshot,data:r({source:e.IncrementalSource.Mutation},t)}))},$=function(t){return Xe(Je({type:e.EventType.IncrementalSnapshot,data:r({source:e.IncrementalSource.Scroll},t)}))},J=function(t){return Xe(Je({type:e.EventType.IncrementalSnapshot,data:r({source:e.IncrementalSource.CanvasMutation},t)}))},K=new Pe({mutationCb:Q}),Z=new $e({recordCanvas:O,mutationCb:J,win:window,blockClass:c,mirror:Ke}),re=new We({mutationCb:Q,scrollCb:$,bypassOptions:{blockClass:c,blockSelector:d,maskTextClass:m,maskTextSelector:y,inlineStylesheet:b,maskInputOptions:G,maskTextFn:E,maskInputFn:T,recordCanvas:O,inlineImages:W,sampling:k,slimDOMOptions:q,iframeManager:K,canvasManager:Z,enableStrictPrivacy:V},mirror:Ke});Qe=function(t){var r,n,i,a;void 0===t&&(t=!1),Xe(Je({type:e.EventType.Meta,data:{href:window.location.href,width:te(),height:ee()}}),t),Te.forEach((function(e){return e.lock()}));var s=o(function(e,t){var r=t||{},n=r.blockClass,o=void 0===n?"highlight-block":n,i=r.blockSelector,a=void 0===i?null:i,s=r.maskTextClass,l=void 0===s?"highlight-mask":s,c=r.maskTextSelector,u=void 0===c?null:c,d=r.inlineStylesheet,f=void 0===d||d,p=r.inlineImages,h=void 0!==p&&p,m=r.recordCanvas,v=void 0!==m&&m,y=r.maskAllInputs,g=void 0!==y&&y,b=r.maskTextFn,S=r.maskInputFn,w=r.slimDOM,x=void 0!==w&&w,T=r.dataURLOptions,E=r.preserveWhiteSpace,I=r.onSerialize,C=r.onIframeLoad,M=r.iframeLoadTimeout,k=r.keepIframeSrcFn,R=void 0===k?function(){return!1}:k,_=r.enableStrictPrivacy,O={};return[N(e,{doc:e,map:O,blockClass:o,blockSelector:a,maskTextClass:l,maskTextSelector:u,skipChild:!1,inlineStylesheet:f,maskInputOptions:!0===g?{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}:!1===g?{password:!0}:g,maskTextFn:b,maskInputFn:S,slimDOMOptions:!0===x||"all"===x?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===x,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===x?{}:x,dataURLOptions:T,inlineImages:h,recordCanvas:v,preserveWhiteSpace:E,onSerialize:I,onIframeLoad:C,iframeLoadTimeout:M,keepIframeSrcFn:R,enableStrictPrivacy:void 0!==_&&_}),O]}(document,{blockClass:c,blockSelector:d,maskTextClass:m,maskTextSelector:y,inlineStylesheet:b,maskAllInputs:G,maskTextFn:E,slimDOM:q,recordCanvas:O,inlineImages:W,enableStrictPrivacy:V,onSerialize:function(e){de(e)&&K.addIframe(e),pe(e)&&re.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){K.attachIframe(e,t),re.observeAttachShadow(e)},keepIframeSrcFn:z}),2),l=s[0],u=s[1];if(!l)return console.warn("Failed to snapshot the document");Ke.map=u,Xe(Je({type:e.EventType.FullSnapshot,data:{node:l,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(r=null===document||void 0===document?void 0:document.body)||void 0===r?void 0:r.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===document||void 0===document?void 0:document.body.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(a=null===(i=null===document||void 0===document?void 0:document.body)||void 0===i?void 0:i.parentElement)||void 0===a?void 0:a.scrollTop)||(null===document||void 0===document?void 0:document.body.scrollTop)||0}}})),Te.forEach((function(e){return e.unlock()}))};try{var ne=[];ne.push(X("DOMContentLoaded",(function(){Xe(Je({type:e.EventType.DomContentLoaded,data:{}}))})));var oe=function(t){var n;return Fe({mutationCb:Q,mousemoveCb:function(t,r){return Xe(Je({type:e.EventType.IncrementalSnapshot,data:{source:r,positions:t}}))},mouseInteractionCb:function(t){return Xe(Je({type:e.EventType.IncrementalSnapshot,data:r({source:e.IncrementalSource.MouseInteraction},t)}))},scrollCb:$,viewportResizeCb:function(t){return Xe(Je({type:e.EventType.IncrementalSnapshot,data:r({source:e.IncrementalSource.ViewportResize},t)}))},inputCb:function(t){return Xe(Je({type:e.EventType.IncrementalSnapshot,data:r({source:e.IncrementalSource.Input},t)}))},mediaInteractionCb:function(t){return Xe(Je({type:e.EventType.IncrementalSnapshot,data:r({source:e.IncrementalSource.MediaInteraction},t)}))},styleSheetRuleCb:function(t){return Xe(Je({type:e.EventType.IncrementalSnapshot,data:r({source:e.IncrementalSource.StyleSheetRule},t)}))},styleDeclarationCb:function(t){return Xe(Je({type:e.EventType.IncrementalSnapshot,data:r({source:e.IncrementalSource.StyleDeclaration},t)}))},canvasMutationCb:J,fontCb:function(t){return Xe(Je({type:e.EventType.IncrementalSnapshot,data:r({source:e.IncrementalSource.Font},t)}))},blockClass:c,ignoreClass:p,maskTextClass:m,maskTextSelector:y,maskInputOptions:G,inlineStylesheet:b,sampling:k,recordCanvas:O,inlineImages:W,userTriggeredOnInput:A,collectFonts:F,doc:t,maskInputFn:T,maskTextFn:E,blockSelector:d,slimDOMOptions:q,mirror:Ke,iframeManager:K,shadowDomManager:re,canvasManager:Z,enableStrictPrivacy:V,plugins:(null===(n=null==j?void 0:j.filter((function(e){return e.observer})))||void 0===n?void 0:n.map((function(t){return{observer:t.observer,options:t.options,callback:function(r){return Xe(Je({type:e.EventType.Plugin,data:{plugin:t.name,payload:r}}))}}})))||[]},I)};K.addLoadListener((function(e){ne.push(oe(e.contentDocument))}));var ie=function(){Qe(),ne.push(oe(document))};return"interactive"===document.readyState||"complete"===document.readyState?ie():ne.push(X("load",(function(){Xe(Je({type:e.EventType.Load,data:{}})),ie()}),window)),function(){ne.forEach((function(e){return e()}))}}catch(e){console.warn(e)}}function et(e){return e=e||Object.create(null),{on:function(t,r){(e[t]||(e[t]=[])).push(r)},off:function(t,r){e[t]&&e[t].splice(e[t].indexOf(r)>>>0,1)},emit:function(t,r){(e[t]||[]).slice().map((function(e){e(r)})),(e["*"]||[]).slice().map((function(e){e(t,r)}))}}}Ze.addCustomEvent=function(t,r){Xe&&Xe(Je({type:e.EventType.Custom,data:{tag:t,payload:r}}))},Ze.freezePage=function(){Te.forEach((function(e){return e.freeze()}))},Ze.takeFullSnapshot=function(e){if(!Qe)throw new Error("please take full snapshot after start recording");Qe(e)},Ze.mirror=Ke;var tt=Object.freeze({__proto__:null,default:et});function rt(e,t){if(void 0===e&&(e=window),void 0===t&&(t=document),!("scrollBehavior"in t.documentElement.style)||!0===e.__forceSmoothScrollPolyfill__){var r,n=e.HTMLElement||e.Element,o={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:n.prototype.scroll||s,scrollIntoView:n.prototype.scrollIntoView},i=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,a=(r=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(r)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?h.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):o.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(l(arguments[0])?o.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):h.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},n.prototype.scroll=n.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==l(arguments[0])){var e=arguments[0].left,t=arguments[0].top;h.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");o.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},n.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):o.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},n.prototype.scrollIntoView=function(){if(!0!==l(arguments[0])){var r=f(this),n=r.getBoundingClientRect(),i=this.getBoundingClientRect();r!==t.body?(h.call(this,r,r.scrollLeft+i.left-n.left,r.scrollTop+i.top-n.top),"fixed"!==e.getComputedStyle(r).position&&e.scrollBy({left:n.left,top:n.top,behavior:"smooth"})):e.scrollBy({left:i.left,top:i.top,behavior:"smooth"})}else o.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function s(e,t){this.scrollLeft=e,this.scrollTop=t}function l(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function c(e,t){return"Y"===t?e.clientHeight+a<e.scrollHeight:"X"===t?e.clientWidth+a<e.scrollWidth:void 0}function u(t,r){var n=e.getComputedStyle(t,null)["overflow"+r];return"auto"===n||"scroll"===n}function d(e){var t=c(e,"Y")&&u(e,"Y"),r=c(e,"X")&&u(e,"X");return t||r}function f(e){for(;e!==t.body&&!1===d(e);)e=e.parentNode||e.host;return e}function p(t){var r,n,o,a,s=(i()-t.startTime)/468;a=s=s>1?1:s,r=.5*(1-Math.cos(Math.PI*a)),n=t.startX+(t.x-t.startX)*r,o=t.startY+(t.y-t.startY)*r,t.method.call(t.scrollable,n,o),n===t.x&&o===t.y||e.requestAnimationFrame(p.bind(e,t))}function h(r,n,a){var l,c,u,d,f=i();r===t.body?(l=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=o.scroll):(l=r,c=r.scrollLeft,u=r.scrollTop,d=s),p({scrollable:l,method:d,startTime:f,startX:c,startY:u,x:n,y:a})}}var nt,ot=function(){function e(e,t){void 0===e&&(e=[]),this.timeOffset=0,this.raf=null,this.actions=e,this.speed=t}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){this.actions=this.actions.concat(e)},e.prototype.replaceActions=function(e){var t;this.actions.length=0,(t=this.actions).splice.apply(t,i([0,0],o(e),!1))},e.prototype.start=function(){this.timeOffset=0;var e=performance.now(),t=this.actions,r=this;this.raf=requestAnimationFrame((function n(){var o=performance.now();for(r.timeOffset+=(o-e)*r.speed,e=o;t.length;){var i=t[0];if(!(r.timeOffset>=i.delay))break;t.shift(),i.doAction()}(t.length>0||r.liveMode)&&(r.raf=requestAnimationFrame(n))}))},e.prototype.clear=function(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0},e.prototype.setSpeed=function(e){this.speed=e},e.prototype.toggleLiveMode=function(e){this.liveMode=e},e.prototype.isActive=function(){return null!==this.raf},e.prototype.findActionIndex=function(e){for(var t=0,r=this.actions.length-1;t<=r;){var n=Math.floor((t+r)/2);if(this.actions[n].delay<e.delay)t=n+1;else{if(!(this.actions[n].delay>e.delay))return n+1;r=n-1}}return t},e}();function it(t,r){if(t.type===e.EventType.IncrementalSnapshot&&t.data.source===e.IncrementalSource.MouseMove){var n=t.data.positions[0].timeOffset,o=t.timestamp+n;return t.delay=o-r,o-r}return t.delay=t.timestamp-r,t.delay}
16
- /*! *****************************************************************************
17
- Copyright (c) Microsoft Corporation.
18
-
19
- Permission to use, copy, modify, and/or distribute this software for any
20
- purpose with or without fee is hereby granted.
21
-
22
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
23
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
24
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
25
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
26
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
27
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
28
- PERFORMANCE OF THIS SOFTWARE.
29
- ***************************************************************************** */function at(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(nt||(nt={}));var st={type:"xstate.init"};function lt(e){return void 0===e?[]:[].concat(e)}function ct(e){return{type:"xstate.assign",assignment:e}}function ut(e,t){return"string"==typeof(e="string"==typeof e&&t&&t[e]?t[e]:e)?{type:e}:"function"==typeof e?{type:e.name,exec:e}:e}function dt(e){return function(t){return e===t}}function ft(e){return"string"==typeof e?{type:e}:e}function pt(e,t){return{value:e,context:t,actions:[],changed:!1,matches:dt(e)}}function ht(e,t,r){var n=t,o=!1;return[e.filter((function(e){if("xstate.assign"===e.type){o=!0;var t=Object.assign({},n);return"function"==typeof e.assignment?t=e.assignment(n,r):Object.keys(e.assignment).forEach((function(o){t[o]="function"==typeof e.assignment[o]?e.assignment[o](n,r):e.assignment[o]})),n=t,!1}return!0})),n,o]}function mt(e,t){void 0===t&&(t={});var r=at(ht(lt(e.states[e.initial].entry).map((function(e){return ut(e,t.actions)})),e.context,st),2),n=r[0],o=r[1],i={config:e,_options:t,initialState:{value:e.initial,actions:n,context:o,matches:dt(e.initial)},transition:function(t,r){var n,o,a="string"==typeof t?{value:t,context:e.context}:t,s=a.value,l=a.context,c=ft(r),u=e.states[s];if(u.on){var d=lt(u.on[c.type]);try{for(var f=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(d),p=f.next();!p.done;p=f.next()){var h=p.value;if(void 0===h)return pt(s,l);var m="string"==typeof h?{target:h}:h,v=m.target,y=m.actions,g=void 0===y?[]:y,b=m.cond,S=void 0===b?function(){return!0}:b,w=void 0===v,x=null!=v?v:s,T=e.states[x];if(S(l,c)){var E=at(ht((w?lt(g):[].concat(u.exit,g,T.entry).filter((function(e){return e}))).map((function(e){return ut(e,i._options.actions)})),l,c),3),I=E[0],C=E[1],M=E[2],k=null!=v?v:s;return{value:k,context:C,actions:I,changed:v!==s||I.length>0||M,matches:dt(k)}}}}catch(e){n={error:e}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}}return pt(s,l)}};return i}var vt=function(e,t){return e.actions.forEach((function(r){var n=r.exec;return n&&n(e.context,t)}))};function yt(e){var t=e.initialState,r=nt.NotStarted,n=new Set,o={_machine:e,send:function(o){r===nt.Running&&(t=e.transition(t,o),vt(t,ft(o)),n.forEach((function(e){return e(t)})))},subscribe:function(e){return n.add(e),e(t),{unsubscribe:function(){return n.delete(e)}}},start:function(n){if(n){var i="object"==typeof n?n:{context:e.config.context,value:n};t={value:i.value,actions:[],context:i.context,matches:dt(i.value)}}return r=nt.Running,vt(t,st),o},stop:function(){return r=nt.Stopped,n.clear(),o},get state(){return t},get status(){return r}};return o}function gt(t,o){var i=o.getCastFn,a=o.applyEventsSynchronously,s=o.emitter;return yt(mt({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:ct({lastPlayedEvent:function(e,t){return"CAST_EVENT"===t.type?t.payload.event:e.lastPlayedEvent}}),recordTimeOffset:ct((function(e,t){var n=e.timeOffset;return"payload"in t&&"timeOffset"in t.payload&&(n=t.payload.timeOffset),r(r({},e),{timeOffset:n,baselineTime:e.events[0].timestamp+n})})),play:function(t){var r,o,l,c,u,d=t.timer,f=t.events,p=t.baselineTime,h=t.lastPlayedEvent;d.clear();try{for(var m=n(f),v=m.next();!v.done;v=m.next()){it(v.value,p)}}catch(e){r={error:e}}finally{try{v&&!v.done&&(o=m.return)&&o.call(m)}finally{if(r)throw r.error}}var y=function(t,r){for(var n=t.length-1;n>=0;n--){var o=t[n];if(o.type===e.EventType.Meta&&o.timestamp<=r)return t.slice(n)}return t}(f,p),g=null==h?void 0:h.timestamp;(null==h?void 0:h.type)===e.EventType.IncrementalSnapshot&&h.data.source===e.IncrementalSource.MouseMove&&(g=h.timestamp+(null===(u=h.data.positions[0])||void 0===u?void 0:u.timeOffset)),p<(g||0)&&s.emit(e.ReplayerEvents.PlayBack);var b=new Array,S=new Array,w=function(e){if(g&&g<p&&(e.timestamp<=g||e===h))return"continue";if(e.timestamp<p)b.push(e);else{var t=i(e,!1);S.push({doAction:function(){t()},delay:e.delay})}};try{for(var x=n(y),T=x.next();!T.done;T=x.next()){w(T.value)}}catch(e){l={error:e}}finally{try{T&&!T.done&&(c=x.return)&&c.call(x)}finally{if(l)throw l.error}}a(b),s.emit(e.ReplayerEvents.Flush),d.addActions(S),d.start()},pause:function(e){e.timer.clear()},resetLastPlayedEvent:ct((function(e){return r(r({},e),{lastPlayedEvent:null})})),startLive:ct({baselineTime:function(e,t){return e.timer.toggleLiveMode(!0),e.timer.start(),"TO_LIVE"===t.type&&t.payload.baselineTime?t.payload.baselineTime:Date.now()}}),replaceEvents:ct((function(e,t){var o,a,s=e.events,l=e.timer,c=e.baselineTime;if("REPLACE_EVENTS"===t.type){var u=t.payload.events;s.length=0;var d=[],f=function(e){if(it(e,c),s.push(e),e.timestamp>=l.timeOffset+c){var t=i(e,!1);d.push({doAction:function(){t()},delay:e.delay})}};try{for(var p=n(u),h=p.next();!h.done;h=p.next()){f(h.value)}}catch(e){o={error:e}}finally{try{h&&!h.done&&(a=p.return)&&a.call(p)}finally{if(o)throw o.error}}l.isActive()&&l.replaceActions(d)}return r(r({},e),{events:s})})),addEvent:ct((function(e,t){var n=e.baselineTime,o=e.timer,a=e.events;if("ADD_EVENT"===t.type){var s=t.payload.event;it(s,n);var l=a.length-1;if(!a[l]||a[l].timestamp<=s.timestamp)a.push(s);else{for(var c=-1,u=0;u<=l;){var d=Math.floor((u+l)/2);a[d].timestamp<=s.timestamp?u=d+1:l=d-1}-1===c&&(c=u),a.splice(c,0,s)}var f=s.timestamp<n,p=i(s,f);f?p():o.isActive()&&o.addAction({doAction:function(){p()},delay:s.delay})}return r(r({},e),{events:a})}))}}))}var bt;function St(e,t){var r=e[t[0]];return 1===t.length?r:St(r.cssRules[t[1]].cssRules,t.slice(2))}function wt(e){var t=i([],o(e),!1),r=t.pop();return{positions:t,index:r}}function xt(e,t){var r=t.sheet;r&&e.forEach((function(e){if(e.type===bt.Insert)try{if(Array.isArray(e.index)){var n=wt(e.index),i=n.positions,a=n.index;St(r.cssRules,i).insertRule(e.cssText,a)}else r.insertRule(e.cssText,e.index)}catch(e){}else if(e.type===bt.Remove)try{if(Array.isArray(e.index)){var s=wt(e.index);i=s.positions,a=s.index;St(r.cssRules,i).deleteRule(a||0)}else r.deleteRule(e.index)}catch(e){}else if(e.type===bt.Snapshot)!function(e,t){var r;try{var n=Array.from((null===(r=t.sheet)||void 0===r?void 0:r.cssRules)||[]).map((function(e){return e.cssText})),i=Object.entries(n).reverse(),a=n.length;i.forEach((function(r){var n,i=o(r,2),s=i[0],l=i[1],c=e.indexOf(l);if(-1===c||c>a)try{null===(n=t.sheet)||void 0===n||n.deleteRule(Number(s))}catch(e){}a=c})),e.forEach((function(e,r){var n,o,i;try{(null===(o=null===(n=t.sheet)||void 0===n?void 0:n.cssRules[r])||void 0===o?void 0:o.cssText)!==e&&(null===(i=t.sheet)||void 0===i||i.insertRule(e,r))}catch(e){}}))}catch(e){}}(e.cssTexts,t);else if(e.type===bt.SetProperty){St(r.cssRules,e.index).style.setProperty(e.property,e.value,e.priority)}else if(e.type===bt.RemoveProperty){St(r.cssRules,e.index).style.removeProperty(e.property)}}))}!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"}(bt||(bt={}));var Tt=new Map;function Et(e,t){var r=Tt.get(e);return r||(r=new Map,Tt.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}var It=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function Ct(e,t){return function(r){if(r&&"object"==typeof r&&"rr_type"in r){if("index"in r){var n=r.rr_type,a=r.index;return Et(t,n)[a]}if("args"in r){var s=r.rr_type,l=r.args,c=window[s];return new(c.bind.apply(c,i([void 0],o(l.map(Ct(e,t))),!1)))}if("base64"in r)return function(e){var t,r,n,o,i,a=.75*e.length,s=e.length,l=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var c=new ArrayBuffer(a),u=new Uint8Array(c);for(t=0;t<s;t+=4)r=Ue[e.charCodeAt(t)],n=Ue[e.charCodeAt(t+1)],o=Ue[e.charCodeAt(t+2)],i=Ue[e.charCodeAt(t+3)],u[l++]=r<<2|n>>4,u[l++]=(15&n)<<4|o>>2,u[l++]=(3&o)<<6|63&i;return c}(r.base64);if("src"in r){var u=e.get(r.src);if(u)return u;var d=new Image;return d.src=r.src,e.set(r.src,d),d}}else if(Array.isArray(r))return r.map(Ct(e,t));return r}}function Mt(e){var t=e.mutation,r=e.target,n=e.type,o=e.imageMap,i=e.errorHandler;try{var a=function(e,t){try{return t===W.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch(e){return null}}(r,n);if(!a)return;if(t.setter)return void(a[t.property]=t.args[0]);var s=a[t.property],l=t.args.map(Ct(o,a));!function(e,t){if(null==t?void 0:t.constructor){var r=t.constructor.name;if(It.includes(r)){var n=Et(e,r);n.includes(t)||n.push(t)}}}(a,s.apply(a,l))}catch(e){i(t,e)}}var kt=36e5,Nt=et||tt,Rt="[replayer]",_t={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Ot(t){return t.type==e.EventType.IncrementalSnapshot&&(t.data.source==e.IncrementalSource.TouchMove||t.data.source==e.IncrementalSource.MouseInteraction&&t.data.type==e.MouseInteractions.TouchStart)}var Lt=function(){function a(t,r){var o=this;if(this.mouseTail=null,this.tailPositions=[],this.emitter=Nt(),this.activityIntervals=[],this.legacy_missingNodeRetryMap={},this.cache=B(),this.imageMap=new Map,this.mirror={map:{},getId:function(e){return e&&e.__sn?e.__sn.id:-1},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,r=e.__sn&&e.__sn.id;delete this.map[r],e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}},this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,!(null==r?void 0:r.liveMode)&&t.length<2)throw new Error("Replayer need at least 2 events.");var i={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,inactiveThreshold:.02,inactiveSkipTime:2e3};this.config=Object.assign({},i,r),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(e.ReplayerEvents.Resize,this.handleResize),this.setupDom(),this.treeIndex=new le,this.fragmentParentMap=new Map,this.elementStateMap=new Map,this.virtualStyleRulesMap=new Map,this.emitter.on(e.ReplayerEvents.Flush,(function(){var e,t,r,i,a,s,l,c,u=o.treeIndex.flush(),d=u.scrollMap,f=u.inputMap,p=u.mutationData;o.fragmentParentMap.forEach((function(e,t){return o.restoreRealParent(t,e)}));try{for(var h=n(p.texts),m=h.next();!m.done;m=h.next()){var v=m.value;o.applyText(v,p)}}catch(t){e={error:t}}finally{try{m&&!m.done&&(t=h.return)&&t.call(h)}finally{if(e)throw e.error}}try{for(var y=n(o.virtualStyleRulesMap.keys()),g=y.next();!g.done;g=y.next()){var b=g.value;o.restoreNodeSheet(b)}}catch(e){r={error:e}}finally{try{g&&!g.done&&(i=y.return)&&i.call(y)}finally{if(r)throw r.error}}o.fragmentParentMap.clear(),o.elementStateMap.clear(),o.virtualStyleRulesMap.clear();try{for(var S=n(d.values()),w=S.next();!w.done;w=S.next()){v=w.value;o.applyScroll(v,!0)}}catch(e){a={error:e}}finally{try{w&&!w.done&&(s=S.return)&&s.call(S)}finally{if(a)throw a.error}}try{for(var x=n(f.values()),T=x.next();!T.done;T=x.next()){v=T.value;o.applyInput(v)}}catch(e){l={error:e}}finally{try{T&&!T.done&&(c=x.return)&&c.call(x)}finally{if(l)throw l.error}}})),this.emitter.on(e.ReplayerEvents.PlayBack,(function(){o.firstFullSnapshot=null,o.mirror.reset()}));var a=new ot([],(null==r?void 0:r.speed)||i.speed);this.service=gt({events:t.map((function(e){return r&&r.unpackFn?r.unpackFn(e):e})).sort((function(e,t){return e.timestamp-t.timestamp})),timer:a,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe((function(t){o.emitter.emit(e.ReplayerEvents.StateChange,{player:t})})),this.speedService=yt(mt({id:"speed",context:{normalSpeed:-1,timer:a},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:function(e,t){"payload"in t&&e.timer.setSpeed(t.payload.speed)},recordSpeed:ct({normalSpeed:function(e){return e.timer.speed}}),restoreSpeed:function(e){e.timer.setSpeed(e.normalSpeed)}}})),this.speedService.start(),this.speedService.subscribe((function(t){o.emitter.emit(e.ReplayerEvents.StateChange,{speed:t})}));var s=this.service.state.context.events.find((function(t){return t.type===e.EventType.Meta})),l=this.service.state.context.events.find((function(t){return t.type===e.EventType.FullSnapshot}));if(s){var c=s.data,u=c.width,d=c.height;setTimeout((function(){o.emitter.emit(e.ReplayerEvents.Resize,{width:u,height:d})}),0)}l&&setTimeout((function(){o.firstFullSnapshot||(o.firstFullSnapshot=l,o.rebuildFullSnapshot(l),o.iframe.contentWindow.scrollTo(l.data.initialOffset))}),1),this.service.state.context.events.find(Ot)&&this.mouse.classList.add("touch-device")}return Object.defineProperty(a.prototype,"timer",{get:function(){return this.service.state.context.timer},enumerable:!1,configurable:!0}),a.prototype.on=function(e,t){return this.emitter.on(e,t),this},a.prototype.off=function(e,t){return this.emitter.off(e,t),this},a.prototype.setConfig=function(e){var t=this;Object.keys(e).forEach((function(r){t.config[r]=e[r]})),this.config.skipInactive||this.backToNormal(),void 0!==e.speed&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),void 0!==e.mouseTail&&(!1===e.mouseTail?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"))},a.prototype.getActivityIntervals=function(){var e=this;if(0==this.activityIntervals.length){for(var t=[],r=this.getMetaData(),n=i(i([{timestamp:r.startTime}],o(this.service.state.context.events.filter((function(t){return e.isUserInteraction(t)}))),!1),[{timestamp:r.endTime}],!1),a=1;a<n.length;a++){var s=n[a-1],l=n[a];l.timestamp-s.timestamp>1e4?t.push({startTime:s.timestamp,endTime:l.timestamp,duration:l.timestamp-s.timestamp,active:!1}):t.push({startTime:s.timestamp,endTime:l.timestamp,duration:l.timestamp-s.timestamp,active:!0})}var c=[],u=t[0];for(a=1;a<t.length;a++)t[a].active!=t[a-1].active&&(c.push({startTime:u.startTime,endTime:t[a-1].endTime,duration:t[a-1].endTime-u.startTime,active:t[a-1].active}),u=t[a]);u&&t.length>0&&c.push({startTime:u.startTime,endTime:t[t.length-1].endTime,duration:t[t.length-1].endTime-u.startTime,active:t[t.length-1].active}),u=c[0];for(a=1;a<c.length;a++)(!c[a].active&&c[a].duration>this.config.inactiveThreshold*r.totalTime||!c[a-1].active&&c[a-1].duration>this.config.inactiveThreshold*r.totalTime)&&(this.activityIntervals.push({startTime:u.startTime,endTime:c[a-1].endTime,duration:c[a-1].endTime-u.startTime,active:c[a-1].active}),u=c[a]);u&&c.length>0&&this.activityIntervals.push({startTime:u.startTime,endTime:c[c.length-1].endTime,duration:c[c.length-1].endTime-u.startTime,active:c[c.length-1].active})}return this.activityIntervals},a.prototype.getMetaData=function(){var e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}},a.prototype.getCurrentTime=function(){return this.timer.timeOffset+this.getTimeOffset()},a.prototype.getTimeOffset=function(){var e=this.service.state.context;return e.baselineTime-e.events[0].timestamp},a.prototype.getMirror=function(){return this.mirror},a.prototype.play=function(t){var r;void 0===t&&(t=0),this.service.state.matches("paused")||this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:t}}),null===(r=this.iframe.contentDocument)||void 0===r||r.getElementsByTagName("html")[0].classList.remove("rrweb-paused"),this.emitter.emit(e.ReplayerEvents.Start),this.handleInactivity(this.getMetaData().startTime+t,!0)},a.prototype.pause=function(t){var r;void 0===t&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),"number"==typeof t&&(this.play(t),this.service.send({type:"PAUSE"})),null===(r=this.iframe.contentDocument)||void 0===r||r.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(e.ReplayerEvents.Pause)},a.prototype.resume=function(t){void 0===t&&(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(e.ReplayerEvents.Resume)},a.prototype.startLive=function(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})},a.prototype.addEvent=function(e){var t=this,r=this.config.unpackFn?this.config.unpackFn(e):e;Ot(r)&&this.mouse.classList.add("touch-device"),Promise.resolve().then((function(){return t.service.send({type:"ADD_EVENT",payload:{event:r}})}))},a.prototype.replaceEvents=function(e){var t,r;try{for(var o=n(e),i=o.next();!i.done;i=o.next()){if(Ot(i.value)){this.mouse.classList.add("touch-device");break}}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}this.service.send({type:"REPLACE_EVENTS",payload:{events:e}})},a.prototype.enableInteract=function(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"},a.prototype.disableInteract=function(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"},a.prototype.resetCache=function(){this.cache=B()},a.prototype.setupDom=function(){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),!1!==this.config.mouseTail&&(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");var 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&&(rt(this.iframe.contentWindow,this.iframe.contentDocument),se(this.iframe.contentWindow))},a.prototype.handleResize=function(e){var t,r;this.iframe.style.display="inherit";try{for(var o=n([this.mouseTail,this.iframe]),i=o.next();!i.done;i=o.next()){var a=i.value;a&&(a.setAttribute("width",String(e.width)),a.setAttribute("height",String(e.height)))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}},a.prototype.applyEventsSynchronously=function(t){var r,o;try{for(var i=n(t),a=i.next();!a.done;a=i.next()){var s=a.value;switch(s.type){case e.EventType.DomContentLoaded:case e.EventType.Load:case e.EventType.Custom:continue;case e.EventType.FullSnapshot:case e.EventType.Meta:case e.EventType.Plugin:break;case e.EventType.IncrementalSnapshot:switch(s.data.source){case e.IncrementalSource.MediaInteraction:continue}}this.getCastFn(s,!0)()}}catch(e){r={error:e}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}this.mousePos&&this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null,!0===this.touchActive?this.mouse.classList.add("touch-active"):!1===this.touchActive&&this.mouse.classList.remove("touch-active"),this.touchActive=null},a.prototype.getCastFn=function(t,r){var o,i=this;switch(void 0===r&&(r=!1),t.type){case e.EventType.DomContentLoaded:case e.EventType.Load:break;case e.EventType.Custom:o=function(){i.emitter.emit(e.ReplayerEvents.CustomEvent,t)};break;case e.EventType.Meta:o=function(){return i.emitter.emit(e.ReplayerEvents.Resize,{width:t.data.width,height:t.data.height})};break;case e.EventType.FullSnapshot:o=function(){if(i.firstFullSnapshot){if(i.firstFullSnapshot===t)return void(i.firstFullSnapshot=!0)}else i.firstFullSnapshot=!0;i.rebuildFullSnapshot(t,r),i.iframe.contentWindow.scrollTo(t.data.initialOffset)};break;case e.EventType.IncrementalSnapshot:o=function(){var o,a;if(i.applyIncremental(t,r),!r&&(i.handleInactivity(t.timestamp),t===i.nextUserInteractionEvent&&(i.nextUserInteractionEvent=null,i.backToNormal()),i.config.skipInactive&&!i.nextUserInteractionEvent)){try{for(var s=n(i.service.state.context.events),l=s.next();!l.done;l=s.next()){var c=l.value;if(!(c.timestamp<=t.timestamp)&&i.isUserInteraction(c)){c.delay-t.delay>1e4*i.speedService.state.context.timer.speed&&(i.nextUserInteractionEvent=c);break}}}catch(e){o={error:e}}finally{try{l&&!l.done&&(a=s.return)&&a.call(s)}finally{if(o)throw o.error}}if(i.nextUserInteractionEvent){var u=i.nextUserInteractionEvent.delay-t.delay,d={speed:Math.min(Math.round(u/2e3),i.config.maxSpeed)};i.speedService.send({type:"FAST_FORWARD",payload:d}),i.emitter.emit(e.ReplayerEvents.SkipStart,d)}}}}return function(){var a,s;o&&o();try{for(var l=n(i.config.plugins||[]),c=l.next();!c.done;c=l.next()){c.value.handler(t,r,{replayer:i})}}catch(e){a={error:e}}finally{try{c&&!c.done&&(s=l.return)&&s.call(l)}finally{if(a)throw a.error}}i.service.send({type:"CAST_EVENT",payload:{event:t}});var u=i.service.state.context.events.length-1;if(t===i.service.state.context.events[u]){var d=function(){u<i.service.state.context.events.length-1||(i.backToNormal(),i.service.send("END"),i.emitter.emit(e.ReplayerEvents.Finish))};t.type===e.EventType.IncrementalSnapshot&&t.data.source===e.IncrementalSource.MouseMove&&t.data.positions.length?setTimeout((function(){d()}),Math.max(0,50-t.data.positions[0].timeOffset)):d()}i.emitter.emit(e.ReplayerEvents.EventCast,t)}},a.prototype.handleInactivity=function(t,r){var o,i;if((t===this.inactiveEndTimestamp||r)&&(this.inactiveEndTimestamp=null,this.backToNormal()),this.config.skipInactive&&!this.inactiveEndTimestamp){try{for(var a=n(this.getActivityIntervals()),s=a.next();!s.done;s=a.next()){var l=s.value;if(t>=l.startTime&&t<l.endTime&&!l.active){this.inactiveEndTimestamp=l.endTime;break}}}catch(e){o={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}if(this.inactiveEndTimestamp){var c=this.inactiveEndTimestamp-t,u={speed:c/kt*this.config.inactiveSkipTime<1e3?c/1e3:Math.round(Math.max(c,kt)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:u}),this.emitter.emit(e.ReplayerEvents.SkipStart,u)}}},a.prototype.rebuildFullSnapshot=function(t,r){var o,i,a=this;if(void 0===r&&(r=!1),!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={};var s=[];this.mirror.map=Y(t.data.node,{doc:this.iframe.contentDocument,afterAppend:function(e){a.collectIframeAndAttachDocument(s,e)},cache:this.cache})[1];var l=function(e,t){c.attachDocumentToIframe(e,t),c.newDocumentQueue=c.newDocumentQueue.filter((function(t){return t!==e}))},c=this;try{for(var u=n(s),d=u.next();!d.done;d=u.next()){var f=d.value;l(f.mutationInQueue,f.builtNode)}}catch(e){o={error:e}}finally{try{d&&!d.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}var p=this.iframe.contentDocument,h=p.documentElement,m=p.head;this.insertStyleRules(h,m),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(e.ReplayerEvents.FullsnapshotRebuilded,t),r||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()},a.prototype.insertStyleRules=function(e,t){var r=document.createElement("style");e.insertBefore(r,t);var n,o=(n=this.config.blockClass,[".".concat(n," { background: currentColor }"),"noscript { display: none !important; }",".".concat(n," { background: currentColor; border-radius: 5px; }"),".".concat(n,":hover::after {content: 'Redacted'; color: white; background: black; text-align: center; width: 100%; display: block;}")]).concat(this.config.insertStyleRules);this.config.pauseAnimation&&o.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }");for(var i=0;i<o.length;i++)r.sheet.insertRule(o[i],i)},a.prototype.attachDocumentToIframe=function(e,r){var o,i,a=this,s=[];if(!r.contentDocument)for(var l=r.parentNode;l;){if(this.fragmentParentMap.has(l)){var c=l,u=this.fragmentParentMap.get(c);this.restoreRealParent(c,u);break}l=l.parentNode}q(e.node,{doc:r.contentDocument,map:this.mirror.map,hackCss:!0,skipChild:!1,afterAppend:function(e){if(a.collectIframeAndAttachDocument(s,e),e.__sn.type===t.Element&&"HTML"===e.__sn.tagName.toUpperCase()){var n=r.contentDocument,o=n.documentElement,i=n.head;a.insertStyleRules(o,i)}},cache:this.cache});var d=function(e,t){f.attachDocumentToIframe(e,t),f.newDocumentQueue=f.newDocumentQueue.filter((function(t){return t!==e}))},f=this;try{for(var p=n(s),h=p.next();!h.done;h=p.next()){var m=h.value;d(m.mutationInQueue,m.builtNode)}}catch(e){o={error:e}}finally{try{h&&!h.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}},a.prototype.collectIframeAndAttachDocument=function(e,t){if(de(t)){var r=this.newDocumentQueue.find((function(e){return e.parentId===t.__sn.id}));r&&e.push({mutationInQueue:r,builtNode:t})}},a.prototype.waitForStylesheetLoad=function(){var t,r=this,n=null===(t=this.iframe.contentDocument)||void 0===t?void 0:t.head;if(n){var o,i=new Set,a=this.service.state,s=function(){a=r.service.state};this.emitter.on(e.ReplayerEvents.Start,s),this.emitter.on(e.ReplayerEvents.Pause,s);var l=function(){r.emitter.off(e.ReplayerEvents.Start,s),r.emitter.off(e.ReplayerEvents.Pause,s)};n.querySelectorAll('link[rel="stylesheet"]').forEach((function(t){t.sheet||(i.add(t),t.addEventListener("load",(function(){i.delete(t),0===i.size&&-1!==o&&(a.matches("playing")&&r.play(r.getCurrentTime()),r.emitter.emit(e.ReplayerEvents.LoadStylesheetEnd),o&&clearTimeout(o),l())})))})),i.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(e.ReplayerEvents.LoadStylesheetStart),o=setTimeout((function(){a.matches("playing")&&r.play(r.getCurrentTime()),o=-1,l()}),this.config.loadTimeout))}},a.prototype.hasImageArg=function(e){var t,r;try{for(var o=n(e),i=o.next();!i.done;i=o.next()){var a=i.value;if(a&&"object"==typeof a)if("rr_type"in a&&"args"in a){if(this.hasImageArg(a.args))return!0}else{if("rr_type"in a&&"HTMLImageElement"===a.rr_type)return!0;if(a instanceof Array&&this.hasImageArg(a))return!0}else;}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return!1},a.prototype.getImageArgs=function(e){var t,r,a=[];try{for(var s=n(e),l=s.next();!l.done;l=s.next()){var c=l.value;c&&"object"==typeof c&&("rr_type"in c&&"args"in c?a.push.apply(a,i([],o(this.getImageArgs(c.args)),!1)):"rr_type"in c&&"HTMLImageElement"===c.rr_type?a.push(c.src):c instanceof Array&&a.push.apply(a,i([],o(this.getImageArgs(c)),!1)))}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return a},a.prototype.preloadAllImages=function(){var t,r,o=this;this.service.state;var i=function(){o.service.state};this.emitter.on(e.ReplayerEvents.Start,i),this.emitter.on(e.ReplayerEvents.Pause,i);var a=function(t){t.type===e.EventType.IncrementalSnapshot&&t.data.source===e.IncrementalSource.CanvasMutation&&("commands"in t.data?t.data.commands.forEach((function(e){return o.preloadImages(e,t)})):s.preloadImages(t.data,t))},s=this;try{for(var l=n(this.service.state.context.events),c=l.next();!c.done;c=l.next()){a(c.value)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}},a.prototype.preloadImages=function(e,t){var r=this;if("drawImage"!==e.property||"string"!=typeof e.args[0]||this.imageMap.has(t))this.hasImageArg(e.args)&&this.getImageArgs(e.args).forEach((function(e){var t=new Image;t.src=e,r.imageMap.set(e,t)}));else{var n=document.createElement("canvas"),o=n.getContext("2d"),i=null==o?void 0:o.createImageData(n.width,n.height);null==i||i.data,JSON.parse(e.args[0]),null==o||o.putImageData(i,0,0)}},a.prototype.applyIncremental=function(t,n){var o,i,a=this,s=t.data;switch(s.source){case e.IncrementalSource.Mutation:n&&(s.adds.forEach((function(e){return a.treeIndex.add(e)})),s.texts.forEach((function(e){var t=a.mirror.getNode(e.id),r=null==t?void 0:t.parentNode;r&&a.virtualStyleRulesMap.has(r)&&a.virtualStyleRulesMap.delete(r),a.treeIndex.text(e)})),s.attributes.forEach((function(e){return a.treeIndex.attribute(e)})),s.removes.forEach((function(e){return a.treeIndex.remove(e,a.mirror)})));try{this.applyMutation(s,n)}catch(e){this.warn("Exception in mutation ".concat(e.message||e),s)}break;case e.IncrementalSource.Drag:case e.IncrementalSource.TouchMove:case e.IncrementalSource.MouseMove:if(n){var l=s.positions[s.positions.length-1];this.mousePos={x:l.x,y:l.y,id:l.id,debugData:s}}else s.positions.forEach((function(e){var r={doAction:function(){a.moveAndHover(e.x,e.y,e.id,n,s)},delay:e.timeOffset+t.timestamp-a.service.state.context.baselineTime};a.timer.addAction(r)})),this.timer.addAction({doAction:function(){},delay:t.delay-(null===(o=s.positions[0])||void 0===o?void 0:o.timeOffset)});break;case e.IncrementalSource.MouseInteraction:if(-1===s.id)break;var c=new Event(e.MouseInteractions[s.type].toLowerCase());if(!(S=this.mirror.getNode(s.id)))return this.debugNodeNotFound(s,s.id);this.emitter.emit(e.ReplayerEvents.MouseInteraction,{type:s.type,target:S});var u=this.config.triggerFocus;switch(s.type){case e.MouseInteractions.Blur:"blur"in S&&S.blur();break;case e.MouseInteractions.Focus:u&&S.focus&&S.focus({preventScroll:!0});break;case e.MouseInteractions.Click:case e.MouseInteractions.TouchStart:case e.MouseInteractions.TouchEnd:n?(s.type===e.MouseInteractions.TouchStart?this.touchActive=!0:s.type===e.MouseInteractions.TouchEnd&&(this.touchActive=!1),this.mousePos={x:s.x,y:s.y,id:s.id,debugData:s}):(s.type===e.MouseInteractions.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(s.x,s.y,s.id,n,s),s.type===e.MouseInteractions.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):s.type===e.MouseInteractions.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):s.type===e.MouseInteractions.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case e.MouseInteractions.TouchCancel:n?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:S.dispatchEvent(c)}break;case e.IncrementalSource.Scroll:if(-1===s.id)break;if(n){this.treeIndex.scroll(s);break}this.applyScroll(s,!1);break;case e.IncrementalSource.ViewportResize:this.emitter.emit(e.ReplayerEvents.Resize,{width:s.width,height:s.height});break;case e.IncrementalSource.Input:if(-1===s.id)break;if(n){this.treeIndex.input(s);break}this.applyInput(s);break;case e.IncrementalSource.MediaInteraction:if(!(S=this.mirror.getNode(s.id)))return this.debugNodeNotFound(s,s.id);var d=S;try{s.currentTime&&(d.currentTime=s.currentTime),s.volume&&(d.volume=s.volume),s.muted&&(d.muted=s.muted),1===s.type&&d.pause(),0===s.type&&d.play()}catch(e){this.config.showWarning&&console.warn("Failed to replay media interactions: ".concat(e.message||e))}break;case e.IncrementalSource.StyleSheetRule:if(!(S=this.mirror.getNode(s.id)))return this.debugNodeNotFound(s,s.id);var f,p=S,h=S.parentNode,m=this.fragmentParentMap.has(h),v=m?null:p.sheet;v||(this.virtualStyleRulesMap.has(S)?f=this.virtualStyleRulesMap.get(S):(f=[],this.virtualStyleRulesMap.set(S,f))),s.adds&&s.adds.forEach((function(e){var t=e.rule,r=e.index;if(v)try{if(Array.isArray(r)){var n=wt(r),o=n.positions,i=n.index;St(v.cssRules,o).insertRule(t,i)}else{i=void 0===r?void 0:Math.min(r,v.cssRules.length);v.insertRule(t,i)}}catch(e){}else null==f||f.push({cssText:t,index:r,type:bt.Insert})})),s.removes&&s.removes.forEach((function(e){var t=e.index;if(m)null==f||f.push({index:t,type:bt.Remove});else try{if(Array.isArray(t)){var r=wt(t),n=r.positions,o=r.index;St(v.cssRules,n).deleteRule(o||0)}else null==v||v.deleteRule(t)}catch(e){}}));break;case e.IncrementalSource.StyleDeclaration:if(!(S=this.mirror.getNode(s.id)))return this.debugNodeNotFound(s,s.id);p=S;var y=S.parentNode,g=this.fragmentParentMap.has(y)?null:p.sheet,b=[];if(g||(this.virtualStyleRulesMap.has(S)?b=this.virtualStyleRulesMap.get(S):(b=[],this.virtualStyleRulesMap.set(S,b))),s.set)if(g)St(g.rules,s.index).style.setProperty(s.set.property,s.set.value,s.set.priority);else b.push(r({type:bt.SetProperty,index:s.index},s.set));if(s.remove)if(g)St(g.rules,s.index).style.removeProperty(s.remove.property);else b.push(r({type:bt.RemoveProperty,index:s.index},s.remove));break;case e.IncrementalSource.CanvasMutation:if(!this.config.UNSAFE_replayCanvas)return;var S;if(!(S=this.mirror.getNode(s.id)))return this.debugNodeNotFound(s,s.id);!function(e){var t=e.event,r=e.mutation,n=e.target,o=e.imageMap,i=e.errorHandler;try{var a="commands"in r?r.commands:[r];[W.WebGL,W.WebGL2].includes(r.type)?a.forEach((function(e){Mt({mutation:e,type:r.type,target:n,imageMap:o,errorHandler:i})})):a.forEach((function(e){!function(e){var t=e.event,r=e.mutation,n=e.target,o=e.imageMap,i=e.errorHandler;try{var a=n.getContext("2d");if(r.setter)return void(a[r.property]=r.args[0]);var s=a[r.property];if("drawImage"===r.property&&"string"==typeof r.args[0]){var l=o.get(t);r.args[0]=l,s.apply(a,r.args)}else s.apply(a,r.args)}catch(e){i(r,e)}}({event:t,mutation:e,target:n,imageMap:o,errorHandler:i})}))}catch(e){i(r,e)}}({event:t,mutation:s,target:S,imageMap:this.imageMap,errorHandler:this.warnCanvasMutationFailed.bind(this)});break;case e.IncrementalSource.Font:try{var w=new FontFace(s.family,s.buffer?new Uint8Array(JSON.parse(s.fontSource)):s.fontSource,s.descriptors);null===(i=this.iframe.contentDocument)||void 0===i||i.fonts.add(w)}catch(e){this.config.showWarning&&console.warn(e)}}},a.prototype.applyMutation=function(e,o){var i,a,s=this;e.removes.forEach((function(t){var r=s.mirror.getNode(t.id);if(!r){if(e.removes.find((function(e){return e.id===t.parentId})))return;return s.warnNodeNotFound(e,t.id)}s.virtualStyleRulesMap.has(r)&&s.virtualStyleRulesMap.delete(r);var n=s.mirror.getNode(t.parentId);if(!n)return s.warnNodeNotFound(e,t.parentId);if(t.isShadow&&pe(n)&&(n=n.shadowRoot),s.mirror.removeNodeFromMap(r),n){var o=null,i="__sn"in n?s.fragmentParentMap.get(n):void 0;i&&i.contains(r)?n=i:s.fragmentParentMap.has(r)&&(o=s.fragmentParentMap.get(r),s.fragmentParentMap.delete(r),r=o);try{n.removeChild(r)}catch(t){if(!(t instanceof DOMException))throw t;s.warn("parent could not remove child in mutation",n,i,r,o,e)}}}));var l=r({},this.legacy_missingNodeRetryMap),c=[],u=function(e){var r,i,a,u;if(!s.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");var d=s.mirror.getNode(e.parentId);if(!d)return e.node.type===t.Document?s.newDocumentQueue.push(e):c.push(e);var f=null;s.iframe.contentDocument.contains?f=s.iframe.contentDocument.contains(d):s.iframe.contentDocument.body.contains&&(f=s.iframe.contentDocument.body.contains(d));var p=(null===(u=(a=d).getElementsByTagName)||void 0===u?void 0:u.call(a,"iframe").length)>0;if(o&&f&&!de(d)&&!p){var h=document.createDocumentFragment();for(s.mirror.map[e.parentId]=h,s.fragmentParentMap.set(h,d),s.storeState(d);d.firstChild;)h.appendChild(d.firstChild);d=h}e.node.isShadow&&(pe(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);var m=null,v=null;if(e.previousId&&(m=s.mirror.getNode(e.previousId)),e.nextId&&(v=s.mirror.getNode(e.nextId)),function(e){var t=null;return e.nextId&&(t=s.mirror.getNode(e.nextId)),null!==e.nextId&&void 0!==e.nextId&&-1!==e.nextId&&!t}(e))return c.push(e);if(!e.node.rootId||s.mirror.getNode(e.node.rootId)){var y=e.node.rootId?s.mirror.getNode(e.node.rootId):s.iframe.contentDocument;if(de(d))s.attachDocumentToIframe(e,d);else{var g=q(e.node,{doc:y,map:s.mirror.map,skipChild:!0,hackCss:!0,cache:s.cache});if(-1!==e.previousId&&-1!==e.nextId){if("__sn"in d&&d.__sn.type===t.Element&&"textarea"===d.__sn.tagName&&e.node.type===t.Text)try{for(var b=n(Array.from(d.childNodes)),S=b.next();!S.done;S=b.next()){var w=S.value;w.nodeType===d.TEXT_NODE&&d.removeChild(w)}}catch(e){r={error:e}}finally{try{S&&!S.done&&(i=b.return)&&i.call(b)}finally{if(r)throw r.error}}if(m&&m.nextSibling&&m.nextSibling.parentNode)d.insertBefore(g,m.nextSibling);else if(v&&v.parentNode)d.contains(v)?d.insertBefore(g,v):d.insertBefore(g,null);else{if(d===y)for(;y.firstChild;)y.removeChild(y.firstChild);d.appendChild(g)}if(de(g)){var x=s.newDocumentQueue.find((function(e){return e.parentId===g.__sn.id}));x&&(s.attachDocumentToIframe(x,g),s.newDocumentQueue=s.newDocumentQueue.filter((function(e){return e!==x})))}(e.previousId||e.nextId)&&s.legacy_resolveMissingNode(l,d,g,e)}else l[e.node.id]={node:g,mutation:e}}}};e.adds.forEach((function(e){u(e)}));for(var d=Date.now();c.length;){var f=ce(c);if(c.length=0,Date.now()-d>500){this.warn("Timeout in the loop, please check the resolve tree data:",f);break}try{for(var p=(i=void 0,n(f)),h=p.next();!h.done;h=p.next()){var m=h.value;this.mirror.getNode(m.value.parentId)?ue(m,(function(e){u(e)})):this.debug("Drop resolve tree since there is no parent for the root node.",m)}}catch(e){i={error:e}}finally{try{h&&!h.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}}Object.keys(l).length&&Object.assign(this.legacy_missingNodeRetryMap,l),e.texts.forEach((function(t){var r=s.mirror.getNode(t.id);if(!r){if(e.removes.find((function(e){return e.id===t.id})))return;return s.warnNodeNotFound(e,t.id)}s.fragmentParentMap.has(r)&&(r=s.fragmentParentMap.get(r)),r.textContent=t.value})),e.attributes.forEach((function(t){var r=s.mirror.getNode(t.id);if(!r){if(e.removes.find((function(e){return e.id===t.id})))return;return s.warnNodeNotFound(e,t.id)}for(var n in s.fragmentParentMap.has(r)&&(r=s.fragmentParentMap.get(r)),t.attributes)if("string"==typeof n){var o=t.attributes[n];if(null===o)r.removeAttribute(n);else if("string"==typeof o)try{r.setAttribute(n,o)}catch(e){s.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",e)}else if("style"===n){var i=o,a=r;for(var l in i)if(!1===i[l])a.style.removeProperty(l);else if(i[l]instanceof Array){var c=i[l];a.style.setProperty(l,c[0],c[1])}else{var u=i[l];a.style.setProperty(l,u)}}}}))},a.prototype.applyScroll=function(e,r){var n=this.mirror.getNode(e.id);if(!n)return this.debugNodeNotFound(e,e.id);if(n===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:e.y,left:e.x,behavior:r?"auto":"smooth"});else if(n.__sn.type===t.Document)n.defaultView.scrollTo({top:e.y,left:e.x,behavior:r?"auto":"smooth"});else try{n.scrollTop=e.y,n.scrollLeft=e.x}catch(e){}},a.prototype.applyInput=function(e){var t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch(e){}},a.prototype.applyText=function(e,t){var r=this.mirror.getNode(e.id);if(!r)return this.debugNodeNotFound(t,e.id);try{r.textContent=e.value}catch(e){}},a.prototype.legacy_resolveMissingNode=function(e,t,r,n){var o=n.previousId,i=n.nextId,a=o&&e[o],s=i&&e[i];if(a){var l=a,c=l.node,u=l.mutation;t.insertBefore(c,r),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}if(s){var d=s;c=d.node,u=d.mutation;t.insertBefore(c,r.nextSibling),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}},a.prototype.moveAndHover=function(e,t,r,n,o){var i=this.mirror.getNode(r);if(!i)return this.debugNodeNotFound(o,r);var a=fe(i,this.iframe),s=e*a.absoluteScale+a.x,l=t*a.absoluteScale+a.y;this.mouse.style.left="".concat(s,"px"),this.mouse.style.top="".concat(l,"px"),n||this.drawMouseTail({x:s,y:l}),this.hoverElements(i)},a.prototype.drawMouseTail=function(e){var t=this;if(this.mouseTail){var r=!0===this.config.mouseTail?_t:Object.assign({},_t,this.config.mouseTail),n=r.lineCap,o=r.lineWidth,i=r.strokeStyle,a=r.duration,s=function(){if(t.mouseTail){var e=t.mouseTail.getContext("2d");e&&t.tailPositions.length&&(e.clearRect(0,0,t.mouseTail.width,t.mouseTail.height),e.beginPath(),e.lineWidth=o,e.lineCap=n,e.strokeStyle=i,e.moveTo(t.tailPositions[0].x,t.tailPositions[0].y),t.tailPositions.forEach((function(t){return e.lineTo(t.x,t.y)})),e.stroke())}};this.tailPositions.push(e),s(),setTimeout((function(){t.tailPositions=t.tailPositions.filter((function(t){return t!==e})),s()}),a/this.speedService.state.context.timer.speed)}},a.prototype.hoverElements=function(e){var t;null===(t=this.iframe.contentDocument)||void 0===t||t.querySelectorAll(".\\:hover").forEach((function(e){e.classList.remove(":hover")}));for(var r=e;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement},a.prototype.isUserInteraction=function(t){return t.type===e.EventType.IncrementalSnapshot&&(t.data.source>e.IncrementalSource.Mutation&&t.data.source<=e.IncrementalSource.Input)},a.prototype.backToNormal=function(){this.nextUserInteractionEvent=null,this.speedService.state.matches("normal")||(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(e.ReplayerEvents.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))},a.prototype.restoreRealParent=function(e,r){this.mirror.map[r.__sn.id]=r,r.__sn.type===t.Element&&"textarea"===r.__sn.tagName&&e.textContent&&(r.value=e.textContent),r.appendChild(e),this.restoreState(r)},a.prototype.storeState=function(e){var t,r;if(e&&e.nodeType===e.ELEMENT_NODE){var o=e;(o.scrollLeft||o.scrollTop)&&this.elementStateMap.set(e,{scroll:[o.scrollLeft,o.scrollTop]}),"STYLE"===o.tagName&&function(e,t){var r;try{var n=Array.from((null===(r=e.sheet)||void 0===r?void 0:r.cssRules)||[]).map((function(e){return e.cssText}));t.set(e,[{type:bt.Snapshot,cssTexts:n}])}catch(e){}}(o,this.virtualStyleRulesMap);var i=o.children;try{for(var a=n(Array.from(i)),s=a.next();!s.done;s=a.next()){var l=s.value;this.storeState(l)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}}},a.prototype.restoreState=function(e){var t,r;if(e.nodeType===e.ELEMENT_NODE){var o=e;if(this.elementStateMap.has(e)){var i=this.elementStateMap.get(e);i.scroll&&(o.scrollLeft=i.scroll[0],o.scrollTop=i.scroll[1]),this.elementStateMap.delete(e)}var a=o.children;try{for(var s=n(Array.from(a)),l=s.next();!l.done;l=s.next()){var c=l.value;this.restoreState(c)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}}},a.prototype.restoreNodeSheet=function(e){var t=this.virtualStyleRulesMap.get(e);"STYLE"===e.nodeName&&(t&&xt(t,e))},a.prototype.warnNodeNotFound=function(e,t){this.treeIndex.idRemoved(t)?this.warn("Node with id '".concat(t,"' was previously removed. "),e):this.warn("Node with id '".concat(t,"' not found. "),e)},a.prototype.warnCanvasMutationFailed=function(e,t){this.warn("Has error on canvas update",t,"canvas mutation:",e)},a.prototype.debugNodeNotFound=function(e,t){this.treeIndex.idRemoved(t)?this.debug(Rt,"Node with id '".concat(t,"' was previously removed. "),e):this.debug(Rt,"Node with id '".concat(t,"' not found. "),e)},a.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showWarning&&console.warn.apply(console,i([Rt],o(e),!1))},a.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showDebug&&console.log.apply(console,i([Rt],o(e),!1))},a}(),At=Ze.addCustomEvent,Dt=Ze.freezePage,Ft=Uint8Array,Pt=Uint16Array,Wt=Uint32Array,jt=new Ft([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]),Ut=new Ft([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]),zt=new Ft([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ht=function(e,t){for(var r=new Pt(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var o=new Wt(r[30]);for(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]},Vt=Ht(jt,2),Bt=Vt[0],Gt=Vt[1];Bt[28]=258,Gt[258]=28;for(var qt=Ht(Ut,0),Yt=qt[0],Xt=qt[1],Qt=new Pt(32768),$t=0;$t<32768;++$t){var Jt=(43690&$t)>>>1|(21845&$t)<<1;Jt=(61680&(Jt=(52428&Jt)>>>2|(13107&Jt)<<2))>>>4|(3855&Jt)<<4,Qt[$t]=((65280&Jt)>>>8|(255&Jt)<<8)>>>1}var Kt=function(e,t,r){for(var n=e.length,o=0,i=new Pt(t);o<n;++o)++i[e[o]-1];var a,s=new Pt(t);for(o=0;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;if(r){a=new Pt(1<<t);var l=15-t;for(o=0;o<n;++o)if(e[o])for(var c=o<<4|e[o],u=t-e[o],d=s[e[o]-1]++<<u,f=d|(1<<u)-1;d<=f;++d)a[Qt[d]>>>l]=c}else for(a=new Pt(n),o=0;o<n;++o)a[o]=Qt[s[e[o]-1]++]>>>15-e[o];return a},Zt=new Ft(288);for($t=0;$t<144;++$t)Zt[$t]=8;for($t=144;$t<256;++$t)Zt[$t]=9;for($t=256;$t<280;++$t)Zt[$t]=7;for($t=280;$t<288;++$t)Zt[$t]=8;var er=new Ft(32);for($t=0;$t<32;++$t)er[$t]=5;var tr=Kt(Zt,9,0),rr=Kt(Zt,9,1),nr=Kt(er,5,0),or=Kt(er,5,1),ir=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},ar=function(e,t,r){var n=t/8>>0;return(e[n]|e[n+1]<<8)>>>(7&t)&r},sr=function(e,t){var r=t/8>>0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>>(7&t)},lr=function(e){return(e/8>>0)+(7&e&&1)},cr=function(e,t,r){(null==t||t<0)&&(t=0),(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof Pt?Pt:e instanceof Wt?Wt:Ft)(r-t);return n.set(e.subarray(t,r)),n},ur=function(e,t,r){r<<=7&t;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8},dr=function(e,t,r){r<<=7&t;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},fr=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 Ft(0),0];if(1==o){var a=new Ft(r[0].s+1);return a[r[0].s]=1,[a,1]}r.sort((function(e,t){return e.f-t.f})),r.push({s:-1,f:25001});var s=r[0],l=r[1],c=0,u=1,d=2;for(r[0]={s:-1,f:s.f+l.f,l:s,r:l};u!=o-1;)s=r[r[c].f<r[d].f?c++:d++],l=r[c!=u&&r[c].f<r[d].f?c++:d++],r[u++]={s:-1,f:s.f+l.f,l:s,r:l};var f=i[0].s;for(n=1;n<o;++n)i[n].s>f&&(f=i[n].s);var p=new Pt(f+1),h=pr(r[u-1],p,0);if(h>t){n=0;var m=0,v=h-t,y=1<<v;for(i.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));n<o;++n){var g=i[n].s;if(!(p[g]>t))break;m+=y-(1<<h-p[g]),p[g]=t}for(m>>>=v;m>0;){var b=i[n].s;p[b]<t?m-=1<<t-p[b]++-1:++n}for(;n>=0&&m;--n){var S=i[n].s;p[S]==t&&(--p[S],++m)}h=t}return[new Ft(p),h]},pr=function(e,t,r){return-1==e.s?Math.max(pr(e.l,t,r+1),pr(e.r,t,r+1)):t[e.s]=r},hr=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Pt(++t),n=0,o=e[0],i=1,a=function(e){r[n++]=e},s=1;s<=t;++s)if(e[s]==o&&s!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(o),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(o);i=1,o=e[s]}return[r.subarray(0,n),t]},mr=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},vr=function(e,t,r){var n=r.length,o=lr(t+2);e[o]=255&n,e[o+1]=n>>>8,e[o+2]=255^e[o],e[o+3]=255^e[o+1];for(var i=0;i<n;++i)e[o+i+4]=r[i];return 8*(o+4+n)},yr=function(e,t,r,n,o,i,a,s,l,c,u){ur(t,u++,r),++o[256];for(var d=fr(o,15),f=d[0],p=d[1],h=fr(i,15),m=h[0],v=h[1],y=hr(f),g=y[0],b=y[1],S=hr(m),w=S[0],x=S[1],T=new Pt(19),E=0;E<g.length;++E)T[31&g[E]]++;for(E=0;E<w.length;++E)T[31&w[E]]++;for(var I=fr(T,7),C=I[0],M=I[1],k=19;k>4&&!C[zt[k-1]];--k);var N,R,_,O,L=c+5<<3,A=mr(o,Zt)+mr(i,er)+a,D=mr(o,f)+mr(i,m)+a+14+3*k+mr(T,C)+(2*T[16]+3*T[17]+7*T[18]);if(L<=A&&L<=D)return vr(t,u,e.subarray(l,l+c));if(ur(t,u,1+(D<A)),u+=2,D<A){N=Kt(f,p,0),R=f,_=Kt(m,v,0),O=m;var F=Kt(C,M,0);ur(t,u,b-257),ur(t,u+5,x-1),ur(t,u+10,k-4),u+=14;for(E=0;E<k;++E)ur(t,u+3*E,C[zt[E]]);u+=3*k;for(var P=[g,w],W=0;W<2;++W){var j=P[W];for(E=0;E<j.length;++E){var U=31&j[E];ur(t,u,F[U]),u+=C[U],U>15&&(ur(t,u,j[E]>>>5&127),u+=j[E]>>>12)}}}else N=tr,R=Zt,_=nr,O=er;for(E=0;E<s;++E)if(n[E]>255){U=n[E]>>>18&31;dr(t,u,N[U+257]),u+=R[U+257],U>7&&(ur(t,u,n[E]>>>23&31),u+=jt[U]);var z=31&n[E];dr(t,u,_[z]),u+=O[z],z>3&&(dr(t,u,n[E]>>>5&8191),u+=Ut[z])}else dr(t,u,N[n[E]]),u+=R[n[E]];return dr(t,u,N[256]),u+R[256]},gr=new Wt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),br=new Ft(0),Sr=function(e,t,r,n,o){return function(e,t,r,n,o,i){var a=e.length,s=new Ft(n+a+5*(1+Math.floor(a/7e3))+o),l=s.subarray(n,s.length-o),c=0;if(!t||a<8)for(var u=0;u<=a;u+=65535){var d=u+65535;d<a?c=vr(l,c,e.subarray(u,d)):(l[u]=i,c=vr(l,c,e.subarray(u,a)))}else{for(var f=gr[t-1],p=f>>>13,h=8191&f,m=(1<<r)-1,v=new Pt(32768),y=new Pt(m+1),g=Math.ceil(r/3),b=2*g,S=function(t){return(e[t]^e[t+1]<<g^e[t+2]<<b)&m},w=new Wt(25e3),x=new Pt(288),T=new Pt(32),E=0,I=0,C=(u=0,0),M=0,k=0;u<a;++u){var N=S(u),R=32767&u,_=y[N];if(v[R]=_,y[N]=R,M<=u){var O=a-u;if((E>7e3||C>24576)&&O>423){c=yr(e,l,0,w,x,T,I,C,k,u-k,c),C=E=I=0,k=u;for(var L=0;L<286;++L)x[L]=0;for(L=0;L<30;++L)T[L]=0}var A=2,D=0,F=h,P=R-_&32767;if(O>2&&N==S(u-P))for(var W=Math.min(p,O)-1,j=Math.min(32767,u),U=Math.min(258,O);P<=j&&--F&&R!=_;){if(e[u+A]==e[u+A-P]){for(var z=0;z<U&&e[u+z]==e[u+z-P];++z);if(z>A){if(A=z,D=P,z>W)break;var H=Math.min(P,z-2),V=0;for(L=0;L<H;++L){var B=u-P+L+32768&32767,G=B-v[B]+32768&32767;G>V&&(V=G,_=B)}}}P+=(R=_)-(_=v[R])+32768&32767}if(D){w[C++]=268435456|Gt[A]<<18|Xt[D];var q=31&Gt[A],Y=31&Xt[D];I+=jt[q]+Ut[Y],++x[257+q],++T[Y],M=u+A,++E}else w[C++]=e[u],++x[e[u]]}}c=yr(e,l,i,w,x,T,I,C,k,u-k,c),i||(c=vr(l,c,br))}return cr(s,0,n+lr(c)+o)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,r,n,!o)};function wr(e,t){void 0===t&&(t={});var r=function(){var e=1,t=0;return{p:function(r){for(var n=e,o=t,i=r.length,a=0;a!=i;){for(var s=Math.min(a+5552,i);a<s;++a)o+=n+=r[a];n%=65521,o%=65521}e=n,t=o},d:function(){return(e>>>8<<16|(255&t)<<8|t>>>8)+2*((255&e)<<23)}}}();r.p(e);var n=Sr(e,t,2,4);return function(e,t){var r=t.level,n=0==r?0:r<6?1:9==r?3:2;e[0]=120,e[1]=n<<6|(n?32-2*n:1)}(n,t),function(e,t,r){for(;r;++t)e[t]=r,r>>>=8}(n,n.length-4,r.d()),n}function xr(e,t){return function(e,t,r){var n=e.length,o=!t||r,i=!r||r.i;r||(r={}),t||(t=new Ft(3*n));var a=function(e){var r=t.length;if(e>r){var n=new Ft(Math.max(2*r,e));n.set(t),t=n}},s=r.f||0,l=r.p||0,c=r.b||0,u=r.l,d=r.d,f=r.m,p=r.n,h=8*n;do{if(!u){r.f=s=ar(e,l,1);var m=ar(e,l+1,3);if(l+=3,!m){var v=e[(M=lr(l)+4)-4]|e[M-3]<<8,y=M+v;if(y>n){if(i)throw"unexpected EOF";break}o&&a(c+v),t.set(e.subarray(M,y),c),r.b=c+=v,r.p=l=8*y;continue}if(1==m)u=rr,d=or,f=9,p=5;else{if(2!=m)throw"invalid block type";var g=ar(e,l,31)+257,b=ar(e,l+10,15)+4,S=g+ar(e,l+5,31)+1;l+=14;for(var w=new Ft(S),x=new Ft(19),T=0;T<b;++T)x[zt[T]]=ar(e,l+3*T,7);l+=3*b;var E=ir(x),I=(1<<E)-1;if(!i&&l+S*(E+7)>h)break;var C=Kt(x,E,1);for(T=0;T<S;){var M,k=C[ar(e,l,I)];if(l+=15&k,(M=k>>>4)<16)w[T++]=M;else{var N=0,R=0;for(16==M?(R=3+ar(e,l,3),l+=2,N=w[T-1]):17==M?(R=3+ar(e,l,7),l+=3):18==M&&(R=11+ar(e,l,127),l+=7);R--;)w[T++]=N}}var _=w.subarray(0,g),O=w.subarray(g);f=ir(_),p=ir(O),u=Kt(_,f,1),d=Kt(O,p,1)}if(l>h)throw"unexpected EOF"}o&&a(c+131072);for(var L=(1<<f)-1,A=(1<<p)-1,D=f+p+18;i||l+D<h;){var F=(N=u[sr(e,l)&L])>>>4;if((l+=15&N)>h)throw"unexpected EOF";if(!N)throw"invalid length/literal";if(F<256)t[c++]=F;else{if(256==F){u=null;break}var P=F-254;if(F>264){var W=jt[T=F-257];P=ar(e,l,(1<<W)-1)+Bt[T],l+=W}var j=d[sr(e,l)&A],U=j>>>4;if(!j)throw"invalid distance";if(l+=15&j,O=Yt[U],U>3&&(W=Ut[U],O+=sr(e,l)&(1<<W)-1,l+=W),l>h)throw"unexpected EOF";o&&a(c+131072);for(var z=c+P;c<z;c+=4)t[c]=t[c-O],t[c+1]=t[c+1-O],t[c+2]=t[c+2-O],t[c+3]=t[c+3-O];c=z}}r.l=u,r.p=l,r.b=c,u&&(s=1,r.m=f,r.d=d,r.n=p)}while(!s);return c==t.length?t:cr(t,0,c)}((function(e){if(8!=(15&e[0])||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(32&e[1])throw"invalid zlib data: preset dictionaries not supported"}(e),e.subarray(2,-4)),t)}function Tr(e,t){var r=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new Ft(e.length+(e.length>>>1)),o=0,i=function(e){n[o++]=e},a=0;a<r;++a){if(o+5>n.length){var s=new Ft(o+8+(r-a<<1));s.set(n),n=s}var l=e.charCodeAt(a);l<128||t?i(l):l<2048?(i(192|l>>>6),i(128|63&l)):l>55295&&l<57344?(i(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++a))>>>18),i(128|l>>>12&63),i(128|l>>>6&63),i(128|63&l)):(i(224|l>>>12),i(128|l>>>6&63),i(128|63&l))}return cr(n,0,o)}function Er(e,t){var r="";if(!t&&"undefined"!=typeof TextDecoder)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((31&o)<<6|63&e[n++]):o<240?r+=String.fromCharCode((15&o)<<12|(63&e[n++])<<6|63&e[n++]):(o=((15&o)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,r+=String.fromCharCode(55296|o>>10,56320|1023&o))}return r}var Ir="v1",Cr=function(){function e(e){this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}return e.prototype.toString=function(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t},e}(),Mr=/(^|@)\S+:\d+/,kr=/^\s*at .*(\S+:\d+|\(native\))/m,Nr=/^(eval@)?(\[native code])?$/,Rr={parse:function(e){if(!e)return[];if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(kr))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: ".concat(e));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(kr)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),n=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),o=this.extractLocation(r?r[1]:n.pop()),i=n.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new Cr({functionName:i,fileName:a,lineNumber:o[1],columnNumber:o[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Nr)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Cr({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,o=this.extractLocation(e.replace(t,""));return new Cr({functionName:n,fileName:o[0],lineNumber:o[1],columnNumber:o[2]})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),n=[],o=2,i=r.length;o<i;o+=2){var a=t.exec(r[o]);a&&n.push(new Cr({fileName:a[2],lineNumber:parseFloat(a[1])}))}return n},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),n=[],o=0,i=r.length;o<i;o+=2){var a=t.exec(r[o]);a&&n.push(new Cr({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return n},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Mr)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),r=this.extractLocation(t.pop()),n=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Cr({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function _r(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var n=e.parentElement,o=[];if(n.children&&n.children.length>0)for(var i=0;i<n.children.length;i++){var a=n.children[i];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===r&&o.push(a)}o.length>1&&(r+=":eq("+o.indexOf(e)+")"),t=r+(t?">"+t:""),e=n}return t}function Or(e){return"[object Object]"===Object.prototype.toString.call(e)}function Lr(e,t){var r,o;if(0===t)return!0;var i=Object.keys(e);try{for(var a=n(i),s=a.next();!s.done;s=a.next()){var l=s.value;if(Or(e[l])&&Lr(e[l],t-1))return!0}}catch(e){r={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return!1}function Ar(e,t){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);var n=[],o=[];return JSON.stringify(e,(function(e,t){if(n.length>0){var i=n.indexOf(this);~i?n.splice(i+1):n.push(this),~i?o.splice(i,1/0,e):o.push(e),~n.indexOf(t)&&(t=n[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,n.indexOf(t)).join(".")+"]")}else n.push(t);if(null==t)return t;if(function(e){if(Or(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Or(e)&&Lr(e,r.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t="".concat(t.slice(0,r.stringLengthLimit),"..."));return t}(t);if(t instanceof Event){var a={};for(var s in t){var l=t[s];Array.isArray(l)?a[s]=_r(l.length?l[0]:null):a[s]=l}return a}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Dr={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 Fr(e,t,r){var a,s,l,c=r.logger;if(!c)return function(){};l="string"==typeof c?t[c]:c;var u=0,d=[];if(r.level.includes("error")&&window){var f=function(t){var n=t.message,o=t.error,i=Rr.parse(o).map((function(e){return e.toString()})),a=[Ar(n,r.stringifyOptions)];e({level:"error",trace:i,payload:a})};window.addEventListener("error",f),d.push((function(){window&&window.removeEventListener("error",f)}))}try{for(var p=n(r.level),h=p.next();!h.done;h=p.next()){var m=h.value;d.push(v(l,m))}}catch(e){a={error:e}}finally{try{h&&!h.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}return function(){d.forEach((function(e){return e()}))};function v(t,n){var a=this;return t[n]?Z(t,n,(function(t){return function(){for(var s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];t.apply(a,s);try{var c=Rr.parse(new Error).map((function(e){return e.toString()})).splice(1),d=s.map((function(e){return Ar(e,r.stringifyOptions)}));++u<r.lengthThreshold?e({level:n,trace:c,payload:d}):u===r.lengthThreshold&&e({level:"warn",trace:[],payload:[Ar("The number of log records reached the threshold.")]})}catch(e){t.apply(void 0,i(["rrweb logger error:",e],o(s),!1))}}})):function(){}}}var Pr="rrweb/console@1",Wr={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],replayLogger:void 0},jr=function(){function e(e){this.config=Object.assign(Wr,e)}return e.prototype.getConsoleLogger=function(){var e,t,r=this,a={},s=function(e){a[e]="trace"===e?function(e){(console.log.__rrweb_original__?console.log.__rrweb_original__:console.log).apply(void 0,i(i([],o(e.payload.map((function(e){return JSON.parse(e)}))),!1),[r.formatMessage(e)],!1))}:function(t){(console[e].__rrweb_original__?console[e].__rrweb_original__:console[e]).apply(void 0,i(i([],o(t.payload.map((function(e){return JSON.parse(e)}))),!1),[r.formatMessage(t)],!1))}};try{for(var l=n(this.config.level),c=l.next();!c.done;c=l.next()){s(c.value)}}catch(t){e={error:t}}finally{try{c&&!c.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}return a},e.prototype.formatMessage=function(e){if(0===e.trace.length)return"";var t="\n\tat ",r=t;return r+=e.trace.join(t)},e}(),Ur={key:"_sid"},zr={key:"_sid",warnOnMissingId:!0};return e.PLUGIN_NAME=Pr,e.Replayer=Lt,e.addCustomEvent=At,e.freezePage=Dt,e.getRecordConsolePlugin=function(e){return{name:Pr,observer:Fr,options:e?Object.assign({},Dr,e):Dr}},e.getRecordSequentialIdPlugin=function(e){var t=e?Object.assign({},Ur,e):Ur,r=0;return{name:"rrweb/sequential-id@1",eventProcessor:function(e){var n;return Object.assign(e,((n={})[t.key]=++r,n)),e},options:t}},e.getReplayConsolePlugin=function(t){var r=(null==t?void 0:t.replayLogger)||new jr(t).getConsoleLogger();return{handler:function(t,n,o){var i=null;if(t.type===e.EventType.IncrementalSnapshot&&t.data.source===e.IncrementalSource.Log?i=t.data:t.type===e.EventType.Plugin&&t.data.plugin===Pr&&(i=t.data.payload),i)try{"function"==typeof r[i.level]&&r[i.level](i)}catch(e){o.replayer.config.showWarning&&console.warn(e)}}}},e.getReplaySequentialIdPlugin=function(e){var t=e?Object.assign({},zr,e):zr,r=t.key,n=t.warnOnMissingId,o=1;return{handler:function(e){if(r in e){var t=e[r];t!==o?console.error('[sequential-id-plugin]: expect to get an id with value "'.concat(o,'", but got "').concat(t,'"')):o++}else n&&console.warn('[sequential-id-plugin]: failed to get id in key: "'.concat(r,'"'))}}},e.pack=function(e){var t=r(r({},e),{v:Ir});return Er(wr(Tr(JSON.stringify(t))),!0)},e.record=Ze,e.unpack=function(e){if("string"!=typeof e)return e;try{if((t=JSON.parse(e)).timestamp)return t}catch(e){}try{var t;if((t=JSON.parse(Er(xr(Tr(e,!0))))).v===Ir)return t;throw new Error("These events were packed with packer ".concat(t.v," which is incompatible with current packer ").concat(Ir,"."))}catch(e){throw console.error(e),new Error("Unknown data format.")}},e.utils=he,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
18
+ ***************************************************************************** */function Qr(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),l=[];try{for(;(t===void 0||t-- >0)&&!(n=i.next()).done;)l.push(n.value)}catch(c){o={error:c}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return l}var Pe;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Pe||(Pe={}));var en={type:"xstate.init"};function At(e){return e===void 0?[]:[].concat(e)}function Me(e){return{type:"xstate.assign",assignment:e}}function tn(e,t){return typeof(e=typeof e=="string"&&t&&t[e]?t[e]:e)=="string"?{type:e}:typeof e=="function"?{type:e.name,exec:e}:e}function at(e){return function(t){return e===t}}function rn(e){return typeof e=="string"?{type:e}:e}function nn(e,t){return{value:e,context:t,actions:[],changed:!1,matches:at(e)}}function on(e,t,r){var n=t,o=!1;return[e.filter(function(i){if(i.type==="xstate.assign"){o=!0;var l=Object.assign({},n);return typeof i.assignment=="function"?l=i.assignment(n,r):Object.keys(i.assignment).forEach(function(c){l[c]=typeof i.assignment[c]=="function"?i.assignment[c](n,r):i.assignment[c]}),n=l,!1}return!0}),n,o]}function sn(e,t){t===void 0&&(t={});var r=Qr(on(At(e.states[e.initial].entry).map(function(l){return tn(l,t.actions)}),e.context,en),2),n=r[0],o=r[1],i={config:e,_options:t,initialState:{value:e.initial,actions:n,context:o,matches:at(e.initial)},transition:function(l,c){var a,s,u=typeof l=="string"?{value:l,context:e.context}:l,d=u.value,m=u.context,h=rn(c),v=e.states[d];if(v.on){var p=At(v.on[h.type]);try{for(var w=function(x){var D=typeof Symbol=="function"&&Symbol.iterator,b=D&&x[D],g=0;if(b)return b.call(x);if(x&&typeof x.length=="number")return{next:function(){return x&&g>=x.length&&(x=void 0),{value:x&&x[g++],done:!x}}};throw new TypeError(D?"Object is not iterable.":"Symbol.iterator is not defined.")}(p),f=w.next();!f.done;f=w.next()){var S=f.value;if(S===void 0)return nn(d,m);var T=typeof S=="string"?{target:S}:S,I=T.target,R=T.actions,M=R===void 0?[]:R,C=T.cond,y=C===void 0?function(){return!0}:C,H=I===void 0,G=I??d,K=e.states[G];if(y(m,h)){var V=Qr(on((H?At(M):[].concat(v.exit,M,K.entry).filter(function(x){return x})).map(function(x){return tn(x,i._options.actions)}),m,h),3),U=V[0],Y=V[1],B=V[2],L=I??d;return{value:L,context:Y,actions:U,changed:I!==d||U.length>0||B,matches:at(L)}}}}catch(x){a={error:x}}finally{try{f&&!f.done&&(s=w.return)&&s.call(w)}finally{if(a)throw a.error}}}return nn(d,m)}};return i}var an=function(e,t){return e.actions.forEach(function(r){var n=r.exec;return n&&n(e.context,t)})};function ln(e){var t=e.initialState,r=Pe.NotStarted,n=new Set,o={_machine:e,send:function(i){r===Pe.Running&&(t=e.transition(t,i),an(t,rn(i)),n.forEach(function(l){return l(t)}))},subscribe:function(i){return n.add(i),i(t),{unsubscribe:function(){return n.delete(i)}}},start:function(i){if(i){var l=typeof i=="object"?i:{context:e.config.context,value:i};t={value:l.value,actions:[],context:l.context,matches:at(l.value)}}return r=Pe.Running,an(t,en),o},stop:function(){return r=Pe.Stopped,n.clear(),o},get state(){return t},get status(){return r}};return o}var _i=Object.defineProperty,$i=Object.defineProperties,Wi=Object.getOwnPropertyDescriptors,cn=Object.getOwnPropertySymbols,ji=Object.prototype.hasOwnProperty,Vi=Object.prototype.propertyIsEnumerable,un=(e,t,r)=>t in e?_i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,lt=(e,t)=>{for(var r in t||(t={}))ji.call(t,r)&&un(e,r,t[r]);if(cn)for(var r of cn(t))Vi.call(t,r)&&un(e,r,t[r]);return e},ct=(e,t)=>$i(e,Wi(t));function Ui(e,t){for(let r=e.length-1;r>=0;r--){const n=e[r];if(n.type===O.Meta&&n.timestamp<=t)return e.slice(r)}return e}function Gi(e,{getCastFn:t,applyEventsSynchronously:r,emitter:n}){const o=sn({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]},REPLACE_EVENTS:{target:"playing",actions:["replaceEvents"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]},REPLACE_EVENTS:{target:"paused",actions:["replaceEvents"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:Me({lastPlayedEvent:(i,l)=>l.type==="CAST_EVENT"?l.payload.event:i.lastPlayedEvent}),recordTimeOffset:Me((i,l)=>{let c=i.timeOffset;return"payload"in l&&"timeOffset"in l.payload&&(c=l.payload.timeOffset),ct(lt({},i),{timeOffset:c,baselineTime:i.events[0].timestamp+c})}),play(i){var l;const{timer:c,events:a,baselineTime:s,lastPlayedEvent:u}=i;c.clear();for(const p of a)Lt(p,s);const d=Ui(a,s);let m=u?.timestamp;u?.type===O.IncrementalSnapshot&&u.data.source===A.MouseMove&&(m=u.timestamp+((l=u.data.positions[0])==null?void 0:l.timeOffset)),s<(m||0)&&n.emit(z.PlayBack);const h=new Array,v=new Array;for(const p of d)if(!(m&&m<s&&(p.timestamp<=m||p===u)))if(p.timestamp<s)h.push(p);else{const w=t(p,!1);v.push({doAction:()=>{w()},delay:p.delay})}r(h),n.emit(z.Flush),c.addActions(v),c.start()},pause(i){i.timer.clear()},resetLastPlayedEvent:Me(i=>ct(lt({},i),{lastPlayedEvent:null})),startLive:Me({baselineTime:(i,l)=>(i.timer.toggleLiveMode(!0),i.timer.start(),l.type==="TO_LIVE"&&l.payload.baselineTime?l.payload.baselineTime:Date.now())}),replaceEvents:Me((i,l)=>{const{events:c,timer:a,baselineTime:s}=i;if(l.type==="REPLACE_EVENTS"){const{events:u}=l.payload;c.length=0;const d=[];for(const m of u)if(Lt(m,s),c.push(m),m.timestamp>=a.timeOffset+s){const h=t(m,!1);d.push({doAction:()=>{h()},delay:m.delay})}a.isActive()&&a.replaceActions(d)}return ct(lt({},i),{events:c})}),addEvent:Me((i,l)=>{const{baselineTime:c,timer:a,events:s}=i;if(l.type==="ADD_EVENT"){const{event:u}=l.payload;Lt(u,c);let d=s.length-1;if(!s[d]||s[d].timestamp<=u.timestamp)s.push(u);else{let v=-1,p=0;for(;p<=d;){const w=Math.floor((p+d)/2);s[w].timestamp<=u.timestamp?p=w+1:d=w-1}v===-1&&(v=p),s.splice(v,0,u)}const m=u.timestamp<c,h=t(u,m);m?h():a.isActive()&&a.addAction({doAction:()=>{h()},delay:u.delay})}return ct(lt({},i),{events:s})})}});return ln(o)}function Bi(e){const t=sn({id:"speed",context:e,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(r,n)=>{"payload"in n&&r.timer.setSpeed(n.payload.speed)},recordSpeed:Me({normalSpeed:r=>r.timer.speed}),restoreSpeed:r=>{r.timer.setSpeed(r.normalSpeed)}}});return ln(t)}const zi=e=>[`.${e} { background: currentColor }`,"noscript { display: none !important; }",`.${e} { background: currentColor; border-radius: 5px; }`,`.${e}:hover::after {content: 'Redacted'; color: white; background: black; text-align: center; width: 100%; display: block;}`];var Hi=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});const dn=new Map;function hn(e,t){let r=dn.get(e);return r||(r=new Map,dn.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}function Se(e,t,r){return n=>Hi(this,null,function*(){if(n&&typeof n=="object"&&"rr_type"in n)if(r&&(r.isUnchanged=!1),n.rr_type==="ImageBitmap"&&"args"in n){const o=yield Se(e,t,r)(n.args);return yield createImageBitmap.apply(null,o)}else if("index"in n){if(r||t===null)return n;const{rr_type:o,index:i}=n;return hn(t,o)[i]}else if("args"in n){const{rr_type:o,args:i}=n,l=window[o];return new l(...yield Promise.all(i.map(Se(e,t,r))))}else{if("base64"in n)return Bo(n.base64);if("src"in n){const o=e.get(n.src);if(o)return o;{const i=new Image;return i.src=n.src,e.set(n.src,i),i}}else if("data"in n&&n.rr_type==="Blob"){const o=yield Promise.all(n.data.map(Se(e,t,r)));return new Blob(o,{type:n.type})}}else if(Array.isArray(n))return yield Promise.all(n.map(Se(e,t,r)));return n})}var Yi=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});function Xi(e,t){try{return t===ve.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}const Zi=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function Ki(e,t){if(!(t!=null&&t.constructor))return;const{name:r}=t.constructor;if(!Zi.includes(r))return;const n=hn(e,r);n.includes(t)||n.push(t)}function qi(e){return Yi(this,arguments,function*({mutation:t,target:r,type:n,imageMap:o,errorHandler:i}){try{const l=Xi(r,n);if(!l)return;if(t.setter){l[t.property]=t.args[0];return}const c=l[t.property],a=yield Promise.all(t.args.map(Se(o,l))),s=c.apply(l,a);Ki(l,s)}catch(l){i(t,l)}})}var Ji=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});function Qi(e){return Ji(this,arguments,function*({event:t,mutation:r,target:n,imageMap:o,errorHandler:i}){try{const l=n.getContext("2d");if(r.setter){l[r.property]=r.args[0];return}const c=l[r.property];if(r.property==="drawImage"&&typeof r.args[0]=="string"){const a=o.get(t);c.apply(l,r.args)}else{const a=yield Promise.all(r.args.map(Se(o,l)));c.apply(l,a)}}catch(l){i(r,l)}})}var es=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});function mn(e){return es(this,arguments,function*({event:t,mutation:r,target:n,imageMap:o,canvasEventMap:i,errorHandler:l}){try{const c=i.get(t)||r,a="commands"in c?c.commands:[c];if([ve.WebGL,ve.WebGL2].includes(r.type)){for(let s=0;s<a.length;s++){const u=a[s];yield qi({mutation:u,type:r.type,target:n,imageMap:o,errorHandler:l})}return}for(let s=0;s<a.length;s++){const u=a[s];yield Qi({event:t,mutation:u,target:n,imageMap:o,errorHandler:l})}}catch(c){l(r,c)}})}var ts=Object.defineProperty,rs=Object.defineProperties,ns=Object.getOwnPropertyDescriptors,pn=Object.getOwnPropertySymbols,os=Object.prototype.hasOwnProperty,is=Object.prototype.propertyIsEnumerable,fn=(e,t,r)=>t in e?ts(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_e=(e,t)=>{for(var r in t||(t={}))os.call(t,r)&&fn(e,r,t[r]);if(pn)for(var r of pn(t))is.call(t,r)&&fn(e,r,t[r]);return e},Ft=(e,t)=>rs(e,ns(t)),Pt=(e,t,r)=>new Promise((n,o)=>{var i=a=>{try{c(r.next(a))}catch(s){o(s)}},l=a=>{try{c(r.throw(a))}catch(s){o(s)}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(i,l);c((r=r.apply(e,t)).next())});const vn=10*1e3,gn=2*1e3,yn=1*1e3,bn=60*60*1e3,ss=Jr||Ai,_t="[replayer]",$t={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Wt(e){return e.type==O.IncrementalSnapshot&&(e.data.source==A.TouchMove||e.data.source==A.MouseInteraction&&e.data.type==te.TouchStart)}class as{constructor(t,r){if(this.usingVirtualDom=!1,this.virtualDom=new Fe,this.mouseTail=null,this.tailPositions=[],this.emitter=ss(),this.activityIntervals=[],this.legacy_missingNodeRetryMap={},this.cache=ur(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=tr(),this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,!(r!=null&&r.liveMode)&&t.length<2)throw new Error("Replayer need at least 2 events.");const n={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"highlight-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:$t,useVirtualDom:!0,inactiveThreshold:.02,inactiveSkipTime:gn};this.config=Object.assign({},n,r),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(z.Resize,this.handleResize),this.setupDom(),this.emitter.on(z.Flush,()=>{if(this.usingVirtualDom){const c={mirror:this.mirror,applyCanvas:(a,s,u)=>{mn({event:a,mutation:s,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this)};if(me(this.iframe.contentDocument,this.virtualDom,c,this.virtualDom.mirror),this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const a in this.legacy_missingNodeRetryMap)try{const s=this.legacy_missingNodeRetryMap[a],u=Rt(s.node,this.mirror,this.virtualDom.mirror);me(u,s.node,c,this.virtualDom.mirror),s.node=u}catch(s){this.config.showWarning&&console.warn(s)}}this.mousePos&&this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null}),this.emitter.on(z.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset()});const o=new Pi([],r?.speed||n.speed);this.service=Gi({events:t.map(c=>r&&r.unpackFn?r.unpackFn(c):c).sort((c,a)=>c.timestamp-a.timestamp),timer:o,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(c=>{this.emitter.emit(z.StateChange,{player:c})}),this.speedService=Bi({normalSpeed:-1,timer:o}),this.speedService.start(),this.speedService.subscribe(c=>{this.emitter.emit(z.StateChange,{speed:c})});const i=this.service.state.context.events.find(c=>c.type===O.Meta),l=this.service.state.context.events.find(c=>c.type===O.FullSnapshot);if(i){const{width:c,height:a}=i.data;setTimeout(()=>{this.emitter.emit(z.Resize,{width:c,height:a})},0)}l&&setTimeout(()=>{this.firstFullSnapshot||(this.firstFullSnapshot=l,this.rebuildFullSnapshot(l),this.iframe.contentWindow.scrollTo(l.data.initialOffset))},1),this.service.state.context.events.find(Wt)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(t,r){return this.emitter.on(t,r),this}off(t,r){return this.emitter.off(t,r),this}setConfig(t){Object.keys(t).forEach(r=>{this.config[r]=t[r]}),this.config.skipInactive||this.backToNormal(),typeof t.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:t.speed}}),typeof t.mouseTail<"u"&&(t.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getActivityIntervals(){if(this.activityIntervals.length==0){const t=[],r=this.getMetaData(),n=[{timestamp:r.startTime},...this.service.state.context.events.filter(l=>this.isUserInteraction(l)),{timestamp:r.endTime}];for(let l=1;l<n.length;l++){const c=n[l-1],a=n[l];a.timestamp-c.timestamp>vn?t.push({startTime:c.timestamp,endTime:a.timestamp,duration:a.timestamp-c.timestamp,active:!1}):t.push({startTime:c.timestamp,endTime:a.timestamp,duration:a.timestamp-c.timestamp,active:!0})}const o=[];let i=t[0];for(let l=1;l<t.length;l++)t[l].active!=t[l-1].active&&(o.push({startTime:i.startTime,endTime:t[l-1].endTime,duration:t[l-1].endTime-i.startTime,active:t[l-1].active}),i=t[l]);i&&t.length>0&&o.push({startTime:i.startTime,endTime:t[t.length-1].endTime,duration:t[t.length-1].endTime-i.startTime,active:t[t.length-1].active}),i=o[0];for(let l=1;l<o.length;l++)(!o[l].active&&o[l].duration>this.config.inactiveThreshold*r.totalTime||!o[l-1].active&&o[l-1].duration>this.config.inactiveThreshold*r.totalTime)&&(this.activityIntervals.push({startTime:i.startTime,endTime:o[l-1].endTime,duration:o[l-1].endTime-i.startTime,active:o[l-1].active}),i=o[l]);i&&o.length>0&&this.activityIntervals.push({startTime:i.startTime,endTime:o[o.length-1].endTime,duration:o[o.length-1].endTime-i.startTime,active:o[o.length-1].active})}return this.activityIntervals}getMetaData(){const t=this.service.state.context.events[0],r=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:t.timestamp,endTime:r.timestamp,totalTime:r.timestamp-t.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:t,events:r}=this.service.state.context;return t-r[0].timestamp}getMirror(){return this.mirror}play(t=0){var r,n;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:t}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:t}})),(n=(r=this.iframe.contentDocument)==null?void 0:r.getElementsByTagName("html")[0])==null||n.classList.remove("rrweb-paused"),this.emitter.emit(z.Start),this.handleInactivity(this.getMetaData().startTime+t,!0)}pause(t){var r,n;t===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof t=="number"&&(this.play(t),this.service.send({type:"PAUSE"})),(n=(r=this.iframe.contentDocument)==null?void 0:r.getElementsByTagName("html")[0])==null||n.classList.add("rrweb-paused"),this.emitter.emit(z.Pause)}resume(t=0){console.warn("The 'resume' will be departed in 1.0. Please use 'play' method which has the same interface."),this.play(t),this.emitter.emit(z.Resume)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){const r=this.config.unpackFn?this.config.unpackFn(t):t;Wt(r)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:r}}))}replaceEvents(t){for(const r of t)if(Wt(r)){this.mouse.classList.add("touch-device");break}this.service.send({type:"REPLACE_EVENTS",payload:{events:t}})}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=ur()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");const t=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&t.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",t.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(Fi(this.iframe.contentWindow,this.iframe.contentDocument),Tt(this.iframe.contentWindow))}handleResize(t){this.iframe.style.display="inherit";for(const r of[this.mouseTail,this.iframe])!r||(r.setAttribute("width",String(t.width)),r.setAttribute("height",String(t.height)))}applyEventsSynchronously(t){for(const r of t){switch(r.type){case O.DomContentLoaded:case O.Load:case O.Custom:continue;case O.FullSnapshot:case O.Meta:case O.Plugin:case O.IncrementalSnapshot:break}this.getCastFn(r,!0)()}this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null}getCastFn(t,r=!1){let n;switch(t.type){case O.DomContentLoaded:case O.Load:break;case O.Custom:n=()=>{this.emitter.emit(z.CustomEvent,t)};break;case O.Meta:n=()=>this.emitter.emit(z.Resize,{width:t.data.width,height:t.data.height});break;case O.FullSnapshot:n=()=>{if(this.firstFullSnapshot){if(this.firstFullSnapshot===t){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(t,r),this.iframe.contentWindow.scrollTo(t.data.initialOffset)};break;case O.IncrementalSnapshot:n=()=>{if(this.applyIncremental(t,r),!r&&(this.handleInactivity(t.timestamp),t===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const o of this.service.state.context.events)if(!(o.timestamp<=t.timestamp)&&this.isUserInteraction(o)){o.delay-t.delay>vn*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=o);break}if(this.nextUserInteractionEvent){const o=this.nextUserInteractionEvent.delay-t.delay,i={speed:Math.min(Math.round(o/gn),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:i}),this.emitter.emit(z.SkipStart,i)}}};break}return()=>{n&&n();for(const i of this.config.plugins||[])i.handler(t,r,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:t}});const o=this.service.state.context.events.length-1;if(t===this.service.state.context.events[o]){const i=()=>{o<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(z.Finish))};t.type===O.IncrementalSnapshot&&t.data.source===A.MouseMove&&t.data.positions.length?setTimeout(()=>{i()},Math.max(0,-t.data.positions[0].timeOffset+50)):i()}this.emitter.emit(z.EventCast,t)}}handleInactivity(t,r){if((t===this.inactiveEndTimestamp||r)&&(this.inactiveEndTimestamp=null,this.backToNormal()),this.config.skipInactive&&!this.inactiveEndTimestamp){for(const n of this.getActivityIntervals())if(t>=n.startTime&&t<n.endTime&&!n.active){this.inactiveEndTimestamp=n.endTime;break}if(this.inactiveEndTimestamp){const n=this.inactiveEndTimestamp-t,o={speed:n/bn*this.config.inactiveSkipTime<yn?n/yn:Math.round(Math.max(n,bn)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:o}),this.emitter.emit(z.SkipStart,o)}}}rebuildFullSnapshot(t,r=!1){if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const n=[];fo(t.data.node,{doc:this.iframe.contentDocument,afterAppend:l=>{this.collectIframeAndAttachDocument(n,l)},cache:this.cache,mirror:this.mirror});for(const{mutationInQueue:l,builtNode:c}of n)this.attachDocumentToIframe(l,c),this.newDocumentQueue=this.newDocumentQueue.filter(a=>a!==l);const{documentElement:o,head:i}=this.iframe.contentDocument;this.insertStyleRules(o,i),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(z.FullsnapshotRebuilded,t),r||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,r){const n=zi(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&n.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,qr(o,this.virtualDom.unserializedId)),t.insertBefore(o,r);for(let i=0;i<n.length;i++)o.rules.push({cssText:n[i],type:ce.Insert,index:i})}else{const o=document.createElement("style");t.insertBefore(o,r);for(let i=0;i<n.length;i++)o.sheet.insertRule(n[i],i)}}attachDocumentToIframe(t,r){const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,o=[];rt(t.node,{doc:r.contentDocument,mirror:n,hackCss:!0,skipChild:!1,afterAppend:i=>{this.collectIframeAndAttachDocument(o,i);const l=n.getMeta(i);if(l?.type===j.Element&&l?.tagName.toUpperCase()==="HTML"){const{documentElement:c,head:a}=r.contentDocument;this.insertStyleRules(c,a)}},cache:this.cache});for(const{mutationInQueue:i,builtNode:l}of o)this.attachDocumentToIframe(i,l),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==i)}collectIframeAndAttachDocument(t,r){if(Re(r,this.mirror)){const n=this.newDocumentQueue.find(o=>o.parentId===this.mirror.getId(r));n&&t.push({mutationInQueue:n,builtNode:r})}}waitForStylesheetLoad(){var t;const r=(t=this.iframe.contentDocument)==null?void 0:t.head;if(r){const n=new Set;let o,i=this.service.state;const l=()=>{i=this.service.state};this.emitter.on(z.Start,l),this.emitter.on(z.Pause,l);const c=()=>{this.emitter.off(z.Start,l),this.emitter.off(z.Pause,l)};r.querySelectorAll('link[rel="stylesheet"]').forEach(a=>{a.sheet||(n.add(a),a.addEventListener("load",()=>{n.delete(a),n.size===0&&o!==-1&&(i.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(z.LoadStylesheetEnd),o&&clearTimeout(o),c())}))}),n.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(z.LoadStylesheetStart),o=setTimeout(()=>{i.matches("playing")&&this.play(this.getCurrentTime()),o=-1,c()},this.config.loadTimeout))}}hasImageArg(t){for(const r of t)if(!(!r||typeof r!="object")){if("rr_type"in r&&"args"in r){if(this.hasImageArg(r.args))return!0}else if("rr_type"in r&&r.rr_type==="HTMLImageElement"||r instanceof Array&&this.hasImageArg(r))return!0}return!1}getImageArgs(t){const r=[];for(const n of t)!n||typeof n!="object"||("rr_type"in n&&"args"in n?r.push(...this.getImageArgs(n.args)):"rr_type"in n&&n.rr_type==="HTMLImageElement"?r.push(n.src):n instanceof Array&&r.push(...this.getImageArgs(n)));return r}preloadAllImages(){return Pt(this,null,function*(){this.service.state;const t=()=>{this.service.state};this.emitter.on(z.Start,t),this.emitter.on(z.Pause,t);const r=[];for(const n of this.service.state.context.events)n.type===O.IncrementalSnapshot&&n.data.source===A.CanvasMutation&&(r.push(this.deserializeAndPreloadCanvasEvents(n.data,n)),("commands"in n.data?n.data.commands:[n.data]).forEach(o=>{this.preloadImages(o,n)}));return Promise.all(r)})}preloadImages(t,r){if(t.property==="drawImage"&&typeof t.args[0]=="string"&&!this.imageMap.has(r)){const n=document.createElement("canvas"),o=n.getContext("2d"),i=o?.createImageData(n.width,n.height);i?.data,JSON.parse(t.args[0]),o?.putImageData(i,0,0)}}deserializeAndPreloadCanvasEvents(t,r){return Pt(this,null,function*(){if(!this.canvasEventMap.has(r)){const n={isUnchanged:!0};if("commands"in t){const o=yield Promise.all(t.commands.map(i=>Pt(this,null,function*(){const l=yield Promise.all(i.args.map(Se(this.imageMap,null,n)));return Ft(_e({},i),{args:l})})));n.isUnchanged===!1&&this.canvasEventMap.set(r,Ft(_e({},t),{commands:o}))}else{const o=yield Promise.all(t.args.map(Se(this.imageMap,null,n)));n.isUnchanged===!1&&this.canvasEventMap.set(r,Ft(_e({},t),{args:o}))}}})}applyIncremental(t,r){var n,o,i,l,c,a;const{data:s}=t;switch(s.source){case A.Mutation:{try{this.applyMutation(s,r)}catch(u){this.warn(`Exception in mutation ${u.message||u}`,s)}break}case A.Drag:case A.TouchMove:case A.MouseMove:if(r){const u=s.positions[s.positions.length-1];this.mousePos={x:u.x,y:u.y,id:u.id,debugData:s}}else s.positions.forEach(u=>{const d={doAction:()=>{this.moveAndHover(u.x,u.y,u.id,r,s)},delay:u.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(d)}),this.timer.addAction({doAction(){},delay:t.delay-((n=s.positions[0])==null?void 0:n.timeOffset)});break;case A.MouseInteraction:{if(s.id===-1||r)break;const u=new Event(te[s.type].toLowerCase()),d=this.mirror.getNode(s.id);if(!d)return this.debugNodeNotFound(s,s.id);this.emitter.emit(z.MouseInteraction,{type:s.type,target:d});const{triggerFocus:m}=this.config;switch(s.type){case te.Blur:"blur"in d&&d.blur();break;case te.Focus:m&&d.focus&&d.focus({preventScroll:!0});break;case te.Click:case te.TouchStart:case te.TouchEnd:r?(s.type===te.TouchStart?this.touchActive=!0:s.type===te.TouchEnd&&(this.touchActive=!1),this.mousePos={x:s.x,y:s.y,id:s.id,debugData:s}):(s.type===te.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(s.x,s.y,s.id,r,s),s.type===te.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):s.type===te.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):s.type===te.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case te.TouchCancel:r?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:d.dispatchEvent(u)}break}case A.Scroll:{if(s.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);u.scrollData=s;break}this.applyScroll(s,r);break}case A.ViewportResize:this.emitter.emit(z.Resize,{width:s.width,height:s.height});break;case A.Input:{if(s.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);u.inputData=s;break}this.applyInput(s);break}case A.MediaInteraction:{const u=this.usingVirtualDom?this.virtualDom.mirror.getNode(s.id):this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u;try{s.currentTime&&(d.currentTime=s.currentTime),s.volume&&(d.volume=s.volume),s.muted&&(d.muted=s.muted),s.type===Ee.Pause&&d.pause(),s.type===Ee.Play&&d.play()}catch(m){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${m.message||m}`)}break}case A.StyleSheetRule:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.rules;(o=s.adds)==null||o.forEach(({rule:m,index:h})=>d?.push({cssText:m,index:h,type:ce.Insert})),(i=s.removes)==null||i.forEach(({index:m})=>d?.push({index:m,type:ce.Remove}))}else{const u=this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.sheet;(l=s.adds)==null||l.forEach(({rule:m,index:h})=>{try{if(Array.isArray(h)){const{positions:v,index:p}=It(h);Le(d.cssRules,v).insertRule(m,p)}else{const v=h===void 0?void 0:Math.min(h,d.cssRules.length);d.insertRule(m,v)}}catch{}}),(c=s.removes)==null||c.forEach(({index:m})=>{try{if(Array.isArray(m)){const{positions:h,index:v}=It(m);Le(d.cssRules,h).deleteRule(v||0)}else d?.deleteRule(m)}catch{}})}break}case A.StyleDeclaration:{if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.rules;s.set&&d.push(_e({type:ce.SetProperty,index:s.index},s.set)),s.remove&&d.push(_e({type:ce.RemoveProperty,index:s.index},s.remove))}else{const u=this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);const d=u.sheet;s.set&&Le(d.rules,s.index).style.setProperty(s.set.property,s.set.value,s.set.priority),s.remove&&Le(d.rules,s.index).style.removeProperty(s.remove.property)}break}case A.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);u.canvasMutations.push({event:t,mutation:s})}else{const u=this.mirror.getNode(s.id);if(!u)return this.debugNodeNotFound(s,s.id);mn({event:t,mutation:s,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case A.Font:{try{const u=new FontFace(s.family,s.buffer?new Uint8Array(JSON.parse(s.fontSource)):s.fontSource,s.descriptors);(a=this.iframe.contentDocument)==null||a.fonts.add(u)}catch(u){this.config.showWarning&&console.warn(u)}break}}}applyMutation(t,r){if(this.config.useVirtualDom&&!this.usingVirtualDom&&r&&(this.usingVirtualDom=!0,Di(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const s in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[s],d=Kr(u.node,this.virtualDom,this.mirror);d&&(u.node=d)}catch(u){this.config.showWarning&&console.warn(u)}const n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;t.removes.forEach(s=>{var u;const d=n.getNode(s.id);if(!d)return t.removes.find(h=>h.id===s.parentId)?void 0:this.warnNodeNotFound(t,s.id);let m=n.getNode(s.parentId);if(!m)return this.warnNodeNotFound(t,s.parentId);if(s.isShadow&&Ue(m)&&(m=m.shadowRoot),n.removeNodeFromMap(d),m)try{m.removeChild(d),this.usingVirtualDom&&d.nodeName==="#text"&&m.nodeName==="STYLE"&&((u=m.rules)==null?void 0:u.length)>0&&(m.rules=[])}catch(h){if(h instanceof DOMException)this.warn("parent could not remove child in mutation",m,d,t);else throw h}});const o=_e({},this.legacy_missingNodeRetryMap),i=[],l=s=>{let u=null;return s.nextId&&(u=n.getNode(s.nextId)),s.nextId!==null&&s.nextId!==void 0&&s.nextId!==-1&&!u},c=s=>{var u;if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");let d=n.getNode(s.parentId);if(!d)return s.node.type===j.Document?this.newDocumentQueue.push(s):i.push(s);s.node.isShadow&&(Ue(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let m=null,h=null;if(s.previousId&&(m=n.getNode(s.previousId)),s.nextId&&(h=n.getNode(s.nextId)),l(s))return i.push(s);if(s.node.rootId&&!n.getNode(s.node.rootId))return;const v=s.node.rootId?n.getNode(s.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Re(d,n)){this.attachDocumentToIframe(s,d);return}const p=rt(s.node,{doc:v,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache});if(s.previousId===-1||s.nextId===-1){o[s.node.id]={node:p,mutation:s};return}const w=n.getMeta(d);if(w&&w.type===j.Element&&w.tagName==="textarea"&&s.node.type===j.Text){const f=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);for(const S of f)S.nodeType===d.TEXT_NODE&&d.removeChild(S)}if(m&&m.nextSibling&&m.nextSibling.parentNode)d.insertBefore(p,m.nextSibling);else if(h&&h.parentNode)d.contains(h)?d.insertBefore(p,h):d.insertBefore(p,null);else{if(d===v)for(;v.firstChild;)v.removeChild(v.firstChild);d.appendChild(p)}if(this.usingVirtualDom&&p.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)==null?void 0:u.length)>0&&(d.rules=[]),Re(p,this.mirror)){const f=this.mirror.getId(p),S=this.newDocumentQueue.find(T=>T.parentId===f);S&&(this.attachDocumentToIframe(S,p),this.newDocumentQueue=this.newDocumentQueue.filter(T=>T!==S))}(s.previousId||s.nextId)&&this.legacy_resolveMissingNode(o,d,p,s)};t.adds.forEach(s=>{c(s)});const a=Date.now();for(;i.length;){const s=mr(i);if(i.length=0,Date.now()-a>500){this.warn("Timeout in the loop, please check the resolve tree data:",s);break}for(const u of s)n.getNode(u.value.parentId)?Et(u,d=>{c(d)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(o).length&&Object.assign(this.legacy_missingNodeRetryMap,o),fr(t.texts).forEach(s=>{var u;const d=n.getNode(s.id);if(!d)return t.removes.find(m=>m.id===s.id)?void 0:this.warnNodeNotFound(t,s.id);if(d.textContent=s.value,this.usingVirtualDom){const m=d.parentNode;((u=m?.rules)==null?void 0:u.length)>0&&(m.rules=[])}}),t.attributes.forEach(s=>{const u=n.getNode(s.id);if(!u)return t.removes.find(d=>d.id===s.id)?void 0:this.warnNodeNotFound(t,s.id);for(const d in s.attributes)if(typeof d=="string"){const m=s.attributes[d];if(m===null)u.removeAttribute(d);else if(typeof m=="string")try{u.setAttribute(d,m)}catch(h){this.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",h)}else if(d==="style"){const h=m,v=u;for(const p in h)if(h[p]===!1)v.style.removeProperty(p);else if(h[p]instanceof Array){const w=h[p];v.style.setProperty(p,w[0],w[1])}else{const w=h[p];v.style.setProperty(p,w)}}}})}applyScroll(t,r){const n=this.mirror.getNode(t.id);if(!n)return this.debugNodeNotFound(t,t.id);const o=this.mirror.getMeta(n);if(n===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else if(o?.type===j.Document)n.defaultView.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else try{n.scrollTop=t.y,n.scrollLeft=t.x}catch{}}applyInput(t){const r=this.mirror.getNode(t.id);if(!r)return this.debugNodeNotFound(t,t.id);try{r.checked=t.isChecked,r.value=t.text}catch{}}legacy_resolveMissingNode(t,r,n,o){const{previousId:i,nextId:l}=o,c=i&&t[i],a=l&&t[l];if(c){const{node:s,mutation:u}=c;r.insertBefore(s,n),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,r,s,u)}if(a){const{node:s,mutation:u}=a;r.insertBefore(s,n.nextSibling),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,r,s,u)}}moveAndHover(t,r,n,o,i){const l=this.mirror.getNode(n);if(!l)return this.debugNodeNotFound(i,n);const c=Ct(l,this.iframe),a=t*c.absoluteScale+c.x,s=r*c.absoluteScale+c.y;this.mouse.style.left=`${a}px`,this.mouse.style.top=`${s}px`,o||this.drawMouseTail({x:a,y:s}),this.hoverElements(l)}drawMouseTail(t){if(!this.mouseTail)return;const{lineCap:r,lineWidth:n,strokeStyle:o,duration:i}=this.config.mouseTail===!0?$t:Object.assign({},$t,this.config.mouseTail),l=()=>{if(!this.mouseTail)return;const c=this.mouseTail.getContext("2d");!c||!this.tailPositions.length||(c.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),c.beginPath(),c.lineWidth=n,c.lineCap=r,c.strokeStyle=o,c.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(a=>c.lineTo(a.x,a.y)),c.stroke())};this.tailPositions.push(t),l(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(c=>c!==t),l()},i/this.speedService.state.context.timer.speed)}hoverElements(t){var r;(r=this.iframe.contentDocument)==null||r.querySelectorAll(".\\:hover").forEach(o=>{o.classList.remove(":hover")});let n=t;for(;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement}isUserInteraction(t){return t.type!==O.IncrementalSnapshot?!1:t.data.source>A.Mutation&&t.data.source<=A.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(z.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(t,r){this.warn(`Node with id '${r}' not found. `,t)}warnCanvasMutationFailed(t,r){this.warn("Has error on canvas update",r,"canvas mutation:",t)}debugNodeNotFound(t,r){this.debug(_t,`Node with id '${r}' not found. `,t)}warn(...t){!this.config.showWarning||console.warn(_t,...t)}debug(...t){!this.config.showDebug||console.log(_t,...t)}}const{addCustomEvent:ls}=Ie,{freezePage:cs}=Ie;var ne=Uint8Array,ie=Uint16Array,Xe=Uint32Array,ut=new ne([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),dt=new ne([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),jt=new ne([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),wn=function(e,t){for(var r=new ie(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var o=new Xe(r[30]),n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)o[i]=i-r[n]<<5|n;return[r,o]},Sn=wn(ut,2),Nn=Sn[0],Vt=Sn[1];Nn[28]=258,Vt[258]=28;for(var Tn=wn(dt,0),us=Tn[0],En=Tn[1],Ut=new ie(32768),Z=0;Z<32768;++Z){var Ne=(Z&43690)>>>1|(Z&21845)<<1;Ne=(Ne&52428)>>>2|(Ne&13107)<<2,Ne=(Ne&61680)>>>4|(Ne&3855)<<4,Ut[Z]=((Ne&65280)>>>8|(Ne&255)<<8)>>>1}for(var pe=function(e,t,r){for(var n=e.length,o=0,i=new ie(t);o<n;++o)++i[e[o]-1];var l=new ie(t);for(o=0;o<t;++o)l[o]=l[o-1]+i[o-1]<<1;var c;if(r){c=new ie(1<<t);var a=15-t;for(o=0;o<n;++o)if(e[o])for(var s=o<<4|e[o],u=t-e[o],d=l[e[o]-1]++<<u,m=d|(1<<u)-1;d<=m;++d)c[Ut[d]>>>a]=s}else for(c=new ie(n),o=0;o<n;++o)c[o]=Ut[l[e[o]-1]++]>>>15-e[o];return c},Te=new ne(288),Z=0;Z<144;++Z)Te[Z]=8;for(var Z=144;Z<256;++Z)Te[Z]=9;for(var Z=256;Z<280;++Z)Te[Z]=7;for(var Z=280;Z<288;++Z)Te[Z]=8;for(var Ze=new ne(32),Z=0;Z<32;++Z)Ze[Z]=5;var ds=pe(Te,9,0),hs=pe(Te,9,1),ms=pe(Ze,5,0),ps=pe(Ze,5,1),Gt=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},ue=function(e,t,r){var n=t/8>>0;return(e[n]|e[n+1]<<8)>>>(t&7)&r},Bt=function(e,t){var r=t/8>>0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>>(t&7)},zt=function(e){return(e/8>>0)+(e&7&&1)},Ht=function(e,t,r){(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length);var n=new(e instanceof ie?ie:e instanceof Xe?Xe:ne)(r-t);return n.set(e.subarray(t,r)),n},fs=function(e,t,r){var n=e.length,o=!t||r,i=!r||r.i;r||(r={}),t||(t=new ne(n*3));var l=function(ee){var _=t.length;if(ee>_){var W=new ne(Math.max(_*2,ee));W.set(t),t=W}},c=r.f||0,a=r.p||0,s=r.b||0,u=r.l,d=r.d,m=r.m,h=r.n,v=n*8;do{if(!u){r.f=c=ue(e,a,1);var p=ue(e,a+1,3);if(a+=3,p)if(p==1)u=hs,d=ps,m=9,h=5;else if(p==2){var T=ue(e,a,31)+257,I=ue(e,a+10,15)+4,R=T+ue(e,a+5,31)+1;a+=14;for(var M=new ne(R),C=new ne(19),y=0;y<I;++y)C[jt[y]]=ue(e,a+y*3,7);a+=I*3;var H=Gt(C),G=(1<<H)-1;if(!i&&a+R*(H+7)>v)break;for(var K=pe(C,H,1),y=0;y<R;){var V=K[ue(e,a,G)];a+=V&15;var w=V>>>4;if(w<16)M[y++]=w;else{var U=0,Y=0;for(w==16?(Y=3+ue(e,a,3),a+=2,U=M[y-1]):w==17?(Y=3+ue(e,a,7),a+=3):w==18&&(Y=11+ue(e,a,127),a+=7);Y--;)M[y++]=U}}var B=M.subarray(0,T),L=M.subarray(T);m=Gt(B),h=Gt(L),u=pe(B,m,1),d=pe(L,h,1)}else throw"invalid block type";else{var w=zt(a)+4,f=e[w-4]|e[w-3]<<8,S=w+f;if(S>n){if(i)throw"unexpected EOF";break}o&&l(s+f),t.set(e.subarray(w,S),s),r.b=s+=f,r.p=a=S*8;continue}if(a>v)throw"unexpected EOF"}o&&l(s+131072);for(var x=(1<<m)-1,D=(1<<h)-1,b=m+h+18;i||a+b<v;){var U=u[Bt(e,a)&x],g=U>>>4;if(a+=U&15,a>v)throw"unexpected EOF";if(!U)throw"invalid length/literal";if(g<256)t[s++]=g;else if(g==256){u=null;break}else{var N=g-254;if(g>264){var y=g-257,E=ut[y];N=ue(e,a,(1<<E)-1)+Nn[y],a+=E}var F=d[Bt(e,a)&D],P=F>>>4;if(!F)throw"invalid distance";a+=F&15;var L=us[P];if(P>3){var E=dt[P];L+=Bt(e,a)&(1<<E)-1,a+=E}if(a>v)throw"unexpected EOF";o&&l(s+131072);for(var k=s+N;s<k;s+=4)t[s]=t[s-L],t[s+1]=t[s+1-L],t[s+2]=t[s+2-L],t[s+3]=t[s+3-L];s=k}}r.l=u,r.p=a,r.b=s,u&&(c=1,r.m=m,r.d=d,r.n=h)}while(!c);return s==t.length?t:Ht(t,0,s)},ge=function(e,t,r){r<<=t&7;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8},Ke=function(e,t,r){r<<=t&7;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},Yt=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var o=r.length,i=r.slice();if(!o)return[new ne(0),0];if(o==1){var l=new ne(r[0].s+1);return l[r[0].s]=1,[l,1]}r.sort(function(R,M){return R.f-M.f}),r.push({s:-1,f:25001});var c=r[0],a=r[1],s=0,u=1,d=2;for(r[0]={s:-1,f:c.f+a.f,l:c,r:a};u!=o-1;)c=r[r[s].f<r[d].f?s++:d++],a=r[s!=u&&r[s].f<r[d].f?s++:d++],r[u++]={s:-1,f:c.f+a.f,l:c,r:a};for(var m=i[0].s,n=1;n<o;++n)i[n].s>m&&(m=i[n].s);var h=new ie(m+1),v=Xt(r[u-1],h,0);if(v>t){var n=0,p=0,w=v-t,f=1<<w;for(i.sort(function(M,C){return h[C.s]-h[M.s]||M.f-C.f});n<o;++n){var S=i[n].s;if(h[S]>t)p+=f-(1<<v-h[S]),h[S]=t;else break}for(p>>>=w;p>0;){var T=i[n].s;h[T]<t?p-=1<<t-h[T]++-1:++n}for(;n>=0&&p;--n){var I=i[n].s;h[I]==t&&(--h[I],++p)}v=t}return[new ne(h),v]},Xt=function(e,t,r){return e.s==-1?Math.max(Xt(e.l,t,r+1),Xt(e.r,t,r+1)):t[e.s]=r},Cn=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new ie(++t),n=0,o=e[0],i=1,l=function(a){r[n++]=a},c=1;c<=t;++c)if(e[c]==o&&c!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)l(32754);i>2&&(l(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(l(o),--i;i>6;i-=6)l(8304);i>2&&(l(i-3<<5|8208),i=0)}for(;i--;)l(o);i=1,o=e[c]}return[r.subarray(0,n),t]},qe=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},ht=function(e,t,r){var n=r.length,o=zt(t+2);e[o]=n&255,e[o+1]=n>>>8,e[o+2]=e[o]^255,e[o+3]=e[o+1]^255;for(var i=0;i<n;++i)e[o+i+4]=r[i];return(o+4+n)*8},In=function(e,t,r,n,o,i,l,c,a,s,u){ge(t,u++,r),++o[256];for(var d=Yt(o,15),m=d[0],h=d[1],v=Yt(i,15),p=v[0],w=v[1],f=Cn(m),S=f[0],T=f[1],I=Cn(p),R=I[0],M=I[1],C=new ie(19),y=0;y<S.length;++y)C[S[y]&31]++;for(var y=0;y<R.length;++y)C[R[y]&31]++;for(var H=Yt(C,7),G=H[0],K=H[1],V=19;V>4&&!G[jt[V-1]];--V);var U=s+5<<3,Y=qe(o,Te)+qe(i,Ze)+l,B=qe(o,m)+qe(i,p)+l+14+3*V+qe(C,G)+(2*C[16]+3*C[17]+7*C[18]);if(U<=Y&&U<=B)return ht(t,u,e.subarray(a,a+s));var L,x,D,b;if(ge(t,u,1+(B<Y)),u+=2,B<Y){L=pe(m,h,0),x=m,D=pe(p,w,0),b=p;var g=pe(G,K,0);ge(t,u,T-257),ge(t,u+5,M-1),ge(t,u+10,V-4),u+=14;for(var y=0;y<V;++y)ge(t,u+3*y,G[jt[y]]);u+=3*V;for(var N=[S,R],E=0;E<2;++E)for(var F=N[E],y=0;y<F.length;++y){var P=F[y]&31;ge(t,u,g[P]),u+=G[P],P>15&&(ge(t,u,F[y]>>>5&127),u+=F[y]>>>12)}}else L=ds,x=Te,D=ms,b=Ze;for(var y=0;y<c;++y)if(n[y]>255){var P=n[y]>>>18&31;Ke(t,u,L[P+257]),u+=x[P+257],P>7&&(ge(t,u,n[y]>>>23&31),u+=ut[P]);var k=n[y]&31;Ke(t,u,D[k]),u+=b[k],k>3&&(Ke(t,u,n[y]>>>5&8191),u+=dt[k])}else Ke(t,u,L[n[y]]),u+=x[n[y]];return Ke(t,u,L[256]),u+x[256]},vs=new Xe([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),gs=new ne(0),ys=function(e,t,r,n,o,i){var l=e.length,c=new ne(n+l+5*(1+Math.floor(l/7e3))+o),a=c.subarray(n,c.length-o),s=0;if(!t||l<8)for(var u=0;u<=l;u+=65535){var d=u+65535;d<l?s=ht(a,s,e.subarray(u,d)):(a[u]=i,s=ht(a,s,e.subarray(u,l)))}else{for(var m=vs[t-1],h=m>>>13,v=m&8191,p=(1<<r)-1,w=new ie(32768),f=new ie(p+1),S=Math.ceil(r/3),T=2*S,I=function(Qt){return(e[Qt]^e[Qt+1]<<S^e[Qt+2]<<T)&p},R=new Xe(25e3),M=new ie(288),C=new ie(32),y=0,H=0,u=0,G=0,K=0,V=0;u<l;++u){var U=I(u),Y=u&32767,B=f[U];if(w[Y]=B,f[U]=Y,K<=u){var L=l-u;if((y>7e3||G>24576)&&L>423){s=In(e,a,0,R,M,C,H,G,V,u-V,s),G=y=H=0,V=u;for(var x=0;x<286;++x)M[x]=0;for(var x=0;x<30;++x)C[x]=0}var D=2,b=0,g=v,N=Y-B&32767;if(L>2&&U==I(u-N))for(var E=Math.min(h,L)-1,F=Math.min(32767,u),P=Math.min(258,L);N<=F&&--g&&Y!=B;){if(e[u+D]==e[u+D-N]){for(var k=0;k<P&&e[u+k]==e[u+k-N];++k);if(k>D){if(D=k,b=N,k>E)break;for(var ee=Math.min(N,k-2),_=0,x=0;x<ee;++x){var W=u-N+x+32768&32767,de=w[W],he=W-de+32768&32767;he>_&&(_=he,B=W)}}}Y=B,B=w[Y],N+=Y-B+32768&32767}if(b){R[G++]=268435456|Vt[D]<<18|En[b];var ye=Vt[D]&31,Je=En[b]&31;H+=ut[ye]+dt[Je],++M[257+ye],++C[Je],K=u+D,++y}else R[G++]=e[u],++M[e[u]]}}s=In(e,a,i,R,M,C,H,G,V,u-V,s),i||(s=ht(a,s,gs))}return Ht(c,0,n+zt(s)+o)},bs=function(){var e=1,t=0;return{p:function(r){for(var n=e,o=t,i=r.length,l=0;l!=i;){for(var c=Math.min(l+5552,i);l<c;++l)n+=r[l],o+=n;n%=65521,o%=65521}e=n,t=o},d:function(){return(e>>>8<<16|(t&255)<<8|t>>>8)+((e&255)<<23)*2}}},ws=function(e,t,r,n,o){return ys(e,t.level==null?6:t.level,t.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):12+t.mem,r,n,!o)},Ss=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},Ns=function(e,t){var r=t.level,n=r==0?0:r<6?1:r==9?3:2;e[0]=120,e[1]=n<<6|(n?32-2*n:1)},Ts=function(e){if((e[0]&15)!=8||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(e[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function Es(e,t){t===void 0&&(t={});var r=bs();r.p(e);var n=ws(e,t,2,4);return Ns(n,t),Ss(n,n.length-4,r.d()),n}function Cs(e,t){return fs((Ts(e),e.subarray(2,-4)),t)}function Mn(e,t){var r=e.length;if(!t&&typeof TextEncoder<"u")return new TextEncoder().encode(e);for(var n=new ne(e.length+(e.length>>>1)),o=0,i=function(s){n[o++]=s},l=0;l<r;++l){if(o+5>n.length){var c=new ne(o+8+(r-l<<1));c.set(n),n=c}var a=e.charCodeAt(l);a<128||t?i(a):a<2048?(i(192|a>>>6),i(128|a&63)):a>55295&&a<57344?(a=65536+(a&1047552)|e.charCodeAt(++l)&1023,i(240|a>>>18),i(128|a>>>12&63),i(128|a>>>6&63),i(128|a&63)):(i(224|a>>>12),i(128|a>>>6&63),i(128|a&63))}return Ht(n,0,o)}function xn(e,t){var r="";if(!t&&typeof TextDecoder<"u")return new TextDecoder().decode(e);for(var n=0;n<e.length;){var o=e[n++];o<128||t?r+=String.fromCharCode(o):o<224?r+=String.fromCharCode((o&31)<<6|e[n++]&63):o<240?r+=String.fromCharCode((o&15)<<12|(e[n++]&63)<<6|e[n++]&63):(o=((o&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,r+=String.fromCharCode(55296|o>>10,56320|o&1023))}return r}const Zt="v1";var Is=Object.defineProperty,Ms=Object.defineProperties,xs=Object.getOwnPropertyDescriptors,kn=Object.getOwnPropertySymbols,ks=Object.prototype.hasOwnProperty,Os=Object.prototype.propertyIsEnumerable,On=(e,t,r)=>t in e?Is(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ds=(e,t)=>{for(var r in t||(t={}))ks.call(t,r)&&On(e,r,t[r]);if(kn)for(var r of kn(t))Os.call(t,r)&&On(e,r,t[r]);return e},Rs=(e,t)=>Ms(e,xs(t));const Ls=e=>{const t=Rs(Ds({},e),{v:Zt});return xn(Es(Mn(JSON.stringify(t))),!0)},As=e=>{if(typeof e!="string")return e;try{const t=JSON.parse(e);if(t.timestamp)return t}catch{}try{const t=JSON.parse(xn(Cs(Mn(e,!0))));if(t.v===Zt)return t;throw new Error(`These events were packed with packer ${t.v} which is incompatible with current packer ${Zt}.`)}catch(t){throw console.error(t),new Error("Unknown data format.")}};class $e{constructor(t){this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){const t=this.lineNumber||"",r=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+r+")":this.fileName+":"+t+":"+r}}const Fs=/(^|@)\S+:\d+/,Dn=/^\s*at .*(\S+:\d+|\(native\))/m,Ps=/^(eval@)?(\[native code])?$/,Rn={parse:function(e){if(!e)return[];if(typeof e.stacktrace<"u"||typeof e["opera#sourceloc"]<"u")return this.parseOpera(e);if(e.stack&&e.stack.match(Dn))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(e.indexOf(":")===-1)return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error(`Cannot parse given url: ${e}`);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split(`
19
+ `).filter(function(t){return!!t.match(Dn)},this).map(function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let r=t.replace(/^\s+/,"").replace(/\(eval code/g,"(");const n=r.match(/ (\((.+):(\d+):(\d+)\)$)/);r=n?r.replace(n[0],""):r;const o=r.split(/\s+/).slice(1),i=this.extractLocation(n?n[1]:o.pop()),l=o.join(" ")||void 0,c=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new $e({functionName:l,fileName:c,lineNumber:i[1],columnNumber:i[2]})},this)},parseFFOrSafari:function(e){return e.stack.split(`
20
+ `).filter(function(t){return!t.match(Ps)},this).map(function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),t.indexOf("@")===-1&&t.indexOf(":")===-1)return new $e({functionName:t});{const r=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=t.match(r),o=n&&n[1]?n[1]:void 0,i=this.extractLocation(t.replace(r,""));return new $e({functionName:o,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf(`
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(Fs)&&!t.match(/^Error created at/)},this).map(function(t){const r=t.split("@"),n=this.extractLocation(r.pop()),o=(r.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new $e({functionName:o,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function _s(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let r=e.localName;if(!r)break;r=r.toLowerCase();const n=e.parentElement,o=[];if(n.children&&n.children.length>0)for(let i=0;i<n.children.length;i++){const l=n.children[i];l.localName&&l.localName.toLowerCase&&l.localName.toLowerCase()===r&&o.push(l)}o.length>1&&(r+=":eq("+o.indexOf(e)+")"),t=r+(t?">"+t:""),e=n}return t}function Kt(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ln(e,t){if(t===0)return!0;const r=Object.keys(e);for(const n of r)if(Kt(e[n])&&Ln(e[n],t-1))return!0;return!1}function qt(e,t){const r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);const n=[],o=[];return JSON.stringify(e,function(c,a){if(n.length>0){const s=n.indexOf(this);~s?n.splice(s+1):n.push(this),~s?o.splice(s,1/0,c):o.push(c),~n.indexOf(a)&&(n[0]===a?a="[Circular ~]":a="[Circular ~."+o.slice(0,n.indexOf(a)).join(".")+"]")}else n.push(a);if(a==null)return a;if(i(a))return l(a);if(a instanceof Event){const s={};for(const u in a){const d=a[u];Array.isArray(d)?s[u]=_s(d.length?d[0]:null):s[u]=d}return s}else{if(a instanceof Node)return a instanceof HTMLElement?a?a.outerHTML:"":a.nodeName;if(a instanceof Error)return a.stack?a.stack+`
27
+ End of stack for Error object`:a.name+": "+a.message}return a});function i(c){return!!(Kt(c)&&Object.keys(c).length>r.numOfKeysLimit||typeof c=="function"||Kt(c)&&Ln(c,r.depthOfLimit))}function l(c){let a=c.toString();return r.stringLengthLimit&&a.length>r.stringLengthLimit&&(a=`${a.slice(0,r.stringLengthLimit)}...`),a}}const An={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function $s(e,t,r){const n=r.logger;if(!n)return()=>{};let o;typeof n=="string"?o=t[n]:o=n;let i=0;const l=[];if(r.level.includes("error")&&window){const a=s=>{const{message:u,error:d}=s,m=Rn.parse(d).map(v=>v.toString()),h=[qt(u,r.stringifyOptions)];e({level:"error",trace:m,payload:h})};window.addEventListener("error",a),l.push(()=>{window&&window.removeEventListener("error",a)})}for(const a of r.level)l.push(c(o,a));return()=>{l.forEach(a=>a())};function c(a,s){return a[s]?be(a,s,u=>(...d)=>{u.apply(this,d);try{const m=Rn.parse(new Error).map(v=>v.toString()).splice(1),h=d.map(v=>qt(v,r.stringifyOptions));i++,i<r.lengthThreshold?e({level:s,trace:m,payload:h}):i===r.lengthThreshold&&e({level:"warn",trace:[],payload:[qt("The number of log records reached the threshold.")]})}catch(m){u("rrweb logger error:",m,...d)}}):()=>{}}}const Jt="rrweb/console@1",Ws=e=>({name:Jt,observer:$s,options:e?Object.assign({},An,e):An}),mt="__rrweb_original__",js={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],replayLogger:void 0};class Vs{constructor(t){this.config=Object.assign(js,t)}getConsoleLogger(){const t={};for(const r of this.config.level)r==="trace"?t[r]=n=>{(console.log[mt]?console.log[mt]:console.log)(...n.payload.map(o=>JSON.parse(o)),this.formatMessage(n))}:t[r]=n=>{(console[r][mt]?console[r][mt]:console[r])(...n.payload.map(o=>JSON.parse(o)),this.formatMessage(n))};return t}formatMessage(t){if(t.trace.length===0)return"";const r=`
28
+ at `;let n=r;return n+=t.trace.join(r),n}}const Us=e=>{const t=e?.replayLogger||new Vs(e).getConsoleLogger();return{handler(r,n,o){let i=null;if(r.type===O.IncrementalSnapshot&&r.data.source===A.Log?i=r.data:r.type===O.Plugin&&r.data.plugin===Jt&&(i=r.data.payload),i)try{typeof t[i.level]=="function"&&t[i.level](i)}catch(l){o.replayer.config.showWarning&&console.warn(l)}}}},Fn={key:"_sid"},Gs="rrweb/sequential-id@1",Bs=e=>{const t=e?Object.assign({},Fn,e):Fn;let r=0;return{name:Gs,eventProcessor(n){return Object.assign(n,{[t.key]:++r}),n},options:t}},Pn={key:"_sid",warnOnMissingId:!0},zs=e=>{const{key:t,warnOnMissingId:r}=e?Object.assign({},Pn,e):Pn;let n=1;return{handler(o){if(t in o){const i=o[t];i!==n?console.error(`[sequential-id-plugin]: expect to get an id with value "${n}", but got "${i}"`):n++}else r&&console.warn(`[sequential-id-plugin]: failed to get id in key: "${t}"`)}}};return q.EventType=O,q.IncrementalSource=A,q.MouseInteractions=te,q.PLUGIN_NAME=Jt,q.Replayer=as,q.ReplayerEvents=z,q.addCustomEvent=ls,q.freezePage=cs,q.getRecordConsolePlugin=Ws,q.getRecordSequentialIdPlugin=Bs,q.getReplayConsolePlugin=Us,q.getReplaySequentialIdPlugin=zs,q.pack=Ls,q.record=Ie,q.unpack=As,q.utils=vo,Object.defineProperty(q,"__esModule",{value:!0}),q}({});
30
29
  //# sourceMappingURL=rrweb-all.min.js.map