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

rrweb-snapshot

Package Overview
Dependencies
Maintainers
1
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rrweb-snapshot - npm Package Compare versions

Comparing version 1.1.4 to 1.1.5

35

dist/rrweb-snapshot.js

@@ -282,3 +282,3 @@ var rrwebSnapshot = (function (exports) {

function serializeNode(n, options) {
var doc = options.doc, blockClass = options.blockClass, blockSelector = options.blockSelector, maskTextClass = options.maskTextClass, maskTextSelector = options.maskTextSelector, inlineStylesheet = options.inlineStylesheet, _a = options.maskInputOptions, maskInputOptions = _a === void 0 ? {} : _a, maskTextFn = options.maskTextFn, recordCanvas = options.recordCanvas;
var doc = options.doc, blockClass = options.blockClass, blockSelector = options.blockSelector, maskTextClass = options.maskTextClass, maskTextSelector = options.maskTextSelector, inlineStylesheet = options.inlineStylesheet, _a = options.maskInputOptions, maskInputOptions = _a === void 0 ? {} : _a, maskTextFn = options.maskTextFn, recordCanvas = options.recordCanvas, keepIframeSrcFn = options.keepIframeSrcFn;
var rootId;

@@ -365,2 +365,3 @@ if (doc.__sn) {

: 'played';
attributes_1.rr_mediaCurrentTime = n.currentTime;
}

@@ -381,3 +382,3 @@ if (n.scrollLeft) {

}
if (tagName === 'iframe') {
if (tagName === 'iframe' && !keepIframeSrcFn(attributes_1.src)) {
delete attributes_1.src;

@@ -511,4 +512,4 @@ }

function serializeNodeWithId(n, options) {
var doc = options.doc, map = options.map, blockClass = options.blockClass, blockSelector = options.blockSelector, maskTextClass = options.maskTextClass, maskTextSelector = options.maskTextSelector, _a = options.skipChild, skipChild = _a === void 0 ? false : _a, _b = options.inlineStylesheet, inlineStylesheet = _b === void 0 ? true : _b, _c = options.maskInputOptions, maskInputOptions = _c === void 0 ? {} : _c, maskTextFn = options.maskTextFn, slimDOMOptions = options.slimDOMOptions, _d = options.recordCanvas, recordCanvas = _d === void 0 ? false : _d, onSerialize = options.onSerialize, onIframeLoad = options.onIframeLoad, _e = options.iframeLoadTimeout, iframeLoadTimeout = _e === void 0 ? 5000 : _e;
var _f = options.preserveWhiteSpace, preserveWhiteSpace = _f === void 0 ? true : _f;
var doc = options.doc, map = options.map, blockClass = options.blockClass, blockSelector = options.blockSelector, maskTextClass = options.maskTextClass, maskTextSelector = options.maskTextSelector, _a = options.skipChild, skipChild = _a === void 0 ? false : _a, _b = options.inlineStylesheet, inlineStylesheet = _b === void 0 ? true : _b, _c = options.maskInputOptions, maskInputOptions = _c === void 0 ? {} : _c, maskTextFn = options.maskTextFn, slimDOMOptions = options.slimDOMOptions, _d = options.recordCanvas, recordCanvas = _d === void 0 ? false : _d, onSerialize = options.onSerialize, onIframeLoad = options.onIframeLoad, _e = options.iframeLoadTimeout, iframeLoadTimeout = _e === void 0 ? 5000 : _e, _f = options.keepIframeSrcFn, keepIframeSrcFn = _f === void 0 ? function () { return false; } : _f;
var _g = options.preserveWhiteSpace, preserveWhiteSpace = _g === void 0 ? true : _g;
var _serializedNode = serializeNode(n, {

@@ -524,2 +525,3 @@ doc: doc,

recordCanvas: recordCanvas,
keepIframeSrcFn: keepIframeSrcFn,
});

@@ -583,5 +585,6 @@ if (!_serializedNode) {

iframeLoadTimeout: iframeLoadTimeout,
keepIframeSrcFn: keepIframeSrcFn,
};
for (var _i = 0, _g = Array.from(n.childNodes); _i < _g.length; _i++) {
var childN = _g[_i];
for (var _i = 0, _h = Array.from(n.childNodes); _i < _h.length; _i++) {
var childN = _h[_i];
var serializedChildNode = serializeNodeWithId(childN, bypassOptions);

@@ -594,4 +597,4 @@ if (serializedChildNode) {

serializedNode.isShadowHost = true;
for (var _h = 0, _j = Array.from(n.shadowRoot.childNodes); _h < _j.length; _h++) {
var childN = _j[_h];
for (var _j = 0, _k = Array.from(n.shadowRoot.childNodes); _j < _k.length; _j++) {
var childN = _k[_j];
var serializedChildNode = serializeNodeWithId(childN, bypassOptions);

@@ -630,2 +633,3 @@ if (serializedChildNode) {

iframeLoadTimeout: iframeLoadTimeout,
keepIframeSrcFn: keepIframeSrcFn,
});

@@ -641,3 +645,3 @@ if (serializedIframeNode) {

function snapshot(n, options) {
var _a = options || {}, _b = _a.blockClass, blockClass = _b === void 0 ? 'rr-block' : _b, _c = _a.blockSelector, blockSelector = _c === void 0 ? null : _c, _d = _a.maskTextClass, maskTextClass = _d === void 0 ? 'rr-mask' : _d, _e = _a.maskTextSelector, maskTextSelector = _e === void 0 ? null : _e, _f = _a.inlineStylesheet, inlineStylesheet = _f === void 0 ? true : _f, _g = _a.recordCanvas, recordCanvas = _g === void 0 ? false : _g, _h = _a.maskAllInputs, maskAllInputs = _h === void 0 ? false : _h, maskTextFn = _a.maskTextFn, _j = _a.slimDOM, slimDOM = _j === void 0 ? false : _j, preserveWhiteSpace = _a.preserveWhiteSpace, onSerialize = _a.onSerialize, onIframeLoad = _a.onIframeLoad, iframeLoadTimeout = _a.iframeLoadTimeout;
var _a = options || {}, _b = _a.blockClass, blockClass = _b === void 0 ? 'rr-block' : _b, _c = _a.blockSelector, blockSelector = _c === void 0 ? null : _c, _d = _a.maskTextClass, maskTextClass = _d === void 0 ? 'rr-mask' : _d, _e = _a.maskTextSelector, maskTextSelector = _e === void 0 ? null : _e, _f = _a.inlineStylesheet, inlineStylesheet = _f === void 0 ? true : _f, _g = _a.recordCanvas, recordCanvas = _g === void 0 ? false : _g, _h = _a.maskAllInputs, maskAllInputs = _h === void 0 ? false : _h, maskTextFn = _a.maskTextFn, _j = _a.slimDOM, slimDOM = _j === void 0 ? false : _j, preserveWhiteSpace = _a.preserveWhiteSpace, onSerialize = _a.onSerialize, onIframeLoad = _a.onIframeLoad, iframeLoadTimeout = _a.iframeLoadTimeout, _k = _a.keepIframeSrcFn, keepIframeSrcFn = _k === void 0 ? function () { return false; } : _k;
var idNodeMap = {};

@@ -703,2 +707,3 @@ var maskInputOptions = maskAllInputs === true

iframeLoadTimeout: iframeLoadTimeout,
keepIframeSrcFn: keepIframeSrcFn,
}),

@@ -1284,5 +1289,2 @@ idNodeMap,

}
if (tagName === 'iframe' && name === 'src') {
return "continue";
}
try {

@@ -1327,6 +1329,13 @@ if (n.isSVG && name === 'xlink:href') {

}
if (name === 'rr_mediaCurrentTime') {
node_1.currentTime = n.attributes
.rr_mediaCurrentTime;
}
if (name === 'rr_mediaState') {
switch (value) {
case 'played':
node_1.play();
node_1
.play()
.catch(function (e) { return console.warn('media playback error', e); });
break;
case 'paused':

@@ -1333,0 +1342,0 @@ node_1.pause();

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

var rrwebSnapshot=function(e){"use strict";var t;function r(e){return e.nodeType===e.ELEMENT_NODE}function n(e){var t,r=null===(t=e)||void 0===t?void 0:t.host;return Boolean(r&&r.shadowRoot&&r.shadowRoot===e)}(t=e.NodeType||(e.NodeType={}))[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment";var a=1,o=RegExp("[^a-z0-9-_:]"),i=-2;function s(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(c).join(""):null}catch(e){return null}}function c(e){return function(e){return"styleSheet"in e}(e)?s(e.styleSheet)||"":e.cssText}var u=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,l=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,f=/^(data:)([^,]*),(.*)/i;function p(e,t){return(e||"").replace(u,function(e,r,n,a,o,i){var s,c=n||o||i,u=r||a||"";if(!c)return e;if(!l.test(c))return"url("+u+c+u+")";if(f.test(c))return"url("+u+c+u+")";if("/"===c[0])return"url("+u+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+c)+u+")";var p=t.split("/"),d=c.split("/");p.pop();for(var m=0,h=d;m<h.length;m++){var v=h[m];"."!==v&&(".."===v?p.pop():p.push(v))}return"url("+u+p.join("/")+u+")"})}var d=/^[^ \t\n\r\u000c]+/,m=/^[, \t\n\r\u000c]+/;function h(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function v(){var e=document.createElement("a");return e.href="",e.href}function y(e,t,r,n){return"src"===r||("href"===r||"xlink:href"===r)&&n?h(e,n):"background"!==r||!n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r&&n?function(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,a=e.exec(t.substring(r));return a?(n=a[0],r+=n.length,n):""}for(var a=[];n(m),!(r>=t.length);){var o=n(d);if(","===o.slice(-1))o=h(e,o.substring(0,o.length-1)),a.push(o);else{var i="";o=h(e,o);for(var s=!1;;){var c=t.charAt(r);if(""===c){a.push((o+i).trim());break}if(s)")"===c&&(s=!1);else{if(","===c){r+=1,a.push((o+i).trim());break}"("===c&&(s=!0)}i+=c,r+=1}}}return a.join(", ")}(e,n):"style"===r&&n?p(n,v()):n:h(e,n)}function g(e,t,r){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if("string"==typeof t){if(e.classList.contains(t))return!0}else e.classList.forEach(function(e){if(t.test(e))return!0});return!(!r||!e.matches(r))||g(e.parentNode,t,r)}return e.nodeType,e.TEXT_NODE,g(e.parentNode,t,r)}function T(t,r){var n,a,i=r.doc,c=r.blockClass,u=r.blockSelector,l=r.maskTextClass,f=r.maskTextSelector,d=r.inlineStylesheet,m=r.maskInputOptions,h=void 0===m?{}:m,T=r.maskTextFn,b=r.recordCanvas;if(i.__sn){var k=i.__sn.id;n=1===k?void 0:k}switch(t.nodeType){case t.DOCUMENT_NODE:return{type:e.NodeType.Document,childNodes:[],rootId:n};case t.DOCUMENT_TYPE_NODE:return{type:e.NodeType.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:n};case t.ELEMENT_NODE:for(var N=function(e,t,r){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=0;n<e.classList.length;n++){var a=e.classList[n];if(t.test(a))return!0}return!!r&&e.matches(r)}(t,c,u),C=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return o.test(t)?"div":t}(t),x={},E=0,S=Array.from(t.attributes);E<S.length;E++){var w=S[E],_=w.name,D=w.value;x[_]=y(i,C,_,D)}if("link"===C&&d){var A,O=Array.from(i.styleSheets).find(function(e){return e.href===t.href});(A=s(O))&&(delete x.rel,delete x.href,x._cssText=p(A,O.href))}if("style"===C&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(A=s(t.sheet))&&(x._cssText=p(A,v()));if("input"===C||"textarea"===C||"select"===C){D=t.value;"radio"!==x.type&&"checkbox"!==x.type&&"submit"!==x.type&&"button"!==x.type&&D?x.value=h[x.type]||h[C]?"*".repeat(D.length):D:t.checked&&(x.checked=t.checked)}if("option"===C){var L=t.parentElement;x.value===L.value&&(x.selected=t.selected)}if("canvas"===C&&b&&(x.rr_dataURL=t.toDataURL()),"audio"!==C&&"video"!==C||(x.rr_mediaState=t.paused?"paused":"played"),t.scrollLeft&&(x.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(x.rr_scrollTop=t.scrollTop),N){var I=t.getBoundingClientRect(),M=I.width,R=I.height;x={class:x.class,rr_width:M+"px",rr_height:R+"px"}}return"iframe"===C&&delete x.src,{type:e.NodeType.Element,tagName:C,attributes:x,childNodes:[],isSVG:(a=t,"svg"===a.tagName||a instanceof SVGElement||void 0),needBlock:N,rootId:n};case t.TEXT_NODE:var F=t.parentNode&&t.parentNode.tagName,G=t.textContent,W="STYLE"===F||void 0,j="SCRIPT"===F||void 0;return W&&G&&(G=p(G,v())),j&&(G="SCRIPT_PLACEHOLDER"),!W&&!j&&g(t,l,f)&&G&&(G=T?T(G):G.replace(/[\S]/g,"*")),{type:e.NodeType.Text,textContent:G||"",isStyle:W,rootId:n};case t.CDATA_SECTION_NODE:return{type:e.NodeType.CDATA,textContent:"",rootId:n};case t.COMMENT_NODE:return{type:e.NodeType.Comment,textContent:t.textContent||"",rootId:n};default:return!1}}function b(e){return void 0===e?"":e.toLowerCase()}function k(t,o){var s,c=o.doc,u=o.map,l=o.blockClass,f=o.blockSelector,p=o.maskTextClass,d=o.maskTextSelector,m=o.skipChild,h=void 0!==m&&m,v=o.inlineStylesheet,y=void 0===v||v,g=o.maskInputOptions,N=void 0===g?{}:g,C=o.maskTextFn,x=o.slimDOMOptions,E=o.recordCanvas,S=void 0!==E&&E,w=o.onSerialize,_=o.onIframeLoad,D=o.iframeLoadTimeout,A=void 0===D?5e3:D,O=o.preserveWhiteSpace,L=void 0===O||O,I=T(t,{doc:c,blockClass:l,blockSelector:f,maskTextClass:p,maskTextSelector:d,inlineStylesheet:y,maskInputOptions:N,maskTextFn:C,recordCanvas:S});if(!I)return console.warn(t,"not serialized"),null;s="__sn"in t?t.__sn.id:!function(t,r){if(r.comment&&t.type===e.NodeType.Comment)return!0;if(t.type===e.NodeType.Element){if(r.script&&("script"===t.tagName||"link"===t.tagName&&"preload"===t.attributes.rel&&"script"===t.attributes.as))return!0;if(r.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(b(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===b(t.attributes.name)||"icon"===b(t.attributes.rel)||"apple-touch-icon"===b(t.attributes.rel)||"shortcut icon"===b(t.attributes.rel))))return!0;if("meta"===t.tagName){if(r.headMetaDescKeywords&&b(t.attributes.name).match(/^description|keywords$/))return!0;if(r.headMetaSocial&&(b(t.attributes.property).match(/^(og|twitter|fb):/)||b(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===b(t.attributes.name)))return!0;if(r.headMetaRobots&&("robots"===b(t.attributes.name)||"googlebot"===b(t.attributes.name)||"bingbot"===b(t.attributes.name)))return!0;if(r.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(r.headMetaAuthorship&&("author"===b(t.attributes.name)||"generator"===b(t.attributes.name)||"framework"===b(t.attributes.name)||"publisher"===b(t.attributes.name)||"progid"===b(t.attributes.name)||b(t.attributes.property).match(/^article:/)||b(t.attributes.property).match(/^product:/)))return!0;if(r.headMetaVerification&&("google-site-verification"===b(t.attributes.name)||"yandex-verification"===b(t.attributes.name)||"csrf-token"===b(t.attributes.name)||"p:domain_verify"===b(t.attributes.name)||"verify-v1"===b(t.attributes.name)||"verification"===b(t.attributes.name)||"shopify-checkout-api-token"===b(t.attributes.name)))return!0}}return!1}(I,x)&&(L||I.type!==e.NodeType.Text||I.isStyle||I.textContent.replace(/^\s+|\s+$/gm,"").length)?a++:i;var M=Object.assign(I,{id:s});if(t.__sn=M,s===i)return null;u[s]=t,w&&w(t);var R=!h;if(M.type===e.NodeType.Element&&(R=R&&!M.needBlock,delete M.needBlock),(M.type===e.NodeType.Document||M.type===e.NodeType.Element)&&R){x.headWhitespace&&I.type===e.NodeType.Element&&"head"===I.tagName&&(L=!1);for(var F={doc:c,map:u,blockClass:l,blockSelector:f,maskTextClass:p,maskTextSelector:d,skipChild:h,inlineStylesheet:y,maskInputOptions:N,maskTextFn:C,slimDOMOptions:x,recordCanvas:S,preserveWhiteSpace:L,onSerialize:w,onIframeLoad:_,iframeLoadTimeout:A},G=0,W=Array.from(t.childNodes);G<W.length;G++){(P=k(W[G],F))&&M.childNodes.push(P)}if(r(t)&&t.shadowRoot){M.isShadowHost=!0;for(var j=0,z=Array.from(t.shadowRoot.childNodes);j<z.length;j++){var P;(P=k(z[j],F))&&(P.isShadow=!0,M.childNodes.push(P))}}}return t.parentNode&&n(t.parentNode)&&(M.isShadow=!0),M.type===e.NodeType.Element&&"iframe"===M.tagName&&function(e,t,r){var n=e.contentWindow;if(n){var a,o=!1;try{a=n.document.readyState}catch(e){return}if("complete"===a)"about:blank"===n.location.href&&"about:blank"!==e.src&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0);else{var i=setTimeout(function(){o||(t(),o=!0)},r);e.addEventListener("load",function(){clearTimeout(i),o=!0,t()})}}}(t,function(){var e=t.contentDocument;if(e&&_){var r=k(e,{doc:e,map:u,blockClass:l,blockSelector:f,maskTextClass:p,maskTextSelector:d,skipChild:!1,inlineStylesheet:y,maskInputOptions:N,maskTextFn:C,slimDOMOptions:x,recordCanvas:S,preserveWhiteSpace:L,onSerialize:w,onIframeLoad:_,iframeLoadTimeout:A});r&&_(t,r)}},A),M}var N=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function C(e,t){void 0===t&&(t={});var r=1,n=1;function a(e){var t=e.match(/\n/g);t&&(r+=t.length);var a=e.lastIndexOf("\n");n=-1===a?n+e.length:e.length-a}function o(){var e={line:r,column:n};return function(t){return t.position=new i(e),d(),t}}var i=function(){return function(e){this.start=e,this.end={line:r,column:n},this.source=t.source}}();i.prototype.content=e;var s=[];function c(a){var o=new Error(t.source+":"+r+":"+n+": "+a);if(o.reason=a,o.filename=t.source,o.line=r,o.column=n,o.source=e,!t.silent)throw o;s.push(o)}function u(){return p(/^{\s*/)}function l(){return p(/^}/)}function f(){var t,r=[];for(d(),m(r);e.length&&"}"!==e.charAt(0)&&(t=w()||_());)!1!==t&&(r.push(t),m(r));return r}function p(t){var r=t.exec(e);if(r){var n=r[0];return a(n),e=e.slice(n.length),r}}function d(){p(/^\s*/)}function m(e){var t;for(void 0===e&&(e=[]);t=h();)!1!==t&&e.push(t),t=h();return e}function h(){var t=o();if("/"===e.charAt(0)&&"*"===e.charAt(1)){for(var r=2;""!==e.charAt(r)&&("*"!==e.charAt(r)||"/"!==e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return c("End of comment missing");var i=e.slice(2,r-2);return n+=2,a(i),e=e.slice(r),n+=2,t({type:"comment",comment:i})}}function v(){var e=p(/^([^{]+)/);if(e)return x(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(e){return e.replace(/,/g,"‌")}).split(/\s*(?![^(]*\)),\s*/).map(function(e){return e.replace(/\u200C/g,",")})}function y(){var e=o(),t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=x(t[0]);if(!p(/^:\s*/))return c("property missing ':'");var n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),a=e({type:"declaration",property:r.replace(N,""),value:n?x(n[0]).replace(N,""):""});return p(/^[;\s]*/),a}}function g(){var e,t=[];if(!u())return c("missing '{'");for(m(t);e=y();)!1!==e&&(t.push(e),m(t)),e=y();return l()?t:c("missing '}'")}function T(){for(var e,t=[],r=o();e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return r({type:"keyframe",values:t,declarations:g()})}var b,k=S("import"),C=S("charset"),E=S("namespace");function S(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=o(),n=p(t);if(n){var a={type:e};return a[e]=n[1].trim(),r(a)}}}function w(){if("@"===e[0])return function(){var e=o(),t=p(/^@([-\w]+)?keyframes\s*/);if(t){var r=t[1];if(!(t=p(/^([-\w]+)\s*/)))return c("@keyframes missing name");var n,a=t[1];if(!u())return c("@keyframes missing '{'");for(var i=m();n=T();)i.push(n),i=i.concat(m());return l()?e({type:"keyframes",name:a,vendor:r,keyframes:i}):c("@keyframes missing '}'")}}()||function(){var e=o(),t=p(/^@media *([^{]+)/);if(t){var r=x(t[1]);if(!u())return c("@media missing '{'");var n=m().concat(f());return l()?e({type:"media",media:r,rules:n}):c("@media missing '}'")}}()||function(){var e=o(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:x(t[1]),media:x(t[2])})}()||function(){var e=o(),t=p(/^@supports *([^{]+)/);if(t){var r=x(t[1]);if(!u())return c("@supports missing '{'");var n=m().concat(f());return l()?e({type:"supports",supports:r,rules:n}):c("@supports missing '}'")}}()||k()||C()||E()||function(){var e=o(),t=p(/^@([-\w]+)?document *([^{]+)/);if(t){var r=x(t[1]),n=x(t[2]);if(!u())return c("@document missing '{'");var a=m().concat(f());return l()?e({type:"document",document:n,vendor:r,rules:a}):c("@document missing '}'")}}()||function(){var e=o();if(p(/^@page */)){var t=v()||[];if(!u())return c("@page missing '{'");for(var r,n=m();r=y();)n.push(r),n=n.concat(m());return l()?e({type:"page",selectors:t,declarations:n}):c("@page missing '}'")}}()||function(){var e=o();if(p(/^@host\s*/)){if(!u())return c("@host missing '{'");var t=m().concat(f());return l()?e({type:"host",rules:t}):c("@host missing '}'")}}()||function(){var e=o();if(p(/^@font-face\s*/)){if(!u())return c("@font-face missing '{'");for(var t,r=m();t=y();)r.push(t),r=r.concat(m());return l()?e({type:"font-face",declarations:r}):c("@font-face missing '}'")}}()}function _(){var e=o(),t=v();return t?(m(),e({type:"rule",selectors:t,declarations:g()})):c("selector missing")}return function e(t,r){var n=t&&"string"==typeof t.type;var a=n?t:r;for(var o=0,i=Object.keys(t);o<i.length;o++){var s=i[o],c=t[s];Array.isArray(c)?c.forEach(function(t){e(t,a)}):c&&"object"==typeof c&&e(c,a)}n&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:r||null});return t}((b=f(),{type:"stylesheet",stylesheet:{source:t.source,rules:b,parsingErrors:s}}))}function x(e){return e?e.replace(/^\s+|\s+$/g,""):""}var E={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};var S=/([^\\]):hover/,w=new RegExp(S,"g");function _(e){var t=C(e,{silent:!0});if(!t.stylesheet)return e;var r=[];if(t.stylesheet.rules.forEach(function(e){"selectors"in e&&(e.selectors||[]).forEach(function(e){S.test(e)&&r.push(e)})}),0===r.length)return e;var n=new RegExp(r.filter(function(e,t){return r.indexOf(e)===t}).sort(function(e,t){return t.length-e.length}).map(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}).join("|"),"g");return e.replace(n,function(e){var t=e.replace(w,"$1.\\:hover");return e+", "+t})}function D(t,r){var n=r.doc,a=r.hackCss;switch(t.type){case e.NodeType.Document:return n.implementation.createDocument(null,"",null);case e.NodeType.DocumentType:return n.implementation.createDocumentType(t.name||"html",t.publicId,t.systemId);case e.NodeType.Element:var o,i=function(e){var t=E[e.tagName]?E[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(t);o=t.isSVG?n.createElementNS("http://www.w3.org/2000/svg",i):n.createElement(i);var s=function(e){if(!t.attributes.hasOwnProperty(e))return"continue";var r=t.attributes[e];if(r="boolean"==typeof r||"number"==typeof r?"":r,e.startsWith("rr_")){if("canvas"===i&&"rr_dataURL"===e){var s=document.createElement("img");s.src=r,s.onload=function(){var e=o.getContext("2d");e&&e.drawImage(s,0,0,s.width,s.height)}}if("rr_width"===e&&(o.style.width=r),"rr_height"===e&&(o.style.height=r),"rr_mediaState"===e)switch(r){case"played":o.play();case"paused":o.pause()}}else{var c="textarea"===i&&"value"===e,u="style"===i&&"_cssText"===e;if(u&&a&&(r=_(r)),c||u){for(var l=n.createTextNode(r),f=0,p=Array.from(o.childNodes);f<p.length;f++){var d=p[f];d.nodeType===o.TEXT_NODE&&o.removeChild(d)}return o.appendChild(l),"continue"}if("iframe"===i&&"src"===e)return"continue";try{if(t.isSVG&&"xlink:href"===e)o.setAttributeNS("http://www.w3.org/1999/xlink",e,r);else if("onload"===e||"onclick"===e||"onmouse"===e.substring(0,7))o.setAttribute("_"+e,r);else{if("meta"===i&&"Content-Security-Policy"===t.attributes["http-equiv"]&&"content"==e)return o.setAttribute("csp-content",r),"continue";o.setAttribute(e,r)}}catch(e){}}};for(var c in t.attributes)s(c);if(t.isShadowHost)if(o.shadowRoot)for(;o.shadowRoot.firstChild;)o.shadowRoot.removeChild(o.shadowRoot.firstChild);else o.attachShadow({mode:"open"});return o;case e.NodeType.Text:return n.createTextNode(t.isStyle&&a?_(t.textContent):t.textContent);case e.NodeType.CDATA:return n.createCDATASection(t.textContent);case e.NodeType.Comment:return n.createComment(t.textContent);default:return null}}function A(t,n){var a=n.doc,o=n.map,i=n.skipChild,s=void 0!==i&&i,c=n.hackCss,u=void 0===c||c,l=n.afterAppend,f=D(t,{doc:a,hackCss:u});if(!f)return null;if(t.rootId&&console.assert(o[t.rootId]===a,"Target document should has the same root id."),t.type===e.NodeType.Document&&(a.close(),a.open(),f=a),f.__sn=t,o[t.id]=f,(t.type===e.NodeType.Document||t.type===e.NodeType.Element)&&!s)for(var p=0,d=t.childNodes;p<d.length;p++){var m=d[p],h=A(m,{doc:a,map:o,skipChild:!1,hackCss:u,afterAppend:l});h?(m.isShadow&&r(f)&&f.shadowRoot?f.shadowRoot.appendChild(h):f.appendChild(h),l&&l(h)):console.warn("Failed to rebuild",m)}return f}return e.snapshot=function(e,t){var r=t||{},n=r.blockClass,a=void 0===n?"rr-block":n,o=r.blockSelector,i=void 0===o?null:o,s=r.maskTextClass,c=void 0===s?"rr-mask":s,u=r.maskTextSelector,l=void 0===u?null:u,f=r.inlineStylesheet,p=void 0===f||f,d=r.recordCanvas,m=void 0!==d&&d,h=r.maskAllInputs,v=void 0!==h&&h,y=r.maskTextFn,g=r.slimDOM,T=void 0!==g&&g,b={};return[k(e,{doc:e,map:b,blockClass:a,blockSelector:i,maskTextClass:c,maskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:!0===v?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===v?{password:!0}:v,maskTextFn:y,slimDOMOptions:!0===T||"all"===T?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===T,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===T?{}:T,recordCanvas:m,preserveWhiteSpace:r.preserveWhiteSpace,onSerialize:r.onSerialize,onIframeLoad:r.onIframeLoad,iframeLoadTimeout:r.iframeLoadTimeout}),b]},e.serializeNodeWithId=k,e.rebuild=function(t,r){var n=r.doc,a=r.onVisit,o=r.hackCss,i={},s=A(t,{doc:n,map:i,skipChild:!1,hackCss:void 0===o||o,afterAppend:r.afterAppend});return function(e,t){for(var r in e)e[r]&&(n=e[r],t(n));var n}(i,function(t){a&&a(t),function(t){var r=t.__sn;if(r.type===e.NodeType.Element){var n=t;for(var a in r.attributes)if(r.attributes.hasOwnProperty(a)&&a.startsWith("rr_")){var o=r.attributes[a];"rr_scrollLeft"===a&&(n.scrollLeft=o),"rr_scrollTop"===a&&(n.scrollTop=o)}}}(t)}),[s,i]},e.buildNodeWithSN=A,e.addHoverClass=_,e.transformAttribute=y,e.visitSnapshot=function(t,r){!function t(n){r(n),n.type!==e.NodeType.Document&&n.type!==e.NodeType.Element||n.childNodes.forEach(t)}(t)},e.cleanupSnapshot=function(){a=1},e.needMaskingText=g,e.IGNORED_NODE=i,e.isElement=r,e.isShadowRoot=n,e}({});
var rrwebSnapshot=function(e){"use strict";var t;function r(e){return e.nodeType===e.ELEMENT_NODE}function n(e){var t,r=null===(t=e)||void 0===t?void 0:t.host;return Boolean(r&&r.shadowRoot&&r.shadowRoot===e)}(t=e.NodeType||(e.NodeType={}))[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment";var a=1,o=RegExp("[^a-z0-9-_:]"),i=-2;function s(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(c).join(""):null}catch(e){return null}}function c(e){return function(e){return"styleSheet"in e}(e)?s(e.styleSheet)||"":e.cssText}var u=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,l=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,f=/^(data:)([^,]*),(.*)/i;function p(e,t){return(e||"").replace(u,function(e,r,n,a,o,i){var s,c=n||o||i,u=r||a||"";if(!c)return e;if(!l.test(c))return"url("+u+c+u+")";if(f.test(c))return"url("+u+c+u+")";if("/"===c[0])return"url("+u+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+c)+u+")";var p=t.split("/"),d=c.split("/");p.pop();for(var m=0,h=d;m<h.length;m++){var v=h[m];"."!==v&&(".."===v?p.pop():p.push(v))}return"url("+u+p.join("/")+u+")"})}var d=/^[^ \t\n\r\u000c]+/,m=/^[, \t\n\r\u000c]+/;function h(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function v(){var e=document.createElement("a");return e.href="",e.href}function y(e,t,r,n){return"src"===r||("href"===r||"xlink:href"===r)&&n?h(e,n):"background"!==r||!n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r&&n?function(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,a=e.exec(t.substring(r));return a?(n=a[0],r+=n.length,n):""}for(var a=[];n(m),!(r>=t.length);){var o=n(d);if(","===o.slice(-1))o=h(e,o.substring(0,o.length-1)),a.push(o);else{var i="";o=h(e,o);for(var s=!1;;){var c=t.charAt(r);if(""===c){a.push((o+i).trim());break}if(s)")"===c&&(s=!1);else{if(","===c){r+=1,a.push((o+i).trim());break}"("===c&&(s=!0)}i+=c,r+=1}}}return a.join(", ")}(e,n):"style"===r&&n?p(n,v()):n:h(e,n)}function g(e,t,r){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if("string"==typeof t){if(e.classList.contains(t))return!0}else e.classList.forEach(function(e){if(t.test(e))return!0});return!(!r||!e.matches(r))||g(e.parentNode,t,r)}return e.nodeType,e.TEXT_NODE,g(e.parentNode,t,r)}function T(t,r){var n,a,i=r.doc,c=r.blockClass,u=r.blockSelector,l=r.maskTextClass,f=r.maskTextSelector,d=r.inlineStylesheet,m=r.maskInputOptions,h=void 0===m?{}:m,T=r.maskTextFn,b=r.recordCanvas,k=r.keepIframeSrcFn;if(i.__sn){var C=i.__sn.id;n=1===C?void 0:C}switch(t.nodeType){case t.DOCUMENT_NODE:return{type:e.NodeType.Document,childNodes:[],rootId:n};case t.DOCUMENT_TYPE_NODE:return{type:e.NodeType.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:n};case t.ELEMENT_NODE:for(var N=function(e,t,r){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=0;n<e.classList.length;n++){var a=e.classList[n];if(t.test(a))return!0}return!!r&&e.matches(r)}(t,c,u),S=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return o.test(t)?"div":t}(t),x={},E=0,w=Array.from(t.attributes);E<w.length;E++){var _=w[E],D=_.name,A=_.value;x[D]=y(i,S,D,A)}if("link"===S&&d){var I,O=Array.from(i.styleSheets).find(function(e){return e.href===t.href});(I=s(O))&&(delete x.rel,delete x.href,x._cssText=p(I,O.href))}if("style"===S&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(I=s(t.sheet))&&(x._cssText=p(I,v()));if("input"===S||"textarea"===S||"select"===S){A=t.value;"radio"!==x.type&&"checkbox"!==x.type&&"submit"!==x.type&&"button"!==x.type&&A?x.value=h[x.type]||h[S]?"*".repeat(A.length):A:t.checked&&(x.checked=t.checked)}if("option"===S){var L=t.parentElement;x.value===L.value&&(x.selected=t.selected)}if("canvas"===S&&b&&(x.rr_dataURL=t.toDataURL()),"audio"!==S&&"video"!==S||(x.rr_mediaState=t.paused?"paused":"played",x.rr_mediaCurrentTime=t.currentTime),t.scrollLeft&&(x.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(x.rr_scrollTop=t.scrollTop),N){var M=t.getBoundingClientRect(),R=M.width,F=M.height;x={class:x.class,rr_width:R+"px",rr_height:F+"px"}}return"iframe"!==S||k(x.src)||delete x.src,{type:e.NodeType.Element,tagName:S,attributes:x,childNodes:[],isSVG:(a=t,"svg"===a.tagName||a instanceof SVGElement||void 0),needBlock:N,rootId:n};case t.TEXT_NODE:var G=t.parentNode&&t.parentNode.tagName,W=t.textContent,j="STYLE"===G||void 0,z="SCRIPT"===G||void 0;return j&&W&&(W=p(W,v())),z&&(W="SCRIPT_PLACEHOLDER"),!j&&!z&&g(t,l,f)&&W&&(W=T?T(W):W.replace(/[\S]/g,"*")),{type:e.NodeType.Text,textContent:W||"",isStyle:j,rootId:n};case t.CDATA_SECTION_NODE:return{type:e.NodeType.CDATA,textContent:"",rootId:n};case t.COMMENT_NODE:return{type:e.NodeType.Comment,textContent:t.textContent||"",rootId:n};default:return!1}}function b(e){return void 0===e?"":e.toLowerCase()}function k(t,o){var s,c=o.doc,u=o.map,l=o.blockClass,f=o.blockSelector,p=o.maskTextClass,d=o.maskTextSelector,m=o.skipChild,h=void 0!==m&&m,v=o.inlineStylesheet,y=void 0===v||v,g=o.maskInputOptions,C=void 0===g?{}:g,N=o.maskTextFn,S=o.slimDOMOptions,x=o.recordCanvas,E=void 0!==x&&x,w=o.onSerialize,_=o.onIframeLoad,D=o.iframeLoadTimeout,A=void 0===D?5e3:D,I=o.keepIframeSrcFn,O=void 0===I?function(){return!1}:I,L=o.preserveWhiteSpace,M=void 0===L||L,R=T(t,{doc:c,blockClass:l,blockSelector:f,maskTextClass:p,maskTextSelector:d,inlineStylesheet:y,maskInputOptions:C,maskTextFn:N,recordCanvas:E,keepIframeSrcFn:O});if(!R)return console.warn(t,"not serialized"),null;s="__sn"in t?t.__sn.id:!function(t,r){if(r.comment&&t.type===e.NodeType.Comment)return!0;if(t.type===e.NodeType.Element){if(r.script&&("script"===t.tagName||"link"===t.tagName&&"preload"===t.attributes.rel&&"script"===t.attributes.as))return!0;if(r.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(b(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===b(t.attributes.name)||"icon"===b(t.attributes.rel)||"apple-touch-icon"===b(t.attributes.rel)||"shortcut icon"===b(t.attributes.rel))))return!0;if("meta"===t.tagName){if(r.headMetaDescKeywords&&b(t.attributes.name).match(/^description|keywords$/))return!0;if(r.headMetaSocial&&(b(t.attributes.property).match(/^(og|twitter|fb):/)||b(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===b(t.attributes.name)))return!0;if(r.headMetaRobots&&("robots"===b(t.attributes.name)||"googlebot"===b(t.attributes.name)||"bingbot"===b(t.attributes.name)))return!0;if(r.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(r.headMetaAuthorship&&("author"===b(t.attributes.name)||"generator"===b(t.attributes.name)||"framework"===b(t.attributes.name)||"publisher"===b(t.attributes.name)||"progid"===b(t.attributes.name)||b(t.attributes.property).match(/^article:/)||b(t.attributes.property).match(/^product:/)))return!0;if(r.headMetaVerification&&("google-site-verification"===b(t.attributes.name)||"yandex-verification"===b(t.attributes.name)||"csrf-token"===b(t.attributes.name)||"p:domain_verify"===b(t.attributes.name)||"verify-v1"===b(t.attributes.name)||"verification"===b(t.attributes.name)||"shopify-checkout-api-token"===b(t.attributes.name)))return!0}}return!1}(R,S)&&(M||R.type!==e.NodeType.Text||R.isStyle||R.textContent.replace(/^\s+|\s+$/gm,"").length)?a++:i;var F=Object.assign(R,{id:s});if(t.__sn=F,s===i)return null;u[s]=t,w&&w(t);var G=!h;if(F.type===e.NodeType.Element&&(G=G&&!F.needBlock,delete F.needBlock),(F.type===e.NodeType.Document||F.type===e.NodeType.Element)&&G){S.headWhitespace&&R.type===e.NodeType.Element&&"head"===R.tagName&&(M=!1);for(var W={doc:c,map:u,blockClass:l,blockSelector:f,maskTextClass:p,maskTextSelector:d,skipChild:h,inlineStylesheet:y,maskInputOptions:C,maskTextFn:N,slimDOMOptions:S,recordCanvas:E,preserveWhiteSpace:M,onSerialize:w,onIframeLoad:_,iframeLoadTimeout:A,keepIframeSrcFn:O},j=0,z=Array.from(t.childNodes);j<z.length;j++){(H=k(z[j],W))&&F.childNodes.push(H)}if(r(t)&&t.shadowRoot){F.isShadowHost=!0;for(var P=0,B=Array.from(t.shadowRoot.childNodes);P<B.length;P++){var H;(H=k(B[P],W))&&(H.isShadow=!0,F.childNodes.push(H))}}}return t.parentNode&&n(t.parentNode)&&(F.isShadow=!0),F.type===e.NodeType.Element&&"iframe"===F.tagName&&function(e,t,r){var n=e.contentWindow;if(n){var a,o=!1;try{a=n.document.readyState}catch(e){return}if("complete"===a)"about:blank"===n.location.href&&"about:blank"!==e.src&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0);else{var i=setTimeout(function(){o||(t(),o=!0)},r);e.addEventListener("load",function(){clearTimeout(i),o=!0,t()})}}}(t,function(){var e=t.contentDocument;if(e&&_){var r=k(e,{doc:e,map:u,blockClass:l,blockSelector:f,maskTextClass:p,maskTextSelector:d,skipChild:!1,inlineStylesheet:y,maskInputOptions:C,maskTextFn:N,slimDOMOptions:S,recordCanvas:E,preserveWhiteSpace:M,onSerialize:w,onIframeLoad:_,iframeLoadTimeout:A,keepIframeSrcFn:O});r&&_(t,r)}},A),F}var C=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function N(e,t){void 0===t&&(t={});var r=1,n=1;function a(e){var t=e.match(/\n/g);t&&(r+=t.length);var a=e.lastIndexOf("\n");n=-1===a?n+e.length:e.length-a}function o(){var e={line:r,column:n};return function(t){return t.position=new i(e),d(),t}}var i=function(){return function(e){this.start=e,this.end={line:r,column:n},this.source=t.source}}();i.prototype.content=e;var s=[];function c(a){var o=new Error(t.source+":"+r+":"+n+": "+a);if(o.reason=a,o.filename=t.source,o.line=r,o.column=n,o.source=e,!t.silent)throw o;s.push(o)}function u(){return p(/^{\s*/)}function l(){return p(/^}/)}function f(){var t,r=[];for(d(),m(r);e.length&&"}"!==e.charAt(0)&&(t=w()||_());)!1!==t&&(r.push(t),m(r));return r}function p(t){var r=t.exec(e);if(r){var n=r[0];return a(n),e=e.slice(n.length),r}}function d(){p(/^\s*/)}function m(e){var t;for(void 0===e&&(e=[]);t=h();)!1!==t&&e.push(t),t=h();return e}function h(){var t=o();if("/"===e.charAt(0)&&"*"===e.charAt(1)){for(var r=2;""!==e.charAt(r)&&("*"!==e.charAt(r)||"/"!==e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return c("End of comment missing");var i=e.slice(2,r-2);return n+=2,a(i),e=e.slice(r),n+=2,t({type:"comment",comment:i})}}function v(){var e=p(/^([^{]+)/);if(e)return S(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(e){return e.replace(/,/g,"‌")}).split(/\s*(?![^(]*\)),\s*/).map(function(e){return e.replace(/\u200C/g,",")})}function y(){var e=o(),t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=S(t[0]);if(!p(/^:\s*/))return c("property missing ':'");var n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),a=e({type:"declaration",property:r.replace(C,""),value:n?S(n[0]).replace(C,""):""});return p(/^[;\s]*/),a}}function g(){var e,t=[];if(!u())return c("missing '{'");for(m(t);e=y();)!1!==e&&(t.push(e),m(t)),e=y();return l()?t:c("missing '}'")}function T(){for(var e,t=[],r=o();e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return r({type:"keyframe",values:t,declarations:g()})}var b,k=E("import"),N=E("charset"),x=E("namespace");function E(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=o(),n=p(t);if(n){var a={type:e};return a[e]=n[1].trim(),r(a)}}}function w(){if("@"===e[0])return function(){var e=o(),t=p(/^@([-\w]+)?keyframes\s*/);if(t){var r=t[1];if(!(t=p(/^([-\w]+)\s*/)))return c("@keyframes missing name");var n,a=t[1];if(!u())return c("@keyframes missing '{'");for(var i=m();n=T();)i.push(n),i=i.concat(m());return l()?e({type:"keyframes",name:a,vendor:r,keyframes:i}):c("@keyframes missing '}'")}}()||function(){var e=o(),t=p(/^@media *([^{]+)/);if(t){var r=S(t[1]);if(!u())return c("@media missing '{'");var n=m().concat(f());return l()?e({type:"media",media:r,rules:n}):c("@media missing '}'")}}()||function(){var e=o(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:S(t[1]),media:S(t[2])})}()||function(){var e=o(),t=p(/^@supports *([^{]+)/);if(t){var r=S(t[1]);if(!u())return c("@supports missing '{'");var n=m().concat(f());return l()?e({type:"supports",supports:r,rules:n}):c("@supports missing '}'")}}()||k()||N()||x()||function(){var e=o(),t=p(/^@([-\w]+)?document *([^{]+)/);if(t){var r=S(t[1]),n=S(t[2]);if(!u())return c("@document missing '{'");var a=m().concat(f());return l()?e({type:"document",document:n,vendor:r,rules:a}):c("@document missing '}'")}}()||function(){var e=o();if(p(/^@page */)){var t=v()||[];if(!u())return c("@page missing '{'");for(var r,n=m();r=y();)n.push(r),n=n.concat(m());return l()?e({type:"page",selectors:t,declarations:n}):c("@page missing '}'")}}()||function(){var e=o();if(p(/^@host\s*/)){if(!u())return c("@host missing '{'");var t=m().concat(f());return l()?e({type:"host",rules:t}):c("@host missing '}'")}}()||function(){var e=o();if(p(/^@font-face\s*/)){if(!u())return c("@font-face missing '{'");for(var t,r=m();t=y();)r.push(t),r=r.concat(m());return l()?e({type:"font-face",declarations:r}):c("@font-face missing '}'")}}()}function _(){var e=o(),t=v();return t?(m(),e({type:"rule",selectors:t,declarations:g()})):c("selector missing")}return function e(t,r){var n=t&&"string"==typeof t.type;var a=n?t:r;for(var o=0,i=Object.keys(t);o<i.length;o++){var s=i[o],c=t[s];Array.isArray(c)?c.forEach(function(t){e(t,a)}):c&&"object"==typeof c&&e(c,a)}n&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:r||null});return t}((b=f(),{type:"stylesheet",stylesheet:{source:t.source,rules:b,parsingErrors:s}}))}function S(e){return e?e.replace(/^\s+|\s+$/g,""):""}var x={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};var E=/([^\\]):hover/,w=new RegExp(E,"g");function _(e){var t=N(e,{silent:!0});if(!t.stylesheet)return e;var r=[];if(t.stylesheet.rules.forEach(function(e){"selectors"in e&&(e.selectors||[]).forEach(function(e){E.test(e)&&r.push(e)})}),0===r.length)return e;var n=new RegExp(r.filter(function(e,t){return r.indexOf(e)===t}).sort(function(e,t){return t.length-e.length}).map(function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}).join("|"),"g");return e.replace(n,function(e){var t=e.replace(w,"$1.\\:hover");return e+", "+t})}function D(t,r){var n=r.doc,a=r.hackCss;switch(t.type){case e.NodeType.Document:return n.implementation.createDocument(null,"",null);case e.NodeType.DocumentType:return n.implementation.createDocumentType(t.name||"html",t.publicId,t.systemId);case e.NodeType.Element:var o,i=function(e){var t=x[e.tagName]?x[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(t);o=t.isSVG?n.createElementNS("http://www.w3.org/2000/svg",i):n.createElement(i);var s=function(e){if(!t.attributes.hasOwnProperty(e))return"continue";var r=t.attributes[e];if(r="boolean"==typeof r||"number"==typeof r?"":r,e.startsWith("rr_")){if("canvas"===i&&"rr_dataURL"===e){var s=document.createElement("img");s.src=r,s.onload=function(){var e=o.getContext("2d");e&&e.drawImage(s,0,0,s.width,s.height)}}if("rr_width"===e&&(o.style.width=r),"rr_height"===e&&(o.style.height=r),"rr_mediaCurrentTime"===e&&(o.currentTime=t.attributes.rr_mediaCurrentTime),"rr_mediaState"===e)switch(r){case"played":o.play().catch(function(e){return console.warn("media playback error",e)});break;case"paused":o.pause()}}else{var c="textarea"===i&&"value"===e,u="style"===i&&"_cssText"===e;if(u&&a&&(r=_(r)),c||u){for(var l=n.createTextNode(r),f=0,p=Array.from(o.childNodes);f<p.length;f++){var d=p[f];d.nodeType===o.TEXT_NODE&&o.removeChild(d)}return o.appendChild(l),"continue"}try{if(t.isSVG&&"xlink:href"===e)o.setAttributeNS("http://www.w3.org/1999/xlink",e,r);else if("onload"===e||"onclick"===e||"onmouse"===e.substring(0,7))o.setAttribute("_"+e,r);else{if("meta"===i&&"Content-Security-Policy"===t.attributes["http-equiv"]&&"content"==e)return o.setAttribute("csp-content",r),"continue";o.setAttribute(e,r)}}catch(e){}}};for(var c in t.attributes)s(c);if(t.isShadowHost)if(o.shadowRoot)for(;o.shadowRoot.firstChild;)o.shadowRoot.removeChild(o.shadowRoot.firstChild);else o.attachShadow({mode:"open"});return o;case e.NodeType.Text:return n.createTextNode(t.isStyle&&a?_(t.textContent):t.textContent);case e.NodeType.CDATA:return n.createCDATASection(t.textContent);case e.NodeType.Comment:return n.createComment(t.textContent);default:return null}}function A(t,n){var a=n.doc,o=n.map,i=n.skipChild,s=void 0!==i&&i,c=n.hackCss,u=void 0===c||c,l=n.afterAppend,f=D(t,{doc:a,hackCss:u});if(!f)return null;if(t.rootId&&console.assert(o[t.rootId]===a,"Target document should has the same root id."),t.type===e.NodeType.Document&&(a.close(),a.open(),f=a),f.__sn=t,o[t.id]=f,(t.type===e.NodeType.Document||t.type===e.NodeType.Element)&&!s)for(var p=0,d=t.childNodes;p<d.length;p++){var m=d[p],h=A(m,{doc:a,map:o,skipChild:!1,hackCss:u,afterAppend:l});h?(m.isShadow&&r(f)&&f.shadowRoot?f.shadowRoot.appendChild(h):f.appendChild(h),l&&l(h)):console.warn("Failed to rebuild",m)}return f}return e.snapshot=function(e,t){var r=t||{},n=r.blockClass,a=void 0===n?"rr-block":n,o=r.blockSelector,i=void 0===o?null:o,s=r.maskTextClass,c=void 0===s?"rr-mask":s,u=r.maskTextSelector,l=void 0===u?null:u,f=r.inlineStylesheet,p=void 0===f||f,d=r.recordCanvas,m=void 0!==d&&d,h=r.maskAllInputs,v=void 0!==h&&h,y=r.maskTextFn,g=r.slimDOM,T=void 0!==g&&g,b=r.preserveWhiteSpace,C=r.onSerialize,N=r.onIframeLoad,S=r.iframeLoadTimeout,x=r.keepIframeSrcFn,E={};return[k(e,{doc:e,map:E,blockClass:a,blockSelector:i,maskTextClass:c,maskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:!0===v?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===v?{password:!0}:v,maskTextFn:y,slimDOMOptions:!0===T||"all"===T?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===T,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===T?{}:T,recordCanvas:m,preserveWhiteSpace:b,onSerialize:C,onIframeLoad:N,iframeLoadTimeout:S,keepIframeSrcFn:void 0===x?function(){return!1}:x}),E]},e.serializeNodeWithId=k,e.rebuild=function(t,r){var n=r.doc,a=r.onVisit,o=r.hackCss,i={},s=A(t,{doc:n,map:i,skipChild:!1,hackCss:void 0===o||o,afterAppend:r.afterAppend});return function(e,t){for(var r in e)e[r]&&(n=e[r],t(n));var n}(i,function(t){a&&a(t),function(t){var r=t.__sn;if(r.type===e.NodeType.Element){var n=t;for(var a in r.attributes)if(r.attributes.hasOwnProperty(a)&&a.startsWith("rr_")){var o=r.attributes[a];"rr_scrollLeft"===a&&(n.scrollLeft=o),"rr_scrollTop"===a&&(n.scrollTop=o)}}}(t)}),[s,i]},e.buildNodeWithSN=A,e.addHoverClass=_,e.transformAttribute=y,e.visitSnapshot=function(t,r){!function t(n){r(n),n.type!==e.NodeType.Document&&n.type!==e.NodeType.Element||n.childNodes.forEach(t)}(t)},e.cleanupSnapshot=function(){a=1},e.needMaskingText=g,e.IGNORED_NODE=i,e.isElement=r,e.isShadowRoot=n,e}({});
//# sourceMappingURL=rrweb-snapshot.min.js.map

@@ -280,3 +280,3 @@ var NodeType;

function serializeNode(n, options) {
var doc = options.doc, blockClass = options.blockClass, blockSelector = options.blockSelector, maskTextClass = options.maskTextClass, maskTextSelector = options.maskTextSelector, inlineStylesheet = options.inlineStylesheet, _a = options.maskInputOptions, maskInputOptions = _a === void 0 ? {} : _a, maskTextFn = options.maskTextFn, recordCanvas = options.recordCanvas;
var doc = options.doc, blockClass = options.blockClass, blockSelector = options.blockSelector, maskTextClass = options.maskTextClass, maskTextSelector = options.maskTextSelector, inlineStylesheet = options.inlineStylesheet, _a = options.maskInputOptions, maskInputOptions = _a === void 0 ? {} : _a, maskTextFn = options.maskTextFn, recordCanvas = options.recordCanvas, keepIframeSrcFn = options.keepIframeSrcFn;
var rootId;

@@ -363,2 +363,3 @@ if (doc.__sn) {

: 'played';
attributes_1.rr_mediaCurrentTime = n.currentTime;
}

@@ -379,3 +380,3 @@ if (n.scrollLeft) {

}
if (tagName === 'iframe') {
if (tagName === 'iframe' && !keepIframeSrcFn(attributes_1.src)) {
delete attributes_1.src;

@@ -509,4 +510,4 @@ }

function serializeNodeWithId(n, options) {
var doc = options.doc, map = options.map, blockClass = options.blockClass, blockSelector = options.blockSelector, maskTextClass = options.maskTextClass, maskTextSelector = options.maskTextSelector, _a = options.skipChild, skipChild = _a === void 0 ? false : _a, _b = options.inlineStylesheet, inlineStylesheet = _b === void 0 ? true : _b, _c = options.maskInputOptions, maskInputOptions = _c === void 0 ? {} : _c, maskTextFn = options.maskTextFn, slimDOMOptions = options.slimDOMOptions, _d = options.recordCanvas, recordCanvas = _d === void 0 ? false : _d, onSerialize = options.onSerialize, onIframeLoad = options.onIframeLoad, _e = options.iframeLoadTimeout, iframeLoadTimeout = _e === void 0 ? 5000 : _e;
var _f = options.preserveWhiteSpace, preserveWhiteSpace = _f === void 0 ? true : _f;
var doc = options.doc, map = options.map, blockClass = options.blockClass, blockSelector = options.blockSelector, maskTextClass = options.maskTextClass, maskTextSelector = options.maskTextSelector, _a = options.skipChild, skipChild = _a === void 0 ? false : _a, _b = options.inlineStylesheet, inlineStylesheet = _b === void 0 ? true : _b, _c = options.maskInputOptions, maskInputOptions = _c === void 0 ? {} : _c, maskTextFn = options.maskTextFn, slimDOMOptions = options.slimDOMOptions, _d = options.recordCanvas, recordCanvas = _d === void 0 ? false : _d, onSerialize = options.onSerialize, onIframeLoad = options.onIframeLoad, _e = options.iframeLoadTimeout, iframeLoadTimeout = _e === void 0 ? 5000 : _e, _f = options.keepIframeSrcFn, keepIframeSrcFn = _f === void 0 ? function () { return false; } : _f;
var _g = options.preserveWhiteSpace, preserveWhiteSpace = _g === void 0 ? true : _g;
var _serializedNode = serializeNode(n, {

@@ -522,2 +523,3 @@ doc: doc,

recordCanvas: recordCanvas,
keepIframeSrcFn: keepIframeSrcFn,
});

@@ -581,5 +583,6 @@ if (!_serializedNode) {

iframeLoadTimeout: iframeLoadTimeout,
keepIframeSrcFn: keepIframeSrcFn,
};
for (var _i = 0, _g = Array.from(n.childNodes); _i < _g.length; _i++) {
var childN = _g[_i];
for (var _i = 0, _h = Array.from(n.childNodes); _i < _h.length; _i++) {
var childN = _h[_i];
var serializedChildNode = serializeNodeWithId(childN, bypassOptions);

@@ -592,4 +595,4 @@ if (serializedChildNode) {

serializedNode.isShadowHost = true;
for (var _h = 0, _j = Array.from(n.shadowRoot.childNodes); _h < _j.length; _h++) {
var childN = _j[_h];
for (var _j = 0, _k = Array.from(n.shadowRoot.childNodes); _j < _k.length; _j++) {
var childN = _k[_j];
var serializedChildNode = serializeNodeWithId(childN, bypassOptions);

@@ -628,2 +631,3 @@ if (serializedChildNode) {

iframeLoadTimeout: iframeLoadTimeout,
keepIframeSrcFn: keepIframeSrcFn,
});

@@ -639,3 +643,3 @@ if (serializedIframeNode) {

function snapshot(n, options) {
var _a = options || {}, _b = _a.blockClass, blockClass = _b === void 0 ? 'rr-block' : _b, _c = _a.blockSelector, blockSelector = _c === void 0 ? null : _c, _d = _a.maskTextClass, maskTextClass = _d === void 0 ? 'rr-mask' : _d, _e = _a.maskTextSelector, maskTextSelector = _e === void 0 ? null : _e, _f = _a.inlineStylesheet, inlineStylesheet = _f === void 0 ? true : _f, _g = _a.recordCanvas, recordCanvas = _g === void 0 ? false : _g, _h = _a.maskAllInputs, maskAllInputs = _h === void 0 ? false : _h, maskTextFn = _a.maskTextFn, _j = _a.slimDOM, slimDOM = _j === void 0 ? false : _j, preserveWhiteSpace = _a.preserveWhiteSpace, onSerialize = _a.onSerialize, onIframeLoad = _a.onIframeLoad, iframeLoadTimeout = _a.iframeLoadTimeout;
var _a = options || {}, _b = _a.blockClass, blockClass = _b === void 0 ? 'rr-block' : _b, _c = _a.blockSelector, blockSelector = _c === void 0 ? null : _c, _d = _a.maskTextClass, maskTextClass = _d === void 0 ? 'rr-mask' : _d, _e = _a.maskTextSelector, maskTextSelector = _e === void 0 ? null : _e, _f = _a.inlineStylesheet, inlineStylesheet = _f === void 0 ? true : _f, _g = _a.recordCanvas, recordCanvas = _g === void 0 ? false : _g, _h = _a.maskAllInputs, maskAllInputs = _h === void 0 ? false : _h, maskTextFn = _a.maskTextFn, _j = _a.slimDOM, slimDOM = _j === void 0 ? false : _j, preserveWhiteSpace = _a.preserveWhiteSpace, onSerialize = _a.onSerialize, onIframeLoad = _a.onIframeLoad, iframeLoadTimeout = _a.iframeLoadTimeout, _k = _a.keepIframeSrcFn, keepIframeSrcFn = _k === void 0 ? function () { return false; } : _k;
var idNodeMap = {};

@@ -701,2 +705,3 @@ var maskInputOptions = maskAllInputs === true

iframeLoadTimeout: iframeLoadTimeout,
keepIframeSrcFn: keepIframeSrcFn,
}),

@@ -1282,5 +1287,2 @@ idNodeMap,

}
if (tagName === 'iframe' && name === 'src') {
return "continue";
}
try {

@@ -1325,6 +1327,13 @@ if (n.isSVG && name === 'xlink:href') {

}
if (name === 'rr_mediaCurrentTime') {
node_1.currentTime = n.attributes
.rr_mediaCurrentTime;
}
if (name === 'rr_mediaState') {
switch (value) {
case 'played':
node_1.play();
node_1
.play()
.catch(function (e) { return console.warn('media playback error', e); });
break;
case 'paused':

@@ -1331,0 +1340,0 @@ node_1.pause();

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

var NodeType;function isElement(e){return e.nodeType===e.ELEMENT_NODE}function isShadowRoot(e){var t,r=null===(t=e)||void 0===t?void 0:t.host;return Boolean(r&&r.shadowRoot&&r.shadowRoot===e)}!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,tagNameRegex=RegExp("[^a-z0-9-_:]"),IGNORED_NODE=-2;function genId(){return _id++}function getValidTagName(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return tagNameRegex.test(t)?"div":t}function getCssRulesString(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(getCssRuleString).join(""):null}catch(e){return null}}function getCssRuleString(e){return isCSSImportRule(e)?getCssRulesString(e.styleSheet)||"":e.cssText}function isCSSImportRule(e){return"styleSheet"in e}function extractOrigin(e){return(e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0]).split("?")[0]}var URL_IN_CSS_REF=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,RELATIVE_PATH=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,DATA_URI=/^(data:)([^,]*),(.*)/i;function absoluteToStylesheet(e,t){return(e||"").replace(URL_IN_CSS_REF,function(e,r,n,a,o,i){var s=n||o||i,l=r||a||"";if(!s)return e;if(!RELATIVE_PATH.test(s))return"url("+l+s+l+")";if(DATA_URI.test(s))return"url("+l+s+l+")";if("/"===s[0])return"url("+l+(extractOrigin(t)+s)+l+")";var c=t.split("/"),u=s.split("/");c.pop();for(var f=0,d=u;f<d.length;f++){var m=d[f];"."!==m&&(".."===m?c.pop():c.push(m))}return"url("+l+c.join("/")+l+")"})}var SRCSET_NOT_SPACES=/^[^ \t\n\r\u000c]+/,SRCSET_COMMAS_OR_SPACES=/^[, \t\n\r\u000c]+/;function getAbsoluteSrcsetString(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,a=e.exec(t.substring(r));return a?(n=a[0],r+=n.length,n):""}for(var a=[];n(SRCSET_COMMAS_OR_SPACES),!(r>=t.length);){var o=n(SRCSET_NOT_SPACES);if(","===o.slice(-1))o=absoluteToDoc(e,o.substring(0,o.length-1)),a.push(o);else{var i="";o=absoluteToDoc(e,o);for(var s=!1;;){var l=t.charAt(r);if(""===l){a.push((o+i).trim());break}if(s)")"===l&&(s=!1);else{if(","===l){r+=1,a.push((o+i).trim());break}"("===l&&(s=!0)}i+=l,r+=1}}}return a.join(", ")}function absoluteToDoc(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function isSVGElement(e){return"svg"===e.tagName||e instanceof SVGElement}function getHref(){var e=document.createElement("a");return e.href="",e.href}function transformAttribute(e,t,r,n){return"src"===r||("href"===r||"xlink:href"===r)&&n?absoluteToDoc(e,n):"background"!==r||!n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r&&n?getAbsoluteSrcsetString(e,n):"style"===r&&n?absoluteToStylesheet(n,getHref()):n:absoluteToDoc(e,n)}function _isBlockedElement(e,t,r){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=0;n<e.classList.length;n++){var a=e.classList[n];if(t.test(a))return!0}return!!r&&e.matches(r)}function needMaskingText(e,t,r){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if("string"==typeof t){if(e.classList.contains(t))return!0}else e.classList.forEach(function(e){if(t.test(e))return!0});return!(!r||!e.matches(r))||needMaskingText(e.parentNode,t,r)}return e.nodeType,e.TEXT_NODE,needMaskingText(e.parentNode,t,r)}function onceIframeLoaded(e,t,r){var n=e.contentWindow;if(n){var a,o=!1;try{a=n.document.readyState}catch(e){return}if("complete"===a){"about:blank"===n.location.href&&"about:blank"!==e.src&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0)}else{var i=setTimeout(function(){o||(t(),o=!0)},r);e.addEventListener("load",function(){clearTimeout(i),o=!0,t()})}}}function serializeNode(e,t){var r,n=t.doc,a=t.blockClass,o=t.blockSelector,i=t.maskTextClass,s=t.maskTextSelector,l=t.inlineStylesheet,c=t.maskInputOptions,u=void 0===c?{}:c,f=t.maskTextFn,d=t.recordCanvas;if(n.__sn){var m=n.__sn.id;r=1===m?void 0:m}switch(e.nodeType){case e.DOCUMENT_NODE:return{type:NodeType.Document,childNodes:[],rootId:r};case e.DOCUMENT_TYPE_NODE:return{type:NodeType.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:r};case e.ELEMENT_NODE:for(var p=_isBlockedElement(e,a,o),h=getValidTagName(e),v={},g=0,y=Array.from(e.attributes);g<y.length;g++){var T=y[g],E=T.name,b=T.value;v[E]=transformAttribute(n,h,E,b)}if("link"===h&&l){var S,N=Array.from(n.styleSheets).find(function(t){return t.href===e.href});(S=getCssRulesString(N))&&(delete v.rel,delete v.href,v._cssText=absoluteToStylesheet(S,N.href))}if("style"===h&&e.sheet&&!(e.innerText||e.textContent||"").trim().length)(S=getCssRulesString(e.sheet))&&(v._cssText=absoluteToStylesheet(S,getHref()));if("input"===h||"textarea"===h||"select"===h){b=e.value;"radio"!==v.type&&"checkbox"!==v.type&&"submit"!==v.type&&"button"!==v.type&&b?v.value=u[v.type]||u[h]?"*".repeat(b.length):b:e.checked&&(v.checked=e.checked)}if("option"===h){var x=e.parentElement;v.value===x.value&&(v.selected=e.selected)}if("canvas"===h&&d&&(v.rr_dataURL=e.toDataURL()),"audio"!==h&&"video"!==h||(v.rr_mediaState=e.paused?"paused":"played"),e.scrollLeft&&(v.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(v.rr_scrollTop=e.scrollTop),p){var C=e.getBoundingClientRect(),k=C.width,w=C.height;v={class:v.class,rr_width:k+"px",rr_height:w+"px"}}return"iframe"===h&&delete v.src,{type:NodeType.Element,tagName:h,attributes:v,childNodes:[],isSVG:isSVGElement(e)||void 0,needBlock:p,rootId:r};case e.TEXT_NODE:var _=e.parentNode&&e.parentNode.tagName,I=e.textContent,O="STYLE"===_||void 0,R="SCRIPT"===_||void 0;return O&&I&&(I=absoluteToStylesheet(I,getHref())),R&&(I="SCRIPT_PLACEHOLDER"),!O&&!R&&needMaskingText(e,i,s)&&I&&(I=f?f(I):I.replace(/[\S]/g,"*")),{type:NodeType.Text,textContent:I||"",isStyle:O,rootId:r};case e.CDATA_SECTION_NODE:return{type:NodeType.CDATA,textContent:"",rootId:r};case e.COMMENT_NODE:return{type:NodeType.Comment,textContent:e.textContent||"",rootId:r};default:return!1}}function lowerIfExists(e){return void 0===e?"":e.toLowerCase()}function slimDOMExcluded(e,t){if(t.comment&&e.type===NodeType.Comment)return!0;if(e.type===NodeType.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&"preload"===e.attributes.rel&&"script"===e.attributes.as))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(lowerIfExists(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===lowerIfExists(e.attributes.name)||"icon"===lowerIfExists(e.attributes.rel)||"apple-touch-icon"===lowerIfExists(e.attributes.rel)||"shortcut icon"===lowerIfExists(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&lowerIfExists(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(lowerIfExists(e.attributes.property).match(/^(og|twitter|fb):/)||lowerIfExists(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===lowerIfExists(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===lowerIfExists(e.attributes.name)||"googlebot"===lowerIfExists(e.attributes.name)||"bingbot"===lowerIfExists(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===lowerIfExists(e.attributes.name)||"generator"===lowerIfExists(e.attributes.name)||"framework"===lowerIfExists(e.attributes.name)||"publisher"===lowerIfExists(e.attributes.name)||"progid"===lowerIfExists(e.attributes.name)||lowerIfExists(e.attributes.property).match(/^article:/)||lowerIfExists(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===lowerIfExists(e.attributes.name)||"yandex-verification"===lowerIfExists(e.attributes.name)||"csrf-token"===lowerIfExists(e.attributes.name)||"p:domain_verify"===lowerIfExists(e.attributes.name)||"verify-v1"===lowerIfExists(e.attributes.name)||"verification"===lowerIfExists(e.attributes.name)||"shopify-checkout-api-token"===lowerIfExists(e.attributes.name)))return!0}}return!1}function serializeNodeWithId(e,t){var r,n=t.doc,a=t.map,o=t.blockClass,i=t.blockSelector,s=t.maskTextClass,l=t.maskTextSelector,c=t.skipChild,u=void 0!==c&&c,f=t.inlineStylesheet,d=void 0===f||f,m=t.maskInputOptions,p=void 0===m?{}:m,h=t.maskTextFn,v=t.slimDOMOptions,g=t.recordCanvas,y=void 0!==g&&g,T=t.onSerialize,E=t.onIframeLoad,b=t.iframeLoadTimeout,S=void 0===b?5e3:b,N=t.preserveWhiteSpace,x=void 0===N||N,C=serializeNode(e,{doc:n,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:l,inlineStylesheet:d,maskInputOptions:p,maskTextFn:h,recordCanvas:y});if(!C)return console.warn(e,"not serialized"),null;r="__sn"in e?e.__sn.id:slimDOMExcluded(C,v)||!x&&C.type===NodeType.Text&&!C.isStyle&&!C.textContent.replace(/^\s+|\s+$/gm,"").length?IGNORED_NODE:genId();var k=Object.assign(C,{id:r});if(e.__sn=k,r===IGNORED_NODE)return null;a[r]=e,T&&T(e);var w=!u;if(k.type===NodeType.Element&&(w=w&&!k.needBlock,delete k.needBlock),(k.type===NodeType.Document||k.type===NodeType.Element)&&w){v.headWhitespace&&C.type===NodeType.Element&&"head"===C.tagName&&(x=!1);for(var _={doc:n,map:a,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:l,skipChild:u,inlineStylesheet:d,maskInputOptions:p,maskTextFn:h,slimDOMOptions:v,recordCanvas:y,preserveWhiteSpace:x,onSerialize:T,onIframeLoad:E,iframeLoadTimeout:S},I=0,O=Array.from(e.childNodes);I<O.length;I++){(A=serializeNodeWithId(O[I],_))&&k.childNodes.push(A)}if(isElement(e)&&e.shadowRoot){k.isShadowHost=!0;for(var R=0,D=Array.from(e.shadowRoot.childNodes);R<D.length;R++){var A;(A=serializeNodeWithId(D[R],_))&&(A.isShadow=!0,k.childNodes.push(A))}}}return e.parentNode&&isShadowRoot(e.parentNode)&&(k.isShadow=!0),k.type===NodeType.Element&&"iframe"===k.tagName&&onceIframeLoaded(e,function(){var t=e.contentDocument;if(t&&E){var r=serializeNodeWithId(t,{doc:t,map:a,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:p,maskTextFn:h,slimDOMOptions:v,recordCanvas:y,preserveWhiteSpace:x,onSerialize:T,onIframeLoad:E,iframeLoadTimeout:S});r&&E(e,r)}},S),k}function snapshot(e,t){var r=t||{},n=r.blockClass,a=void 0===n?"rr-block":n,o=r.blockSelector,i=void 0===o?null:o,s=r.maskTextClass,l=void 0===s?"rr-mask":s,c=r.maskTextSelector,u=void 0===c?null:c,f=r.inlineStylesheet,d=void 0===f||f,m=r.recordCanvas,p=void 0!==m&&m,h=r.maskAllInputs,v=void 0!==h&&h,g=r.maskTextFn,y=r.slimDOM,T=void 0!==y&&y,E={};return[serializeNodeWithId(e,{doc:e,map:E,blockClass:a,blockSelector:i,maskTextClass:l,maskTextSelector:u,skipChild:!1,inlineStylesheet:d,maskInputOptions:!0===v?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===v?{password:!0}:v,maskTextFn:g,slimDOMOptions:!0===T||"all"===T?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===T,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===T?{}:T,recordCanvas:p,preserveWhiteSpace:r.preserveWhiteSpace,onSerialize:r.onSerialize,onIframeLoad:r.onIframeLoad,iframeLoadTimeout:r.iframeLoadTimeout}),E]}function visitSnapshot(e,t){!function e(r){t(r),r.type!==NodeType.Document&&r.type!==NodeType.Element||r.childNodes.forEach(e)}(e)}function cleanupSnapshot(){_id=1}var commentre=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function parse(e,t){void 0===t&&(t={});var r=1,n=1;function a(e){var t=e.match(/\n/g);t&&(r+=t.length);var a=e.lastIndexOf("\n");n=-1===a?n+e.length:e.length-a}function o(){var e={line:r,column:n};return function(t){return t.position=new i(e),m(),t}}var i=function(){return function(e){this.start=e,this.end={line:r,column:n},this.source=t.source}}();i.prototype.content=e;var s=[];function l(a){var o=new Error(t.source+":"+r+":"+n+": "+a);if(o.reason=a,o.filename=t.source,o.line=r,o.column=n,o.source=e,!t.silent)throw o;s.push(o)}function c(){return d(/^{\s*/)}function u(){return d(/^}/)}function f(){var t,r=[];for(m(),p(r);e.length&&"}"!==e.charAt(0)&&(t=C()||k());)!1!==t&&(r.push(t),p(r));return r}function d(t){var r=t.exec(e);if(r){var n=r[0];return a(n),e=e.slice(n.length),r}}function m(){d(/^\s*/)}function p(e){var t;for(void 0===e&&(e=[]);t=h();)!1!==t&&e.push(t),t=h();return e}function h(){var t=o();if("/"===e.charAt(0)&&"*"===e.charAt(1)){for(var r=2;""!==e.charAt(r)&&("*"!==e.charAt(r)||"/"!==e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return l("End of comment missing");var i=e.slice(2,r-2);return n+=2,a(i),e=e.slice(r),n+=2,t({type:"comment",comment:i})}}function v(){var e=d(/^([^{]+)/);if(e)return trim(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(e){return e.replace(/,/g,"‌")}).split(/\s*(?![^(]*\)),\s*/).map(function(e){return e.replace(/\u200C/g,",")})}function g(){var e=o(),t=d(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=trim(t[0]);if(!d(/^:\s*/))return l("property missing ':'");var n=d(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),a=e({type:"declaration",property:r.replace(commentre,""),value:n?trim(n[0]).replace(commentre,""):""});return d(/^[;\s]*/),a}}function y(){var e,t=[];if(!c())return l("missing '{'");for(p(t);e=g();)!1!==e&&(t.push(e),p(t)),e=g();return u()?t:l("missing '}'")}function T(){for(var e,t=[],r=o();e=d(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),d(/^,\s*/);if(t.length)return r({type:"keyframe",values:t,declarations:y()})}var E,b=x("import"),S=x("charset"),N=x("namespace");function x(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=o(),n=d(t);if(n){var a={type:e};return a[e]=n[1].trim(),r(a)}}}function C(){if("@"===e[0])return function(){var e=o(),t=d(/^@([-\w]+)?keyframes\s*/);if(t){var r=t[1];if(!(t=d(/^([-\w]+)\s*/)))return l("@keyframes missing name");var n,a=t[1];if(!c())return l("@keyframes missing '{'");for(var i=p();n=T();)i.push(n),i=i.concat(p());return u()?e({type:"keyframes",name:a,vendor:r,keyframes:i}):l("@keyframes missing '}'")}}()||function(){var e=o(),t=d(/^@media *([^{]+)/);if(t){var r=trim(t[1]);if(!c())return l("@media missing '{'");var n=p().concat(f());return u()?e({type:"media",media:r,rules:n}):l("@media missing '}'")}}()||function(){var e=o(),t=d(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:trim(t[1]),media:trim(t[2])})}()||function(){var e=o(),t=d(/^@supports *([^{]+)/);if(t){var r=trim(t[1]);if(!c())return l("@supports missing '{'");var n=p().concat(f());return u()?e({type:"supports",supports:r,rules:n}):l("@supports missing '}'")}}()||b()||S()||N()||function(){var e=o(),t=d(/^@([-\w]+)?document *([^{]+)/);if(t){var r=trim(t[1]),n=trim(t[2]);if(!c())return l("@document missing '{'");var a=p().concat(f());return u()?e({type:"document",document:n,vendor:r,rules:a}):l("@document missing '}'")}}()||function(){var e=o();if(d(/^@page */)){var t=v()||[];if(!c())return l("@page missing '{'");for(var r,n=p();r=g();)n.push(r),n=n.concat(p());return u()?e({type:"page",selectors:t,declarations:n}):l("@page missing '}'")}}()||function(){var e=o();if(d(/^@host\s*/)){if(!c())return l("@host missing '{'");var t=p().concat(f());return u()?e({type:"host",rules:t}):l("@host missing '}'")}}()||function(){var e=o();if(d(/^@font-face\s*/)){if(!c())return l("@font-face missing '{'");for(var t,r=p();t=g();)r.push(t),r=r.concat(p());return u()?e({type:"font-face",declarations:r}):l("@font-face missing '}'")}}()}function k(){var e=o(),t=v();return t?(p(),e({type:"rule",selectors:t,declarations:y()})):l("selector missing")}return addParent((E=f(),{type:"stylesheet",stylesheet:{source:t.source,rules:E,parsingErrors:s}}))}function trim(e){return e?e.replace(/^\s+|\s+$/g,""):""}function addParent(e,t){for(var r=e&&"string"==typeof e.type,n=r?e:t,a=0,o=Object.keys(e);a<o.length;a++){var i=e[o[a]];Array.isArray(i)?i.forEach(function(e){addParent(e,n)}):i&&"object"==typeof i&&addParent(i,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var tagMap={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function getTagName(e){var t=tagMap[e.tagName]?tagMap[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}function escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var HOVER_SELECTOR=/([^\\]):hover/,HOVER_SELECTOR_GLOBAL=new RegExp(HOVER_SELECTOR,"g");function addHoverClass(e){var t=parse(e,{silent:!0});if(!t.stylesheet)return e;var r=[];if(t.stylesheet.rules.forEach(function(e){"selectors"in e&&(e.selectors||[]).forEach(function(e){HOVER_SELECTOR.test(e)&&r.push(e)})}),0===r.length)return e;var n=new RegExp(r.filter(function(e,t){return r.indexOf(e)===t}).sort(function(e,t){return t.length-e.length}).map(function(e){return escapeRegExp(e)}).join("|"),"g");return e.replace(n,function(e){var t=e.replace(HOVER_SELECTOR_GLOBAL,"$1.\\:hover");return e+", "+t})}function buildNode(e,t){var r=t.doc,n=t.hackCss;switch(e.type){case NodeType.Document:return r.implementation.createDocument(null,"",null);case NodeType.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case NodeType.Element:var a,o=getTagName(e);a=e.isSVG?r.createElementNS("http://www.w3.org/2000/svg",o):r.createElement(o);var i=function(t){if(!e.attributes.hasOwnProperty(t))return"continue";var i=e.attributes[t];if(i="boolean"==typeof i||"number"==typeof i?"":i,t.startsWith("rr_")){if("canvas"===o&&"rr_dataURL"===t){var s=document.createElement("img");s.src=i,s.onload=function(){var e=a.getContext("2d");e&&e.drawImage(s,0,0,s.width,s.height)}}if("rr_width"===t&&(a.style.width=i),"rr_height"===t&&(a.style.height=i),"rr_mediaState"===t)switch(i){case"played":a.play();case"paused":a.pause()}}else{var l="textarea"===o&&"value"===t,c="style"===o&&"_cssText"===t;if(c&&n&&(i=addHoverClass(i)),l||c){for(var u=r.createTextNode(i),f=0,d=Array.from(a.childNodes);f<d.length;f++){var m=d[f];m.nodeType===a.TEXT_NODE&&a.removeChild(m)}return a.appendChild(u),"continue"}if("iframe"===o&&"src"===t)return"continue";try{if(e.isSVG&&"xlink:href"===t)a.setAttributeNS("http://www.w3.org/1999/xlink",t,i);else if("onload"===t||"onclick"===t||"onmouse"===t.substring(0,7))a.setAttribute("_"+t,i);else{if("meta"===o&&"Content-Security-Policy"===e.attributes["http-equiv"]&&"content"==t)return a.setAttribute("csp-content",i),"continue";a.setAttribute(t,i)}}catch(e){}}};for(var s in e.attributes)i(s);if(e.isShadowHost)if(a.shadowRoot)for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);else a.attachShadow({mode:"open"});return a;case NodeType.Text:return r.createTextNode(e.isStyle&&n?addHoverClass(e.textContent):e.textContent);case NodeType.CDATA:return r.createCDATASection(e.textContent);case NodeType.Comment:return r.createComment(e.textContent);default:return null}}function buildNodeWithSN(e,t){var r=t.doc,n=t.map,a=t.skipChild,o=void 0!==a&&a,i=t.hackCss,s=void 0===i||i,l=t.afterAppend,c=buildNode(e,{doc:r,hackCss:s});if(!c)return null;if(e.rootId&&console.assert(n[e.rootId]===r,"Target document should has the same root id."),e.type===NodeType.Document&&(r.close(),r.open(),c=r),c.__sn=e,n[e.id]=c,(e.type===NodeType.Document||e.type===NodeType.Element)&&!o)for(var u=0,f=e.childNodes;u<f.length;u++){var d=f[u],m=buildNodeWithSN(d,{doc:r,map:n,skipChild:!1,hackCss:s,afterAppend:l});m?(d.isShadow&&isElement(c)&&c.shadowRoot?c.shadowRoot.appendChild(m):c.appendChild(m),l&&l(m)):console.warn("Failed to rebuild",d)}return c}function visit(e,t){for(var r in e)e[r]&&(n=e[r],t(n));var n}function handleScroll(e){var t=e.__sn;if(t.type===NodeType.Element){var r=e;for(var n in t.attributes)if(t.attributes.hasOwnProperty(n)&&n.startsWith("rr_")){var a=t.attributes[n];"rr_scrollLeft"===n&&(r.scrollLeft=a),"rr_scrollTop"===n&&(r.scrollTop=a)}}}function rebuild(e,t){var r=t.doc,n=t.onVisit,a=t.hackCss,o={},i=buildNodeWithSN(e,{doc:r,map:o,skipChild:!1,hackCss:void 0===a||a,afterAppend:t.afterAppend});return visit(o,function(e){n&&n(e),handleScroll(e)}),[i,o]}export{snapshot,serializeNodeWithId,rebuild,buildNodeWithSN,addHoverClass,transformAttribute,visitSnapshot,cleanupSnapshot,needMaskingText,IGNORED_NODE,NodeType,isElement,isShadowRoot};
var NodeType;function isElement(e){return e.nodeType===e.ELEMENT_NODE}function isShadowRoot(e){var t,r=null===(t=e)||void 0===t?void 0:t.host;return Boolean(r&&r.shadowRoot&&r.shadowRoot===e)}!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,tagNameRegex=RegExp("[^a-z0-9-_:]"),IGNORED_NODE=-2;function genId(){return _id++}function getValidTagName(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return tagNameRegex.test(t)?"div":t}function getCssRulesString(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(getCssRuleString).join(""):null}catch(e){return null}}function getCssRuleString(e){return isCSSImportRule(e)?getCssRulesString(e.styleSheet)||"":e.cssText}function isCSSImportRule(e){return"styleSheet"in e}function extractOrigin(e){return(e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0]).split("?")[0]}var URL_IN_CSS_REF=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,RELATIVE_PATH=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,DATA_URI=/^(data:)([^,]*),(.*)/i;function absoluteToStylesheet(e,t){return(e||"").replace(URL_IN_CSS_REF,function(e,r,n,a,i,o){var s=n||i||o,l=r||a||"";if(!s)return e;if(!RELATIVE_PATH.test(s))return"url("+l+s+l+")";if(DATA_URI.test(s))return"url("+l+s+l+")";if("/"===s[0])return"url("+l+(extractOrigin(t)+s)+l+")";var c=t.split("/"),u=s.split("/");c.pop();for(var f=0,d=u;f<d.length;f++){var m=d[f];"."!==m&&(".."===m?c.pop():c.push(m))}return"url("+l+c.join("/")+l+")"})}var SRCSET_NOT_SPACES=/^[^ \t\n\r\u000c]+/,SRCSET_COMMAS_OR_SPACES=/^[, \t\n\r\u000c]+/;function getAbsoluteSrcsetString(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,a=e.exec(t.substring(r));return a?(n=a[0],r+=n.length,n):""}for(var a=[];n(SRCSET_COMMAS_OR_SPACES),!(r>=t.length);){var i=n(SRCSET_NOT_SPACES);if(","===i.slice(-1))i=absoluteToDoc(e,i.substring(0,i.length-1)),a.push(i);else{var o="";i=absoluteToDoc(e,i);for(var s=!1;;){var l=t.charAt(r);if(""===l){a.push((i+o).trim());break}if(s)")"===l&&(s=!1);else{if(","===l){r+=1,a.push((i+o).trim());break}"("===l&&(s=!0)}o+=l,r+=1}}}return a.join(", ")}function absoluteToDoc(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function isSVGElement(e){return"svg"===e.tagName||e instanceof SVGElement}function getHref(){var e=document.createElement("a");return e.href="",e.href}function transformAttribute(e,t,r,n){return"src"===r||("href"===r||"xlink:href"===r)&&n?absoluteToDoc(e,n):"background"!==r||!n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r&&n?getAbsoluteSrcsetString(e,n):"style"===r&&n?absoluteToStylesheet(n,getHref()):n:absoluteToDoc(e,n)}function _isBlockedElement(e,t,r){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=0;n<e.classList.length;n++){var a=e.classList[n];if(t.test(a))return!0}return!!r&&e.matches(r)}function needMaskingText(e,t,r){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if("string"==typeof t){if(e.classList.contains(t))return!0}else e.classList.forEach(function(e){if(t.test(e))return!0});return!(!r||!e.matches(r))||needMaskingText(e.parentNode,t,r)}return e.nodeType,e.TEXT_NODE,needMaskingText(e.parentNode,t,r)}function onceIframeLoaded(e,t,r){var n=e.contentWindow;if(n){var a,i=!1;try{a=n.document.readyState}catch(e){return}if("complete"===a){"about:blank"===n.location.href&&"about:blank"!==e.src&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0)}else{var o=setTimeout(function(){i||(t(),i=!0)},r);e.addEventListener("load",function(){clearTimeout(o),i=!0,t()})}}}function serializeNode(e,t){var r,n=t.doc,a=t.blockClass,i=t.blockSelector,o=t.maskTextClass,s=t.maskTextSelector,l=t.inlineStylesheet,c=t.maskInputOptions,u=void 0===c?{}:c,f=t.maskTextFn,d=t.recordCanvas,m=t.keepIframeSrcFn;if(n.__sn){var p=n.__sn.id;r=1===p?void 0:p}switch(e.nodeType){case e.DOCUMENT_NODE:return{type:NodeType.Document,childNodes:[],rootId:r};case e.DOCUMENT_TYPE_NODE:return{type:NodeType.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:r};case e.ELEMENT_NODE:for(var h=_isBlockedElement(e,a,i),v=getValidTagName(e),g={},y=0,T=Array.from(e.attributes);y<T.length;y++){var E=T[y],S=E.name,b=E.value;g[S]=transformAttribute(n,v,S,b)}if("link"===v&&l){var N,C=Array.from(n.styleSheets).find(function(t){return t.href===e.href});(N=getCssRulesString(C))&&(delete g.rel,delete g.href,g._cssText=absoluteToStylesheet(N,C.href))}if("style"===v&&e.sheet&&!(e.innerText||e.textContent||"").trim().length)(N=getCssRulesString(e.sheet))&&(g._cssText=absoluteToStylesheet(N,getHref()));if("input"===v||"textarea"===v||"select"===v){b=e.value;"radio"!==g.type&&"checkbox"!==g.type&&"submit"!==g.type&&"button"!==g.type&&b?g.value=u[g.type]||u[v]?"*".repeat(b.length):b:e.checked&&(g.checked=e.checked)}if("option"===v){var x=e.parentElement;g.value===x.value&&(g.selected=e.selected)}if("canvas"===v&&d&&(g.rr_dataURL=e.toDataURL()),"audio"!==v&&"video"!==v||(g.rr_mediaState=e.paused?"paused":"played",g.rr_mediaCurrentTime=e.currentTime),e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop),h){var k=e.getBoundingClientRect(),w=k.width,I=k.height;g={class:g.class,rr_width:w+"px",rr_height:I+"px"}}return"iframe"!==v||m(g.src)||delete g.src,{type:NodeType.Element,tagName:v,attributes:g,childNodes:[],isSVG:isSVGElement(e)||void 0,needBlock:h,rootId:r};case e.TEXT_NODE:var _=e.parentNode&&e.parentNode.tagName,O=e.textContent,R="STYLE"===_||void 0,D="SCRIPT"===_||void 0;return R&&O&&(O=absoluteToStylesheet(O,getHref())),D&&(O="SCRIPT_PLACEHOLDER"),!R&&!D&&needMaskingText(e,o,s)&&O&&(O=f?f(O):O.replace(/[\S]/g,"*")),{type:NodeType.Text,textContent:O||"",isStyle:R,rootId:r};case e.CDATA_SECTION_NODE:return{type:NodeType.CDATA,textContent:"",rootId:r};case e.COMMENT_NODE:return{type:NodeType.Comment,textContent:e.textContent||"",rootId:r};default:return!1}}function lowerIfExists(e){return void 0===e?"":e.toLowerCase()}function slimDOMExcluded(e,t){if(t.comment&&e.type===NodeType.Comment)return!0;if(e.type===NodeType.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&"preload"===e.attributes.rel&&"script"===e.attributes.as))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(lowerIfExists(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===lowerIfExists(e.attributes.name)||"icon"===lowerIfExists(e.attributes.rel)||"apple-touch-icon"===lowerIfExists(e.attributes.rel)||"shortcut icon"===lowerIfExists(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&lowerIfExists(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(lowerIfExists(e.attributes.property).match(/^(og|twitter|fb):/)||lowerIfExists(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===lowerIfExists(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===lowerIfExists(e.attributes.name)||"googlebot"===lowerIfExists(e.attributes.name)||"bingbot"===lowerIfExists(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===lowerIfExists(e.attributes.name)||"generator"===lowerIfExists(e.attributes.name)||"framework"===lowerIfExists(e.attributes.name)||"publisher"===lowerIfExists(e.attributes.name)||"progid"===lowerIfExists(e.attributes.name)||lowerIfExists(e.attributes.property).match(/^article:/)||lowerIfExists(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===lowerIfExists(e.attributes.name)||"yandex-verification"===lowerIfExists(e.attributes.name)||"csrf-token"===lowerIfExists(e.attributes.name)||"p:domain_verify"===lowerIfExists(e.attributes.name)||"verify-v1"===lowerIfExists(e.attributes.name)||"verification"===lowerIfExists(e.attributes.name)||"shopify-checkout-api-token"===lowerIfExists(e.attributes.name)))return!0}}return!1}function serializeNodeWithId(e,t){var r,n=t.doc,a=t.map,i=t.blockClass,o=t.blockSelector,s=t.maskTextClass,l=t.maskTextSelector,c=t.skipChild,u=void 0!==c&&c,f=t.inlineStylesheet,d=void 0===f||f,m=t.maskInputOptions,p=void 0===m?{}:m,h=t.maskTextFn,v=t.slimDOMOptions,g=t.recordCanvas,y=void 0!==g&&g,T=t.onSerialize,E=t.onIframeLoad,S=t.iframeLoadTimeout,b=void 0===S?5e3:S,N=t.keepIframeSrcFn,C=void 0===N?function(){return!1}:N,x=t.preserveWhiteSpace,k=void 0===x||x,w=serializeNode(e,{doc:n,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:l,inlineStylesheet:d,maskInputOptions:p,maskTextFn:h,recordCanvas:y,keepIframeSrcFn:C});if(!w)return console.warn(e,"not serialized"),null;r="__sn"in e?e.__sn.id:slimDOMExcluded(w,v)||!k&&w.type===NodeType.Text&&!w.isStyle&&!w.textContent.replace(/^\s+|\s+$/gm,"").length?IGNORED_NODE:genId();var I=Object.assign(w,{id:r});if(e.__sn=I,r===IGNORED_NODE)return null;a[r]=e,T&&T(e);var _=!u;if(I.type===NodeType.Element&&(_=_&&!I.needBlock,delete I.needBlock),(I.type===NodeType.Document||I.type===NodeType.Element)&&_){v.headWhitespace&&w.type===NodeType.Element&&"head"===w.tagName&&(k=!1);for(var O={doc:n,map:a,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:l,skipChild:u,inlineStylesheet:d,maskInputOptions:p,maskTextFn:h,slimDOMOptions:v,recordCanvas:y,preserveWhiteSpace:k,onSerialize:T,onIframeLoad:E,iframeLoadTimeout:b,keepIframeSrcFn:C},R=0,D=Array.from(e.childNodes);R<D.length;R++){(M=serializeNodeWithId(D[R],O))&&I.childNodes.push(M)}if(isElement(e)&&e.shadowRoot){I.isShadowHost=!0;for(var A=0,L=Array.from(e.shadowRoot.childNodes);A<L.length;A++){var M;(M=serializeNodeWithId(L[A],O))&&(M.isShadow=!0,I.childNodes.push(M))}}}return e.parentNode&&isShadowRoot(e.parentNode)&&(I.isShadow=!0),I.type===NodeType.Element&&"iframe"===I.tagName&&onceIframeLoaded(e,function(){var t=e.contentDocument;if(t&&E){var r=serializeNodeWithId(t,{doc:t,map:a,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:l,skipChild:!1,inlineStylesheet:d,maskInputOptions:p,maskTextFn:h,slimDOMOptions:v,recordCanvas:y,preserveWhiteSpace:k,onSerialize:T,onIframeLoad:E,iframeLoadTimeout:b,keepIframeSrcFn:C});r&&E(e,r)}},b),I}function snapshot(e,t){var r=t||{},n=r.blockClass,a=void 0===n?"rr-block":n,i=r.blockSelector,o=void 0===i?null:i,s=r.maskTextClass,l=void 0===s?"rr-mask":s,c=r.maskTextSelector,u=void 0===c?null:c,f=r.inlineStylesheet,d=void 0===f||f,m=r.recordCanvas,p=void 0!==m&&m,h=r.maskAllInputs,v=void 0!==h&&h,g=r.maskTextFn,y=r.slimDOM,T=void 0!==y&&y,E=r.preserveWhiteSpace,S=r.onSerialize,b=r.onIframeLoad,N=r.iframeLoadTimeout,C=r.keepIframeSrcFn,x={};return[serializeNodeWithId(e,{doc:e,map:x,blockClass:a,blockSelector:o,maskTextClass:l,maskTextSelector:u,skipChild:!1,inlineStylesheet:d,maskInputOptions:!0===v?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===v?{password:!0}:v,maskTextFn:g,slimDOMOptions:!0===T||"all"===T?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===T,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===T?{}:T,recordCanvas:p,preserveWhiteSpace:E,onSerialize:S,onIframeLoad:b,iframeLoadTimeout:N,keepIframeSrcFn:void 0===C?function(){return!1}:C}),x]}function visitSnapshot(e,t){!function e(r){t(r),r.type!==NodeType.Document&&r.type!==NodeType.Element||r.childNodes.forEach(e)}(e)}function cleanupSnapshot(){_id=1}var commentre=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function parse(e,t){void 0===t&&(t={});var r=1,n=1;function a(e){var t=e.match(/\n/g);t&&(r+=t.length);var a=e.lastIndexOf("\n");n=-1===a?n+e.length:e.length-a}function i(){var e={line:r,column:n};return function(t){return t.position=new o(e),m(),t}}var o=function(){return function(e){this.start=e,this.end={line:r,column:n},this.source=t.source}}();o.prototype.content=e;var s=[];function l(a){var i=new Error(t.source+":"+r+":"+n+": "+a);if(i.reason=a,i.filename=t.source,i.line=r,i.column=n,i.source=e,!t.silent)throw i;s.push(i)}function c(){return d(/^{\s*/)}function u(){return d(/^}/)}function f(){var t,r=[];for(m(),p(r);e.length&&"}"!==e.charAt(0)&&(t=x()||k());)!1!==t&&(r.push(t),p(r));return r}function d(t){var r=t.exec(e);if(r){var n=r[0];return a(n),e=e.slice(n.length),r}}function m(){d(/^\s*/)}function p(e){var t;for(void 0===e&&(e=[]);t=h();)!1!==t&&e.push(t),t=h();return e}function h(){var t=i();if("/"===e.charAt(0)&&"*"===e.charAt(1)){for(var r=2;""!==e.charAt(r)&&("*"!==e.charAt(r)||"/"!==e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return l("End of comment missing");var o=e.slice(2,r-2);return n+=2,a(o),e=e.slice(r),n+=2,t({type:"comment",comment:o})}}function v(){var e=d(/^([^{]+)/);if(e)return trim(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(e){return e.replace(/,/g,"‌")}).split(/\s*(?![^(]*\)),\s*/).map(function(e){return e.replace(/\u200C/g,",")})}function g(){var e=i(),t=d(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=trim(t[0]);if(!d(/^:\s*/))return l("property missing ':'");var n=d(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),a=e({type:"declaration",property:r.replace(commentre,""),value:n?trim(n[0]).replace(commentre,""):""});return d(/^[;\s]*/),a}}function y(){var e,t=[];if(!c())return l("missing '{'");for(p(t);e=g();)!1!==e&&(t.push(e),p(t)),e=g();return u()?t:l("missing '}'")}function T(){for(var e,t=[],r=i();e=d(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),d(/^,\s*/);if(t.length)return r({type:"keyframe",values:t,declarations:y()})}var E,S=C("import"),b=C("charset"),N=C("namespace");function C(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=i(),n=d(t);if(n){var a={type:e};return a[e]=n[1].trim(),r(a)}}}function x(){if("@"===e[0])return function(){var e=i(),t=d(/^@([-\w]+)?keyframes\s*/);if(t){var r=t[1];if(!(t=d(/^([-\w]+)\s*/)))return l("@keyframes missing name");var n,a=t[1];if(!c())return l("@keyframes missing '{'");for(var o=p();n=T();)o.push(n),o=o.concat(p());return u()?e({type:"keyframes",name:a,vendor:r,keyframes:o}):l("@keyframes missing '}'")}}()||function(){var e=i(),t=d(/^@media *([^{]+)/);if(t){var r=trim(t[1]);if(!c())return l("@media missing '{'");var n=p().concat(f());return u()?e({type:"media",media:r,rules:n}):l("@media missing '}'")}}()||function(){var e=i(),t=d(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:trim(t[1]),media:trim(t[2])})}()||function(){var e=i(),t=d(/^@supports *([^{]+)/);if(t){var r=trim(t[1]);if(!c())return l("@supports missing '{'");var n=p().concat(f());return u()?e({type:"supports",supports:r,rules:n}):l("@supports missing '}'")}}()||S()||b()||N()||function(){var e=i(),t=d(/^@([-\w]+)?document *([^{]+)/);if(t){var r=trim(t[1]),n=trim(t[2]);if(!c())return l("@document missing '{'");var a=p().concat(f());return u()?e({type:"document",document:n,vendor:r,rules:a}):l("@document missing '}'")}}()||function(){var e=i();if(d(/^@page */)){var t=v()||[];if(!c())return l("@page missing '{'");for(var r,n=p();r=g();)n.push(r),n=n.concat(p());return u()?e({type:"page",selectors:t,declarations:n}):l("@page missing '}'")}}()||function(){var e=i();if(d(/^@host\s*/)){if(!c())return l("@host missing '{'");var t=p().concat(f());return u()?e({type:"host",rules:t}):l("@host missing '}'")}}()||function(){var e=i();if(d(/^@font-face\s*/)){if(!c())return l("@font-face missing '{'");for(var t,r=p();t=g();)r.push(t),r=r.concat(p());return u()?e({type:"font-face",declarations:r}):l("@font-face missing '}'")}}()}function k(){var e=i(),t=v();return t?(p(),e({type:"rule",selectors:t,declarations:y()})):l("selector missing")}return addParent((E=f(),{type:"stylesheet",stylesheet:{source:t.source,rules:E,parsingErrors:s}}))}function trim(e){return e?e.replace(/^\s+|\s+$/g,""):""}function addParent(e,t){for(var r=e&&"string"==typeof e.type,n=r?e:t,a=0,i=Object.keys(e);a<i.length;a++){var o=e[i[a]];Array.isArray(o)?o.forEach(function(e){addParent(e,n)}):o&&"object"==typeof o&&addParent(o,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var tagMap={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function getTagName(e){var t=tagMap[e.tagName]?tagMap[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}function escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var HOVER_SELECTOR=/([^\\]):hover/,HOVER_SELECTOR_GLOBAL=new RegExp(HOVER_SELECTOR,"g");function addHoverClass(e){var t=parse(e,{silent:!0});if(!t.stylesheet)return e;var r=[];if(t.stylesheet.rules.forEach(function(e){"selectors"in e&&(e.selectors||[]).forEach(function(e){HOVER_SELECTOR.test(e)&&r.push(e)})}),0===r.length)return e;var n=new RegExp(r.filter(function(e,t){return r.indexOf(e)===t}).sort(function(e,t){return t.length-e.length}).map(function(e){return escapeRegExp(e)}).join("|"),"g");return e.replace(n,function(e){var t=e.replace(HOVER_SELECTOR_GLOBAL,"$1.\\:hover");return e+", "+t})}function buildNode(e,t){var r=t.doc,n=t.hackCss;switch(e.type){case NodeType.Document:return r.implementation.createDocument(null,"",null);case NodeType.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case NodeType.Element:var a,i=getTagName(e);a=e.isSVG?r.createElementNS("http://www.w3.org/2000/svg",i):r.createElement(i);var o=function(t){if(!e.attributes.hasOwnProperty(t))return"continue";var o=e.attributes[t];if(o="boolean"==typeof o||"number"==typeof o?"":o,t.startsWith("rr_")){if("canvas"===i&&"rr_dataURL"===t){var s=document.createElement("img");s.src=o,s.onload=function(){var e=a.getContext("2d");e&&e.drawImage(s,0,0,s.width,s.height)}}if("rr_width"===t&&(a.style.width=o),"rr_height"===t&&(a.style.height=o),"rr_mediaCurrentTime"===t&&(a.currentTime=e.attributes.rr_mediaCurrentTime),"rr_mediaState"===t)switch(o){case"played":a.play().catch(function(e){return console.warn("media playback error",e)});break;case"paused":a.pause()}}else{var l="textarea"===i&&"value"===t,c="style"===i&&"_cssText"===t;if(c&&n&&(o=addHoverClass(o)),l||c){for(var u=r.createTextNode(o),f=0,d=Array.from(a.childNodes);f<d.length;f++){var m=d[f];m.nodeType===a.TEXT_NODE&&a.removeChild(m)}return a.appendChild(u),"continue"}try{if(e.isSVG&&"xlink:href"===t)a.setAttributeNS("http://www.w3.org/1999/xlink",t,o);else if("onload"===t||"onclick"===t||"onmouse"===t.substring(0,7))a.setAttribute("_"+t,o);else{if("meta"===i&&"Content-Security-Policy"===e.attributes["http-equiv"]&&"content"==t)return a.setAttribute("csp-content",o),"continue";a.setAttribute(t,o)}}catch(e){}}};for(var s in e.attributes)o(s);if(e.isShadowHost)if(a.shadowRoot)for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);else a.attachShadow({mode:"open"});return a;case NodeType.Text:return r.createTextNode(e.isStyle&&n?addHoverClass(e.textContent):e.textContent);case NodeType.CDATA:return r.createCDATASection(e.textContent);case NodeType.Comment:return r.createComment(e.textContent);default:return null}}function buildNodeWithSN(e,t){var r=t.doc,n=t.map,a=t.skipChild,i=void 0!==a&&a,o=t.hackCss,s=void 0===o||o,l=t.afterAppend,c=buildNode(e,{doc:r,hackCss:s});if(!c)return null;if(e.rootId&&console.assert(n[e.rootId]===r,"Target document should has the same root id."),e.type===NodeType.Document&&(r.close(),r.open(),c=r),c.__sn=e,n[e.id]=c,(e.type===NodeType.Document||e.type===NodeType.Element)&&!i)for(var u=0,f=e.childNodes;u<f.length;u++){var d=f[u],m=buildNodeWithSN(d,{doc:r,map:n,skipChild:!1,hackCss:s,afterAppend:l});m?(d.isShadow&&isElement(c)&&c.shadowRoot?c.shadowRoot.appendChild(m):c.appendChild(m),l&&l(m)):console.warn("Failed to rebuild",d)}return c}function visit(e,t){for(var r in e)e[r]&&(n=e[r],t(n));var n}function handleScroll(e){var t=e.__sn;if(t.type===NodeType.Element){var r=e;for(var n in t.attributes)if(t.attributes.hasOwnProperty(n)&&n.startsWith("rr_")){var a=t.attributes[n];"rr_scrollLeft"===n&&(r.scrollLeft=a),"rr_scrollTop"===n&&(r.scrollTop=a)}}}function rebuild(e,t){var r=t.doc,n=t.onVisit,a=t.hackCss,i={},o=buildNodeWithSN(e,{doc:r,map:i,skipChild:!1,hackCss:void 0===a||a,afterAppend:t.afterAppend});return visit(i,function(e){n&&n(e),handleScroll(e)}),[o,i]}export{snapshot,serializeNodeWithId,rebuild,buildNodeWithSN,addHoverClass,transformAttribute,visitSnapshot,cleanupSnapshot,needMaskingText,IGNORED_NODE,NodeType,isElement,isShadowRoot};
//# sourceMappingURL=rrweb-snapshot.min.js.map

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

function serializeNode(n, options) {
var doc = options.doc, blockClass = options.blockClass, blockSelector = options.blockSelector, maskTextClass = options.maskTextClass, maskTextSelector = options.maskTextSelector, inlineStylesheet = options.inlineStylesheet, _a = options.maskInputOptions, maskInputOptions = _a === void 0 ? {} : _a, maskTextFn = options.maskTextFn, recordCanvas = options.recordCanvas;
var doc = options.doc, blockClass = options.blockClass, blockSelector = options.blockSelector, maskTextClass = options.maskTextClass, maskTextSelector = options.maskTextSelector, inlineStylesheet = options.inlineStylesheet, _a = options.maskInputOptions, maskInputOptions = _a === void 0 ? {} : _a, maskTextFn = options.maskTextFn, recordCanvas = options.recordCanvas, keepIframeSrcFn = options.keepIframeSrcFn;
var rootId;

@@ -366,2 +366,3 @@ if (doc.__sn) {

: 'played';
attributes_1.rr_mediaCurrentTime = n.currentTime;
}

@@ -382,3 +383,3 @@ if (n.scrollLeft) {

}
if (tagName === 'iframe') {
if (tagName === 'iframe' && !keepIframeSrcFn(attributes_1.src)) {
delete attributes_1.src;

@@ -512,4 +513,4 @@ }

function serializeNodeWithId(n, options) {
var doc = options.doc, map = options.map, blockClass = options.blockClass, blockSelector = options.blockSelector, maskTextClass = options.maskTextClass, maskTextSelector = options.maskTextSelector, _a = options.skipChild, skipChild = _a === void 0 ? false : _a, _b = options.inlineStylesheet, inlineStylesheet = _b === void 0 ? true : _b, _c = options.maskInputOptions, maskInputOptions = _c === void 0 ? {} : _c, maskTextFn = options.maskTextFn, slimDOMOptions = options.slimDOMOptions, _d = options.recordCanvas, recordCanvas = _d === void 0 ? false : _d, onSerialize = options.onSerialize, onIframeLoad = options.onIframeLoad, _e = options.iframeLoadTimeout, iframeLoadTimeout = _e === void 0 ? 5000 : _e;
var _f = options.preserveWhiteSpace, preserveWhiteSpace = _f === void 0 ? true : _f;
var doc = options.doc, map = options.map, blockClass = options.blockClass, blockSelector = options.blockSelector, maskTextClass = options.maskTextClass, maskTextSelector = options.maskTextSelector, _a = options.skipChild, skipChild = _a === void 0 ? false : _a, _b = options.inlineStylesheet, inlineStylesheet = _b === void 0 ? true : _b, _c = options.maskInputOptions, maskInputOptions = _c === void 0 ? {} : _c, maskTextFn = options.maskTextFn, slimDOMOptions = options.slimDOMOptions, _d = options.recordCanvas, recordCanvas = _d === void 0 ? false : _d, onSerialize = options.onSerialize, onIframeLoad = options.onIframeLoad, _e = options.iframeLoadTimeout, iframeLoadTimeout = _e === void 0 ? 5000 : _e, _f = options.keepIframeSrcFn, keepIframeSrcFn = _f === void 0 ? function () { return false; } : _f;
var _g = options.preserveWhiteSpace, preserveWhiteSpace = _g === void 0 ? true : _g;
var _serializedNode = serializeNode(n, {

@@ -525,2 +526,3 @@ doc: doc,

recordCanvas: recordCanvas,
keepIframeSrcFn: keepIframeSrcFn,
});

@@ -584,5 +586,6 @@ if (!_serializedNode) {

iframeLoadTimeout: iframeLoadTimeout,
keepIframeSrcFn: keepIframeSrcFn,
};
for (var _i = 0, _g = Array.from(n.childNodes); _i < _g.length; _i++) {
var childN = _g[_i];
for (var _i = 0, _h = Array.from(n.childNodes); _i < _h.length; _i++) {
var childN = _h[_i];
var serializedChildNode = serializeNodeWithId(childN, bypassOptions);

@@ -595,4 +598,4 @@ if (serializedChildNode) {

serializedNode.isShadowHost = true;
for (var _h = 0, _j = Array.from(n.shadowRoot.childNodes); _h < _j.length; _h++) {
var childN = _j[_h];
for (var _j = 0, _k = Array.from(n.shadowRoot.childNodes); _j < _k.length; _j++) {
var childN = _k[_j];
var serializedChildNode = serializeNodeWithId(childN, bypassOptions);

@@ -631,2 +634,3 @@ if (serializedChildNode) {

iframeLoadTimeout: iframeLoadTimeout,
keepIframeSrcFn: keepIframeSrcFn,
});

@@ -642,3 +646,3 @@ if (serializedIframeNode) {

function snapshot(n, options) {
var _a = options || {}, _b = _a.blockClass, blockClass = _b === void 0 ? 'rr-block' : _b, _c = _a.blockSelector, blockSelector = _c === void 0 ? null : _c, _d = _a.maskTextClass, maskTextClass = _d === void 0 ? 'rr-mask' : _d, _e = _a.maskTextSelector, maskTextSelector = _e === void 0 ? null : _e, _f = _a.inlineStylesheet, inlineStylesheet = _f === void 0 ? true : _f, _g = _a.recordCanvas, recordCanvas = _g === void 0 ? false : _g, _h = _a.maskAllInputs, maskAllInputs = _h === void 0 ? false : _h, maskTextFn = _a.maskTextFn, _j = _a.slimDOM, slimDOM = _j === void 0 ? false : _j, preserveWhiteSpace = _a.preserveWhiteSpace, onSerialize = _a.onSerialize, onIframeLoad = _a.onIframeLoad, iframeLoadTimeout = _a.iframeLoadTimeout;
var _a = options || {}, _b = _a.blockClass, blockClass = _b === void 0 ? 'rr-block' : _b, _c = _a.blockSelector, blockSelector = _c === void 0 ? null : _c, _d = _a.maskTextClass, maskTextClass = _d === void 0 ? 'rr-mask' : _d, _e = _a.maskTextSelector, maskTextSelector = _e === void 0 ? null : _e, _f = _a.inlineStylesheet, inlineStylesheet = _f === void 0 ? true : _f, _g = _a.recordCanvas, recordCanvas = _g === void 0 ? false : _g, _h = _a.maskAllInputs, maskAllInputs = _h === void 0 ? false : _h, maskTextFn = _a.maskTextFn, _j = _a.slimDOM, slimDOM = _j === void 0 ? false : _j, preserveWhiteSpace = _a.preserveWhiteSpace, onSerialize = _a.onSerialize, onIframeLoad = _a.onIframeLoad, iframeLoadTimeout = _a.iframeLoadTimeout, _k = _a.keepIframeSrcFn, keepIframeSrcFn = _k === void 0 ? function () { return false; } : _k;
var idNodeMap = {};

@@ -704,2 +708,3 @@ var maskInputOptions = maskAllInputs === true

iframeLoadTimeout: iframeLoadTimeout,
keepIframeSrcFn: keepIframeSrcFn,
}),

@@ -1285,5 +1290,2 @@ idNodeMap,

}
if (tagName === 'iframe' && name === 'src') {
return "continue";
}
try {

@@ -1328,6 +1330,13 @@ if (n.isSVG && name === 'xlink:href') {

}
if (name === 'rr_mediaCurrentTime') {
node_1.currentTime = n.attributes
.rr_mediaCurrentTime;
}
if (name === 'rr_mediaState') {
switch (value) {
case 'played':
node_1.play();
node_1
.play()
.catch(function (e) { return console.warn('media playback error', e); });
break;
case 'paused':

@@ -1334,0 +1343,0 @@ node_1.pause();

{
"name": "rrweb-snapshot",
"version": "1.1.4",
"version": "1.1.5",
"description": "rrweb's component to take a snapshot of DOM, aka DOM serializer",

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

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

import { serializedNodeWithId, INode, idNodeMap, MaskInputOptions, SlimDOMOptions, MaskTextFn } from './types';
import { serializedNodeWithId, INode, idNodeMap, MaskInputOptions, SlimDOMOptions, MaskTextFn, KeepIframeSrcFn } from './types';
export declare const IGNORED_NODE = -2;

@@ -20,2 +20,3 @@ export declare function absoluteToStylesheet(cssText: string | null, href: string): string;

slimDOMOptions: SlimDOMOptions;
keepIframeSrcFn?: KeepIframeSrcFn;
recordCanvas?: boolean;

@@ -41,2 +42,3 @@ preserveWhiteSpace?: boolean;

iframeLoadTimeout?: number;
keepIframeSrcFn?: KeepIframeSrcFn;
}): [serializedNodeWithId | null, idNodeMap];

@@ -43,0 +45,0 @@ export declare function visitSnapshot(node: serializedNodeWithId, onVisit: (node: serializedNodeWithId) => unknown): void;

@@ -91,1 +91,2 @@ export declare enum NodeType {

export declare type MaskTextFn = (text: string) => string;
export declare type KeepIframeSrcFn = (src: string) => boolean;

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