Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rrweb

Package Overview
Dependencies
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rrweb - npm Package Compare versions

Comparing version 0.7.4 to 0.7.5

86

dist/record/rrweb-record.js

@@ -712,10 +712,54 @@ var rrwebRecord = (function () {

if (options === void 0) { options = {}; }
var emit = options.emit;
var emit = options.emit, checkoutEveryNms = options.checkoutEveryNms, checkoutEveryNth = options.checkoutEveryNth;
if (!emit) {
throw new Error('emit function is required');
}
var lastFullSnapshotEvent;
var incrementalSnapshotCount = 0;
var wrappedEmit = function (e, isCheckout) {
emit(e, isCheckout);
if (e.type === EventType.FullSnapshot) {
lastFullSnapshotEvent = e;
incrementalSnapshotCount = 0;
}
else if (e.type === EventType.IncrementalSnapshot) {
incrementalSnapshotCount++;
var exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth;
var exceedTime = checkoutEveryNms &&
e.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms;
if (exceedCount || exceedTime) {
takeFullSnapshot(true);
}
}
};
function takeFullSnapshot(isCheckout) {
if (isCheckout === void 0) { isCheckout = false; }
wrappedEmit(wrapEvent({
type: EventType.Meta,
data: {
href: window.location.href,
width: getWindowWidth(),
height: getWindowHeight()
}
}), isCheckout);
var _a = snapshot(document), node = _a[0], idNodeMap = _a[1];
if (!node) {
return console.warn('Failed to snapshot the document');
}
mirror.map = idNodeMap;
wrappedEmit(wrapEvent({
type: EventType.FullSnapshot,
data: {
node: node,
initialOffset: {
left: document.documentElement.scrollLeft,
top: document.documentElement.scrollTop
}
}
}));
}
try {
var handlers_1 = [];
handlers_1.push(on('DOMContentLoaded', function () {
emit(wrapEvent({
wrappedEmit(wrapEvent({
type: EventType.DomContentLoaded,

@@ -726,28 +770,6 @@ data: {}

var init_1 = function () {
emit(wrapEvent({
type: EventType.Meta,
data: {
href: window.location.href,
width: getWindowWidth(),
height: getWindowHeight()
}
}));
var _a = snapshot(document), node = _a[0], idNodeMap = _a[1];
if (!node) {
return console.warn('Failed to snapshot the document');
}
mirror.map = idNodeMap;
emit(wrapEvent({
type: EventType.FullSnapshot,
data: {
node: node,
initialOffset: {
left: document.documentElement.scrollLeft,
top: document.documentElement.scrollTop
}
}
}));
takeFullSnapshot();
handlers_1.push(initObservers({
mutationCb: function (m) {
return emit(wrapEvent({
return wrappedEmit(wrapEvent({
type: EventType.IncrementalSnapshot,

@@ -758,3 +780,3 @@ data: __assign({ source: IncrementalSource.Mutation }, m)

mousemoveCb: function (positions) {
return emit(wrapEvent({
return wrappedEmit(wrapEvent({
type: EventType.IncrementalSnapshot,

@@ -768,3 +790,3 @@ data: {

mouseInteractionCb: function (d) {
return emit(wrapEvent({
return wrappedEmit(wrapEvent({
type: EventType.IncrementalSnapshot,

@@ -775,3 +797,3 @@ data: __assign({ source: IncrementalSource.MouseInteraction }, d)

scrollCb: function (p) {
return emit(wrapEvent({
return wrappedEmit(wrapEvent({
type: EventType.IncrementalSnapshot,

@@ -782,3 +804,3 @@ data: __assign({ source: IncrementalSource.Scroll }, p)

viewportResizeCb: function (d) {
return emit(wrapEvent({
return wrappedEmit(wrapEvent({
type: EventType.IncrementalSnapshot,

@@ -789,3 +811,3 @@ data: __assign({ source: IncrementalSource.ViewportResize }, d)

inputCb: function (v) {
return emit(wrapEvent({
return wrappedEmit(wrapEvent({
type: EventType.IncrementalSnapshot,

@@ -803,3 +825,3 @@ data: __assign({ source: IncrementalSource.Input }, v)

handlers_1.push(on('load', function () {
emit(wrapEvent({
wrappedEmit(wrapEvent({
type: EventType.Load,

@@ -806,0 +828,0 @@ data: {}

@@ -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(!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("/"),d=c.split("/");s.pop();for(var l=0,f=d;l<f.length;l++){var p=f[l];"."!==p&&(".."===p?s.pop():s.push(p))}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,d=Array.from(t.attributes);s<d.length;s++){var l=d[s],f=l.name,p=l.value;a[f]="src"===f||"href"===f?i(n,p):"style"===f?u(p,location.href):p}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){p=t.value;"radio"!==a.type&&"checkbox"!==a.type&&p?a.value=p:t.checked&&(a.checked=t.checked)}if("option"===o){var v=t.parentElement;a.value===v.value&&(a.selected=t.selected)}if(r){var g=t.getBoundingClientRect(),y=g.width,E=g.height;a.rr_width=y+"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 d(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 l=0,f=Array.from(t.childNodes);l<f.length;l++){var p=d(f[l],r,o);p&&i.childNodes.push(p)}return i}function l(e){n=1;var t={};return[d(e,e,t),t]}function f(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 p={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return p.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete p.map[t],e.childNodes&&e.childNodes.forEach(function(e){return p.removeNodeFromMap(e)})},has:function(e){return p.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 g,y,E,b="rr-block";function w(e){return!!e&&(e.nodeType===e.ELEMENT_NODE&&e.classList.contains(b)||w(e.parentNode))}function C(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(!w(n.target)){var r=p.getId(n.target),o=n.clientX,a=n.clientY;e({type:E[t],id:r,x:o,y:a})}}}(n);t.push(f(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"}(g||(g={})),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"}(y||(y={})),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={}));var N=["INPUT","TEXTAREA","SELECT"],T=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],I="rr-ignore",D=new WeakMap;function M(e){function n(e){var t=e.target;if(t&&t.tagName&&!(N.indexOf(t.tagName)<0)&&!w(t)){var n=t.type;if("password"!==n&&!t.classList.contains(I)){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=p.getId(n);e(t({},r,{id:a}))}}var o=["input","change"].map(function(e){return f(e,n)}),a=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");return a&&a.set&&o.push.apply(o,T.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 S(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){w(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,d=e.addedNodes,l=e.removedNodes,f=e.attributeName;switch(t){case"characterData":var m=a.textContent;w(a)||m===s||n.push({value:m,node:a});break;case"attributes":if(m=a.getAttribute(f),w(a)||m===s)return;var h=r.find(function(e){return e.node===a});h||(h={node:a,attributes:{}},r.push(h)),h.attributes[f]=m;break;case"childList":d.forEach(function(e){return c(e)}),l.forEach(function(e){w(e)||(i.has(e)?(i.delete(e),u.push(e)):i.has(a)&&!p.getId(e)||o.push({parentId:p.getId(a),id:p.getId(e)}),p.removeNodeFromMap(e))})}}),o=o.map(function(e){return e.parentNode&&(e.parentId=p.getId(e.parentNode),delete e.parentNode),e});var s=function(e){var t=e.parentNode;return!!t&&(!!u.some(function(e){return e===t})||s(t))},l=function(e){var t=e.parentNode;if(!t)return!1;var n=p.getId(t);return!!o.some(function(e){return e.id===n})||l(t)};Array.from(i).forEach(function(e){s(e)||l(e)?u.push(e):a.push({parentId:p.getId(e.parentNode),previousId:e.previousSibling?p.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?p.getId(e.nextSibling):e.nextSibling,node:d(e,document,p.map,!0)})});var f={texts:n.map(function(e){return{id:p.getId(e.node),value:e.value}}).filter(function(e){return p.has(e.id)}),attributes:r.map(function(e){return{id:p.getId(e.node),attributes:e.attributes}}).filter(function(e){return p.has(e.id)}),removes:o,adds:a};(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),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 f("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:p.getId(u),timeOffset:Date.now()-t}),r()},20,{trailing:!1}))}(e.mousemoveCb),a=C(e.mouseInteractionCb),u=function(e){return f("scroll",m(function(t){if(t.target&&!w(t.target)){var n=p.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 f("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 x(e){return t({},e,{timestamp:Date.now()})}return function(e){void 0===e&&(e={});var n=e.emit;if(!n)throw new Error("emit function is required");try{var r=[];r.push(f("DOMContentLoaded",function(){n(x({type:g.DomContentLoaded,data:{}}))}));var o=function(){n(x({type:g.Meta,data:{href:window.location.href,width:v(),height:h()}}));var e=l(document),o=e[0],a=e[1];if(!o)return console.warn("Failed to snapshot the document");p.map=a,n(x({type:g.FullSnapshot,data:{node:o,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}})),r.push(S({mutationCb:function(e){return n(x({type:g.IncrementalSnapshot,data:t({source:y.Mutation},e)}))},mousemoveCb:function(e){return n(x({type:g.IncrementalSnapshot,data:{source:y.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return n(x({type:g.IncrementalSnapshot,data:t({source:y.MouseInteraction},e)}))},scrollCb:function(e){return n(x({type:g.IncrementalSnapshot,data:t({source:y.Scroll},e)}))},viewportResizeCb:function(e){return n(x({type:g.IncrementalSnapshot,data:t({source:y.ViewportResize},e)}))},inputCb:function(e){return n(x({type:g.IncrementalSnapshot,data:t({source:y.Input},e)}))}}))};return"interactive"===document.readyState||"complete"===document.readyState?o():r.push(f("load",function(){n(x({type:g.Load,data:{}})),o()},window)),function(){r.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 u(e,t){return e.replace(r,function(e,n,r,u){var i,c=n||r||u;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("/"),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 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,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?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 g=t.getBoundingClientRect(),y=g.width,E=g.height;a.rr_width=y+"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=u(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 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 l=0,p=Array.from(t.childNodes);l<p.length;l++){var f=d(p[l],r,o);f&&i.childNodes.push(f)}return i}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 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 g,y,E,b="rr-block";function w(e){return!!e&&(e.nodeType===e.ELEMENT_NODE&&e.classList.contains(b)||w(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(!w(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"}(g||(g={})),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"}(y||(y={})),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={}));var C=["INPUT","TEXTAREA","SELECT"],I=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],T="rr-ignore",D=new WeakMap;function M(e){function n(e){var t=e.target;if(t&&t.tagName&&!(C.indexOf(t.tagName)<0)&&!w(t)){var n=t.type;if("password"!==n&&!t.classList.contains(T)){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 S(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){w(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,d=e.addedNodes,l=e.removedNodes,p=e.attributeName;switch(t){case"characterData":var m=a.textContent;w(a)||m===s||n.push({value:m,node:a});break;case"attributes":if(m=a.getAttribute(p),w(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){w(e)||(i.has(e)?(i.delete(e),u.push(e)):i.has(a)&&!f.getId(e)||o.push({parentId:f.getId(a),id:f.getId(e)}),f.removeNodeFromMap(e))})}}),o=o.map(function(e){return e.parentNode&&(e.parentId=f.getId(e.parentNode),delete e.parentNode),e});var s=function(e){var t=e.parentNode;return!!t&&(!!u.some(function(e){return e===t})||s(t))},l=function(e){var t=e.parentNode;if(!t)return!1;var n=f.getId(t);return!!o.some(function(e){return e.id===n})||l(t)};Array.from(i).forEach(function(e){s(e)||l(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:d(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()},20,{trailing:!1}))}(e.mousemoveCb),a=N(e.mouseInteractionCb),u=function(e){return p("scroll",m(function(t){if(t.target&&!w(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 x(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===g.FullSnapshot)n=e,u=0;else if(e.type===g.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(x({type:g.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,i(x({type:g.FullSnapshot,data:{node:n,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}}))}try{var s=[];s.push(p("DOMContentLoaded",function(){i(x({type:g.DomContentLoaded,data:{}}))}));var d=function(){c(),s.push(S({mutationCb:function(e){return i(x({type:g.IncrementalSnapshot,data:t({source:y.Mutation},e)}))},mousemoveCb:function(e){return i(x({type:g.IncrementalSnapshot,data:{source:y.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return i(x({type:g.IncrementalSnapshot,data:t({source:y.MouseInteraction},e)}))},scrollCb:function(e){return i(x({type:g.IncrementalSnapshot,data:t({source:y.Scroll},e)}))},viewportResizeCb:function(e){return i(x({type:g.IncrementalSnapshot,data:t({source:y.ViewportResize},e)}))},inputCb:function(e){return i(x({type:g.IncrementalSnapshot,data:t({source:y.Input},e)}))}}))};return"interactive"===document.readyState||"complete"===document.readyState?d():s.push(p("load",function(){i(x({type:g.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(!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:(I=e,"svg"===I.tagName||I instanceof SVGElement||void 0),needBlock:o};case e.TEXT_NODE:var w=e.parentNode&&e.parentNode.tagName,E=e.textContent,T="STYLE"===w||void 0;return T&&E&&(E=s(E,location.href)),"SCRIPT"===w&&(E="SCRIPT_PLACEHOLDER"),{type:t.Text,textContent:E||"",isStyle:T};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 I}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 T(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function I(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}var x,C,N,S="rr-block";function M(e){return!!e&&(e.nodeType===e.ELEMENT_NODE&&e.classList.contains(S)||M(e.parentNode))}function D(e){var t=[];return Object.keys(N).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(n){var o=n.toLowerCase(),r=function(t){return function(n){if(!M(n.target)){var o=w.getId(n.target),r=n.clientX,i=n.clientY;e({type:N[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"}(x||(x={})),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"}(C||(C={})),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"}(N||(N={}));var O=["INPUT","TEXTAREA","SELECT"],L=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],k="rr-ignore",A=new WeakMap;function _(e){function t(e){var t=e.target;if(t&&t.tagName&&!(O.indexOf(t.tagName)<0)&&!M(t)){var n=t.type;if("password"!==n&&!t.classList.contains(k)){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=A.get(t);if(!r||r.text!==o.text||r.isChecked!==o.isChecked){A.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,L.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 R(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){M(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;M(i)||p===c||n.push({value:p,node:i});break;case"attributes":if(p=i.getAttribute(f),M(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){M(e)||(s.has(e)?(s.delete(e),a.push(e)):s.has(i)&&!w.getId(e)||r.push({parentId:w.getId(i),id:w.getId(e)}),w.removeNodeFromMap(e))})}}),r=r.map(function(e){return e.parentNode&&(e.parentId=w.getId(e.parentNode),delete e.parentNode),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()},20,{trailing:!1}))}(e.mousemoveCb),i=D(e.mouseInteractionCb),a=function(e){return b("scroll",E(function(t){if(t.target&&!M(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=T(),n=I();e({width:Number(n),height:Number(t)})},200),window)}(e.viewportResizeCb),l=_(e.inputCb);return function(){o.disconnect(),r(),i(),a(),s(),l()}}function F(e){return n({},e,{timestamp:Date.now()})}function B(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 j=Object.freeze({default:B});var z,P=(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})}}}}()}(z={exports:{}},z.exports),z.exports).polyfill,X=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}(),Y=["iframe, .rr-block { background: #ccc }","noscript { display: none !important; }"];P();var V=B||j,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};this.config=Object.assign({},n,t),this.timer=new X(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()},e.prototype.pause=function(){this.timer.clear(),this.emitter.emit("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("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===x.IncrementalSnapshot&&e.data.source===C.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 x.DomContentLoaded:case x.Load:break;case x.Meta:n=function(){return o.emitter.emit("resize",{width:e.data.width,height:e.data.height})};break;case x.FullSnapshot:n=function(){o.rebuildFullSnapshot(e),o.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case x.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("skip-start",s)}}}}return function(){n&&n(),o.lastPlayedEvent=e,e===o.events[o.events.length-1]&&(o.restoreSpeed(),o.emitter.emit("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<Y.length;l++)r.sheet.insertRule(Y[l],l);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("wait-stylesheet"),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("stylesheet-loaded"),n&&window.clearTimeout(n))}))})}},e.prototype.applyIncremental=function(e,t){var o=this,r=e.data;switch(r.source){case C.Mutation:r.removes.forEach(function(e){var t=w.getNode(e.id);if(t){var n=w.getNode(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),r=null,a=null;e.previousId&&(r=w.getNode(e.previousId)),e.nextId&&(a=w.getNode(e.nextId)),-1!==e.previousId&&-1!==e.nextId?(r&&r.nextSibling&&r.nextSibling.parentNode?n.insertBefore(t,r.nextSibling):a&&a.parentNode?n.insertBefore(t,a):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){w.getNode(e.id).textContent=e.value}),r.attributes.forEach(function(e){var t=w.getNode(e.id);for(var n in e.attributes)if("string"==typeof n){var o=e.attributes[n];o?t.setAttribute(n,o):t.removeAttribute(n)}});break;case C.MouseMove:t||r.positions.forEach(function(t){var n={doAction:function(){o.mouse.style.left=t.x+"px",o.mouse.style.top=t.y+"px";var e=w.getNode(t.id);e&&o.hoverElements(e)},delay:t.timeOffset+e.timestamp-o.baselineTime};o.timer.addAction(n)});break;case C.MouseInteraction:if(-1===r.id)break;var a=new Event(N[r.type].toLowerCase()),s=w.getNode(r.id);switch(r.type){case N.Blur:s.blur();break;case N.Focus:s.focus({preventScroll:!0});break;case N.Click:t||(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:s.dispatchEvent(a)}break;case C.Scroll:if(-1===r.id)break;if((s=w.getNode(r.id))===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 C.ViewportResize:this.emitter.emit("resize",{width:r.width,height:r.height});break;case C.Input:if(-1===r.id)break;s=w.getNode(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.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===x.IncrementalSnapshot&&(e.data.source>C.Mutation&&e.data.source<=C.Input)},e.prototype.restoreSpeed=function(){if(-1!==this.noramlSpeed){var e={speed:this.noramlSpeed};this.setConfig(e),this.emitter.emit("skip-end",e),this.noramlSpeed=-1}},e}();return e.record=function(e){void 0===e&&(e={});var t=e.emit;if(!t)throw new Error("emit function is required");try{var o=[];o.push(b("DOMContentLoaded",function(){t(F({type:x.DomContentLoaded,data:{}}))}));var r=function(){t(F({type:x.Meta,data:{href:window.location.href,width:I(),height:T()}}));var e=f(document),r=e[0],i=e[1];if(!r)return console.warn("Failed to snapshot the document");w.map=i,t(F({type:x.FullSnapshot,data:{node:r,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}})),o.push(R({mutationCb:function(e){return t(F({type:x.IncrementalSnapshot,data:n({source:C.Mutation},e)}))},mousemoveCb:function(e){return t(F({type:x.IncrementalSnapshot,data:{source:C.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return t(F({type:x.IncrementalSnapshot,data:n({source:C.MouseInteraction},e)}))},scrollCb:function(e){return t(F({type:x.IncrementalSnapshot,data:n({source:C.Scroll},e)}))},viewportResizeCb:function(e){return t(F({type:x.IncrementalSnapshot,data:n({source:C.ViewportResize},e)}))},inputCb:function(e){return t(F({type:x.IncrementalSnapshot,data:n({source:C.Input},e)}))}}))};return"interactive"===document.readyState||"complete"===document.readyState?r():o.push(b("load",function(){t(F({type:x.Load,data:{}})),r()},window)),function(){o.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,c=n||o||r;if(!i.test(c))return"url('"+c+"')";if(a.test(c))return"url("+c+")";if("/"===c[0])return"url('"+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+c)+"')";var l=t.split("/"),u=c.split("/");l.pop();for(var d=0,f=u;d<f.length;d++){var p=f[d];"."!==p&&(".."===p?l.pop():l.push(p))}return"url('"+l.join("/")+"')"})}function c(e,t){var n=e.createElement("a");return n.href=t,n.href}var l="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(l),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?c(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:(I=e,"svg"===I.tagName||I instanceof SVGElement||void 0),needBlock:o};case e.TEXT_NODE:var w=e.parentNode&&e.parentNode.tagName,E=e.textContent,T="STYLE"===w||void 0;return T&&E&&(E=s(E,location.href)),"SCRIPT"===w&&(E="SCRIPT_PLACEHOLDER"),{type:t.Text,textContent:E||"",isStyle:T};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 I}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 c=!i;if(s.type===t.Element&&(c=c&&!s.needBlock,delete s.needBlock),(s.type===t.Document||s.type===t.Element)&&c)for(var l=0,f=Array.from(e.childNodes);l<f.length;l++){var p=d(f[l],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,c="style"===o&&"_cssText"===i;if(c&&(a=v(a)),s||c){var l=n.createTextNode(a);r.appendChild(l);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 c=s[a],l=g(c,n,o);l?i.appendChild(l):console.warn("Failed to rebuild",c)}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,c=arguments;a<=0||a>t?(o&&(window.clearTimeout(o),o=null),r=i,e.apply(s,c)):o||!1===n.trailing||(o=window.setTimeout(function(){r=!1===n.leading?0:Date.now(),o=null,e.apply(s,c)},a))}}function T(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function I(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}var N,x,C,S="rr-block";function M(e){return!!e&&(e.nodeType===e.ELEMENT_NODE&&e.classList.contains(S)||M(e.parentNode))}function D(e){var t=[];return Object.keys(C).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(n){var o=n.toLowerCase(),r=function(t){return function(n){if(!M(n.target)){var o=w.getId(n.target),r=n.clientX,i=n.clientY;e({type:C[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"}(N||(N={})),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"}(x||(x={})),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"}(C||(C={}));var O=["INPUT","TEXTAREA","SELECT"],k=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],L="rr-ignore",A=new WeakMap;function F(e){function t(e){var t=e.target;if(t&&t.tagName&&!(O.indexOf(t.tagName)<0)&&!M(t)){var n=t.type;if("password"!==n&&!t.classList.contains(L)){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=A.get(t);if(!r||r.text!==o.text||r.isChecked!==o.isChecked){A.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,k.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,c=function(e){M(e)||(s.add(e),e.childNodes.forEach(function(e){return c(e)}))};e.forEach(function(e){var t=e.type,i=e.target,l=e.oldValue,u=e.addedNodes,d=e.removedNodes,f=e.attributeName;switch(t){case"characterData":var p=i.textContent;M(i)||p===l||n.push({value:p,node:i});break;case"attributes":if(p=i.getAttribute(f),M(i)||p===l)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 c(e)}),d.forEach(function(e){M(e)||(s.has(e)?(s.delete(e),a.push(e)):s.has(i)&&!w.getId(e)||r.push({parentId:w.getId(i),id:w.getId(e)}),w.removeNodeFromMap(e))})}}),r=r.map(function(e){return e.parentNode&&(e.parentId=w.getId(e.parentNode),delete e.parentNode),e});var l=function(e){var t=e.parentNode;return!!t&&(!!a.some(function(e){return e===t})||l(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){l(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()},20,{trailing:!1}))}(e.mousemoveCb),i=D(e.mouseInteractionCb),a=function(e){return b("scroll",E(function(t){if(t.target&&!M(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=T(),n=I();e({width:Number(n),height:Number(t)})},200),window)}(e.viewportResizeCb),c=F(e.inputCb);return function(){o.disconnect(),r(),i(),a(),s(),c()}}function R(e){return n({},e,{timestamp:Date.now()})}function B(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 j=Object.freeze({default:B});var z,P=(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||c,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!==l(arguments[0])?h.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):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]&&(l(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!==l(arguments[0])){var e=arguments[0].left,t=arguments[0].top;h.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");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!==l(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!==l(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 c(e,t){this.scrollLeft=e,this.scrollTop=t}function l(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function 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,c=(a()-t.startTime)/r;s=c=c>1?1:c,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,l,u,d,f=a();n===t.body?(s=e,l=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(s=n,l=n.scrollLeft,u=n.scrollTop,d=c),p({scrollable:s,method:d,startTime:f,startX:l,startY:u,x:o,y:r})}}}}()}(z={exports:{}},z.exports),z.exports).polyfill,X=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}(),Y=["iframe, .rr-block { background: #ccc }","noscript { display: none !important; }"];P();var V=B||j,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 X(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()},e.prototype.pause=function(){this.timer.clear(),this.emitter.emit("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("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===N.IncrementalSnapshot&&e.data.source===x.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 N.DomContentLoaded:case N.Load:break;case N.Meta:n=function(){return o.emitter.emit("resize",{width:e.data.width,height:e.data.height})};break;case N.FullSnapshot:n=function(){o.rebuildFullSnapshot(e),o.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case N.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("skip-start",s)}}}}return function(){n&&n(),o.lastPlayedEvent=e,e===o.events[o.events.length-1]&&(o.restoreSpeed(),o.emitter.emit("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 c=0;c<Y.length;c++)r.sheet.insertRule(Y[c],c);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("wait-stylesheet"),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("stylesheet-loaded"),n&&window.clearTimeout(n))}))})}},e.prototype.applyIncremental=function(e,t){var o=this,r=e.data;switch(r.source){case x.Mutation:r.removes.forEach(function(e){var t=w.getNode(e.id);if(!t)return o.warnTargetNotFound(r,e.id);var n=w.getNode(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),r=null,a=null;e.previousId&&(r=w.getNode(e.previousId)),e.nextId&&(a=w.getNode(e.nextId)),-1!==e.previousId&&-1!==e.nextId?(r&&r.nextSibling&&r.nextSibling.parentNode?n.insertBefore(t,r.nextSibling):a&&a.parentNode?n.insertBefore(t,a):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){w.getNode(e.id).textContent=e.value}),r.attributes.forEach(function(e){var t=w.getNode(e.id);for(var n in e.attributes)if("string"==typeof n){var o=e.attributes[n];o?t.setAttribute(n,o):t.removeAttribute(n)}});break;case x.MouseMove:t||r.positions.forEach(function(t){var n={doAction:function(){o.mouse.style.left=t.x+"px",o.mouse.style.top=t.y+"px";var e=w.getNode(t.id);if(!e)return o.warnTargetNotFound(r,t.id);o.hoverElements(e)},delay:t.timeOffset+e.timestamp-o.baselineTime};o.timer.addAction(n)});break;case x.MouseInteraction:if(-1===r.id)break;var a=new Event(C[r.type].toLowerCase());if(!(s=w.getNode(r.id)))return this.warnTargetNotFound(r,r.id);switch(r.type){case C.Blur:s.blur();break;case C.Focus:s.focus({preventScroll:!0});break;case C.Click:t||(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:s.dispatchEvent(a)}break;case x.Scroll:if(-1===r.id)break;if(!(s=w.getNode(r.id)))return this.warnTargetNotFound(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 x.ViewportResize:this.emitter.emit("resize",{width:r.width,height:r.height});break;case x.Input:if(-1===r.id)break;var s;if(!(s=w.getNode(r.id)))return this.warnTargetNotFound(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 c=a,l=c.node,u=c.mutation;t.insertBefore(l,n),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,l,u)}if(s){var d=s;l=d.node,u=d.mutation;t.insertBefore(l,n.nextSibling),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,l,u)}},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===N.IncrementalSnapshot&&(e.data.source>x.Mutation&&e.data.source<=x.Input)},e.prototype.restoreSpeed=function(){if(-1!==this.noramlSpeed){var e={speed:this.noramlSpeed};this.setConfig(e),this.emitter.emit("skip-end",e),this.noramlSpeed=-1}},e.prototype.warnTargetNotFound=function(e,t){this.config.showWarning&&console.warn("[replayer]","target 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===N.FullSnapshot)t=e,a=0;else if(e.type===N.IncrementalSnapshot){a++;var s=i&&a>=i,l=r&&e.timestamp-t.timestamp>r;(s||l)&&c(!0)}};function c(e){void 0===e&&(e=!1),s(R({type:N.Meta,data:{href:window.location.href,width:I(),height:T()}}),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(R({type:N.FullSnapshot,data:{node:n,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}}))}try{var l=[];l.push(b("DOMContentLoaded",function(){s(R({type:N.DomContentLoaded,data:{}}))}));var u=function(){c(),l.push(_({mutationCb:function(e){return s(R({type:N.IncrementalSnapshot,data:n({source:x.Mutation},e)}))},mousemoveCb:function(e){return s(R({type:N.IncrementalSnapshot,data:{source:x.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return s(R({type:N.IncrementalSnapshot,data:n({source:x.MouseInteraction},e)}))},scrollCb:function(e){return s(R({type:N.IncrementalSnapshot,data:n({source:x.Scroll},e)}))},viewportResizeCb:function(e){return s(R({type:N.IncrementalSnapshot,data:n({source:x.ViewportResize},e)}))},inputCb:function(e){return s(R({type:N.IncrementalSnapshot,data:n({source:x.Input},e)}))}}))};return"interactive"===document.readyState||"complete"===document.readyState?u():l.push(b("load",function(){s(R({type:N.Load,data:{}})),u()},window)),function(){l.forEach(function(e){return e()})}}catch(e){console.warn(e)}},e.Replayer=U,e.mirror=w,e}({});
//# sourceMappingURL=rrweb.min.js.map

@@ -709,10 +709,54 @@ /*! *****************************************************************************

if (options === void 0) { options = {}; }
var emit = options.emit;
var emit = options.emit, checkoutEveryNms = options.checkoutEveryNms, checkoutEveryNth = options.checkoutEveryNth;
if (!emit) {
throw new Error('emit function is required');
}
var lastFullSnapshotEvent;
var incrementalSnapshotCount = 0;
var wrappedEmit = function (e, isCheckout) {
emit(e, isCheckout);
if (e.type === EventType.FullSnapshot) {
lastFullSnapshotEvent = e;
incrementalSnapshotCount = 0;
}
else if (e.type === EventType.IncrementalSnapshot) {
incrementalSnapshotCount++;
var exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth;
var exceedTime = checkoutEveryNms &&
e.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms;
if (exceedCount || exceedTime) {
takeFullSnapshot(true);
}
}
};
function takeFullSnapshot(isCheckout) {
if (isCheckout === void 0) { isCheckout = false; }
wrappedEmit(wrapEvent({
type: EventType.Meta,
data: {
href: window.location.href,
width: getWindowWidth(),
height: getWindowHeight()
}
}), isCheckout);
var _a = snapshot(document), node = _a[0], idNodeMap = _a[1];
if (!node) {
return console.warn('Failed to snapshot the document');
}
mirror.map = idNodeMap;
wrappedEmit(wrapEvent({
type: EventType.FullSnapshot,
data: {
node: node,
initialOffset: {
left: document.documentElement.scrollLeft,
top: document.documentElement.scrollTop
}
}
}));
}
try {
var handlers_1 = [];
handlers_1.push(on('DOMContentLoaded', function () {
emit(wrapEvent({
wrappedEmit(wrapEvent({
type: EventType.DomContentLoaded,

@@ -723,28 +767,6 @@ data: {}

var init_1 = function () {
emit(wrapEvent({
type: EventType.Meta,
data: {
href: window.location.href,
width: getWindowWidth(),
height: getWindowHeight()
}
}));
var _a = snapshot(document), node = _a[0], idNodeMap = _a[1];
if (!node) {
return console.warn('Failed to snapshot the document');
}
mirror.map = idNodeMap;
emit(wrapEvent({
type: EventType.FullSnapshot,
data: {
node: node,
initialOffset: {
left: document.documentElement.scrollLeft,
top: document.documentElement.scrollTop
}
}
}));
takeFullSnapshot();
handlers_1.push(initObservers({
mutationCb: function (m) {
return emit(wrapEvent({
return wrappedEmit(wrapEvent({
type: EventType.IncrementalSnapshot,

@@ -755,3 +777,3 @@ data: __assign({ source: IncrementalSource.Mutation }, m)

mousemoveCb: function (positions) {
return emit(wrapEvent({
return wrappedEmit(wrapEvent({
type: EventType.IncrementalSnapshot,

@@ -765,3 +787,3 @@ data: {

mouseInteractionCb: function (d) {
return emit(wrapEvent({
return wrappedEmit(wrapEvent({
type: EventType.IncrementalSnapshot,

@@ -772,3 +794,3 @@ data: __assign({ source: IncrementalSource.MouseInteraction }, d)

scrollCb: function (p) {
return emit(wrapEvent({
return wrappedEmit(wrapEvent({
type: EventType.IncrementalSnapshot,

@@ -779,3 +801,3 @@ data: __assign({ source: IncrementalSource.Scroll }, p)

viewportResizeCb: function (d) {
return emit(wrapEvent({
return wrappedEmit(wrapEvent({
type: EventType.IncrementalSnapshot,

@@ -786,3 +808,3 @@ data: __assign({ source: IncrementalSource.ViewportResize }, d)

inputCb: function (v) {
return emit(wrapEvent({
return wrappedEmit(wrapEvent({
type: EventType.IncrementalSnapshot,

@@ -800,3 +822,3 @@ data: __assign({ source: IncrementalSource.Input }, v)

handlers_1.push(on('load', function () {
emit(wrapEvent({
wrappedEmit(wrapEvent({
type: EventType.Load,

@@ -803,0 +825,0 @@ data: {}

@@ -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(!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,E=e.textContent,g="STYLE"===h||void 0;return g&&E&&(E=absoluteToStylesheet(E,location.href)),"SCRIPT"===h&&(E="SCRIPT_PLACEHOLDER"),{type:NodeType.Text,textContent:E||"",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 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,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){isBlocked(e)||(u.has(e)?(u.delete(e),a.push(e)):u.has(i)&&!mirror.getId(e)||o.push({parentId:mirror.getId(i),id:mirror.getId(e)}),mirror.removeNodeFromMap(e))})}}),o=o.map(function(e){return e.parentNode&&(e.parentId=mirror.getId(e.parentNode),delete e.parentNode),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()},20,{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={}));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=e.emit;if(!t)throw new Error("emit function is required");try{var n=[];n.push(on("DOMContentLoaded",function(){t(wrapEvent({type:EventType.DomContentLoaded,data:{}}))}));var r=function(){t(wrapEvent({type:EventType.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}));var e=snapshot(document),r=e[0],o=e[1];if(!r)return console.warn("Failed to snapshot the document");mirror.map=o,t(wrapEvent({type:EventType.FullSnapshot,data:{node:r,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}})),n.push(initObservers({mutationCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Mutation},e)}))},mousemoveCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:{source:IncrementalSource.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.MouseInteraction},e)}))},scrollCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Scroll},e)}))},viewportResizeCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.ViewportResize},e)}))},inputCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Input},e)}))}}))};return"interactive"===document.readyState||"complete"===document.readyState?r():n.push(on("load",function(){t(wrapEvent({type:EventType.Load,data:{}})),r()},window)),function(){n.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(!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,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,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,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){isBlocked(e)||(u.has(e)?(u.delete(e),a.push(e)):u.has(i)&&!mirror.getId(e)||o.push({parentId:mirror.getId(i),id:mirror.getId(e)}),mirror.removeNodeFromMap(e))})}}),o=o.map(function(e){return e.parentNode&&(e.parentId=mirror.getId(e.parentNode),delete e.parentNode),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()},20,{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={}));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;
//# 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(!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,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){isBlocked(e)||(s.has(e)?(s.delete(e),a.push(e)):s.has(i)&&!mirror.getId(e)||o.push({parentId:mirror.getId(i),id:mirror.getId(e)}),mirror.removeNodeFromMap(e))})}}),o=o.map(function(e){return e.parentNode&&(e.parentId=mirror.getId(e.parentNode),delete e.parentNode),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()},20,{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={}));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=e.emit;if(!t)throw new Error("emit function is required");try{var n=[];n.push(on("DOMContentLoaded",function(){t(wrapEvent({type:EventType.DomContentLoaded,data:{}}))}));var r=function(){t(wrapEvent({type:EventType.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}));var e=snapshot(document),r=e[0],o=e[1];if(!r)return console.warn("Failed to snapshot the document");mirror.map=o,t(wrapEvent({type:EventType.FullSnapshot,data:{node:r,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}})),n.push(initObservers({mutationCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Mutation},e)}))},mousemoveCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:{source:IncrementalSource.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.MouseInteraction},e)}))},scrollCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Scroll},e)}))},viewportResizeCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.ViewportResize},e)}))},inputCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Input},e)}))}}))};return"interactive"===document.readyState||"complete"===document.readyState?r():n.push(on("load",function(){t(wrapEvent({type:EventType.Load,data:{}})),r()},window)),function(){n.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,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};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()},e.prototype.pause=function(){this.timer.clear(),this.emitter.emit("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("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("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("skip-start",s)}}}}return function(){n&&n(),r.lastPlayedEvent=e,e===r.events[r.events.length-1]&&(r.restoreSpeed(),r.emitter.emit("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.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("wait-stylesheet"),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("stylesheet-loaded"),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){var n=mirror.getNode(e.parentId);mirror.removeNodeFromMap(t),n&&n.removeChild(t)}});var o=__assign({},this.missingNodeRetryMap);r.adds.forEach(function(e){var t=buildNodeWithSN(e.node,n.iframe.contentDocument,mirror.map,!0),r=mirror.getNode(e.parentId),i=null,a=null;e.previousId&&(i=mirror.getNode(e.previousId)),e.nextId&&(a=mirror.getNode(e.nextId)),-1!==e.previousId&&-1!==e.nextId?(i&&i.nextSibling&&i.nextSibling.parentNode?r.insertBefore(t,i.nextSibling):a&&a.parentNode?r.insertBefore(t,a):r.appendChild(t),(e.previousId||e.nextId)&&n.resolveMissingNode(o,r,t,e)):o[e.node.id]={node:t,mutation:e}}),Object.keys(o).length&&Object.assign(this.missingNodeRetryMap,o),r.texts.forEach(function(e){mirror.getNode(e.id).textContent=e.value}),r.attributes.forEach(function(e){var t=mirror.getNode(e.id);for(var n in e.attributes)if("string"==typeof n){var r=e.attributes[n];r?t.setAttribute(n,r):t.removeAttribute(n)}});break;case IncrementalSource.MouseMove:t||r.positions.forEach(function(t){var r={doAction:function(){n.mouse.style.left=t.x+"px",n.mouse.style.top=t.y+"px";var e=mirror.getNode(t.id);e&&n.hoverElements(e)},delay:t.timeOffset+e.timestamp-n.baselineTime};n.timer.addAction(r)});break;case IncrementalSource.MouseInteraction:if(-1===r.id)break;var i=new Event(MouseInteractions[r.type].toLowerCase()),a=mirror.getNode(r.id);switch(r.type){case MouseInteractions.Blur:a.blur();break;case MouseInteractions.Focus:a.focus({preventScroll:!0});break;case MouseInteractions.Click:t||(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))===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("resize",{width:r.width,height:r.height});break;case IncrementalSource.Input:if(-1===r.id)break;a=mirror.getNode(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.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("skip-end",e),this.noramlSpeed=-1}},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(!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,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){isBlocked(e)||(s.has(e)?(s.delete(e),a.push(e)):s.has(i)&&!mirror.getId(e)||o.push({parentId:mirror.getId(i),id:mirror.getId(e)}),mirror.removeNodeFromMap(e))})}}),o=o.map(function(e){return e.parentNode&&(e.parentId=mirror.getId(e.parentNode),delete e.parentNode),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()},20,{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={}));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()},e.prototype.pause=function(){this.timer.clear(),this.emitter.emit("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("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("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("skip-start",s)}}}}return function(){n&&n(),r.lastPlayedEvent=e,e===r.events[r.events.length-1]&&(r.restoreSpeed(),r.emitter.emit("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.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("wait-stylesheet"),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("stylesheet-loaded"),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.warnTargetNotFound(r,e.id);var o=mirror.getNode(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),r=mirror.getNode(e.parentId),i=null,a=null;e.previousId&&(i=mirror.getNode(e.previousId)),e.nextId&&(a=mirror.getNode(e.nextId)),-1!==e.previousId&&-1!==e.nextId?(i&&i.nextSibling&&i.nextSibling.parentNode?r.insertBefore(t,i.nextSibling):a&&a.parentNode?r.insertBefore(t,a):r.appendChild(t),(e.previousId||e.nextId)&&n.resolveMissingNode(o,r,t,e)):o[e.node.id]={node:t,mutation:e}}),Object.keys(o).length&&Object.assign(this.missingNodeRetryMap,o),r.texts.forEach(function(e){mirror.getNode(e.id).textContent=e.value}),r.attributes.forEach(function(e){var t=mirror.getNode(e.id);for(var n in e.attributes)if("string"==typeof n){var r=e.attributes[n];r?t.setAttribute(n,r):t.removeAttribute(n)}});break;case IncrementalSource.MouseMove:t||r.positions.forEach(function(t){var o={doAction:function(){n.mouse.style.left=t.x+"px",n.mouse.style.top=t.y+"px";var e=mirror.getNode(t.id);if(!e)return n.warnTargetNotFound(r,t.id);n.hoverElements(e)},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.warnTargetNotFound(r,r.id);switch(r.type){case MouseInteractions.Blur:a.blur();break;case MouseInteractions.Focus:a.focus({preventScroll:!0});break;case MouseInteractions.Click:t||(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.warnTargetNotFound(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("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.warnTargetNotFound(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.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("skip-end",e),this.noramlSpeed=-1}},e.prototype.warnTargetNotFound=function(e,t){this.config.showWarning&&console.warn(REPLAY_CONSOLE_PREFIX,"target with id '"+t+"' not found in",e)},e}();export{record,Replayer,mirror};
//# sourceMappingURL=rrweb.min.js.map

@@ -711,10 +711,54 @@ 'use strict';

if (options === void 0) { options = {}; }
var emit = options.emit;
var emit = options.emit, checkoutEveryNms = options.checkoutEveryNms, checkoutEveryNth = options.checkoutEveryNth;
if (!emit) {
throw new Error('emit function is required');
}
var lastFullSnapshotEvent;
var incrementalSnapshotCount = 0;
var wrappedEmit = function (e, isCheckout) {
emit(e, isCheckout);
if (e.type === EventType.FullSnapshot) {
lastFullSnapshotEvent = e;
incrementalSnapshotCount = 0;
}
else if (e.type === EventType.IncrementalSnapshot) {
incrementalSnapshotCount++;
var exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth;
var exceedTime = checkoutEveryNms &&
e.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms;
if (exceedCount || exceedTime) {
takeFullSnapshot(true);
}
}
};
function takeFullSnapshot(isCheckout) {
if (isCheckout === void 0) { isCheckout = false; }
wrappedEmit(wrapEvent({
type: EventType.Meta,
data: {
href: window.location.href,
width: getWindowWidth(),
height: getWindowHeight()
}
}), isCheckout);
var _a = snapshot(document), node = _a[0], idNodeMap = _a[1];
if (!node) {
return console.warn('Failed to snapshot the document');
}
mirror.map = idNodeMap;
wrappedEmit(wrapEvent({
type: EventType.FullSnapshot,
data: {
node: node,
initialOffset: {
left: document.documentElement.scrollLeft,
top: document.documentElement.scrollTop
}
}
}));
}
try {
var handlers_1 = [];
handlers_1.push(on('DOMContentLoaded', function () {
emit(wrapEvent({
wrappedEmit(wrapEvent({
type: EventType.DomContentLoaded,

@@ -725,28 +769,6 @@ data: {}

var init_1 = function () {
emit(wrapEvent({
type: EventType.Meta,
data: {
href: window.location.href,
width: getWindowWidth(),
height: getWindowHeight()
}
}));
var _a = snapshot(document), node = _a[0], idNodeMap = _a[1];
if (!node) {
return console.warn('Failed to snapshot the document');
}
mirror.map = idNodeMap;
emit(wrapEvent({
type: EventType.FullSnapshot,
data: {
node: node,
initialOffset: {
left: document.documentElement.scrollLeft,
top: document.documentElement.scrollTop
}
}
}));
takeFullSnapshot();
handlers_1.push(initObservers({
mutationCb: function (m) {
return emit(wrapEvent({
return wrappedEmit(wrapEvent({
type: EventType.IncrementalSnapshot,

@@ -757,3 +779,3 @@ data: __assign({ source: IncrementalSource.Mutation }, m)

mousemoveCb: function (positions) {
return emit(wrapEvent({
return wrappedEmit(wrapEvent({
type: EventType.IncrementalSnapshot,

@@ -767,3 +789,3 @@ data: {

mouseInteractionCb: function (d) {
return emit(wrapEvent({
return wrappedEmit(wrapEvent({
type: EventType.IncrementalSnapshot,

@@ -774,3 +796,3 @@ data: __assign({ source: IncrementalSource.MouseInteraction }, d)

scrollCb: function (p) {
return emit(wrapEvent({
return wrappedEmit(wrapEvent({
type: EventType.IncrementalSnapshot,

@@ -781,3 +803,3 @@ data: __assign({ source: IncrementalSource.Scroll }, p)

viewportResizeCb: function (d) {
return emit(wrapEvent({
return wrappedEmit(wrapEvent({
type: EventType.IncrementalSnapshot,

@@ -788,3 +810,3 @@ data: __assign({ source: IncrementalSource.ViewportResize }, d)

inputCb: function (v) {
return emit(wrapEvent({
return wrappedEmit(wrapEvent({
type: EventType.IncrementalSnapshot,

@@ -802,3 +824,3 @@ data: __assign({ source: IncrementalSource.Input }, v)

handlers_1.push(on('load', function () {
emit(wrapEvent({
wrappedEmit(wrapEvent({
type: EventType.Load,

@@ -805,0 +827,0 @@ data: {}

{
"name": "rrweb",
"version": "0.7.4",
"version": "0.7.5",
"description": "record and replay the web",

@@ -37,2 +37,3 @@ "scripts": {

"@types/chai": "^4.1.6",
"@types/inquirer": "0.0.43",
"@types/mocha": "^5.2.5",

@@ -43,2 +44,3 @@ "@types/node": "^10.11.7",

"cross-env": "^5.2.0",
"inquirer": "^6.2.1",
"jest-snapshot": "^23.6.0",

@@ -45,0 +47,0 @@ "mocha": "^5.2.0",

@@ -10,3 +10,3 @@ <p align="center">

[![Build Status](https://travis-ci.org/rrweb-io/rrweb.svg?branch=master)](https://travis-ci.org/rrweb-io/rrweb)
[![Build Status](https://travis-ci.org/rrweb-io/rrweb.svg?branch=master)](https://travis-ci.org/rrweb-io/rrweb) [![Join the chat at https://gitter.im/rrweb-io/rrweb](https://badges.gitter.im/rrweb-io/rrweb.svg)](https://gitter.im/rrweb-io/rrweb?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

@@ -13,0 +13,0 @@ [中文文档](./README.zh_CN.md)

@@ -10,3 +10,3 @@ <p align="center">

[![Build Status](https://travis-ci.org/rrweb-io/rrweb.svg?branch=master)](https://travis-ci.org/rrweb-io/rrweb)
[![Build Status](https://travis-ci.org/rrweb-io/rrweb.svg?branch=master)](https://travis-ci.org/rrweb-io/rrweb) [![Join the chat at https://gitter.im/rrweb-io/rrweb](https://badges.gitter.im/rrweb-io/rrweb.svg)](https://gitter.im/rrweb-io/rrweb?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

@@ -13,0 +13,0 @@ rrweb 是 'record and replay the web' 的简写,旨在利用现代浏览器所提供的强大 API 录制并回放任意 web 界面中的用户操作。

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

export type recordOptions = {
emit?: (e: eventWithTime) => void;
emit?: (e: eventWithTime, isCheckout?: boolean) => void;
checkoutEveryNth?: number;
checkoutEveryNms?: number;
};

@@ -233,2 +235,3 @@

skipInactive: Boolean;
showWarning: Boolean;
};

@@ -235,0 +238,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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc