@highlight-run/rrweb 1.2.1 → 2.0.0-lambda.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/CHANGELOG.md +359 -19
  2. package/README.md +147 -34
  3. package/dist/assets/image-bitmap-data-url-worker-DwtK8A0z.js.map +1 -0
  4. package/dist/rrweb.cjs +17806 -0
  5. package/dist/rrweb.cjs.map +1 -0
  6. package/dist/rrweb.d.cts +509 -0
  7. package/dist/rrweb.d.ts +509 -0
  8. package/dist/rrweb.js +17807 -0
  9. package/dist/rrweb.js.map +1 -0
  10. package/dist/rrweb.umd.cjs +17810 -0
  11. package/dist/rrweb.umd.cjs.map +7 -0
  12. package/dist/rrweb.umd.min.cjs +90 -0
  13. package/dist/rrweb.umd.min.cjs.map +7 -0
  14. package/dist/{index.css → style.css} +23 -14
  15. package/dist/style.min.css +2 -0
  16. package/dist/style.min.css.map +7 -0
  17. package/package.json +67 -61
  18. package/rrweb-record/package.json +4 -0
  19. package/rrweb-replay/package.json +4 -0
  20. package/README.zh_CN.md +0 -122
  21. package/dist/entries/all.d.ts +0 -4
  22. package/dist/entries/record-pack.d.ts +0 -2
  23. package/dist/entries/replay-unpack.d.ts +0 -2
  24. package/dist/index.css.map +0 -1
  25. package/dist/index.d.ts +0 -9
  26. package/dist/index.js +0 -3
  27. package/dist/index.js.LICENSE.txt +0 -14
  28. package/dist/index.js.map +0 -1
  29. package/dist/packer/base.d.ts +0 -7
  30. package/dist/packer/index.d.ts +0 -2
  31. package/dist/packer/pack.d.ts +0 -2
  32. package/dist/packer/unpack.d.ts +0 -2
  33. package/dist/plugins/console/record/error-stack-parser.d.ts +0 -37
  34. package/dist/plugins/console/record/index.d.ts +0 -41
  35. package/dist/plugins/console/record/stringify.d.ts +0 -2
  36. package/dist/plugins/console/replay/index.d.ts +0 -9
  37. package/dist/plugins/console-record.min.js +0 -16
  38. package/dist/plugins/console-record.min.js.map +0 -1
  39. package/dist/plugins/entries/all.d.ts +0 -4
  40. package/dist/plugins/entries/record-pack.d.ts +0 -2
  41. package/dist/plugins/entries/replay-unpack.d.ts +0 -2
  42. package/dist/plugins/index.d.ts +0 -9
  43. package/dist/plugins/packer/base.d.ts +0 -7
  44. package/dist/plugins/packer/index.d.ts +0 -2
  45. package/dist/plugins/packer/pack.d.ts +0 -2
  46. package/dist/plugins/packer/unpack.d.ts +0 -2
  47. package/dist/plugins/plugins/console/record/error-stack-parser.d.ts +0 -37
  48. package/dist/plugins/plugins/console/record/index.d.ts +0 -41
  49. package/dist/plugins/plugins/console/record/stringify.d.ts +0 -2
  50. package/dist/plugins/plugins/console/replay/index.d.ts +0 -9
  51. package/dist/plugins/plugins/sequential-id/record/index.d.ts +0 -6
  52. package/dist/plugins/plugins/sequential-id/replay/index.d.ts +0 -7
  53. package/dist/plugins/record/iframe-manager.d.ts +0 -13
  54. package/dist/plugins/record/index.d.ts +0 -9
  55. package/dist/plugins/record/mutation.d.ts +0 -45
  56. package/dist/plugins/record/observer.d.ts +0 -11
  57. package/dist/plugins/record/observers/canvas/2d.d.ts +0 -2
  58. package/dist/plugins/record/observers/canvas/canvas-manager.d.ts +0 -32
  59. package/dist/plugins/record/observers/canvas/canvas.d.ts +0 -2
  60. package/dist/plugins/record/observers/canvas/serialize-args.d.ts +0 -6
  61. package/dist/plugins/record/observers/canvas/webgl.d.ts +0 -2
  62. package/dist/plugins/record/shadow-dom-manager.d.ts +0 -34
  63. package/dist/plugins/replay/canvas/2d.d.ts +0 -9
  64. package/dist/plugins/replay/canvas/index.d.ts +0 -9
  65. package/dist/plugins/replay/canvas/webgl.d.ts +0 -11
  66. package/dist/plugins/replay/index.d.ts +0 -82
  67. package/dist/plugins/replay/machine.d.ts +0 -85
  68. package/dist/plugins/replay/smoothscroll.d.ts +0 -1
  69. package/dist/plugins/replay/styles/inject-style.d.ts +0 -2
  70. package/dist/plugins/replay/timer.d.ts +0 -19
  71. package/dist/plugins/replay/virtual-styles.d.ts +0 -43
  72. package/dist/plugins/rrdom/index.d.ts +0 -1
  73. package/dist/plugins/rrdom/tree-node.d.ts +0 -20
  74. package/dist/plugins/sequential-id/record/index.d.ts +0 -6
  75. package/dist/plugins/sequential-id/replay/index.d.ts +0 -7
  76. package/dist/plugins/snapshot/css.d.ts +0 -92
  77. package/dist/plugins/snapshot/index.d.ts +0 -5
  78. package/dist/plugins/snapshot/rebuild.d.ts +0 -19
  79. package/dist/plugins/snapshot/snapshot.d.ts +0 -49
  80. package/dist/plugins/snapshot/types.d.ts +0 -99
  81. package/dist/plugins/snapshot/utils.d.ts +0 -11
  82. package/dist/plugins/types.d.ts +0 -509
  83. package/dist/plugins/utils.d.ts +0 -71
  84. package/dist/record/iframe-manager.d.ts +0 -13
  85. package/dist/record/index.d.ts +0 -9
  86. package/dist/record/mutation.d.ts +0 -45
  87. package/dist/record/observer.d.ts +0 -11
  88. package/dist/record/observers/canvas/2d.d.ts +0 -2
  89. package/dist/record/observers/canvas/canvas-manager.d.ts +0 -32
  90. package/dist/record/observers/canvas/canvas.d.ts +0 -2
  91. package/dist/record/observers/canvas/serialize-args.d.ts +0 -6
  92. package/dist/record/observers/canvas/webgl.d.ts +0 -2
  93. package/dist/record/shadow-dom-manager.d.ts +0 -34
  94. package/dist/replay/canvas/2d.d.ts +0 -9
  95. package/dist/replay/canvas/index.d.ts +0 -9
  96. package/dist/replay/canvas/webgl.d.ts +0 -11
  97. package/dist/replay/index.d.ts +0 -82
  98. package/dist/replay/machine.d.ts +0 -85
  99. package/dist/replay/smoothscroll.d.ts +0 -1
  100. package/dist/replay/styles/inject-style.d.ts +0 -2
  101. package/dist/replay/timer.d.ts +0 -19
  102. package/dist/replay/virtual-styles.d.ts +0 -43
  103. package/dist/rrdom/index.d.ts +0 -1
  104. package/dist/rrdom/tree-node.d.ts +0 -20
  105. package/dist/rrweb.min.js +0 -30
  106. package/dist/rrweb.min.js.map +0 -1
  107. package/dist/snapshot/css.d.ts +0 -92
  108. package/dist/snapshot/index.d.ts +0 -5
  109. package/dist/snapshot/rebuild.d.ts +0 -19
  110. package/dist/snapshot/snapshot.d.ts +0 -49
  111. package/dist/snapshot/types.d.ts +0 -99
  112. package/dist/snapshot/utils.d.ts +0 -11
  113. package/dist/types.d.ts +0 -509
  114. package/dist/utils.d.ts +0 -71
package/dist/rrweb.min.js DELETED
@@ -1,30 +0,0 @@
1
- var rrweb=function(e){"use strict";
2
- /*! *****************************************************************************
3
- Copyright (c) Microsoft Corporation.
4
-
5
- Permission to use, copy, modify, and/or distribute this software for any
6
- purpose with or without fee is hereby granted.
7
-
8
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
- PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */var t,r,n,o,i,a,s=function(){return(s=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 l(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 c(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 u(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(c(arguments[t]));return e}function d(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 p(){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,(t=e.EventType||(e.EventType={}))[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",e.IncrementalSource=void 0,(r=e.IncrementalSource||(e.IncrementalSource={}))[r.Mutation=0]="Mutation",r[r.MouseMove=1]="MouseMove",r[r.MouseInteraction=2]="MouseInteraction",r[r.Scroll=3]="Scroll",r[r.ViewportResize=4]="ViewportResize",r[r.Input=5]="Input",r[r.TouchMove=6]="TouchMove",r[r.MediaInteraction=7]="MediaInteraction",r[r.StyleSheetRule=8]="StyleSheetRule",r[r.CanvasMutation=9]="CanvasMutation",r[r.Font=10]="Font",r[r.Log=11]="Log",r[r.Drag=12]="Drag",r[r.StyleDeclaration=13]="StyleDeclaration",e.MouseInteractions=void 0,(n=e.MouseInteractions||(e.MouseInteractions={}))[n.MouseUp=0]="MouseUp",n[n.MouseDown=1]="MouseDown",n[n.Click=2]="Click",n[n.ContextMenu=3]="ContextMenu",n[n.DblClick=4]="DblClick",n[n.Focus=5]="Focus",n[n.Blur=6]="Blur",n[n.TouchStart=7]="TouchStart",n[n.TouchMove_Departed=8]="TouchMove_Departed",n[n.TouchEnd=9]="TouchEnd",n[n.TouchCancel=10]="TouchCancel",function(e){e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2"}(o||(o={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange"}(i||(i={})),e.ReplayerEvents=void 0,(a=e.ReplayerEvents||(e.ReplayerEvents={})).Start="start",a.Pause="pause",a.Resume="resume",a.Resize="resize",a.Finish="finish",a.FullsnapshotRebuilded="fullsnapshot-rebuilded",a.LoadStylesheetStart="load-stylesheet-start",a.LoadStylesheetEnd="load-stylesheet-end",a.SkipStart="skip-start",a.SkipEnd="skip-end",a.MouseInteraction="mouse-interaction",a.EventCast="event-cast",a.CustomEvent="custom-event",a.Flush="flush",a.StateChange="state-change",a.PlayBack="play-back";var f="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 h(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 m(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 m(e,t,i||{},!0)}}function v(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 y(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function g(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}e.mirror={map:{},getId:function(){return console.error(f),-1},getNode:function(){return console.error(f),null},removeNodeFromMap:function(){console.error(f)},has:function(){return console.error(f),!1},reset:function(){console.error(f)}},"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(e.mirror=new Proxy(e.mirror,{get:function(e,t,r){return"map"===t&&console.error(f),Reflect.get(e,t,r)}}));var b=function(e){try{if(e instanceof HTMLElement)return"CANVAS"===e.tagName}catch(e){return!1}return!1};function S(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||S(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,S(e.parentNode,t)}function T(e){return"__sn"in e&&e.__sn.id===j}function x(e,t){if(L(e))return!1;var r=t.getId(e);return!t.has(r)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||x(e.parentNode,t))}function w(e){return Boolean(e.changedTouches)}function E(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 I=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,n,o,i=this,a=this.tree,s=this.removeNodeMutations,c=this.textMutations,u=this.attributeMutations,d={source:e.IncrementalSource.Mutation,removes:s,texts:c,attributes:u,adds:[]},p=function(e,t){t&&i.removeIdSet.add(e.id),d.texts=d.texts.concat(t?[]:e.texts).filter((function(e){return!i.removeIdSet.has(e.id)})),d.attributes=d.attributes.concat(t?[]:e.attributes).filter((function(e){return!i.removeIdSet.has(e.id)})),i.removeIdSet.has(e.id)||i.removeIdSet.has(e.mutation.parentId)||t?Object.values(e.children).forEach((function(e){return p(e,!0)})):(d.adds.push(e.mutation),e.children&&Object.values(e.children).forEach((function(e){return p(e,!1)})))};Object.values(a).forEach((function(e){return p(e,!1)}));try{for(var f=l(this.scrollMap.keys()),h=f.next();!h.done;h=f.next()){var m=h.value;this.removeIdSet.has(m)&&this.scrollMap.delete(m)}}catch(e){t={error:e}}finally{try{h&&!h.done&&(r=f.return)&&r.call(f)}finally{if(t)throw t.error}}try{for(var v=l(this.inputMap.keys()),y=v.next();!y.done;y=v.next()){m=y.value;this.removeIdSet.has(m)&&this.inputMap.delete(m)}}catch(e){n={error:e}}finally{try{y&&!y.done&&(o=v.return)&&o.call(v)}finally{if(n)throw n.error}}var g=new Map(this.scrollMap),b=new Map(this.inputMap);return this.reset(),{mutationData:d,scrollMap:g,inputMap:b}},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 C(e){var t,r,n={},o=function(e,t){var r={value:e,parent:t,children:[]};return n[e.node.id]=r,r},i=[];try{for(var a=l(e),s=a.next();!s.done;s=a.next()){var c=s.value,u=c.nextId,d=c.parentId;if(u&&u in n){var p=n[u];if(p.parent){var f=p.parent.children.indexOf(p);p.parent.children.splice(f,0,o(c,p.parent))}else{f=i.indexOf(p);i.splice(f,0,o(c,null))}}else if(d in n){var h=n[d];h.children.push(o(c,h))}else i.push(o(c,null))}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return i}function k(e,t){t(e.value);for(var r=e.children.length-1;r>=0;r--)k(e.children[r],t)}function M(e){return"__sn"in e&&(e.__sn.type===O.Element&&"iframe"===e.__sn.tagName)}function N(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=N(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 R(e){var t;return Boolean(null===(t=e)||void 0===t?void 0:t.shadowRoot)}function _(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 O,A=Object.freeze({__proto__:null,on:d,createMirror:p,get _mirror(){return e.mirror},throttle:h,hookSetter:m,patch:v,getWindowHeight:y,getWindowWidth:g,isCanvasNode:b,isBlocked:S,isIgnored:T,isAncestorRemoved:x,isTouchEvent:w,polyfill:E,TreeIndex:I,queueToResolveTrees:C,iterateResolveTree:k,isIframeINode:M,getBaseDimension:N,hasShadowRoot:R,obfuscateText:_});function D(e){return e.nodeType===e.ELEMENT_NODE}function L(e){var t,r=null===(t=e)||void 0===t?void 0:t.host;return Boolean(r&&r.shadowRoot&&r.shadowRoot===e)}function F(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"}(O||(O={}));var P=1,W=new RegExp("[^a-z0-9-_:]"),j=-2;function z(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(B).join(""):null}catch(e){return null}}function B(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=z(e.styleSheet)||t}catch(e){}return t}var V=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,U=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,G=/^(data:)([^,]*),(.*)/i;function H(e,t){return(e||"").replace(V,(function(e,r,n,o,i,a){var s,c,u,d=n||i||a,p=r||o||"";if(!d)return e;if(!U.test(d))return"url("+p+d+p+")";if(G.test(d))return"url("+p+d+p+")";if("/"===d[0])return"url("+p+(((u=t).indexOf("//")>-1?u.split("/").slice(0,3).join("/"):u.split("/")[0]).split("?")[0]+d)+p+")";var f=t.split("/"),h=d.split("/");f.pop();try{for(var m=l(h),v=m.next();!v.done;v=m.next()){var y=v.value;"."!==y&&(".."===y?f.pop():f.push(y))}}catch(e){s={error:e}}finally{try{v&&!v.done&&(c=m.return)&&c.call(m)}finally{if(s)throw s.error}}return"url("+p+f.join("/")+p+")"}))}var Y=/^[^ \t\n\r\u000c]+/,X=/^[, \t\n\r\u000c]+/;function q(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function Q(){var e=document.createElement("a");return e.href="",e.href}function $(e,t,r,n){return"src"===r||"href"===r&&n||"xlink:href"===r&&n&&"#"!==n[0]?q(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(Y);if(","===i.slice(-1))i=q(e,i.substring(0,i.length-1)),o.push(i);else{var a="";i=q(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?H(n,Q()):"object"===t&&"data"===r&&n?q(e,n):n:q(e,n)}function K(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 e.classList.forEach((function(e){if(t.test(e))return!0}));return!(!r||!e.matches(r))||K(e.parentNode,t,r)}return e.nodeType,e.TEXT_NODE,K(e.parentNode,t,r)}function J(e,t){var r,n,o,i,a,s,c=t.doc,u=t.blockClass,d=t.blockSelector,p=t.maskTextClass,f=t.maskTextSelector,h=t.inlineStylesheet,m=t.maskInputOptions,v=void 0===m?{}:m,y=t.maskTextFn,g=t.maskInputFn,b=t.recordCanvas,S=t.keepIframeSrcFn,T=t.enableStrictPrivacy;if(c.__sn){var x=c.__sn.id;i=1===x?void 0:x}switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:O.Document,childNodes:[],compatMode:e.compatMode,rootId:i}:{type:O.Document,childNodes:[],rootId:i};case e.DOCUMENT_TYPE_NODE:return{type:O.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:i};case e.ELEMENT_NODE:var w=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,u,d),E=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return W.test(t)?"div":t}(e),I={};try{for(var C=l(Array.from(e.attributes)),k=C.next();!k.done;k=C.next()){var M=k.value,N=M.name,R=M.value;I[N]=$(c,E,N,R)}}catch(e){r={error:e}}finally{try{k&&!k.done&&(n=C.return)&&n.call(C)}finally{if(r)throw r.error}}if("link"===E&&h){var A,D=Array.from(c.styleSheets).find((function(t){return t.href===e.href}));(A=z(D))&&(delete I.rel,delete I.href,I._cssText=H(A,D.href))}if("style"===E&&e.sheet&&!(e.innerText||e.textContent||"").trim().length)(A=z(e.sheet))&&(I._cssText=H(A,Q()));if("input"===E||"textarea"===E||"select"===E){R=e.value;"radio"!==I.type&&"checkbox"!==I.type&&"submit"!==I.type&&"button"!==I.type&&R?"password"===I.type?I.value="*".repeat(R.length):I.value=F({type:I.type,tagName:E,value:R,maskInputOptions:v,maskInputFn:g}):e.checked&&(I.checked=e.checked)}if("option"===E&&(e.selected&&!v.select?I.selected=!0:delete I.selected),"canvas"===E&&b)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="__rrweb_original__"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)||(I.rr_dataURL=e.toDataURL());else if(!("__context"in e)){var L=e.toDataURL(),P=document.createElement("canvas");P.width=e.width,P.height=e.height,L!==P.toDataURL()&&(I.rr_dataURL=L)}if("audio"!==E&&"video"!==E||(I.rr_mediaState=e.paused?"paused":"played",I.rr_mediaCurrentTime=e.currentTime),e.scrollLeft&&(I.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(I.rr_scrollTop=e.scrollTop),w||"img"===E&&T){var j=e.getBoundingClientRect(),B=j.width,V=j.height;I={class:I.class,rr_width:B+"px",rr_height:V+"px"},w=!0}return"iframe"!==E||S(I.src)||(e.contentDocument||(I.rr_src=I.src),delete I.src),{type:O.Element,tagName:E,attributes:I,childNodes:[],isSVG:(s=e,Boolean("svg"===s.tagName||s.ownerSVGElement)||void 0),needBlock:w,rootId:i};case e.TEXT_NODE:var U=e.parentNode&&e.parentNode.tagName,G=e.textContent,Y="STYLE"===U||void 0,X="SCRIPT"===U||void 0,q=!1;if(Y&&G){try{e.nextSibling||e.previousSibling||(null===(o=e.parentNode.sheet)||void 0===o?void 0:o.cssRules)&&(G=(a=e.parentNode.sheet).cssRules?Array.from(a.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(e){}G=H(G,Q()),q=!0}if(X?(G="SCRIPT_PLACEHOLDER",q=!0):"NOSCRIPT"===U&&(G="",q=!0),!Y&&!X&&K(e,p,f)&&G&&(G=y?y(G):G.replace(/[\S]/g,"*")),T&&!q&&U)!new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]).has(U)&&G&&(G=_(G));return{type:O.Text,textContent:G||"",isStyle:Y,rootId:i};case e.CDATA_SECTION_NODE:return{type:O.CDATA,textContent:"",rootId:i};case e.COMMENT_NODE:return{type:O.Comment,textContent:e.textContent||"",rootId:i};default:return!1}}function Z(e){return void 0===e?"":e.toLowerCase()}function ee(e,t){var r,n,o,i,a,s=t.doc,c=t.map,u=t.blockClass,d=t.blockSelector,p=t.maskTextClass,f=t.maskTextSelector,h=t.skipChild,m=void 0!==h&&h,v=t.inlineStylesheet,y=void 0===v||v,g=t.maskInputOptions,b=void 0===g?{}:g,S=t.maskTextFn,T=t.maskInputFn,x=t.slimDOMOptions,w=t.recordCanvas,E=void 0!==w&&w,I=t.onSerialize,C=t.onIframeLoad,k=t.iframeLoadTimeout,M=void 0===k?5e3:k,N=t.keepIframeSrcFn,R=void 0===N?function(){return!1}:N,_=t.enableStrictPrivacy,A=t.preserveWhiteSpace,F=void 0===A||A,W=J(e,{doc:s,blockClass:u,blockSelector:d,maskTextClass:p,maskTextSelector:f,inlineStylesheet:y,maskInputOptions:b,maskTextFn:S,maskInputFn:T,recordCanvas:E,keepIframeSrcFn:R,enableStrictPrivacy:_});if(!W)return console.warn(e,"not serialized"),null;a="__sn"in e?e.__sn.id:!function(e,t){if(t.comment&&e.type===O.Comment)return!0;if(e.type===O.Element){if(t.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(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Z(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Z(e.attributes.name)||"icon"===Z(e.attributes.rel)||"apple-touch-icon"===Z(e.attributes.rel)||"shortcut icon"===Z(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Z(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Z(e.attributes.property).match(/^(og|twitter|fb):/)||Z(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Z(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Z(e.attributes.name)||"googlebot"===Z(e.attributes.name)||"bingbot"===Z(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Z(e.attributes.name)||"generator"===Z(e.attributes.name)||"framework"===Z(e.attributes.name)||"publisher"===Z(e.attributes.name)||"progid"===Z(e.attributes.name)||Z(e.attributes.property).match(/^article:/)||Z(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Z(e.attributes.name)||"yandex-verification"===Z(e.attributes.name)||"csrf-token"===Z(e.attributes.name)||"p:domain_verify"===Z(e.attributes.name)||"verify-v1"===Z(e.attributes.name)||"verification"===Z(e.attributes.name)||"shopify-checkout-api-token"===Z(e.attributes.name)))return!0}}return!1}(W,x)&&(F||W.type!==O.Text||W.isStyle||W.textContent.replace(/^\s+|\s+$/gm,"").length)?P++:j;var z=Object.assign(W,{id:a});if(e.__sn=z,a===j)return null;c[a]=e,I&&I(e);var B=!m;if(z.type===O.Element){if(B=B&&!z.needBlock,z.needBlock&&"img"===z.tagName){var V=e.cloneNode();V.src="",c[a]=V}delete z.needBlock}if((z.type===O.Document||z.type===O.Element)&&B){x.headWhitespace&&W.type===O.Element&&"head"===W.tagName&&(F=!1);var U={doc:s,map:c,blockClass:u,blockSelector:d,maskTextClass:p,maskTextSelector:f,skipChild:m,inlineStylesheet:y,maskInputOptions:b,maskTextFn:S,maskInputFn:T,slimDOMOptions:x,recordCanvas:E,preserveWhiteSpace:F,onSerialize:I,onIframeLoad:C,iframeLoadTimeout:M,keepIframeSrcFn:R,enableStrictPrivacy:_};try{for(var G=l(Array.from(e.childNodes)),H=G.next();!H.done;H=G.next()){(q=ee(H.value,U))&&z.childNodes.push(q)}}catch(e){r={error:e}}finally{try{H&&!H.done&&(n=G.return)&&n.call(G)}finally{if(r)throw r.error}}if(D(e)&&e.shadowRoot){z.isShadowHost=!0;try{for(var Y=l(Array.from(e.shadowRoot.childNodes)),X=Y.next();!X.done;X=Y.next()){var q;(q=ee(X.value,U))&&(q.isShadow=!0,z.childNodes.push(q))}}catch(e){o={error:e}}finally{try{X&&!X.done&&(i=Y.return)&&i.call(Y)}finally{if(o)throw o.error}}}}return e.parentNode&&L(e.parentNode)&&(z.isShadow=!0),z.type===O.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){"about:blank"===n.location.href&&"about:blank"!==e.src&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0)}else{var a=setTimeout((function(){i||(t(),i=!0)}),r);e.addEventListener("load",(function(){clearTimeout(a),i=!0,t()}))}}}(e,(function(){var t=e.contentDocument;if(t&&C){var r=ee(t,{doc:t,map:c,blockClass:u,blockSelector:d,maskTextClass:p,maskTextSelector:f,skipChild:!1,inlineStylesheet:y,maskInputOptions:b,maskTextFn:S,maskInputFn:T,slimDOMOptions:x,recordCanvas:E,preserveWhiteSpace:F,onSerialize:I,onIframeLoad:C,iframeLoadTimeout:M,keepIframeSrcFn:R,enableStrictPrivacy:_});r&&C(e,r)}}),M),z}var te=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function re(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),h(),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 c(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 u(){return f(/^{\s*/)}function d(){return f(/^}/)}function p(){var t,r=[];for(h(),m(r);e.length&&"}"!==e.charAt(0)&&(t=C()||k());)!1!==t&&(r.push(t),m(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 h(){f(/^\s*/)}function m(e){var t;for(void 0===e&&(e=[]);t=v();)!1!==t&&e.push(t),t=v();return e}function v(){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 c("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 y(){var e=f(/^([^{]+)/);if(e)return ne(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 g(){var e=i(),t=f(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=ne(t[0]);if(!f(/^:\s*/))return c("property missing ':'");var n=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:r.replace(te,""),value:n?ne(n[0]).replace(te,""):""});return f(/^[;\s]*/),o}}function b(){var e,t=[];if(!u())return c("missing '{'");for(m(t);e=g();)!1!==e&&(t.push(e),m(t)),e=g();return d()?t:c("missing '}'")}function S(){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:b()})}var T,x=I("import"),w=I("charset"),E=I("namespace");function I(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 C(){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 c("@keyframes missing name");var n,o=t[1];if(!u())return c("@keyframes missing '{'");for(var a=m();n=S();)a.push(n),a=a.concat(m());return d()?e({type:"keyframes",name:o,vendor:r,keyframes:a}):c("@keyframes missing '}'")}}()||function(){var e=i(),t=f(/^@media *([^{]+)/);if(t){var r=ne(t[1]);if(!u())return c("@media missing '{'");var n=m().concat(p());return d()?e({type:"media",media:r,rules:n}):c("@media missing '}'")}}()||function(){var e=i(),t=f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:ne(t[1]),media:ne(t[2])})}()||function(){var e=i(),t=f(/^@supports *([^{]+)/);if(t){var r=ne(t[1]);if(!u())return c("@supports missing '{'");var n=m().concat(p());return d()?e({type:"supports",supports:r,rules:n}):c("@supports missing '}'")}}()||x()||w()||E()||function(){var e=i(),t=f(/^@([-\w]+)?document *([^{]+)/);if(t){var r=ne(t[1]),n=ne(t[2]);if(!u())return c("@document missing '{'");var o=m().concat(p());return d()?e({type:"document",document:n,vendor:r,rules:o}):c("@document missing '}'")}}()||function(){var e=i();if(f(/^@page */)){var t=y()||[];if(!u())return c("@page missing '{'");for(var r,n=m();r=g();)n.push(r),n=n.concat(m());return d()?e({type:"page",selectors:t,declarations:n}):c("@page missing '}'")}}()||function(){var e=i();if(f(/^@host\s*/)){if(!u())return c("@host missing '{'");var t=m().concat(p());return d()?e({type:"host",rules:t}):c("@host missing '}'")}}()||function(){var e=i();if(f(/^@font-face\s*/)){if(!u())return c("@font-face missing '{'");for(var t,r=m();t=g();)r.push(t),r=r.concat(m());return d()?e({type:"font-face",declarations:r}):c("@font-face missing '}'")}}()}function k(){var e=i(),t=y();return t?(m(),e({type:"rule",selectors:t,declarations:b()})):c("selector missing")}return function e(t,r){var n,o,i=t&&"string"==typeof t.type,a=i?t:r;try{for(var s=l(Object.keys(t)),c=s.next();!c.done;c=s.next()){var u=c.value,d=t[u];Array.isArray(d)?d.forEach((function(t){e(t,a)})):d&&"object"==typeof d&&e(d,a)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}i&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:r||null});return t}((T=p(),{type:"stylesheet",stylesheet:{source:t.source,rules:T,parsingErrors:s}}))}function ne(e){return e?e.replace(/^\s+|\s+$/g,""):""}var oe={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 ie=/([^\\]):hover/,ae=new RegExp(ie.source,"g");function se(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=re(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){ie.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(ae,"$1.\\:hover");return e+", "+t}));return null==t||t.stylesWithHoverClass.set(e,s),s}function le(){return{stylesWithHoverClass:new Map}}function ce(e,t){var r=t.doc,n=t.hackCss,o=t.cache;switch(e.type){case O.Document:return r.implementation.createDocument(null,"",null);case O.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case O.Element:var i,a=function(e){var t=oe[e.tagName]?oe[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e);i=e.isSVG?r.createElementNS("http://www.w3.org/2000/svg",a):r.createElement(a);var s=function(t){var s,c;if(!e.attributes.hasOwnProperty(t))return"continue";var u=e.attributes[t];if("option"===a&&"selected"===t&&!1===u)return"continue";if(u="boolean"==typeof u||"number"==typeof u?"":u,t.startsWith("rr_")){if("canvas"===a&&"rr_dataURL"===t){var d=document.createElement("img");d.src=u,d.onload=function(){var e=i.getContext("2d");e&&e.drawImage(d,0,0,d.width,d.height)}}if("rr_width"===t&&(i.style.width=u),"rr_height"===t&&(i.style.height=u),"rr_mediaCurrentTime"===t&&(i.currentTime=e.attributes.rr_mediaCurrentTime),"rr_mediaState"===t)switch(u){case"played":i.play().catch((function(e){return console.warn("media playback error",e)}));break;case"paused":i.pause()}}else{var p="textarea"===a&&"value"===t,f="style"===a&&"_cssText"===t;if(f&&n&&"string"==typeof(u=se(u,o))){for(var h=/url\(\"https:\/\/\S*(.eot|.woff2|.ttf|.woff)\S*\"\)/gm,m=void 0,v=[];null!==(m=h.exec(u));)m.index===h.lastIndex&&h.lastIndex++,m.forEach((function(e,t){if(0===t){var r=e.slice(5,e.length-2);v.push({originalUrl:r,proxyUrl:r.replace(r,"https://replay-cors-proxy.highlightrun.workers.dev?url="+r)})}}));v.forEach((function(e){u=u.replace(e.originalUrl,e.proxyUrl)}))}if(p||f){var y=r.createTextNode(u);try{for(var g=(s=void 0,l(Array.from(i.childNodes))),b=g.next();!b.done;b=g.next()){var S=b.value;S.nodeType===i.TEXT_NODE&&i.removeChild(S)}}catch(e){s={error:e}}finally{try{b&&!b.done&&(c=g.return)&&c.call(g)}finally{if(s)throw s.error}}return i.appendChild(y),"continue"}try{if(e.isSVG&&"xlink:href"===t)i.setAttributeNS("http://www.w3.org/1999/xlink",t,u);else if("onload"===t||"onclick"===t||"onmouse"===t.substring(0,7))i.setAttribute("_"+t,u);else{if("meta"===a&&"Content-Security-Policy"===e.attributes["http-equiv"]&&"content"===t)return i.setAttribute("csp-content",u),"continue";"link"===a&&"preload"===e.attributes.rel&&"script"===e.attributes.as||"link"===a&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")||i.setAttribute(t,u)}}catch(e){}}};for(var c in e.attributes)s(c);if(e.isShadowHost)if(i.shadowRoot)for(;i.shadowRoot.firstChild;)i.shadowRoot.removeChild(i.shadowRoot.firstChild);else i.attachShadow({mode:"open"});return i;case O.Text:return r.createTextNode(e.isStyle&&n?se(e.textContent,o):e.textContent);case O.CDATA:return r.createCDATASection(e.textContent);case O.Comment:return r.createComment(e.textContent);default:return null}}function ue(e,t){var r,n,o=t.doc,i=t.map,a=t.skipChild,s=void 0!==a&&a,c=t.hackCss,u=void 0===c||c,d=t.afterAppend,p=t.cache,f=ce(e,{doc:o,hackCss:u,cache:p});if(!f)return null;if(e.rootId&&console.assert(i[e.rootId]===o,"Target document should has the same root id."),e.type===O.Document&&(o.close(),o.open(),"BackCompat"===e.compatMode&&e.childNodes&&e.childNodes[0].type!==O.DocumentType&&(e.childNodes[0].type===O.Element&&"xmlns"in e.childNodes[0].attributes&&"http://www.w3.org/1999/xhtml"===e.childNodes[0].attributes.xmlns?o.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):o.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),f=o),f.__sn=e,i[e.id]=f,(e.type===O.Document||e.type===O.Element)&&!s)try{for(var h=l(e.childNodes),m=h.next();!m.done;m=h.next()){var v=m.value,y=ue(v,{doc:o,map:i,skipChild:!1,hackCss:u,afterAppend:d,cache:p});y?(v.isShadow&&D(f)&&f.shadowRoot?f.shadowRoot.appendChild(y):f.appendChild(y),d&&d(y)):console.warn("Failed to rebuild",v)}}catch(e){r={error:e}}finally{try{m&&!m.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}return f}function de(e,t){var r=t.doc,n=t.onVisit,o=t.hackCss,i={},a=ue(e,{doc:r,map:i,skipChild:!1,hackCss:void 0===o||o,afterAppend:t.afterAppend,cache:t.cache});return function(e,t){for(var r in e)e[r]&&(n=e[r],t(n));var n}(i,(function(e){n&&n(e),function(e){var t=e.__sn;if(t.type===O.Element){var r=e;for(var n in t.attributes)if(t.attributes.hasOwnProperty(n)&&n.startsWith("rr_")){var o=t.attributes[n];"rr_scrollLeft"===n&&(r.scrollLeft=o),"rr_scrollTop"===n&&(r.scrollTop=o)}}}(e)})),[a,i]}function pe(e){return"__ln"in e}var fe=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&&pe(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&&pe(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}(),he=function(e,t){return e+"@"+t};function me(e){return"__sn"in e}var ve=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,n,o;if(!e.frozen&&!e.locked){for(var i=[],a=new fe,s=function(t){for(var r=t,n=j;n===j;)n=(r=r&&r.nextSibling)&&e.mirror.getId(r);return n},c=function(t){var r,n=t.getRootNode?null===(r=t.getRootNode())||void 0===r?void 0:r.host:null,o=!(e.doc.contains(t)||n instanceof Node&&e.doc.contains(n));if(t.parentNode&&!o){var l=L(t.parentNode)?e.mirror.getId(n):e.mirror.getId(t.parentNode),c=s(t);if(-1===l||-1===c)return a.addNode(t);var u=ee(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,enableStrictPrivacy:e.enableStrictPrivacy,onSerialize:function(r){M(r)&&e.iframeManager.addIframe(r),R(t)&&e.shadowDomManager.addShadowRoot(t.shadowRoot,document)},onIframeLoad:function(t,r){e.iframeManager.attachIframe(t,r)}});u&&i.push({parentId:l,nextId:c,node:u})}};e.mapRemoves.length;)e.mirror.removeNodeFromMap(e.mapRemoves.shift());try{for(var u=l(e.movedSet),d=u.next();!d.done;d=u.next()){var p=d.value;ge(e.removes,p,e.mirror)&&!e.movedSet.has(p.parentNode)||c(p)}}catch(e){t={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}try{for(var f=l(e.addedSet),h=f.next();!h.done;h=f.next()){p=h.value;be(e.droppedSet,p)||ge(e.removes,p,e.mirror)?be(e.movedSet,p)?c(p):e.droppedSet.add(p):c(p)}}catch(e){n={error:e}}finally{try{h&&!h.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}for(var m=null;a.length;){var v=null;if(m){var y=e.mirror.getId(m.value.parentNode),g=s(m.value);-1!==y&&-1!==g&&(v=m)}if(!v)for(var b=a.length-1;b>=0;b--){var S=a.get(b);if(S){y=e.mirror.getId(S.value.parentNode),g=s(S.value);if(-1!==y&&-1!==g){v=S;break}}}if(!v){for(;a.head;)a.removeNode(a.head.value);break}m=v.previous,a.removeNode(v.value),c(v.value)}var T={texts:e.texts.map((function(t){var r=t.value;return e.enableStrictPrivacy&&r&&(r=_(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:i};(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.emissionCallback(T))}},this.processMutation=function(t){var r,n,o,i;if(!T(t.target))switch(t.type){case"characterData":var a=t.target.textContent;S(t.target,e.blockClass)||a===t.oldValue||e.texts.push({value:K(t.target,e.maskTextClass,e.maskTextSelector)&&a?e.maskTextFn?e.maskTextFn(a):a.replace(/[\S]/g,"*"):a,node:t.target});break;case"attributes":var s=t.target;a=t.target.getAttribute(t.attributeName);if("value"===t.attributeName&&(a=F({maskInputOptions:e.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:a,maskInputFn:e.maskInputFn})),S(t.target,e.blockClass)||a===t.oldValue)return;var c=e.attributes.find((function(e){return e.node===t.target}));if(c||(c={node:t.target,attributes:{}},e.attributes.push(c)),"INPUT"===t.target.tagName){var u=t.target;if("password"===u.type){c.attributes.value="*".repeat(u.value.length);break}}if("style"===t.attributeName){var d=e.doc.createElement("span");t.oldValue&&d.setAttribute("style",t.oldValue),void 0!==c.attributes.style&&null!==c.attributes.style||(c.attributes.style={});var p=c.attributes.style;try{for(var f=l(Array.from(s.style)),h=f.next();!h.done;h=f.next()){var m=h.value,v=s.style.getPropertyValue(m),y=s.style.getPropertyPriority(m);v===d.style.getPropertyValue(m)&&y===d.style.getPropertyPriority(m)||(p[m]=""===y?v:[v,y])}}catch(e){r={error:e}}finally{try{h&&!h.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}try{for(var g=l(Array.from(d.style)),b=g.next();!b.done;b=g.next()){m=b.value;""===s.style.getPropertyValue(m)&&(p[m]=!1)}}catch(e){o={error:e}}finally{try{b&&!b.done&&(i=g.return)&&i.call(g)}finally{if(o)throw o.error}}}else c.attributes[t.attributeName]=$(e.doc,t.target.tagName,t.attributeName,a);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=L(t.target)?e.mirror.getId(t.target.host):e.mirror.getId(t.target);S(t.target,e.blockClass)||T(r)||(e.addedSet.has(r)?(ye(e.addedSet,r),e.droppedSet.add(r)):e.addedSet.has(t.target)&&-1===n||x(t.target,e.mirror)||(e.movedSet.has(r)&&e.movedMap[he(n,o)]?ye(e.movedSet,r):e.removes.push({parentId:o,id:n,isShadow:!!L(t.target)||void 0})),e.mapRemoves.push(r))}))}},this.genAdds=function(t,r){if(!r||!S(r,e.blockClass)){if(me(t)){if(T(t))return;e.movedSet.add(t);var n=null;r&&me(r)&&(n=r.__sn.id),n&&(e.movedMap[he(t.__sn.id,n)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);S(t,e.blockClass)||t.childNodes.forEach((function(t){return e.genAdds(t)}))}}}return e.prototype.init=function(e,t,r,n,o,i,a,s,l,c,u,d,p,f,h,m,v){this.blockClass=t,this.blockSelector=r,this.maskTextClass=n,this.maskTextSelector=o,this.inlineStylesheet=i,this.maskInputOptions=a,this.maskTextFn=s,this.maskInputFn=l,this.recordCanvas=c,this.slimDOMOptions=u,this.enableStrictPrivacy=v,this.emissionCallback=e,this.doc=d,this.mirror=p,this.iframeManager=f,this.shadowDomManager=h,this.canvasManager=m},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.canvasManager.reset()},e}();function ye(e,t){e.delete(t),t.childNodes.forEach((function(t){return ye(e,t)}))}function ge(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}))||ge(e,n,r)}function be(e,t){var r=t.parentNode;return!!r&&(!!e.has(r)||be(e,r))}var Se=[],Te="undefined"!=typeof CSSGroupingRule,xe="undefined"!=typeof CSSMediaRule,we="undefined"!=typeof CSSSupportsRule,Ee="undefined"!=typeof CSSConditionRule;function Ie(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 Ce(e,t,r,n,o,i,a,s,l,c,u,d,p,f,h,m,v,y){var g,b,S,T=new ve;Se.push(T),T.init(e,r,n,o,i,a,s,l,c,u,d,t,p,f,h,m,y);var x=window.MutationObserver||window.__rrMutationObserver,w=null===(S=null===(b=null===(g=window)||void 0===g?void 0:g.Zone)||void 0===b?void 0:b.__symbol__)||void 0===S?void 0:S.call(b,"MutationObserver");w&&window[w]&&(x=window[w]);var E=new x(T.processMutations.bind(T));return E.observe(v,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),E}function ke(t,r,n,o,i){if(!1===i.mouseInteraction)return function(){};var a=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,s=[];return Object.keys(e.MouseInteractions).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e]})).forEach((function(i){var a=i.toLowerCase(),l=function(r){return function(i){var a=Ie(i);if(!S(a,o)&&!b(a)){var s=w(i)?i.changedTouches[0]:i;if(s){var l=n.getId(a),c=s.clientX,u=s.clientY;t({type:e.MouseInteractions[r],id:l,x:c,y:u})}}}}(i);s.push(d(a,l,r))})),function(){s.forEach((function(e){return e()}))}}function Me(e,t,r,n,o){return d("scroll",h((function(o){var i=Ie(o);if(i&&!S(i,n)){var a=r.getId(i);if(i===t){var s=t.scrollingElement||t.documentElement;e({id:a,x:s.scrollLeft,y:s.scrollTop})}else e({id:a,x:i.scrollLeft,y:i.scrollTop})}}),o.scroll||100),t)}function Ne(e,t){var r=s({},e);return t||delete r.userTriggered,r}var Re=["INPUT","TEXTAREA","SELECT"],_e=new WeakMap;function Oe(e){return function(e,t){if(Te&&e.parentRule instanceof CSSGroupingRule||xe&&e.parentRule instanceof CSSMediaRule||we&&e.parentRule instanceof CSSSupportsRule||Ee&&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 Ae(t,r){var n,o;void 0===r&&(r={});var i=t.doc.defaultView;if(!i)return function(){};!function(e,t){var r=e.mutationCb,n=e.mousemoveCb,o=e.mouseInteractionCb,i=e.scrollCb,a=e.viewportResizeCb,s=e.inputCb,l=e.mediaInteractionCb,c=e.styleSheetRuleCb,d=e.styleDeclarationCb,p=e.canvasMutationCb,f=e.fontCb;e.mutationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mutation&&t.mutation.apply(t,u(e)),r.apply(void 0,u(e))},e.mousemoveCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.mousemove&&t.mousemove.apply(t,u(e)),n.apply(void 0,u(e))},e.mouseInteractionCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.mouseInteraction&&t.mouseInteraction.apply(t,u(e)),o.apply(void 0,u(e))},e.scrollCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.scroll&&t.scroll.apply(t,u(e)),i.apply(void 0,u(e))},e.viewportResizeCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.viewportResize&&t.viewportResize.apply(t,u(e)),a.apply(void 0,u(e))},e.inputCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.input&&t.input.apply(t,u(e)),s.apply(void 0,u(e))},e.mediaInteractionCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.mediaInteaction&&t.mediaInteaction.apply(t,u(e)),l.apply(void 0,u(e))},e.styleSheetRuleCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.styleSheetRule&&t.styleSheetRule.apply(t,u(e)),c.apply(void 0,u(e))},e.styleDeclarationCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.styleDeclaration&&t.styleDeclaration.apply(t,u(e)),d.apply(void 0,u(e))},e.canvasMutationCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.canvasMutation&&t.canvasMutation.apply(t,u(e)),p.apply(void 0,u(e))},e.fontCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.font&&t.font.apply(t,u(e)),f.apply(void 0,u(e))}}(t,r);var a,p,f,b=Ce(t.mutationCb,t.doc,t.blockClass,t.blockSelector,t.maskTextClass,t.maskTextSelector,t.inlineStylesheet,t.maskInputOptions,t.maskTextFn,t.maskInputFn,t.recordCanvas,t.slimDOMOptions,t.mirror,t.iframeManager,t.shadowDomManager,t.canvasManager,t.doc,t.enableStrictPrivacy),T=function(t,r,n,o){if(!1===r.mousemove)return function(){};var i,a="number"==typeof r.mousemove?r.mousemove:50,s="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],c=h((function(e){var r=Date.now()-i;t(l.map((function(e){return e.timeOffset-=r,e})),e),l=[],i=null}),s),u=h((function(t){var r=Ie(t),n=w(t)?t.changedTouches[0]:t,a=n.clientX,s=n.clientY;i||(i=Date.now()),l.push({x:a,y:s,id:o.getId(r),timeOffset:Date.now()-i}),c("undefined"!=typeof DragEvent&&t instanceof DragEvent?e.IncrementalSource.Drag:t instanceof MouseEvent?e.IncrementalSource.MouseMove:e.IncrementalSource.TouchMove)}),a,{trailing:!1}),p=[d("mousemove",u,n),d("touchmove",u,n),d("drag",u,n)];return function(){p.forEach((function(e){return e()}))}}(t.mousemoveCb,t.sampling,t.doc,t.mirror),x=ke(t.mouseInteractionCb,t.doc,t.mirror,t.blockClass,t.sampling),E=Me(t.scrollCb,t.doc,t.mirror,t.blockClass,t.sampling),I=(a=t.viewportResizeCb,p=-1,f=-1,d("resize",h((function(){var e=y(),t=g();p===e&&f===t||(a({width:Number(t),height:Number(e)}),p=e,f=t)}),200),window)),C=function(e,t,r,n,o,i,a,l,c){function p(e){var r=Ie(e),s=e.isTrusted;if(r&&"OPTION"===r.tagName&&(r=r.parentElement),r&&r.tagName&&!(Re.indexOf(r.tagName)<0)&&!S(r,n)){var l=r.type;if(!r.classList.contains(o)){var u=r.value,d=!1;"radio"===l||"checkbox"===l?d=r.checked:(i[r.tagName.toLowerCase()]||i[l])&&(u=F({maskInputOptions:i,tagName:r.tagName,type:l,value:u,maskInputFn:a})),f(r,Ne({text:u,isChecked:d,userTriggered:s},c));var p=r.name;"radio"===l&&p&&d&&t.querySelectorAll('input[type="radio"][name="'+p+'"]').forEach((function(e){e!==r&&f(e,Ne({text:e.value,isChecked:!d,userTriggered:!1},c))}))}}}function f(t,n){var o=_e.get(t);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){_e.set(t,n);var i=r.getId(t);e(s(s({},n),{id:i}))}}var h=("last"===l.input?["change"]:["input","change"]).map((function(e){return d(e,p,t)})),v=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),y=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return v&&v.set&&h.push.apply(h,u(y.map((function(e){return m(e[0],e[1],{set:function(){p({target:this})}})})))),function(){h.forEach((function(e){return e()}))}}(t.inputCb,t.doc,t.mirror,t.blockClass,t.ignoreClass,t.maskInputOptions,t.maskInputFn,t.sampling,t.userTriggeredOnInput),k=function(e,t,r,n){var o=function(o){return h((function(n){var i=Ie(n);if(i&&!S(i,t)){var a=i,s=a.currentTime,l=a.volume,c=a.muted;e({type:o,id:r.getId(i),currentTime:s,volume:l,muted:c})}}),n.media||500)},i=[d("play",o(0)),d("pause",o(1)),d("seeked",o(2)),d("volumechange",o(3))];return function(){i.forEach((function(e){return e()}))}}(t.mediaInteractionCb,t.blockClass,t.mirror,t.sampling),M=function(e,t,r){var n=t.CSSStyleSheet.prototype.insertRule;t.CSSStyleSheet.prototype.insertRule=function(t,o){var i=r.getId(this.ownerNode);return-1!==i&&e({id:i,adds:[{rule:t,index:o}]}),n.apply(this,arguments)};var o=t.CSSStyleSheet.prototype.deleteRule;t.CSSStyleSheet.prototype.deleteRule=function(t){var n=r.getId(this.ownerNode);return-1!==n&&e({id:n,removes:[{index:t}]}),o.apply(this,arguments)};var i={};Te?i.CSSGroupingRule=t.CSSGroupingRule:(xe&&(i.CSSMediaRule=t.CSSMediaRule),Ee&&(i.CSSConditionRule=t.CSSConditionRule),we&&(i.CSSSupportsRule=t.CSSSupportsRule));var a={};return Object.entries(i).forEach((function(t){var n=c(t,2),o=n[0],i=n[1];a[o]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=function(t,n){var i=r.getId(this.parentStyleSheet.ownerNode);return-1!==i&&e({id:i,adds:[{rule:t,index:u(Oe(this),[n||0])}]}),a[o].insertRule.apply(this,arguments)},i.prototype.deleteRule=function(t){var n=r.getId(this.parentStyleSheet.ownerNode);return-1!==n&&e({id:n,removes:[{index:u(Oe(this),[t])}]}),a[o].deleteRule.apply(this,arguments)}})),function(){t.CSSStyleSheet.prototype.insertRule=n,t.CSSStyleSheet.prototype.deleteRule=o,Object.entries(i).forEach((function(e){var t=c(e,2),r=t[0],n=t[1];n.prototype.insertRule=a[r].insertRule,n.prototype.deleteRule=a[r].deleteRule}))}}(t.styleSheetRuleCb,i,t.mirror),N=function(e,t,r){var n=t.CSSStyleDeclaration.prototype.setProperty;t.CSSStyleDeclaration.prototype.setProperty=function(t,o,i){var a,s,l=r.getId(null===(s=null===(a=this.parentRule)||void 0===a?void 0:a.parentStyleSheet)||void 0===s?void 0:s.ownerNode);return-1!==l&&e({id:l,set:{property:t,value:o,priority:i},index:Oe(this.parentRule)}),n.apply(this,arguments)};var o=t.CSSStyleDeclaration.prototype.removeProperty;return t.CSSStyleDeclaration.prototype.removeProperty=function(t){var n,i,a=r.getId(null===(i=null===(n=this.parentRule)||void 0===n?void 0:n.parentStyleSheet)||void 0===i?void 0:i.ownerNode);return-1!==a&&e({id:a,remove:{property:t},index:Oe(this.parentRule)}),o.apply(this,arguments)},function(){t.CSSStyleDeclaration.prototype.setProperty=n,t.CSSStyleDeclaration.prototype.removeProperty=o}}(t.styleDeclarationCb,i,t.mirror),R=t.collectFonts?function(e,t){var r=t.defaultView;if(!r)return function(){};var n=[],o=new WeakMap,i=r.FontFace;r.FontFace=function(e,t,r){var n=new i(e,t,r);return o.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};var a=v(t.fonts,"add",(function(t){return function(r){return setTimeout((function(){var t=o.get(r);t&&(e(t),o.delete(r))}),0),t.apply(this,[r])}}));return n.push((function(){r.FontFace=i})),n.push(a),function(){n.forEach((function(e){return e()}))}}(t.fontCb,t.doc):function(){},_=[];try{for(var O=l(t.plugins),A=O.next();!A.done;A=O.next()){var D=A.value;_.push(D.observer(D.callback,i,D.options))}}catch(e){n={error:e}}finally{try{A&&!A.done&&(o=O.return)&&o.call(O)}finally{if(n)throw n.error}}return function(){Se.forEach((function(e){return e.reset()})),b.disconnect(),T(),x(),E(),I(),C(),k(),M(),N(),R(),_.forEach((function(e){return e()}))}}var De=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}(),Le=function(){function e(e){this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror}return e.prototype.addShadowRoot=function(e,t){Ce(this.mutationCb,t,this.bypassOptions.blockClass,this.bypassOptions.blockSelector,this.bypassOptions.maskTextClass,this.bypassOptions.maskTextSelector,this.bypassOptions.inlineStylesheet,this.bypassOptions.maskInputOptions,this.bypassOptions.maskTextFn,this.bypassOptions.maskInputFn,this.bypassOptions.recordCanvas,this.bypassOptions.slimDOMOptions,this.mirror,this.bypassOptions.iframeManager,this,this.bypassOptions.canvasManager,e,this.bypassOptions.enableStrictPrivacy),Me(this.scrollCb,e,this.mirror,this.bypassOptions.blockClass,this.bypassOptions.sampling)},e}();for(var Fe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Pe="undefined"==typeof Uint8Array?[]:new Uint8Array(256),We=0;We<Fe.length;We++)Pe[Fe.charCodeAt(We)]=We;var je=new Map;var ze=function(e,t,r){if(e&&(Ue(e,t)||"object"==typeof e)){var n=function(e,t){var r=je.get(e);return r||(r=new Map,je.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+=Fe[r[t]>>2],o+=Fe[(3&r[t])<<4|r[t+1]>>4],o+=Fe[(15&r[t+1])<<2|r[t+2]>>6],o+=Fe[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]}:Ue(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:ze(e,t,r)}:e}var Ve=function(e,t,r){return u(e).map((function(e){return Be(e,t,r)}))},Ue=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 Ge(e,t,r,n,o,i){var a,s,c=[],d=Object.getOwnPropertyNames(e),p=function(a){try{if("function"!=typeof e[a])return"continue";var s=v(e,a,(function(s){return function(){for(var l=[],c=0;c<arguments.length;c++)l[c]=arguments[c];var d=s.apply(this,l);if(ze(d,i,e),!S(this.canvas,n)){o.getId(this.canvas);var p=Ve(u(l),i,e),f={type:t,property:a,args:p};r(this.canvas,f)}return d}}));c.push(s)}catch(n){var l=m(e,a,{set:function(e){r(this.canvas,{type:t,property:a,args:[e],setter:!0})}});c.push(l)}};try{for(var f=l(d),h=f.next();!h.done;h=f.next()){p(h.value)}}catch(e){a={error:e}}finally{try{h&&!h.done&&(s=f.return)&&s.call(f)}finally{if(a)throw a.error}}return c}var He,Ye,Xe=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=v(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(r){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];return S(this,t)||"__context"in this||(this.__context=r),e.apply(this,u([r],n))}}));r.push(n)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){r.forEach((function(e){return e()}))}}(e,t),n=function(e,t,r,n){var i,a,s=[],c=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),d=function(n){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[n])return"continue";var i=v(t.CanvasRenderingContext2D.prototype,n,(function(t){return function(){for(var i=this,a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];return S(this.canvas,r)||setTimeout((function(){var t=u(a);if("drawImage"===n&&t[0]&&t[0]instanceof HTMLCanvasElement){var r=t[0],s=r.getContext("2d"),l=null==s?void 0:s.getImageData(0,0,r.width,r.height),c=null==l?void 0:l.data;t[0]=JSON.stringify(c)}e(i.canvas,{type:o["2D"],property:n,args:t})}),0),t.apply(this,a)}}));s.push(i)}catch(r){var a=m(t.CanvasRenderingContext2D.prototype,n,{set:function(t){e(this.canvas,{type:o["2D"],property:n,args:[t],setter:!0})}});s.push(a)}};try{for(var p=l(c),f=p.next();!f.done;f=p.next()){d(f.value)}}catch(e){i={error:e}}finally{try{f&&!f.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}return function(){s.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,this.mirror),i=function(e,t,r,n){var i=[];return i.push.apply(i,u(Ge(t.WebGLRenderingContext.prototype,o.WebGL,e,r,n,t))),void 0!==t.WebGL2RenderingContext&&i.push.apply(i,u(Ge(t.WebGL2RenderingContext.prototype,o.WebGL2,e,r,n,t))),function(){i.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,this.mirror);this.resetObservers=function(){r(),n(),i()}},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 qe(e){return s(s({},e),{timestamp:Date.now()})}var Qe={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 $e(t){void 0===t&&(t={});var r=t.emit,n=t.checkoutEveryNms,o=t.checkoutEveryNth,i=t.blockClass,a=void 0===i?"highlight-block":i,u=t.blockSelector,p=void 0===u?null:u,f=t.ignoreClass,h=void 0===f?"highlight-ignore":f,m=t.maskTextClass,v=void 0===m?"highlight-mask":m,b=t.maskTextSelector,S=void 0===b?null:b,T=t.inlineStylesheet,x=void 0===T||T,w=t.maskAllInputs,I=t.maskInputOptions,C=t.slimDOMOptions,k=t.maskInputFn,N=t.maskTextFn,_=t.hooks,O=t.packFn,A=t.sampling,D=void 0===A?{}:A,L=t.mousemoveWait,F=t.recordCanvas,P=void 0!==F&&F,W=t.userTriggeredOnInput,j=void 0!==W&&W,z=t.collectFonts,B=void 0!==z&&z,V=t.plugins,U=t.keepIframeSrcFn,G=void 0===U?function(){return!1}:U,H=t.enableStrictPrivacy,Y=void 0!==H&&H;if(!r)throw new Error("emit function is required");void 0!==L&&void 0===D.mousemove&&(D.mousemove=L);var X,q=!0===w?{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!==I?I:{password:!0},Q=!0===C||"all"===C?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===C,headMetaDescKeywords:"all"===C}:C||{};E();var $=0;He=function(t,i){var a;if(!(null===(a=Se[0])||void 0===a?void 0:a.isFrozen())||t.type===e.EventType.FullSnapshot||t.type===e.EventType.IncrementalSnapshot&&t.data.source===e.IncrementalSource.Mutation||Se.forEach((function(e){return e.unfreeze()})),r(function(e){var t,r;try{for(var n=l(V||[]),o=n.next();!o.done;o=n.next()){var i=o.value;i.eventProcessor&&(e=i.eventProcessor(e))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return O&&(e=O(e)),e}(t),i),t.type===e.EventType.FullSnapshot)X=t,$=0;else if(t.type===e.EventType.IncrementalSnapshot){if(t.data.source===e.IncrementalSource.Mutation&&t.data.isAttachIframe)return;$++;var s=o&&$>=o,c=n&&t.timestamp-X.timestamp>n;(s||c)&&Ye(!0)}};var K=function(t){He(qe({type:e.EventType.IncrementalSnapshot,data:s({source:e.IncrementalSource.Mutation},t)}))},J=function(t){return He(qe({type:e.EventType.IncrementalSnapshot,data:s({source:e.IncrementalSource.Scroll},t)}))},Z=function(t){return He(qe({type:e.EventType.IncrementalSnapshot,data:s({source:e.IncrementalSource.CanvasMutation},t)}))},te=new De({mutationCb:K}),re=new Xe({recordCanvas:P,mutationCb:Z,win:window,blockClass:a,mirror:Qe}),ne=new Le({mutationCb:K,scrollCb:J,bypassOptions:{blockClass:a,blockSelector:p,maskTextClass:v,maskTextSelector:S,inlineStylesheet:x,maskInputOptions:q,maskTextFn:N,maskInputFn:k,recordCanvas:P,sampling:D,slimDOMOptions:Q,iframeManager:te,canvasManager:re,enableStrictPrivacy:Y},mirror:Qe});Ye=function(t){var r,n,o,i;void 0===t&&(t=!1),He(qe({type:e.EventType.Meta,data:{href:window.location.href,width:g(),height:y()}}),t),Se.forEach((function(e){return e.lock()}));var s=c(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,p=void 0===d||d,f=r.recordCanvas,h=void 0!==f&&f,m=r.maskAllInputs,v=void 0!==m&&m,y=r.maskTextFn,g=r.maskInputFn,b=r.slimDOM,S=void 0!==b&&b,T=r.preserveWhiteSpace,x=r.onSerialize,w=r.onIframeLoad,E=r.iframeLoadTimeout,I=r.keepIframeSrcFn,C=void 0===I?function(){return!1}:I,k=r.enableStrictPrivacy,M={};return[ee(e,{doc:e,map:M,blockClass:o,blockSelector:a,maskTextClass:l,maskTextSelector:u,skipChild:!1,inlineStylesheet:p,maskInputOptions:!0===v?{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===v?{password:!0}:v,maskTextFn:y,maskInputFn:g,slimDOMOptions:!0===S||"all"===S?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===S,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===S?{}:S,recordCanvas:h,preserveWhiteSpace:T,onSerialize:x,onIframeLoad:w,iframeLoadTimeout:E,keepIframeSrcFn:C,enableStrictPrivacy:void 0!==k&&k}),M]}(document,{blockClass:a,blockSelector:p,maskTextClass:v,maskTextSelector:S,inlineStylesheet:x,maskAllInputs:q,maskTextFn:N,slimDOM:Q,recordCanvas:P,enableStrictPrivacy:Y,onSerialize:function(e){M(e)&&te.addIframe(e),R(e)&&ne.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){te.attachIframe(e,t)},keepIframeSrcFn:G}),2),l=s[0],u=s[1];if(!l)return console.warn("Failed to snapshot the document");Qe.map=u,He(qe({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===(i=null===(o=null===document||void 0===document?void 0:document.body)||void 0===o?void 0:o.parentElement)||void 0===i?void 0:i.scrollTop)||(null===document||void 0===document?void 0:document.body.scrollTop)||0}}})),Se.forEach((function(e){return e.unlock()}))};try{var oe=[];oe.push(d("DOMContentLoaded",(function(){He(qe({type:e.EventType.DomContentLoaded,data:{}}))})));var ie=function(t){var r;return Ae({mutationCb:K,mousemoveCb:function(t,r){return He(qe({type:e.EventType.IncrementalSnapshot,data:{source:r,positions:t}}))},mouseInteractionCb:function(t){return He(qe({type:e.EventType.IncrementalSnapshot,data:s({source:e.IncrementalSource.MouseInteraction},t)}))},scrollCb:J,viewportResizeCb:function(t){return He(qe({type:e.EventType.IncrementalSnapshot,data:s({source:e.IncrementalSource.ViewportResize},t)}))},inputCb:function(t){return He(qe({type:e.EventType.IncrementalSnapshot,data:s({source:e.IncrementalSource.Input},t)}))},mediaInteractionCb:function(t){return He(qe({type:e.EventType.IncrementalSnapshot,data:s({source:e.IncrementalSource.MediaInteraction},t)}))},styleSheetRuleCb:function(t){return He(qe({type:e.EventType.IncrementalSnapshot,data:s({source:e.IncrementalSource.StyleSheetRule},t)}))},styleDeclarationCb:function(t){return He(qe({type:e.EventType.IncrementalSnapshot,data:s({source:e.IncrementalSource.StyleDeclaration},t)}))},canvasMutationCb:Z,fontCb:function(t){return He(qe({type:e.EventType.IncrementalSnapshot,data:s({source:e.IncrementalSource.Font},t)}))},blockClass:a,ignoreClass:h,maskTextClass:v,maskTextSelector:S,maskInputOptions:q,inlineStylesheet:x,sampling:D,recordCanvas:P,userTriggeredOnInput:j,collectFonts:B,doc:t,maskInputFn:k,maskTextFn:N,blockSelector:p,slimDOMOptions:Q,mirror:Qe,iframeManager:te,shadowDomManager:ne,canvasManager:re,plugins:(null===(r=null==V?void 0:V.filter((function(e){return e.observer})))||void 0===r?void 0:r.map((function(t){return{observer:t.observer,options:t.options,callback:function(r){return He(qe({type:e.EventType.Plugin,data:{plugin:t.name,payload:r}}))}}})))||[],enableStrictPrivacy:Y},_)};te.addLoadListener((function(e){oe.push(ie(e.contentDocument))}));var ae=function(){Ye(),oe.push(ie(document))};return"interactive"===document.readyState||"complete"===document.readyState?ae():oe.push(d("load",(function(){He(qe({type:e.EventType.Load,data:{}})),ae()}),window)),function(){oe.forEach((function(e){return e()}))}}catch(e){console.warn(e)}}function Ke(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)}))}}}$e.addCustomEvent=function(t,r){He&&He(qe({type:e.EventType.Custom,data:{tag:t,payload:r}}))},$e.freezePage=function(){Se.forEach((function(e){return e.freeze()}))},$e.takeFullSnapshot=function(e){if(!Ye)throw new Error("please take full snapshot after start recording");Ye(e)},$e.mirror=Qe;var Je=Object.freeze({__proto__:null,default:Ke});function Ze(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=p(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 p(e){for(;e!==t.body&&!1===d(e);)e=e.parentNode||e.host;return e}function f(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(f.bind(e,t))}function h(r,n,a){var l,c,u,d,p=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),f({scrollable:l,method:d,startTime:p,startX:c,startY:u,x:n,y:a})}}var et,tt=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,u([0,0],e))},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 rt(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 nt(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"}(et||(et={}));var ot={type:"xstate.init"};function it(e){return void 0===e?[]:[].concat(e)}function at(e){return{type:"xstate.assign",assignment:e}}function st(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 lt(e){return function(t){return e===t}}function ct(e){return"string"==typeof e?{type:e}:e}function ut(e,t){return{value:e,context:t,actions:[],changed:!1,matches:lt(e)}}function dt(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 pt(e,t){void 0===t&&(t={});var r=nt(dt(it(e.states[e.initial].entry).map((function(e){return st(e,t.actions)})),e.context,ot),2),n=r[0],o=r[1],i={config:e,_options:t,initialState:{value:e.initial,actions:n,context:o,matches:lt(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=ct(r),u=e.states[s];if(u.on){var d=it(u.on[c.type]);try{for(var p=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),f=p.next();!f.done;f=p.next()){var h=f.value;if(void 0===h)return ut(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===v;if((void 0===b?function(){return!0}:b)(l,c)){var T=e.states[null!=v?v:s],x=nt(dt((S?it(g):[].concat(u.exit,g,T.entry).filter((function(e){return e}))).map((function(e){return st(e,i._options.actions)})),l,c),3),w=x[0],E=x[1],I=x[2],C=null!=v?v:s;return{value:C,context:E,actions:w,changed:v!==s||w.length>0||I,matches:lt(C)}}}}catch(e){n={error:e}}finally{try{f&&!f.done&&(o=p.return)&&o.call(p)}finally{if(n)throw n.error}}}return ut(s,l)}};return i}var ft=function(e,t){return e.actions.forEach((function(r){var n=r.exec;return n&&n(e.context,t)}))};function ht(e){var t=e.initialState,r=et.NotStarted,n=new Set,o={_machine:e,send:function(o){r===et.Running&&(t=e.transition(t,o),ft(t,ct(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:lt(i.value)}}return r=et.Running,ft(t,ot),o},stop:function(){return r=et.Stopped,n.clear(),o},get state(){return t},get status(){return r}};return o}function mt(t,r){var n=r.getCastFn,o=r.applyEventsSynchronously,i=r.emitter;return ht(pt({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:at({lastPlayedEvent:function(e,t){return"CAST_EVENT"===t.type?t.payload.event:e.lastPlayedEvent}}),recordTimeOffset:at((function(e,t){var r=e.timeOffset;return"payload"in t&&"timeOffset"in t.payload&&(r=t.payload.timeOffset),s(s({},e),{timeOffset:r,baselineTime:e.events[0].timestamp+r})})),play:function(t){var r,a,s,c,u,d=t.timer,p=t.events,f=t.baselineTime,h=t.lastPlayedEvent;d.clear();try{for(var m=l(p),v=m.next();!v.done;v=m.next()){rt(v.value,f)}}catch(e){r={error:e}}finally{try{v&&!v.done&&(a=m.return)&&a.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}(p,f),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)),f<(g||0)&&i.emit(e.ReplayerEvents.PlayBack);var b=new Array,S=new Array,T=function(e){if(g&&g<f&&(e.timestamp<=g||e===h))return"continue";if(e.timestamp<f)b.push(e);else{var t=n(e,!1);S.push({doAction:function(){t()},delay:e.delay})}};try{for(var x=l(y),w=x.next();!w.done;w=x.next()){T(w.value)}}catch(e){s={error:e}}finally{try{w&&!w.done&&(c=x.return)&&c.call(x)}finally{if(s)throw s.error}}o(b),i.emit(e.ReplayerEvents.Flush),d.addActions(S),d.start()},pause:function(e){e.timer.clear()},resetLastPlayedEvent:at((function(e){return s(s({},e),{lastPlayedEvent:null})})),startLive:at({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:at((function(e,t){var r,o,i=e.events,a=e.timer,c=e.baselineTime;if("REPLACE_EVENTS"===t.type){var u=t.payload.events;i.length=0;var d=[],p=function(e){if(rt(e,c),i.push(e),e.timestamp>=a.timeOffset+c){var t=n(e,!1);d.push({doAction:function(){t()},delay:e.delay})}};try{for(var f=l(u),h=f.next();!h.done;h=f.next()){p(h.value)}}catch(e){r={error:e}}finally{try{h&&!h.done&&(o=f.return)&&o.call(f)}finally{if(r)throw r.error}}a.isActive()&&a.replaceActions(d)}return s(s({},e),{events:i})})),addEvent:at((function(e,t){var r=e.baselineTime,o=e.timer,i=e.events;if("ADD_EVENT"===t.type){var a=t.payload.event;rt(a,r);var l=i.length-1;if(!i[l]||i[l].timestamp<=a.timestamp)i.push(a);else{for(var c=-1,u=0;u<=l;){var d=Math.floor((u+l)/2);i[d].timestamp<=a.timestamp?u=d+1:l=d-1}-1===c&&(c=u),i.splice(c,0,a)}var p=a.timestamp<r,f=n(a,p);p?f():o.isActive()&&o.addAction({doAction:function(){f()},delay:a.delay})}return s(s({},e),{events:i})}))}}))}var vt;function yt(e,t){var r=e[t[0]];return 1===t.length?r:yt(r.cssRules[t[1]].cssRules,t.slice(2))}function gt(e){var t=u(e),r=t.pop();return{positions:t,index:r}}function bt(e,t){var r=t.sheet;r&&e.forEach((function(e){if(e.type===vt.Insert)try{if(Array.isArray(e.index)){var n=gt(e.index),o=n.positions,i=n.index;yt(r.cssRules,o).insertRule(e.cssText,i)}else r.insertRule(e.cssText,e.index)}catch(e){}else if(e.type===vt.Remove)try{if(Array.isArray(e.index)){var a=gt(e.index);o=a.positions,i=a.index;yt(r.cssRules,o).deleteRule(i||0)}else r.deleteRule(e.index)}catch(e){}else if(e.type===vt.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})),o=Object.entries(n).reverse(),i=n.length;o.forEach((function(r){var n,o=c(r,2),a=o[0],s=o[1],l=e.indexOf(s);if(-1===l||l>i)try{null===(n=t.sheet)||void 0===n||n.deleteRule(Number(a))}catch(e){}i=l})),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===vt.SetProperty){yt(r.cssRules,e.index).style.setProperty(e.property,e.value,e.priority)}else if(e.type===vt.RemoveProperty){yt(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"}(vt||(vt={}));var St=new Map;function Tt(e,t){var r=St.get(e);return r||(r=new Map,St.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}var xt=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function wt(e,t){return function(r){if(r&&"object"==typeof r&&"rr_type"in r){if("index"in r){var n=r.rr_type,o=r.index;return Tt(t,n)[o]}if("args"in r){var i=r.rr_type,a=r.args,s=window[i];return new(s.bind.apply(s,u([void 0],a.map(wt(e,t)))))}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=Pe[e.charCodeAt(t)],n=Pe[e.charCodeAt(t+1)],o=Pe[e.charCodeAt(t+2)],i=Pe[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 l=e.get(r.src);if(l)return l;var c=new Image;return c.src=r.src,e.set(r.src,c),c}}else if(Array.isArray(r))return r.map(wt(e,t));return r}}function Et(e){var t=e.mutation,r=e.target,n=e.type,i=e.imageMap,a=e.errorHandler;try{var s=function(e,t){try{return t===o.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch(e){return null}}(r,n);if(!s)return;if(t.setter)return void(s[t.property]=t.args[0]);var l=s[t.property],c=t.args.map(wt(i,s));!function(e,t){if(null==t?void 0:t.constructor){var r=t.constructor.name;if(xt.includes(r)){var n=Tt(e,r);n.includes(t)||n.push(t)}}}(s,l.apply(s,c))}catch(e){a(t,e)}}var It=Ke||Je,Ct={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function kt(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 Mt=function(){function t(t,r){var n=this;if(this.mouseTail=null,this.tailPositions=[],this.emitter=It(),this.activityIntervals=[],this.legacy_missingNodeRetryMap={},this.cache=le(),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 o={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:Ct,inactiveThreshold:.02,inactiveSkipTime:2e3};this.config=Object.assign({},o,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 I,this.fragmentParentMap=new Map,this.elementStateMap=new Map,this.virtualStyleRulesMap=new Map,this.emitter.on(e.ReplayerEvents.Flush,(function(){var e,t,r,o,i,a,s=n.treeIndex.flush(),c=s.scrollMap,u=s.inputMap;n.fragmentParentMap.forEach((function(e,t){return n.restoreRealParent(t,e)}));try{for(var d=l(n.virtualStyleRulesMap.keys()),p=d.next();!p.done;p=d.next()){var f=p.value;n.restoreNodeSheet(f)}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=d.return)&&t.call(d)}finally{if(e)throw e.error}}n.fragmentParentMap.clear(),n.elementStateMap.clear(),n.virtualStyleRulesMap.clear();try{for(var h=l(c.values()),m=h.next();!m.done;m=h.next()){var v=m.value;n.applyScroll(v,!0)}}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 y=l(u.values()),g=y.next();!g.done;g=y.next()){v=g.value;n.applyInput(v)}}catch(e){i={error:e}}finally{try{g&&!g.done&&(a=y.return)&&a.call(y)}finally{if(i)throw i.error}}})),this.emitter.on(e.ReplayerEvents.PlayBack,(function(){n.firstFullSnapshot=null,n.mirror.reset()}));var i=new tt([],(null==r?void 0:r.speed)||o.speed);this.service=mt({events:t.map((function(e){return r&&r.unpackFn?r.unpackFn(e):e})).sort((function(e,t){return e.timestamp-t.timestamp})),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe((function(t){n.emitter.emit(e.ReplayerEvents.StateChange,{player:t})})),this.speedService=ht(pt({id:"speed",context:{normalSpeed:-1,timer:i},initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:function(e,t){"payload"in t&&e.timer.setSpeed(t.payload.speed)},recordSpeed:at({normalSpeed:function(e){return e.timer.speed}}),restoreSpeed:function(e){e.timer.setSpeed(e.normalSpeed)}}})),this.speedService.start(),this.speedService.subscribe((function(t){n.emitter.emit(e.ReplayerEvents.StateChange,{speed:t})}));var a=this.service.state.context.events.find((function(t){return t.type===e.EventType.Meta})),s=this.service.state.context.events.find((function(t){return t.type===e.EventType.FullSnapshot}));if(a){var c=a.data,u=c.width,d=c.height;setTimeout((function(){n.emitter.emit(e.ReplayerEvents.Resize,{width:u,height:d})}),0)}s&&setTimeout((function(){n.firstFullSnapshot||(n.firstFullSnapshot=s,n.rebuildFullSnapshot(s),n.iframe.contentWindow.scrollTo(s.data.initialOffset))}),1),this.service.state.context.events.find(kt)&&this.mouse.classList.add("touch-device")}return Object.defineProperty(t.prototype,"timer",{get:function(){return this.service.state.context.timer},enumerable:!1,configurable:!0}),t.prototype.on=function(e,t){return this.emitter.on(e,t),this},t.prototype.off=function(e,t){return this.emitter.off(e,t),this},t.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"))},t.prototype.getActivityIntervals=function(){var e=this;if(0==this.activityIntervals.length){for(var t=[],r=this.getMetaData(),n=u([{timestamp:r.startTime}],this.service.state.context.events.filter((function(t){return e.isUserInteraction(t)})),[{timestamp:r.endTime}]),o=1;o<n.length;o++){var i=n[o-1],a=n[o];a.timestamp-i.timestamp>1e4?t.push({startTime:i.timestamp,endTime:a.timestamp,duration:a.timestamp-i.timestamp,active:!1}):t.push({startTime:i.timestamp,endTime:a.timestamp,duration:a.timestamp-i.timestamp,active:!0})}var s=[],l=t[0];for(o=1;o<t.length;o++)t[o].active!=t[o-1].active&&(s.push({startTime:l.startTime,endTime:t[o-1].endTime,duration:t[o-1].endTime-l.startTime,active:t[o-1].active}),l=t[o]);l&&t.length>0&&s.push({startTime:l.startTime,endTime:t[t.length-1].endTime,duration:t[t.length-1].endTime-l.startTime,active:t[t.length-1].active}),l=s[0];for(o=1;o<s.length;o++)(!s[o].active&&s[o].duration>this.config.inactiveThreshold*r.totalTime||!s[o-1].active&&s[o-1].duration>this.config.inactiveThreshold*r.totalTime)&&(this.activityIntervals.push({startTime:l.startTime,endTime:s[o-1].endTime,duration:s[o-1].endTime-l.startTime,active:s[o-1].active}),l=s[o]);l&&s.length>0&&this.activityIntervals.push({startTime:l.startTime,endTime:s[s.length-1].endTime,duration:s[s.length-1].endTime-l.startTime,active:s[s.length-1].active})}return this.activityIntervals},t.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}},t.prototype.getCurrentTime=function(){return this.timer.timeOffset+this.getTimeOffset()},t.prototype.getTimeOffset=function(){var e=this.service.state.context;return e.baselineTime-e.events[0].timestamp},t.prototype.getMirror=function(){return this.mirror},t.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)},t.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)},t.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)},t.prototype.startLive=function(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})},t.prototype.addEvent=function(e){var t=this,r=this.config.unpackFn?this.config.unpackFn(e):e;kt(r)&&this.mouse.classList.add("touch-device"),Promise.resolve().then((function(){return t.service.send({type:"ADD_EVENT",payload:{event:r}})}))},t.prototype.replaceEvents=function(e){var t,r;try{for(var n=l(e),o=n.next();!o.done;o=n.next()){if(kt(o.value)){this.mouse.classList.add("touch-device");break}}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}this.service.send({type:"REPLACE_EVENTS",payload:{events:e}})},t.prototype.enableInteract=function(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"},t.prototype.disableInteract=function(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"},t.prototype.resetCache=function(){this.cache=le()},t.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&&(Ze(this.iframe.contentWindow,this.iframe.contentDocument),E(this.iframe.contentWindow))},t.prototype.handleResize=function(e){var t,r;this.iframe.style.display="inherit";try{for(var n=l([this.mouseTail,this.iframe]),o=n.next();!o.done;o=n.next()){var i=o.value;i&&(i.setAttribute("width",String(e.width)),i.setAttribute("height",String(e.height)))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},t.prototype.applyEventsSynchronously=function(t){var r,n;try{for(var o=l(t),i=o.next();!i.done;i=o.next()){var a=i.value;switch(a.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(a.data.source){case e.IncrementalSource.MediaInteraction:continue}}this.getCastFn(a,!0)()}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}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},t.prototype.getCastFn=function(t,r){var n,o=this;switch(void 0===r&&(r=!1),t.type){case e.EventType.DomContentLoaded:case e.EventType.Load:break;case e.EventType.Custom:n=function(){o.emitter.emit(e.ReplayerEvents.CustomEvent,t)};break;case e.EventType.Meta:n=function(){return o.emitter.emit(e.ReplayerEvents.Resize,{width:t.data.width,height:t.data.height})};break;case e.EventType.FullSnapshot:n=function(){if(o.firstFullSnapshot){if(o.firstFullSnapshot===t)return void(o.firstFullSnapshot=!0)}else o.firstFullSnapshot=!0;o.rebuildFullSnapshot(t,r),o.iframe.contentWindow.scrollTo(t.data.initialOffset)};break;case e.EventType.IncrementalSnapshot:n=function(){var n,i;if(o.applyIncremental(t,r),!r&&(o.handleInactivity(t.timestamp),t===o.nextUserInteractionEvent&&(o.nextUserInteractionEvent=null,o.backToNormal()),o.config.skipInactive&&!o.nextUserInteractionEvent)){try{for(var a=l(o.service.state.context.events),s=a.next();!s.done;s=a.next()){var c=s.value;if(!(c.timestamp<=t.timestamp)&&o.isUserInteraction(c)){c.delay-t.delay>1e4*o.speedService.state.context.timer.speed&&(o.nextUserInteractionEvent=c);break}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}if(o.nextUserInteractionEvent){var u=o.nextUserInteractionEvent.delay-t.delay,d={speed:Math.min(Math.round(u/2e3),o.config.maxSpeed)};o.speedService.send({type:"FAST_FORWARD",payload:d}),o.emitter.emit(e.ReplayerEvents.SkipStart,d)}}}}return function(){var i,a;n&&n();try{for(var s=l(o.config.plugins||[]),c=s.next();!c.done;c=s.next()){c.value.handler(t,r,{replayer:o})}}catch(e){i={error:e}}finally{try{c&&!c.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}o.service.send({type:"CAST_EVENT",payload:{event:t}});var u=o.service.state.context.events.length-1;if(t===o.service.state.context.events[u]){var d=function(){u<o.service.state.context.events.length-1||(o.backToNormal(),o.service.send("END"),o.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()}o.emitter.emit(e.ReplayerEvents.EventCast,t)}},t.prototype.handleInactivity=function(t,r){var n,o;if((t===this.inactiveEndTimestamp||r)&&(this.inactiveEndTimestamp=null,this.backToNormal()),this.config.skipInactive&&!this.inactiveEndTimestamp){try{for(var i=l(this.getActivityIntervals()),a=i.next();!a.done;a=i.next()){var s=a.value;if(t>=s.startTime&&t<s.endTime&&!s.active){this.inactiveEndTimestamp=s.endTime;break}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}if(this.inactiveEndTimestamp){var c=this.inactiveEndTimestamp-t,u={speed:c/36e5*this.config.inactiveSkipTime<1e3?c/1e3:Math.round(Math.max(c,36e5)/this.config.inactiveSkipTime)};this.speedService.send({type:"FAST_FORWARD",payload:u}),this.emitter.emit(e.ReplayerEvents.SkipStart,u)}}},t.prototype.rebuildFullSnapshot=function(t,r){var n,o,i=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 a=[];this.mirror.map=de(t.data.node,{doc:this.iframe.contentDocument,afterAppend:function(e){i.collectIframeAndAttachDocument(a,e)},cache:this.cache})[1];var s=function(e,t){c.attachDocumentToIframe(e,t),c.newDocumentQueue=c.newDocumentQueue.filter((function(t){return t!==e}))},c=this;try{for(var u=l(a),d=u.next();!d.done;d=u.next()){var p=d.value;s(p.mutationInQueue,p.builtNode)}}catch(e){n={error:e}}finally{try{d&&!d.done&&(o=u.return)&&o.call(u)}finally{if(n)throw n.error}}var f=this.iframe.contentDocument,h=f.documentElement,m=f.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()},t.prototype.insertStyleRules=function(e,t){var r=document.createElement("style");e.insertBefore(r,t);var n,o=(n=this.config.blockClass,["noscript { display: none !important; }","."+n+" { background: currentColor; border-radius: 5px; }","."+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)},t.prototype.attachDocumentToIframe=function(e,t){var r,n,o=this,i=[];if(!t.contentDocument)for(var a=t.parentNode;a;){if(this.fragmentParentMap.has(a)){var s=a,c=this.fragmentParentMap.get(s);this.restoreRealParent(s,c);break}a=a.parentNode}ue(e.node,{doc:t.contentDocument,map:this.mirror.map,hackCss:!0,skipChild:!1,afterAppend:function(e){if(o.collectIframeAndAttachDocument(i,e),e.__sn.type===O.Element&&"HTML"===e.__sn.tagName.toUpperCase()){var r=t.contentDocument,n=r.documentElement,a=r.head;o.insertStyleRules(n,a)}},cache:this.cache});var u=function(e,t){d.attachDocumentToIframe(e,t),d.newDocumentQueue=d.newDocumentQueue.filter((function(t){return t!==e}))},d=this;try{for(var p=l(i),f=p.next();!f.done;f=p.next()){var h=f.value;u(h.mutationInQueue,h.builtNode)}}catch(e){r={error:e}}finally{try{f&&!f.done&&(n=p.return)&&n.call(p)}finally{if(r)throw r.error}}},t.prototype.collectIframeAndAttachDocument=function(e,t){if(M(t)){var r=this.newDocumentQueue.find((function(e){return e.parentId===t.__sn.id}));r&&e.push({mutationInQueue:r,builtNode:t})}},t.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))}},t.prototype.hasImageArg=function(e){var t,r;try{for(var n=l(e),o=n.next();!o.done;o=n.next()){var i=o.value;if(i&&"object"==typeof i)if("rr_type"in i&&"args"in i){if(this.hasImageArg(i.args))return!0}else{if("rr_type"in i&&"HTMLImageElement"===i.rr_type)return!0;if(i instanceof Array&&this.hasImageArg(i))return!0}else;}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return!1},t.prototype.getImageArgs=function(e){var t,r,n=[];try{for(var o=l(e),i=o.next();!i.done;i=o.next()){var a=i.value;a&&"object"==typeof a&&("rr_type"in a&&"args"in a?n.push.apply(n,u(this.getImageArgs(a.args))):"rr_type"in a&&"HTMLImageElement"===a.rr_type?n.push(a.src):a instanceof Array&&n.push.apply(n,u(this.getImageArgs(a))))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n},t.prototype.preloadAllImages=function(){var t,r,n=this;this.service.state;var o=function(){n.service.state};this.emitter.on(e.ReplayerEvents.Start,o),this.emitter.on(e.ReplayerEvents.Pause,o);var i=function(t){t.type===e.EventType.IncrementalSnapshot&&t.data.source===e.IncrementalSource.CanvasMutation&&("commands"in t.data?t.data.commands.forEach((function(e){return n.preloadImages(e,t)})):a.preloadImages(t.data,t))},a=this;try{for(var s=l(this.service.state.context.events),c=s.next();!c.done;c=s.next()){i(c.value)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}},t.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)}},t.prototype.applyIncremental=function(t,r){var n,i,a=this,l=t.data;switch(l.source){case e.IncrementalSource.Mutation:r&&(l.adds.forEach((function(e){return a.treeIndex.add(e)})),l.texts.forEach((function(e){return a.treeIndex.text(e)})),l.attributes.forEach((function(e){return a.treeIndex.attribute(e)})),l.removes.forEach((function(e){return a.treeIndex.remove(e,a.mirror)})));try{this.applyMutation(l,r)}catch(e){this.warn("Exception in mutation "+(e.message||e),l)}break;case e.IncrementalSource.Drag:case e.IncrementalSource.TouchMove:case e.IncrementalSource.MouseMove:if(r){var c=l.positions[l.positions.length-1];this.mousePos={x:c.x,y:c.y,id:c.id,debugData:l}}else l.positions.forEach((function(e){var n={doAction:function(){a.moveAndHover(e.x,e.y,e.id,r,l)},delay:e.timeOffset+t.timestamp-a.service.state.context.baselineTime};a.timer.addAction(n)})),this.timer.addAction({doAction:function(){},delay:t.delay-(null===(n=l.positions[0])||void 0===n?void 0:n.timeOffset)});break;case e.IncrementalSource.MouseInteraction:if(-1===l.id)break;var u=new Event(e.MouseInteractions[l.type].toLowerCase());if(!(T=this.mirror.getNode(l.id)))return this.debugNodeNotFound(l,l.id);this.emitter.emit(e.ReplayerEvents.MouseInteraction,{type:l.type,target:T});var d=this.config.triggerFocus;switch(l.type){case e.MouseInteractions.Blur:"blur"in T&&T.blur();break;case e.MouseInteractions.Focus:d&&T.focus&&T.focus({preventScroll:!0});break;case e.MouseInteractions.Click:case e.MouseInteractions.TouchStart:case e.MouseInteractions.TouchEnd:r?(l.type===e.MouseInteractions.TouchStart?this.touchActive=!0:l.type===e.MouseInteractions.TouchEnd&&(this.touchActive=!1),this.mousePos={x:l.x,y:l.y,id:l.id,debugData:l}):(l.type===e.MouseInteractions.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(l.x,l.y,l.id,r,l),l.type===e.MouseInteractions.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):l.type===e.MouseInteractions.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):l.type===e.MouseInteractions.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case e.MouseInteractions.TouchCancel:r?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:T.dispatchEvent(u)}break;case e.IncrementalSource.Scroll:if(-1===l.id)break;if(r){this.treeIndex.scroll(l);break}this.applyScroll(l,!1);break;case e.IncrementalSource.ViewportResize:this.emitter.emit(e.ReplayerEvents.Resize,{width:l.width,height:l.height});break;case e.IncrementalSource.Input:if(-1===l.id)break;if(r){this.treeIndex.input(l);break}this.applyInput(l);break;case e.IncrementalSource.MediaInteraction:if(!(T=this.mirror.getNode(l.id)))return this.debugNodeNotFound(l,l.id);var p=T;try{l.currentTime&&(p.currentTime=l.currentTime),l.volume&&(p.volume=l.volume),l.muted&&(p.muted=l.muted),1===l.type&&p.pause(),0===l.type&&p.play()}catch(e){this.config.showWarning&&console.warn("Failed to replay media interactions: "+(e.message||e))}break;case e.IncrementalSource.StyleSheetRule:if(!(T=this.mirror.getNode(l.id)))return this.debugNodeNotFound(l,l.id);var f,h=T,m=T.parentNode,v=this.fragmentParentMap.has(m),y=v?null:h.sheet;y||(this.virtualStyleRulesMap.has(T)?f=this.virtualStyleRulesMap.get(T):(f=[],this.virtualStyleRulesMap.set(T,f))),l.adds&&l.adds.forEach((function(e){var t=e.rule,r=e.index;if(y)try{if(Array.isArray(r)){var n=gt(r),o=n.positions,i=n.index;yt(y.cssRules,o).insertRule(t,i)}else{i=void 0===r?void 0:Math.min(r,y.cssRules.length);y.insertRule(t,i)}}catch(e){}else null==f||f.push({cssText:t,index:r,type:vt.Insert})})),l.removes&&l.removes.forEach((function(e){var t=e.index;if(v)null==f||f.push({index:t,type:vt.Remove});else try{if(Array.isArray(t)){var r=gt(t),n=r.positions,o=r.index;yt(y.cssRules,n).deleteRule(o||0)}else null==y||y.deleteRule(t)}catch(e){}}));break;case e.IncrementalSource.StyleDeclaration:if(!(T=this.mirror.getNode(l.id)))return this.debugNodeNotFound(l,l.id);h=T;var g=T.parentNode,b=this.fragmentParentMap.has(g)?null:h.sheet,S=[];if(b||(this.virtualStyleRulesMap.has(T)?S=this.virtualStyleRulesMap.get(T):(S=[],this.virtualStyleRulesMap.set(T,S))),l.set)if(b)yt(b.rules,l.index).style.setProperty(l.set.property,l.set.value,l.set.priority);else S.push(s({type:vt.SetProperty,index:l.index},l.set));if(l.remove)if(b)yt(b.rules,l.index).style.removeProperty(l.remove.property);else S.push(s({type:vt.RemoveProperty,index:l.index},l.remove));break;case e.IncrementalSource.CanvasMutation:if(!this.config.UNSAFE_replayCanvas)return;var T;if(!(T=this.mirror.getNode(l.id)))return this.debugNodeNotFound(l,l.id);!function(e){var t=e.event,r=e.mutation,n=e.target,i=e.imageMap,a=e.errorHandler;try{var s="commands"in r?r.commands:[r];[o.WebGL,o.WebGL2].includes(r.type)?s.forEach((function(e){Et({mutation:e,type:r.type,target:n,imageMap:i,errorHandler:a})})):s.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:i,errorHandler:a})}))}catch(e){a(r,e)}}({event:t,mutation:l,target:T,imageMap:this.imageMap,errorHandler:this.warnCanvasMutationFailed.bind(this)});break;case e.IncrementalSource.Font:try{var x=new FontFace(l.family,l.buffer?new Uint8Array(JSON.parse(l.fontSource)):l.fontSource,l.descriptors);null===(i=this.iframe.contentDocument)||void 0===i||i.fonts.add(x)}catch(e){this.config.showWarning&&console.warn(e)}}},t.prototype.applyMutation=function(e,t){var r,n,o=this;e.removes.forEach((function(t){var r=o.mirror.getNode(t.id);if(!r){if(e.removes.find((function(e){return e.id===t.parentId})))return;return o.warnNodeNotFound(e,t.id)}o.virtualStyleRulesMap.has(r)&&o.virtualStyleRulesMap.delete(r);var n=o.mirror.getNode(t.parentId);if(!n)return o.warnNodeNotFound(e,t.parentId);if(t.isShadow&&R(n)&&(n=n.shadowRoot),o.mirror.removeNodeFromMap(r),n){var i=null,a="__sn"in n?o.fragmentParentMap.get(n):void 0;a&&a.contains(r)?n=a:o.fragmentParentMap.has(r)&&(i=o.fragmentParentMap.get(r),o.fragmentParentMap.delete(r),r=i);try{n.removeChild(r)}catch(t){if(!(t instanceof DOMException))throw t;o.warn("parent could not remove child in mutation",n,a,r,i,e)}}}));var i=s({},this.legacy_missingNodeRetryMap),a=[],c=function(e){var r,n,s,c;if(!o.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");var u=o.mirror.getNode(e.parentId);if(!u)return e.node.type===O.Document?o.newDocumentQueue.push(e):a.push(e);var d=null;o.iframe.contentDocument.contains?d=o.iframe.contentDocument.contains(u):o.iframe.contentDocument.body.contains&&(d=o.iframe.contentDocument.body.contains(u));var p=(null===(c=(s=u).getElementsByTagName)||void 0===c?void 0:c.call(s,"iframe").length)>0;if(t&&d&&!M(u)&&!p){var f=document.createDocumentFragment();for(o.mirror.map[e.parentId]=f,o.fragmentParentMap.set(f,u),o.storeState(u);u.firstChild;)f.appendChild(u.firstChild);u=f}e.node.isShadow&&R(u)&&(u=u.shadowRoot);var h=null,m=null;if(e.previousId&&(h=o.mirror.getNode(e.previousId)),e.nextId&&(m=o.mirror.getNode(e.nextId)),function(e){var t=null;return e.nextId&&(t=o.mirror.getNode(e.nextId)),null!==e.nextId&&void 0!==e.nextId&&-1!==e.nextId&&!t}(e))return a.push(e);if(!e.node.rootId||o.mirror.getNode(e.node.rootId)){var v=e.node.rootId?o.mirror.getNode(e.node.rootId):o.iframe.contentDocument;if(M(u))o.attachDocumentToIframe(e,u);else{var y=ue(e.node,{doc:v,map:o.mirror.map,skipChild:!0,hackCss:!0,cache:o.cache});if(-1!==e.previousId&&-1!==e.nextId){if("__sn"in u&&u.__sn.type===O.Element&&"textarea"===u.__sn.tagName&&e.node.type===O.Text)try{for(var g=l(Array.from(u.childNodes)),b=g.next();!b.done;b=g.next()){var S=b.value;S.nodeType===u.TEXT_NODE&&u.removeChild(S)}}catch(e){r={error:e}}finally{try{b&&!b.done&&(n=g.return)&&n.call(g)}finally{if(r)throw r.error}}if(h&&h.nextSibling&&h.nextSibling.parentNode)u.insertBefore(y,h.nextSibling);else if(m&&m.parentNode)u.contains(m)?u.insertBefore(y,m):u.insertBefore(y,null);else{if(u===v)for(;v.firstChild;)v.removeChild(v.firstChild);u.appendChild(y)}if(M(y)){var T=o.newDocumentQueue.find((function(e){return e.parentId===y.__sn.id}));T&&(o.attachDocumentToIframe(T,y),o.newDocumentQueue=o.newDocumentQueue.filter((function(e){return e!==T})))}(e.previousId||e.nextId)&&o.legacy_resolveMissingNode(i,u,y,e)}else i[e.node.id]={node:y,mutation:e}}}};e.adds.forEach((function(e){c(e)}));for(var u=Date.now();a.length;){var d=C(a);if(a.length=0,Date.now()-u>500){this.warn("Timeout in the loop, please check the resolve tree data:",d);break}try{for(var p=(r=void 0,l(d)),f=p.next();!f.done;f=p.next()){var h=f.value;this.mirror.getNode(h.value.parentId)?k(h,(function(e){c(e)})):this.debug("Drop resolve tree since there is no parent for the root node.",h)}}catch(e){r={error:e}}finally{try{f&&!f.done&&(n=p.return)&&n.call(p)}finally{if(r)throw r.error}}}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),e.texts.forEach((function(t){var r=o.mirror.getNode(t.id);if(!r){if(e.removes.find((function(e){return e.id===t.id})))return;return o.warnNodeNotFound(e,t.id)}o.fragmentParentMap.has(r)&&(r=o.fragmentParentMap.get(r)),r.textContent=t.value})),e.attributes.forEach((function(t){var r=o.mirror.getNode(t.id);if(!r){if(e.removes.find((function(e){return e.id===t.id})))return;return o.warnNodeNotFound(e,t.id)}for(var n in o.fragmentParentMap.has(r)&&(r=o.fragmentParentMap.get(r)),t.attributes)if("string"==typeof n){var i=t.attributes[n];if(null===i)r.removeAttribute(n);else if("string"==typeof i)try{r.setAttribute(n,i)}catch(e){o.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",e)}else if("style"===n){var a=i,s=r;for(var l in a)if(!1===a[l])s.style.removeProperty(l);else if(a[l]instanceof Array){var c=a[l];s.style.setProperty(l,c[0],c[1])}else{var u=a[l];s.style.setProperty(l,u)}}}}))},t.prototype.applyScroll=function(e,t){var r=this.mirror.getNode(e.id);if(!r)return this.debugNodeNotFound(e,e.id);if(r===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else if(r.__sn.type===O.Document)r.defaultView.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else try{r.scrollTop=e.y,r.scrollLeft=e.x}catch(e){}},t.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){}},t.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)}},t.prototype.moveAndHover=function(e,t,r,n,o){var i=this.mirror.getNode(r);if(!i)return this.debugNodeNotFound(o,r);var a=N(i,this.iframe),s=e*a.absoluteScale+a.x,l=t*a.absoluteScale+a.y;this.mouse.style.left=s+"px",this.mouse.style.top=l+"px",n||this.drawMouseTail({x:s,y:l}),this.hoverElements(i)},t.prototype.drawMouseTail=function(e){var t=this;if(this.mouseTail){var r=!0===this.config.mouseTail?Ct:Object.assign({},Ct,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)}},t.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},t.prototype.isUserInteraction=function(t){return t.type===e.EventType.IncrementalSnapshot&&(t.data.source>e.IncrementalSource.Mutation&&t.data.source<=e.IncrementalSource.Input)},t.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}))},t.prototype.restoreRealParent=function(e,t){this.mirror.map[t.__sn.id]=t,t.__sn.type===O.Element&&"textarea"===t.__sn.tagName&&e.textContent&&(t.value=e.textContent);try{t.appendChild(e),this.restoreState(t)}catch(e){console.warn(e)}},t.prototype.storeState=function(e){var t,r;if(e&&e.nodeType===e.ELEMENT_NODE){var n=e;(n.scrollLeft||n.scrollTop)&&this.elementStateMap.set(e,{scroll:[n.scrollLeft,n.scrollTop]}),"STYLE"===n.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:vt.Snapshot,cssTexts:n}])}catch(e){}}(n,this.virtualStyleRulesMap);var o=n.children;try{for(var i=l(Array.from(o)),a=i.next();!a.done;a=i.next()){var s=a.value;this.storeState(s)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}}},t.prototype.restoreState=function(e){var t,r;if(e.nodeType===e.ELEMENT_NODE){var n=e;if(this.elementStateMap.has(e)){var o=this.elementStateMap.get(e);o.scroll&&(n.scrollLeft=o.scroll[0],n.scrollTop=o.scroll[1]),this.elementStateMap.delete(e)}var i=n.children;try{for(var a=l(Array.from(i)),s=a.next();!s.done;s=a.next()){var c=s.value;this.restoreState(c)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}}},t.prototype.restoreNodeSheet=function(e){var t=this.virtualStyleRulesMap.get(e);"STYLE"===e.nodeName&&(t&&bt(t,e))},t.prototype.warnNodeNotFound=function(e,t){this.treeIndex.idRemoved(t)?this.warn("Node with id '"+t+"' was previously removed. ",e):this.warn("Node with id '"+t+"' not found. ",e)},t.prototype.warnCanvasMutationFailed=function(e,t){this.warn("Has error on canvas update",t,"canvas mutation:",e)},t.prototype.debugNodeNotFound=function(e,t){this.treeIndex.idRemoved(t)?this.debug("[replayer]","Node with id '"+t+"' was previously removed. ",e):this.debug("[replayer]","Node with id '"+t+"' not found. ",e)},t.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showWarning&&console.warn.apply(console,u(["[replayer]"],e))},t.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showDebug&&console.log.apply(console,u(["[replayer]"],e))},t}(),Nt={key:"_sid"},Rt=$e.addCustomEvent,_t=$e.freezePage;return e.Replayer=Mt,e.addCustomEvent=Rt,e.freezePage=_t,e.getRecordSequentialIdPlugin=function(e){var t=e?Object.assign({},Nt,e):Nt,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.record=$e,e.utils=A,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
30
- //# sourceMappingURL=rrweb.min.js.map