Socket
Socket
Sign inDemoInstall

rrweb

Package Overview
Dependencies
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rrweb - npm Package Compare versions

Comparing version 0.6.2 to 0.6.3

7

dist/record/rrweb-record.js

@@ -73,5 +73,6 @@ var record = (function () {

var URL_IN_CSS_REF = /url\((['"]|)([^'"]*)\1\)/gm;
var RELATIVE_PATH = /^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/;
function absoluteToStylesheet(cssText, href) {
return cssText.replace(URL_IN_CSS_REF, function (_1, _2, filePath) {
if (!/^[./]/.test(filePath)) {
if (!RELATIVE_PATH.test(filePath)) {
return "url('" + filePath + "')";

@@ -100,7 +101,3 @@ }

}
var RELATIVE_PATH = /^(\.\.|\.|)\//;
function absoluteToDoc(doc, attributeValue) {
if (!RELATIVE_PATH.test(attributeValue)) {
return attributeValue;
}
var a = doc.createElement('a');

@@ -107,0 +104,0 @@ a.href = attributeValue;

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

var record=function(){"use strict";var e,t=function(){return(t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(e||(e={}));var n=1;var r=/url\((['"]|)([^'"]*)\1\)/gm;function o(e,t){return e.replace(r,function(e,n,r){if(!/^[.\/]/.test(r))return"url('"+r+"')";if("/"===r[0])return"url('"+(((o=t).indexOf("//")>-1?o.split("/").slice(0,3).join("/"):o.split("/")[0]).split("?")[0]+r)+"')";var o,u=t.split("/"),a=r.split("/");u.pop();for(var i=0,c=a;i<c.length;i++){var d=c[i];"."!==d&&(".."===d?u.pop():u.push(d))}return"url('"+u.join("/")+"')"})}var u=/^(\.\.|\.|)\//;function a(e,t){if(!u.test(t))return t;var n=e.createElement("a");return n.href=t,n.href}function i(t,n){switch(t.nodeType){case t.DOCUMENT_NODE:return{type:e.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId};case t.ELEMENT_NODE:for(var r=t.tagName.toLowerCase(),u={},i=0,c=Array.from(t.attributes);i<c.length;i++){var d=c[i],s=d.name,l=d.value;u[s]="src"===s||"href"===s?a(n,l):l}if("link"===r){var p=Array.from(n.styleSheets).find(function(e){return e.href===t.href}),f=function(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+t.cssText},""):null}catch(e){return null}}(p);f&&(u={_cssText:o(f,p.href)})}if("input"===r||"textarea"===r||"select"===r){l=t.value;"radio"!==u.type&&"checkbox"!==u.type&&l?u.value=l:t.checked&&(u.checked=t.checked)}if("option"===r){var m=t.parentElement;u.value===m.value&&(u.selected=t.selected)}return{type:e.Element,tagName:r,attributes:u,childNodes:[],isSVG:(g=t,"svg"===g.tagName||g instanceof SVGElement||void 0)};case t.TEXT_NODE:var h=t.parentNode&&t.parentNode.tagName,v=t.textContent,y="STYLE"===h||void 0;return y&&v&&(v=o(v,location.href)),"SCRIPT"===h&&(v="SCRIPT_PLACEHOLDER"),{type:e.Text,textContent:v||"",isStyle:y};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 g}function c(t,r,o,u){void 0===u&&(u=!1);var a=i(t,r);if(!a)return console.warn(t,"not serialized"),null;var d=Object.assign(a,{id:n++});if(t.__sn=d,o[d.id]=t,(d.type===e.Document||d.type===e.Element)&&!u)for(var s=0,l=Array.from(t.childNodes);s<l.length;s++){var p=c(l[s],r,o);p&&d.childNodes.push(p)}return d}function d(e){n=1;var t={};return[c(e,e,t),t]}function s(e,t,n){return void 0===n&&(n=document),n.addEventListener(e,t,{capture:!0,passive:!0}),function(){return n.removeEventListener(e,t)}}var l,p,f,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 h(e,t,n){void 0===n&&(n={});var r=null,o=0;return function(){var u=Date.now();o||!1!==n.leading||(o=u);var a=t-(u-o),i=this,c=arguments;a<=0||a>t?(r&&(window.clearTimeout(r),r=null),o=u,e.apply(i,c)):r||!1===n.trailing||(r=window.setTimeout(function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(i,c)},a))}}function v(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function y(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function g(e){var t=[];return Object.keys(f).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(n){var r=n.toLowerCase(),o=function(t){return function(n){var r=m.getId(n.target),o=n.clientX,u=n.clientY;e({type:f[t],id:r,x:o,y:u})}}(n);t.push(s(r,o))}),function(){t.forEach(function(e){return e()})}}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta"}(l||(l={})),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"}(p||(p={})),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"}(f||(f={}));var E=["INPUT","TEXTAREA","SELECT"],b=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],C=new WeakMap;function I(e){function n(e){var t=e.target;if(t&&t.tagName&&!(E.indexOf(t.tagName)<0)){var n=t.type,o=t.value,u=!1;"radio"!==n&&"checkbox"!==n||(u=t.checked),r(t,{text:o,isChecked:u});var a=t.name;"radio"===n&&a&&u&&document.querySelectorAll('input[type="radio"][name="'+a+'"]').forEach(function(e){e!==t&&r(e,{text:e.value,isChecked:!u})})}}function r(n,r){var o=C.get(n);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){C.set(n,r);var u=m.getId(n);e(t({},r,{id:u}))}}var o=["input","change"].map(function(e){return s(e,n)}),u=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");return u&&u.set&&o.push.apply(o,b.map(function(e){return function e(t,n,r){var o=Object.getOwnPropertyDescriptor(t,n);return Object.defineProperty(t,n,{set:function(e){var t=this;setTimeout(function(){r.set.call(t,e)},0),o&&o.set&&o.set.call(this,e)}}),function(){return e(t,n,o||{})}}(e[0],e[1],{set:function(){n({target:this})}})})),function(){o.forEach(function(e){return e()})}}function w(e){var t,n;return{mutationObserver:(t=e.mutationCb,(n=new MutationObserver(function(e){var n=[],r=[],o=[],u=[],a=[],i=new Set,d=function(e){i.add(e),e.childNodes.forEach(function(e){return d(e)})};e.forEach(function(e){var t=e.type,u=e.target,c=e.oldValue,s=e.addedNodes,l=e.removedNodes,p=e.attributeName;switch(t){case"characterData":(f=u.textContent)!==c&&n.push({value:f,node:u});break;case"attributes":var f;if((f=u.getAttribute(p))===c)return;var h=r.find(function(e){return e.node===u});h||(h={node:u,attributes:{}},r.push(h)),h.attributes[p]=f;case"childList":s.forEach(function(e){return d(e)}),l.forEach(function(e){i.has(e)?(i.delete(e),a.push(e)):i.has(u)&&!m.getId(e)||o.push({parentId:m.getId(u),id:m.getId(e)}),m.removeNodeFromMap(e)})}}),o=o.map(function(e){return e.parentNode&&(e.parentId=m.getId(e.parentNode),delete e.parentNode),e}),Array.from(i).forEach(function(e){var t=m.getId(e.parentNode);!t||a.some(function(t){return t===e.parentNode})||o.some(function(e){return e.id===t})?a.push(e):u.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:c(e,document,m.map,!0)})}),t({texts:n.map(function(e){return{id:m.getId(e.node),value:e.value}}).filter(function(e){return m.has(e.id)}),attributes:r.map(function(e){return{id:m.getId(e.node),attributes:e.attributes}}).filter(function(e){return m.has(e.id)}),removes:o,adds:u})})).observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n),mousemoveHandler:function(e){var t,n=[],r=h(function(){var r=Date.now()-t;e(n.map(function(e){return e.timeOffset-=r,e})),n=[],t=null},500);return s("mousemove",h(function(e){var o=e.clientX,u=e.clientY,a=e.target;t||(t=Date.now()),n.push({x:o,y:u,id:m.getId(a),timeOffset:Date.now()-t}),r()},20,{trailing:!1}))}(e.mousemoveCb),mouseInteractionHandler:g(e.mouseInteractionCb),scrollHandler:function(e){return s("scroll",h(function(t){if(t.target){var n=m.getId(t.target);t.target===document?e({id:n,x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}):e({id:n,x:t.target.scrollLeft,y:t.target.scrollTop})}},100))}(e.scrollCb),viewportResizeHandler:function(e){return s("resize",h(function(){var t=v(),n=y();e({width:Number(n),height:Number(t)})},200),window)}(e.viewportResizeCb),inputHandler:I(e.inputCb)}}function N(e){return t({},e,{timestamp:Date.now()})}return function(e){void 0===e&&(e={});var n=e.emit;if(!n)throw new Error("emit function is required");try{s("DOMContentLoaded",function(){n(N({type:l.DomContentLoaded,data:{}}))});var r=function(){n(N({type:l.Meta,data:{href:window.location.href,width:y(),height:v()}}));var e=d(document),r=e[0],o=e[1];if(!r)return console.warn("Failed to snapshot the document");m.map=o,n(N({type:l.FullSnapshot,data:{node:r,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}})),w({mutationCb:function(e){return n(N({type:l.IncrementalSnapshot,data:t({source:p.Mutation},e)}))},mousemoveCb:function(e){return n(N({type:l.IncrementalSnapshot,data:{source:p.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return n(N({type:l.IncrementalSnapshot,data:t({source:p.MouseInteraction},e)}))},scrollCb:function(e){return n(N({type:l.IncrementalSnapshot,data:t({source:p.Scroll},e)}))},viewportResizeCb:function(e){return n(N({type:l.IncrementalSnapshot,data:t({source:p.ViewportResize},e)}))},inputCb:function(e){return n(N({type:l.IncrementalSnapshot,data:t({source:p.Input},e)}))}})};"interactive"===document.readyState||"complete"===document.readyState?r():s("load",function(){n(N({type:l.Load,data:{}})),r()},window)}catch(e){console.warn(e)}}}();
var record=function(){"use strict";var e,t=function(){return(t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(e||(e={}));var n=1;var r=/url\((['"]|)([^'"]*)\1\)/gm,o=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/;function u(e,t){return e.replace(r,function(e,n,r){if(!o.test(r))return"url('"+r+"')";if("/"===r[0])return"url('"+(((u=t).indexOf("//")>-1?u.split("/").slice(0,3).join("/"):u.split("/")[0]).split("?")[0]+r)+"')";var u,a=t.split("/"),i=r.split("/");a.pop();for(var c=0,d=i;c<d.length;c++){var s=d[c];"."!==s&&(".."===s?a.pop():a.push(s))}return"url('"+a.join("/")+"')"})}function a(e,t){var n=e.createElement("a");return n.href=t,n.href}function i(t,n){switch(t.nodeType){case t.DOCUMENT_NODE:return{type:e.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId};case t.ELEMENT_NODE:for(var r=t.tagName.toLowerCase(),o={},i=0,c=Array.from(t.attributes);i<c.length;i++){var d=c[i],s=d.name,l=d.value;o[s]="src"===s||"href"===s?a(n,l):l}if("link"===r){var p=Array.from(n.styleSheets).find(function(e){return e.href===t.href}),f=function(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+t.cssText},""):null}catch(e){return null}}(p);f&&(o={_cssText:u(f,p.href)})}if("input"===r||"textarea"===r||"select"===r){l=t.value;"radio"!==o.type&&"checkbox"!==o.type&&l?o.value=l:t.checked&&(o.checked=t.checked)}if("option"===r){var m=t.parentElement;o.value===m.value&&(o.selected=t.selected)}return{type:e.Element,tagName:r,attributes:o,childNodes:[],isSVG:(g=t,"svg"===g.tagName||g instanceof SVGElement||void 0)};case t.TEXT_NODE:var h=t.parentNode&&t.parentNode.tagName,v=t.textContent,y="STYLE"===h||void 0;return y&&v&&(v=u(v,location.href)),"SCRIPT"===h&&(v="SCRIPT_PLACEHOLDER"),{type:e.Text,textContent:v||"",isStyle:y};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 g}function c(t,r,o,u){void 0===u&&(u=!1);var a=i(t,r);if(!a)return console.warn(t,"not serialized"),null;var d=Object.assign(a,{id:n++});if(t.__sn=d,o[d.id]=t,(d.type===e.Document||d.type===e.Element)&&!u)for(var s=0,l=Array.from(t.childNodes);s<l.length;s++){var p=c(l[s],r,o);p&&d.childNodes.push(p)}return d}function d(e){n=1;var t={};return[c(e,e,t),t]}function s(e,t,n){return void 0===n&&(n=document),n.addEventListener(e,t,{capture:!0,passive:!0}),function(){return n.removeEventListener(e,t)}}var l,p,f,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 h(e,t,n){void 0===n&&(n={});var r=null,o=0;return function(){var u=Date.now();o||!1!==n.leading||(o=u);var a=t-(u-o),i=this,c=arguments;a<=0||a>t?(r&&(window.clearTimeout(r),r=null),o=u,e.apply(i,c)):r||!1===n.trailing||(r=window.setTimeout(function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(i,c)},a))}}function v(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function y(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function g(e){var t=[];return Object.keys(f).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(n){var r=n.toLowerCase(),o=function(t){return function(n){var r=m.getId(n.target),o=n.clientX,u=n.clientY;e({type:f[t],id:r,x:o,y:u})}}(n);t.push(s(r,o))}),function(){t.forEach(function(e){return e()})}}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta"}(l||(l={})),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"}(p||(p={})),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"}(f||(f={}));var E=["INPUT","TEXTAREA","SELECT"],b=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],w=new WeakMap;function C(e){function n(e){var t=e.target;if(t&&t.tagName&&!(E.indexOf(t.tagName)<0)){var n=t.type,o=t.value,u=!1;"radio"!==n&&"checkbox"!==n||(u=t.checked),r(t,{text:o,isChecked:u});var a=t.name;"radio"===n&&a&&u&&document.querySelectorAll('input[type="radio"][name="'+a+'"]').forEach(function(e){e!==t&&r(e,{text:e.value,isChecked:!u})})}}function r(n,r){var o=w.get(n);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){w.set(n,r);var u=m.getId(n);e(t({},r,{id:u}))}}var o=["input","change"].map(function(e){return s(e,n)}),u=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");return u&&u.set&&o.push.apply(o,b.map(function(e){return function e(t,n,r){var o=Object.getOwnPropertyDescriptor(t,n);return Object.defineProperty(t,n,{set:function(e){var t=this;setTimeout(function(){r.set.call(t,e)},0),o&&o.set&&o.set.call(this,e)}}),function(){return e(t,n,o||{})}}(e[0],e[1],{set:function(){n({target:this})}})})),function(){o.forEach(function(e){return e()})}}function I(e){var t,n;return{mutationObserver:(t=e.mutationCb,(n=new MutationObserver(function(e){var n=[],r=[],o=[],u=[],a=[],i=new Set,d=function(e){i.add(e),e.childNodes.forEach(function(e){return d(e)})};e.forEach(function(e){var t=e.type,u=e.target,c=e.oldValue,s=e.addedNodes,l=e.removedNodes,p=e.attributeName;switch(t){case"characterData":(f=u.textContent)!==c&&n.push({value:f,node:u});break;case"attributes":var f;if((f=u.getAttribute(p))===c)return;var h=r.find(function(e){return e.node===u});h||(h={node:u,attributes:{}},r.push(h)),h.attributes[p]=f;case"childList":s.forEach(function(e){return d(e)}),l.forEach(function(e){i.has(e)?(i.delete(e),a.push(e)):i.has(u)&&!m.getId(e)||o.push({parentId:m.getId(u),id:m.getId(e)}),m.removeNodeFromMap(e)})}}),o=o.map(function(e){return e.parentNode&&(e.parentId=m.getId(e.parentNode),delete e.parentNode),e}),Array.from(i).forEach(function(e){var t=m.getId(e.parentNode);!t||a.some(function(t){return t===e.parentNode})||o.some(function(e){return e.id===t})?a.push(e):u.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:c(e,document,m.map,!0)})}),t({texts:n.map(function(e){return{id:m.getId(e.node),value:e.value}}).filter(function(e){return m.has(e.id)}),attributes:r.map(function(e){return{id:m.getId(e.node),attributes:e.attributes}}).filter(function(e){return m.has(e.id)}),removes:o,adds:u})})).observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n),mousemoveHandler:function(e){var t,n=[],r=h(function(){var r=Date.now()-t;e(n.map(function(e){return e.timeOffset-=r,e})),n=[],t=null},500);return s("mousemove",h(function(e){var o=e.clientX,u=e.clientY,a=e.target;t||(t=Date.now()),n.push({x:o,y:u,id:m.getId(a),timeOffset:Date.now()-t}),r()},20,{trailing:!1}))}(e.mousemoveCb),mouseInteractionHandler:g(e.mouseInteractionCb),scrollHandler:function(e){return s("scroll",h(function(t){if(t.target){var n=m.getId(t.target);t.target===document?e({id:n,x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}):e({id:n,x:t.target.scrollLeft,y:t.target.scrollTop})}},100))}(e.scrollCb),viewportResizeHandler:function(e){return s("resize",h(function(){var t=v(),n=y();e({width:Number(n),height:Number(t)})},200),window)}(e.viewportResizeCb),inputHandler:C(e.inputCb)}}function N(e){return t({},e,{timestamp:Date.now()})}return function(e){void 0===e&&(e={});var n=e.emit;if(!n)throw new Error("emit function is required");try{s("DOMContentLoaded",function(){n(N({type:l.DomContentLoaded,data:{}}))});var r=function(){n(N({type:l.Meta,data:{href:window.location.href,width:y(),height:v()}}));var e=d(document),r=e[0],o=e[1];if(!r)return console.warn("Failed to snapshot the document");m.map=o,n(N({type:l.FullSnapshot,data:{node:r,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}})),I({mutationCb:function(e){return n(N({type:l.IncrementalSnapshot,data:t({source:p.Mutation},e)}))},mousemoveCb:function(e){return n(N({type:l.IncrementalSnapshot,data:{source:p.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return n(N({type:l.IncrementalSnapshot,data:t({source:p.MouseInteraction},e)}))},scrollCb:function(e){return n(N({type:l.IncrementalSnapshot,data:t({source:p.Scroll},e)}))},viewportResizeCb:function(e){return n(N({type:l.IncrementalSnapshot,data:t({source:p.ViewportResize},e)}))},inputCb:function(e){return n(N({type:l.IncrementalSnapshot,data:t({source:p.Input},e)}))}})};"interactive"===document.readyState||"complete"===document.readyState?r():s("load",function(){n(N({type:l.Load,data:{}})),r()},window)}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,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"}(t||(t={}));var r=1;var o=/url\((['"]|)([^'"]*)\1\)/gm;function i(e,t){return e.replace(o,function(e,n,r){if(!/^[.\/]/.test(r))return"url('"+r+"')";if("/"===r[0])return"url('"+(((o=t).indexOf("//")>-1?o.split("/").slice(0,3).join("/"):o.split("/")[0]).split("?")[0]+r)+"')";var o,i=t.split("/"),a=r.split("/");i.pop();for(var s=0,u=a;s<u.length;s++){var c=u[s];"."!==c&&(".."===c?i.pop():i.push(c))}return"url('"+i.join("/")+"')"})}var a=/^(\.\.|\.|)\//;function s(e,t){if(!a.test(t))return t;var n=e.createElement("a");return n.href=t,n.href}function u(e,n){switch(e.nodeType){case e.DOCUMENT_NODE:return{type:t.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:t.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId};case e.ELEMENT_NODE:for(var r=e.tagName.toLowerCase(),o={},a=0,u=Array.from(e.attributes);a<u.length;a++){var c=u[a],l=c.name,d=c.value;o[l]="src"===l||"href"===l?s(n,d):d}if("link"===r){var p=Array.from(n.styleSheets).find(function(t){return t.href===e.href}),f=function(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+t.cssText},""):null}catch(e){return null}}(p);f&&(o={_cssText:i(f,p.href)})}if("input"===r||"textarea"===r||"select"===r){d=e.value;"radio"!==o.type&&"checkbox"!==o.type&&d?o.value=d:e.checked&&(o.checked=e.checked)}if("option"===r){var h=e.parentElement;o.value===h.value&&(o.selected=e.selected)}return{type:t.Element,tagName:r,attributes:o,childNodes:[],isSVG:(g=e,"svg"===g.tagName||g instanceof SVGElement||void 0)};case e.TEXT_NODE:var m=e.parentNode&&e.parentNode.tagName,v=e.textContent,y="STYLE"===m||void 0;return y&&v&&(v=i(v,location.href)),"SCRIPT"===m&&(v="SCRIPT_PLACEHOLDER"),{type:t.Text,textContent:v||"",isStyle:y};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 g}function c(e,n,o,i){void 0===i&&(i=!1);var a=u(e,n);if(!a)return console.warn(e,"not serialized"),null;var s=Object.assign(a,{id:r++});if(e.__sn=s,o[s.id]=e,(s.type===t.Document||s.type===t.Element)&&!i)for(var l=0,d=Array.from(e.childNodes);l<d.length;l++){var p=c(d[l],n,o);p&&s.childNodes.push(p)}return s}function l(e){r=1;var t={};return[c(e,e,t),t]}var d={script:"noscript"};var p=/([^\r\n,{}]+)(,(?=[^}]*{)|\s*{)/g,f=/([^\\]):hover/g;function h(e){return e.replace(p,function(e,t,n){if(f.test(t)){var r=t.replace(f,"$1.\\:hover");return t.replace(/\s*$/,"")+", "+r.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 r=function(e){var t=d[e.tagName]?d[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e),o=void 0;for(var i in o=e.isSVG?n.createElementNS("http://www.w3.org/2000/svg",r):n.createElement(r),e.attributes)if(e.attributes.hasOwnProperty(i)){var a=e.attributes[i];a="boolean"==typeof a?"":a;var s="textarea"===r&&"value"===i,u="style"===r&&"_cssText"===i;if(u&&(a=h(a)),s||u){var c=n.createTextNode(a);o.appendChild(c)}try{o.setAttribute(i,a)}catch(e){}}return o;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,r,o){void 0===o&&(o=!1);var i=m(e,n);if(!i)return null;if(e.type===t.Document&&(n.open(),i=n),i.__sn=e,r[e.id]=i,(e.type===t.Document||e.type===t.Element)&&!o)for(var a=0,s=e.childNodes;a<s.length;a++){var u=s[a],c=v(u,n,r);c?i.appendChild(c):console.warn("Failed to rebuild",u)}return i}function y(e,t,n){return void 0===n&&(n=document),n.addEventListener(e,t,{capture:!0,passive:!0}),function(){return n.removeEventListener(e,t)}}var g,b,w,x={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return x.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete x.map[t],e.childNodes&&e.childNodes.forEach(function(e){return x.removeNodeFromMap(e)})},has:function(e){return x.map.hasOwnProperty(e)}};function E(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 I(){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 N(e){var t=[];return Object.keys(w).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(n){var r=n.toLowerCase(),o=function(t){return function(n){var r=x.getId(n.target),o=n.clientX,i=n.clientY;e({type:w[t],id:r,x:o,y:i})}}(n);t.push(y(r,o))}),function(){t.forEach(function(e){return e()})}}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta"}(g||(g={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input"}(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={}));var D=["INPUT","TEXTAREA","SELECT"],T=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],S=new WeakMap;function M(e){function t(e){var t=e.target;if(t&&t.tagName&&!(D.indexOf(t.tagName)<0)){var n=t.type,o=t.value,i=!1;"radio"!==n&&"checkbox"!==n||(i=t.checked),r(t,{text:o,isChecked:i});var a=t.name;"radio"===n&&a&&i&&document.querySelectorAll('input[type="radio"][name="'+a+'"]').forEach(function(e){e!==t&&r(e,{text:e.value,isChecked:!i})})}}function r(t,r){var o=S.get(t);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){S.set(t,r);var i=x.getId(t);e(n({},r,{id:i}))}}var o=["input","change"].map(function(e){return y(e,t)}),i=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");return i&&i.set&&o.push.apply(o,T.map(function(e){return function e(t,n,r){var o=Object.getOwnPropertyDescriptor(t,n);return Object.defineProperty(t,n,{set:function(e){var t=this;setTimeout(function(){r.set.call(t,e)},0),o&&o.set&&o.set.call(this,e)}}),function(){return e(t,n,o||{})}}(e[0],e[1],{set:function(){t({target:this})}})})),function(){o.forEach(function(e){return e()})}}function k(e){var t,n;return{mutationObserver:(t=e.mutationCb,(n=new MutationObserver(function(e){var n=[],r=[],o=[],i=[],a=[],s=new Set,u=function(e){s.add(e),e.childNodes.forEach(function(e){return u(e)})};e.forEach(function(e){var t=e.type,i=e.target,c=e.oldValue,l=e.addedNodes,d=e.removedNodes,p=e.attributeName;switch(t){case"characterData":(f=i.textContent)!==c&&n.push({value:f,node:i});break;case"attributes":var f;if((f=i.getAttribute(p))===c)return;var h=r.find(function(e){return e.node===i});h||(h={node:i,attributes:{}},r.push(h)),h.attributes[p]=f;case"childList":l.forEach(function(e){return u(e)}),d.forEach(function(e){s.has(e)?(s.delete(e),a.push(e)):s.has(i)&&!x.getId(e)||o.push({parentId:x.getId(i),id:x.getId(e)}),x.removeNodeFromMap(e)})}}),o=o.map(function(e){return e.parentNode&&(e.parentId=x.getId(e.parentNode),delete e.parentNode),e}),Array.from(s).forEach(function(e){var t=x.getId(e.parentNode);!t||a.some(function(t){return t===e.parentNode})||o.some(function(e){return e.id===t})?a.push(e):i.push({parentId:x.getId(e.parentNode),previousId:e.previousSibling?x.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?x.getId(e.nextSibling):e.nextSibling,node:c(e,document,x.map,!0)})}),t({texts:n.map(function(e){return{id:x.getId(e.node),value:e.value}}).filter(function(e){return x.has(e.id)}),attributes:r.map(function(e){return{id:x.getId(e.node),attributes:e.attributes}}).filter(function(e){return x.has(e.id)}),removes:o,adds:i})})).observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n),mousemoveHandler:function(e){var t,n=[],r=E(function(){var r=Date.now()-t;e(n.map(function(e){return e.timeOffset-=r,e})),n=[],t=null},500);return y("mousemove",E(function(e){var o=e.clientX,i=e.clientY,a=e.target;t||(t=Date.now()),n.push({x:o,y:i,id:x.getId(a),timeOffset:Date.now()-t}),r()},20,{trailing:!1}))}(e.mousemoveCb),mouseInteractionHandler:N(e.mouseInteractionCb),scrollHandler:function(e){return y("scroll",E(function(t){if(t.target){var n=x.getId(t.target);t.target===document?e({id:n,x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}):e({id:n,x:t.target.scrollLeft,y:t.target.scrollTop})}},100))}(e.scrollCb),viewportResizeHandler:function(e){return y("resize",E(function(){var t=I(),n=C();e({width:Number(n),height:Number(t)})},200),window)}(e.viewportResizeCb),inputHandler:M(e.inputCb)}}function O(e){return n({},e,{timestamp:Date.now()})}function A(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 L=Object.freeze({default:A});function F(){if(!(this instanceof F))return new F;this.size=0,this.uid=0,this.selectors=[],this.indexes=Object.create(this.indexes),this.activeIndexes=[]}var _=window.document.documentElement,z=_.matches||_.webkitMatchesSelector||_.mozMatchesSelector||_.oMatchesSelector||_.msMatchesSelector;F.prototype.matchesSelector=function(e,t){return z.call(e,t)},F.prototype.querySelectorAll=function(e,t){return t.querySelectorAll(e)},F.prototype.indexes=[];var P=/^#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;F.prototype.indexes.push({name:"ID",selector:function(e){var t;if(t=e.match(P))return t[0].slice(1)},element:function(e){if(e.id)return[e.id]}});var j=/^\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;F.prototype.indexes.push({name:"CLASS",selector:function(e){var t;if(t=e.match(j))return t[0].slice(1)},element:function(e){var t=e.className;if(t){if("string"==typeof t)return t.split(/\s/);if("object"==typeof t&&"baseVal"in t)return t.baseVal.split(/\s/)}}});var R,H=/^((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;F.prototype.indexes.push({name:"TAG",selector:function(e){var t;if(t=e.match(H))return t[0].toUpperCase()},element:function(e){return[e.nodeName.toUpperCase()]}}),F.prototype.indexes.default={name:"UNIVERSAL",selector:function(){return!0},element:function(){return[!0]}},R="function"==typeof window.Map?window.Map:function(){function e(){this.map={}}return e.prototype.get=function(e){return this.map[e+" "]},e.prototype.set=function(e,t){this.map[e+" "]=t},e}();var V=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g;function U(e,t){var n,r,o,i,a,s,u=(e=e.slice(0).concat(e.default)).length,c=t,l=[];do{if(V.exec(""),(o=V.exec(c))&&(c=o[3],o[2]||!c))for(n=0;n<u;n++)if(a=(s=e[n]).selector(o[1])){for(r=l.length,i=!1;r--;)if(l[r].index===s&&l[r].key===a){i=!0;break}i||l.push({index:s,key:a});break}}while(o);return l}function q(e,t){var n,r,o;for(n=0,r=e.length;n<r;n++)if(o=e[n],t.isPrototypeOf(o))return o}function W(e,t){return e.id-t.id}F.prototype.logDefaultIndexUsed=function(){},F.prototype.add=function(e,t){var n,r,o,i,a,s,u,c,l=this.activeIndexes,d=this.selectors;if("string"==typeof e){for(n={id:this.uid++,selector:e,data:t},u=U(this.indexes,e),r=0;r<u.length;r++)i=(c=u[r]).key,(a=q(l,o=c.index))||((a=Object.create(o)).map=new R,l.push(a)),o===this.indexes.default&&this.logDefaultIndexUsed(n),(s=a.map.get(i))||(s=[],a.map.set(i,s)),s.push(n);this.size++,d.push(e)}},F.prototype.remove=function(e,t){if("string"==typeof e){var n,r,o,i,a,s,u,c,l=this.activeIndexes,d={},p=1===arguments.length;for(n=U(this.indexes,e),o=0;o<n.length;o++)for(r=n[o],i=l.length;i--;)if(s=l[i],r.index.isPrototypeOf(s)){if(u=s.map.get(r.key))for(a=u.length;a--;)(c=u[a]).selector!==e||!p&&c.data!==t||(u.splice(a,1),d[c.id]=!0);break}this.size-=Object.keys(d).length}},F.prototype.queryAll=function(e){if(!this.selectors.length)return[];var t,n,r,o,i,a,s,u,c={},l=[],d=this.querySelectorAll(this.selectors.join(", "),e);for(t=0,r=d.length;t<r;t++)for(i=d[t],n=0,o=(a=this.matches(i)).length;n<o;n++)c[(u=a[n]).id]?s=c[u.id]:(s={id:u.id,selector:u.selector,data:u.data,elements:[]},c[u.id]=s,l.push(s)),s.elements.push(i);return l.sort(W)},F.prototype.matches=function(e){if(!e)return[];var t,n,r,o,i,a,s,u,c,l,d,p=this.activeIndexes,f={},h=[];for(t=0,o=p.length;t<o;t++)if(u=(s=p[t]).element(e))for(n=0,i=u.length;n<i;n++)if(c=s.map.get(u[n]))for(r=0,a=c.length;r<a;r++)!f[d=(l=c[r]).id]&&this.matchesSelector(e,l.selector)&&(f[d]=!0,h.push(l));return h.sort(W)};var B={},G={},X=new WeakMap,Y=new WeakMap,$=new WeakMap,J=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function K(e,t,n){var r=e[t];return e[t]=function(){return n.apply(e,arguments),r.apply(e,arguments)},e}function Q(){X.set(this,!0)}function Z(){X.set(this,!0),Y.set(this,!0)}function ee(){return $.get(this)||null}function te(e,t){J&&Object.defineProperty(e,"currentTarget",{configurable:!0,enumerable:!0,get:t||J.get})}function ne(e){var t=(1===e.eventPhase?G:B)[e.type];if(t){var n=function(e,t,n){var r=[],o=t;do{if(1!==o.nodeType)break;var i=e.matches(o);if(i.length){var a={node:o,observers:i};n?r.unshift(a):r.push(a)}}while(o=o.parentElement);return r}(t,e.target,1===e.eventPhase);if(n.length){K(e,"stopPropagation",Q),K(e,"stopImmediatePropagation",Z),te(e,ee);for(var r=0,o=n.length;r<o&&!X.get(e);r++){var i=n[r];$.set(e,i.node);for(var a=0,s=i.observers.length;a<s&&!Y.get(e);a++)i.observers[a].data.call(i.node,e)}$.delete(e),te(e)}}}function re(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=!!r.capture,i=r.document||document,a=o?G:B,s=a[e];s||(s=new F,a[e]=s,i.addEventListener(e,ne,o)),s.add(t,n)}function oe(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=!!r.capture,i=r.document||document,a=o?G:B,s=a[e];s&&(s.remove(t,n),s.size||(delete a[e],i.removeEventListener(e,ne,o)))}var ie=function(){function e(e,t){void 0===t&&(t=[]),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});var e=0,t=performance.now(),n=this.actions,r=this.config;requestAnimationFrame(function o(i){for(e=i-t;n.length;){var a=n[0],s=a.delay/r.speed;if(!(e>=s))break;n.shift(),a.doAction()}n.length>0&&requestAnimationFrame(o)})},e.prototype.clear=function(){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}(),ae=A||L,se={speed:1,root:document.body},ue=function(){function e(e,t){if(this.events=[],this.config=se,this.emitter=ae(),this.baselineTime=0,e.length<2)throw new Error("Replayer need at least 2 events.");this.events=e,this.handleResize=this.handleResize.bind(this),this.timer=new ie(this.config),this.setConfig(Object.assign({},t)),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]})},e.prototype.getMetaData=function(){var e=this.events[0];return{totalTime:this.events[this.events.length-1].timestamp-e.timestamp}},e.prototype.play=function(e){void 0===e&&(e=0),this.baselineTime=this.events[0].timestamp+e;for(var t=new Array,n=0,r=this.events;n<r.length;n++){var o=r[n],i=o.timestamp<this.baselineTime,a=this.getCastFn(o,i);i?a():t.push({doAction:a,delay:this.getDelay(o)})}this.timer.addActions(t),this.timer.start()},e.prototype.pause=function(){this.timer.clear()},e.prototype.resume=function(e){void 0===e&&(e=0),this.timer.clear();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.getDelay(o),a=this.getCastFn(o);t.push({doAction:a,delay:i-e})}}this.timer.addActions(t),this.timer.start()},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.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,r=e.timestamp+t-this.baselineTime;return e.data.positions=e.data.positions.map(function(e){return n({},e,{timeOffset:e.timeOffset-t+r})}),r}return e.timestamp-this.baselineTime},e.prototype.getCastFn=function(e,t){var n,r=this;switch(void 0===t&&(t=!1),e.type){case g.DomContentLoaded:case g.Load:break;case g.Meta:n=function(){return r.emitter.emit("resize",{width:e.data.width,height:e.data.height})};break;case g.FullSnapshot:n=function(){r.rebuildFullSnapshot(e),r.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case g.IncrementalSnapshot:n=function(){r.applyIncremental(e.data,t)}}return function(){n&&n(),r.lastPlayedEvent=e}},e.prototype.rebuildFullSnapshot=function(e){var t,n,r;x.map=(t=e.data.node,n=this.iframe.contentDocument,r={},[v(t,n,r),r])[1],oe("submit","form",this.preventDefault,{document:this.iframe.contentDocument}),re("submit","form",this.preventDefault,{document:this.iframe.contentDocument}),oe("click","a",this.preventDefault,{document:this.iframe.contentDocument}),re("click","a",this.preventDefault,{document:this.iframe.contentDocument})},e.prototype.preventDefault=function(e){e.preventDefault()},e.prototype.applyIncremental=function(e,t){var n=this;switch(e.source){case b.Mutation:e.removes.forEach(function(e){var t=x.getNode(e.id);if(t){var n=x.getNode(e.parentId);x.removeNodeFromMap(t),n&&n.removeChild(t)}});var r={};e.adds.forEach(function(e){var t=v(e.node,n.iframe.contentDocument,x.map,!0),o=x.getNode(e.parentId),i=null,a=null;e.previousId&&(i=x.getNode(e.previousId)),e.nextId&&(a=x.getNode(e.nextId)),-1!==e.previousId&&-1!==e.nextId?(i&&i.nextSibling&&i.nextSibling.parentNode?o.insertBefore(t,i.nextSibling):a&&a.parentNode?o.insertBefore(t,a):o.appendChild(t),(e.previousId||e.nextId)&&n.resolveMissingNode(r,o,t,e)):r[e.node.id]={node:t,mutation:e}}),Object.keys(r).length&&console.warn("Found unresolved missing node map",r),e.texts.forEach(function(e){x.getNode(e.id).textContent=e.value}),e.attributes.forEach(function(e){var t=x.getNode(e.id);for(var n in e.attributes)if("string"==typeof n){var r=e.attributes[n];r?t.setAttribute(n,r):t.removeAttribute(n)}});break;case b.MouseMove:t||e.positions.forEach(function(e){var t={doAction:function(){n.mouse.style.left=e.x+"px",n.mouse.style.top=e.y+"px";var t=x.getNode(e.id);t&&n.hoverElements(t)},delay:e.timeOffset};n.timer.addAction(t)});break;case b.MouseInteraction:if(-1===e.id)break;var o=new Event(w[e.type].toLowerCase());(i=x.getNode(e.id)).dispatchEvent(o),e.type===w.Blur?i.blur():e.type===w.Click?i.click():e.type===w.Focus&&i.focus();break;case b.Scroll:if(-1===e.id)break;(i=x.getNode(e.id))===this.iframe.contentDocument?this.iframe.contentWindow.scrollTo({top:e.y,left:e.x,behavior:t?"instant":"smooth"}):(i.scrollTop=e.y,i.scrollLeft=e.x);break;case b.ViewportResize:this.emitter.emit("resize",{width:e.width,height:e.height});break;case b.Input:if(-1===e.id)break;var i;(i=x.getNode(e.id)).checked=e.isChecked,i.value=e.text}},e.prototype.resolveMissingNode=function(e,t,n,r){var o=r.previousId,i=r.nextId,a=o&&e[o],s=i&&e[i];if(a||s){var u=a||s,c=u.node,l=u.mutation;a?t.insertBefore(c,n):t.insertBefore(c,n.nextSibling),delete e[l.node.id],(l.previousId||l.nextId)&&this.resolveMissingNode(e,t,c,l)}},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}();return e.record=function(e){void 0===e&&(e={});var t=e.emit;if(!t)throw new Error("emit function is required");try{y("DOMContentLoaded",function(){t(O({type:g.DomContentLoaded,data:{}}))});var r=function(){t(O({type:g.Meta,data:{href:window.location.href,width:C(),height:I()}}));var e=l(document),r=e[0],o=e[1];if(!r)return console.warn("Failed to snapshot the document");x.map=o,t(O({type:g.FullSnapshot,data:{node:r,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}})),k({mutationCb:function(e){return t(O({type:g.IncrementalSnapshot,data:n({source:b.Mutation},e)}))},mousemoveCb:function(e){return t(O({type:g.IncrementalSnapshot,data:{source:b.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return t(O({type:g.IncrementalSnapshot,data:n({source:b.MouseInteraction},e)}))},scrollCb:function(e){return t(O({type:g.IncrementalSnapshot,data:n({source:b.Scroll},e)}))},viewportResizeCb:function(e){return t(O({type:g.IncrementalSnapshot,data:n({source:b.ViewportResize},e)}))},inputCb:function(e){return t(O({type:g.IncrementalSnapshot,data:n({source:b.Input},e)}))}})};"interactive"===document.readyState||"complete"===document.readyState?r():y("load",function(){t(O({type:g.Load,data:{}})),r()},window)}catch(e){console.warn(e)}},e.Replayer=ue,e.mirror=x,e}({});
var rrweb=function(e){"use strict";var t,n=function(){return(n=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"}(t||(t={}));var r=1;var o=/url\((['"]|)([^'"]*)\1\)/gm,i=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/;function a(e,t){return e.replace(o,function(e,n,r){if(!i.test(r))return"url('"+r+"')";if("/"===r[0])return"url('"+(((o=t).indexOf("//")>-1?o.split("/").slice(0,3).join("/"):o.split("/")[0]).split("?")[0]+r)+"')";var o,a=t.split("/"),s=r.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 s(e,t){var n=e.createElement("a");return n.href=t,n.href}function u(e,n){switch(e.nodeType){case e.DOCUMENT_NODE:return{type:t.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:t.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId};case e.ELEMENT_NODE:for(var r=e.tagName.toLowerCase(),o={},i=0,u=Array.from(e.attributes);i<u.length;i++){var c=u[i],l=c.name,d=c.value;o[l]="src"===l||"href"===l?s(n,d):d}if("link"===r){var p=Array.from(n.styleSheets).find(function(t){return t.href===e.href}),f=function(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+t.cssText},""):null}catch(e){return null}}(p);f&&(o={_cssText:a(f,p.href)})}if("input"===r||"textarea"===r||"select"===r){d=e.value;"radio"!==o.type&&"checkbox"!==o.type&&d?o.value=d:e.checked&&(o.checked=e.checked)}if("option"===r){var h=e.parentElement;o.value===h.value&&(o.selected=e.selected)}return{type:t.Element,tagName:r,attributes:o,childNodes:[],isSVG:(g=e,"svg"===g.tagName||g instanceof SVGElement||void 0)};case e.TEXT_NODE:var m=e.parentNode&&e.parentNode.tagName,v=e.textContent,y="STYLE"===m||void 0;return y&&v&&(v=a(v,location.href)),"SCRIPT"===m&&(v="SCRIPT_PLACEHOLDER"),{type:t.Text,textContent:v||"",isStyle:y};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 g}function c(e,n,o,i){void 0===i&&(i=!1);var a=u(e,n);if(!a)return console.warn(e,"not serialized"),null;var s=Object.assign(a,{id:r++});if(e.__sn=s,o[s.id]=e,(s.type===t.Document||s.type===t.Element)&&!i)for(var l=0,d=Array.from(e.childNodes);l<d.length;l++){var p=c(d[l],n,o);p&&s.childNodes.push(p)}return s}function l(e){r=1;var t={};return[c(e,e,t),t]}var d={script:"noscript"};var p=/([^\r\n,{}]+)(,(?=[^}]*{)|\s*{)/g,f=/([^\\]):hover/g;function h(e){return e.replace(p,function(e,t,n){if(f.test(t)){var r=t.replace(f,"$1.\\:hover");return t.replace(/\s*$/,"")+", "+r.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 r=function(e){var t=d[e.tagName]?d[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e),o=void 0;for(var i in o=e.isSVG?n.createElementNS("http://www.w3.org/2000/svg",r):n.createElement(r),e.attributes)if(e.attributes.hasOwnProperty(i)){var a=e.attributes[i];a="boolean"==typeof a?"":a;var s="textarea"===r&&"value"===i,u="style"===r&&"_cssText"===i;if(u&&(a=h(a)),s||u){var c=n.createTextNode(a);o.appendChild(c)}try{o.setAttribute(i,a)}catch(e){}}return o;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,r,o){void 0===o&&(o=!1);var i=m(e,n);if(!i)return null;if(e.type===t.Document&&(n.open(),i=n),i.__sn=e,r[e.id]=i,(e.type===t.Document||e.type===t.Element)&&!o)for(var a=0,s=e.childNodes;a<s.length;a++){var u=s[a],c=v(u,n,r);c?i.appendChild(c):console.warn("Failed to rebuild",u)}return i}function y(e,t,n){return void 0===n&&(n=document),n.addEventListener(e,t,{capture:!0,passive:!0}),function(){return n.removeEventListener(e,t)}}var g,b,w,E={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return E.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete E.map[t],e.childNodes&&e.childNodes.forEach(function(e){return E.removeNodeFromMap(e)})},has:function(e){return E.map.hasOwnProperty(e)}};function x(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 I(){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 D(e){var t=[];return Object.keys(w).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(n){var r=n.toLowerCase(),o=function(t){return function(n){var r=E.getId(n.target),o=n.clientX,i=n.clientY;e({type:w[t],id:r,x:o,y:i})}}(n);t.push(y(r,o))}),function(){t.forEach(function(e){return e()})}}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta"}(g||(g={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input"}(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={}));var N=["INPUT","TEXTAREA","SELECT"],T=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],S=new WeakMap;function M(e){function t(e){var t=e.target;if(t&&t.tagName&&!(N.indexOf(t.tagName)<0)){var n=t.type,o=t.value,i=!1;"radio"!==n&&"checkbox"!==n||(i=t.checked),r(t,{text:o,isChecked:i});var a=t.name;"radio"===n&&a&&i&&document.querySelectorAll('input[type="radio"][name="'+a+'"]').forEach(function(e){e!==t&&r(e,{text:e.value,isChecked:!i})})}}function r(t,r){var o=S.get(t);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){S.set(t,r);var i=E.getId(t);e(n({},r,{id:i}))}}var o=["input","change"].map(function(e){return y(e,t)}),i=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");return i&&i.set&&o.push.apply(o,T.map(function(e){return function e(t,n,r){var o=Object.getOwnPropertyDescriptor(t,n);return Object.defineProperty(t,n,{set:function(e){var t=this;setTimeout(function(){r.set.call(t,e)},0),o&&o.set&&o.set.call(this,e)}}),function(){return e(t,n,o||{})}}(e[0],e[1],{set:function(){t({target:this})}})})),function(){o.forEach(function(e){return e()})}}function k(e){var t,n;return{mutationObserver:(t=e.mutationCb,(n=new MutationObserver(function(e){var n=[],r=[],o=[],i=[],a=[],s=new Set,u=function(e){s.add(e),e.childNodes.forEach(function(e){return u(e)})};e.forEach(function(e){var t=e.type,i=e.target,c=e.oldValue,l=e.addedNodes,d=e.removedNodes,p=e.attributeName;switch(t){case"characterData":(f=i.textContent)!==c&&n.push({value:f,node:i});break;case"attributes":var f;if((f=i.getAttribute(p))===c)return;var h=r.find(function(e){return e.node===i});h||(h={node:i,attributes:{}},r.push(h)),h.attributes[p]=f;case"childList":l.forEach(function(e){return u(e)}),d.forEach(function(e){s.has(e)?(s.delete(e),a.push(e)):s.has(i)&&!E.getId(e)||o.push({parentId:E.getId(i),id:E.getId(e)}),E.removeNodeFromMap(e)})}}),o=o.map(function(e){return e.parentNode&&(e.parentId=E.getId(e.parentNode),delete e.parentNode),e}),Array.from(s).forEach(function(e){var t=E.getId(e.parentNode);!t||a.some(function(t){return t===e.parentNode})||o.some(function(e){return e.id===t})?a.push(e):i.push({parentId:E.getId(e.parentNode),previousId:e.previousSibling?E.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?E.getId(e.nextSibling):e.nextSibling,node:c(e,document,E.map,!0)})}),t({texts:n.map(function(e){return{id:E.getId(e.node),value:e.value}}).filter(function(e){return E.has(e.id)}),attributes:r.map(function(e){return{id:E.getId(e.node),attributes:e.attributes}}).filter(function(e){return E.has(e.id)}),removes:o,adds:i})})).observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n),mousemoveHandler:function(e){var t,n=[],r=x(function(){var r=Date.now()-t;e(n.map(function(e){return e.timeOffset-=r,e})),n=[],t=null},500);return y("mousemove",x(function(e){var o=e.clientX,i=e.clientY,a=e.target;t||(t=Date.now()),n.push({x:o,y:i,id:E.getId(a),timeOffset:Date.now()-t}),r()},20,{trailing:!1}))}(e.mousemoveCb),mouseInteractionHandler:D(e.mouseInteractionCb),scrollHandler:function(e){return y("scroll",x(function(t){if(t.target){var n=E.getId(t.target);t.target===document?e({id:n,x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}):e({id:n,x:t.target.scrollLeft,y:t.target.scrollTop})}},100))}(e.scrollCb),viewportResizeHandler:function(e){return y("resize",x(function(){var t=I(),n=C();e({width:Number(n),height:Number(t)})},200),window)}(e.viewportResizeCb),inputHandler:M(e.inputCb)}}function O(e){return n({},e,{timestamp:Date.now()})}function A(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 L=Object.freeze({default:A});function F(){if(!(this instanceof F))return new F;this.size=0,this.uid=0,this.selectors=[],this.indexes=Object.create(this.indexes),this.activeIndexes=[]}var z=window.document.documentElement,_=z.matches||z.webkitMatchesSelector||z.mozMatchesSelector||z.oMatchesSelector||z.msMatchesSelector;F.prototype.matchesSelector=function(e,t){return _.call(e,t)},F.prototype.querySelectorAll=function(e,t){return t.querySelectorAll(e)},F.prototype.indexes=[];var P=/^#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;F.prototype.indexes.push({name:"ID",selector:function(e){var t;if(t=e.match(P))return t[0].slice(1)},element:function(e){if(e.id)return[e.id]}});var j=/^\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;F.prototype.indexes.push({name:"CLASS",selector:function(e){var t;if(t=e.match(j))return t[0].slice(1)},element:function(e){var t=e.className;if(t){if("string"==typeof t)return t.split(/\s/);if("object"==typeof t&&"baseVal"in t)return t.baseVal.split(/\s/)}}});var R,H=/^((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;F.prototype.indexes.push({name:"TAG",selector:function(e){var t;if(t=e.match(H))return t[0].toUpperCase()},element:function(e){return[e.nodeName.toUpperCase()]}}),F.prototype.indexes.default={name:"UNIVERSAL",selector:function(){return!0},element:function(){return[!0]}},R="function"==typeof window.Map?window.Map:function(){function e(){this.map={}}return e.prototype.get=function(e){return this.map[e+" "]},e.prototype.set=function(e,t){this.map[e+" "]=t},e}();var V=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g;function q(e,t){var n,r,o,i,a,s,u=(e=e.slice(0).concat(e.default)).length,c=t,l=[];do{if(V.exec(""),(o=V.exec(c))&&(c=o[3],o[2]||!c))for(n=0;n<u;n++)if(a=(s=e[n]).selector(o[1])){for(r=l.length,i=!1;r--;)if(l[r].index===s&&l[r].key===a){i=!0;break}i||l.push({index:s,key:a});break}}while(o);return l}function U(e,t){var n,r,o;for(n=0,r=e.length;n<r;n++)if(o=e[n],t.isPrototypeOf(o))return o}function W(e,t){return e.id-t.id}F.prototype.logDefaultIndexUsed=function(){},F.prototype.add=function(e,t){var n,r,o,i,a,s,u,c,l=this.activeIndexes,d=this.selectors;if("string"==typeof e){for(n={id:this.uid++,selector:e,data:t},u=q(this.indexes,e),r=0;r<u.length;r++)i=(c=u[r]).key,(a=U(l,o=c.index))||((a=Object.create(o)).map=new R,l.push(a)),o===this.indexes.default&&this.logDefaultIndexUsed(n),(s=a.map.get(i))||(s=[],a.map.set(i,s)),s.push(n);this.size++,d.push(e)}},F.prototype.remove=function(e,t){if("string"==typeof e){var n,r,o,i,a,s,u,c,l=this.activeIndexes,d={},p=1===arguments.length;for(n=q(this.indexes,e),o=0;o<n.length;o++)for(r=n[o],i=l.length;i--;)if(s=l[i],r.index.isPrototypeOf(s)){if(u=s.map.get(r.key))for(a=u.length;a--;)(c=u[a]).selector!==e||!p&&c.data!==t||(u.splice(a,1),d[c.id]=!0);break}this.size-=Object.keys(d).length}},F.prototype.queryAll=function(e){if(!this.selectors.length)return[];var t,n,r,o,i,a,s,u,c={},l=[],d=this.querySelectorAll(this.selectors.join(", "),e);for(t=0,r=d.length;t<r;t++)for(i=d[t],n=0,o=(a=this.matches(i)).length;n<o;n++)c[(u=a[n]).id]?s=c[u.id]:(s={id:u.id,selector:u.selector,data:u.data,elements:[]},c[u.id]=s,l.push(s)),s.elements.push(i);return l.sort(W)},F.prototype.matches=function(e){if(!e)return[];var t,n,r,o,i,a,s,u,c,l,d,p=this.activeIndexes,f={},h=[];for(t=0,o=p.length;t<o;t++)if(u=(s=p[t]).element(e))for(n=0,i=u.length;n<i;n++)if(c=s.map.get(u[n]))for(r=0,a=c.length;r<a;r++)!f[d=(l=c[r]).id]&&this.matchesSelector(e,l.selector)&&(f[d]=!0,h.push(l));return h.sort(W)};var B={},G={},X=new WeakMap,Y=new WeakMap,$=new WeakMap,Z=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function J(e,t,n){var r=e[t];return e[t]=function(){return n.apply(e,arguments),r.apply(e,arguments)},e}function K(){X.set(this,!0)}function Q(){X.set(this,!0),Y.set(this,!0)}function ee(){return $.get(this)||null}function te(e,t){Z&&Object.defineProperty(e,"currentTarget",{configurable:!0,enumerable:!0,get:t||Z.get})}function ne(e){var t=(1===e.eventPhase?G:B)[e.type];if(t){var n=function(e,t,n){var r=[],o=t;do{if(1!==o.nodeType)break;var i=e.matches(o);if(i.length){var a={node:o,observers:i};n?r.unshift(a):r.push(a)}}while(o=o.parentElement);return r}(t,e.target,1===e.eventPhase);if(n.length){J(e,"stopPropagation",K),J(e,"stopImmediatePropagation",Q),te(e,ee);for(var r=0,o=n.length;r<o&&!X.get(e);r++){var i=n[r];$.set(e,i.node);for(var a=0,s=i.observers.length;a<s&&!Y.get(e);a++)i.observers[a].data.call(i.node,e)}$.delete(e),te(e)}}}function re(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=!!r.capture,i=r.document||document,a=o?G:B,s=a[e];s||(s=new F,a[e]=s,i.addEventListener(e,ne,o)),s.add(t,n)}function oe(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=!!r.capture,i=r.document||document,a=o?G:B,s=a[e];s&&(s.remove(t,n),s.size||(delete a[e],i.removeEventListener(e,ne,o)))}var ie=function(){function e(e,t){void 0===t&&(t=[]),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});var e=0,t=performance.now(),n=this.actions,r=this.config;requestAnimationFrame(function o(i){for(e=i-t;n.length;){var a=n[0],s=a.delay/r.speed;if(!(e>=s))break;n.shift(),a.doAction()}n.length>0&&requestAnimationFrame(o)})},e.prototype.clear=function(){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}(),ae=A||L,se={speed:1,root:document.body,loadTimeout:1e4},ue=function(){function e(e,t){if(this.events=[],this.config=se,this.emitter=ae(),this.baselineTime=0,e.length<2)throw new Error("Replayer need at least 2 events.");this.events=e,this.handleResize=this.handleResize.bind(this),this.timer=new ie(this.config),this.setConfig(Object.assign({},t)),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]})},e.prototype.getMetaData=function(){var e=this.events[0];return{totalTime:this.events[this.events.length-1].timestamp-e.timestamp}},e.prototype.play=function(e){void 0===e&&(e=0),this.baselineTime=this.events[0].timestamp+e;for(var t=new Array,n=0,r=this.events;n<r.length;n++){var o=r[n],i=o.timestamp<this.baselineTime,a=this.getCastFn(o,i);i?a():t.push({doAction:a,delay:this.getDelay(o)})}this.timer.addActions(t),this.timer.start()},e.prototype.pause=function(){this.timer.clear()},e.prototype.resume=function(e){void 0===e&&(e=0),this.timer.clear();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.getDelay(o),a=this.getCastFn(o);t.push({doAction:a,delay:i-e})}}this.timer.addActions(t),this.timer.start()},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.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,r=e.timestamp+t-this.baselineTime;return e.data.positions=e.data.positions.map(function(e){return n({},e,{timeOffset:e.timeOffset-t+r})}),r}return e.timestamp-this.baselineTime},e.prototype.getCastFn=function(e,t){var n,r=this;switch(void 0===t&&(t=!1),e.type){case g.DomContentLoaded:case g.Load:break;case g.Meta:n=function(){return r.emitter.emit("resize",{width:e.data.width,height:e.data.height})};break;case g.FullSnapshot:n=function(){r.rebuildFullSnapshot(e),r.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case g.IncrementalSnapshot:n=function(){r.applyIncremental(e.data,t)}}return function(){n&&n(),r.lastPlayedEvent=e}},e.prototype.rebuildFullSnapshot=function(e){var t,n,r;E.map=(t=e.data.node,n=this.iframe.contentDocument,r={},[v(t,n,r),r])[1],this.waitForStylesheetLoad(),oe("submit","form",this.preventDefault,{document:this.iframe.contentDocument}),re("submit","form",this.preventDefault,{document:this.iframe.contentDocument}),oe("click","a",this.preventDefault,{document:this.iframe.contentDocument}),re("click","a",this.preventDefault,{document:this.iframe.contentDocument})},e.prototype.waitForStylesheetLoad=function(){var e=this,t=this.iframe.contentDocument.head;if(t){var n,r=new Set;t.querySelectorAll('link[rel="stylesheet"]').forEach(function(t){t.sheet||(0===r.size&&(e.pause(),e.emitter.emit("wait-stylesheet"),n=window.setTimeout(function(){e.resume(),n=-1},e.config.loadTimeout)),r.add(t),t.addEventListener("load",function(){r.delete(t),0===r.size&&-1!==n&&(e.resume(),e.emitter.emit("stylesheet-loaded"),n&&window.clearTimeout(n))}))})}},e.prototype.preventDefault=function(e){e.preventDefault()},e.prototype.applyIncremental=function(e,t){var n=this;switch(e.source){case b.Mutation:e.removes.forEach(function(e){var t=E.getNode(e.id);if(t){var n=E.getNode(e.parentId);E.removeNodeFromMap(t),n&&n.removeChild(t)}});var r={};e.adds.forEach(function(e){var t=v(e.node,n.iframe.contentDocument,E.map,!0),o=E.getNode(e.parentId),i=null,a=null;e.previousId&&(i=E.getNode(e.previousId)),e.nextId&&(a=E.getNode(e.nextId)),-1!==e.previousId&&-1!==e.nextId?(i&&i.nextSibling&&i.nextSibling.parentNode?o.insertBefore(t,i.nextSibling):a&&a.parentNode?o.insertBefore(t,a):o.appendChild(t),(e.previousId||e.nextId)&&n.resolveMissingNode(r,o,t,e)):r[e.node.id]={node:t,mutation:e}}),Object.keys(r).length&&console.warn("Found unresolved missing node map",r),e.texts.forEach(function(e){E.getNode(e.id).textContent=e.value}),e.attributes.forEach(function(e){var t=E.getNode(e.id);for(var n in e.attributes)if("string"==typeof n){var r=e.attributes[n];r?t.setAttribute(n,r):t.removeAttribute(n)}});break;case b.MouseMove:t||e.positions.forEach(function(e){var t={doAction:function(){n.mouse.style.left=e.x+"px",n.mouse.style.top=e.y+"px";var t=E.getNode(e.id);t&&n.hoverElements(t)},delay:e.timeOffset};n.timer.addAction(t)});break;case b.MouseInteraction:if(-1===e.id)break;var o=new Event(w[e.type].toLowerCase());(i=E.getNode(e.id)).dispatchEvent(o),e.type===w.Blur?i.blur():e.type===w.Click?i.click():e.type===w.Focus&&i.focus();break;case b.Scroll:if(-1===e.id)break;(i=E.getNode(e.id))===this.iframe.contentDocument?this.iframe.contentWindow.scrollTo({top:e.y,left:e.x,behavior:t?"instant":"smooth"}):(i.scrollTop=e.y,i.scrollLeft=e.x);break;case b.ViewportResize:this.emitter.emit("resize",{width:e.width,height:e.height});break;case b.Input:if(-1===e.id)break;var i;(i=E.getNode(e.id)).checked=e.isChecked,i.value=e.text}},e.prototype.resolveMissingNode=function(e,t,n,r){var o=r.previousId,i=r.nextId,a=o&&e[o],s=i&&e[i];if(a||s){var u=a||s,c=u.node,l=u.mutation;a?t.insertBefore(c,n):t.insertBefore(c,n.nextSibling),delete e[l.node.id],(l.previousId||l.nextId)&&this.resolveMissingNode(e,t,c,l)}},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}();return e.record=function(e){void 0===e&&(e={});var t=e.emit;if(!t)throw new Error("emit function is required");try{y("DOMContentLoaded",function(){t(O({type:g.DomContentLoaded,data:{}}))});var r=function(){t(O({type:g.Meta,data:{href:window.location.href,width:C(),height:I()}}));var e=l(document),r=e[0],o=e[1];if(!r)return console.warn("Failed to snapshot the document");E.map=o,t(O({type:g.FullSnapshot,data:{node:r,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}})),k({mutationCb:function(e){return t(O({type:g.IncrementalSnapshot,data:n({source:b.Mutation},e)}))},mousemoveCb:function(e){return t(O({type:g.IncrementalSnapshot,data:{source:b.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return t(O({type:g.IncrementalSnapshot,data:n({source:b.MouseInteraction},e)}))},scrollCb:function(e){return t(O({type:g.IncrementalSnapshot,data:n({source:b.Scroll},e)}))},viewportResizeCb:function(e){return t(O({type:g.IncrementalSnapshot,data:n({source:b.ViewportResize},e)}))},inputCb:function(e){return t(O({type:g.IncrementalSnapshot,data:n({source:b.Input},e)}))}})};"interactive"===document.readyState||"complete"===document.readyState?r():y("load",function(){t(O({type:g.Load,data:{}})),r()},window)}catch(e){console.warn(e)}},e.Replayer=ue,e.mirror=E,e}({});
//# sourceMappingURL=rrweb.min.js.map

@@ -70,5 +70,6 @@ /*! *****************************************************************************

var URL_IN_CSS_REF = /url\((['"]|)([^'"]*)\1\)/gm;
var RELATIVE_PATH = /^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/;
function absoluteToStylesheet(cssText, href) {
return cssText.replace(URL_IN_CSS_REF, function (_1, _2, filePath) {
if (!/^[./]/.test(filePath)) {
if (!RELATIVE_PATH.test(filePath)) {
return "url('" + filePath + "')";

@@ -97,7 +98,3 @@ }

}
var RELATIVE_PATH = /^(\.\.|\.|)\//;
function absoluteToDoc(doc, attributeValue) {
if (!RELATIVE_PATH.test(attributeValue)) {
return attributeValue;
}
var a = doc.createElement('a');

@@ -104,0 +101,0 @@ a.href = attributeValue;

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

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

@@ -70,5 +70,6 @@ /*! *****************************************************************************

var URL_IN_CSS_REF = /url\((['"]|)([^'"]*)\1\)/gm;
var RELATIVE_PATH = /^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/;
function absoluteToStylesheet(cssText, href) {
return cssText.replace(URL_IN_CSS_REF, function (_1, _2, filePath) {
if (!/^[./]/.test(filePath)) {
if (!RELATIVE_PATH.test(filePath)) {
return "url('" + filePath + "')";

@@ -97,7 +98,3 @@ }

}
var RELATIVE_PATH = /^(\.\.|\.|)\//;
function absoluteToDoc(doc, attributeValue) {
if (!RELATIVE_PATH.test(attributeValue)) {
return attributeValue;
}
var a = doc.createElement('a');

@@ -1491,3 +1488,4 @@ a.href = attributeValue;

speed: 1,
root: document.body
root: document.body,
loadTimeout: 10 * 1000
};

@@ -1633,2 +1631,3 @@ var Replayer = (function () {

mirror.map = rebuild(event.data.node, this.iframe.contentDocument)[1];
this.waitForStylesheetLoad();
off('submit', 'form', this.preventDefault, {

@@ -1647,2 +1646,35 @@ document: this.iframe.contentDocument

};
Replayer.prototype.waitForStylesheetLoad = function () {
var _this = this;
var head = this.iframe.contentDocument.head;
if (head) {
var unloadSheets_1 = new Set();
var timer_1;
head
.querySelectorAll('link[rel="stylesheet"]')
.forEach(function (css) {
if (!css.sheet) {
if (unloadSheets_1.size === 0) {
_this.pause();
_this.emitter.emit('wait-stylesheet');
timer_1 = window.setTimeout(function () {
_this.resume();
timer_1 = -1;
}, _this.config.loadTimeout);
}
unloadSheets_1.add(css);
css.addEventListener('load', function () {
unloadSheets_1["delete"](css);
if (unloadSheets_1.size === 0 && timer_1 !== -1) {
_this.resume();
_this.emitter.emit('stylesheet-loaded');
if (timer_1) {
window.clearTimeout(timer_1);
}
}
});
}
});
}
};
Replayer.prototype.preventDefault = function (evt) {

@@ -1649,0 +1681,0 @@ evt.preventDefault();

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

var NodeType,__assign=function(){return(__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(NodeType||(NodeType={}));var _id=1;function genId(){return _id++}function resetId(){_id=1}function getCssRulesString(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+t.cssText},""):null}catch(e){return null}}function extractOrigin(e){return(e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0]).split("?")[0]}var URL_IN_CSS_REF=/url\((['"]|)([^'"]*)\1\)/gm;function absoluteToStylesheet(e,t){return e.replace(URL_IN_CSS_REF,function(e,n,r){if(!/^[.\/]/.test(r))return"url('"+r+"')";if("/"===r[0])return"url('"+(extractOrigin(t)+r)+"')";var o=t.split("/"),i=r.split("/");o.pop();for(var a=0,s=i;a<s.length;a++){var c=s[a];"."!==c&&(".."===c?o.pop():o.push(c))}return"url('"+o.join("/")+"')"})}var RELATIVE_PATH=/^(\.\.|\.|)\//;function absoluteToDoc(e,t){if(!RELATIVE_PATH.test(t))return 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){switch(e.nodeType){case e.DOCUMENT_NODE:return{type:NodeType.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:NodeType.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId};case e.ELEMENT_NODE:for(var n=e.tagName.toLowerCase(),r={},o=0,i=Array.from(e.attributes);o<i.length;o++){var a=i[o],s=a.name,c=a.value;r[s]="src"===s||"href"===s?absoluteToDoc(t,c):c}if("link"===n){var u=Array.from(t.styleSheets).find(function(t){return t.href===e.href}),d=getCssRulesString(u);d&&(r={_cssText:absoluteToStylesheet(d,u.href)})}if("input"===n||"textarea"===n||"select"===n){c=e.value;"radio"!==r.type&&"checkbox"!==r.type&&c?r.value=c:e.checked&&(r.checked=e.checked)}if("option"===n){var l=e.parentElement;r.value===l.value&&(r.selected=e.selected)}return{type:NodeType.Element,tagName:n,attributes:r,childNodes:[],isSVG:isSVGElement(e)||void 0};case e.TEXT_NODE:var p=e.parentNode&&e.parentNode.tagName,m=e.textContent,f="STYLE"===p||void 0;return f&&m&&(m=absoluteToStylesheet(m,location.href)),"SCRIPT"===p&&(m="SCRIPT_PLACEHOLDER"),{type:NodeType.Text,textContent:m||"",isStyle:f};case e.CDATA_SECTION_NODE:return{type:NodeType.CDATA,textContent:""};case e.COMMENT_NODE:return{type:NodeType.Comment,textContent:e.textContent||""};default:return!1}}function serializeNodeWithId(e,t,n,r){void 0===r&&(r=!1);var o=serializeNode(e,t);if(!o)return console.warn(e,"not serialized"),null;var i=Object.assign(o,{id:genId()});if(e.__sn=i,n[i.id]=e,(i.type===NodeType.Document||i.type===NodeType.Element)&&!r)for(var a=0,s=Array.from(e.childNodes);a<s.length;a++){var c=serializeNodeWithId(s[a],t,n);c&&i.childNodes.push(c)}return i}function snapshot(e){resetId();var t={};return[serializeNodeWithId(e,e,t),t]}var tagMap={script:"noscript"};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)){var i=e.attributes[o];i="boolean"==typeof i?"":i;var a="textarea"===n&&"value"===o,s="style"===n&&"_cssText"===o;if(s&&(i=addHoverClass(i)),a||s){var c=t.createTextNode(i);r.appendChild(c)}try{r.setAttribute(o,i)}catch(e){}}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.open(),o=t),o.__sn=e,n[e.id]=o,(e.type===NodeType.Document||e.type===NodeType.Element)&&!r)for(var i=0,a=e.childNodes;i<a.length;i++){var s=a[i],c=buildNodeWithSN(s,t,n);c?o.appendChild(c):console.warn("Failed to rebuild",s)}return o}function rebuild(e,t){var n={};return[buildNodeWithSN(e,t,n),n]}function on(e,t,n){return void 0===n&&(n=document),n.addEventListener(e,t,{capture:!0,passive:!0}),function(){return n.removeEventListener(e,t)}}var EventType,IncrementalSource,MouseInteractions,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,c=arguments;a<=0||a>t?(r&&(window.clearTimeout(r),r=null),o=i,e.apply(s,c)):r||!1===n.trailing||(r=window.setTimeout(function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(s,c)},a))}}function hookSetter(e,t,n){var r=Object.getOwnPropertyDescriptor(e,t);return Object.defineProperty(e,t,{set:function(e){var t=this;setTimeout(function(){n.set.call(t,e)},0),r&&r.set&&r.set.call(this,e)}}),function(){return hookSetter(e,t,r||{})}}function getWindowHeight(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function getWindowWidth(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function initMutationObserver(e){var t=new MutationObserver(function(t){var n=[],r=[],o=[],i=[],a=[],s=new Set,c=function(e){s.add(e),e.childNodes.forEach(function(e){return c(e)})};t.forEach(function(e){var t=e.type,i=e.target,u=e.oldValue,d=e.addedNodes,l=e.removedNodes,p=e.attributeName;switch(t){case"characterData":(m=i.textContent)!==u&&n.push({value:m,node:i});break;case"attributes":var m;if((m=i.getAttribute(p))===u)return;var f=r.find(function(e){return e.node===i});f||(f={node:i,attributes:{}},r.push(f)),f.attributes[p]=m;case"childList":d.forEach(function(e){return c(e)}),l.forEach(function(e){s.has(e)?(s.delete(e),a.push(e)):s.has(i)&&!mirror.getId(e)||o.push({parentId:mirror.getId(i),id:mirror.getId(e)}),mirror.removeNodeFromMap(e)})}}),o=o.map(function(e){return e.parentNode&&(e.parentId=mirror.getId(e.parentNode),delete e.parentNode),e}),Array.from(s).forEach(function(e){var t=mirror.getId(e.parentNode);!t||a.some(function(t){return t===e.parentNode})||o.some(function(e){return e.id===t})?a.push(e):i.push({parentId:mirror.getId(e.parentNode),previousId:e.previousSibling?mirror.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?mirror.getId(e.nextSibling):e.nextSibling,node:serializeNodeWithId(e,document,mirror.map,!0)})}),e({texts:n.map(function(e){return{id:mirror.getId(e.node),value:e.value}}).filter(function(e){return mirror.has(e.id)}),attributes:r.map(function(e){return{id:mirror.getId(e.node),attributes:e.attributes}}).filter(function(e){return mirror.has(e.id)}),removes:o,adds:i})});return t.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),t}function initMousemoveObserver(e){var t,n=[],r=throttle(function(){var r=Date.now()-t;e(n.map(function(e){return e.timeOffset-=r,e})),n=[],t=null},500);return on("mousemove",throttle(function(e){var o=e.clientX,i=e.clientY,a=e.target;t||(t=Date.now()),n.push({x:o,y:i,id:mirror.getId(a),timeOffset:Date.now()-t}),r()},20,{trailing:!1}))}function initMouseInteractionObserver(e){var t=[];return Object.keys(MouseInteractions).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(n){var r=n.toLowerCase(),o=function(t){return function(n){var r=mirror.getId(n.target),o=n.clientX,i=n.clientY;e({type:MouseInteractions[t],id:r,x:o,y:i})}}(n);t.push(on(r,o))}),function(){t.forEach(function(e){return e()})}}function initScrollObserver(e){return on("scroll",throttle(function(t){if(t.target){var n=mirror.getId(t.target);t.target===document?e({id:n,x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}):e({id:n,x:t.target.scrollLeft,y:t.target.scrollTop})}},100))}function initViewportResizeObserver(e){return on("resize",throttle(function(){var t=getWindowHeight(),n=getWindowWidth();e({width:Number(n),height:Number(t)})},200),window)}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta"}(EventType||(EventType={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input"}(IncrementalSource||(IncrementalSource={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove=8]="TouchMove",e[e.TouchEnd=9]="TouchEnd"}(MouseInteractions||(MouseInteractions={}));var INPUT_TAGS=["INPUT","TEXTAREA","SELECT"],HOOK_PROPERTIES=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],lastInputValueMap=new WeakMap;function initInputObserver(e){function t(e){var t=e.target;if(t&&t.tagName&&!(INPUT_TAGS.indexOf(t.tagName)<0)){var r=t.type,o=t.value,i=!1;"radio"!==r&&"checkbox"!==r||(i=t.checked),n(t,{text:o,isChecked:i});var a=t.name;"radio"===r&&a&&i&&document.querySelectorAll('input[type="radio"][name="'+a+'"]').forEach(function(e){e!==t&&n(e,{text:e.value,isChecked:!i})})}}function n(t,n){var r=lastInputValueMap.get(t);if(!r||r.text!==n.text||r.isChecked!==n.isChecked){lastInputValueMap.set(t,n);var o=mirror.getId(t);e(__assign({},n,{id:o}))}}var r=["input","change"].map(function(e){return on(e,t)}),o=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");return o&&o.set&&r.push.apply(r,HOOK_PROPERTIES.map(function(e){return hookSetter(e[0],e[1],{set:function(){t({target:this})}})})),function(){r.forEach(function(e){return e()})}}function initObservers(e){return{mutationObserver:initMutationObserver(e.mutationCb),mousemoveHandler:initMousemoveObserver(e.mousemoveCb),mouseInteractionHandler:initMouseInteractionObserver(e.mouseInteractionCb),scrollHandler:initScrollObserver(e.scrollCb),viewportResizeHandler:initViewportResizeObserver(e.viewportResizeCb),inputHandler:initInputObserver(e.inputCb)}}function wrapEvent(e){return __assign({},e,{timestamp:Date.now()})}function record(e){void 0===e&&(e={});var t=e.emit;if(!t)throw new Error("emit function is required");try{on("DOMContentLoaded",function(){t(wrapEvent({type:EventType.DomContentLoaded,data:{}}))});var n=function(){t(wrapEvent({type:EventType.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}));var e=snapshot(document),n=e[0],r=e[1];if(!n)return console.warn("Failed to snapshot the document");mirror.map=r,t(wrapEvent({type:EventType.FullSnapshot,data:{node:n,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}})),initObservers({mutationCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Mutation},e)}))},mousemoveCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:{source:IncrementalSource.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.MouseInteraction},e)}))},scrollCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Scroll},e)}))},viewportResizeCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.ViewportResize},e)}))},inputCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Input},e)}))}})};"interactive"===document.readyState||"complete"===document.readyState?n():on("load",function(){t(wrapEvent({type:EventType.Load,data:{}})),n()},window)}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 SelectorSet(){if(!(this instanceof SelectorSet))return new SelectorSet;this.size=0,this.uid=0,this.selectors=[],this.indexes=Object.create(this.indexes),this.activeIndexes=[]}var docElem=window.document.documentElement,matches=docElem.matches||docElem.webkitMatchesSelector||docElem.mozMatchesSelector||docElem.oMatchesSelector||docElem.msMatchesSelector;SelectorSet.prototype.matchesSelector=function(e,t){return matches.call(e,t)},SelectorSet.prototype.querySelectorAll=function(e,t){return t.querySelectorAll(e)},SelectorSet.prototype.indexes=[];var idRe=/^#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;SelectorSet.prototype.indexes.push({name:"ID",selector:function(e){var t;if(t=e.match(idRe))return t[0].slice(1)},element:function(e){if(e.id)return[e.id]}});var classRe=/^\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;SelectorSet.prototype.indexes.push({name:"CLASS",selector:function(e){var t;if(t=e.match(classRe))return t[0].slice(1)},element:function(e){var t=e.className;if(t){if("string"==typeof t)return t.split(/\s/);if("object"==typeof t&&"baseVal"in t)return t.baseVal.split(/\s/)}}});var Map,tagRe=/^((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;SelectorSet.prototype.indexes.push({name:"TAG",selector:function(e){var t;if(t=e.match(tagRe))return t[0].toUpperCase()},element:function(e){return[e.nodeName.toUpperCase()]}}),SelectorSet.prototype.indexes.default={name:"UNIVERSAL",selector:function(){return!0},element:function(){return[!0]}},Map="function"==typeof window.Map?window.Map:function(){function e(){this.map={}}return e.prototype.get=function(e){return this.map[e+" "]},e.prototype.set=function(e,t){this.map[e+" "]=t},e}();var chunker=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g;function parseSelectorIndexes(e,t){var n,r,o,i,a,s,c=(e=e.slice(0).concat(e.default)).length,u=t,d=[];do{if(chunker.exec(""),(o=chunker.exec(u))&&(u=o[3],o[2]||!u))for(n=0;n<c;n++)if(a=(s=e[n]).selector(o[1])){for(r=d.length,i=!1;r--;)if(d[r].index===s&&d[r].key===a){i=!0;break}i||d.push({index:s,key:a});break}}while(o);return d}function findByPrototype(e,t){var n,r,o;for(n=0,r=e.length;n<r;n++)if(o=e[n],t.isPrototypeOf(o))return o}function sortById(e,t){return e.id-t.id}SelectorSet.prototype.logDefaultIndexUsed=function(){},SelectorSet.prototype.add=function(e,t){var n,r,o,i,a,s,c,u,d=this.activeIndexes,l=this.selectors;if("string"==typeof e){for(n={id:this.uid++,selector:e,data:t},c=parseSelectorIndexes(this.indexes,e),r=0;r<c.length;r++)i=(u=c[r]).key,(a=findByPrototype(d,o=u.index))||((a=Object.create(o)).map=new Map,d.push(a)),o===this.indexes.default&&this.logDefaultIndexUsed(n),(s=a.map.get(i))||(s=[],a.map.set(i,s)),s.push(n);this.size++,l.push(e)}},SelectorSet.prototype.remove=function(e,t){if("string"==typeof e){var n,r,o,i,a,s,c,u,d=this.activeIndexes,l={},p=1===arguments.length;for(n=parseSelectorIndexes(this.indexes,e),o=0;o<n.length;o++)for(r=n[o],i=d.length;i--;)if(s=d[i],r.index.isPrototypeOf(s)){if(c=s.map.get(r.key))for(a=c.length;a--;)(u=c[a]).selector!==e||!p&&u.data!==t||(c.splice(a,1),l[u.id]=!0);break}this.size-=Object.keys(l).length}},SelectorSet.prototype.queryAll=function(e){if(!this.selectors.length)return[];var t,n,r,o,i,a,s,c,u={},d=[],l=this.querySelectorAll(this.selectors.join(", "),e);for(t=0,r=l.length;t<r;t++)for(i=l[t],n=0,o=(a=this.matches(i)).length;n<o;n++)u[(c=a[n]).id]?s=u[c.id]:(s={id:c.id,selector:c.selector,data:c.data,elements:[]},u[c.id]=s,d.push(s)),s.elements.push(i);return d.sort(sortById)},SelectorSet.prototype.matches=function(e){if(!e)return[];var t,n,r,o,i,a,s,c,u,d,l,p=this.activeIndexes,m={},f=[];for(t=0,o=p.length;t<o;t++)if(c=(s=p[t]).element(e))for(n=0,i=c.length;n<i;n++)if(u=s.map.get(c[n]))for(r=0,a=u.length;r<a;r++)!m[l=(d=u[r]).id]&&this.matchesSelector(e,d.selector)&&(m[l]=!0,f.push(d));return f.sort(sortById)};var bubbleEvents={},captureEvents={},propagationStopped=new WeakMap,immediatePropagationStopped=new WeakMap,currentTargets=new WeakMap,currentTargetDesc=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function before(e,t,n){var r=e[t];return e[t]=function(){return n.apply(e,arguments),r.apply(e,arguments)},e}function matches$1(e,t,n){var r=[],o=t;do{if(1!==o.nodeType)break;var i=e.matches(o);if(i.length){var a={node:o,observers:i};n?r.unshift(a):r.push(a)}}while(o=o.parentElement);return r}function trackPropagation(){propagationStopped.set(this,!0)}function trackImmediate(){propagationStopped.set(this,!0),immediatePropagationStopped.set(this,!0)}function getCurrentTarget(){return currentTargets.get(this)||null}function defineCurrentTarget(e,t){currentTargetDesc&&Object.defineProperty(e,"currentTarget",{configurable:!0,enumerable:!0,get:t||currentTargetDesc.get})}function dispatch(e){var t=(1===e.eventPhase?captureEvents:bubbleEvents)[e.type];if(t){var n=matches$1(t,e.target,1===e.eventPhase);if(n.length){before(e,"stopPropagation",trackPropagation),before(e,"stopImmediatePropagation",trackImmediate),defineCurrentTarget(e,getCurrentTarget);for(var r=0,o=n.length;r<o&&!propagationStopped.get(e);r++){var i=n[r];currentTargets.set(e,i.node);for(var a=0,s=i.observers.length;a<s&&!immediatePropagationStopped.get(e);a++)i.observers[a].data.call(i.node,e)}currentTargets.delete(e),defineCurrentTarget(e)}}}function on$1(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=!!r.capture,i=r.document||document,a=o?captureEvents:bubbleEvents,s=a[e];s||(s=new SelectorSet,a[e]=s,i.addEventListener(e,dispatch,o)),s.add(t,n)}function off(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=!!r.capture,i=r.document||document,a=o?captureEvents:bubbleEvents,s=a[e];s&&(s.remove(t,n),s.size||(delete a[e],i.removeEventListener(e,dispatch,o)))}var Timer=function(){function e(e,t){void 0===t&&(t=[]),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});var e=0,t=performance.now(),n=this.actions,r=this.config;requestAnimationFrame(function o(i){for(e=i-t;n.length;){var a=n[0],s=a.delay/r.speed;if(!(e>=s))break;n.shift(),a.doAction()}n.length>0&&requestAnimationFrame(o)})},e.prototype.clear=function(){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}(),mitt$1=mitt||mittProxy,defaultConfig={speed:1,root:document.body},Replayer=function(){function e(e,t){if(this.events=[],this.config=defaultConfig,this.emitter=mitt$1(),this.baselineTime=0,e.length<2)throw new Error("Replayer need at least 2 events.");this.events=e,this.handleResize=this.handleResize.bind(this),this.timer=new Timer(this.config),this.setConfig(Object.assign({},t)),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]})},e.prototype.getMetaData=function(){var e=this.events[0];return{totalTime:this.events[this.events.length-1].timestamp-e.timestamp}},e.prototype.play=function(e){void 0===e&&(e=0),this.baselineTime=this.events[0].timestamp+e;for(var t=new Array,n=0,r=this.events;n<r.length;n++){var o=r[n],i=o.timestamp<this.baselineTime,a=this.getCastFn(o,i);i?a():t.push({doAction:a,delay:this.getDelay(o)})}this.timer.addActions(t),this.timer.start()},e.prototype.pause=function(){this.timer.clear()},e.prototype.resume=function(e){void 0===e&&(e=0),this.timer.clear();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.getDelay(o),a=this.getCastFn(o);t.push({doAction:a,delay:i-e})}}this.timer.addActions(t),this.timer.start()},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.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-this.baselineTime;return e.data.positions=e.data.positions.map(function(e){return __assign({},e,{timeOffset:e.timeOffset-t+n})}),n}return e.timestamp-this.baselineTime},e.prototype.getCastFn=function(e,t){var n,r=this;switch(void 0===t&&(t=!1),e.type){case EventType.DomContentLoaded:case EventType.Load:break;case EventType.Meta:n=function(){return r.emitter.emit("resize",{width:e.data.width,height:e.data.height})};break;case EventType.FullSnapshot:n=function(){r.rebuildFullSnapshot(e),r.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case EventType.IncrementalSnapshot:n=function(){r.applyIncremental(e.data,t)}}return function(){n&&n(),r.lastPlayedEvent=e}},e.prototype.rebuildFullSnapshot=function(e){mirror.map=rebuild(e.data.node,this.iframe.contentDocument)[1],off("submit","form",this.preventDefault,{document:this.iframe.contentDocument}),on$1("submit","form",this.preventDefault,{document:this.iframe.contentDocument}),off("click","a",this.preventDefault,{document:this.iframe.contentDocument}),on$1("click","a",this.preventDefault,{document:this.iframe.contentDocument})},e.prototype.preventDefault=function(e){e.preventDefault()},e.prototype.applyIncremental=function(e,t){var n=this;switch(e.source){case IncrementalSource.Mutation:e.removes.forEach(function(e){var t=mirror.getNode(e.id);if(t){var n=mirror.getNode(e.parentId);mirror.removeNodeFromMap(t),n&&n.removeChild(t)}});var r={};e.adds.forEach(function(e){var t=buildNodeWithSN(e.node,n.iframe.contentDocument,mirror.map,!0),o=mirror.getNode(e.parentId),i=null,a=null;e.previousId&&(i=mirror.getNode(e.previousId)),e.nextId&&(a=mirror.getNode(e.nextId)),-1!==e.previousId&&-1!==e.nextId?(i&&i.nextSibling&&i.nextSibling.parentNode?o.insertBefore(t,i.nextSibling):a&&a.parentNode?o.insertBefore(t,a):o.appendChild(t),(e.previousId||e.nextId)&&n.resolveMissingNode(r,o,t,e)):r[e.node.id]={node:t,mutation:e}}),Object.keys(r).length&&console.warn("Found unresolved missing node map",r),e.texts.forEach(function(e){mirror.getNode(e.id).textContent=e.value}),e.attributes.forEach(function(e){var t=mirror.getNode(e.id);for(var n in e.attributes)if("string"==typeof n){var r=e.attributes[n];r?t.setAttribute(n,r):t.removeAttribute(n)}});break;case IncrementalSource.MouseMove:t||e.positions.forEach(function(e){var t={doAction:function(){n.mouse.style.left=e.x+"px",n.mouse.style.top=e.y+"px";var t=mirror.getNode(e.id);t&&n.hoverElements(t)},delay:e.timeOffset};n.timer.addAction(t)});break;case IncrementalSource.MouseInteraction:if(-1===e.id)break;var o=new Event(MouseInteractions[e.type].toLowerCase());(i=mirror.getNode(e.id)).dispatchEvent(o),e.type===MouseInteractions.Blur?i.blur():e.type===MouseInteractions.Click?i.click():e.type===MouseInteractions.Focus&&i.focus();break;case IncrementalSource.Scroll:if(-1===e.id)break;(i=mirror.getNode(e.id))===this.iframe.contentDocument?this.iframe.contentWindow.scrollTo({top:e.y,left:e.x,behavior:t?"instant":"smooth"}):(i.scrollTop=e.y,i.scrollLeft=e.x);break;case IncrementalSource.ViewportResize:this.emitter.emit("resize",{width:e.width,height:e.height});break;case IncrementalSource.Input:if(-1===e.id)break;var i;(i=mirror.getNode(e.id)).checked=e.isChecked,i.value=e.text}},e.prototype.resolveMissingNode=function(e,t,n,r){var o=r.previousId,i=r.nextId,a=o&&e[o],s=i&&e[i];if(a||s){var c=a||s,u=c.node,d=c.mutation;a?t.insertBefore(u,n):t.insertBefore(u,n.nextSibling),delete e[d.node.id],(d.previousId||d.nextId)&&this.resolveMissingNode(e,t,u,d)}},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}();export{record,Replayer,mirror};
var NodeType,__assign=function(){return(__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(NodeType||(NodeType={}));var _id=1;function genId(){return _id++}function resetId(){_id=1}function getCssRulesString(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+t.cssText},""):null}catch(e){return null}}function extractOrigin(e){return(e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0]).split("?")[0]}var URL_IN_CSS_REF=/url\((['"]|)([^'"]*)\1\)/gm,RELATIVE_PATH=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/;function absoluteToStylesheet(e,t){return e.replace(URL_IN_CSS_REF,function(e,n,r){if(!RELATIVE_PATH.test(r))return"url('"+r+"')";if("/"===r[0])return"url('"+(extractOrigin(t)+r)+"')";var o=t.split("/"),i=r.split("/");o.pop();for(var a=0,s=i;a<s.length;a++){var c=s[a];"."!==c&&(".."===c?o.pop():o.push(c))}return"url('"+o.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){switch(e.nodeType){case e.DOCUMENT_NODE:return{type:NodeType.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:NodeType.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId};case e.ELEMENT_NODE:for(var n=e.tagName.toLowerCase(),r={},o=0,i=Array.from(e.attributes);o<i.length;o++){var a=i[o],s=a.name,c=a.value;r[s]="src"===s||"href"===s?absoluteToDoc(t,c):c}if("link"===n){var u=Array.from(t.styleSheets).find(function(t){return t.href===e.href}),d=getCssRulesString(u);d&&(r={_cssText:absoluteToStylesheet(d,u.href)})}if("input"===n||"textarea"===n||"select"===n){c=e.value;"radio"!==r.type&&"checkbox"!==r.type&&c?r.value=c:e.checked&&(r.checked=e.checked)}if("option"===n){var l=e.parentElement;r.value===l.value&&(r.selected=e.selected)}return{type:NodeType.Element,tagName:n,attributes:r,childNodes:[],isSVG:isSVGElement(e)||void 0};case e.TEXT_NODE:var p=e.parentNode&&e.parentNode.tagName,m=e.textContent,f="STYLE"===p||void 0;return f&&m&&(m=absoluteToStylesheet(m,location.href)),"SCRIPT"===p&&(m="SCRIPT_PLACEHOLDER"),{type:NodeType.Text,textContent:m||"",isStyle:f};case e.CDATA_SECTION_NODE:return{type:NodeType.CDATA,textContent:""};case e.COMMENT_NODE:return{type:NodeType.Comment,textContent:e.textContent||""};default:return!1}}function serializeNodeWithId(e,t,n,r){void 0===r&&(r=!1);var o=serializeNode(e,t);if(!o)return console.warn(e,"not serialized"),null;var i=Object.assign(o,{id:genId()});if(e.__sn=i,n[i.id]=e,(i.type===NodeType.Document||i.type===NodeType.Element)&&!r)for(var a=0,s=Array.from(e.childNodes);a<s.length;a++){var c=serializeNodeWithId(s[a],t,n);c&&i.childNodes.push(c)}return i}function snapshot(e){resetId();var t={};return[serializeNodeWithId(e,e,t),t]}var tagMap={script:"noscript"};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)){var i=e.attributes[o];i="boolean"==typeof i?"":i;var a="textarea"===n&&"value"===o,s="style"===n&&"_cssText"===o;if(s&&(i=addHoverClass(i)),a||s){var c=t.createTextNode(i);r.appendChild(c)}try{r.setAttribute(o,i)}catch(e){}}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.open(),o=t),o.__sn=e,n[e.id]=o,(e.type===NodeType.Document||e.type===NodeType.Element)&&!r)for(var i=0,a=e.childNodes;i<a.length;i++){var s=a[i],c=buildNodeWithSN(s,t,n);c?o.appendChild(c):console.warn("Failed to rebuild",s)}return o}function rebuild(e,t){var n={};return[buildNodeWithSN(e,t,n),n]}function on(e,t,n){return void 0===n&&(n=document),n.addEventListener(e,t,{capture:!0,passive:!0}),function(){return n.removeEventListener(e,t)}}var EventType,IncrementalSource,MouseInteractions,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,c=arguments;a<=0||a>t?(r&&(window.clearTimeout(r),r=null),o=i,e.apply(s,c)):r||!1===n.trailing||(r=window.setTimeout(function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(s,c)},a))}}function hookSetter(e,t,n){var r=Object.getOwnPropertyDescriptor(e,t);return Object.defineProperty(e,t,{set:function(e){var t=this;setTimeout(function(){n.set.call(t,e)},0),r&&r.set&&r.set.call(this,e)}}),function(){return hookSetter(e,t,r||{})}}function getWindowHeight(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function getWindowWidth(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function initMutationObserver(e){var t=new MutationObserver(function(t){var n=[],r=[],o=[],i=[],a=[],s=new Set,c=function(e){s.add(e),e.childNodes.forEach(function(e){return c(e)})};t.forEach(function(e){var t=e.type,i=e.target,u=e.oldValue,d=e.addedNodes,l=e.removedNodes,p=e.attributeName;switch(t){case"characterData":(m=i.textContent)!==u&&n.push({value:m,node:i});break;case"attributes":var m;if((m=i.getAttribute(p))===u)return;var f=r.find(function(e){return e.node===i});f||(f={node:i,attributes:{}},r.push(f)),f.attributes[p]=m;case"childList":d.forEach(function(e){return c(e)}),l.forEach(function(e){s.has(e)?(s.delete(e),a.push(e)):s.has(i)&&!mirror.getId(e)||o.push({parentId:mirror.getId(i),id:mirror.getId(e)}),mirror.removeNodeFromMap(e)})}}),o=o.map(function(e){return e.parentNode&&(e.parentId=mirror.getId(e.parentNode),delete e.parentNode),e}),Array.from(s).forEach(function(e){var t=mirror.getId(e.parentNode);!t||a.some(function(t){return t===e.parentNode})||o.some(function(e){return e.id===t})?a.push(e):i.push({parentId:mirror.getId(e.parentNode),previousId:e.previousSibling?mirror.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?mirror.getId(e.nextSibling):e.nextSibling,node:serializeNodeWithId(e,document,mirror.map,!0)})}),e({texts:n.map(function(e){return{id:mirror.getId(e.node),value:e.value}}).filter(function(e){return mirror.has(e.id)}),attributes:r.map(function(e){return{id:mirror.getId(e.node),attributes:e.attributes}}).filter(function(e){return mirror.has(e.id)}),removes:o,adds:i})});return t.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),t}function initMousemoveObserver(e){var t,n=[],r=throttle(function(){var r=Date.now()-t;e(n.map(function(e){return e.timeOffset-=r,e})),n=[],t=null},500);return on("mousemove",throttle(function(e){var o=e.clientX,i=e.clientY,a=e.target;t||(t=Date.now()),n.push({x:o,y:i,id:mirror.getId(a),timeOffset:Date.now()-t}),r()},20,{trailing:!1}))}function initMouseInteractionObserver(e){var t=[];return Object.keys(MouseInteractions).filter(function(e){return Number.isNaN(Number(e))}).forEach(function(n){var r=n.toLowerCase(),o=function(t){return function(n){var r=mirror.getId(n.target),o=n.clientX,i=n.clientY;e({type:MouseInteractions[t],id:r,x:o,y:i})}}(n);t.push(on(r,o))}),function(){t.forEach(function(e){return e()})}}function initScrollObserver(e){return on("scroll",throttle(function(t){if(t.target){var n=mirror.getId(t.target);t.target===document?e({id:n,x:document.documentElement.scrollLeft,y:document.documentElement.scrollTop}):e({id:n,x:t.target.scrollLeft,y:t.target.scrollTop})}},100))}function initViewportResizeObserver(e){return on("resize",throttle(function(){var t=getWindowHeight(),n=getWindowWidth();e({width:Number(n),height:Number(t)})},200),window)}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta"}(EventType||(EventType={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input"}(IncrementalSource||(IncrementalSource={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove=8]="TouchMove",e[e.TouchEnd=9]="TouchEnd"}(MouseInteractions||(MouseInteractions={}));var INPUT_TAGS=["INPUT","TEXTAREA","SELECT"],HOOK_PROPERTIES=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]],lastInputValueMap=new WeakMap;function initInputObserver(e){function t(e){var t=e.target;if(t&&t.tagName&&!(INPUT_TAGS.indexOf(t.tagName)<0)){var r=t.type,o=t.value,i=!1;"radio"!==r&&"checkbox"!==r||(i=t.checked),n(t,{text:o,isChecked:i});var a=t.name;"radio"===r&&a&&i&&document.querySelectorAll('input[type="radio"][name="'+a+'"]').forEach(function(e){e!==t&&n(e,{text:e.value,isChecked:!i})})}}function n(t,n){var r=lastInputValueMap.get(t);if(!r||r.text!==n.text||r.isChecked!==n.isChecked){lastInputValueMap.set(t,n);var o=mirror.getId(t);e(__assign({},n,{id:o}))}}var r=["input","change"].map(function(e){return on(e,t)}),o=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");return o&&o.set&&r.push.apply(r,HOOK_PROPERTIES.map(function(e){return hookSetter(e[0],e[1],{set:function(){t({target:this})}})})),function(){r.forEach(function(e){return e()})}}function initObservers(e){return{mutationObserver:initMutationObserver(e.mutationCb),mousemoveHandler:initMousemoveObserver(e.mousemoveCb),mouseInteractionHandler:initMouseInteractionObserver(e.mouseInteractionCb),scrollHandler:initScrollObserver(e.scrollCb),viewportResizeHandler:initViewportResizeObserver(e.viewportResizeCb),inputHandler:initInputObserver(e.inputCb)}}function wrapEvent(e){return __assign({},e,{timestamp:Date.now()})}function record(e){void 0===e&&(e={});var t=e.emit;if(!t)throw new Error("emit function is required");try{on("DOMContentLoaded",function(){t(wrapEvent({type:EventType.DomContentLoaded,data:{}}))});var n=function(){t(wrapEvent({type:EventType.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}));var e=snapshot(document),n=e[0],r=e[1];if(!n)return console.warn("Failed to snapshot the document");mirror.map=r,t(wrapEvent({type:EventType.FullSnapshot,data:{node:n,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}})),initObservers({mutationCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Mutation},e)}))},mousemoveCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:{source:IncrementalSource.MouseMove,positions:e}}))},mouseInteractionCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.MouseInteraction},e)}))},scrollCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Scroll},e)}))},viewportResizeCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.ViewportResize},e)}))},inputCb:function(e){return t(wrapEvent({type:EventType.IncrementalSnapshot,data:__assign({source:IncrementalSource.Input},e)}))}})};"interactive"===document.readyState||"complete"===document.readyState?n():on("load",function(){t(wrapEvent({type:EventType.Load,data:{}})),n()},window)}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 SelectorSet(){if(!(this instanceof SelectorSet))return new SelectorSet;this.size=0,this.uid=0,this.selectors=[],this.indexes=Object.create(this.indexes),this.activeIndexes=[]}var docElem=window.document.documentElement,matches=docElem.matches||docElem.webkitMatchesSelector||docElem.mozMatchesSelector||docElem.oMatchesSelector||docElem.msMatchesSelector;SelectorSet.prototype.matchesSelector=function(e,t){return matches.call(e,t)},SelectorSet.prototype.querySelectorAll=function(e,t){return t.querySelectorAll(e)},SelectorSet.prototype.indexes=[];var idRe=/^#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;SelectorSet.prototype.indexes.push({name:"ID",selector:function(e){var t;if(t=e.match(idRe))return t[0].slice(1)},element:function(e){if(e.id)return[e.id]}});var classRe=/^\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;SelectorSet.prototype.indexes.push({name:"CLASS",selector:function(e){var t;if(t=e.match(classRe))return t[0].slice(1)},element:function(e){var t=e.className;if(t){if("string"==typeof t)return t.split(/\s/);if("object"==typeof t&&"baseVal"in t)return t.baseVal.split(/\s/)}}});var Map,tagRe=/^((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;SelectorSet.prototype.indexes.push({name:"TAG",selector:function(e){var t;if(t=e.match(tagRe))return t[0].toUpperCase()},element:function(e){return[e.nodeName.toUpperCase()]}}),SelectorSet.prototype.indexes.default={name:"UNIVERSAL",selector:function(){return!0},element:function(){return[!0]}},Map="function"==typeof window.Map?window.Map:function(){function e(){this.map={}}return e.prototype.get=function(e){return this.map[e+" "]},e.prototype.set=function(e,t){this.map[e+" "]=t},e}();var chunker=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g;function parseSelectorIndexes(e,t){var n,r,o,i,a,s,c=(e=e.slice(0).concat(e.default)).length,u=t,d=[];do{if(chunker.exec(""),(o=chunker.exec(u))&&(u=o[3],o[2]||!u))for(n=0;n<c;n++)if(a=(s=e[n]).selector(o[1])){for(r=d.length,i=!1;r--;)if(d[r].index===s&&d[r].key===a){i=!0;break}i||d.push({index:s,key:a});break}}while(o);return d}function findByPrototype(e,t){var n,r,o;for(n=0,r=e.length;n<r;n++)if(o=e[n],t.isPrototypeOf(o))return o}function sortById(e,t){return e.id-t.id}SelectorSet.prototype.logDefaultIndexUsed=function(){},SelectorSet.prototype.add=function(e,t){var n,r,o,i,a,s,c,u,d=this.activeIndexes,l=this.selectors;if("string"==typeof e){for(n={id:this.uid++,selector:e,data:t},c=parseSelectorIndexes(this.indexes,e),r=0;r<c.length;r++)i=(u=c[r]).key,(a=findByPrototype(d,o=u.index))||((a=Object.create(o)).map=new Map,d.push(a)),o===this.indexes.default&&this.logDefaultIndexUsed(n),(s=a.map.get(i))||(s=[],a.map.set(i,s)),s.push(n);this.size++,l.push(e)}},SelectorSet.prototype.remove=function(e,t){if("string"==typeof e){var n,r,o,i,a,s,c,u,d=this.activeIndexes,l={},p=1===arguments.length;for(n=parseSelectorIndexes(this.indexes,e),o=0;o<n.length;o++)for(r=n[o],i=d.length;i--;)if(s=d[i],r.index.isPrototypeOf(s)){if(c=s.map.get(r.key))for(a=c.length;a--;)(u=c[a]).selector!==e||!p&&u.data!==t||(c.splice(a,1),l[u.id]=!0);break}this.size-=Object.keys(l).length}},SelectorSet.prototype.queryAll=function(e){if(!this.selectors.length)return[];var t,n,r,o,i,a,s,c,u={},d=[],l=this.querySelectorAll(this.selectors.join(", "),e);for(t=0,r=l.length;t<r;t++)for(i=l[t],n=0,o=(a=this.matches(i)).length;n<o;n++)u[(c=a[n]).id]?s=u[c.id]:(s={id:c.id,selector:c.selector,data:c.data,elements:[]},u[c.id]=s,d.push(s)),s.elements.push(i);return d.sort(sortById)},SelectorSet.prototype.matches=function(e){if(!e)return[];var t,n,r,o,i,a,s,c,u,d,l,p=this.activeIndexes,m={},f=[];for(t=0,o=p.length;t<o;t++)if(c=(s=p[t]).element(e))for(n=0,i=c.length;n<i;n++)if(u=s.map.get(c[n]))for(r=0,a=u.length;r<a;r++)!m[l=(d=u[r]).id]&&this.matchesSelector(e,d.selector)&&(m[l]=!0,f.push(d));return f.sort(sortById)};var bubbleEvents={},captureEvents={},propagationStopped=new WeakMap,immediatePropagationStopped=new WeakMap,currentTargets=new WeakMap,currentTargetDesc=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function before(e,t,n){var r=e[t];return e[t]=function(){return n.apply(e,arguments),r.apply(e,arguments)},e}function matches$1(e,t,n){var r=[],o=t;do{if(1!==o.nodeType)break;var i=e.matches(o);if(i.length){var a={node:o,observers:i};n?r.unshift(a):r.push(a)}}while(o=o.parentElement);return r}function trackPropagation(){propagationStopped.set(this,!0)}function trackImmediate(){propagationStopped.set(this,!0),immediatePropagationStopped.set(this,!0)}function getCurrentTarget(){return currentTargets.get(this)||null}function defineCurrentTarget(e,t){currentTargetDesc&&Object.defineProperty(e,"currentTarget",{configurable:!0,enumerable:!0,get:t||currentTargetDesc.get})}function dispatch(e){var t=(1===e.eventPhase?captureEvents:bubbleEvents)[e.type];if(t){var n=matches$1(t,e.target,1===e.eventPhase);if(n.length){before(e,"stopPropagation",trackPropagation),before(e,"stopImmediatePropagation",trackImmediate),defineCurrentTarget(e,getCurrentTarget);for(var r=0,o=n.length;r<o&&!propagationStopped.get(e);r++){var i=n[r];currentTargets.set(e,i.node);for(var a=0,s=i.observers.length;a<s&&!immediatePropagationStopped.get(e);a++)i.observers[a].data.call(i.node,e)}currentTargets.delete(e),defineCurrentTarget(e)}}}function on$1(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=!!r.capture,i=r.document||document,a=o?captureEvents:bubbleEvents,s=a[e];s||(s=new SelectorSet,a[e]=s,i.addEventListener(e,dispatch,o)),s.add(t,n)}function off(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=!!r.capture,i=r.document||document,a=o?captureEvents:bubbleEvents,s=a[e];s&&(s.remove(t,n),s.size||(delete a[e],i.removeEventListener(e,dispatch,o)))}var Timer=function(){function e(e,t){void 0===t&&(t=[]),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});var e=0,t=performance.now(),n=this.actions,r=this.config;requestAnimationFrame(function o(i){for(e=i-t;n.length;){var a=n[0],s=a.delay/r.speed;if(!(e>=s))break;n.shift(),a.doAction()}n.length>0&&requestAnimationFrame(o)})},e.prototype.clear=function(){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}(),mitt$1=mitt||mittProxy,defaultConfig={speed:1,root:document.body,loadTimeout:1e4},Replayer=function(){function e(e,t){if(this.events=[],this.config=defaultConfig,this.emitter=mitt$1(),this.baselineTime=0,e.length<2)throw new Error("Replayer need at least 2 events.");this.events=e,this.handleResize=this.handleResize.bind(this),this.timer=new Timer(this.config),this.setConfig(Object.assign({},t)),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]})},e.prototype.getMetaData=function(){var e=this.events[0];return{totalTime:this.events[this.events.length-1].timestamp-e.timestamp}},e.prototype.play=function(e){void 0===e&&(e=0),this.baselineTime=this.events[0].timestamp+e;for(var t=new Array,n=0,r=this.events;n<r.length;n++){var o=r[n],i=o.timestamp<this.baselineTime,a=this.getCastFn(o,i);i?a():t.push({doAction:a,delay:this.getDelay(o)})}this.timer.addActions(t),this.timer.start()},e.prototype.pause=function(){this.timer.clear()},e.prototype.resume=function(e){void 0===e&&(e=0),this.timer.clear();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.getDelay(o),a=this.getCastFn(o);t.push({doAction:a,delay:i-e})}}this.timer.addActions(t),this.timer.start()},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.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-this.baselineTime;return e.data.positions=e.data.positions.map(function(e){return __assign({},e,{timeOffset:e.timeOffset-t+n})}),n}return e.timestamp-this.baselineTime},e.prototype.getCastFn=function(e,t){var n,r=this;switch(void 0===t&&(t=!1),e.type){case EventType.DomContentLoaded:case EventType.Load:break;case EventType.Meta:n=function(){return r.emitter.emit("resize",{width:e.data.width,height:e.data.height})};break;case EventType.FullSnapshot:n=function(){r.rebuildFullSnapshot(e),r.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case EventType.IncrementalSnapshot:n=function(){r.applyIncremental(e.data,t)}}return function(){n&&n(),r.lastPlayedEvent=e}},e.prototype.rebuildFullSnapshot=function(e){mirror.map=rebuild(e.data.node,this.iframe.contentDocument)[1],this.waitForStylesheetLoad(),off("submit","form",this.preventDefault,{document:this.iframe.contentDocument}),on$1("submit","form",this.preventDefault,{document:this.iframe.contentDocument}),off("click","a",this.preventDefault,{document:this.iframe.contentDocument}),on$1("click","a",this.preventDefault,{document:this.iframe.contentDocument})},e.prototype.waitForStylesheetLoad=function(){var e=this,t=this.iframe.contentDocument.head;if(t){var n,r=new Set;t.querySelectorAll('link[rel="stylesheet"]').forEach(function(t){t.sheet||(0===r.size&&(e.pause(),e.emitter.emit("wait-stylesheet"),n=window.setTimeout(function(){e.resume(),n=-1},e.config.loadTimeout)),r.add(t),t.addEventListener("load",function(){r.delete(t),0===r.size&&-1!==n&&(e.resume(),e.emitter.emit("stylesheet-loaded"),n&&window.clearTimeout(n))}))})}},e.prototype.preventDefault=function(e){e.preventDefault()},e.prototype.applyIncremental=function(e,t){var n=this;switch(e.source){case IncrementalSource.Mutation:e.removes.forEach(function(e){var t=mirror.getNode(e.id);if(t){var n=mirror.getNode(e.parentId);mirror.removeNodeFromMap(t),n&&n.removeChild(t)}});var r={};e.adds.forEach(function(e){var t=buildNodeWithSN(e.node,n.iframe.contentDocument,mirror.map,!0),o=mirror.getNode(e.parentId),i=null,a=null;e.previousId&&(i=mirror.getNode(e.previousId)),e.nextId&&(a=mirror.getNode(e.nextId)),-1!==e.previousId&&-1!==e.nextId?(i&&i.nextSibling&&i.nextSibling.parentNode?o.insertBefore(t,i.nextSibling):a&&a.parentNode?o.insertBefore(t,a):o.appendChild(t),(e.previousId||e.nextId)&&n.resolveMissingNode(r,o,t,e)):r[e.node.id]={node:t,mutation:e}}),Object.keys(r).length&&console.warn("Found unresolved missing node map",r),e.texts.forEach(function(e){mirror.getNode(e.id).textContent=e.value}),e.attributes.forEach(function(e){var t=mirror.getNode(e.id);for(var n in e.attributes)if("string"==typeof n){var r=e.attributes[n];r?t.setAttribute(n,r):t.removeAttribute(n)}});break;case IncrementalSource.MouseMove:t||e.positions.forEach(function(e){var t={doAction:function(){n.mouse.style.left=e.x+"px",n.mouse.style.top=e.y+"px";var t=mirror.getNode(e.id);t&&n.hoverElements(t)},delay:e.timeOffset};n.timer.addAction(t)});break;case IncrementalSource.MouseInteraction:if(-1===e.id)break;var o=new Event(MouseInteractions[e.type].toLowerCase());(i=mirror.getNode(e.id)).dispatchEvent(o),e.type===MouseInteractions.Blur?i.blur():e.type===MouseInteractions.Click?i.click():e.type===MouseInteractions.Focus&&i.focus();break;case IncrementalSource.Scroll:if(-1===e.id)break;(i=mirror.getNode(e.id))===this.iframe.contentDocument?this.iframe.contentWindow.scrollTo({top:e.y,left:e.x,behavior:t?"instant":"smooth"}):(i.scrollTop=e.y,i.scrollLeft=e.x);break;case IncrementalSource.ViewportResize:this.emitter.emit("resize",{width:e.width,height:e.height});break;case IncrementalSource.Input:if(-1===e.id)break;var i;(i=mirror.getNode(e.id)).checked=e.isChecked,i.value=e.text}},e.prototype.resolveMissingNode=function(e,t,n,r){var o=r.previousId,i=r.nextId,a=o&&e[o],s=i&&e[i];if(a||s){var c=a||s,u=c.node,d=c.mutation;a?t.insertBefore(u,n):t.insertBefore(u,n.nextSibling),delete e[d.node.id],(d.previousId||d.nextId)&&this.resolveMissingNode(e,t,u,d)}},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}();export{record,Replayer,mirror};
//# sourceMappingURL=rrweb.min.js.map

@@ -72,5 +72,6 @@ 'use strict';

var URL_IN_CSS_REF = /url\((['"]|)([^'"]*)\1\)/gm;
var RELATIVE_PATH = /^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/;
function absoluteToStylesheet(cssText, href) {
return cssText.replace(URL_IN_CSS_REF, function (_1, _2, filePath) {
if (!/^[./]/.test(filePath)) {
if (!RELATIVE_PATH.test(filePath)) {
return "url('" + filePath + "')";

@@ -99,7 +100,3 @@ }

}
var RELATIVE_PATH = /^(\.\.|\.|)\//;
function absoluteToDoc(doc, attributeValue) {
if (!RELATIVE_PATH.test(attributeValue)) {
return attributeValue;
}
var a = doc.createElement('a');

@@ -106,0 +103,0 @@ a.href = attributeValue;

@@ -74,5 +74,6 @@ 'use strict';

var URL_IN_CSS_REF = /url\((['"]|)([^'"]*)\1\)/gm;
var RELATIVE_PATH = /^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/;
function absoluteToStylesheet(cssText, href) {
return cssText.replace(URL_IN_CSS_REF, function (_1, _2, filePath) {
if (!/^[./]/.test(filePath)) {
if (!RELATIVE_PATH.test(filePath)) {
return "url('" + filePath + "')";

@@ -101,7 +102,3 @@ }

}
var RELATIVE_PATH = /^(\.\.|\.|)\//;
function absoluteToDoc(doc, attributeValue) {
if (!RELATIVE_PATH.test(attributeValue)) {
return attributeValue;
}
var a = doc.createElement('a');

@@ -1495,3 +1492,4 @@ a.href = attributeValue;

speed: 1,
root: document.body
root: document.body,
loadTimeout: 10 * 1000
};

@@ -1637,2 +1635,3 @@ var Replayer = (function () {

mirror.map = rebuild(event.data.node, this.iframe.contentDocument)[1];
this.waitForStylesheetLoad();
off('submit', 'form', this.preventDefault, {

@@ -1651,2 +1650,35 @@ document: this.iframe.contentDocument

};
Replayer.prototype.waitForStylesheetLoad = function () {
var _this = this;
var head = this.iframe.contentDocument.head;
if (head) {
var unloadSheets_1 = new Set();
var timer_1;
head
.querySelectorAll('link[rel="stylesheet"]')
.forEach(function (css) {
if (!css.sheet) {
if (unloadSheets_1.size === 0) {
_this.pause();
_this.emitter.emit('wait-stylesheet');
timer_1 = window.setTimeout(function () {
_this.resume();
timer_1 = -1;
}, _this.config.loadTimeout);
}
unloadSheets_1.add(css);
css.addEventListener('load', function () {
unloadSheets_1["delete"](css);
if (unloadSheets_1.size === 0 && timer_1 !== -1) {
_this.resume();
_this.emitter.emit('stylesheet-loaded');
if (timer_1) {
window.clearTimeout(timer_1);
}
}
});
}
});
}
};
Replayer.prototype.preventDefault = function (evt) {

@@ -1653,0 +1685,0 @@ evt.preventDefault();

{
"name": "rrweb",
"version": "0.6.2",
"version": "0.6.3",
"description": "record and replay the web",

@@ -58,4 +58,4 @@ "scripts": {

"mitt": "^1.1.3",
"rrweb-snapshot": "^0.6.4"
"rrweb-snapshot": "^0.6.6"
}
}

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

root: Element;
loadTimeout: number;
};

@@ -231,0 +232,0 @@

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc