Socket
Socket
Sign inDemoInstall

rrweb

Package Overview
Dependencies
4
Maintainers
1
Versions
100
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.7.8 to 0.7.9

74

dist/record/rrweb-record.js

@@ -350,2 +350,16 @@ var rrwebRecord = (function () {

}
function isAncestorRemoved(target) {
var id = mirror.getId(target);
if (!mirror.has(id)) {
return true;
}
if (target.parentNode &&
target.parentNode.nodeType === target.DOCUMENT_NODE) {
return false;
}
if (!target.parentNode) {
return true;
}
return isAncestorRemoved(target.parentNode);
}

@@ -396,2 +410,28 @@ var EventType;

function deepDelete(addsSet, n) {
addsSet["delete"](n);
n.childNodes.forEach(function (childN) { return deepDelete(addsSet, childN); });
}
function isParentRemoved(removes, n) {
var parentNode = n.parentNode;
if (!parentNode) {
return false;
}
var parentId = mirror.getId(parentNode);
if (removes.some(function (r) { return r.id === parentId; })) {
return true;
}
return isParentRemoved(removes, parentNode);
}
function isParentDropped(droppedSet, n) {
var parentNode = n.parentNode;
if (!parentNode) {
return false;
}
if (droppedSet.has(parentNode)) {
return true;
}
return isParentDropped(droppedSet, parentNode);
}
function initMutationObserver(cb) {

@@ -403,4 +443,4 @@ var observer = new MutationObserver(function (mutations) {

var adds = [];
var dropped = [];
var addsSet = new Set();
var droppedSet = new Set();
var genAdds = function (n) {

@@ -411,2 +451,3 @@ if (isBlocked(n)) {

addsSet.add(n);
droppedSet["delete"](n);
n.childNodes.forEach(function (childN) { return genAdds(childN); });

@@ -452,7 +493,7 @@ };

if (addsSet.has(n)) {
addsSet["delete"](n);
dropped.push(n);
deepDelete(addsSet, n);
droppedSet.add(n);
}
else if (addsSet.has(target) && nodeId === -1) ;
else if (!mirror.has(parentId)) ;
else if (isAncestorRemoved(target)) ;
else {

@@ -472,25 +513,4 @@ removes.push({

});
var isDropped = function (n) {
var parentNode = n.parentNode;
if (!parentNode) {
return false;
}
if (dropped.some(function (d) { return d === parentNode; })) {
return true;
}
return isDropped(parentNode);
};
var isRemoved = function (n) {
var parentNode = n.parentNode;
if (!parentNode) {
return false;
}
var parentId = mirror.getId(parentNode);
if (removes.some(function (r) { return r.id === parentId; })) {
return true;
}
return isRemoved(parentNode);
};
Array.from(addsSet).forEach(function (n) {
if (!isDropped(n) && !isRemoved(n)) {
if (!isParentDropped(droppedSet, n) && !isParentRemoved(removes, n)) {
adds.push({

@@ -508,3 +528,3 @@ parentId: mirror.getId(n.parentNode),

else {
dropped.push(n);
droppedSet.add(n);
}

@@ -511,0 +531,0 @@ });

@@ -1,2 +0,2 @@

var rrwebRecord=function(){"use strict";var e,t=function(){return(t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};!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"}(e||(e={}));var n=1;var r=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,o=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,a=/^(data:)([\w\/\+]+);(charset=[\w-]+|base64).*,(.*)/gi;function u(e,t){return e.replace(r,function(e,n,r,u){var i,c=n||r||u;if(!c)return e;if(!o.test(c))return"url('"+c+"')";if(a.test(c))return"url("+c+")";if("/"===c[0])return"url('"+(((i=t).indexOf("//")>-1?i.split("/").slice(0,3).join("/"):i.split("/")[0]).split("?")[0]+c)+"')";var s=t.split("/"),l=c.split("/");s.pop();for(var d=0,p=l;d<p.length;d++){var f=p[d];"."!==f&&(".."===f?s.pop():s.push(f))}return"url('"+s.join("/")+"')"})}function i(e,t){var n=e.createElement("a");return n.href=t,n.href}var c="rr-block";function s(t,n){switch(t.nodeType){case t.DOCUMENT_NODE:return{type:e.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId};case t.ELEMENT_NODE:for(var r=t.classList.contains(c),o=t.tagName.toLowerCase(),a={},s=0,l=Array.from(t.attributes);s<l.length;s++){var d=l[s],p=d.name,f=d.value;a[p]="src"===p||"href"===p?i(n,f):"style"===p?u(f,location.href):f}if("link"===o){var m=Array.from(n.styleSheets).find(function(e){return e.href===t.href}),h=function(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+t.cssText},""):null}catch(e){return null}}(m);h&&(a={_cssText:u(h,m.href)})}if("input"===o||"textarea"===o||"select"===o){f=t.value;"radio"!==a.type&&"checkbox"!==a.type&&f?a.value=f:t.checked&&(a.checked=t.checked)}if("option"===o){var v=t.parentElement;a.value===v.value&&(a.selected=t.selected)}if(r){var y=t.getBoundingClientRect(),g=y.width,E=y.height;a.rr_width=g+"px",a.rr_height=E+"px"}return{type:e.Element,tagName:o,attributes:a,childNodes:[],isSVG:(N=t,"svg"===N.tagName||N instanceof SVGElement||void 0),needBlock:r};case t.TEXT_NODE:var b=t.parentNode&&t.parentNode.tagName,w=t.textContent,C="STYLE"===b||void 0;return C&&w&&(w=u(w,location.href)),"SCRIPT"===b&&(w="SCRIPT_PLACEHOLDER"),{type:e.Text,textContent:w||"",isStyle:C};case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:""};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||""};default:return!1}var N}function l(t,r,o,a){void 0===a&&(a=!1);var u=s(t,r);if(!u)return console.warn(t,"not serialized"),null;var i=Object.assign(u,{id:n++});t.__sn=i,o[i.id]=t;var c=!a;if(i.type===e.Element&&(c=c&&!i.needBlock,delete i.needBlock),(i.type===e.Document||i.type===e.Element)&&c)for(var d=0,p=Array.from(t.childNodes);d<p.length;d++){var f=l(p[d],r,o);f&&i.childNodes.push(f)}return i}function d(e){n=1;var t={};return[l(e,e,t),t]}function p(e,t,n){void 0===n&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}var f={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return f.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete f.map[t],e.childNodes&&e.childNodes.forEach(function(e){return f.removeNodeFromMap(e)})},has:function(e){return f.map.hasOwnProperty(e)}};function m(e,t,n){void 0===n&&(n={});var r=null,o=0;return function(){var a=Date.now();o||!1!==n.leading||(o=a);var u=t-(a-o),i=this,c=arguments;u<=0||u>t?(r&&(window.clearTimeout(r),r=null),o=a,e.apply(i,c)):r||!1===n.trailing||(r=window.setTimeout(function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(i,c)},u))}}function h(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function v(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}var y,g,E,b,w="rr-block";function C(e){return!!e&&(e.nodeType===e.ELEMENT_NODE&&e.classList.contains(w)||C(e.parentNode))}function N(e){var t=[];return Object.keys(E).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(n){var r=n.toLowerCase(),o=function(t){return function(n){if(!C(n.target)){var r=f.getId(n.target),o=n.clientX,a=n.clientY;e({type:E[t],id:r,x:o,y:a})}}}(n);t.push(p(r,o))}),function(){t.forEach(function(e){return e()})}}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta"}(y||(y={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input"}(g||(g={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove=8]="TouchMove",e[e.TouchEnd=9]="TouchEnd"}(E||(E={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end"}(b||(b={}));var T=["INPUT","TEXTAREA","SELECT"],I=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],S="rr-ignore",D=new WeakMap;function M(e){function n(e){var t=e.target;if(t&&t.tagName&&!(T.indexOf(t.tagName)<0)&&!C(t)){var n=t.type;if("password"!==n&&!t.classList.contains(S)){var o=t.value,a=!1;"radio"!==n&&"checkbox"!==n||(a=t.checked),r(t,{text:o,isChecked:a});var u=t.name;"radio"===n&&u&&a&&document.querySelectorAll('input[type="radio"][name="'+u+'"]').forEach(function(e){e!==t&&r(e,{text:e.value,isChecked:!a})})}}}function r(n,r){var o=D.get(n);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){D.set(n,r);var a=f.getId(n);e(t({},r,{id:a}))}}var o=["input","change"].map(function(e){return p(e,n)}),a=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");return a&&a.set&&o.push.apply(o,I.map(function(e){return function e(t,n,r){var o=Object.getOwnPropertyDescriptor(t,n);return Object.defineProperty(t,n,{set:function(e){var t=this;setTimeout(function(){r.set.call(t,e)},0),o&&o.set&&o.set.call(this,e)}}),function(){return e(t,n,o||{})}}(e[0],e[1],{set:function(){n({target:this})}})})),function(){o.forEach(function(e){return e()})}}function x(e){var t,n,r=(t=e.mutationCb,(n=new MutationObserver(function(e){var n=[],r=[],o=[],a=[],u=[],i=new Set,c=function(e){C(e)||(i.add(e),e.childNodes.forEach(function(e){return c(e)}))};e.forEach(function(e){var t=e.type,a=e.target,s=e.oldValue,l=e.addedNodes,d=e.removedNodes,p=e.attributeName;switch(t){case"characterData":var m=a.textContent;C(a)||m===s||n.push({value:m,node:a});break;case"attributes":if(m=a.getAttribute(p),C(a)||m===s)return;var h=r.find(function(e){return e.node===a});h||(h={node:a,attributes:{}},r.push(h)),h.attributes[p]=m;break;case"childList":l.forEach(function(e){return c(e)}),d.forEach(function(e){var t=f.getId(e),n=f.getId(a);C(e)||(i.has(e)?(i.delete(e),u.push(e)):i.has(a)&&-1===t||f.has(n)&&o.push({parentId:n,id:t}),f.removeNodeFromMap(e))})}});var s=function(e){var t=e.parentNode;return!!t&&(!!u.some(function(e){return e===t})||s(t))},d=function(e){var t=e.parentNode;if(!t)return!1;var n=f.getId(t);return!!o.some(function(e){return e.id===n})||d(t)};Array.from(i).forEach(function(e){s(e)||d(e)?u.push(e):a.push({parentId:f.getId(e.parentNode),previousId:e.previousSibling?f.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?f.getId(e.nextSibling):e.nextSibling,node:l(e,document,f.map,!0)})});var p={texts:n.map(function(e){return{id:f.getId(e.node),value:e.value}}).filter(function(e){return f.has(e.id)}),attributes:r.map(function(e){return{id:f.getId(e.node),attributes:e.attributes}}).filter(function(e){return f.has(e.id)}),removes:o,adds:a};(p.texts.length||p.attributes.length||p.removes.length||p.adds.length)&&t(p)})).observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n),o=function(e){var t,n=[],r=m(function(){var r=Date.now()-t;e(n.map(function(e){return e.timeOffset-=r,e})),n=[],t=null},500);return p("mousemove",m(function(e){var o=e.clientX,a=e.clientY,u=e.target;t||(t=Date.now()),n.push({x:o,y:a,id:f.getId(u),timeOffset:Date.now()-t}),r()},50,{trailing:!1}))}(e.mousemoveCb),a=N(e.mouseInteractionCb),u=function(e){return p("scroll",m(function(t){if(t.target&&!C(t.target)){var n=f.getId(t.target);if(t.target===document){var r=document.scrollingElement||document.documentElement;e({id:n,x:r.scrollLeft,y:r.scrollTop})}else e({id:n,x:t.target.scrollLeft,y:t.target.scrollTop})}},100))}(e.scrollCb),i=function(e){return p("resize",m(function(){var t=h(),n=v();e({width:Number(n),height:Number(t)})},200),window)}(e.viewportResizeCb),c=M(e.inputCb);return function(){r.disconnect(),o(),a(),u(),i(),c()}}function L(e){return t({},e,{timestamp:Date.now()})}return function(e){void 0===e&&(e={});var n,r=e.emit,o=e.checkoutEveryNms,a=e.checkoutEveryNth;if(!r)throw new Error("emit function is required");var u=0,i=function(e,t){if(r(e,t),e.type===y.FullSnapshot)n=e,u=0;else if(e.type===y.IncrementalSnapshot){u++;var i=a&&u>=a,s=o&&e.timestamp-n.timestamp>o;(i||s)&&c(!0)}};function c(e){void 0===e&&(e=!1),i(L({type:y.Meta,data:{href:window.location.href,width:v(),height:h()}}),e);var t=d(document),n=t[0],r=t[1];if(!n)return console.warn("Failed to snapshot the document");f.map=r,i(L({type:y.FullSnapshot,data:{node:n,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}}))}try{var s=[];s.push(p("DOMContentLoaded",function(){i(L({type:y.DomContentLoaded,data:{}}))}));var l=function(){c(),s.push(x({mutationCb:function(e){return i(L({type:y.IncrementalSnapshot,data:t({source:g.Mutation},e)}))},mousemoveCb:function(e){return i(L({type:y.IncrementalSnapshot,data:{source:g.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return i(L({type:y.IncrementalSnapshot,data:t({source:g.MouseInteraction},e)}))},scrollCb:function(e){return i(L({type:y.IncrementalSnapshot,data:t({source:g.Scroll},e)}))},viewportResizeCb:function(e){return i(L({type:y.IncrementalSnapshot,data:t({source:g.ViewportResize},e)}))},inputCb:function(e){return i(L({type:y.IncrementalSnapshot,data:t({source:g.Input},e)}))}}))};return"interactive"===document.readyState||"complete"===document.readyState?l():s.push(p("load",function(){i(L({type:y.Load,data:{}})),l()},window)),function(){s.forEach(function(e){return e()})}}catch(e){console.warn(e)}}}();
var rrwebRecord=function(){"use strict";var e,t=function(){return(t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};!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"}(e||(e={}));var n=1;var r=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,o=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,a=/^(data:)([\w\/\+]+);(charset=[\w-]+|base64).*,(.*)/gi;function i(e,t){return e.replace(r,function(e,n,r,i){var u,c=n||r||i;if(!c)return e;if(!o.test(c))return"url('"+c+"')";if(a.test(c))return"url("+c+")";if("/"===c[0])return"url('"+(((u=t).indexOf("//")>-1?u.split("/").slice(0,3).join("/"):u.split("/")[0]).split("?")[0]+c)+"')";var s=t.split("/"),d=c.split("/");s.pop();for(var l=0,p=d;l<p.length;l++){var f=p[l];"."!==f&&(".."===f?s.pop():s.push(f))}return"url('"+s.join("/")+"')"})}function u(e,t){var n=e.createElement("a");return n.href=t,n.href}var c="rr-block";function s(t,n){switch(t.nodeType){case t.DOCUMENT_NODE:return{type:e.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId};case t.ELEMENT_NODE:for(var r=t.classList.contains(c),o=t.tagName.toLowerCase(),a={},s=0,d=Array.from(t.attributes);s<d.length;s++){var l=d[s],p=l.name,f=l.value;a[p]="src"===p||"href"===p?u(n,f):"style"===p?i(f,location.href):f}if("link"===o){var m=Array.from(n.styleSheets).find(function(e){return e.href===t.href}),h=function(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+t.cssText},""):null}catch(e){return null}}(m);h&&(a={_cssText:i(h,m.href)})}if("input"===o||"textarea"===o||"select"===o){f=t.value;"radio"!==a.type&&"checkbox"!==a.type&&f?a.value=f:t.checked&&(a.checked=t.checked)}if("option"===o){var v=t.parentElement;a.value===v.value&&(a.selected=t.selected)}if(r){var y=t.getBoundingClientRect(),g=y.width,E=y.height;a.rr_width=g+"px",a.rr_height=E+"px"}return{type:e.Element,tagName:o,attributes:a,childNodes:[],isSVG:(C=t,"svg"===C.tagName||C instanceof SVGElement||void 0),needBlock:r};case t.TEXT_NODE:var b=t.parentNode&&t.parentNode.tagName,w=t.textContent,N="STYLE"===b||void 0;return N&&w&&(w=i(w,location.href)),"SCRIPT"===b&&(w="SCRIPT_PLACEHOLDER"),{type:e.Text,textContent:w||"",isStyle:N};case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:""};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||""};default:return!1}var C}function d(t,r,o,a){void 0===a&&(a=!1);var i=s(t,r);if(!i)return console.warn(t,"not serialized"),null;var u=Object.assign(i,{id:n++});t.__sn=u,o[u.id]=t;var c=!a;if(u.type===e.Element&&(c=c&&!u.needBlock,delete u.needBlock),(u.type===e.Document||u.type===e.Element)&&c)for(var l=0,p=Array.from(t.childNodes);l<p.length;l++){var f=d(p[l],r,o);f&&u.childNodes.push(f)}return u}function l(e){n=1;var t={};return[d(e,e,t),t]}function p(e,t,n){void 0===n&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}var f={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return f.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete f.map[t],e.childNodes&&e.childNodes.forEach(function(e){return f.removeNodeFromMap(e)})},has:function(e){return f.map.hasOwnProperty(e)}};function m(e,t,n){void 0===n&&(n={});var r=null,o=0;return function(){var a=Date.now();o||!1!==n.leading||(o=a);var i=t-(a-o),u=this,c=arguments;i<=0||i>t?(r&&(window.clearTimeout(r),r=null),o=a,e.apply(u,c)):r||!1===n.trailing||(r=window.setTimeout(function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(u,c)},i))}}function h(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function v(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}var y,g,E,b,w="rr-block";function N(e){return!!e&&(e.nodeType===e.ELEMENT_NODE&&e.classList.contains(w)||N(e.parentNode))}function C(e){var t=new MutationObserver(function(t){var n=[],r=[],o=[],a=[],i=new Set,u=new Set,c=function(e){N(e)||(i.add(e),u.delete(e),e.childNodes.forEach(function(e){return c(e)}))};t.forEach(function(e){var t=e.type,a=e.target,s=e.oldValue,d=e.addedNodes,l=e.removedNodes,p=e.attributeName;switch(t){case"characterData":var m=a.textContent;N(a)||m===s||n.push({value:m,node:a});break;case"attributes":m=a.getAttribute(p);if(N(a)||m===s)return;var h=r.find(function(e){return e.node===a});h||(h={node:a,attributes:{}},r.push(h)),h.attributes[p]=m;break;case"childList":d.forEach(function(e){return c(e)}),l.forEach(function(e){var t=f.getId(e),n=f.getId(a);N(e)||(i.has(e)?(!function e(t,n){t.delete(n),n.childNodes.forEach(function(n){return e(t,n)})}(i,e),u.add(e)):i.has(a)&&-1===t||function e(t){var n=f.getId(t);return!f.has(n)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||e(t.parentNode))}(a)||o.push({parentId:n,id:t}),f.removeNodeFromMap(e))})}}),Array.from(i).forEach(function(e){(function e(t,n){var r=n.parentNode;return!!r&&(!!t.has(r)||e(t,r))})(u,e)||function e(t,n){var r=n.parentNode;if(!r)return!1;var o=f.getId(r);return!!t.some(function(e){return e.id===o})||e(t,r)}(o,e)?u.add(e):a.push({parentId:f.getId(e.parentNode),previousId:e.previousSibling?f.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?f.getId(e.nextSibling):e.nextSibling,node:d(e,document,f.map,!0)})});var s={texts:n.map(function(e){return{id:f.getId(e.node),value:e.value}}).filter(function(e){return f.has(e.id)}),attributes:r.map(function(e){return{id:f.getId(e.node),attributes:e.attributes}}).filter(function(e){return f.has(e.id)}),removes:o,adds:a};(s.texts.length||s.attributes.length||s.removes.length||s.adds.length)&&e(s)});return t.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),t}function T(e){var t=[];return Object.keys(E).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(n){var r=n.toLowerCase(),o=function(t){return function(n){if(!N(n.target)){var r=f.getId(n.target),o=n.clientX,a=n.clientY;e({type:E[t],id:r,x:o,y:a})}}}(n);t.push(p(r,o))}),function(){t.forEach(function(e){return e()})}}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta"}(y||(y={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input"}(g||(g={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove=8]="TouchMove",e[e.TouchEnd=9]="TouchEnd"}(E||(E={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end"}(b||(b={}));var I=["INPUT","TEXTAREA","SELECT"],S=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],D="rr-ignore",M=new WeakMap;function x(e){function n(e){var t=e.target;if(t&&t.tagName&&!(I.indexOf(t.tagName)<0)&&!N(t)){var n=t.type;if("password"!==n&&!t.classList.contains(D)){var o=t.value,a=!1;"radio"!==n&&"checkbox"!==n||(a=t.checked),r(t,{text:o,isChecked:a});var i=t.name;"radio"===n&&i&&a&&document.querySelectorAll('input[type="radio"][name="'+i+'"]').forEach(function(e){e!==t&&r(e,{text:e.value,isChecked:!a})})}}}function r(n,r){var o=M.get(n);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){M.set(n,r);var a=f.getId(n);e(t({},r,{id:a}))}}var o=["input","change"].map(function(e){return p(e,n)}),a=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");return a&&a.set&&o.push.apply(o,S.map(function(e){return function e(t,n,r){var o=Object.getOwnPropertyDescriptor(t,n);return Object.defineProperty(t,n,{set:function(e){var t=this;setTimeout(function(){r.set.call(t,e)},0),o&&o.set&&o.set.call(this,e)}}),function(){return e(t,n,o||{})}}(e[0],e[1],{set:function(){n({target:this})}})})),function(){o.forEach(function(e){return e()})}}function O(e){var t,n,r,o,a=C(e.mutationCb),i=(t=e.mousemoveCb,r=[],o=m(function(){var e=Date.now()-n;t(r.map(function(t){return t.timeOffset-=e,t})),r=[],n=null},500),p("mousemove",m(function(e){var t=e.clientX,a=e.clientY,i=e.target;n||(n=Date.now()),r.push({x:t,y:a,id:f.getId(i),timeOffset:Date.now()-n}),o()},50,{trailing:!1}))),u=T(e.mouseInteractionCb),c=function(e){return p("scroll",m(function(t){if(t.target&&!N(t.target)){var n=f.getId(t.target);if(t.target===document){var r=document.scrollingElement||document.documentElement;e({id:n,x:r.scrollLeft,y:r.scrollTop})}else e({id:n,x:t.target.scrollLeft,y:t.target.scrollTop})}},100))}(e.scrollCb),s=function(e){return p("resize",m(function(){var t=h(),n=v();e({width:Number(n),height:Number(t)})},200),window)}(e.viewportResizeCb),d=x(e.inputCb);return function(){a.disconnect(),i(),u(),c(),s(),d()}}function L(e){return t({},e,{timestamp:Date.now()})}return function(e){void 0===e&&(e={});var n,r=e.emit,o=e.checkoutEveryNms,a=e.checkoutEveryNth;if(!r)throw new Error("emit function is required");var i=0,u=function(e,t){if(r(e,t),e.type===y.FullSnapshot)n=e,i=0;else if(e.type===y.IncrementalSnapshot){i++;var u=a&&i>=a,s=o&&e.timestamp-n.timestamp>o;(u||s)&&c(!0)}};function c(e){void 0===e&&(e=!1),u(L({type:y.Meta,data:{href:window.location.href,width:v(),height:h()}}),e);var t=l(document),n=t[0],r=t[1];if(!n)return console.warn("Failed to snapshot the document");f.map=r,u(L({type:y.FullSnapshot,data:{node:n,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}}))}try{var s=[];s.push(p("DOMContentLoaded",function(){u(L({type:y.DomContentLoaded,data:{}}))}));var d=function(){c(),s.push(O({mutationCb:function(e){return u(L({type:y.IncrementalSnapshot,data:t({source:g.Mutation},e)}))},mousemoveCb:function(e){return u(L({type:y.IncrementalSnapshot,data:{source:g.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return u(L({type:y.IncrementalSnapshot,data:t({source:g.MouseInteraction},e)}))},scrollCb:function(e){return u(L({type:y.IncrementalSnapshot,data:t({source:g.Scroll},e)}))},viewportResizeCb:function(e){return u(L({type:y.IncrementalSnapshot,data:t({source:g.ViewportResize},e)}))},inputCb:function(e){return u(L({type:y.IncrementalSnapshot,data:t({source:g.Input},e)}))}}))};return"interactive"===document.readyState||"complete"===document.readyState?d():s.push(p("load",function(){u(L({type:y.Load,data:{}})),d()},window)),function(){s.forEach(function(e){return e()})}}catch(e){console.warn(e)}}}();
//# sourceMappingURL=rrweb-record.min.js.map

@@ -1,2 +0,2 @@

var rrweb=function(e){"use strict";var t,n=function(){return(n=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(t||(t={}));var o=1;var r=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,i=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,a=/^(data:)([\w\/\+]+);(charset=[\w-]+|base64).*,(.*)/gi;function s(e,t){return e.replace(r,function(e,n,o,r){var s,l=n||o||r;if(!l)return e;if(!i.test(l))return"url('"+l+"')";if(a.test(l))return"url("+l+")";if("/"===l[0])return"url('"+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+l)+"')";var c=t.split("/"),u=l.split("/");c.pop();for(var d=0,f=u;d<f.length;d++){var p=f[d];"."!==p&&(".."===p?c.pop():c.push(p))}return"url('"+c.join("/")+"')"})}function l(e,t){var n=e.createElement("a");return n.href=t,n.href}var c="rr-block";function u(e,n){switch(e.nodeType){case e.DOCUMENT_NODE:return{type:t.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:t.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId};case e.ELEMENT_NODE:for(var o=e.classList.contains(c),r=e.tagName.toLowerCase(),i={},a=0,u=Array.from(e.attributes);a<u.length;a++){var d=u[a],f=d.name,p=d.value;i[f]="src"===f||"href"===f?l(n,p):"style"===f?s(p,location.href):p}if("link"===r){var h=Array.from(n.styleSheets).find(function(t){return t.href===e.href}),m=function(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+t.cssText},""):null}catch(e){return null}}(h);m&&(i={_cssText:s(m,h.href)})}if("input"===r||"textarea"===r||"select"===r){p=e.value;"radio"!==i.type&&"checkbox"!==i.type&&p?i.value=p:e.checked&&(i.checked=e.checked)}if("option"===r){var v=e.parentElement;i.value===v.value&&(i.selected=e.selected)}if(o){var y=e.getBoundingClientRect(),g=y.width,b=y.height;i.rr_width=g+"px",i.rr_height=b+"px"}return{type:t.Element,tagName:r,attributes:i,childNodes:[],isSVG:(S=e,"svg"===S.tagName||S instanceof SVGElement||void 0),needBlock:o};case e.TEXT_NODE:var w=e.parentNode&&e.parentNode.tagName,E=e.textContent,N="STYLE"===w||void 0;return N&&E&&(E=s(E,location.href)),"SCRIPT"===w&&(E="SCRIPT_PLACEHOLDER"),{type:t.Text,textContent:E||"",isStyle:N};case e.CDATA_SECTION_NODE:return{type:t.CDATA,textContent:""};case e.COMMENT_NODE:return{type:t.Comment,textContent:e.textContent||""};default:return!1}var S}function d(e,n,r,i){void 0===i&&(i=!1);var a=u(e,n);if(!a)return console.warn(e,"not serialized"),null;var s=Object.assign(a,{id:o++});e.__sn=s,r[s.id]=e;var l=!i;if(s.type===t.Element&&(l=l&&!s.needBlock,delete s.needBlock),(s.type===t.Document||s.type===t.Element)&&l)for(var c=0,f=Array.from(e.childNodes);c<f.length;c++){var p=d(f[c],n,r);p&&s.childNodes.push(p)}return s}function f(e){o=1;var t={};return[d(e,e,t),t]}var p={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 h=/([^\r\n,{}]+)(,(?=[^}]*{)|\s*{)/g,m=/([^\\]):hover/g;function v(e){return e.replace(h,function(e,t,n){if(m.test(t)){var o=t.replace(m,"$1.\\:hover");return t.replace(/\s*$/,"")+", "+o.replace(/^\s*/,"")+n}return e})}function y(e,n){switch(e.type){case t.Document:return n.implementation.createDocument(null,"",null);case t.DocumentType:return n.implementation.createDocumentType(e.name,e.publicId,e.systemId);case t.Element:var o=function(e){var t=p[e.tagName]?p[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e),r=void 0;for(var i in r=e.isSVG?n.createElementNS("http://www.w3.org/2000/svg",o):n.createElement(o),e.attributes)if(e.attributes.hasOwnProperty(i)&&!i.startsWith("rr_")){var a=e.attributes[i];a="boolean"==typeof a?"":a;var s="textarea"===o&&"value"===i,l="style"===o&&"_cssText"===i;if(l&&(a=v(a)),s||l){var c=n.createTextNode(a);r.appendChild(c);continue}if("iframe"===o&&"src"===i)continue;try{r.setAttribute(i,a)}catch(e){}}else e.attributes.rr_width&&(r.style.width=e.attributes.rr_width),e.attributes.rr_height&&(r.style.height=e.attributes.rr_height);return r;case t.Text:return n.createTextNode(e.isStyle?v(e.textContent):e.textContent);case t.CDATA:return n.createCDATASection(e.textContent);case t.Comment:return n.createComment(e.textContent);default:return null}}function g(e,n,o,r){void 0===r&&(r=!1);var i=y(e,n);if(!i)return null;if(e.type===t.Document&&(n.close(),n.open(),i=n),i.__sn=e,o[e.id]=i,(e.type===t.Document||e.type===t.Element)&&!r)for(var a=0,s=e.childNodes;a<s.length;a++){var l=s[a],c=g(l,n,o);c?i.appendChild(c):console.warn("Failed to rebuild",l)}return i}function b(e,t,n){void 0===n&&(n=document);var o={capture:!0,passive:!0};return n.addEventListener(e,t,o),function(){return n.removeEventListener(e,t,o)}}var w={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return w.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete w.map[t],e.childNodes&&e.childNodes.forEach(function(e){return w.removeNodeFromMap(e)})},has:function(e){return w.map.hasOwnProperty(e)}};function E(e,t,n){void 0===n&&(n={});var o=null,r=0;return function(){var i=Date.now();r||!1!==n.leading||(r=i);var a=t-(i-r),s=this,l=arguments;a<=0||a>t?(o&&(window.clearTimeout(o),o=null),r=i,e.apply(s,l)):o||!1===n.trailing||(o=window.setTimeout(function(){r=!1===n.leading?0:Date.now(),o=null,e.apply(s,l)},a))}}function N(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function S(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}var T,I,x,C,M="rr-block";function D(e){return!!e&&(e.nodeType===e.ELEMENT_NODE&&e.classList.contains(M)||D(e.parentNode))}function k(e){var t=[];return Object.keys(x).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(n){var o=n.toLowerCase(),r=function(t){return function(n){if(!D(n.target)){var o=w.getId(n.target),r=n.clientX,i=n.clientY;e({type:x[t],id:o,x:r,y:i})}}}(n);t.push(b(o,r))}),function(){t.forEach(function(e){return e()})}}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta"}(T||(T={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input"}(I||(I={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove=8]="TouchMove",e[e.TouchEnd=9]="TouchEnd"}(x||(x={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end"}(C||(C={}));var L=["INPUT","TEXTAREA","SELECT"],O=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],A="rr-ignore",F=new WeakMap;function R(e){function t(e){var t=e.target;if(t&&t.tagName&&!(L.indexOf(t.tagName)<0)&&!D(t)){var n=t.type;if("password"!==n&&!t.classList.contains(A)){var r=t.value,i=!1;"radio"!==n&&"checkbox"!==n||(i=t.checked),o(t,{text:r,isChecked:i});var a=t.name;"radio"===n&&a&&i&&document.querySelectorAll('input[type="radio"][name="'+a+'"]').forEach(function(e){e!==t&&o(e,{text:e.value,isChecked:!i})})}}}function o(t,o){var r=F.get(t);if(!r||r.text!==o.text||r.isChecked!==o.isChecked){F.set(t,o);var i=w.getId(t);e(n({},o,{id:i}))}}var r=["input","change"].map(function(e){return b(e,t)}),i=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");return i&&i.set&&r.push.apply(r,O.map(function(e){return function e(t,n,o){var r=Object.getOwnPropertyDescriptor(t,n);return Object.defineProperty(t,n,{set:function(e){var t=this;setTimeout(function(){o.set.call(t,e)},0),r&&r.set&&r.set.call(this,e)}}),function(){return e(t,n,r||{})}}(e[0],e[1],{set:function(){t({target:this})}})})),function(){r.forEach(function(e){return e()})}}function _(e){var t,n,o=(t=e.mutationCb,(n=new MutationObserver(function(e){var n=[],o=[],r=[],i=[],a=[],s=new Set,l=function(e){D(e)||(s.add(e),e.childNodes.forEach(function(e){return l(e)}))};e.forEach(function(e){var t=e.type,i=e.target,c=e.oldValue,u=e.addedNodes,d=e.removedNodes,f=e.attributeName;switch(t){case"characterData":var p=i.textContent;D(i)||p===c||n.push({value:p,node:i});break;case"attributes":if(p=i.getAttribute(f),D(i)||p===c)return;var h=o.find(function(e){return e.node===i});h||(h={node:i,attributes:{}},o.push(h)),h.attributes[f]=p;break;case"childList":u.forEach(function(e){return l(e)}),d.forEach(function(e){var t=w.getId(e),n=w.getId(i);D(e)||(s.has(e)?(s.delete(e),a.push(e)):s.has(i)&&-1===t||w.has(n)&&r.push({parentId:n,id:t}),w.removeNodeFromMap(e))})}});var c=function(e){var t=e.parentNode;return!!t&&(!!a.some(function(e){return e===t})||c(t))},u=function(e){var t=e.parentNode;if(!t)return!1;var n=w.getId(t);return!!r.some(function(e){return e.id===n})||u(t)};Array.from(s).forEach(function(e){c(e)||u(e)?a.push(e):i.push({parentId:w.getId(e.parentNode),previousId:e.previousSibling?w.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?w.getId(e.nextSibling):e.nextSibling,node:d(e,document,w.map,!0)})});var f={texts:n.map(function(e){return{id:w.getId(e.node),value:e.value}}).filter(function(e){return w.has(e.id)}),attributes:o.map(function(e){return{id:w.getId(e.node),attributes:e.attributes}}).filter(function(e){return w.has(e.id)}),removes:r,adds:i};(f.texts.length||f.attributes.length||f.removes.length||f.adds.length)&&t(f)})).observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n),r=function(e){var t,n=[],o=E(function(){var o=Date.now()-t;e(n.map(function(e){return e.timeOffset-=o,e})),n=[],t=null},500);return b("mousemove",E(function(e){var r=e.clientX,i=e.clientY,a=e.target;t||(t=Date.now()),n.push({x:r,y:i,id:w.getId(a),timeOffset:Date.now()-t}),o()},50,{trailing:!1}))}(e.mousemoveCb),i=k(e.mouseInteractionCb),a=function(e){return b("scroll",E(function(t){if(t.target&&!D(t.target)){var n=w.getId(t.target);if(t.target===document){var o=document.scrollingElement||document.documentElement;e({id:n,x:o.scrollLeft,y:o.scrollTop})}else e({id:n,x:t.target.scrollLeft,y:t.target.scrollTop})}},100))}(e.scrollCb),s=function(e){return b("resize",E(function(){var t=N(),n=S();e({width:Number(n),height:Number(t)})},200),window)}(e.viewportResizeCb),l=R(e.inputCb);return function(){o.disconnect(),r(),i(),a(),s(),l()}}function B(e){return n({},e,{timestamp:Date.now()})}function j(e){return e=e||Object.create(null),{on:function(t,n){(e[t]||(e[t]=[])).push(n)},off:function(t,n){e[t]&&e[t].splice(e[t].indexOf(n)>>>0,1)},emit:function(t,n){(e[t]||[]).slice().map(function(e){e(n)}),(e["*"]||[]).slice().map(function(e){e(t,n)})}}}var z=Object.freeze({default:j});var P,X=(function(e,t){!function(){e.exports={polyfill:function(){var e=window,t=document;if(!("scrollBehavior"in t.documentElement.style&&!0!==e.__forceSmoothScrollPolyfill__)){var n,o=e.HTMLElement||e.Element,r=468,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:o.prototype.scroll||l,scrollIntoView:o.prototype.scrollIntoView},a=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,s=(n=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==c(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):i.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]&&(c(arguments[0])?i.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)))},o.prototype.scroll=o.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==c(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");i.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)}},o.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.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))},o.prototype.scrollIntoView=function(){if(!0!==c(arguments[0])){var n=function(e){var n;do{n=(e=e.parentNode)===t.body}while(!1===n&&!1===f(e));return n=null,e}(this),o=n.getBoundingClientRect(),r=this.getBoundingClientRect();n!==t.body?(h.call(this,n,n.scrollLeft+r.left-o.left,n.scrollTop+r.top-o.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})):e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function l(e,t){this.scrollLeft=e,this.scrollTop=t}function c(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 u(e,t){return"Y"===t?e.clientHeight+s<e.scrollHeight:"X"===t?e.clientWidth+s<e.scrollWidth:void 0}function d(t,n){var o=e.getComputedStyle(t,null)["overflow"+n];return"auto"===o||"scroll"===o}function f(e){var t=u(e,"Y")&&d(e,"Y"),n=u(e,"X")&&d(e,"X");return t||n}function p(t){var n,o,i,s,l=(a()-t.startTime)/r;s=l=l>1?1:l,n=.5*(1-Math.cos(Math.PI*s)),o=t.startX+(t.x-t.startX)*n,i=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,o,i),o===t.x&&i===t.y||e.requestAnimationFrame(p.bind(e,t))}function h(n,o,r){var s,c,u,d,f=a();n===t.body?(s=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(s=n,c=n.scrollLeft,u=n.scrollTop,d=l),p({scrollable:s,method:d,startTime:f,startX:c,startY:u,x:o,y:r})}}}}()}(P={exports:{}},P.exports),P.exports).polyfill,Y=function(){function e(e,t){void 0===t&&(t=[]),this.timeOffset=0,this.actions=t,this.config=e}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){var t;(t=this.actions).push.apply(t,e)},e.prototype.start=function(){this.actions.sort(function(e,t){return e.delay-t.delay}),this.timeOffset=0;var e=performance.now(),t=this.actions,n=this.config,o=this;this.raf=requestAnimationFrame(function r(i){for(o.timeOffset+=(i-e)*n.speed,e=i;t.length;){var a=t[0];if(!(o.timeOffset>=a.delay))break;t.shift(),a.doAction()}t.length>0&&(o.raf=requestAnimationFrame(r))})},e.prototype.clear=function(){this.raf&&cancelAnimationFrame(this.raf),this.actions.length=0},e.prototype.findActionIndex=function(e){for(var t=0,n=this.actions.length-1;t<=n;){var o=Math.floor((t+n)/2);if(this.actions[o].delay<e.delay)t=o+1;else{if(!(this.actions[o].delay>e.delay))return o;n=o-1}}return t},e}(),H=["iframe, .rr-block { background: #ccc }","noscript { display: none !important; }"];X();var V=j||z,U=function(){function e(e,t){if(this.events=[],this.emitter=V(),this.baselineTime=0,this.noramlSpeed=-1,this.missingNodeRetryMap={},e.length<2)throw new Error("Replayer need at least 2 events.");this.events=e,this.handleResize=this.handleResize.bind(this);var n={speed:1,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0};this.config=Object.assign({},n,t),this.timer=new Y(this.config),this.setupDom(),this.emitter.on("resize",this.handleResize)}return e.prototype.on=function(e,t){this.emitter.on(e,t)},e.prototype.setConfig=function(e){var t=this;Object.keys(e).forEach(function(n){t.config[n]=e[n]}),this.config.skipInactive||(this.noramlSpeed=-1)},e.prototype.getMetaData=function(){var e=this.events[0];return{totalTime:this.events[this.events.length-1].timestamp-e.timestamp}},e.prototype.getTimeOffset=function(){return this.baselineTime-this.events[0].timestamp},e.prototype.play=function(e){void 0===e&&(e=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+e;for(var t=new Array,n=0,o=this.events;n<o.length;n++){var r=o[n],i=r.timestamp<this.baselineTime,a=this.getCastFn(r,i);i?a():t.push({doAction:a,delay:this.getDelay(r)})}this.timer.addActions(t),this.timer.start(),this.emitter.emit(C.Start)},e.prototype.pause=function(){this.timer.clear(),this.emitter.emit(C.Pause)},e.prototype.resume=function(e){void 0===e&&(e=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+e;for(var t=new Array,n=0,o=this.events;n<o.length;n++){var r=o[n];if(!(r.timestamp<=this.lastPlayedEvent.timestamp||r===this.lastPlayedEvent)){var i=this.getCastFn(r);t.push({doAction:i,delay:this.getDelay(r)})}}this.timer.addActions(t),this.timer.start(),this.emitter.emit(C.Resume)},e.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),this.iframe=document.createElement("iframe"),this.iframe.setAttribute("sandbox","allow-same-origin"),this.iframe.setAttribute("scrolling","no"),this.wrapper.appendChild(this.iframe)},e.prototype.handleResize=function(e){this.iframe.width=e.width+"px",this.iframe.height=e.height+"px"},e.prototype.getDelay=function(e){if(e.type===T.IncrementalSnapshot&&e.data.source===I.MouseMove){var t=e.data.positions[0].timeOffset,n=e.timestamp+t;return e.delay=n-this.baselineTime,n-this.baselineTime}return e.delay=e.timestamp-this.baselineTime,e.timestamp-this.baselineTime},e.prototype.getCastFn=function(e,t){var n,o=this;switch(void 0===t&&(t=!1),e.type){case T.DomContentLoaded:case T.Load:break;case T.Meta:n=function(){return o.emitter.emit(C.Resize,{width:e.data.width,height:e.data.height})};break;case T.FullSnapshot:n=function(){o.rebuildFullSnapshot(e),o.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case T.IncrementalSnapshot:n=function(){if(o.applyIncremental(e,t),e===o.nextUserInteractionEvent&&(o.nextUserInteractionEvent=null,o.restoreSpeed()),o.config.skipInactive&&!o.nextUserInteractionEvent){for(var n=0,r=o.events;n<r.length;n++){var i=r[n];if(!(i.timestamp<=e.timestamp)&&o.isUserInteraction(i)){i.delay-e.delay>1e4*o.config.speed&&(o.nextUserInteractionEvent=i);break}}if(o.nextUserInteractionEvent){o.noramlSpeed=o.config.speed;var a=o.nextUserInteractionEvent.delay-e.delay,s={speed:Math.min(Math.round(a/5e3),360)};o.setConfig(s),o.emitter.emit(C.SkipStart,s)}}}}return function(){n&&n(),o.lastPlayedEvent=e,e===o.events[o.events.length-1]&&(o.restoreSpeed(),o.emitter.emit(C.Finish))}},e.prototype.rebuildFullSnapshot=function(e){var t,n,o;Object.keys(this.missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.missingNodeRetryMap),this.missingNodeRetryMap={},w.map=(t=e.data.node,n=this.iframe.contentDocument,o={},[g(t,n,o),o])[1];var r=document.createElement("style"),i=this.iframe.contentDocument,a=i.documentElement,s=i.head;a.insertBefore(r,s);for(var l=0;l<H.length;l++)r.sheet.insertRule(H[l],l);this.emitter.emit(C.FullsnapshotRebuilded),this.waitForStylesheetLoad()},e.prototype.waitForStylesheetLoad=function(){var e=this,t=this.iframe.contentDocument.head;if(t){var n,o=new Set;t.querySelectorAll('link[rel="stylesheet"]').forEach(function(t){t.sheet||(0===o.size&&(e.pause(),e.emitter.emit(C.LoadStylesheetStart),n=window.setTimeout(function(){e.resume(),n=-1},e.config.loadTimeout)),o.add(t),t.addEventListener("load",function(){o.delete(t),0===o.size&&-1!==n&&(e.resume(),e.emitter.emit(C.LoadStylesheetEnd),n&&window.clearTimeout(n))}))})}},e.prototype.applyIncremental=function(e,t){var o=this,r=e.data;switch(r.source){case I.Mutation:r.removes.forEach(function(e){var t=w.getNode(e.id);if(!t)return o.warnNodeNotFound(r,e.id);var n=w.getNode(e.parentId);if(!n)return o.warnNodeNotFound(r,e.parentId);w.removeNodeFromMap(t),n&&n.removeChild(t)});var i=n({},this.missingNodeRetryMap);r.adds.forEach(function(e){var t=g(e.node,o.iframe.contentDocument,w.map,!0),n=w.getNode(e.parentId);if(!n)return o.warnNodeNotFound(r,e.parentId);var a=null,s=null;e.previousId&&(a=w.getNode(e.previousId)),e.nextId&&(s=w.getNode(e.nextId)),-1!==e.previousId&&-1!==e.nextId?(a&&a.nextSibling&&a.nextSibling.parentNode?n.insertBefore(t,a.nextSibling):s&&s.parentNode?n.insertBefore(t,s):n.appendChild(t),(e.previousId||e.nextId)&&o.resolveMissingNode(i,n,t,e)):i[e.node.id]={node:t,mutation:e}}),Object.keys(i).length&&Object.assign(this.missingNodeRetryMap,i),r.texts.forEach(function(e){var t=w.getNode(e.id);if(!t)return o.warnNodeNotFound(r,e.id);t.textContent=e.value}),r.attributes.forEach(function(e){var t=w.getNode(e.id);if(!t)return o.warnNodeNotFound(r,e.id);for(var n in e.attributes)if("string"==typeof n){var i=e.attributes[n];i?t.setAttribute(n,i):t.removeAttribute(n)}});break;case I.MouseMove:t||r.positions.forEach(function(t){var n={doAction:function(){o.moveAndHover(r,t.x,t.y,t.id)},delay:t.timeOffset+e.timestamp-o.baselineTime};o.timer.addAction(n)});break;case I.MouseInteraction:if(-1===r.id)break;var a=new Event(x[r.type].toLowerCase());if(!(s=w.getNode(r.id)))return this.warnNodeNotFound(r,r.id);switch(r.type){case x.Blur:s.blur&&s.blur();break;case x.Focus:s.focus&&s.focus({preventScroll:!0});break;case x.Click:t||(this.moveAndHover(r,r.x,r.y,r.id),this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:s.dispatchEvent(a)}break;case I.Scroll:if(-1===r.id)break;if(!(s=w.getNode(r.id)))return this.warnNodeNotFound(r,r.id);if(s===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:r.y,left:r.x,behavior:t?"auto":"smooth"});else try{s.scrollTop=r.y,s.scrollLeft=r.x}catch(e){}break;case I.ViewportResize:this.emitter.emit(C.Resize,{width:r.width,height:r.height});break;case I.Input:if(-1===r.id)break;var s;if(!(s=w.getNode(r.id)))return this.warnNodeNotFound(r,r.id);try{s.checked=r.isChecked,s.value=r.text}catch(e){}}},e.prototype.resolveMissingNode=function(e,t,n,o){var r=o.previousId,i=o.nextId,a=r&&e[r],s=i&&e[i];if(a){var l=a,c=l.node,u=l.mutation;t.insertBefore(c,n),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,c,u)}if(s){var d=s;c=d.node,u=d.mutation;t.insertBefore(c,n.nextSibling),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,c,u)}},e.prototype.moveAndHover=function(e,t,n,o){this.mouse.style.left=t+"px",this.mouse.style.top=n+"px";var r=w.getNode(o);if(!r)return this.warnNodeNotFound(e,o);this.hoverElements(r)},e.prototype.hoverElements=function(e){this.iframe.contentDocument.querySelectorAll(".\\:hover").forEach(function(e){e.classList.remove(":hover")});for(var t=e;t;)t.classList.add(":hover"),t=t.parentElement},e.prototype.isUserInteraction=function(e){return e.type===T.IncrementalSnapshot&&(e.data.source>I.Mutation&&e.data.source<=I.Input)},e.prototype.restoreSpeed=function(){if(-1!==this.noramlSpeed){var e={speed:this.noramlSpeed};this.setConfig(e),this.emitter.emit(C.SkipEnd,e),this.noramlSpeed=-1}},e.prototype.warnNodeNotFound=function(e,t){this.config.showWarning&&console.warn("[replayer]","Node with id '"+t+"' not found in",e)},e}();return e.record=function(e){void 0===e&&(e={});var t,o=e.emit,r=e.checkoutEveryNms,i=e.checkoutEveryNth;if(!o)throw new Error("emit function is required");var a=0,s=function(e,n){if(o(e,n),e.type===T.FullSnapshot)t=e,a=0;else if(e.type===T.IncrementalSnapshot){a++;var s=i&&a>=i,c=r&&e.timestamp-t.timestamp>r;(s||c)&&l(!0)}};function l(e){void 0===e&&(e=!1),s(B({type:T.Meta,data:{href:window.location.href,width:S(),height:N()}}),e);var t=f(document),n=t[0],o=t[1];if(!n)return console.warn("Failed to snapshot the document");w.map=o,s(B({type:T.FullSnapshot,data:{node:n,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}}))}try{var c=[];c.push(b("DOMContentLoaded",function(){s(B({type:T.DomContentLoaded,data:{}}))}));var u=function(){l(),c.push(_({mutationCb:function(e){return s(B({type:T.IncrementalSnapshot,data:n({source:I.Mutation},e)}))},mousemoveCb:function(e){return s(B({type:T.IncrementalSnapshot,data:{source:I.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return s(B({type:T.IncrementalSnapshot,data:n({source:I.MouseInteraction},e)}))},scrollCb:function(e){return s(B({type:T.IncrementalSnapshot,data:n({source:I.Scroll},e)}))},viewportResizeCb:function(e){return s(B({type:T.IncrementalSnapshot,data:n({source:I.ViewportResize},e)}))},inputCb:function(e){return s(B({type:T.IncrementalSnapshot,data:n({source:I.Input},e)}))}}))};return"interactive"===document.readyState||"complete"===document.readyState?u():c.push(b("load",function(){s(B({type:T.Load,data:{}})),u()},window)),function(){c.forEach(function(e){return e()})}}catch(e){console.warn(e)}},e.Replayer=U,e.mirror=w,e}({});
var rrweb=function(e){"use strict";var t,n=function(){return(n=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(t||(t={}));var o=1;var r=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,i=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,a=/^(data:)([\w\/\+]+);(charset=[\w-]+|base64).*,(.*)/gi;function s(e,t){return e.replace(r,function(e,n,o,r){var s,l=n||o||r;if(!l)return e;if(!i.test(l))return"url('"+l+"')";if(a.test(l))return"url("+l+")";if("/"===l[0])return"url('"+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+l)+"')";var c=t.split("/"),u=l.split("/");c.pop();for(var d=0,f=u;d<f.length;d++){var p=f[d];"."!==p&&(".."===p?c.pop():c.push(p))}return"url('"+c.join("/")+"')"})}function l(e,t){var n=e.createElement("a");return n.href=t,n.href}var c="rr-block";function u(e,n){switch(e.nodeType){case e.DOCUMENT_NODE:return{type:t.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:t.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId};case e.ELEMENT_NODE:for(var o=e.classList.contains(c),r=e.tagName.toLowerCase(),i={},a=0,u=Array.from(e.attributes);a<u.length;a++){var d=u[a],f=d.name,p=d.value;i[f]="src"===f||"href"===f?l(n,p):"style"===f?s(p,location.href):p}if("link"===r){var h=Array.from(n.styleSheets).find(function(t){return t.href===e.href}),m=function(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+t.cssText},""):null}catch(e){return null}}(h);m&&(i={_cssText:s(m,h.href)})}if("input"===r||"textarea"===r||"select"===r){p=e.value;"radio"!==i.type&&"checkbox"!==i.type&&p?i.value=p:e.checked&&(i.checked=e.checked)}if("option"===r){var v=e.parentElement;i.value===v.value&&(i.selected=e.selected)}if(o){var y=e.getBoundingClientRect(),g=y.width,b=y.height;i.rr_width=g+"px",i.rr_height=b+"px"}return{type:t.Element,tagName:r,attributes:i,childNodes:[],isSVG:(T=e,"svg"===T.tagName||T instanceof SVGElement||void 0),needBlock:o};case e.TEXT_NODE:var w=e.parentNode&&e.parentNode.tagName,N=e.textContent,E="STYLE"===w||void 0;return E&&N&&(N=s(N,location.href)),"SCRIPT"===w&&(N="SCRIPT_PLACEHOLDER"),{type:t.Text,textContent:N||"",isStyle:E};case e.CDATA_SECTION_NODE:return{type:t.CDATA,textContent:""};case e.COMMENT_NODE:return{type:t.Comment,textContent:e.textContent||""};default:return!1}var T}function d(e,n,r,i){void 0===i&&(i=!1);var a=u(e,n);if(!a)return console.warn(e,"not serialized"),null;var s=Object.assign(a,{id:o++});e.__sn=s,r[s.id]=e;var l=!i;if(s.type===t.Element&&(l=l&&!s.needBlock,delete s.needBlock),(s.type===t.Document||s.type===t.Element)&&l)for(var c=0,f=Array.from(e.childNodes);c<f.length;c++){var p=d(f[c],n,r);p&&s.childNodes.push(p)}return s}function f(e){o=1;var t={};return[d(e,e,t),t]}var p={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 h=/([^\r\n,{}]+)(,(?=[^}]*{)|\s*{)/g,m=/([^\\]):hover/g;function v(e){return e.replace(h,function(e,t,n){if(m.test(t)){var o=t.replace(m,"$1.\\:hover");return t.replace(/\s*$/,"")+", "+o.replace(/^\s*/,"")+n}return e})}function y(e,n){switch(e.type){case t.Document:return n.implementation.createDocument(null,"",null);case t.DocumentType:return n.implementation.createDocumentType(e.name,e.publicId,e.systemId);case t.Element:var o=function(e){var t=p[e.tagName]?p[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e),r=void 0;for(var i in r=e.isSVG?n.createElementNS("http://www.w3.org/2000/svg",o):n.createElement(o),e.attributes)if(e.attributes.hasOwnProperty(i)&&!i.startsWith("rr_")){var a=e.attributes[i];a="boolean"==typeof a?"":a;var s="textarea"===o&&"value"===i,l="style"===o&&"_cssText"===i;if(l&&(a=v(a)),s||l){var c=n.createTextNode(a);r.appendChild(c);continue}if("iframe"===o&&"src"===i)continue;try{r.setAttribute(i,a)}catch(e){}}else e.attributes.rr_width&&(r.style.width=e.attributes.rr_width),e.attributes.rr_height&&(r.style.height=e.attributes.rr_height);return r;case t.Text:return n.createTextNode(e.isStyle?v(e.textContent):e.textContent);case t.CDATA:return n.createCDATASection(e.textContent);case t.Comment:return n.createComment(e.textContent);default:return null}}function g(e,n,o,r){void 0===r&&(r=!1);var i=y(e,n);if(!i)return null;if(e.type===t.Document&&(n.close(),n.open(),i=n),i.__sn=e,o[e.id]=i,(e.type===t.Document||e.type===t.Element)&&!r)for(var a=0,s=e.childNodes;a<s.length;a++){var l=s[a],c=g(l,n,o);c?i.appendChild(c):console.warn("Failed to rebuild",l)}return i}function b(e,t,n){void 0===n&&(n=document);var o={capture:!0,passive:!0};return n.addEventListener(e,t,o),function(){return n.removeEventListener(e,t,o)}}var w={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return w.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete w.map[t],e.childNodes&&e.childNodes.forEach(function(e){return w.removeNodeFromMap(e)})},has:function(e){return w.map.hasOwnProperty(e)}};function N(e,t,n){void 0===n&&(n={});var o=null,r=0;return function(){var i=Date.now();r||!1!==n.leading||(r=i);var a=t-(i-r),s=this,l=arguments;a<=0||a>t?(o&&(window.clearTimeout(o),o=null),r=i,e.apply(s,l)):o||!1===n.trailing||(o=window.setTimeout(function(){r=!1===n.leading?0:Date.now(),o=null,e.apply(s,l)},a))}}function E(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function T(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}var S,I,x,C,M="rr-block";function D(e){return!!e&&(e.nodeType===e.ELEMENT_NODE&&e.classList.contains(M)||D(e.parentNode))}function k(e){var t=new MutationObserver(function(t){var n=[],o=[],r=[],i=[],a=new Set,s=new Set,l=function(e){D(e)||(a.add(e),s.delete(e),e.childNodes.forEach(function(e){return l(e)}))};t.forEach(function(e){var t=e.type,i=e.target,c=e.oldValue,u=e.addedNodes,d=e.removedNodes,f=e.attributeName;switch(t){case"characterData":var p=i.textContent;D(i)||p===c||n.push({value:p,node:i});break;case"attributes":p=i.getAttribute(f);if(D(i)||p===c)return;var h=o.find(function(e){return e.node===i});h||(h={node:i,attributes:{}},o.push(h)),h.attributes[f]=p;break;case"childList":u.forEach(function(e){return l(e)}),d.forEach(function(e){var t=w.getId(e),n=w.getId(i);D(e)||(a.has(e)?(!function e(t,n){t.delete(n),n.childNodes.forEach(function(n){return e(t,n)})}(a,e),s.add(e)):a.has(i)&&-1===t||function e(t){var n=w.getId(t);return!w.has(n)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||e(t.parentNode))}(i)||r.push({parentId:n,id:t}),w.removeNodeFromMap(e))})}}),Array.from(a).forEach(function(e){(function e(t,n){var o=n.parentNode;return!!o&&(!!t.has(o)||e(t,o))})(s,e)||function e(t,n){var o=n.parentNode;if(!o)return!1;var r=w.getId(o);return!!t.some(function(e){return e.id===r})||e(t,o)}(r,e)?s.add(e):i.push({parentId:w.getId(e.parentNode),previousId:e.previousSibling?w.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?w.getId(e.nextSibling):e.nextSibling,node:d(e,document,w.map,!0)})});var c={texts:n.map(function(e){return{id:w.getId(e.node),value:e.value}}).filter(function(e){return w.has(e.id)}),attributes:o.map(function(e){return{id:w.getId(e.node),attributes:e.attributes}}).filter(function(e){return w.has(e.id)}),removes:r,adds:i};(c.texts.length||c.attributes.length||c.removes.length||c.adds.length)&&e(c)});return t.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),t}function O(e){var t=[];return Object.keys(x).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(n){var o=n.toLowerCase(),r=function(t){return function(n){if(!D(n.target)){var o=w.getId(n.target),r=n.clientX,i=n.clientY;e({type:x[t],id:o,x:r,y:i})}}}(n);t.push(b(o,r))}),function(){t.forEach(function(e){return e()})}}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta"}(S||(S={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input"}(I||(I={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove=8]="TouchMove",e[e.TouchEnd=9]="TouchEnd"}(x||(x={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end"}(C||(C={}));var L=["INPUT","TEXTAREA","SELECT"],A=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],F="rr-ignore",R=new WeakMap;function _(e){function t(e){var t=e.target;if(t&&t.tagName&&!(L.indexOf(t.tagName)<0)&&!D(t)){var n=t.type;if("password"!==n&&!t.classList.contains(F)){var r=t.value,i=!1;"radio"!==n&&"checkbox"!==n||(i=t.checked),o(t,{text:r,isChecked:i});var a=t.name;"radio"===n&&a&&i&&document.querySelectorAll('input[type="radio"][name="'+a+'"]').forEach(function(e){e!==t&&o(e,{text:e.value,isChecked:!i})})}}}function o(t,o){var r=R.get(t);if(!r||r.text!==o.text||r.isChecked!==o.isChecked){R.set(t,o);var i=w.getId(t);e(n({},o,{id:i}))}}var r=["input","change"].map(function(e){return b(e,t)}),i=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");return i&&i.set&&r.push.apply(r,A.map(function(e){return function e(t,n,o){var r=Object.getOwnPropertyDescriptor(t,n);return Object.defineProperty(t,n,{set:function(e){var t=this;setTimeout(function(){o.set.call(t,e)},0),r&&r.set&&r.set.call(this,e)}}),function(){return e(t,n,r||{})}}(e[0],e[1],{set:function(){t({target:this})}})})),function(){r.forEach(function(e){return e()})}}function B(e){var t,n,o,r,i=k(e.mutationCb),a=(t=e.mousemoveCb,o=[],r=N(function(){var e=Date.now()-n;t(o.map(function(t){return t.timeOffset-=e,t})),o=[],n=null},500),b("mousemove",N(function(e){var t=e.clientX,i=e.clientY,a=e.target;n||(n=Date.now()),o.push({x:t,y:i,id:w.getId(a),timeOffset:Date.now()-n}),r()},50,{trailing:!1}))),s=O(e.mouseInteractionCb),l=function(e){return b("scroll",N(function(t){if(t.target&&!D(t.target)){var n=w.getId(t.target);if(t.target===document){var o=document.scrollingElement||document.documentElement;e({id:n,x:o.scrollLeft,y:o.scrollTop})}else e({id:n,x:t.target.scrollLeft,y:t.target.scrollTop})}},100))}(e.scrollCb),c=function(e){return b("resize",N(function(){var t=E(),n=T();e({width:Number(n),height:Number(t)})},200),window)}(e.viewportResizeCb),u=_(e.inputCb);return function(){i.disconnect(),a(),s(),l(),c(),u()}}function j(e){return n({},e,{timestamp:Date.now()})}function z(e){return e=e||Object.create(null),{on:function(t,n){(e[t]||(e[t]=[])).push(n)},off:function(t,n){e[t]&&e[t].splice(e[t].indexOf(n)>>>0,1)},emit:function(t,n){(e[t]||[]).slice().map(function(e){e(n)}),(e["*"]||[]).slice().map(function(e){e(t,n)})}}}var P=Object.freeze({default:z});var X,Y=(function(e,t){!function(){e.exports={polyfill:function(){var e=window,t=document;if(!("scrollBehavior"in t.documentElement.style&&!0!==e.__forceSmoothScrollPolyfill__)){var n,o=e.HTMLElement||e.Element,r=468,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:o.prototype.scroll||l,scrollIntoView:o.prototype.scrollIntoView},a=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,s=(n=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==c(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):i.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]&&(c(arguments[0])?i.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)))},o.prototype.scroll=o.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==c(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");i.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)}},o.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.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))},o.prototype.scrollIntoView=function(){if(!0!==c(arguments[0])){var n=function(e){var n;do{n=(e=e.parentNode)===t.body}while(!1===n&&!1===f(e));return n=null,e}(this),o=n.getBoundingClientRect(),r=this.getBoundingClientRect();n!==t.body?(h.call(this,n,n.scrollLeft+r.left-o.left,n.scrollTop+r.top-o.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})):e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function l(e,t){this.scrollLeft=e,this.scrollTop=t}function c(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 u(e,t){return"Y"===t?e.clientHeight+s<e.scrollHeight:"X"===t?e.clientWidth+s<e.scrollWidth:void 0}function d(t,n){var o=e.getComputedStyle(t,null)["overflow"+n];return"auto"===o||"scroll"===o}function f(e){var t=u(e,"Y")&&d(e,"Y"),n=u(e,"X")&&d(e,"X");return t||n}function p(t){var n,o,i,s,l=(a()-t.startTime)/r;s=l=l>1?1:l,n=.5*(1-Math.cos(Math.PI*s)),o=t.startX+(t.x-t.startX)*n,i=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,o,i),o===t.x&&i===t.y||e.requestAnimationFrame(p.bind(e,t))}function h(n,o,r){var s,c,u,d,f=a();n===t.body?(s=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(s=n,c=n.scrollLeft,u=n.scrollTop,d=l),p({scrollable:s,method:d,startTime:f,startX:c,startY:u,x:o,y:r})}}}}()}(X={exports:{}},X.exports),X.exports).polyfill,H=function(){function e(e,t){void 0===t&&(t=[]),this.timeOffset=0,this.actions=t,this.config=e}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){var t;(t=this.actions).push.apply(t,e)},e.prototype.start=function(){this.actions.sort(function(e,t){return e.delay-t.delay}),this.timeOffset=0;var e=performance.now(),t=this.actions,n=this.config,o=this;this.raf=requestAnimationFrame(function r(i){for(o.timeOffset+=(i-e)*n.speed,e=i;t.length;){var a=t[0];if(!(o.timeOffset>=a.delay))break;t.shift(),a.doAction()}t.length>0&&(o.raf=requestAnimationFrame(r))})},e.prototype.clear=function(){this.raf&&cancelAnimationFrame(this.raf),this.actions.length=0},e.prototype.findActionIndex=function(e){for(var t=0,n=this.actions.length-1;t<=n;){var o=Math.floor((t+n)/2);if(this.actions[o].delay<e.delay)t=o+1;else{if(!(this.actions[o].delay>e.delay))return o;n=o-1}}return t},e}(),V=["iframe, .rr-block { background: #ccc }","noscript { display: none !important; }"];Y();var U=z||P,W=function(){function e(e,t){if(this.events=[],this.emitter=U(),this.baselineTime=0,this.noramlSpeed=-1,this.missingNodeRetryMap={},e.length<2)throw new Error("Replayer need at least 2 events.");this.events=e,this.handleResize=this.handleResize.bind(this);var n={speed:1,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1};this.config=Object.assign({},n,t),this.timer=new H(this.config),this.setupDom(),this.emitter.on("resize",this.handleResize)}return e.prototype.on=function(e,t){this.emitter.on(e,t)},e.prototype.setConfig=function(e){var t=this;Object.keys(e).forEach(function(n){t.config[n]=e[n]}),this.config.skipInactive||(this.noramlSpeed=-1)},e.prototype.getMetaData=function(){var e=this.events[0];return{totalTime:this.events[this.events.length-1].timestamp-e.timestamp}},e.prototype.getTimeOffset=function(){return this.baselineTime-this.events[0].timestamp},e.prototype.play=function(e){void 0===e&&(e=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+e;for(var t=new Array,n=0,o=this.events;n<o.length;n++){var r=o[n],i=r.timestamp<this.baselineTime,a=this.getCastFn(r,i);i?a():t.push({doAction:a,delay:this.getDelay(r)})}this.timer.addActions(t),this.timer.start(),this.emitter.emit(C.Start)},e.prototype.pause=function(){this.timer.clear(),this.emitter.emit(C.Pause)},e.prototype.resume=function(e){void 0===e&&(e=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+e;for(var t=new Array,n=0,o=this.events;n<o.length;n++){var r=o[n];if(!(r.timestamp<=this.lastPlayedEvent.timestamp||r===this.lastPlayedEvent)){var i=this.getCastFn(r);t.push({doAction:i,delay:this.getDelay(r)})}}this.timer.addActions(t),this.timer.start(),this.emitter.emit(C.Resume)},e.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),this.iframe=document.createElement("iframe"),this.iframe.setAttribute("sandbox","allow-same-origin"),this.iframe.setAttribute("scrolling","no"),this.wrapper.appendChild(this.iframe)},e.prototype.handleResize=function(e){this.iframe.width=e.width+"px",this.iframe.height=e.height+"px"},e.prototype.getDelay=function(e){if(e.type===S.IncrementalSnapshot&&e.data.source===I.MouseMove){var t=e.data.positions[0].timeOffset,n=e.timestamp+t;return e.delay=n-this.baselineTime,n-this.baselineTime}return e.delay=e.timestamp-this.baselineTime,e.timestamp-this.baselineTime},e.prototype.getCastFn=function(e,t){var n,o=this;switch(void 0===t&&(t=!1),e.type){case S.DomContentLoaded:case S.Load:break;case S.Meta:n=function(){return o.emitter.emit(C.Resize,{width:e.data.width,height:e.data.height})};break;case S.FullSnapshot:n=function(){o.rebuildFullSnapshot(e),o.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case S.IncrementalSnapshot:n=function(){if(o.applyIncremental(e,t),e===o.nextUserInteractionEvent&&(o.nextUserInteractionEvent=null,o.restoreSpeed()),o.config.skipInactive&&!o.nextUserInteractionEvent){for(var n=0,r=o.events;n<r.length;n++){var i=r[n];if(!(i.timestamp<=e.timestamp)&&o.isUserInteraction(i)){i.delay-e.delay>1e4*o.config.speed&&(o.nextUserInteractionEvent=i);break}}if(o.nextUserInteractionEvent){o.noramlSpeed=o.config.speed;var a=o.nextUserInteractionEvent.delay-e.delay,s={speed:Math.min(Math.round(a/5e3),360)};o.setConfig(s),o.emitter.emit(C.SkipStart,s)}}}}return function(){n&&n(),o.lastPlayedEvent=e,e===o.events[o.events.length-1]&&(o.restoreSpeed(),o.emitter.emit(C.Finish))}},e.prototype.rebuildFullSnapshot=function(e){var t,n,o;Object.keys(this.missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.missingNodeRetryMap),this.missingNodeRetryMap={},w.map=(t=e.data.node,n=this.iframe.contentDocument,o={},[g(t,n,o),o])[1];var r=document.createElement("style"),i=this.iframe.contentDocument,a=i.documentElement,s=i.head;a.insertBefore(r,s);for(var l=0;l<V.length;l++)r.sheet.insertRule(V[l],l);this.emitter.emit(C.FullsnapshotRebuilded),this.waitForStylesheetLoad()},e.prototype.waitForStylesheetLoad=function(){var e=this,t=this.iframe.contentDocument.head;if(t){var n,o=new Set;t.querySelectorAll('link[rel="stylesheet"]').forEach(function(t){t.sheet||(0===o.size&&(e.pause(),e.emitter.emit(C.LoadStylesheetStart),n=window.setTimeout(function(){e.resume(),n=-1},e.config.loadTimeout)),o.add(t),t.addEventListener("load",function(){o.delete(t),0===o.size&&-1!==n&&(e.resume(),e.emitter.emit(C.LoadStylesheetEnd),n&&window.clearTimeout(n))}))})}},e.prototype.applyIncremental=function(e,t){var o=this,r=e.data;switch(r.source){case I.Mutation:r.removes.forEach(function(e){var t=w.getNode(e.id);if(!t)return o.warnNodeNotFound(r,e.id);var n=w.getNode(e.parentId);if(!n)return o.warnNodeNotFound(r,e.parentId);w.removeNodeFromMap(t),n&&n.removeChild(t)});var i=n({},this.missingNodeRetryMap);r.adds.forEach(function(e){var t=g(e.node,o.iframe.contentDocument,w.map,!0),n=w.getNode(e.parentId);if(!n)return o.warnNodeNotFound(r,e.parentId);var a=null,s=null;e.previousId&&(a=w.getNode(e.previousId)),e.nextId&&(s=w.getNode(e.nextId)),-1!==e.previousId&&-1!==e.nextId?(a&&a.nextSibling&&a.nextSibling.parentNode?n.insertBefore(t,a.nextSibling):s&&s.parentNode?n.insertBefore(t,s):n.appendChild(t),(e.previousId||e.nextId)&&o.resolveMissingNode(i,n,t,e)):i[e.node.id]={node:t,mutation:e}}),Object.keys(i).length&&Object.assign(this.missingNodeRetryMap,i),r.texts.forEach(function(e){var t=w.getNode(e.id);if(!t)return o.warnNodeNotFound(r,e.id);t.textContent=e.value}),r.attributes.forEach(function(e){var t=w.getNode(e.id);if(!t)return o.warnNodeNotFound(r,e.id);for(var n in e.attributes)if("string"==typeof n){var i=e.attributes[n];i?t.setAttribute(n,i):t.removeAttribute(n)}});break;case I.MouseMove:t||r.positions.forEach(function(t){var n={doAction:function(){o.moveAndHover(r,t.x,t.y,t.id)},delay:t.timeOffset+e.timestamp-o.baselineTime};o.timer.addAction(n)});break;case I.MouseInteraction:if(-1===r.id)break;var a=new Event(x[r.type].toLowerCase());if(!(s=w.getNode(r.id)))return this.debugNodeNotFound(r,r.id);switch(r.type){case x.Blur:s.blur&&s.blur();break;case x.Focus:s.focus&&s.focus({preventScroll:!0});break;case x.Click:t||(this.moveAndHover(r,r.x,r.y,r.id),this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:s.dispatchEvent(a)}break;case I.Scroll:if(-1===r.id)break;if(!(s=w.getNode(r.id)))return this.debugNodeNotFound(r,r.id);if(s===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:r.y,left:r.x,behavior:t?"auto":"smooth"});else try{s.scrollTop=r.y,s.scrollLeft=r.x}catch(e){}break;case I.ViewportResize:this.emitter.emit(C.Resize,{width:r.width,height:r.height});break;case I.Input:if(-1===r.id)break;var s;if(!(s=w.getNode(r.id)))return this.debugNodeNotFound(r,r.id);try{s.checked=r.isChecked,s.value=r.text}catch(e){}}},e.prototype.resolveMissingNode=function(e,t,n,o){var r=o.previousId,i=o.nextId,a=r&&e[r],s=i&&e[i];if(a){var l=a,c=l.node,u=l.mutation;t.insertBefore(c,n),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,c,u)}if(s){var d=s;c=d.node,u=d.mutation;t.insertBefore(c,n.nextSibling),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,c,u)}},e.prototype.moveAndHover=function(e,t,n,o){this.mouse.style.left=t+"px",this.mouse.style.top=n+"px";var r=w.getNode(o);if(!r)return this.debugNodeNotFound(e,o);this.hoverElements(r)},e.prototype.hoverElements=function(e){this.iframe.contentDocument.querySelectorAll(".\\:hover").forEach(function(e){e.classList.remove(":hover")});for(var t=e;t;)t.classList.add(":hover"),t=t.parentElement},e.prototype.isUserInteraction=function(e){return e.type===S.IncrementalSnapshot&&(e.data.source>I.Mutation&&e.data.source<=I.Input)},e.prototype.restoreSpeed=function(){if(-1!==this.noramlSpeed){var e={speed:this.noramlSpeed};this.setConfig(e),this.emitter.emit(C.SkipEnd,e),this.noramlSpeed=-1}},e.prototype.warnNodeNotFound=function(e,t){this.config.showWarning&&console.warn("[replayer]","Node with id '"+t+"' not found in",e)},e.prototype.debugNodeNotFound=function(e,t){this.config.showDebug&&console.log("[replayer]","Node with id '"+t+"' not found in",e)},e}();return e.record=function(e){void 0===e&&(e={});var t,o=e.emit,r=e.checkoutEveryNms,i=e.checkoutEveryNth;if(!o)throw new Error("emit function is required");var a=0,s=function(e,n){if(o(e,n),e.type===S.FullSnapshot)t=e,a=0;else if(e.type===S.IncrementalSnapshot){a++;var s=i&&a>=i,c=r&&e.timestamp-t.timestamp>r;(s||c)&&l(!0)}};function l(e){void 0===e&&(e=!1),s(j({type:S.Meta,data:{href:window.location.href,width:T(),height:E()}}),e);var t=f(document),n=t[0],o=t[1];if(!n)return console.warn("Failed to snapshot the document");w.map=o,s(j({type:S.FullSnapshot,data:{node:n,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}}))}try{var c=[];c.push(b("DOMContentLoaded",function(){s(j({type:S.DomContentLoaded,data:{}}))}));var u=function(){l(),c.push(B({mutationCb:function(e){return s(j({type:S.IncrementalSnapshot,data:n({source:I.Mutation},e)}))},mousemoveCb:function(e){return s(j({type:S.IncrementalSnapshot,data:{source:I.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return s(j({type:S.IncrementalSnapshot,data:n({source:I.MouseInteraction},e)}))},scrollCb:function(e){return s(j({type:S.IncrementalSnapshot,data:n({source:I.Scroll},e)}))},viewportResizeCb:function(e){return s(j({type:S.IncrementalSnapshot,data:n({source:I.ViewportResize},e)}))},inputCb:function(e){return s(j({type:S.IncrementalSnapshot,data:n({source:I.Input},e)}))}}))};return"interactive"===document.readyState||"complete"===document.readyState?u():c.push(b("load",function(){s(j({type:S.Load,data:{}})),u()},window)),function(){c.forEach(function(e){return e()})}}catch(e){console.warn(e)}},e.Replayer=W,e.mirror=w,e}({});
//# sourceMappingURL=rrweb.min.js.map

@@ -347,2 +347,16 @@ /*! *****************************************************************************

}
function isAncestorRemoved(target) {
var id = mirror.getId(target);
if (!mirror.has(id)) {
return true;
}
if (target.parentNode &&
target.parentNode.nodeType === target.DOCUMENT_NODE) {
return false;
}
if (!target.parentNode) {
return true;
}
return isAncestorRemoved(target.parentNode);
}

@@ -393,2 +407,28 @@ var EventType;

function deepDelete(addsSet, n) {
addsSet["delete"](n);
n.childNodes.forEach(function (childN) { return deepDelete(addsSet, childN); });
}
function isParentRemoved(removes, n) {
var parentNode = n.parentNode;
if (!parentNode) {
return false;
}
var parentId = mirror.getId(parentNode);
if (removes.some(function (r) { return r.id === parentId; })) {
return true;
}
return isParentRemoved(removes, parentNode);
}
function isParentDropped(droppedSet, n) {
var parentNode = n.parentNode;
if (!parentNode) {
return false;
}
if (droppedSet.has(parentNode)) {
return true;
}
return isParentDropped(droppedSet, parentNode);
}
function initMutationObserver(cb) {

@@ -400,4 +440,4 @@ var observer = new MutationObserver(function (mutations) {

var adds = [];
var dropped = [];
var addsSet = new Set();
var droppedSet = new Set();
var genAdds = function (n) {

@@ -408,2 +448,3 @@ if (isBlocked(n)) {

addsSet.add(n);
droppedSet["delete"](n);
n.childNodes.forEach(function (childN) { return genAdds(childN); });

@@ -449,7 +490,7 @@ };

if (addsSet.has(n)) {
addsSet["delete"](n);
dropped.push(n);
deepDelete(addsSet, n);
droppedSet.add(n);
}
else if (addsSet.has(target) && nodeId === -1) ;
else if (!mirror.has(parentId)) ;
else if (isAncestorRemoved(target)) ;
else {

@@ -469,25 +510,4 @@ removes.push({

});
var isDropped = function (n) {
var parentNode = n.parentNode;
if (!parentNode) {
return false;
}
if (dropped.some(function (d) { return d === parentNode; })) {
return true;
}
return isDropped(parentNode);
};
var isRemoved = function (n) {
var parentNode = n.parentNode;
if (!parentNode) {
return false;
}
var parentId = mirror.getId(parentNode);
if (removes.some(function (r) { return r.id === parentId; })) {
return true;
}
return isRemoved(parentNode);
};
Array.from(addsSet).forEach(function (n) {
if (!isDropped(n) && !isRemoved(n)) {
if (!isParentDropped(droppedSet, n) && !isParentRemoved(removes, n)) {
adds.push({

@@ -505,3 +525,3 @@ parentId: mirror.getId(n.parentNode),

else {
dropped.push(n);
droppedSet.add(n);
}

@@ -508,0 +528,0 @@ });

@@ -1,2 +0,2 @@

var NodeType,__assign=function(){return(__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};!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"}(NodeType||(NodeType={}));var _id=1;function genId(){return _id++}function resetId(){_id=1}function getCssRulesString(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+t.cssText},""):null}catch(e){return null}}function extractOrigin(e){return(e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0]).split("?")[0]}var URL_IN_CSS_REF=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,RELATIVE_PATH=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,DATA_URI=/^(data:)([\w\/\+]+);(charset=[\w-]+|base64).*,(.*)/gi;function absoluteToStylesheet(e,t){return e.replace(URL_IN_CSS_REF,function(e,n,r,o){var i=n||r||o;if(!i)return e;if(!RELATIVE_PATH.test(i))return"url('"+i+"')";if(DATA_URI.test(i))return"url("+i+")";if("/"===i[0])return"url('"+(extractOrigin(t)+i)+"')";var a=t.split("/"),u=i.split("/");a.pop();for(var c=0,s=u;c<s.length;c++){var l=s[c];"."!==l&&(".."===l?a.pop():a.push(l))}return"url('"+a.join("/")+"')"})}function absoluteToDoc(e,t){var n=e.createElement("a");return n.href=t,n.href}function isSVGElement(e){return"svg"===e.tagName||e instanceof SVGElement}var BLOCK_CLASS="rr-block";function serializeNode(e,t){switch(e.nodeType){case e.DOCUMENT_NODE:return{type:NodeType.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:NodeType.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId};case e.ELEMENT_NODE:for(var n=e.classList.contains(BLOCK_CLASS),r=e.tagName.toLowerCase(),o={},i=0,a=Array.from(e.attributes);i<a.length;i++){var u=a[i],c=u.name,s=u.value;o[c]="src"===c||"href"===c?absoluteToDoc(t,s):"style"===c?absoluteToStylesheet(s,location.href):s}if("link"===r){var l=Array.from(t.styleSheets).find(function(t){return t.href===e.href}),d=getCssRulesString(l);d&&(o={_cssText:absoluteToStylesheet(d,l.href)})}if("input"===r||"textarea"===r||"select"===r){s=e.value;"radio"!==o.type&&"checkbox"!==o.type&&s?o.value=s:e.checked&&(o.checked=e.checked)}if("option"===r){var p=e.parentElement;o.value===p.value&&(o.selected=e.selected)}if(n){var m=e.getBoundingClientRect(),f=m.width,v=m.height;o.rr_width=f+"px",o.rr_height=v+"px"}return{type:NodeType.Element,tagName:r,attributes:o,childNodes:[],isSVG:isSVGElement(e)||void 0,needBlock:n};case e.TEXT_NODE:var h=e.parentNode&&e.parentNode.tagName,y=e.textContent,E="STYLE"===h||void 0;return E&&y&&(y=absoluteToStylesheet(y,location.href)),"SCRIPT"===h&&(y="SCRIPT_PLACEHOLDER"),{type:NodeType.Text,textContent:y||"",isStyle:E};case e.CDATA_SECTION_NODE:return{type:NodeType.CDATA,textContent:""};case e.COMMENT_NODE:return{type:NodeType.Comment,textContent:e.textContent||""};default:return!1}}function serializeNodeWithId(e,t,n,r){void 0===r&&(r=!1);var o=serializeNode(e,t);if(!o)return console.warn(e,"not serialized"),null;var i=Object.assign(o,{id:genId()});e.__sn=i,n[i.id]=e;var a=!r;if(i.type===NodeType.Element&&(a=a&&!i.needBlock,delete i.needBlock),(i.type===NodeType.Document||i.type===NodeType.Element)&&a)for(var u=0,c=Array.from(e.childNodes);u<c.length;u++){var s=serializeNodeWithId(c[u],t,n);s&&i.childNodes.push(s)}return i}function snapshot(e){resetId();var t={};return[serializeNodeWithId(e,e,t),t]}function on(e,t,n){void 0===n&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}var mirror={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return mirror.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete mirror.map[t],e.childNodes&&e.childNodes.forEach(function(e){return mirror.removeNodeFromMap(e)})},has:function(e){return mirror.map.hasOwnProperty(e)}};function throttle(e,t,n){void 0===n&&(n={});var r=null,o=0;return function(){var i=Date.now();o||!1!==n.leading||(o=i);var a=t-(i-o),u=this,c=arguments;a<=0||a>t?(r&&(window.clearTimeout(r),r=null),o=i,e.apply(u,c)):r||!1===n.trailing||(r=window.setTimeout(function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(u,c)},a))}}function hookSetter(e,t,n){var r=Object.getOwnPropertyDescriptor(e,t);return Object.defineProperty(e,t,{set:function(e){var t=this;setTimeout(function(){n.set.call(t,e)},0),r&&r.set&&r.set.call(this,e)}}),function(){return hookSetter(e,t,r||{})}}function getWindowHeight(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function getWindowWidth(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}var EventType,IncrementalSource,MouseInteractions,ReplayerEvents,BLOCK_CLASS$1="rr-block";function isBlocked(e){return!!e&&(e.nodeType===e.ELEMENT_NODE&&e.classList.contains(BLOCK_CLASS$1)||isBlocked(e.parentNode))}function initMutationObserver(e){var t=new MutationObserver(function(t){var n=[],r=[],o=[],i=[],a=[],u=new Set,c=function(e){isBlocked(e)||(u.add(e),e.childNodes.forEach(function(e){return c(e)}))};t.forEach(function(e){var t=e.type,i=e.target,s=e.oldValue,l=e.addedNodes,d=e.removedNodes,p=e.attributeName;switch(t){case"characterData":var m=i.textContent;isBlocked(i)||m===s||n.push({value:m,node:i});break;case"attributes":m=i.getAttribute(p);if(isBlocked(i)||m===s)return;var f=r.find(function(e){return e.node===i});f||(f={node:i,attributes:{}},r.push(f)),f.attributes[p]=m;break;case"childList":l.forEach(function(e){return c(e)}),d.forEach(function(e){var t=mirror.getId(e),n=mirror.getId(i);isBlocked(e)||(u.has(e)?(u.delete(e),a.push(e)):u.has(i)&&-1===t||mirror.has(n)&&o.push({parentId:n,id:t}),mirror.removeNodeFromMap(e))})}});var s=function(e){var t=e.parentNode;return!!t&&(!!a.some(function(e){return e===t})||s(t))},l=function(e){var t=e.parentNode;if(!t)return!1;var n=mirror.getId(t);return!!o.some(function(e){return e.id===n})||l(t)};Array.from(u).forEach(function(e){s(e)||l(e)?a.push(e):i.push({parentId:mirror.getId(e.parentNode),previousId:e.previousSibling?mirror.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?mirror.getId(e.nextSibling):e.nextSibling,node:serializeNodeWithId(e,document,mirror.map,!0)})});var d={texts:n.map(function(e){return{id:mirror.getId(e.node),value:e.value}}).filter(function(e){return mirror.has(e.id)}),attributes:r.map(function(e){return{id:mirror.getId(e.node),attributes:e.attributes}}).filter(function(e){return mirror.has(e.id)}),removes:o,adds:i};(d.texts.length||d.attributes.length||d.removes.length||d.adds.length)&&e(d)});return t.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),t}function initMousemoveObserver(e){var t,n=[],r=throttle(function(){var r=Date.now()-t;e(n.map(function(e){return e.timeOffset-=r,e})),n=[],t=null},500);return on("mousemove",throttle(function(e){var o=e.clientX,i=e.clientY,a=e.target;t||(t=Date.now()),n.push({x:o,y:i,id:mirror.getId(a),timeOffset:Date.now()-t}),r()},50,{trailing:!1}))}function initMouseInteractionObserver(e){var t=[];return Object.keys(MouseInteractions).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(n){var r=n.toLowerCase(),o=function(t){return function(n){if(!isBlocked(n.target)){var r=mirror.getId(n.target),o=n.clientX,i=n.clientY;e({type:MouseInteractions[t],id:r,x:o,y:i})}}}(n);t.push(on(r,o))}),function(){t.forEach(function(e){return e()})}}function initScrollObserver(e){return on("scroll",throttle(function(t){if(t.target&&!isBlocked(t.target)){var n=mirror.getId(t.target);if(t.target===document){var r=document.scrollingElement||document.documentElement;e({id:n,x:r.scrollLeft,y:r.scrollTop})}else e({id:n,x:t.target.scrollLeft,y:t.target.scrollTop})}},100))}function initViewportResizeObserver(e){return on("resize",throttle(function(){var t=getWindowHeight(),n=getWindowWidth();e({width:Number(n),height:Number(t)})},200),window)}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta"}(EventType||(EventType={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input"}(IncrementalSource||(IncrementalSource={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove=8]="TouchMove",e[e.TouchEnd=9]="TouchEnd"}(MouseInteractions||(MouseInteractions={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end"}(ReplayerEvents||(ReplayerEvents={}));var INPUT_TAGS=["INPUT","TEXTAREA","SELECT"],HOOK_PROPERTIES=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],IGNORE_CLASS="rr-ignore",lastInputValueMap=new WeakMap;function initInputObserver(e){function t(e){var t=e.target;if(t&&t.tagName&&!(INPUT_TAGS.indexOf(t.tagName)<0)&&!isBlocked(t)){var r=t.type;if("password"!==r&&!t.classList.contains(IGNORE_CLASS)){var o=t.value,i=!1;"radio"!==r&&"checkbox"!==r||(i=t.checked),n(t,{text:o,isChecked:i});var a=t.name;"radio"===r&&a&&i&&document.querySelectorAll('input[type="radio"][name="'+a+'"]').forEach(function(e){e!==t&&n(e,{text:e.value,isChecked:!i})})}}}function n(t,n){var r=lastInputValueMap.get(t);if(!r||r.text!==n.text||r.isChecked!==n.isChecked){lastInputValueMap.set(t,n);var o=mirror.getId(t);e(__assign({},n,{id:o}))}}var r=["input","change"].map(function(e){return on(e,t)}),o=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");return o&&o.set&&r.push.apply(r,HOOK_PROPERTIES.map(function(e){return hookSetter(e[0],e[1],{set:function(){t({target:this})}})})),function(){r.forEach(function(e){return e()})}}function initObservers(e){var t=initMutationObserver(e.mutationCb),n=initMousemoveObserver(e.mousemoveCb),r=initMouseInteractionObserver(e.mouseInteractionCb),o=initScrollObserver(e.scrollCb),i=initViewportResizeObserver(e.viewportResizeCb),a=initInputObserver(e.inputCb);return function(){t.disconnect(),n(),r(),o(),i(),a()}}function wrapEvent(e){return __assign({},e,{timestamp:Date.now()})}function record(e){void 0===e&&(e={});var t,n=e.emit,r=e.checkoutEveryNms,o=e.checkoutEveryNth;if(!n)throw new Error("emit function is required");var i=0,a=function(e,a){if(n(e,a),e.type===EventType.FullSnapshot)t=e,i=0;else if(e.type===EventType.IncrementalSnapshot){i++;var c=o&&i>=o,s=r&&e.timestamp-t.timestamp>r;(c||s)&&u(!0)}};function u(e){void 0===e&&(e=!1),a(wrapEvent({type:EventType.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}),e);var t=snapshot(document),n=t[0],r=t[1];if(!n)return console.warn("Failed to snapshot the document");mirror.map=r,a(wrapEvent({type:EventType.FullSnapshot,data:{node:n,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}}))}try{var c=[];c.push(on("DOMContentLoaded",function(){a(wrapEvent({type:EventType.DomContentLoaded,data:{}}))}));var s=function(){u(),c.push(initObservers({mutationCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Mutation},e)}))},mousemoveCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:{source:IncrementalSource.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.MouseInteraction},e)}))},scrollCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Scroll},e)}))},viewportResizeCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.ViewportResize},e)}))},inputCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Input},e)}))}}))};return"interactive"===document.readyState||"complete"===document.readyState?s():c.push(on("load",function(){a(wrapEvent({type:EventType.Load,data:{}})),s()},window)),function(){c.forEach(function(e){return e()})}}catch(e){console.warn(e)}}export default record;
var NodeType,__assign=function(){return(__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};!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"}(NodeType||(NodeType={}));var _id=1;function genId(){return _id++}function resetId(){_id=1}function getCssRulesString(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+t.cssText},""):null}catch(e){return null}}function extractOrigin(e){return(e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0]).split("?")[0]}var URL_IN_CSS_REF=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,RELATIVE_PATH=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,DATA_URI=/^(data:)([\w\/\+]+);(charset=[\w-]+|base64).*,(.*)/gi;function absoluteToStylesheet(e,t){return e.replace(URL_IN_CSS_REF,function(e,n,r,o){var i=n||r||o;if(!i)return e;if(!RELATIVE_PATH.test(i))return"url('"+i+"')";if(DATA_URI.test(i))return"url("+i+")";if("/"===i[0])return"url('"+(extractOrigin(t)+i)+"')";var a=t.split("/"),u=i.split("/");a.pop();for(var s=0,c=u;s<c.length;s++){var d=c[s];"."!==d&&(".."===d?a.pop():a.push(d))}return"url('"+a.join("/")+"')"})}function absoluteToDoc(e,t){var n=e.createElement("a");return n.href=t,n.href}function isSVGElement(e){return"svg"===e.tagName||e instanceof SVGElement}var BLOCK_CLASS="rr-block";function serializeNode(e,t){switch(e.nodeType){case e.DOCUMENT_NODE:return{type:NodeType.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:NodeType.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId};case e.ELEMENT_NODE:for(var n=e.classList.contains(BLOCK_CLASS),r=e.tagName.toLowerCase(),o={},i=0,a=Array.from(e.attributes);i<a.length;i++){var u=a[i],s=u.name,c=u.value;o[s]="src"===s||"href"===s?absoluteToDoc(t,c):"style"===s?absoluteToStylesheet(c,location.href):c}if("link"===r){var d=Array.from(t.styleSheets).find(function(t){return t.href===e.href}),l=getCssRulesString(d);l&&(o={_cssText:absoluteToStylesheet(l,d.href)})}if("input"===r||"textarea"===r||"select"===r){c=e.value;"radio"!==o.type&&"checkbox"!==o.type&&c?o.value=c:e.checked&&(o.checked=e.checked)}if("option"===r){var p=e.parentElement;o.value===p.value&&(o.selected=e.selected)}if(n){var m=e.getBoundingClientRect(),f=m.width,v=m.height;o.rr_width=f+"px",o.rr_height=v+"px"}return{type:NodeType.Element,tagName:r,attributes:o,childNodes:[],isSVG:isSVGElement(e)||void 0,needBlock:n};case e.TEXT_NODE:var h=e.parentNode&&e.parentNode.tagName,E=e.textContent,y="STYLE"===h||void 0;return y&&E&&(E=absoluteToStylesheet(E,location.href)),"SCRIPT"===h&&(E="SCRIPT_PLACEHOLDER"),{type:NodeType.Text,textContent:E||"",isStyle:y};case e.CDATA_SECTION_NODE:return{type:NodeType.CDATA,textContent:""};case e.COMMENT_NODE:return{type:NodeType.Comment,textContent:e.textContent||""};default:return!1}}function serializeNodeWithId(e,t,n,r){void 0===r&&(r=!1);var o=serializeNode(e,t);if(!o)return console.warn(e,"not serialized"),null;var i=Object.assign(o,{id:genId()});e.__sn=i,n[i.id]=e;var a=!r;if(i.type===NodeType.Element&&(a=a&&!i.needBlock,delete i.needBlock),(i.type===NodeType.Document||i.type===NodeType.Element)&&a)for(var u=0,s=Array.from(e.childNodes);u<s.length;u++){var c=serializeNodeWithId(s[u],t,n);c&&i.childNodes.push(c)}return i}function snapshot(e){resetId();var t={};return[serializeNodeWithId(e,e,t),t]}function on(e,t,n){void 0===n&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}var mirror={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return mirror.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete mirror.map[t],e.childNodes&&e.childNodes.forEach(function(e){return mirror.removeNodeFromMap(e)})},has:function(e){return mirror.map.hasOwnProperty(e)}};function throttle(e,t,n){void 0===n&&(n={});var r=null,o=0;return function(){var i=Date.now();o||!1!==n.leading||(o=i);var a=t-(i-o),u=this,s=arguments;a<=0||a>t?(r&&(window.clearTimeout(r),r=null),o=i,e.apply(u,s)):r||!1===n.trailing||(r=window.setTimeout(function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(u,s)},a))}}function hookSetter(e,t,n){var r=Object.getOwnPropertyDescriptor(e,t);return Object.defineProperty(e,t,{set:function(e){var t=this;setTimeout(function(){n.set.call(t,e)},0),r&&r.set&&r.set.call(this,e)}}),function(){return hookSetter(e,t,r||{})}}function getWindowHeight(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function getWindowWidth(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}var EventType,IncrementalSource,MouseInteractions,ReplayerEvents,BLOCK_CLASS$1="rr-block";function isBlocked(e){return!!e&&(e.nodeType===e.ELEMENT_NODE&&e.classList.contains(BLOCK_CLASS$1)||isBlocked(e.parentNode))}function isAncestorRemoved(e){var t=mirror.getId(e);return!mirror.has(t)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||isAncestorRemoved(e.parentNode))}function deepDelete(e,t){e.delete(t),t.childNodes.forEach(function(t){return deepDelete(e,t)})}function isParentRemoved(e,t){var n=t.parentNode;if(!n)return!1;var r=mirror.getId(n);return!!e.some(function(e){return e.id===r})||isParentRemoved(e,n)}function isParentDropped(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||isParentDropped(e,n))}function initMutationObserver(e){var t=new MutationObserver(function(t){var n=[],r=[],o=[],i=[],a=new Set,u=new Set,s=function(e){isBlocked(e)||(a.add(e),u.delete(e),e.childNodes.forEach(function(e){return s(e)}))};t.forEach(function(e){var t=e.type,i=e.target,c=e.oldValue,d=e.addedNodes,l=e.removedNodes,p=e.attributeName;switch(t){case"characterData":var m=i.textContent;isBlocked(i)||m===c||n.push({value:m,node:i});break;case"attributes":m=i.getAttribute(p);if(isBlocked(i)||m===c)return;var f=r.find(function(e){return e.node===i});f||(f={node:i,attributes:{}},r.push(f)),f.attributes[p]=m;break;case"childList":d.forEach(function(e){return s(e)}),l.forEach(function(e){var t=mirror.getId(e),n=mirror.getId(i);isBlocked(e)||(a.has(e)?(deepDelete(a,e),u.add(e)):a.has(i)&&-1===t||isAncestorRemoved(i)||o.push({parentId:n,id:t}),mirror.removeNodeFromMap(e))})}}),Array.from(a).forEach(function(e){isParentDropped(u,e)||isParentRemoved(o,e)?u.add(e):i.push({parentId:mirror.getId(e.parentNode),previousId:e.previousSibling?mirror.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?mirror.getId(e.nextSibling):e.nextSibling,node:serializeNodeWithId(e,document,mirror.map,!0)})});var c={texts:n.map(function(e){return{id:mirror.getId(e.node),value:e.value}}).filter(function(e){return mirror.has(e.id)}),attributes:r.map(function(e){return{id:mirror.getId(e.node),attributes:e.attributes}}).filter(function(e){return mirror.has(e.id)}),removes:o,adds:i};(c.texts.length||c.attributes.length||c.removes.length||c.adds.length)&&e(c)});return t.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),t}function initMousemoveObserver(e){var t,n=[],r=throttle(function(){var r=Date.now()-t;e(n.map(function(e){return e.timeOffset-=r,e})),n=[],t=null},500);return on("mousemove",throttle(function(e){var o=e.clientX,i=e.clientY,a=e.target;t||(t=Date.now()),n.push({x:o,y:i,id:mirror.getId(a),timeOffset:Date.now()-t}),r()},50,{trailing:!1}))}function initMouseInteractionObserver(e){var t=[];return Object.keys(MouseInteractions).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(n){var r=n.toLowerCase(),o=function(t){return function(n){if(!isBlocked(n.target)){var r=mirror.getId(n.target),o=n.clientX,i=n.clientY;e({type:MouseInteractions[t],id:r,x:o,y:i})}}}(n);t.push(on(r,o))}),function(){t.forEach(function(e){return e()})}}function initScrollObserver(e){return on("scroll",throttle(function(t){if(t.target&&!isBlocked(t.target)){var n=mirror.getId(t.target);if(t.target===document){var r=document.scrollingElement||document.documentElement;e({id:n,x:r.scrollLeft,y:r.scrollTop})}else e({id:n,x:t.target.scrollLeft,y:t.target.scrollTop})}},100))}function initViewportResizeObserver(e){return on("resize",throttle(function(){var t=getWindowHeight(),n=getWindowWidth();e({width:Number(n),height:Number(t)})},200),window)}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta"}(EventType||(EventType={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input"}(IncrementalSource||(IncrementalSource={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove=8]="TouchMove",e[e.TouchEnd=9]="TouchEnd"}(MouseInteractions||(MouseInteractions={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end"}(ReplayerEvents||(ReplayerEvents={}));var INPUT_TAGS=["INPUT","TEXTAREA","SELECT"],HOOK_PROPERTIES=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],IGNORE_CLASS="rr-ignore",lastInputValueMap=new WeakMap;function initInputObserver(e){function t(e){var t=e.target;if(t&&t.tagName&&!(INPUT_TAGS.indexOf(t.tagName)<0)&&!isBlocked(t)){var r=t.type;if("password"!==r&&!t.classList.contains(IGNORE_CLASS)){var o=t.value,i=!1;"radio"!==r&&"checkbox"!==r||(i=t.checked),n(t,{text:o,isChecked:i});var a=t.name;"radio"===r&&a&&i&&document.querySelectorAll('input[type="radio"][name="'+a+'"]').forEach(function(e){e!==t&&n(e,{text:e.value,isChecked:!i})})}}}function n(t,n){var r=lastInputValueMap.get(t);if(!r||r.text!==n.text||r.isChecked!==n.isChecked){lastInputValueMap.set(t,n);var o=mirror.getId(t);e(__assign({},n,{id:o}))}}var r=["input","change"].map(function(e){return on(e,t)}),o=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");return o&&o.set&&r.push.apply(r,HOOK_PROPERTIES.map(function(e){return hookSetter(e[0],e[1],{set:function(){t({target:this})}})})),function(){r.forEach(function(e){return e()})}}function initObservers(e){var t=initMutationObserver(e.mutationCb),n=initMousemoveObserver(e.mousemoveCb),r=initMouseInteractionObserver(e.mouseInteractionCb),o=initScrollObserver(e.scrollCb),i=initViewportResizeObserver(e.viewportResizeCb),a=initInputObserver(e.inputCb);return function(){t.disconnect(),n(),r(),o(),i(),a()}}function wrapEvent(e){return __assign({},e,{timestamp:Date.now()})}function record(e){void 0===e&&(e={});var t,n=e.emit,r=e.checkoutEveryNms,o=e.checkoutEveryNth;if(!n)throw new Error("emit function is required");var i=0,a=function(e,a){if(n(e,a),e.type===EventType.FullSnapshot)t=e,i=0;else if(e.type===EventType.IncrementalSnapshot){i++;var s=o&&i>=o,c=r&&e.timestamp-t.timestamp>r;(s||c)&&u(!0)}};function u(e){void 0===e&&(e=!1),a(wrapEvent({type:EventType.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}),e);var t=snapshot(document),n=t[0],r=t[1];if(!n)return console.warn("Failed to snapshot the document");mirror.map=r,a(wrapEvent({type:EventType.FullSnapshot,data:{node:n,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}}))}try{var s=[];s.push(on("DOMContentLoaded",function(){a(wrapEvent({type:EventType.DomContentLoaded,data:{}}))}));var c=function(){u(),s.push(initObservers({mutationCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Mutation},e)}))},mousemoveCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:{source:IncrementalSource.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.MouseInteraction},e)}))},scrollCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Scroll},e)}))},viewportResizeCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.ViewportResize},e)}))},inputCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Input},e)}))}}))};return"interactive"===document.readyState||"complete"===document.readyState?c():s.push(on("load",function(){a(wrapEvent({type:EventType.Load,data:{}})),c()},window)),function(){s.forEach(function(e){return e()})}}catch(e){console.warn(e)}}export default record;
//# sourceMappingURL=rrweb-record.min.js.map

@@ -1,2 +0,2 @@

var NodeType,__assign=function(){return(__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};!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"}(NodeType||(NodeType={}));var _id=1;function genId(){return _id++}function resetId(){_id=1}function getCssRulesString(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+t.cssText},""):null}catch(e){return null}}function extractOrigin(e){return(e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0]).split("?")[0]}var URL_IN_CSS_REF=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,RELATIVE_PATH=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,DATA_URI=/^(data:)([\w\/\+]+);(charset=[\w-]+|base64).*,(.*)/gi;function absoluteToStylesheet(e,t){return e.replace(URL_IN_CSS_REF,function(e,n,r,o){var i=n||r||o;if(!i)return e;if(!RELATIVE_PATH.test(i))return"url('"+i+"')";if(DATA_URI.test(i))return"url("+i+")";if("/"===i[0])return"url('"+(extractOrigin(t)+i)+"')";var a=t.split("/"),s=i.split("/");a.pop();for(var l=0,c=s;l<c.length;l++){var u=c[l];"."!==u&&(".."===u?a.pop():a.push(u))}return"url('"+a.join("/")+"')"})}function absoluteToDoc(e,t){var n=e.createElement("a");return n.href=t,n.href}function isSVGElement(e){return"svg"===e.tagName||e instanceof SVGElement}var BLOCK_CLASS="rr-block";function serializeNode(e,t){switch(e.nodeType){case e.DOCUMENT_NODE:return{type:NodeType.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:NodeType.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId};case e.ELEMENT_NODE:for(var n=e.classList.contains(BLOCK_CLASS),r=e.tagName.toLowerCase(),o={},i=0,a=Array.from(e.attributes);i<a.length;i++){var s=a[i],l=s.name,c=s.value;o[l]="src"===l||"href"===l?absoluteToDoc(t,c):"style"===l?absoluteToStylesheet(c,location.href):c}if("link"===r){var u=Array.from(t.styleSheets).find(function(t){return t.href===e.href}),d=getCssRulesString(u);d&&(o={_cssText:absoluteToStylesheet(d,u.href)})}if("input"===r||"textarea"===r||"select"===r){c=e.value;"radio"!==o.type&&"checkbox"!==o.type&&c?o.value=c:e.checked&&(o.checked=e.checked)}if("option"===r){var p=e.parentElement;o.value===p.value&&(o.selected=e.selected)}if(n){var f=e.getBoundingClientRect(),m=f.width,h=f.height;o.rr_width=m+"px",o.rr_height=h+"px"}return{type:NodeType.Element,tagName:r,attributes:o,childNodes:[],isSVG:isSVGElement(e)||void 0,needBlock:n};case e.TEXT_NODE:var v=e.parentNode&&e.parentNode.tagName,y=e.textContent,g="STYLE"===v||void 0;return g&&y&&(y=absoluteToStylesheet(y,location.href)),"SCRIPT"===v&&(y="SCRIPT_PLACEHOLDER"),{type:NodeType.Text,textContent:y||"",isStyle:g};case e.CDATA_SECTION_NODE:return{type:NodeType.CDATA,textContent:""};case e.COMMENT_NODE:return{type:NodeType.Comment,textContent:e.textContent||""};default:return!1}}function serializeNodeWithId(e,t,n,r){void 0===r&&(r=!1);var o=serializeNode(e,t);if(!o)return console.warn(e,"not serialized"),null;var i=Object.assign(o,{id:genId()});e.__sn=i,n[i.id]=e;var a=!r;if(i.type===NodeType.Element&&(a=a&&!i.needBlock,delete i.needBlock),(i.type===NodeType.Document||i.type===NodeType.Element)&&a)for(var s=0,l=Array.from(e.childNodes);s<l.length;s++){var c=serializeNodeWithId(l[s],t,n);c&&i.childNodes.push(c)}return i}function snapshot(e){resetId();var t={};return[serializeNodeWithId(e,e,t),t]}var tagMap={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function getTagName(e){var t=tagMap[e.tagName]?tagMap[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}var CSS_SELECTOR=/([^\r\n,{}]+)(,(?=[^}]*{)|\s*{)/g,HOVER_SELECTOR=/([^\\]):hover/g;function addHoverClass(e){return e.replace(CSS_SELECTOR,function(e,t,n){if(HOVER_SELECTOR.test(t)){var r=t.replace(HOVER_SELECTOR,"$1.\\:hover");return t.replace(/\s*$/,"")+", "+r.replace(/^\s*/,"")+n}return e})}function buildNode(e,t){switch(e.type){case NodeType.Document:return t.implementation.createDocument(null,"",null);case NodeType.DocumentType:return t.implementation.createDocumentType(e.name,e.publicId,e.systemId);case NodeType.Element:var n=getTagName(e),r=void 0;for(var o in r=e.isSVG?t.createElementNS("http://www.w3.org/2000/svg",n):t.createElement(n),e.attributes)if(e.attributes.hasOwnProperty(o)&&!o.startsWith("rr_")){var i=e.attributes[o];i="boolean"==typeof i?"":i;var a="textarea"===n&&"value"===o,s="style"===n&&"_cssText"===o;if(s&&(i=addHoverClass(i)),a||s){var l=t.createTextNode(i);r.appendChild(l);continue}if("iframe"===n&&"src"===o)continue;try{r.setAttribute(o,i)}catch(e){}}else e.attributes.rr_width&&(r.style.width=e.attributes.rr_width),e.attributes.rr_height&&(r.style.height=e.attributes.rr_height);return r;case NodeType.Text:return t.createTextNode(e.isStyle?addHoverClass(e.textContent):e.textContent);case NodeType.CDATA:return t.createCDATASection(e.textContent);case NodeType.Comment:return t.createComment(e.textContent);default:return null}}function buildNodeWithSN(e,t,n,r){void 0===r&&(r=!1);var o=buildNode(e,t);if(!o)return null;if(e.type===NodeType.Document&&(t.close(),t.open(),o=t),o.__sn=e,n[e.id]=o,(e.type===NodeType.Document||e.type===NodeType.Element)&&!r)for(var i=0,a=e.childNodes;i<a.length;i++){var s=a[i],l=buildNodeWithSN(s,t,n);l?o.appendChild(l):console.warn("Failed to rebuild",s)}return o}function rebuild(e,t){var n={};return[buildNodeWithSN(e,t,n),n]}function on(e,t,n){void 0===n&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}var mirror={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return mirror.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete mirror.map[t],e.childNodes&&e.childNodes.forEach(function(e){return mirror.removeNodeFromMap(e)})},has:function(e){return mirror.map.hasOwnProperty(e)}};function throttle(e,t,n){void 0===n&&(n={});var r=null,o=0;return function(){var i=Date.now();o||!1!==n.leading||(o=i);var a=t-(i-o),s=this,l=arguments;a<=0||a>t?(r&&(window.clearTimeout(r),r=null),o=i,e.apply(s,l)):r||!1===n.trailing||(r=window.setTimeout(function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(s,l)},a))}}function hookSetter(e,t,n){var r=Object.getOwnPropertyDescriptor(e,t);return Object.defineProperty(e,t,{set:function(e){var t=this;setTimeout(function(){n.set.call(t,e)},0),r&&r.set&&r.set.call(this,e)}}),function(){return hookSetter(e,t,r||{})}}function getWindowHeight(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function getWindowWidth(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}var EventType,IncrementalSource,MouseInteractions,ReplayerEvents,BLOCK_CLASS$1="rr-block";function isBlocked(e){return!!e&&(e.nodeType===e.ELEMENT_NODE&&e.classList.contains(BLOCK_CLASS$1)||isBlocked(e.parentNode))}function initMutationObserver(e){var t=new MutationObserver(function(t){var n=[],r=[],o=[],i=[],a=[],s=new Set,l=function(e){isBlocked(e)||(s.add(e),e.childNodes.forEach(function(e){return l(e)}))};t.forEach(function(e){var t=e.type,i=e.target,c=e.oldValue,u=e.addedNodes,d=e.removedNodes,p=e.attributeName;switch(t){case"characterData":var f=i.textContent;isBlocked(i)||f===c||n.push({value:f,node:i});break;case"attributes":f=i.getAttribute(p);if(isBlocked(i)||f===c)return;var m=r.find(function(e){return e.node===i});m||(m={node:i,attributes:{}},r.push(m)),m.attributes[p]=f;break;case"childList":u.forEach(function(e){return l(e)}),d.forEach(function(e){var t=mirror.getId(e),n=mirror.getId(i);isBlocked(e)||(s.has(e)?(s.delete(e),a.push(e)):s.has(i)&&-1===t||mirror.has(n)&&o.push({parentId:n,id:t}),mirror.removeNodeFromMap(e))})}});var c=function(e){var t=e.parentNode;return!!t&&(!!a.some(function(e){return e===t})||c(t))},u=function(e){var t=e.parentNode;if(!t)return!1;var n=mirror.getId(t);return!!o.some(function(e){return e.id===n})||u(t)};Array.from(s).forEach(function(e){c(e)||u(e)?a.push(e):i.push({parentId:mirror.getId(e.parentNode),previousId:e.previousSibling?mirror.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?mirror.getId(e.nextSibling):e.nextSibling,node:serializeNodeWithId(e,document,mirror.map,!0)})});var d={texts:n.map(function(e){return{id:mirror.getId(e.node),value:e.value}}).filter(function(e){return mirror.has(e.id)}),attributes:r.map(function(e){return{id:mirror.getId(e.node),attributes:e.attributes}}).filter(function(e){return mirror.has(e.id)}),removes:o,adds:i};(d.texts.length||d.attributes.length||d.removes.length||d.adds.length)&&e(d)});return t.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),t}function initMousemoveObserver(e){var t,n=[],r=throttle(function(){var r=Date.now()-t;e(n.map(function(e){return e.timeOffset-=r,e})),n=[],t=null},500);return on("mousemove",throttle(function(e){var o=e.clientX,i=e.clientY,a=e.target;t||(t=Date.now()),n.push({x:o,y:i,id:mirror.getId(a),timeOffset:Date.now()-t}),r()},50,{trailing:!1}))}function initMouseInteractionObserver(e){var t=[];return Object.keys(MouseInteractions).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(n){var r=n.toLowerCase(),o=function(t){return function(n){if(!isBlocked(n.target)){var r=mirror.getId(n.target),o=n.clientX,i=n.clientY;e({type:MouseInteractions[t],id:r,x:o,y:i})}}}(n);t.push(on(r,o))}),function(){t.forEach(function(e){return e()})}}function initScrollObserver(e){return on("scroll",throttle(function(t){if(t.target&&!isBlocked(t.target)){var n=mirror.getId(t.target);if(t.target===document){var r=document.scrollingElement||document.documentElement;e({id:n,x:r.scrollLeft,y:r.scrollTop})}else e({id:n,x:t.target.scrollLeft,y:t.target.scrollTop})}},100))}function initViewportResizeObserver(e){return on("resize",throttle(function(){var t=getWindowHeight(),n=getWindowWidth();e({width:Number(n),height:Number(t)})},200),window)}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta"}(EventType||(EventType={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input"}(IncrementalSource||(IncrementalSource={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove=8]="TouchMove",e[e.TouchEnd=9]="TouchEnd"}(MouseInteractions||(MouseInteractions={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end"}(ReplayerEvents||(ReplayerEvents={}));var INPUT_TAGS=["INPUT","TEXTAREA","SELECT"],HOOK_PROPERTIES=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],IGNORE_CLASS="rr-ignore",lastInputValueMap=new WeakMap;function initInputObserver(e){function t(e){var t=e.target;if(t&&t.tagName&&!(INPUT_TAGS.indexOf(t.tagName)<0)&&!isBlocked(t)){var r=t.type;if("password"!==r&&!t.classList.contains(IGNORE_CLASS)){var o=t.value,i=!1;"radio"!==r&&"checkbox"!==r||(i=t.checked),n(t,{text:o,isChecked:i});var a=t.name;"radio"===r&&a&&i&&document.querySelectorAll('input[type="radio"][name="'+a+'"]').forEach(function(e){e!==t&&n(e,{text:e.value,isChecked:!i})})}}}function n(t,n){var r=lastInputValueMap.get(t);if(!r||r.text!==n.text||r.isChecked!==n.isChecked){lastInputValueMap.set(t,n);var o=mirror.getId(t);e(__assign({},n,{id:o}))}}var r=["input","change"].map(function(e){return on(e,t)}),o=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");return o&&o.set&&r.push.apply(r,HOOK_PROPERTIES.map(function(e){return hookSetter(e[0],e[1],{set:function(){t({target:this})}})})),function(){r.forEach(function(e){return e()})}}function initObservers(e){var t=initMutationObserver(e.mutationCb),n=initMousemoveObserver(e.mousemoveCb),r=initMouseInteractionObserver(e.mouseInteractionCb),o=initScrollObserver(e.scrollCb),i=initViewportResizeObserver(e.viewportResizeCb),a=initInputObserver(e.inputCb);return function(){t.disconnect(),n(),r(),o(),i(),a()}}function wrapEvent(e){return __assign({},e,{timestamp:Date.now()})}function record(e){void 0===e&&(e={});var t,n=e.emit,r=e.checkoutEveryNms,o=e.checkoutEveryNth;if(!n)throw new Error("emit function is required");var i=0,a=function(e,a){if(n(e,a),e.type===EventType.FullSnapshot)t=e,i=0;else if(e.type===EventType.IncrementalSnapshot){i++;var l=o&&i>=o,c=r&&e.timestamp-t.timestamp>r;(l||c)&&s(!0)}};function s(e){void 0===e&&(e=!1),a(wrapEvent({type:EventType.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}),e);var t=snapshot(document),n=t[0],r=t[1];if(!n)return console.warn("Failed to snapshot the document");mirror.map=r,a(wrapEvent({type:EventType.FullSnapshot,data:{node:n,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}}))}try{var l=[];l.push(on("DOMContentLoaded",function(){a(wrapEvent({type:EventType.DomContentLoaded,data:{}}))}));var c=function(){s(),l.push(initObservers({mutationCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Mutation},e)}))},mousemoveCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:{source:IncrementalSource.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.MouseInteraction},e)}))},scrollCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Scroll},e)}))},viewportResizeCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.ViewportResize},e)}))},inputCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Input},e)}))}}))};return"interactive"===document.readyState||"complete"===document.readyState?c():l.push(on("load",function(){a(wrapEvent({type:EventType.Load,data:{}})),c()},window)),function(){l.forEach(function(e){return e()})}}catch(e){console.warn(e)}}function mitt(e){return e=e||Object.create(null),{on:function(t,n){(e[t]||(e[t]=[])).push(n)},off:function(t,n){e[t]&&e[t].splice(e[t].indexOf(n)>>>0,1)},emit:function(t,n){(e[t]||[]).slice().map(function(e){e(n)}),(e["*"]||[]).slice().map(function(e){e(t,n)})}}}var mittProxy=Object.freeze({default:mitt});function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var smoothscroll=createCommonjsModule(function(e,t){!function(){e.exports={polyfill:function(){var e=window,t=document;if(!("scrollBehavior"in t.documentElement.style&&!0!==e.__forceSmoothScrollPolyfill__)){var n,r=e.HTMLElement||e.Element,o=468,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||l,scrollIntoView:r.prototype.scrollIntoView},a=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,s=(n=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?m.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):i.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]&&(c(arguments[0])?i.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):m.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},r.prototype.scroll=r.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==c(arguments[0])){var e=arguments[0].left,t=arguments[0].top;m.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");i.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)}},r.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.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))},r.prototype.scrollIntoView=function(){if(!0!==c(arguments[0])){var n=function(e){var n;do{n=(e=e.parentNode)===t.body}while(!1===n&&!1===p(e));return n=null,e}(this),r=n.getBoundingClientRect(),o=this.getBoundingClientRect();n!==t.body?(m.call(this,n,n.scrollLeft+o.left-r.left,n.scrollTop+o.top-r.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})):e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function l(e,t){this.scrollLeft=e,this.scrollTop=t}function c(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 u(e,t){return"Y"===t?e.clientHeight+s<e.scrollHeight:"X"===t?e.clientWidth+s<e.scrollWidth:void 0}function d(t,n){var r=e.getComputedStyle(t,null)["overflow"+n];return"auto"===r||"scroll"===r}function p(e){var t=u(e,"Y")&&d(e,"Y"),n=u(e,"X")&&d(e,"X");return t||n}function f(t){var n,r,i,s,l=(a()-t.startTime)/o;s=l=l>1?1:l,n=.5*(1-Math.cos(Math.PI*s)),r=t.startX+(t.x-t.startX)*n,i=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,r,i),r===t.x&&i===t.y||e.requestAnimationFrame(f.bind(e,t))}function m(n,r,o){var s,c,u,d,p=a();n===t.body?(s=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(s=n,c=n.scrollLeft,u=n.scrollTop,d=l),f({scrollable:s,method:d,startTime:p,startX:c,startY:u,x:r,y:o})}}}}()}),smoothscroll_1=smoothscroll.polyfill,Timer=function(){function e(e,t){void 0===t&&(t=[]),this.timeOffset=0,this.actions=t,this.config=e}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){var t;(t=this.actions).push.apply(t,e)},e.prototype.start=function(){this.actions.sort(function(e,t){return e.delay-t.delay}),this.timeOffset=0;var e=performance.now(),t=this.actions,n=this.config,r=this;this.raf=requestAnimationFrame(function o(i){for(r.timeOffset+=(i-e)*n.speed,e=i;t.length;){var a=t[0];if(!(r.timeOffset>=a.delay))break;t.shift(),a.doAction()}t.length>0&&(r.raf=requestAnimationFrame(o))})},e.prototype.clear=function(){this.raf&&cancelAnimationFrame(this.raf),this.actions.length=0},e.prototype.findActionIndex=function(e){for(var t=0,n=this.actions.length-1;t<=n;){var r=Math.floor((t+n)/2);if(this.actions[r].delay<e.delay)t=r+1;else{if(!(this.actions[r].delay>e.delay))return r;n=r-1}}return t},e}(),rules=["iframe, .rr-block { background: #ccc }","noscript { display: none !important; }"],SKIP_TIME_THRESHOLD=1e4,SKIP_TIME_INTERVAL=5e3;smoothscroll_1();var mitt$1=mitt||mittProxy,REPLAY_CONSOLE_PREFIX="[replayer]",Replayer=function(){function e(e,t){if(this.events=[],this.emitter=mitt$1(),this.baselineTime=0,this.noramlSpeed=-1,this.missingNodeRetryMap={},e.length<2)throw new Error("Replayer need at least 2 events.");this.events=e,this.handleResize=this.handleResize.bind(this);var n={speed:1,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0};this.config=Object.assign({},n,t),this.timer=new Timer(this.config),this.setupDom(),this.emitter.on("resize",this.handleResize)}return e.prototype.on=function(e,t){this.emitter.on(e,t)},e.prototype.setConfig=function(e){var t=this;Object.keys(e).forEach(function(n){t.config[n]=e[n]}),this.config.skipInactive||(this.noramlSpeed=-1)},e.prototype.getMetaData=function(){var e=this.events[0];return{totalTime:this.events[this.events.length-1].timestamp-e.timestamp}},e.prototype.getTimeOffset=function(){return this.baselineTime-this.events[0].timestamp},e.prototype.play=function(e){void 0===e&&(e=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+e;for(var t=new Array,n=0,r=this.events;n<r.length;n++){var o=r[n],i=o.timestamp<this.baselineTime,a=this.getCastFn(o,i);i?a():t.push({doAction:a,delay:this.getDelay(o)})}this.timer.addActions(t),this.timer.start(),this.emitter.emit(ReplayerEvents.Start)},e.prototype.pause=function(){this.timer.clear(),this.emitter.emit(ReplayerEvents.Pause)},e.prototype.resume=function(e){void 0===e&&(e=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+e;for(var t=new Array,n=0,r=this.events;n<r.length;n++){var o=r[n];if(!(o.timestamp<=this.lastPlayedEvent.timestamp||o===this.lastPlayedEvent)){var i=this.getCastFn(o);t.push({doAction:i,delay:this.getDelay(o)})}}this.timer.addActions(t),this.timer.start(),this.emitter.emit(ReplayerEvents.Resume)},e.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),this.iframe=document.createElement("iframe"),this.iframe.setAttribute("sandbox","allow-same-origin"),this.iframe.setAttribute("scrolling","no"),this.wrapper.appendChild(this.iframe)},e.prototype.handleResize=function(e){this.iframe.width=e.width+"px",this.iframe.height=e.height+"px"},e.prototype.getDelay=function(e){if(e.type===EventType.IncrementalSnapshot&&e.data.source===IncrementalSource.MouseMove){var t=e.data.positions[0].timeOffset,n=e.timestamp+t;return e.delay=n-this.baselineTime,n-this.baselineTime}return e.delay=e.timestamp-this.baselineTime,e.timestamp-this.baselineTime},e.prototype.getCastFn=function(e,t){var n,r=this;switch(void 0===t&&(t=!1),e.type){case EventType.DomContentLoaded:case EventType.Load:break;case EventType.Meta:n=function(){return r.emitter.emit(ReplayerEvents.Resize,{width:e.data.width,height:e.data.height})};break;case EventType.FullSnapshot:n=function(){r.rebuildFullSnapshot(e),r.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case EventType.IncrementalSnapshot:n=function(){if(r.applyIncremental(e,t),e===r.nextUserInteractionEvent&&(r.nextUserInteractionEvent=null,r.restoreSpeed()),r.config.skipInactive&&!r.nextUserInteractionEvent){for(var n=0,o=r.events;n<o.length;n++){var i=o[n];if(!(i.timestamp<=e.timestamp)&&r.isUserInteraction(i)){i.delay-e.delay>SKIP_TIME_THRESHOLD*r.config.speed&&(r.nextUserInteractionEvent=i);break}}if(r.nextUserInteractionEvent){r.noramlSpeed=r.config.speed;var a=r.nextUserInteractionEvent.delay-e.delay,s={speed:Math.min(Math.round(a/SKIP_TIME_INTERVAL),360)};r.setConfig(s),r.emitter.emit(ReplayerEvents.SkipStart,s)}}}}return function(){n&&n(),r.lastPlayedEvent=e,e===r.events[r.events.length-1]&&(r.restoreSpeed(),r.emitter.emit(ReplayerEvents.Finish))}},e.prototype.rebuildFullSnapshot=function(e){Object.keys(this.missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.missingNodeRetryMap),this.missingNodeRetryMap={},mirror.map=rebuild(e.data.node,this.iframe.contentDocument)[1];var t=document.createElement("style"),n=this.iframe.contentDocument,r=n.documentElement,o=n.head;r.insertBefore(t,o);for(var i=0;i<rules.length;i++)t.sheet.insertRule(rules[i],i);this.emitter.emit(ReplayerEvents.FullsnapshotRebuilded),this.waitForStylesheetLoad()},e.prototype.waitForStylesheetLoad=function(){var e=this,t=this.iframe.contentDocument.head;if(t){var n,r=new Set;t.querySelectorAll('link[rel="stylesheet"]').forEach(function(t){t.sheet||(0===r.size&&(e.pause(),e.emitter.emit(ReplayerEvents.LoadStylesheetStart),n=window.setTimeout(function(){e.resume(),n=-1},e.config.loadTimeout)),r.add(t),t.addEventListener("load",function(){r.delete(t),0===r.size&&-1!==n&&(e.resume(),e.emitter.emit(ReplayerEvents.LoadStylesheetEnd),n&&window.clearTimeout(n))}))})}},e.prototype.applyIncremental=function(e,t){var n=this,r=e.data;switch(r.source){case IncrementalSource.Mutation:r.removes.forEach(function(e){var t=mirror.getNode(e.id);if(!t)return n.warnNodeNotFound(r,e.id);var o=mirror.getNode(e.parentId);if(!o)return n.warnNodeNotFound(r,e.parentId);mirror.removeNodeFromMap(t),o&&o.removeChild(t)});var o=__assign({},this.missingNodeRetryMap);r.adds.forEach(function(e){var t=buildNodeWithSN(e.node,n.iframe.contentDocument,mirror.map,!0),i=mirror.getNode(e.parentId);if(!i)return n.warnNodeNotFound(r,e.parentId);var a=null,s=null;e.previousId&&(a=mirror.getNode(e.previousId)),e.nextId&&(s=mirror.getNode(e.nextId)),-1!==e.previousId&&-1!==e.nextId?(a&&a.nextSibling&&a.nextSibling.parentNode?i.insertBefore(t,a.nextSibling):s&&s.parentNode?i.insertBefore(t,s):i.appendChild(t),(e.previousId||e.nextId)&&n.resolveMissingNode(o,i,t,e)):o[e.node.id]={node:t,mutation:e}}),Object.keys(o).length&&Object.assign(this.missingNodeRetryMap,o),r.texts.forEach(function(e){var t=mirror.getNode(e.id);if(!t)return n.warnNodeNotFound(r,e.id);t.textContent=e.value}),r.attributes.forEach(function(e){var t=mirror.getNode(e.id);if(!t)return n.warnNodeNotFound(r,e.id);for(var o in e.attributes)if("string"==typeof o){var i=e.attributes[o];i?t.setAttribute(o,i):t.removeAttribute(o)}});break;case IncrementalSource.MouseMove:t||r.positions.forEach(function(t){var o={doAction:function(){n.moveAndHover(r,t.x,t.y,t.id)},delay:t.timeOffset+e.timestamp-n.baselineTime};n.timer.addAction(o)});break;case IncrementalSource.MouseInteraction:if(-1===r.id)break;var i=new Event(MouseInteractions[r.type].toLowerCase());if(!(a=mirror.getNode(r.id)))return this.warnNodeNotFound(r,r.id);switch(r.type){case MouseInteractions.Blur:a.blur&&a.blur();break;case MouseInteractions.Focus:a.focus&&a.focus({preventScroll:!0});break;case MouseInteractions.Click:t||(this.moveAndHover(r,r.x,r.y,r.id),this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:a.dispatchEvent(i)}break;case IncrementalSource.Scroll:if(-1===r.id)break;if(!(a=mirror.getNode(r.id)))return this.warnNodeNotFound(r,r.id);if(a===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:r.y,left:r.x,behavior:t?"auto":"smooth"});else try{a.scrollTop=r.y,a.scrollLeft=r.x}catch(e){}break;case IncrementalSource.ViewportResize:this.emitter.emit(ReplayerEvents.Resize,{width:r.width,height:r.height});break;case IncrementalSource.Input:if(-1===r.id)break;var a;if(!(a=mirror.getNode(r.id)))return this.warnNodeNotFound(r,r.id);try{a.checked=r.isChecked,a.value=r.text}catch(e){}}},e.prototype.resolveMissingNode=function(e,t,n,r){var o=r.previousId,i=r.nextId,a=o&&e[o],s=i&&e[i];if(a){var l=a,c=l.node,u=l.mutation;t.insertBefore(c,n),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,c,u)}if(s){var d=s;c=d.node,u=d.mutation;t.insertBefore(c,n.nextSibling),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,c,u)}},e.prototype.moveAndHover=function(e,t,n,r){this.mouse.style.left=t+"px",this.mouse.style.top=n+"px";var o=mirror.getNode(r);if(!o)return this.warnNodeNotFound(e,r);this.hoverElements(o)},e.prototype.hoverElements=function(e){this.iframe.contentDocument.querySelectorAll(".\\:hover").forEach(function(e){e.classList.remove(":hover")});for(var t=e;t;)t.classList.add(":hover"),t=t.parentElement},e.prototype.isUserInteraction=function(e){return e.type===EventType.IncrementalSnapshot&&(e.data.source>IncrementalSource.Mutation&&e.data.source<=IncrementalSource.Input)},e.prototype.restoreSpeed=function(){if(-1!==this.noramlSpeed){var e={speed:this.noramlSpeed};this.setConfig(e),this.emitter.emit(ReplayerEvents.SkipEnd,e),this.noramlSpeed=-1}},e.prototype.warnNodeNotFound=function(e,t){this.config.showWarning&&console.warn(REPLAY_CONSOLE_PREFIX,"Node with id '"+t+"' not found in",e)},e}();export{record,Replayer,mirror};
var NodeType,__assign=function(){return(__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};!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"}(NodeType||(NodeType={}));var _id=1;function genId(){return _id++}function resetId(){_id=1}function getCssRulesString(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+t.cssText},""):null}catch(e){return null}}function extractOrigin(e){return(e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0]).split("?")[0]}var URL_IN_CSS_REF=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,RELATIVE_PATH=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,DATA_URI=/^(data:)([\w\/\+]+);(charset=[\w-]+|base64).*,(.*)/gi;function absoluteToStylesheet(e,t){return e.replace(URL_IN_CSS_REF,function(e,n,r,o){var i=n||r||o;if(!i)return e;if(!RELATIVE_PATH.test(i))return"url('"+i+"')";if(DATA_URI.test(i))return"url("+i+")";if("/"===i[0])return"url('"+(extractOrigin(t)+i)+"')";var a=t.split("/"),s=i.split("/");a.pop();for(var l=0,c=s;l<c.length;l++){var u=c[l];"."!==u&&(".."===u?a.pop():a.push(u))}return"url('"+a.join("/")+"')"})}function absoluteToDoc(e,t){var n=e.createElement("a");return n.href=t,n.href}function isSVGElement(e){return"svg"===e.tagName||e instanceof SVGElement}var BLOCK_CLASS="rr-block";function serializeNode(e,t){switch(e.nodeType){case e.DOCUMENT_NODE:return{type:NodeType.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:NodeType.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId};case e.ELEMENT_NODE:for(var n=e.classList.contains(BLOCK_CLASS),r=e.tagName.toLowerCase(),o={},i=0,a=Array.from(e.attributes);i<a.length;i++){var s=a[i],l=s.name,c=s.value;o[l]="src"===l||"href"===l?absoluteToDoc(t,c):"style"===l?absoluteToStylesheet(c,location.href):c}if("link"===r){var u=Array.from(t.styleSheets).find(function(t){return t.href===e.href}),d=getCssRulesString(u);d&&(o={_cssText:absoluteToStylesheet(d,u.href)})}if("input"===r||"textarea"===r||"select"===r){c=e.value;"radio"!==o.type&&"checkbox"!==o.type&&c?o.value=c:e.checked&&(o.checked=e.checked)}if("option"===r){var p=e.parentElement;o.value===p.value&&(o.selected=e.selected)}if(n){var f=e.getBoundingClientRect(),m=f.width,h=f.height;o.rr_width=m+"px",o.rr_height=h+"px"}return{type:NodeType.Element,tagName:r,attributes:o,childNodes:[],isSVG:isSVGElement(e)||void 0,needBlock:n};case e.TEXT_NODE:var v=e.parentNode&&e.parentNode.tagName,y=e.textContent,g="STYLE"===v||void 0;return g&&y&&(y=absoluteToStylesheet(y,location.href)),"SCRIPT"===v&&(y="SCRIPT_PLACEHOLDER"),{type:NodeType.Text,textContent:y||"",isStyle:g};case e.CDATA_SECTION_NODE:return{type:NodeType.CDATA,textContent:""};case e.COMMENT_NODE:return{type:NodeType.Comment,textContent:e.textContent||""};default:return!1}}function serializeNodeWithId(e,t,n,r){void 0===r&&(r=!1);var o=serializeNode(e,t);if(!o)return console.warn(e,"not serialized"),null;var i=Object.assign(o,{id:genId()});e.__sn=i,n[i.id]=e;var a=!r;if(i.type===NodeType.Element&&(a=a&&!i.needBlock,delete i.needBlock),(i.type===NodeType.Document||i.type===NodeType.Element)&&a)for(var s=0,l=Array.from(e.childNodes);s<l.length;s++){var c=serializeNodeWithId(l[s],t,n);c&&i.childNodes.push(c)}return i}function snapshot(e){resetId();var t={};return[serializeNodeWithId(e,e,t),t]}var tagMap={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function getTagName(e){var t=tagMap[e.tagName]?tagMap[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}var CSS_SELECTOR=/([^\r\n,{}]+)(,(?=[^}]*{)|\s*{)/g,HOVER_SELECTOR=/([^\\]):hover/g;function addHoverClass(e){return e.replace(CSS_SELECTOR,function(e,t,n){if(HOVER_SELECTOR.test(t)){var r=t.replace(HOVER_SELECTOR,"$1.\\:hover");return t.replace(/\s*$/,"")+", "+r.replace(/^\s*/,"")+n}return e})}function buildNode(e,t){switch(e.type){case NodeType.Document:return t.implementation.createDocument(null,"",null);case NodeType.DocumentType:return t.implementation.createDocumentType(e.name,e.publicId,e.systemId);case NodeType.Element:var n=getTagName(e),r=void 0;for(var o in r=e.isSVG?t.createElementNS("http://www.w3.org/2000/svg",n):t.createElement(n),e.attributes)if(e.attributes.hasOwnProperty(o)&&!o.startsWith("rr_")){var i=e.attributes[o];i="boolean"==typeof i?"":i;var a="textarea"===n&&"value"===o,s="style"===n&&"_cssText"===o;if(s&&(i=addHoverClass(i)),a||s){var l=t.createTextNode(i);r.appendChild(l);continue}if("iframe"===n&&"src"===o)continue;try{r.setAttribute(o,i)}catch(e){}}else e.attributes.rr_width&&(r.style.width=e.attributes.rr_width),e.attributes.rr_height&&(r.style.height=e.attributes.rr_height);return r;case NodeType.Text:return t.createTextNode(e.isStyle?addHoverClass(e.textContent):e.textContent);case NodeType.CDATA:return t.createCDATASection(e.textContent);case NodeType.Comment:return t.createComment(e.textContent);default:return null}}function buildNodeWithSN(e,t,n,r){void 0===r&&(r=!1);var o=buildNode(e,t);if(!o)return null;if(e.type===NodeType.Document&&(t.close(),t.open(),o=t),o.__sn=e,n[e.id]=o,(e.type===NodeType.Document||e.type===NodeType.Element)&&!r)for(var i=0,a=e.childNodes;i<a.length;i++){var s=a[i],l=buildNodeWithSN(s,t,n);l?o.appendChild(l):console.warn("Failed to rebuild",s)}return o}function rebuild(e,t){var n={};return[buildNodeWithSN(e,t,n),n]}function on(e,t,n){void 0===n&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}var mirror={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return mirror.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete mirror.map[t],e.childNodes&&e.childNodes.forEach(function(e){return mirror.removeNodeFromMap(e)})},has:function(e){return mirror.map.hasOwnProperty(e)}};function throttle(e,t,n){void 0===n&&(n={});var r=null,o=0;return function(){var i=Date.now();o||!1!==n.leading||(o=i);var a=t-(i-o),s=this,l=arguments;a<=0||a>t?(r&&(window.clearTimeout(r),r=null),o=i,e.apply(s,l)):r||!1===n.trailing||(r=window.setTimeout(function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(s,l)},a))}}function hookSetter(e,t,n){var r=Object.getOwnPropertyDescriptor(e,t);return Object.defineProperty(e,t,{set:function(e){var t=this;setTimeout(function(){n.set.call(t,e)},0),r&&r.set&&r.set.call(this,e)}}),function(){return hookSetter(e,t,r||{})}}function getWindowHeight(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function getWindowWidth(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}var EventType,IncrementalSource,MouseInteractions,ReplayerEvents,BLOCK_CLASS$1="rr-block";function isBlocked(e){return!!e&&(e.nodeType===e.ELEMENT_NODE&&e.classList.contains(BLOCK_CLASS$1)||isBlocked(e.parentNode))}function isAncestorRemoved(e){var t=mirror.getId(e);return!mirror.has(t)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||isAncestorRemoved(e.parentNode))}function deepDelete(e,t){e.delete(t),t.childNodes.forEach(function(t){return deepDelete(e,t)})}function isParentRemoved(e,t){var n=t.parentNode;if(!n)return!1;var r=mirror.getId(n);return!!e.some(function(e){return e.id===r})||isParentRemoved(e,n)}function isParentDropped(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||isParentDropped(e,n))}function initMutationObserver(e){var t=new MutationObserver(function(t){var n=[],r=[],o=[],i=[],a=new Set,s=new Set,l=function(e){isBlocked(e)||(a.add(e),s.delete(e),e.childNodes.forEach(function(e){return l(e)}))};t.forEach(function(e){var t=e.type,i=e.target,c=e.oldValue,u=e.addedNodes,d=e.removedNodes,p=e.attributeName;switch(t){case"characterData":var f=i.textContent;isBlocked(i)||f===c||n.push({value:f,node:i});break;case"attributes":f=i.getAttribute(p);if(isBlocked(i)||f===c)return;var m=r.find(function(e){return e.node===i});m||(m={node:i,attributes:{}},r.push(m)),m.attributes[p]=f;break;case"childList":u.forEach(function(e){return l(e)}),d.forEach(function(e){var t=mirror.getId(e),n=mirror.getId(i);isBlocked(e)||(a.has(e)?(deepDelete(a,e),s.add(e)):a.has(i)&&-1===t||isAncestorRemoved(i)||o.push({parentId:n,id:t}),mirror.removeNodeFromMap(e))})}}),Array.from(a).forEach(function(e){isParentDropped(s,e)||isParentRemoved(o,e)?s.add(e):i.push({parentId:mirror.getId(e.parentNode),previousId:e.previousSibling?mirror.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?mirror.getId(e.nextSibling):e.nextSibling,node:serializeNodeWithId(e,document,mirror.map,!0)})});var c={texts:n.map(function(e){return{id:mirror.getId(e.node),value:e.value}}).filter(function(e){return mirror.has(e.id)}),attributes:r.map(function(e){return{id:mirror.getId(e.node),attributes:e.attributes}}).filter(function(e){return mirror.has(e.id)}),removes:o,adds:i};(c.texts.length||c.attributes.length||c.removes.length||c.adds.length)&&e(c)});return t.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),t}function initMousemoveObserver(e){var t,n=[],r=throttle(function(){var r=Date.now()-t;e(n.map(function(e){return e.timeOffset-=r,e})),n=[],t=null},500);return on("mousemove",throttle(function(e){var o=e.clientX,i=e.clientY,a=e.target;t||(t=Date.now()),n.push({x:o,y:i,id:mirror.getId(a),timeOffset:Date.now()-t}),r()},50,{trailing:!1}))}function initMouseInteractionObserver(e){var t=[];return Object.keys(MouseInteractions).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(n){var r=n.toLowerCase(),o=function(t){return function(n){if(!isBlocked(n.target)){var r=mirror.getId(n.target),o=n.clientX,i=n.clientY;e({type:MouseInteractions[t],id:r,x:o,y:i})}}}(n);t.push(on(r,o))}),function(){t.forEach(function(e){return e()})}}function initScrollObserver(e){return on("scroll",throttle(function(t){if(t.target&&!isBlocked(t.target)){var n=mirror.getId(t.target);if(t.target===document){var r=document.scrollingElement||document.documentElement;e({id:n,x:r.scrollLeft,y:r.scrollTop})}else e({id:n,x:t.target.scrollLeft,y:t.target.scrollTop})}},100))}function initViewportResizeObserver(e){return on("resize",throttle(function(){var t=getWindowHeight(),n=getWindowWidth();e({width:Number(n),height:Number(t)})},200),window)}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta"}(EventType||(EventType={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input"}(IncrementalSource||(IncrementalSource={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove=8]="TouchMove",e[e.TouchEnd=9]="TouchEnd"}(MouseInteractions||(MouseInteractions={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end"}(ReplayerEvents||(ReplayerEvents={}));var INPUT_TAGS=["INPUT","TEXTAREA","SELECT"],HOOK_PROPERTIES=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],IGNORE_CLASS="rr-ignore",lastInputValueMap=new WeakMap;function initInputObserver(e){function t(e){var t=e.target;if(t&&t.tagName&&!(INPUT_TAGS.indexOf(t.tagName)<0)&&!isBlocked(t)){var r=t.type;if("password"!==r&&!t.classList.contains(IGNORE_CLASS)){var o=t.value,i=!1;"radio"!==r&&"checkbox"!==r||(i=t.checked),n(t,{text:o,isChecked:i});var a=t.name;"radio"===r&&a&&i&&document.querySelectorAll('input[type="radio"][name="'+a+'"]').forEach(function(e){e!==t&&n(e,{text:e.value,isChecked:!i})})}}}function n(t,n){var r=lastInputValueMap.get(t);if(!r||r.text!==n.text||r.isChecked!==n.isChecked){lastInputValueMap.set(t,n);var o=mirror.getId(t);e(__assign({},n,{id:o}))}}var r=["input","change"].map(function(e){return on(e,t)}),o=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");return o&&o.set&&r.push.apply(r,HOOK_PROPERTIES.map(function(e){return hookSetter(e[0],e[1],{set:function(){t({target:this})}})})),function(){r.forEach(function(e){return e()})}}function initObservers(e){var t=initMutationObserver(e.mutationCb),n=initMousemoveObserver(e.mousemoveCb),r=initMouseInteractionObserver(e.mouseInteractionCb),o=initScrollObserver(e.scrollCb),i=initViewportResizeObserver(e.viewportResizeCb),a=initInputObserver(e.inputCb);return function(){t.disconnect(),n(),r(),o(),i(),a()}}function wrapEvent(e){return __assign({},e,{timestamp:Date.now()})}function record(e){void 0===e&&(e={});var t,n=e.emit,r=e.checkoutEveryNms,o=e.checkoutEveryNth;if(!n)throw new Error("emit function is required");var i=0,a=function(e,a){if(n(e,a),e.type===EventType.FullSnapshot)t=e,i=0;else if(e.type===EventType.IncrementalSnapshot){i++;var l=o&&i>=o,c=r&&e.timestamp-t.timestamp>r;(l||c)&&s(!0)}};function s(e){void 0===e&&(e=!1),a(wrapEvent({type:EventType.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}),e);var t=snapshot(document),n=t[0],r=t[1];if(!n)return console.warn("Failed to snapshot the document");mirror.map=r,a(wrapEvent({type:EventType.FullSnapshot,data:{node:n,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}}))}try{var l=[];l.push(on("DOMContentLoaded",function(){a(wrapEvent({type:EventType.DomContentLoaded,data:{}}))}));var c=function(){s(),l.push(initObservers({mutationCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Mutation},e)}))},mousemoveCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:{source:IncrementalSource.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.MouseInteraction},e)}))},scrollCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Scroll},e)}))},viewportResizeCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.ViewportResize},e)}))},inputCb:function(e){return a(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Input},e)}))}}))};return"interactive"===document.readyState||"complete"===document.readyState?c():l.push(on("load",function(){a(wrapEvent({type:EventType.Load,data:{}})),c()},window)),function(){l.forEach(function(e){return e()})}}catch(e){console.warn(e)}}function mitt(e){return e=e||Object.create(null),{on:function(t,n){(e[t]||(e[t]=[])).push(n)},off:function(t,n){e[t]&&e[t].splice(e[t].indexOf(n)>>>0,1)},emit:function(t,n){(e[t]||[]).slice().map(function(e){e(n)}),(e["*"]||[]).slice().map(function(e){e(t,n)})}}}var mittProxy=Object.freeze({default:mitt});function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var smoothscroll=createCommonjsModule(function(e,t){!function(){e.exports={polyfill:function(){var e=window,t=document;if(!("scrollBehavior"in t.documentElement.style&&!0!==e.__forceSmoothScrollPolyfill__)){var n,r=e.HTMLElement||e.Element,o=468,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||l,scrollIntoView:r.prototype.scrollIntoView},a=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,s=(n=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?m.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):i.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]&&(c(arguments[0])?i.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):m.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},r.prototype.scroll=r.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==c(arguments[0])){var e=arguments[0].left,t=arguments[0].top;m.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");i.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)}},r.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==c(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.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))},r.prototype.scrollIntoView=function(){if(!0!==c(arguments[0])){var n=function(e){var n;do{n=(e=e.parentNode)===t.body}while(!1===n&&!1===p(e));return n=null,e}(this),r=n.getBoundingClientRect(),o=this.getBoundingClientRect();n!==t.body?(m.call(this,n,n.scrollLeft+o.left-r.left,n.scrollTop+o.top-r.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})):e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function l(e,t){this.scrollLeft=e,this.scrollTop=t}function c(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 u(e,t){return"Y"===t?e.clientHeight+s<e.scrollHeight:"X"===t?e.clientWidth+s<e.scrollWidth:void 0}function d(t,n){var r=e.getComputedStyle(t,null)["overflow"+n];return"auto"===r||"scroll"===r}function p(e){var t=u(e,"Y")&&d(e,"Y"),n=u(e,"X")&&d(e,"X");return t||n}function f(t){var n,r,i,s,l=(a()-t.startTime)/o;s=l=l>1?1:l,n=.5*(1-Math.cos(Math.PI*s)),r=t.startX+(t.x-t.startX)*n,i=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,r,i),r===t.x&&i===t.y||e.requestAnimationFrame(f.bind(e,t))}function m(n,r,o){var s,c,u,d,p=a();n===t.body?(s=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(s=n,c=n.scrollLeft,u=n.scrollTop,d=l),f({scrollable:s,method:d,startTime:p,startX:c,startY:u,x:r,y:o})}}}}()}),smoothscroll_1=smoothscroll.polyfill,Timer=function(){function e(e,t){void 0===t&&(t=[]),this.timeOffset=0,this.actions=t,this.config=e}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){var t;(t=this.actions).push.apply(t,e)},e.prototype.start=function(){this.actions.sort(function(e,t){return e.delay-t.delay}),this.timeOffset=0;var e=performance.now(),t=this.actions,n=this.config,r=this;this.raf=requestAnimationFrame(function o(i){for(r.timeOffset+=(i-e)*n.speed,e=i;t.length;){var a=t[0];if(!(r.timeOffset>=a.delay))break;t.shift(),a.doAction()}t.length>0&&(r.raf=requestAnimationFrame(o))})},e.prototype.clear=function(){this.raf&&cancelAnimationFrame(this.raf),this.actions.length=0},e.prototype.findActionIndex=function(e){for(var t=0,n=this.actions.length-1;t<=n;){var r=Math.floor((t+n)/2);if(this.actions[r].delay<e.delay)t=r+1;else{if(!(this.actions[r].delay>e.delay))return r;n=r-1}}return t},e}(),rules=["iframe, .rr-block { background: #ccc }","noscript { display: none !important; }"],SKIP_TIME_THRESHOLD=1e4,SKIP_TIME_INTERVAL=5e3;smoothscroll_1();var mitt$1=mitt||mittProxy,REPLAY_CONSOLE_PREFIX="[replayer]",Replayer=function(){function e(e,t){if(this.events=[],this.emitter=mitt$1(),this.baselineTime=0,this.noramlSpeed=-1,this.missingNodeRetryMap={},e.length<2)throw new Error("Replayer need at least 2 events.");this.events=e,this.handleResize=this.handleResize.bind(this);var n={speed:1,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1};this.config=Object.assign({},n,t),this.timer=new Timer(this.config),this.setupDom(),this.emitter.on("resize",this.handleResize)}return e.prototype.on=function(e,t){this.emitter.on(e,t)},e.prototype.setConfig=function(e){var t=this;Object.keys(e).forEach(function(n){t.config[n]=e[n]}),this.config.skipInactive||(this.noramlSpeed=-1)},e.prototype.getMetaData=function(){var e=this.events[0];return{totalTime:this.events[this.events.length-1].timestamp-e.timestamp}},e.prototype.getTimeOffset=function(){return this.baselineTime-this.events[0].timestamp},e.prototype.play=function(e){void 0===e&&(e=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+e;for(var t=new Array,n=0,r=this.events;n<r.length;n++){var o=r[n],i=o.timestamp<this.baselineTime,a=this.getCastFn(o,i);i?a():t.push({doAction:a,delay:this.getDelay(o)})}this.timer.addActions(t),this.timer.start(),this.emitter.emit(ReplayerEvents.Start)},e.prototype.pause=function(){this.timer.clear(),this.emitter.emit(ReplayerEvents.Pause)},e.prototype.resume=function(e){void 0===e&&(e=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+e;for(var t=new Array,n=0,r=this.events;n<r.length;n++){var o=r[n];if(!(o.timestamp<=this.lastPlayedEvent.timestamp||o===this.lastPlayedEvent)){var i=this.getCastFn(o);t.push({doAction:i,delay:this.getDelay(o)})}}this.timer.addActions(t),this.timer.start(),this.emitter.emit(ReplayerEvents.Resume)},e.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),this.iframe=document.createElement("iframe"),this.iframe.setAttribute("sandbox","allow-same-origin"),this.iframe.setAttribute("scrolling","no"),this.wrapper.appendChild(this.iframe)},e.prototype.handleResize=function(e){this.iframe.width=e.width+"px",this.iframe.height=e.height+"px"},e.prototype.getDelay=function(e){if(e.type===EventType.IncrementalSnapshot&&e.data.source===IncrementalSource.MouseMove){var t=e.data.positions[0].timeOffset,n=e.timestamp+t;return e.delay=n-this.baselineTime,n-this.baselineTime}return e.delay=e.timestamp-this.baselineTime,e.timestamp-this.baselineTime},e.prototype.getCastFn=function(e,t){var n,r=this;switch(void 0===t&&(t=!1),e.type){case EventType.DomContentLoaded:case EventType.Load:break;case EventType.Meta:n=function(){return r.emitter.emit(ReplayerEvents.Resize,{width:e.data.width,height:e.data.height})};break;case EventType.FullSnapshot:n=function(){r.rebuildFullSnapshot(e),r.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case EventType.IncrementalSnapshot:n=function(){if(r.applyIncremental(e,t),e===r.nextUserInteractionEvent&&(r.nextUserInteractionEvent=null,r.restoreSpeed()),r.config.skipInactive&&!r.nextUserInteractionEvent){for(var n=0,o=r.events;n<o.length;n++){var i=o[n];if(!(i.timestamp<=e.timestamp)&&r.isUserInteraction(i)){i.delay-e.delay>SKIP_TIME_THRESHOLD*r.config.speed&&(r.nextUserInteractionEvent=i);break}}if(r.nextUserInteractionEvent){r.noramlSpeed=r.config.speed;var a=r.nextUserInteractionEvent.delay-e.delay,s={speed:Math.min(Math.round(a/SKIP_TIME_INTERVAL),360)};r.setConfig(s),r.emitter.emit(ReplayerEvents.SkipStart,s)}}}}return function(){n&&n(),r.lastPlayedEvent=e,e===r.events[r.events.length-1]&&(r.restoreSpeed(),r.emitter.emit(ReplayerEvents.Finish))}},e.prototype.rebuildFullSnapshot=function(e){Object.keys(this.missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.missingNodeRetryMap),this.missingNodeRetryMap={},mirror.map=rebuild(e.data.node,this.iframe.contentDocument)[1];var t=document.createElement("style"),n=this.iframe.contentDocument,r=n.documentElement,o=n.head;r.insertBefore(t,o);for(var i=0;i<rules.length;i++)t.sheet.insertRule(rules[i],i);this.emitter.emit(ReplayerEvents.FullsnapshotRebuilded),this.waitForStylesheetLoad()},e.prototype.waitForStylesheetLoad=function(){var e=this,t=this.iframe.contentDocument.head;if(t){var n,r=new Set;t.querySelectorAll('link[rel="stylesheet"]').forEach(function(t){t.sheet||(0===r.size&&(e.pause(),e.emitter.emit(ReplayerEvents.LoadStylesheetStart),n=window.setTimeout(function(){e.resume(),n=-1},e.config.loadTimeout)),r.add(t),t.addEventListener("load",function(){r.delete(t),0===r.size&&-1!==n&&(e.resume(),e.emitter.emit(ReplayerEvents.LoadStylesheetEnd),n&&window.clearTimeout(n))}))})}},e.prototype.applyIncremental=function(e,t){var n=this,r=e.data;switch(r.source){case IncrementalSource.Mutation:r.removes.forEach(function(e){var t=mirror.getNode(e.id);if(!t)return n.warnNodeNotFound(r,e.id);var o=mirror.getNode(e.parentId);if(!o)return n.warnNodeNotFound(r,e.parentId);mirror.removeNodeFromMap(t),o&&o.removeChild(t)});var o=__assign({},this.missingNodeRetryMap);r.adds.forEach(function(e){var t=buildNodeWithSN(e.node,n.iframe.contentDocument,mirror.map,!0),i=mirror.getNode(e.parentId);if(!i)return n.warnNodeNotFound(r,e.parentId);var a=null,s=null;e.previousId&&(a=mirror.getNode(e.previousId)),e.nextId&&(s=mirror.getNode(e.nextId)),-1!==e.previousId&&-1!==e.nextId?(a&&a.nextSibling&&a.nextSibling.parentNode?i.insertBefore(t,a.nextSibling):s&&s.parentNode?i.insertBefore(t,s):i.appendChild(t),(e.previousId||e.nextId)&&n.resolveMissingNode(o,i,t,e)):o[e.node.id]={node:t,mutation:e}}),Object.keys(o).length&&Object.assign(this.missingNodeRetryMap,o),r.texts.forEach(function(e){var t=mirror.getNode(e.id);if(!t)return n.warnNodeNotFound(r,e.id);t.textContent=e.value}),r.attributes.forEach(function(e){var t=mirror.getNode(e.id);if(!t)return n.warnNodeNotFound(r,e.id);for(var o in e.attributes)if("string"==typeof o){var i=e.attributes[o];i?t.setAttribute(o,i):t.removeAttribute(o)}});break;case IncrementalSource.MouseMove:t||r.positions.forEach(function(t){var o={doAction:function(){n.moveAndHover(r,t.x,t.y,t.id)},delay:t.timeOffset+e.timestamp-n.baselineTime};n.timer.addAction(o)});break;case IncrementalSource.MouseInteraction:if(-1===r.id)break;var i=new Event(MouseInteractions[r.type].toLowerCase());if(!(a=mirror.getNode(r.id)))return this.debugNodeNotFound(r,r.id);switch(r.type){case MouseInteractions.Blur:a.blur&&a.blur();break;case MouseInteractions.Focus:a.focus&&a.focus({preventScroll:!0});break;case MouseInteractions.Click:t||(this.moveAndHover(r,r.x,r.y,r.id),this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:a.dispatchEvent(i)}break;case IncrementalSource.Scroll:if(-1===r.id)break;if(!(a=mirror.getNode(r.id)))return this.debugNodeNotFound(r,r.id);if(a===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:r.y,left:r.x,behavior:t?"auto":"smooth"});else try{a.scrollTop=r.y,a.scrollLeft=r.x}catch(e){}break;case IncrementalSource.ViewportResize:this.emitter.emit(ReplayerEvents.Resize,{width:r.width,height:r.height});break;case IncrementalSource.Input:if(-1===r.id)break;var a;if(!(a=mirror.getNode(r.id)))return this.debugNodeNotFound(r,r.id);try{a.checked=r.isChecked,a.value=r.text}catch(e){}}},e.prototype.resolveMissingNode=function(e,t,n,r){var o=r.previousId,i=r.nextId,a=o&&e[o],s=i&&e[i];if(a){var l=a,c=l.node,u=l.mutation;t.insertBefore(c,n),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,c,u)}if(s){var d=s;c=d.node,u=d.mutation;t.insertBefore(c,n.nextSibling),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,c,u)}},e.prototype.moveAndHover=function(e,t,n,r){this.mouse.style.left=t+"px",this.mouse.style.top=n+"px";var o=mirror.getNode(r);if(!o)return this.debugNodeNotFound(e,r);this.hoverElements(o)},e.prototype.hoverElements=function(e){this.iframe.contentDocument.querySelectorAll(".\\:hover").forEach(function(e){e.classList.remove(":hover")});for(var t=e;t;)t.classList.add(":hover"),t=t.parentElement},e.prototype.isUserInteraction=function(e){return e.type===EventType.IncrementalSnapshot&&(e.data.source>IncrementalSource.Mutation&&e.data.source<=IncrementalSource.Input)},e.prototype.restoreSpeed=function(){if(-1!==this.noramlSpeed){var e={speed:this.noramlSpeed};this.setConfig(e),this.emitter.emit(ReplayerEvents.SkipEnd,e),this.noramlSpeed=-1}},e.prototype.warnNodeNotFound=function(e,t){this.config.showWarning&&console.warn(REPLAY_CONSOLE_PREFIX,"Node with id '"+t+"' not found in",e)},e.prototype.debugNodeNotFound=function(e,t){this.config.showDebug&&console.log(REPLAY_CONSOLE_PREFIX,"Node with id '"+t+"' not found in",e)},e}();export{record,Replayer,mirror};
//# sourceMappingURL=rrweb.min.js.map

@@ -349,2 +349,16 @@ 'use strict';

}
function isAncestorRemoved(target) {
var id = mirror.getId(target);
if (!mirror.has(id)) {
return true;
}
if (target.parentNode &&
target.parentNode.nodeType === target.DOCUMENT_NODE) {
return false;
}
if (!target.parentNode) {
return true;
}
return isAncestorRemoved(target.parentNode);
}

@@ -395,2 +409,28 @@ var EventType;

function deepDelete(addsSet, n) {
addsSet["delete"](n);
n.childNodes.forEach(function (childN) { return deepDelete(addsSet, childN); });
}
function isParentRemoved(removes, n) {
var parentNode = n.parentNode;
if (!parentNode) {
return false;
}
var parentId = mirror.getId(parentNode);
if (removes.some(function (r) { return r.id === parentId; })) {
return true;
}
return isParentRemoved(removes, parentNode);
}
function isParentDropped(droppedSet, n) {
var parentNode = n.parentNode;
if (!parentNode) {
return false;
}
if (droppedSet.has(parentNode)) {
return true;
}
return isParentDropped(droppedSet, parentNode);
}
function initMutationObserver(cb) {

@@ -402,4 +442,4 @@ var observer = new MutationObserver(function (mutations) {

var adds = [];
var dropped = [];
var addsSet = new Set();
var droppedSet = new Set();
var genAdds = function (n) {

@@ -410,2 +450,3 @@ if (isBlocked(n)) {

addsSet.add(n);
droppedSet["delete"](n);
n.childNodes.forEach(function (childN) { return genAdds(childN); });

@@ -451,7 +492,7 @@ };

if (addsSet.has(n)) {
addsSet["delete"](n);
dropped.push(n);
deepDelete(addsSet, n);
droppedSet.add(n);
}
else if (addsSet.has(target) && nodeId === -1) ;
else if (!mirror.has(parentId)) ;
else if (isAncestorRemoved(target)) ;
else {

@@ -471,25 +512,4 @@ removes.push({

});
var isDropped = function (n) {
var parentNode = n.parentNode;
if (!parentNode) {
return false;
}
if (dropped.some(function (d) { return d === parentNode; })) {
return true;
}
return isDropped(parentNode);
};
var isRemoved = function (n) {
var parentNode = n.parentNode;
if (!parentNode) {
return false;
}
var parentId = mirror.getId(parentNode);
if (removes.some(function (r) { return r.id === parentId; })) {
return true;
}
return isRemoved(parentNode);
};
Array.from(addsSet).forEach(function (n) {
if (!isDropped(n) && !isRemoved(n)) {
if (!isParentDropped(droppedSet, n) && !isParentRemoved(removes, n)) {
adds.push({

@@ -507,3 +527,3 @@ parentId: mirror.getId(n.parentNode),

else {
dropped.push(n);
droppedSet.add(n);
}

@@ -510,0 +530,0 @@ });

{
"name": "rrweb",
"version": "0.7.8",
"version": "0.7.9",
"description": "record and replay the web",

@@ -5,0 +5,0 @@ "scripts": {

@@ -66,1 +66,9 @@ <p align="center">

[Using the REPL tool](./guide.md#REPL-tool)
## Who's using rrweb
<p align="center">
<a href="http://www.smartx.com/" target="_blank">
<img width="260px" src="https://www.rrweb.io/logos/smartx.png">
</a>
</p>

@@ -67,1 +67,9 @@ <p align="center">

[使用 REPL 工具](./guide.zh_CN.md#REPL-工具)
## Who's using rrweb
<p align="center">
<a href="http://www.smartx.com/" target="_blank">
<img width="260px" src="https://www.rrweb.io/logos/smartx.png">
</a>
</p>

@@ -234,2 +234,3 @@ import { serializedNodeWithId, idNodeMap, INode } from 'rrweb-snapshot';

showWarning: Boolean;
showDebug: Boolean;
};

@@ -236,0 +237,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc