Socket
Socket
Sign inDemoInstall

rrweb

Package Overview
Dependencies
4
Maintainers
1
Versions
100
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.7.15 to 0.7.16

85

dist/record/rrweb-record.js

@@ -467,3 +467,3 @@ var rrwebRecord = (function () {

}
function isParentDropped(droppedSet, n) {
function isAncestorInSet(set, n) {
var parentNode = n.parentNode;

@@ -473,8 +473,12 @@ if (!parentNode) {

}
if (droppedSet.has(parentNode)) {
if (set.has(parentNode)) {
return true;
}
return isParentDropped(droppedSet, parentNode);
return isAncestorInSet(set, parentNode);
}
var moveKey = function (id, parentId) { return id + "@" + parentId; };
function isINode(n) {
return '__sn' in n;
}
function initMutationObserver(cb, blockClass, inlineStylesheet) {

@@ -486,10 +490,24 @@ var observer = new MutationObserver(function (mutations) {

var adds = [];
var addsSet = new Set();
var addedSet = new Set();
var movedSet = new Set();
var droppedSet = new Set();
var genAdds = function (n) {
var movedMap = {};
var genAdds = function (n, target) {
if (isBlocked(n, blockClass)) {
return;
}
addsSet.add(n);
droppedSet["delete"](n);
if (isINode(n)) {
movedSet.add(n);
var targetId = null;
if (target && isINode(target)) {
targetId = target.__sn.id;
}
if (targetId) {
movedMap[moveKey(n.__sn.id, targetId)] = true;
}
}
else {
addedSet.add(n);
droppedSet["delete"](n);
}
n.childNodes.forEach(function (childN) { return genAdds(childN); });

@@ -527,3 +545,3 @@ };

case 'childList': {
addedNodes.forEach(function (n) { return genAdds(n); });
addedNodes.forEach(function (n) { return genAdds(n, target); });
removedNodes.forEach(function (n) {

@@ -535,8 +553,11 @@ var nodeId = mirror.getId(n);

}
if (addsSet.has(n)) {
deepDelete(addsSet, n);
if (addedSet.has(n)) {
deepDelete(addedSet, n);
droppedSet.add(n);
}
else if (addsSet.has(target) && nodeId === -1) ;
else if (addedSet.has(target) && nodeId === -1) ;
else if (isAncestorRemoved(target)) ;
else if (movedSet.has(n) && movedMap[moveKey(nodeId, parentId)]) {
deepDelete(movedSet, n);
}
else {

@@ -556,15 +577,27 @@ removes.push({

});
Array.from(addsSet).forEach(function (n) {
if (!isParentDropped(droppedSet, n) && !isParentRemoved(removes, n)) {
adds.push({
parentId: mirror.getId(n.parentNode),
previousId: !n.previousSibling
? n.previousSibling
: mirror.getId(n.previousSibling),
nextId: !n.nextSibling
? n.nextSibling
: mirror.getId(n.nextSibling),
node: serializeNodeWithId(n, document, mirror.map, blockClass, true)
});
var addQueue = [];
var pushAdd = function (n) {
var parentId = mirror.getId(n.parentNode);
if (parentId === -1) {
return addQueue.push(n);
}
adds.push({
parentId: parentId,
previousId: !n.previousSibling
? n.previousSibling
: mirror.getId(n.previousSibling),
nextId: !n.nextSibling
? n.nextSibling
: mirror.getId(n.nextSibling),
node: serializeNodeWithId(n, document, mirror.map, blockClass, true, inlineStylesheet)
});
};
Array.from(movedSet).forEach(pushAdd);
Array.from(addedSet).forEach(function (n) {
if (!isAncestorInSet(droppedSet, n) && !isParentRemoved(removes, n)) {
pushAdd(n);
}
else if (isAncestorInSet(movedSet, n)) {
pushAdd(n);
}
else {

@@ -574,2 +607,8 @@ droppedSet.add(n);

});
while (addQueue.length) {
if (addQueue.every(function (n) { return mirror.getId(n.parentNode) === -1; })) {
break;
}
pushAdd(addQueue.shift());
}
var payload = {

@@ -576,0 +615,0 @@ texts: texts

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

@@ -464,3 +464,3 @@ /*! *****************************************************************************

}
function isParentDropped(droppedSet, n) {
function isAncestorInSet(set, n) {
var parentNode = n.parentNode;

@@ -470,8 +470,12 @@ if (!parentNode) {

}
if (droppedSet.has(parentNode)) {
if (set.has(parentNode)) {
return true;
}
return isParentDropped(droppedSet, parentNode);
return isAncestorInSet(set, parentNode);
}
var moveKey = function (id, parentId) { return id + "@" + parentId; };
function isINode(n) {
return '__sn' in n;
}
function initMutationObserver(cb, blockClass, inlineStylesheet) {

@@ -483,10 +487,24 @@ var observer = new MutationObserver(function (mutations) {

var adds = [];
var addsSet = new Set();
var addedSet = new Set();
var movedSet = new Set();
var droppedSet = new Set();
var genAdds = function (n) {
var movedMap = {};
var genAdds = function (n, target) {
if (isBlocked(n, blockClass)) {
return;
}
addsSet.add(n);
droppedSet["delete"](n);
if (isINode(n)) {
movedSet.add(n);
var targetId = null;
if (target && isINode(target)) {
targetId = target.__sn.id;
}
if (targetId) {
movedMap[moveKey(n.__sn.id, targetId)] = true;
}
}
else {
addedSet.add(n);
droppedSet["delete"](n);
}
n.childNodes.forEach(function (childN) { return genAdds(childN); });

@@ -524,3 +542,3 @@ };

case 'childList': {
addedNodes.forEach(function (n) { return genAdds(n); });
addedNodes.forEach(function (n) { return genAdds(n, target); });
removedNodes.forEach(function (n) {

@@ -532,8 +550,11 @@ var nodeId = mirror.getId(n);

}
if (addsSet.has(n)) {
deepDelete(addsSet, n);
if (addedSet.has(n)) {
deepDelete(addedSet, n);
droppedSet.add(n);
}
else if (addsSet.has(target) && nodeId === -1) ;
else if (addedSet.has(target) && nodeId === -1) ;
else if (isAncestorRemoved(target)) ;
else if (movedSet.has(n) && movedMap[moveKey(nodeId, parentId)]) {
deepDelete(movedSet, n);
}
else {

@@ -553,15 +574,27 @@ removes.push({

});
Array.from(addsSet).forEach(function (n) {
if (!isParentDropped(droppedSet, n) && !isParentRemoved(removes, n)) {
adds.push({
parentId: mirror.getId(n.parentNode),
previousId: !n.previousSibling
? n.previousSibling
: mirror.getId(n.previousSibling),
nextId: !n.nextSibling
? n.nextSibling
: mirror.getId(n.nextSibling),
node: serializeNodeWithId(n, document, mirror.map, blockClass, true)
});
var addQueue = [];
var pushAdd = function (n) {
var parentId = mirror.getId(n.parentNode);
if (parentId === -1) {
return addQueue.push(n);
}
adds.push({
parentId: parentId,
previousId: !n.previousSibling
? n.previousSibling
: mirror.getId(n.previousSibling),
nextId: !n.nextSibling
? n.nextSibling
: mirror.getId(n.nextSibling),
node: serializeNodeWithId(n, document, mirror.map, blockClass, true, inlineStylesheet)
});
};
Array.from(movedSet).forEach(pushAdd);
Array.from(addedSet).forEach(function (n) {
if (!isAncestorInSet(droppedSet, n) && !isParentRemoved(removes, n)) {
pushAdd(n);
}
else if (isAncestorInSet(movedSet, n)) {
pushAdd(n);
}
else {

@@ -571,2 +604,8 @@ droppedSet.add(n);

});
while (addQueue.length) {
if (addQueue.every(function (n) { return mirror.getId(n.parentNode) === -1; })) {
break;
}
pushAdd(addQueue.shift());
}
var payload = {

@@ -573,0 +612,0 @@ texts: texts

@@ -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 getCssRulesString(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+getCssRuleString(t)},""):null}catch(e){return null}}function getCssRuleString(e){return isCSSImportRule(e)?getCssRulesString(e.styleSheet)||"":e.cssText}function isCSSImportRule(e){return"styleSheet"in e}function extractOrigin(e){return(e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0]).split("?")[0]}var URL_IN_CSS_REF=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,RELATIVE_PATH=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,DATA_URI=/^(data:)([\w\/\+]+);(charset=[\w-]+|base64).*,(.*)/gi;function absoluteToStylesheet(e,t){return e.replace(URL_IN_CSS_REF,function(e,n,r,o){var i=n||r||o;if(!i)return e;if(!RELATIVE_PATH.test(i))return"url('"+i+"')";if(DATA_URI.test(i))return"url("+i+")";if("/"===i[0])return"url('"+(extractOrigin(t)+i)+"')";var a=t.split("/"),s=i.split("/");a.pop();for(var u=0,c=s;u<c.length;u++){var l=c[u];"."!==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}function serializeNode(e,t,n,r){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:var o=!1;"string"==typeof n?o=e.classList.contains(n):e.classList.forEach(function(e){n.test(e)&&(o=!0)});for(var i=e.tagName.toLowerCase(),a={},s=0,u=Array.from(e.attributes);s<u.length;s++){var c=u[s],l=c.name,d=c.value;a[l]="src"===l||"href"===l?absoluteToDoc(t,d):"style"===l?absoluteToStylesheet(d,location.href):d}if("link"===i&&r){var p,m=Array.from(t.styleSheets).find(function(t){return t.href===e.href});(p=getCssRulesString(m))&&(delete a.rel,delete a.href,a._cssText=absoluteToStylesheet(p,m.href))}if("style"===i&&e.sheet&&!e.innerText.trim().length)(p=getCssRulesString(e.sheet))&&(a._cssText=absoluteToStylesheet(p,location.href));if("input"===i||"textarea"===i||"select"===i){d=e.value;"radio"!==a.type&&"checkbox"!==a.type&&d?a.value=d:e.checked&&(a.checked=e.checked)}if("option"===i){var f=e.parentElement;a.value===f.value&&(a.selected=e.selected)}if(o){var h=e.getBoundingClientRect(),v=h.width,y=h.height;a.rr_width=v+"px",a.rr_height=y+"px"}return{type:NodeType.Element,tagName:i,attributes:a,childNodes:[],isSVG:isSVGElement(e)||void 0,needBlock:o};case e.TEXT_NODE:var g=e.parentNode&&e.parentNode.tagName,E=e.textContent,T="STYLE"===g||void 0;return T&&E&&(E=absoluteToStylesheet(E,location.href)),"SCRIPT"===g&&(E="SCRIPT_PLACEHOLDER"),{type:NodeType.Text,textContent:E||"",isStyle:T};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,o,i){void 0===o&&(o=!1),void 0===i&&(i=!0);var a,s=serializeNode(e,t,r,i);if(!s)return console.warn(e,"not serialized"),null;a="__sn"in e?e.__sn.id:genId();var u=Object.assign(s,{id:a});e.__sn=u,n[a]=e;var c=!o;if(u.type===NodeType.Element&&(c=c&&!u.needBlock,delete u.needBlock),(u.type===NodeType.Document||u.type===NodeType.Element)&&c)for(var l=0,d=Array.from(e.childNodes);l<d.length;l++){var p=serializeNodeWithId(d[l],t,n,r,o,i);p&&u.childNodes.push(p)}return u}function snapshot(e,t,n){void 0===t&&(t="rr-block"),void 0===n&&(n=!0);var r={};return[serializeNodeWithId(e,e,r,t,!1,n),r]}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 EventType,IncrementalSource,MouseInteractions,ReplayerEvents,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,u=arguments;a<=0||a>t?(r&&(window.clearTimeout(r),r=null),o=i,e.apply(s,u)):r||!1===n.trailing||(r=window.setTimeout(function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(s,u)},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}function isBlocked(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var n=!1;return"string"==typeof t?n=e.classList.contains(t):e.classList.forEach(function(e){t.test(e)&&(n=!0)}),n||isBlocked(e.parentNode,t)}return isBlocked(e.parentNode,t)}function isAncestorRemoved(e){var t=mirror.getId(e);return!mirror.has(t)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||isAncestorRemoved(e.parentNode))}function deepDelete(e,t){e.delete(t),t.childNodes.forEach(function(t){return deepDelete(e,t)})}function isParentRemoved(e,t){var n=t.parentNode;if(!n)return!1;var r=mirror.getId(n);return!!e.some(function(e){return e.id===r})||isParentRemoved(e,n)}function isParentDropped(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||isParentDropped(e,n))}function initMutationObserver(e,t,n){var r=new MutationObserver(function(n){var r=[],o=[],i=[],a=[],s=new Set,u=new Set,c=function(e){isBlocked(e,t)||(s.add(e),u.delete(e),e.childNodes.forEach(function(e){return c(e)}))};n.forEach(function(e){var n=e.type,a=e.target,l=e.oldValue,d=e.addedNodes,p=e.removedNodes,m=e.attributeName;switch(n){case"characterData":var f=a.textContent;isBlocked(a,t)||f===l||r.push({value:f,node:a});break;case"attributes":f=a.getAttribute(m);if(isBlocked(a,t)||f===l)return;var h=o.find(function(e){return e.node===a});h||(h={node:a,attributes:{}},o.push(h)),h.attributes[m]=f;break;case"childList":d.forEach(function(e){return c(e)}),p.forEach(function(e){var n=mirror.getId(e),r=mirror.getId(a);isBlocked(e,t)||(s.has(e)?(deepDelete(s,e),u.add(e)):s.has(a)&&-1===n||isAncestorRemoved(a)||i.push({parentId:r,id:n}),mirror.removeNodeFromMap(e))})}}),Array.from(s).forEach(function(e){isParentDropped(u,e)||isParentRemoved(i,e)?u.add(e):a.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,t,!0)})});var l={texts:r.map(function(e){return{id:mirror.getId(e.node),value:e.value}}).filter(function(e){return mirror.has(e.id)}),attributes:o.map(function(e){return{id:mirror.getId(e.node),attributes:e.attributes}}).filter(function(e){return mirror.has(e.id)}),removes:i,adds:a};(l.texts.length||l.attributes.length||l.removes.length||l.adds.length)&&e(l)});return r.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function initMousemoveObserver(e){var t,n=[],r=throttle(function(){var r=Date.now()-t;e(n.map(function(e){return e.timeOffset-=r,e})),n=[],t=null},500);return on("mousemove",throttle(function(e){var o=e.clientX,i=e.clientY,a=e.target;t||(t=Date.now()),n.push({x:o,y:i,id:mirror.getId(a),timeOffset:Date.now()-t}),r()},50,{trailing:!1}))}function initMouseInteractionObserver(e,t){var n=[];return Object.keys(MouseInteractions).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(r){var o=r.toLowerCase(),i=function(n){return function(r){if(!isBlocked(r.target,t)){var o=mirror.getId(r.target),i=r.clientX,a=r.clientY;e({type:MouseInteractions[n],id:o,x:i,y:a})}}}(r);n.push(on(o,i))}),function(){n.forEach(function(e){return e()})}}function initScrollObserver(e,t){return on("scroll",throttle(function(n){if(n.target&&!isBlocked(n.target,t)){var r=mirror.getId(n.target);if(n.target===document){var o=document.scrollingElement||document.documentElement;e({id:r,x:o.scrollLeft,y:o.scrollTop})}else e({id:r,x:n.target.scrollLeft,y:n.target.scrollTop})}},100))}function initViewportResizeObserver(e){return on("resize",throttle(function(){var t=getWindowHeight(),n=getWindowWidth();e({width:Number(n),height:Number(t)})},200),window)}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta"}(EventType||(EventType={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input"}(IncrementalSource||(IncrementalSource={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove=8]="TouchMove",e[e.TouchEnd=9]="TouchEnd"}(MouseInteractions||(MouseInteractions={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction"}(ReplayerEvents||(ReplayerEvents={}));var INPUT_TAGS=["INPUT","TEXTAREA","SELECT"],lastInputValueMap=new WeakMap;function initInputObserver(e,t,n){function r(e){var r=e.target;if(r&&r.tagName&&!(INPUT_TAGS.indexOf(r.tagName)<0)&&!isBlocked(r,t)){var i=r.type;if("password"!==i&&!r.classList.contains(n)){var a=r.value,s=!1;"radio"!==i&&"checkbox"!==i||(s=r.checked),o(r,{text:a,isChecked:s});var u=r.name;"radio"===i&&u&&s&&document.querySelectorAll('input[type="radio"][name="'+u+'"]').forEach(function(e){e!==r&&o(e,{text:e.value,isChecked:!s})})}}}function o(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 i=["input","change"].map(function(e){return on(e,r)}),a=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),s=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]];return a&&a.set&&i.push.apply(i,s.map(function(e){return hookSetter(e[0],e[1],{set:function(){r({target:this})}})})),function(){i.forEach(function(e){return e()})}}function initObservers(e){var t=initMutationObserver(e.mutationCb,e.blockClass,e.inlineStylesheet),n=initMousemoveObserver(e.mousemoveCb),r=initMouseInteractionObserver(e.mouseInteractionCb,e.blockClass),o=initScrollObserver(e.scrollCb,e.blockClass),i=initViewportResizeObserver(e.viewportResizeCb),a=initInputObserver(e.inputCb,e.blockClass,e.ignoreClass);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,i=e.blockClass,a=void 0===i?"rr-block":i,s=e.ignoreClass,u=void 0===s?"rr-ignore":s,c=e.inlineStylesheet,l=void 0===c||c;if(!n)throw new Error("emit function is required");var d=0,p=function(e,i){if(n(e,i),e.type===EventType.FullSnapshot)t=e,d=0;else if(e.type===EventType.IncrementalSnapshot){d++;var a=o&&d>=o,s=r&&e.timestamp-t.timestamp>r;(a||s)&&m(!0)}};function m(e){void 0===e&&(e=!1),p(wrapEvent({type:EventType.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}),e);var t=snapshot(document,a,l),n=t[0],r=t[1];if(!n)return console.warn("Failed to snapshot the document");mirror.map=r,p(wrapEvent({type:EventType.FullSnapshot,data:{node:n,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}}))}try{var f=[];f.push(on("DOMContentLoaded",function(){p(wrapEvent({type:EventType.DomContentLoaded,data:{}}))}));var h=function(){m(),f.push(initObservers({mutationCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Mutation},e)}))},mousemoveCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:{source:IncrementalSource.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.MouseInteraction},e)}))},scrollCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Scroll},e)}))},viewportResizeCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.ViewportResize},e)}))},inputCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Input},e)}))},blockClass:a,ignoreClass:u,inlineStylesheet:l}))};return"interactive"===document.readyState||"complete"===document.readyState?h():f.push(on("load",function(){p(wrapEvent({type:EventType.Load,data:{}})),h()},window)),function(){f.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 getCssRulesString(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+getCssRuleString(t)},""):null}catch(e){return null}}function getCssRuleString(e){return isCSSImportRule(e)?getCssRulesString(e.styleSheet)||"":e.cssText}function isCSSImportRule(e){return"styleSheet"in e}function extractOrigin(e){return(e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0]).split("?")[0]}var URL_IN_CSS_REF=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,RELATIVE_PATH=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,DATA_URI=/^(data:)([\w\/\+]+);(charset=[\w-]+|base64).*,(.*)/gi;function absoluteToStylesheet(e,t){return e.replace(URL_IN_CSS_REF,function(e,n,r,o){var i=n||r||o;if(!i)return e;if(!RELATIVE_PATH.test(i))return"url('"+i+"')";if(DATA_URI.test(i))return"url("+i+")";if("/"===i[0])return"url('"+(extractOrigin(t)+i)+"')";var a=t.split("/"),s=i.split("/");a.pop();for(var u=0,c=s;u<c.length;u++){var l=c[u];"."!==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}function serializeNode(e,t,n,r){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:var o=!1;"string"==typeof n?o=e.classList.contains(n):e.classList.forEach(function(e){n.test(e)&&(o=!0)});for(var i=e.tagName.toLowerCase(),a={},s=0,u=Array.from(e.attributes);s<u.length;s++){var c=u[s],l=c.name,d=c.value;a[l]="src"===l||"href"===l?absoluteToDoc(t,d):"style"===l?absoluteToStylesheet(d,location.href):d}if("link"===i&&r){var p,f=Array.from(t.styleSheets).find(function(t){return t.href===e.href});(p=getCssRulesString(f))&&(delete a.rel,delete a.href,a._cssText=absoluteToStylesheet(p,f.href))}if("style"===i&&e.sheet&&!e.innerText.trim().length)(p=getCssRulesString(e.sheet))&&(a._cssText=absoluteToStylesheet(p,location.href));if("input"===i||"textarea"===i||"select"===i){d=e.value;"radio"!==a.type&&"checkbox"!==a.type&&d?a.value=d:e.checked&&(a.checked=e.checked)}if("option"===i){var m=e.parentElement;a.value===m.value&&(a.selected=e.selected)}if(o){var v=e.getBoundingClientRect(),h=v.width,y=v.height;a.rr_width=h+"px",a.rr_height=y+"px"}return{type:NodeType.Element,tagName:i,attributes:a,childNodes:[],isSVG:isSVGElement(e)||void 0,needBlock:o};case e.TEXT_NODE:var g=e.parentNode&&e.parentNode.tagName,E=e.textContent,T="STYLE"===g||void 0;return T&&E&&(E=absoluteToStylesheet(E,location.href)),"SCRIPT"===g&&(E="SCRIPT_PLACEHOLDER"),{type:NodeType.Text,textContent:E||"",isStyle:T};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,o,i){void 0===o&&(o=!1),void 0===i&&(i=!0);var a,s=serializeNode(e,t,r,i);if(!s)return console.warn(e,"not serialized"),null;a="__sn"in e?e.__sn.id:genId();var u=Object.assign(s,{id:a});e.__sn=u,n[a]=e;var c=!o;if(u.type===NodeType.Element&&(c=c&&!u.needBlock,delete u.needBlock),(u.type===NodeType.Document||u.type===NodeType.Element)&&c)for(var l=0,d=Array.from(e.childNodes);l<d.length;l++){var p=serializeNodeWithId(d[l],t,n,r,o,i);p&&u.childNodes.push(p)}return u}function snapshot(e,t,n){void 0===t&&(t="rr-block"),void 0===n&&(n=!0);var r={};return[serializeNodeWithId(e,e,r,t,!1,n),r]}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 EventType,IncrementalSource,MouseInteractions,ReplayerEvents,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,u=arguments;a<=0||a>t?(r&&(window.clearTimeout(r),r=null),o=i,e.apply(s,u)):r||!1===n.trailing||(r=window.setTimeout(function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(s,u)},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}function isBlocked(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var n=!1;return"string"==typeof t?n=e.classList.contains(t):e.classList.forEach(function(e){t.test(e)&&(n=!0)}),n||isBlocked(e.parentNode,t)}return isBlocked(e.parentNode,t)}function isAncestorRemoved(e){var t=mirror.getId(e);return!mirror.has(t)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||isAncestorRemoved(e.parentNode))}function deepDelete(e,t){e.delete(t),t.childNodes.forEach(function(t){return deepDelete(e,t)})}function isParentRemoved(e,t){var n=t.parentNode;if(!n)return!1;var r=mirror.getId(n);return!!e.some(function(e){return e.id===r})||isParentRemoved(e,n)}function isAncestorInSet(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||isAncestorInSet(e,n))}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta"}(EventType||(EventType={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input"}(IncrementalSource||(IncrementalSource={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove=8]="TouchMove",e[e.TouchEnd=9]="TouchEnd"}(MouseInteractions||(MouseInteractions={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction"}(ReplayerEvents||(ReplayerEvents={}));var moveKey=function(e,t){return e+"@"+t};function isINode(e){return"__sn"in e}function initMutationObserver(e,t,n){var r=new MutationObserver(function(r){var o=[],i=[],a=[],s=[],u=new Set,c=new Set,l=new Set,d={},p=function(e,n){if(!isBlocked(e,t)){if(isINode(e)){c.add(e);var r=null;n&&isINode(n)&&(r=n.__sn.id),r&&(d[moveKey(e.__sn.id,r)]=!0)}else u.add(e),l.delete(e);e.childNodes.forEach(function(e){return p(e)})}};r.forEach(function(e){var n=e.type,r=e.target,s=e.oldValue,f=e.addedNodes,m=e.removedNodes,v=e.attributeName;switch(n){case"characterData":var h=r.textContent;isBlocked(r,t)||h===s||o.push({value:h,node:r});break;case"attributes":h=r.getAttribute(v);if(isBlocked(r,t)||h===s)return;var y=i.find(function(e){return e.node===r});y||(y={node:r,attributes:{}},i.push(y)),y.attributes[v]=h;break;case"childList":f.forEach(function(e){return p(e,r)}),m.forEach(function(e){var n=mirror.getId(e),o=mirror.getId(r);isBlocked(e,t)||(u.has(e)?(deepDelete(u,e),l.add(e)):u.has(r)&&-1===n||isAncestorRemoved(r)||(c.has(e)&&d[moveKey(n,o)]?deepDelete(c,e):a.push({parentId:o,id:n})),mirror.removeNodeFromMap(e))})}});var f=[],m=function(e){var r=mirror.getId(e.parentNode);if(-1===r)return f.push(e);s.push({parentId:r,previousId:e.previousSibling?mirror.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?mirror.getId(e.nextSibling):e.nextSibling,node:serializeNodeWithId(e,document,mirror.map,t,!0,n)})};for(Array.from(c).forEach(m),Array.from(u).forEach(function(e){isAncestorInSet(l,e)||isParentRemoved(a,e)?isAncestorInSet(c,e)?m(e):l.add(e):m(e)});f.length&&!f.every(function(e){return-1===mirror.getId(e.parentNode)});)m(f.shift());var v={texts:o.map(function(e){return{id:mirror.getId(e.node),value:e.value}}).filter(function(e){return mirror.has(e.id)}),attributes:i.map(function(e){return{id:mirror.getId(e.node),attributes:e.attributes}}).filter(function(e){return mirror.has(e.id)}),removes:a,adds:s};(v.texts.length||v.attributes.length||v.removes.length||v.adds.length)&&e(v)});return r.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function initMousemoveObserver(e){var t,n=[],r=throttle(function(){var r=Date.now()-t;e(n.map(function(e){return e.timeOffset-=r,e})),n=[],t=null},500);return on("mousemove",throttle(function(e){var o=e.clientX,i=e.clientY,a=e.target;t||(t=Date.now()),n.push({x:o,y:i,id:mirror.getId(a),timeOffset:Date.now()-t}),r()},50,{trailing:!1}))}function initMouseInteractionObserver(e,t){var n=[];return Object.keys(MouseInteractions).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(r){var o=r.toLowerCase(),i=function(n){return function(r){if(!isBlocked(r.target,t)){var o=mirror.getId(r.target),i=r.clientX,a=r.clientY;e({type:MouseInteractions[n],id:o,x:i,y:a})}}}(r);n.push(on(o,i))}),function(){n.forEach(function(e){return e()})}}function initScrollObserver(e,t){return on("scroll",throttle(function(n){if(n.target&&!isBlocked(n.target,t)){var r=mirror.getId(n.target);if(n.target===document){var o=document.scrollingElement||document.documentElement;e({id:r,x:o.scrollLeft,y:o.scrollTop})}else e({id:r,x:n.target.scrollLeft,y:n.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)}var INPUT_TAGS=["INPUT","TEXTAREA","SELECT"],lastInputValueMap=new WeakMap;function initInputObserver(e,t,n){function r(e){var r=e.target;if(r&&r.tagName&&!(INPUT_TAGS.indexOf(r.tagName)<0)&&!isBlocked(r,t)){var i=r.type;if("password"!==i&&!r.classList.contains(n)){var a=r.value,s=!1;"radio"!==i&&"checkbox"!==i||(s=r.checked),o(r,{text:a,isChecked:s});var u=r.name;"radio"===i&&u&&s&&document.querySelectorAll('input[type="radio"][name="'+u+'"]').forEach(function(e){e!==r&&o(e,{text:e.value,isChecked:!s})})}}}function o(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 i=["input","change"].map(function(e){return on(e,r)}),a=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),s=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]];return a&&a.set&&i.push.apply(i,s.map(function(e){return hookSetter(e[0],e[1],{set:function(){r({target:this})}})})),function(){i.forEach(function(e){return e()})}}function initObservers(e){var t=initMutationObserver(e.mutationCb,e.blockClass,e.inlineStylesheet),n=initMousemoveObserver(e.mousemoveCb),r=initMouseInteractionObserver(e.mouseInteractionCb,e.blockClass),o=initScrollObserver(e.scrollCb,e.blockClass),i=initViewportResizeObserver(e.viewportResizeCb),a=initInputObserver(e.inputCb,e.blockClass,e.ignoreClass);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,i=e.blockClass,a=void 0===i?"rr-block":i,s=e.ignoreClass,u=void 0===s?"rr-ignore":s,c=e.inlineStylesheet,l=void 0===c||c;if(!n)throw new Error("emit function is required");var d=0,p=function(e,i){if(n(e,i),e.type===EventType.FullSnapshot)t=e,d=0;else if(e.type===EventType.IncrementalSnapshot){d++;var a=o&&d>=o,s=r&&e.timestamp-t.timestamp>r;(a||s)&&f(!0)}};function f(e){void 0===e&&(e=!1),p(wrapEvent({type:EventType.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}),e);var t=snapshot(document,a,l),n=t[0],r=t[1];if(!n)return console.warn("Failed to snapshot the document");mirror.map=r,p(wrapEvent({type:EventType.FullSnapshot,data:{node:n,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}}))}try{var m=[];m.push(on("DOMContentLoaded",function(){p(wrapEvent({type:EventType.DomContentLoaded,data:{}}))}));var v=function(){f(),m.push(initObservers({mutationCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Mutation},e)}))},mousemoveCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:{source:IncrementalSource.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.MouseInteraction},e)}))},scrollCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Scroll},e)}))},viewportResizeCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.ViewportResize},e)}))},inputCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Input},e)}))},blockClass:a,ignoreClass:u,inlineStylesheet:l}))};return"interactive"===document.readyState||"complete"===document.readyState?v():m.push(on("load",function(){p(wrapEvent({type:EventType.Load,data:{}})),v()},window)),function(){m.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,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"}(NodeType||(NodeType={}));var _id=1;function genId(){return _id++}function getCssRulesString(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+getCssRuleString(t)},""):null}catch(e){return null}}function getCssRuleString(e){return isCSSImportRule(e)?getCssRulesString(e.styleSheet)||"":e.cssText}function isCSSImportRule(e){return"styleSheet"in e}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,o,r){var i=n||o||r;if(!i)return e;if(!RELATIVE_PATH.test(i))return"url('"+i+"')";if(DATA_URI.test(i))return"url("+i+")";if("/"===i[0])return"url('"+(extractOrigin(t)+i)+"')";var s=t.split("/"),a=i.split("/");s.pop();for(var l=0,c=a;l<c.length;l++){var u=c[l];"."!==u&&(".."===u?s.pop():s.push(u))}return"url('"+s.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}function serializeNode(e,t,n,o){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:var r=!1;"string"==typeof n?r=e.classList.contains(n):e.classList.forEach(function(e){n.test(e)&&(r=!0)});for(var i=e.tagName.toLowerCase(),s={},a=0,l=Array.from(e.attributes);a<l.length;a++){var c=l[a],u=c.name,d=c.value;s[u]="src"===u||"href"===u?absoluteToDoc(t,d):"style"===u?absoluteToStylesheet(d,location.href):d}if("link"===i&&o){var p,f=Array.from(t.styleSheets).find(function(t){return t.href===e.href});(p=getCssRulesString(f))&&(delete s.rel,delete s.href,s._cssText=absoluteToStylesheet(p,f.href))}if("style"===i&&e.sheet&&!e.innerText.trim().length)(p=getCssRulesString(e.sheet))&&(s._cssText=absoluteToStylesheet(p,location.href));if("input"===i||"textarea"===i||"select"===i){d=e.value;"radio"!==s.type&&"checkbox"!==s.type&&d?s.value=d:e.checked&&(s.checked=e.checked)}if("option"===i){var m=e.parentElement;s.value===m.value&&(s.selected=e.selected)}if(r){var h=e.getBoundingClientRect(),v=h.width,y=h.height;s.rr_width=v+"px",s.rr_height=y+"px"}return{type:NodeType.Element,tagName:i,attributes:s,childNodes:[],isSVG:isSVGElement(e)||void 0,needBlock:r};case e.TEXT_NODE:var g=e.parentNode&&e.parentNode.tagName,b=e.textContent,E="STYLE"===g||void 0;return E&&b&&(b=absoluteToStylesheet(b,location.href)),"SCRIPT"===g&&(b="SCRIPT_PLACEHOLDER"),{type:NodeType.Text,textContent:b||"",isStyle:E};case e.CDATA_SECTION_NODE:return{type:NodeType.CDATA,textContent:""};case e.COMMENT_NODE:return{type:NodeType.Comment,textContent:e.textContent||""};default:return!1}}function serializeNodeWithId(e,t,n,o,r,i){void 0===r&&(r=!1),void 0===i&&(i=!0);var s,a=serializeNode(e,t,o,i);if(!a)return console.warn(e,"not serialized"),null;s="__sn"in e?e.__sn.id:genId();var l=Object.assign(a,{id:s});e.__sn=l,n[s]=e;var c=!r;if(l.type===NodeType.Element&&(c=c&&!l.needBlock,delete l.needBlock),(l.type===NodeType.Document||l.type===NodeType.Element)&&c)for(var u=0,d=Array.from(e.childNodes);u<d.length;u++){var p=serializeNodeWithId(d[u],t,n,o,r,i);p&&l.childNodes.push(p)}return l}function snapshot(e,t,n){void 0===t&&(t="rr-block"),void 0===n&&(n=!0);var o={};return[serializeNodeWithId(e,e,o,t,!1,n),o]}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 o=t.replace(HOVER_SELECTOR,"$1.\\:hover");return t.replace(/\s*$/,"")+", "+o.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),o=void 0;for(var r in o=e.isSVG?t.createElementNS("http://www.w3.org/2000/svg",n):t.createElement(n),e.attributes)if(e.attributes.hasOwnProperty(r)&&!r.startsWith("rr_")){var i=e.attributes[r];i="boolean"==typeof i?"":i;var s="textarea"===n&&"value"===r,a="style"===n&&"_cssText"===r;if(a&&(i=addHoverClass(i)),s||a){var l=t.createTextNode(i);o.appendChild(l);continue}if("iframe"===n&&"src"===r)continue;try{e.isSVG&&"xlink:href"===r?o.setAttributeNS("http://www.w3.org/1999/xlink",r,i):o.setAttribute(r,i)}catch(e){}}else e.attributes.rr_width&&(o.style.width=e.attributes.rr_width),e.attributes.rr_height&&(o.style.height=e.attributes.rr_height);return o;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,o){void 0===o&&(o=!1);var r=buildNode(e,t);if(!r)return null;if(e.type===NodeType.Document&&(t.close(),t.open(),r=t),r.__sn=e,n[e.id]=r,(e.type===NodeType.Document||e.type===NodeType.Element)&&!o)for(var i=0,s=e.childNodes;i<s.length;i++){var a=s[i],l=buildNodeWithSN(a,t,n);l?r.appendChild(l):console.warn("Failed to rebuild",a)}return r}function rebuild(e,t){var n={};return[buildNodeWithSN(e,t,n),n]}function on(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 EventType,IncrementalSource,MouseInteractions,ReplayerEvents,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 o=null,r=0;return function(){var i=Date.now();r||!1!==n.leading||(r=i);var s=t-(i-r),a=this,l=arguments;s<=0||s>t?(o&&(window.clearTimeout(o),o=null),r=i,e.apply(a,l)):o||!1===n.trailing||(o=window.setTimeout(function(){r=!1===n.leading?0:Date.now(),o=null,e.apply(a,l)},s))}}function hookSetter(e,t,n){var o=Object.getOwnPropertyDescriptor(e,t);return Object.defineProperty(e,t,{set:function(e){var t=this;setTimeout(function(){n.set.call(t,e)},0),o&&o.set&&o.set.call(this,e)}}),function(){return hookSetter(e,t,o||{})}}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}function isBlocked(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var n=!1;return"string"==typeof t?n=e.classList.contains(t):e.classList.forEach(function(e){t.test(e)&&(n=!0)}),n||isBlocked(e.parentNode,t)}return isBlocked(e.parentNode,t)}function isAncestorRemoved(e){var t=mirror.getId(e);return!mirror.has(t)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||isAncestorRemoved(e.parentNode))}function deepDelete(e,t){e.delete(t),t.childNodes.forEach(function(t){return deepDelete(e,t)})}function isParentRemoved(e,t){var n=t.parentNode;if(!n)return!1;var o=mirror.getId(n);return!!e.some(function(e){return e.id===o})||isParentRemoved(e,n)}function isParentDropped(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||isParentDropped(e,n))}function initMutationObserver(e,t,n){var o=new MutationObserver(function(n){var o=[],r=[],i=[],s=[],a=new Set,l=new Set,c=function(e){isBlocked(e,t)||(a.add(e),l.delete(e),e.childNodes.forEach(function(e){return c(e)}))};n.forEach(function(e){var n=e.type,s=e.target,u=e.oldValue,d=e.addedNodes,p=e.removedNodes,f=e.attributeName;switch(n){case"characterData":var m=s.textContent;isBlocked(s,t)||m===u||o.push({value:m,node:s});break;case"attributes":m=s.getAttribute(f);if(isBlocked(s,t)||m===u)return;var h=r.find(function(e){return e.node===s});h||(h={node:s,attributes:{}},r.push(h)),h.attributes[f]=m;break;case"childList":d.forEach(function(e){return c(e)}),p.forEach(function(e){var n=mirror.getId(e),o=mirror.getId(s);isBlocked(e,t)||(a.has(e)?(deepDelete(a,e),l.add(e)):a.has(s)&&-1===n||isAncestorRemoved(s)||i.push({parentId:o,id:n}),mirror.removeNodeFromMap(e))})}}),Array.from(a).forEach(function(e){isParentDropped(l,e)||isParentRemoved(i,e)?l.add(e):s.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,t,!0)})});var u={texts:o.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:i,adds:s};(u.texts.length||u.attributes.length||u.removes.length||u.adds.length)&&e(u)});return o.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),o}function initMousemoveObserver(e){var t,n=[],o=throttle(function(){var o=Date.now()-t;e(n.map(function(e){return e.timeOffset-=o,e})),n=[],t=null},500);return on("mousemove",throttle(function(e){var r=e.clientX,i=e.clientY,s=e.target;t||(t=Date.now()),n.push({x:r,y:i,id:mirror.getId(s),timeOffset:Date.now()-t}),o()},50,{trailing:!1}))}function initMouseInteractionObserver(e,t){var n=[];return Object.keys(MouseInteractions).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(o){var r=o.toLowerCase(),i=function(n){return function(o){if(!isBlocked(o.target,t)){var r=mirror.getId(o.target),i=o.clientX,s=o.clientY;e({type:MouseInteractions[n],id:r,x:i,y:s})}}}(o);n.push(on(r,i))}),function(){n.forEach(function(e){return e()})}}function initScrollObserver(e,t){return on("scroll",throttle(function(n){if(n.target&&!isBlocked(n.target,t)){var o=mirror.getId(n.target);if(n.target===document){var r=document.scrollingElement||document.documentElement;e({id:o,x:r.scrollLeft,y:r.scrollTop})}else e({id:o,x:n.target.scrollLeft,y:n.target.scrollTop})}},100))}function initViewportResizeObserver(e){return on("resize",throttle(function(){var t=getWindowHeight(),n=getWindowWidth();e({width:Number(n),height:Number(t)})},200),window)}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta"}(EventType||(EventType={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input"}(IncrementalSource||(IncrementalSource={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove=8]="TouchMove",e[e.TouchEnd=9]="TouchEnd"}(MouseInteractions||(MouseInteractions={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction"}(ReplayerEvents||(ReplayerEvents={}));var INPUT_TAGS=["INPUT","TEXTAREA","SELECT"],lastInputValueMap=new WeakMap;function initInputObserver(e,t,n){function o(e){var o=e.target;if(o&&o.tagName&&!(INPUT_TAGS.indexOf(o.tagName)<0)&&!isBlocked(o,t)){var i=o.type;if("password"!==i&&!o.classList.contains(n)){var s=o.value,a=!1;"radio"!==i&&"checkbox"!==i||(a=o.checked),r(o,{text:s,isChecked:a});var l=o.name;"radio"===i&&l&&a&&document.querySelectorAll('input[type="radio"][name="'+l+'"]').forEach(function(e){e!==o&&r(e,{text:e.value,isChecked:!a})})}}}function r(t,n){var o=lastInputValueMap.get(t);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){lastInputValueMap.set(t,n);var r=mirror.getId(t);e(__assign({},n,{id:r}))}}var i=["input","change"].map(function(e){return on(e,o)}),s=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),a=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]];return s&&s.set&&i.push.apply(i,a.map(function(e){return hookSetter(e[0],e[1],{set:function(){o({target:this})}})})),function(){i.forEach(function(e){return e()})}}function initObservers(e){var t=initMutationObserver(e.mutationCb,e.blockClass,e.inlineStylesheet),n=initMousemoveObserver(e.mousemoveCb),o=initMouseInteractionObserver(e.mouseInteractionCb,e.blockClass),r=initScrollObserver(e.scrollCb,e.blockClass),i=initViewportResizeObserver(e.viewportResizeCb),s=initInputObserver(e.inputCb,e.blockClass,e.ignoreClass);return function(){t.disconnect(),n(),o(),r(),i(),s()}}function wrapEvent(e){return __assign({},e,{timestamp:Date.now()})}function record(e){void 0===e&&(e={});var t,n=e.emit,o=e.checkoutEveryNms,r=e.checkoutEveryNth,i=e.blockClass,s=void 0===i?"rr-block":i,a=e.ignoreClass,l=void 0===a?"rr-ignore":a,c=e.inlineStylesheet,u=void 0===c||c;if(!n)throw new Error("emit function is required");var d=0,p=function(e,i){if(n(e,i),e.type===EventType.FullSnapshot)t=e,d=0;else if(e.type===EventType.IncrementalSnapshot){d++;var s=r&&d>=r,a=o&&e.timestamp-t.timestamp>o;(s||a)&&f(!0)}};function f(e){void 0===e&&(e=!1),p(wrapEvent({type:EventType.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}),e);var t=snapshot(document,s,u),n=t[0],o=t[1];if(!n)return console.warn("Failed to snapshot the document");mirror.map=o,p(wrapEvent({type:EventType.FullSnapshot,data:{node:n,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}}))}try{var m=[];m.push(on("DOMContentLoaded",function(){p(wrapEvent({type:EventType.DomContentLoaded,data:{}}))}));var h=function(){f(),m.push(initObservers({mutationCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Mutation},e)}))},mousemoveCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:{source:IncrementalSource.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.MouseInteraction},e)}))},scrollCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Scroll},e)}))},viewportResizeCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.ViewportResize},e)}))},inputCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Input},e)}))},blockClass:s,ignoreClass:l,inlineStylesheet:u}))};return"interactive"===document.readyState||"complete"===document.readyState?h():m.push(on("load",function(){p(wrapEvent({type:EventType.Load,data:{}})),h()},window)),function(){m.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,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},s=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,a=(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)))},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;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)}},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){for(;e!==t.body&&!1===p(e);)e=e.parentNode||e.host;return e}(this),o=n.getBoundingClientRect(),r=this.getBoundingClientRect();n!==t.body?(m.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+a<e.scrollHeight:"X"===t?e.clientWidth+a<e.scrollWidth:void 0}function d(t,n){var o=e.getComputedStyle(t,null)["overflow"+n];return"auto"===o||"scroll"===o}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,o,i,a,l=(s()-t.startTime)/r;a=l=l>1?1:l,n=.5*(1-Math.cos(Math.PI*a)),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(f.bind(e,t))}function m(n,o,r){var a,c,u,d,p=s();n===t.body?(a=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(a=n,c=n.scrollLeft,u=n.scrollTop,d=l),f({scrollable:a,method:d,startTime:p,startX:c,startY:u,x:o,y:r})}}}}()}),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,o=this;this.raf=requestAnimationFrame(function r(i){for(o.timeOffset+=(i-e)*n.speed,e=i;t.length;){var s=t[0];if(!(o.timeOffset>=s.delay))break;t.shift(),s.doAction()}(t.length>0||o.config.liveMode)&&(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}(),rules=function(e){return["iframe, ."+e+" { background: #ccc }","noscript { display: none !important; }"]},SKIP_TIME_THRESHOLD=1e4,SKIP_TIME_INTERVAL=5e3,mitt$1=mitt||mittProxy,REPLAY_CONSOLE_PREFIX="[replayer]",Replayer=function(){function e(e,t){if(this.events=[],this.emitter=mitt$1(),this.baselineTime=0,this.noramlSpeed=-1,this.missingNodeRetryMap={},e.length<2)throw new Error("Replayer need at least 2 events.");this.events=e,this.handleResize=this.handleResize.bind(this);var n={speed:1,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1};this.config=Object.assign({},n,t),this.timer=new Timer(this.config),smoothscroll_1(),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,s=this.getCastFn(r,i);i?s():t.push({doAction:s,delay:this.getDelay(r)})}this.timer.addActions(t),this.timer.start(),this.emitter.emit(ReplayerEvents.Start)},e.prototype.pause=function(){this.timer.clear(),this.emitter.emit(ReplayerEvents.Pause)},e.prototype.resume=function(e){void 0===e&&(e=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+e;for(var t=new Array,n=0,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(ReplayerEvents.Resume)},e.prototype.addEvent=function(e){this.getCastFn(e,!0)()},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,o=this;switch(void 0===t&&(t=!1),e.type){case EventType.DomContentLoaded:case EventType.Load:break;case EventType.Meta:n=function(){return o.emitter.emit(ReplayerEvents.Resize,{width:e.data.width,height:e.data.height})};break;case EventType.FullSnapshot:n=function(){o.rebuildFullSnapshot(e),o.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case EventType.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>SKIP_TIME_THRESHOLD*o.config.speed&&(o.nextUserInteractionEvent=i);break}}if(o.nextUserInteractionEvent){o.noramlSpeed=o.config.speed;var s=o.nextUserInteractionEvent.delay-e.delay,a={speed:Math.min(Math.round(s/SKIP_TIME_INTERVAL),360)};o.setConfig(a),o.emitter.emit(ReplayerEvents.SkipStart,a)}}}}return function(){n&&n(),o.lastPlayedEvent=e,e===o.events[o.events.length-1]&&(o.restoreSpeed(),o.emitter.emit(ReplayerEvents.Finish))}},e.prototype.rebuildFullSnapshot=function(e){Object.keys(this.missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.missingNodeRetryMap),this.missingNodeRetryMap={},mirror.map=rebuild(e.data.node,this.iframe.contentDocument)[1];var t=document.createElement("style"),n=this.iframe.contentDocument,o=n.documentElement,r=n.head;o.insertBefore(t,r);for(var i=rules(this.config.blockClass),s=0;s<i.length;s++)t.sheet.insertRule(i[s],s);this.emitter.emit(ReplayerEvents.FullsnapshotRebuilded),this.waitForStylesheetLoad()},e.prototype.waitForStylesheetLoad=function(){var e=this,t=this.iframe.contentDocument.head;if(t){var n,o=new Set;t.querySelectorAll('link[rel="stylesheet"]').forEach(function(t){t.sheet||(0===o.size&&(e.pause(),e.emitter.emit(ReplayerEvents.LoadStylesheetStart),n=window.setTimeout(function(){e.resume(e.timer.timeOffset),n=-1},e.config.loadTimeout)),o.add(t),t.addEventListener("load",function(){o.delete(t),0===o.size&&-1!==n&&(e.resume(e.timer.timeOffset),e.emitter.emit(ReplayerEvents.LoadStylesheetEnd),n&&window.clearTimeout(n))}))})}},e.prototype.applyIncremental=function(e,t){var n=this,o=e.data;switch(o.source){case IncrementalSource.Mutation:o.removes.forEach(function(e){var t=mirror.getNode(e.id);if(!t)return n.warnNodeNotFound(o,e.id);var r=mirror.getNode(e.parentId);if(!r)return n.warnNodeNotFound(o,e.parentId);mirror.removeNodeFromMap(t),r&&r.removeChild(t)});var r=__assign({},this.missingNodeRetryMap);o.adds.forEach(function(e){var t=buildNodeWithSN(e.node,n.iframe.contentDocument,mirror.map,!0),i=mirror.getNode(e.parentId);if(!i)return n.warnNodeNotFound(o,e.parentId);var s=null,a=null;e.previousId&&(s=mirror.getNode(e.previousId)),e.nextId&&(a=mirror.getNode(e.nextId)),-1!==e.previousId&&-1!==e.nextId?(s&&s.nextSibling&&s.nextSibling.parentNode?i.insertBefore(t,s.nextSibling):a&&a.parentNode?i.insertBefore(t,a):i.appendChild(t),(e.previousId||e.nextId)&&n.resolveMissingNode(r,i,t,e)):r[e.node.id]={node:t,mutation:e}}),Object.keys(r).length&&Object.assign(this.missingNodeRetryMap,r),o.texts.forEach(function(e){var t=mirror.getNode(e.id);if(!t)return n.warnNodeNotFound(o,e.id);t.textContent=e.value}),o.attributes.forEach(function(e){var t=mirror.getNode(e.id);if(!t)return n.warnNodeNotFound(o,e.id);for(var r in e.attributes)if("string"==typeof r){var i=e.attributes[r];null!==i?t.setAttribute(r,i):t.removeAttribute(r)}});break;case IncrementalSource.MouseMove:if(t){var i=o.positions[o.positions.length-1];this.moveAndHover(o,i.x,i.y,i.id)}else o.positions.forEach(function(t){var r={doAction:function(){n.moveAndHover(o,t.x,t.y,t.id)},delay:t.timeOffset+e.timestamp-n.baselineTime};n.timer.addAction(r)});break;case IncrementalSource.MouseInteraction:if(-1===o.id)break;var s=new Event(MouseInteractions[o.type].toLowerCase());if(!(a=mirror.getNode(o.id)))return this.debugNodeNotFound(o,o.id);switch(this.emitter.emit(ReplayerEvents.MouseInteraction,{type:o.type,target:a}),o.type){case MouseInteractions.Blur:a.blur&&a.blur();break;case MouseInteractions.Focus:a.focus&&a.focus({preventScroll:!0});break;case MouseInteractions.Click:t||(this.moveAndHover(o,o.x,o.y,o.id),this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:a.dispatchEvent(s)}break;case IncrementalSource.Scroll:if(-1===o.id)break;if(!(a=mirror.getNode(o.id)))return this.debugNodeNotFound(o,o.id);if(a===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:o.y,left:o.x,behavior:t?"auto":"smooth"});else try{a.scrollTop=o.y,a.scrollLeft=o.x}catch(e){}break;case IncrementalSource.ViewportResize:this.emitter.emit(ReplayerEvents.Resize,{width:o.width,height:o.height});break;case IncrementalSource.Input:if(-1===o.id)break;var a;if(!(a=mirror.getNode(o.id)))return this.debugNodeNotFound(o,o.id);try{a.checked=o.isChecked,a.value=o.text}catch(e){}}},e.prototype.resolveMissingNode=function(e,t,n,o){var r=o.previousId,i=o.nextId,s=r&&e[r],a=i&&e[i];if(s){var l=s,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(a){var d=a;c=d.node,u=d.mutation;t.insertBefore(c,n.nextSibling),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,c,u)}},e.prototype.moveAndHover=function(e,t,n,o){this.mouse.style.left=t+"px",this.mouse.style.top=n+"px";var r=mirror.getNode(o);if(!r)return this.debugNodeNotFound(e,o);this.hoverElements(r)},e.prototype.hoverElements=function(e){this.iframe.contentDocument.querySelectorAll(".\\:hover").forEach(function(e){e.classList.remove(":hover")});for(var t=e;t;)t.classList.add(":hover"),t=t.parentElement},e.prototype.isUserInteraction=function(e){return e.type===EventType.IncrementalSnapshot&&(e.data.source>IncrementalSource.Mutation&&e.data.source<=IncrementalSource.Input)},e.prototype.restoreSpeed=function(){if(-1!==this.noramlSpeed){var e={speed:this.noramlSpeed};this.setConfig(e),this.emitter.emit(ReplayerEvents.SkipEnd,e),this.noramlSpeed=-1}},e.prototype.warnNodeNotFound=function(e,t){this.config.showWarning&&console.warn(REPLAY_CONSOLE_PREFIX,"Node with id '"+t+"' not found in",e)},e.prototype.debugNodeNotFound=function(e,t){this.config.showDebug&&console.log(REPLAY_CONSOLE_PREFIX,"Node with id '"+t+"' not found in",e)},e}();export{record,Replayer,mirror};
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 getCssRulesString(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+getCssRuleString(t)},""):null}catch(e){return null}}function getCssRuleString(e){return isCSSImportRule(e)?getCssRulesString(e.styleSheet)||"":e.cssText}function isCSSImportRule(e){return"styleSheet"in e}function extractOrigin(e){return(e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0]).split("?")[0]}var URL_IN_CSS_REF=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,RELATIVE_PATH=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,DATA_URI=/^(data:)([\w\/\+]+);(charset=[\w-]+|base64).*,(.*)/gi;function absoluteToStylesheet(e,t){return e.replace(URL_IN_CSS_REF,function(e,n,r,o){var i=n||r||o;if(!i)return e;if(!RELATIVE_PATH.test(i))return"url('"+i+"')";if(DATA_URI.test(i))return"url("+i+")";if("/"===i[0])return"url('"+(extractOrigin(t)+i)+"')";var s=t.split("/"),a=i.split("/");s.pop();for(var l=0,c=a;l<c.length;l++){var u=c[l];"."!==u&&(".."===u?s.pop():s.push(u))}return"url('"+s.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}function serializeNode(e,t,n,r){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:var o=!1;"string"==typeof n?o=e.classList.contains(n):e.classList.forEach(function(e){n.test(e)&&(o=!0)});for(var i=e.tagName.toLowerCase(),s={},a=0,l=Array.from(e.attributes);a<l.length;a++){var c=l[a],u=c.name,d=c.value;s[u]="src"===u||"href"===u?absoluteToDoc(t,d):"style"===u?absoluteToStylesheet(d,location.href):d}if("link"===i&&r){var p,f=Array.from(t.styleSheets).find(function(t){return t.href===e.href});(p=getCssRulesString(f))&&(delete s.rel,delete s.href,s._cssText=absoluteToStylesheet(p,f.href))}if("style"===i&&e.sheet&&!e.innerText.trim().length)(p=getCssRulesString(e.sheet))&&(s._cssText=absoluteToStylesheet(p,location.href));if("input"===i||"textarea"===i||"select"===i){d=e.value;"radio"!==s.type&&"checkbox"!==s.type&&d?s.value=d:e.checked&&(s.checked=e.checked)}if("option"===i){var m=e.parentElement;s.value===m.value&&(s.selected=e.selected)}if(o){var h=e.getBoundingClientRect(),v=h.width,y=h.height;s.rr_width=v+"px",s.rr_height=y+"px"}return{type:NodeType.Element,tagName:i,attributes:s,childNodes:[],isSVG:isSVGElement(e)||void 0,needBlock:o};case e.TEXT_NODE:var g=e.parentNode&&e.parentNode.tagName,b=e.textContent,E="STYLE"===g||void 0;return E&&b&&(b=absoluteToStylesheet(b,location.href)),"SCRIPT"===g&&(b="SCRIPT_PLACEHOLDER"),{type:NodeType.Text,textContent:b||"",isStyle:E};case e.CDATA_SECTION_NODE:return{type:NodeType.CDATA,textContent:""};case e.COMMENT_NODE:return{type:NodeType.Comment,textContent:e.textContent||""};default:return!1}}function serializeNodeWithId(e,t,n,r,o,i){void 0===o&&(o=!1),void 0===i&&(i=!0);var s,a=serializeNode(e,t,r,i);if(!a)return console.warn(e,"not serialized"),null;s="__sn"in e?e.__sn.id:genId();var l=Object.assign(a,{id:s});e.__sn=l,n[s]=e;var c=!o;if(l.type===NodeType.Element&&(c=c&&!l.needBlock,delete l.needBlock),(l.type===NodeType.Document||l.type===NodeType.Element)&&c)for(var u=0,d=Array.from(e.childNodes);u<d.length;u++){var p=serializeNodeWithId(d[u],t,n,r,o,i);p&&l.childNodes.push(p)}return l}function snapshot(e,t,n){void 0===t&&(t="rr-block"),void 0===n&&(n=!0);var r={};return[serializeNodeWithId(e,e,r,t,!1,n),r]}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 s="textarea"===n&&"value"===o,a="style"===n&&"_cssText"===o;if(a&&(i=addHoverClass(i)),s||a){var l=t.createTextNode(i);r.appendChild(l);continue}if("iframe"===n&&"src"===o)continue;try{e.isSVG&&"xlink:href"===o?r.setAttributeNS("http://www.w3.org/1999/xlink",o,i):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,s=e.childNodes;i<s.length;i++){var a=s[i],l=buildNodeWithSN(a,t,n);l?o.appendChild(l):console.warn("Failed to rebuild",a)}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 EventType,IncrementalSource,MouseInteractions,ReplayerEvents,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 s=t-(i-o),a=this,l=arguments;s<=0||s>t?(r&&(window.clearTimeout(r),r=null),o=i,e.apply(a,l)):r||!1===n.trailing||(r=window.setTimeout(function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(a,l)},s))}}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}function isBlocked(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var n=!1;return"string"==typeof t?n=e.classList.contains(t):e.classList.forEach(function(e){t.test(e)&&(n=!0)}),n||isBlocked(e.parentNode,t)}return isBlocked(e.parentNode,t)}function isAncestorRemoved(e){var t=mirror.getId(e);return!mirror.has(t)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||isAncestorRemoved(e.parentNode))}function deepDelete(e,t){e.delete(t),t.childNodes.forEach(function(t){return deepDelete(e,t)})}function isParentRemoved(e,t){var n=t.parentNode;if(!n)return!1;var r=mirror.getId(n);return!!e.some(function(e){return e.id===r})||isParentRemoved(e,n)}function isAncestorInSet(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||isAncestorInSet(e,n))}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta"}(EventType||(EventType={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input"}(IncrementalSource||(IncrementalSource={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove=8]="TouchMove",e[e.TouchEnd=9]="TouchEnd"}(MouseInteractions||(MouseInteractions={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction"}(ReplayerEvents||(ReplayerEvents={}));var moveKey=function(e,t){return e+"@"+t};function isINode(e){return"__sn"in e}function initMutationObserver(e,t,n){var r=new MutationObserver(function(r){var o=[],i=[],s=[],a=[],l=new Set,c=new Set,u=new Set,d={},p=function(e,n){if(!isBlocked(e,t)){if(isINode(e)){c.add(e);var r=null;n&&isINode(n)&&(r=n.__sn.id),r&&(d[moveKey(e.__sn.id,r)]=!0)}else l.add(e),u.delete(e);e.childNodes.forEach(function(e){return p(e)})}};r.forEach(function(e){var n=e.type,r=e.target,a=e.oldValue,f=e.addedNodes,m=e.removedNodes,h=e.attributeName;switch(n){case"characterData":var v=r.textContent;isBlocked(r,t)||v===a||o.push({value:v,node:r});break;case"attributes":v=r.getAttribute(h);if(isBlocked(r,t)||v===a)return;var y=i.find(function(e){return e.node===r});y||(y={node:r,attributes:{}},i.push(y)),y.attributes[h]=v;break;case"childList":f.forEach(function(e){return p(e,r)}),m.forEach(function(e){var n=mirror.getId(e),o=mirror.getId(r);isBlocked(e,t)||(l.has(e)?(deepDelete(l,e),u.add(e)):l.has(r)&&-1===n||isAncestorRemoved(r)||(c.has(e)&&d[moveKey(n,o)]?deepDelete(c,e):s.push({parentId:o,id:n})),mirror.removeNodeFromMap(e))})}});var f=[],m=function(e){var r=mirror.getId(e.parentNode);if(-1===r)return f.push(e);a.push({parentId:r,previousId:e.previousSibling?mirror.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?mirror.getId(e.nextSibling):e.nextSibling,node:serializeNodeWithId(e,document,mirror.map,t,!0,n)})};for(Array.from(c).forEach(m),Array.from(l).forEach(function(e){isAncestorInSet(u,e)||isParentRemoved(s,e)?isAncestorInSet(c,e)?m(e):u.add(e):m(e)});f.length&&!f.every(function(e){return-1===mirror.getId(e.parentNode)});)m(f.shift());var h={texts:o.map(function(e){return{id:mirror.getId(e.node),value:e.value}}).filter(function(e){return mirror.has(e.id)}),attributes:i.map(function(e){return{id:mirror.getId(e.node),attributes:e.attributes}}).filter(function(e){return mirror.has(e.id)}),removes:s,adds:a};(h.texts.length||h.attributes.length||h.removes.length||h.adds.length)&&e(h)});return r.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}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,s=e.target;t||(t=Date.now()),n.push({x:o,y:i,id:mirror.getId(s),timeOffset:Date.now()-t}),r()},50,{trailing:!1}))}function initMouseInteractionObserver(e,t){var n=[];return Object.keys(MouseInteractions).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(r){var o=r.toLowerCase(),i=function(n){return function(r){if(!isBlocked(r.target,t)){var o=mirror.getId(r.target),i=r.clientX,s=r.clientY;e({type:MouseInteractions[n],id:o,x:i,y:s})}}}(r);n.push(on(o,i))}),function(){n.forEach(function(e){return e()})}}function initScrollObserver(e,t){return on("scroll",throttle(function(n){if(n.target&&!isBlocked(n.target,t)){var r=mirror.getId(n.target);if(n.target===document){var o=document.scrollingElement||document.documentElement;e({id:r,x:o.scrollLeft,y:o.scrollTop})}else e({id:r,x:n.target.scrollLeft,y:n.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)}var INPUT_TAGS=["INPUT","TEXTAREA","SELECT"],lastInputValueMap=new WeakMap;function initInputObserver(e,t,n){function r(e){var r=e.target;if(r&&r.tagName&&!(INPUT_TAGS.indexOf(r.tagName)<0)&&!isBlocked(r,t)){var i=r.type;if("password"!==i&&!r.classList.contains(n)){var s=r.value,a=!1;"radio"!==i&&"checkbox"!==i||(a=r.checked),o(r,{text:s,isChecked:a});var l=r.name;"radio"===i&&l&&a&&document.querySelectorAll('input[type="radio"][name="'+l+'"]').forEach(function(e){e!==r&&o(e,{text:e.value,isChecked:!a})})}}}function o(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 i=["input","change"].map(function(e){return on(e,r)}),s=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),a=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]];return s&&s.set&&i.push.apply(i,a.map(function(e){return hookSetter(e[0],e[1],{set:function(){r({target:this})}})})),function(){i.forEach(function(e){return e()})}}function initObservers(e){var t=initMutationObserver(e.mutationCb,e.blockClass,e.inlineStylesheet),n=initMousemoveObserver(e.mousemoveCb),r=initMouseInteractionObserver(e.mouseInteractionCb,e.blockClass),o=initScrollObserver(e.scrollCb,e.blockClass),i=initViewportResizeObserver(e.viewportResizeCb),s=initInputObserver(e.inputCb,e.blockClass,e.ignoreClass);return function(){t.disconnect(),n(),r(),o(),i(),s()}}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,i=e.blockClass,s=void 0===i?"rr-block":i,a=e.ignoreClass,l=void 0===a?"rr-ignore":a,c=e.inlineStylesheet,u=void 0===c||c;if(!n)throw new Error("emit function is required");var d=0,p=function(e,i){if(n(e,i),e.type===EventType.FullSnapshot)t=e,d=0;else if(e.type===EventType.IncrementalSnapshot){d++;var s=o&&d>=o,a=r&&e.timestamp-t.timestamp>r;(s||a)&&f(!0)}};function f(e){void 0===e&&(e=!1),p(wrapEvent({type:EventType.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}),e);var t=snapshot(document,s,u),n=t[0],r=t[1];if(!n)return console.warn("Failed to snapshot the document");mirror.map=r,p(wrapEvent({type:EventType.FullSnapshot,data:{node:n,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}}))}try{var m=[];m.push(on("DOMContentLoaded",function(){p(wrapEvent({type:EventType.DomContentLoaded,data:{}}))}));var h=function(){f(),m.push(initObservers({mutationCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Mutation},e)}))},mousemoveCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:{source:IncrementalSource.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.MouseInteraction},e)}))},scrollCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Scroll},e)}))},viewportResizeCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.ViewportResize},e)}))},inputCb:function(e){return p(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Input},e)}))},blockClass:s,ignoreClass:l,inlineStylesheet:u}))};return"interactive"===document.readyState||"complete"===document.readyState?h():m.push(on("load",function(){p(wrapEvent({type:EventType.Load,data:{}})),h()},window)),function(){m.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},s=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,a=(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){for(;e!==t.body&&!1===p(e);)e=e.parentNode||e.host;return 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+a<e.scrollHeight:"X"===t?e.clientWidth+a<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,a,l=(s()-t.startTime)/o;a=l=l>1?1:l,n=.5*(1-Math.cos(Math.PI*a)),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 a,c,u,d,p=s();n===t.body?(a=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(a=n,c=n.scrollLeft,u=n.scrollTop,d=l),f({scrollable:a,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 s=t[0];if(!(r.timeOffset>=s.delay))break;t.shift(),s.doAction()}(t.length>0||r.config.liveMode)&&(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=function(e){return["iframe, ."+e+" { background: #ccc }","noscript { display: none !important; }"]},SKIP_TIME_THRESHOLD=1e4,SKIP_TIME_INTERVAL=5e3,mitt$1=mitt||mittProxy,REPLAY_CONSOLE_PREFIX="[replayer]",Replayer=function(){function e(e,t){if(this.events=[],this.emitter=mitt$1(),this.baselineTime=0,this.noramlSpeed=-1,this.missingNodeRetryMap={},e.length<2)throw new Error("Replayer need at least 2 events.");this.events=e,this.handleResize=this.handleResize.bind(this);var n={speed:1,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1};this.config=Object.assign({},n,t),this.timer=new Timer(this.config),smoothscroll_1(),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,s=this.getCastFn(o,i);i?s():t.push({doAction:s,delay:this.getDelay(o)})}this.timer.addActions(t),this.timer.start(),this.emitter.emit(ReplayerEvents.Start)},e.prototype.pause=function(){this.timer.clear(),this.emitter.emit(ReplayerEvents.Pause)},e.prototype.resume=function(e){void 0===e&&(e=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+e;for(var t=new Array,n=0,r=this.events;n<r.length;n++){var o=r[n];if(!(o.timestamp<=this.lastPlayedEvent.timestamp||o===this.lastPlayedEvent)){var i=this.getCastFn(o);t.push({doAction:i,delay:this.getDelay(o)})}}this.timer.addActions(t),this.timer.start(),this.emitter.emit(ReplayerEvents.Resume)},e.prototype.addEvent=function(e){this.getCastFn(e,!0)()},e.prototype.setupDom=function(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.iframe=document.createElement("iframe"),this.iframe.setAttribute("sandbox","allow-same-origin"),this.iframe.setAttribute("scrolling","no"),this.wrapper.appendChild(this.iframe)},e.prototype.handleResize=function(e){this.iframe.width=e.width+"px",this.iframe.height=e.height+"px"},e.prototype.getDelay=function(e){if(e.type===EventType.IncrementalSnapshot&&e.data.source===IncrementalSource.MouseMove){var t=e.data.positions[0].timeOffset,n=e.timestamp+t;return e.delay=n-this.baselineTime,n-this.baselineTime}return e.delay=e.timestamp-this.baselineTime,e.timestamp-this.baselineTime},e.prototype.getCastFn=function(e,t){var n,r=this;switch(void 0===t&&(t=!1),e.type){case EventType.DomContentLoaded:case EventType.Load:break;case EventType.Meta:n=function(){return r.emitter.emit(ReplayerEvents.Resize,{width:e.data.width,height:e.data.height})};break;case EventType.FullSnapshot:n=function(){r.rebuildFullSnapshot(e),r.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case EventType.IncrementalSnapshot:n=function(){if(r.applyIncremental(e,t),e===r.nextUserInteractionEvent&&(r.nextUserInteractionEvent=null,r.restoreSpeed()),r.config.skipInactive&&!r.nextUserInteractionEvent){for(var n=0,o=r.events;n<o.length;n++){var i=o[n];if(!(i.timestamp<=e.timestamp)&&r.isUserInteraction(i)){i.delay-e.delay>SKIP_TIME_THRESHOLD*r.config.speed&&(r.nextUserInteractionEvent=i);break}}if(r.nextUserInteractionEvent){r.noramlSpeed=r.config.speed;var s=r.nextUserInteractionEvent.delay-e.delay,a={speed:Math.min(Math.round(s/SKIP_TIME_INTERVAL),360)};r.setConfig(a),r.emitter.emit(ReplayerEvents.SkipStart,a)}}}}return function(){n&&n(),r.lastPlayedEvent=e,e===r.events[r.events.length-1]&&(r.restoreSpeed(),r.emitter.emit(ReplayerEvents.Finish))}},e.prototype.rebuildFullSnapshot=function(e){Object.keys(this.missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.missingNodeRetryMap),this.missingNodeRetryMap={},mirror.map=rebuild(e.data.node,this.iframe.contentDocument)[1];var t=document.createElement("style"),n=this.iframe.contentDocument,r=n.documentElement,o=n.head;r.insertBefore(t,o);for(var i=rules(this.config.blockClass),s=0;s<i.length;s++)t.sheet.insertRule(i[s],s);this.emitter.emit(ReplayerEvents.FullsnapshotRebuilded),this.waitForStylesheetLoad()},e.prototype.waitForStylesheetLoad=function(){var e=this,t=this.iframe.contentDocument.head;if(t){var n,r=new Set;t.querySelectorAll('link[rel="stylesheet"]').forEach(function(t){t.sheet||(0===r.size&&(e.pause(),e.emitter.emit(ReplayerEvents.LoadStylesheetStart),n=window.setTimeout(function(){e.resume(e.timer.timeOffset),n=-1},e.config.loadTimeout)),r.add(t),t.addEventListener("load",function(){r.delete(t),0===r.size&&-1!==n&&(e.resume(e.timer.timeOffset),e.emitter.emit(ReplayerEvents.LoadStylesheetEnd),n&&window.clearTimeout(n))}))})}},e.prototype.applyIncremental=function(e,t){var n=this,r=e.data;switch(r.source){case IncrementalSource.Mutation:r.removes.forEach(function(e){var t=mirror.getNode(e.id);if(!t)return n.warnNodeNotFound(r,e.id);var o=mirror.getNode(e.parentId);if(!o)return n.warnNodeNotFound(r,e.parentId);mirror.removeNodeFromMap(t),o&&o.removeChild(t)});var o=__assign({},this.missingNodeRetryMap),i=[],s=function(e){var t=mirror.getNode(e.parentId);if(!t)return i.push(e);var r=buildNodeWithSN(e.node,n.iframe.contentDocument,mirror.map,!0),s=null,a=null;e.previousId&&(s=mirror.getNode(e.previousId)),e.nextId&&(a=mirror.getNode(e.nextId)),-1!==e.previousId&&-1!==e.nextId?(s&&s.nextSibling&&s.nextSibling.parentNode?t.insertBefore(r,s.nextSibling):a&&a.parentNode?t.insertBefore(r,a):t.appendChild(r),(e.previousId||e.nextId)&&n.resolveMissingNode(o,t,r,e)):o[e.node.id]={node:r,mutation:e}};for(r.adds.forEach(function(e){s(e)});i.length;){if(i.every(function(e){return!Boolean(mirror.getNode(e.parentId))}))return i.forEach(function(e){return n.warnNodeNotFound(r,e.node.id)});var a=i.shift();s(a)}Object.keys(o).length&&Object.assign(this.missingNodeRetryMap,o),r.texts.forEach(function(e){var t=mirror.getNode(e.id);if(!t)return n.warnNodeNotFound(r,e.id);t.textContent=e.value}),r.attributes.forEach(function(e){var t=mirror.getNode(e.id);if(!t)return n.warnNodeNotFound(r,e.id);for(var o in e.attributes)if("string"==typeof o){var i=e.attributes[o];null!==i?t.setAttribute(o,i):t.removeAttribute(o)}});break;case IncrementalSource.MouseMove:if(t){var l=r.positions[r.positions.length-1];this.moveAndHover(r,l.x,l.y,l.id)}else r.positions.forEach(function(t){var o={doAction:function(){n.moveAndHover(r,t.x,t.y,t.id)},delay:t.timeOffset+e.timestamp-n.baselineTime};n.timer.addAction(o)});break;case IncrementalSource.MouseInteraction:if(-1===r.id)break;var c=new Event(MouseInteractions[r.type].toLowerCase());if(!(u=mirror.getNode(r.id)))return this.debugNodeNotFound(r,r.id);switch(this.emitter.emit(ReplayerEvents.MouseInteraction,{type:r.type,target:u}),r.type){case MouseInteractions.Blur:u.blur&&u.blur();break;case MouseInteractions.Focus:u.focus&&u.focus({preventScroll:!0});break;case MouseInteractions.Click:t||(this.moveAndHover(r,r.x,r.y,r.id),this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:u.dispatchEvent(c)}break;case IncrementalSource.Scroll:if(-1===r.id)break;if(!(u=mirror.getNode(r.id)))return this.debugNodeNotFound(r,r.id);if(u===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:r.y,left:r.x,behavior:t?"auto":"smooth"});else try{u.scrollTop=r.y,u.scrollLeft=r.x}catch(e){}break;case IncrementalSource.ViewportResize:this.emitter.emit(ReplayerEvents.Resize,{width:r.width,height:r.height});break;case IncrementalSource.Input:if(-1===r.id)break;var u;if(!(u=mirror.getNode(r.id)))return this.debugNodeNotFound(r,r.id);try{u.checked=r.isChecked,u.value=r.text}catch(e){}}},e.prototype.resolveMissingNode=function(e,t,n,r){var o=r.previousId,i=r.nextId,s=o&&e[o],a=i&&e[i];if(s){var l=s,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(a){var d=a;c=d.node,u=d.mutation;t.insertBefore(c,n.nextSibling),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,c,u)}},e.prototype.moveAndHover=function(e,t,n,r){this.mouse.style.left=t+"px",this.mouse.style.top=n+"px";var o=mirror.getNode(r);if(!o)return this.debugNodeNotFound(e,r);this.hoverElements(o)},e.prototype.hoverElements=function(e){this.iframe.contentDocument.querySelectorAll(".\\:hover").forEach(function(e){e.classList.remove(":hover")});for(var t=e;t;)t.classList.add(":hover"),t=t.parentElement},e.prototype.isUserInteraction=function(e){return e.type===EventType.IncrementalSnapshot&&(e.data.source>IncrementalSource.Mutation&&e.data.source<=IncrementalSource.Input)},e.prototype.restoreSpeed=function(){if(-1!==this.noramlSpeed){var e={speed:this.noramlSpeed};this.setConfig(e),this.emitter.emit(ReplayerEvents.SkipEnd,e),this.noramlSpeed=-1}},e.prototype.warnNodeNotFound=function(e,t){this.config.showWarning&&console.warn(REPLAY_CONSOLE_PREFIX,"Node with id '"+t+"' not found in",e)},e.prototype.debugNodeNotFound=function(e,t){this.config.showDebug&&console.log(REPLAY_CONSOLE_PREFIX,"Node with id '"+t+"' not found in",e)},e}();export{record,Replayer,mirror,EventType,IncrementalSource,MouseInteractions,ReplayerEvents};
//# sourceMappingURL=rrweb.min.js.map

@@ -466,3 +466,3 @@ 'use strict';

}
function isParentDropped(droppedSet, n) {
function isAncestorInSet(set, n) {
var parentNode = n.parentNode;

@@ -472,8 +472,12 @@ if (!parentNode) {

}
if (droppedSet.has(parentNode)) {
if (set.has(parentNode)) {
return true;
}
return isParentDropped(droppedSet, parentNode);
return isAncestorInSet(set, parentNode);
}
var moveKey = function (id, parentId) { return id + "@" + parentId; };
function isINode(n) {
return '__sn' in n;
}
function initMutationObserver(cb, blockClass, inlineStylesheet) {

@@ -485,10 +489,24 @@ var observer = new MutationObserver(function (mutations) {

var adds = [];
var addsSet = new Set();
var addedSet = new Set();
var movedSet = new Set();
var droppedSet = new Set();
var genAdds = function (n) {
var movedMap = {};
var genAdds = function (n, target) {
if (isBlocked(n, blockClass)) {
return;
}
addsSet.add(n);
droppedSet["delete"](n);
if (isINode(n)) {
movedSet.add(n);
var targetId = null;
if (target && isINode(target)) {
targetId = target.__sn.id;
}
if (targetId) {
movedMap[moveKey(n.__sn.id, targetId)] = true;
}
}
else {
addedSet.add(n);
droppedSet["delete"](n);
}
n.childNodes.forEach(function (childN) { return genAdds(childN); });

@@ -526,3 +544,3 @@ };

case 'childList': {
addedNodes.forEach(function (n) { return genAdds(n); });
addedNodes.forEach(function (n) { return genAdds(n, target); });
removedNodes.forEach(function (n) {

@@ -534,8 +552,11 @@ var nodeId = mirror.getId(n);

}
if (addsSet.has(n)) {
deepDelete(addsSet, n);
if (addedSet.has(n)) {
deepDelete(addedSet, n);
droppedSet.add(n);
}
else if (addsSet.has(target) && nodeId === -1) ;
else if (addedSet.has(target) && nodeId === -1) ;
else if (isAncestorRemoved(target)) ;
else if (movedSet.has(n) && movedMap[moveKey(nodeId, parentId)]) {
deepDelete(movedSet, n);
}
else {

@@ -555,15 +576,27 @@ removes.push({

});
Array.from(addsSet).forEach(function (n) {
if (!isParentDropped(droppedSet, n) && !isParentRemoved(removes, n)) {
adds.push({
parentId: mirror.getId(n.parentNode),
previousId: !n.previousSibling
? n.previousSibling
: mirror.getId(n.previousSibling),
nextId: !n.nextSibling
? n.nextSibling
: mirror.getId(n.nextSibling),
node: serializeNodeWithId(n, document, mirror.map, blockClass, true)
});
var addQueue = [];
var pushAdd = function (n) {
var parentId = mirror.getId(n.parentNode);
if (parentId === -1) {
return addQueue.push(n);
}
adds.push({
parentId: parentId,
previousId: !n.previousSibling
? n.previousSibling
: mirror.getId(n.previousSibling),
nextId: !n.nextSibling
? n.nextSibling
: mirror.getId(n.nextSibling),
node: serializeNodeWithId(n, document, mirror.map, blockClass, true, inlineStylesheet)
});
};
Array.from(movedSet).forEach(pushAdd);
Array.from(addedSet).forEach(function (n) {
if (!isAncestorInSet(droppedSet, n) && !isParentRemoved(removes, n)) {
pushAdd(n);
}
else if (isAncestorInSet(movedSet, n)) {
pushAdd(n);
}
else {

@@ -573,2 +606,8 @@ droppedSet.add(n);

});
while (addQueue.length) {
if (addQueue.every(function (n) { return mirror.getId(n.parentNode) === -1; })) {
break;
}
pushAdd(addQueue.shift());
}
var payload = {

@@ -575,0 +614,0 @@ texts: texts

{
"name": "rrweb",
"version": "0.7.15",
"version": "0.7.16",
"description": "record and replay the web",

@@ -27,4 +27,3 @@ "scripts": {

"es",
"typings",
"index.d.ts"
"typings"
],

@@ -31,0 +30,0 @@ "author": "yanzhen@smartx.com",

import record from './record';
import { Replayer } from './replay';
import { mirror } from './utils';
export { EventType, IncrementalSource, MouseInteractions, ReplayerEvents } from './types';
export { record, Replayer, mirror };
import { removedNodeMutation } from '../types';
export declare function deepDelete(addsSet: Set<Node>, n: Node): void;
export declare function isParentRemoved(removes: removedNodeMutation[], n: Node): boolean;
export declare function isParentDropped(droppedSet: Set<Node>, n: Node): boolean;
export declare function isAncestorInSet(set: Set<Node>, n: Node): boolean;
import Timer from './timer';
import { eventWithTime, playerConfig, playerMetaData } from '../types';
import { eventWithTime, playerConfig, playerMetaData, Handler } from '../types';
import './styles/style.css';

@@ -18,3 +18,3 @@ export declare class Replayer {

constructor(events: eventWithTime[], config?: Partial<playerConfig>);
on(event: string, handler: mitt.Handler): void;
on(event: string, handler: Handler): void;
setConfig(config: Partial<playerConfig>): void;

@@ -21,0 +21,0 @@ getMetaData(): playerMetaData;

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

};
export declare type Handler = (event?: unknown) => void;
export declare type Emitter = {
on(type: string, handler: Handler): void;
emit(type: string, event?: unknown): void;
};
export declare enum ReplayerEvents {

@@ -213,0 +218,0 @@ Start = "start",

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc