rrweb-snapshot
Advanced tools
Comparing version 2.0.0-alpha.9 to 2.0.0-alpha.10
@@ -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=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function a(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function o(e){try{var t=e.rules||e.cssRules;return t?((r=Array.from(t).map(i).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),r):null}catch(e){return null}var r}function i(e){var t=e.cssText;if(s(e))try{t=o(e.styleSheet)||t}catch(e){}return t}function s(e){return"styleSheet"in e}e.NodeType=void 0,(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 c=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var r=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=r?r:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,r=this.getId(e);this.idNodeMap.delete(r),e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){var r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function l(e){var t=e.element,r=e.maskInputOptions,n=e.tagName,a=e.type,o=e.value,i=e.maskInputFn,s=o||"",c=a&&u(a);return(r[n.toLowerCase()]||c&&r[c])&&(s=i?i(s,t):"*".repeat(s.length)),s}function u(e){return e.toLowerCase()}var d="__rrweb_original__";function p(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;r<e.width;r+=50)for(var n=0;n<e.height;n+=50){var a=t.getImageData,o=d in a?a.__rrweb_original__:a;if(new Uint32Array(o.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((function(e){return 0!==e})))return!1}return!0}function f(t,r){return!(!t||!r||t.type!==r.type)&&(t.type===e.NodeType.Document?t.compatMode===r.compatMode:t.type===e.NodeType.DocumentType?t.name===r.name&&t.publicId===r.publicId&&t.systemId===r.systemId:t.type===e.NodeType.Comment||t.type===e.NodeType.Text||t.type===e.NodeType.CDATA?t.textContent===r.textContent:t.type===e.NodeType.Element&&(t.tagName===r.tagName&&JSON.stringify(t.attributes)===JSON.stringify(r.attributes)&&t.isSVG===r.isSVG&&t.needBlock===r.needBlock))}function m(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?u(t):null}var h,v,y=1,g=new RegExp("[^a-z0-9-_:]");function T(){return y++}var b=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,k=/^(?:[a-z+]+:)?\/\//i,N=/^www\..*/i,C=/^(data:)([^,]*),(.*)/i;function S(e,t){return(e||"").replace(b,(function(e,r,n,a,o,i){var s,c=n||o||i,l=r||a||"";if(!c)return e;if(k.test(c)||N.test(c))return"url(".concat(l).concat(c).concat(l,")");if(C.test(c))return"url(".concat(l).concat(c).concat(l,")");if("/"===c[0])return"url(".concat(l).concat((s=t,(s.indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+c)).concat(l,")");var u=t.split("/"),d=c.split("/");u.pop();for(var p=0,f=d;p<f.length;p++){var m=f[p];"."!==m&&(".."===m?u.pop():u.push(m))}return"url(".concat(l).concat(u.join("/")).concat(l,")")}))}var w=/^[^ \t\n\r\u000c]+/,x=/^[, \t\n\r\u000c]+/;function E(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function I(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function L(){var e=document.createElement("a");return e.href="",e.href}function M(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?E(e,n):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?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(x),!(r>=t.length);){var o=n(w);if(","===o.slice(-1))o=E(e,o.substring(0,o.length-1)),a.push(o);else{var i="";o=E(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?S(n,L()):"object"===t&&"data"===r?E(e,n):n:E(e,n):n}function O(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function D(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&D(e.parentNode,t,r);for(var n=e.classList.length;n--;){var a=e.classList[n];if(t.test(a))return!0}return!!r&&D(e.parentNode,t,r)}function _(e,t,r){try{var n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===n)return!1;if("string"==typeof t){if(n.classList.contains(t))return!0;if(n.closest(".".concat(t)))return!0}else if(D(n,t,!0))return!0;if(r){if(n.matches(r))return!0;if(n.closest(r))return!0}}catch(e){}return!1}function A(t,r){var n=r.doc,a=r.mirror,i=r.blockClass,s=r.blockSelector,c=r.maskTextClass,d=r.maskTextSelector,f=r.inlineStylesheet,y=r.maskInputOptions,T=void 0===y?{}:y,b=r.maskTextFn,k=r.maskInputFn,N=r.dataURLOptions,C=void 0===N?{}:N,w=r.inlineImages,x=r.recordCanvas,E=r.keepIframeSrcFn,D=r.newlyAddedElement,A=void 0!==D&&D,R=function(e,t){if(!t.hasNode(e))return;var r=t.getId(e);return 1===r?void 0:r}(n,a);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.NodeType.Document,childNodes:[],compatMode:t.compatMode}:{type:e.NodeType.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.NodeType.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:R};case t.ELEMENT_NODE:return function(t,r){for(var n=r.doc,a=r.blockClass,i=r.blockSelector,s=r.inlineStylesheet,c=r.maskInputOptions,d=void 0===c?{}:c,f=r.maskInputFn,y=r.dataURLOptions,T=void 0===y?{}:y,b=r.inlineImages,k=r.recordCanvas,N=r.keepIframeSrcFn,C=r.newlyAddedElement,w=void 0!==C&&C,x=r.rootId,E=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var a=e.classList[n];if(t.test(a))return!0}if(r)return e.matches(r)}catch(e){}return!1}(t,a,i),D=function(e){if(e instanceof HTMLFormElement)return"form";var t=u(e.tagName);return g.test(t)?"div":t}(t),_={},A=t.attributes.length,R=0;R<A;R++){var F=t.attributes[R];O(D,F.name,F.value)||(_[F.name]=M(n,D,u(F.name),F.value))}if("link"===D&&s){var U=Array.from(n.styleSheets).find((function(e){return e.href===t.href})),W=null;U&&(W=o(U)),W&&(delete _.rel,delete _.href,_._cssText=S(W,U.href))}if("style"===D&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){(W=o(t.sheet))&&(_._cssText=S(W,L()))}if("input"===D||"textarea"===D||"select"===D){var j=t.value,B=t.checked;if("radio"!==_.type&&"checkbox"!==_.type&&"submit"!==_.type&&"button"!==_.type&&j){var P=m(t);_.value=l({element:t,type:P,tagName:D,value:j,maskInputOptions:d,maskInputFn:f})}else B&&(_.checked=B)}"option"===D&&(t.selected&&!d.select?_.selected=!0:delete _.selected);if("canvas"===D&&k)if("2d"===t.__context)p(t)||(_.rr_dataURL=t.toDataURL(T.type,T.quality));else if(!("__context"in t)){var G=t.toDataURL(T.type,T.quality),H=document.createElement("canvas");H.width=t.width,H.height=t.height,G!==H.toDataURL(T.type,T.quality)&&(_.rr_dataURL=G)}if("img"===D&&b){h||(h=n.createElement("canvas"),v=h.getContext("2d"));var z=t,V=z.crossOrigin;z.crossOrigin="anonymous";var q=function(){z.removeEventListener("load",q);try{h.width=z.naturalWidth,h.height=z.naturalHeight,v.drawImage(z,0,0),_.rr_dataURL=h.toDataURL(T.type,T.quality)}catch(e){console.warn("Cannot inline img src=".concat(z.currentSrc,"! Error: ").concat(e))}V?_.crossOrigin=V:z.removeAttribute("crossorigin")};z.complete&&0!==z.naturalWidth?q():z.addEventListener("load",q)}"audio"!==D&&"video"!==D||(_.rr_mediaState=t.paused?"paused":"played",_.rr_mediaCurrentTime=t.currentTime);w||(t.scrollLeft&&(_.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(_.rr_scrollTop=t.scrollTop));if(E){var $=t.getBoundingClientRect(),Y=$.width,X=$.height;_={class:_.class,rr_width:"".concat(Y,"px"),rr_height:"".concat(X,"px")}}"iframe"!==D||N(_.src)||(t.contentDocument||(_.rr_src=_.src),delete _.src);return{type:e.NodeType.Element,tagName:D,attributes:_,childNodes:[],isSVG:I(t)||void 0,needBlock:E,rootId:x}}(t,{doc:n,blockClass:i,blockSelector:s,inlineStylesheet:f,maskInputOptions:T,maskInputFn:k,dataURLOptions:C,inlineImages:w,recordCanvas:x,keepIframeSrcFn:E,newlyAddedElement:A,rootId:R});case t.TEXT_NODE:return function(t,r){var n,a=r.maskTextClass,o=r.maskTextSelector,i=r.maskTextFn,s=r.rootId,c=t.parentNode&&t.parentNode.tagName,l=t.textContent,u="STYLE"===c||void 0,d="SCRIPT"===c||void 0;if(u&&l){try{t.nextSibling||t.previousSibling||(null===(n=t.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(l=(p=t.parentNode.sheet).cssRules?Array.from(p.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(e),t)}l=S(l,L())}var p;d&&(l="SCRIPT_PLACEHOLDER");!u&&!d&&l&&_(t,a,o)&&(l=i?i(l):l.replace(/[\S]/g,"*"));return{type:e.NodeType.Text,textContent:l||"",isStyle:u,rootId:s}}(t,{maskTextClass:c,maskTextSelector:d,maskTextFn:b,rootId:R});case t.CDATA_SECTION_NODE:return{type:e.NodeType.CDATA,textContent:"",rootId:R};case t.COMMENT_NODE:return{type:e.NodeType.Comment,textContent:t.textContent||"",rootId:R};default:return!1}}function R(e){return null==e?"":e.toLowerCase()}function F(t,o){var i,s=o.doc,c=o.mirror,l=o.blockClass,u=o.blockSelector,d=o.maskTextClass,p=o.maskTextSelector,f=o.skipChild,m=void 0!==f&&f,h=o.inlineStylesheet,v=void 0===h||h,y=o.maskInputOptions,g=void 0===y?{}:y,b=o.maskTextFn,k=o.maskInputFn,N=o.slimDOMOptions,C=o.dataURLOptions,S=void 0===C?{}:C,w=o.inlineImages,x=void 0!==w&&w,E=o.recordCanvas,I=void 0!==E&&E,L=o.onSerialize,M=o.onIframeLoad,O=o.iframeLoadTimeout,D=void 0===O?5e3:O,_=o.onStylesheetLoad,U=o.stylesheetLoadTimeout,W=void 0===U?5e3:U,j=o.keepIframeSrcFn,B=void 0===j?function(){return!1}:j,P=o.newlyAddedElement,G=void 0!==P&&P,H=o.preserveWhiteSpace,z=void 0===H||H,V=A(t,{doc:s,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:p,inlineStylesheet:v,maskInputOptions:g,maskTextFn:b,maskInputFn:k,dataURLOptions:S,inlineImages:x,recordCanvas:I,keepIframeSrcFn:B,newlyAddedElement:G});if(!V)return console.warn(t,"not serialized"),null;i=c.hasNode(t)?c.getId(t):!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||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")))return!0;if(r.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(R(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===R(t.attributes.name)||"icon"===R(t.attributes.rel)||"apple-touch-icon"===R(t.attributes.rel)||"shortcut icon"===R(t.attributes.rel))))return!0;if("meta"===t.tagName){if(r.headMetaDescKeywords&&R(t.attributes.name).match(/^description|keywords$/))return!0;if(r.headMetaSocial&&(R(t.attributes.property).match(/^(og|twitter|fb):/)||R(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===R(t.attributes.name)))return!0;if(r.headMetaRobots&&("robots"===R(t.attributes.name)||"googlebot"===R(t.attributes.name)||"bingbot"===R(t.attributes.name)))return!0;if(r.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(r.headMetaAuthorship&&("author"===R(t.attributes.name)||"generator"===R(t.attributes.name)||"framework"===R(t.attributes.name)||"publisher"===R(t.attributes.name)||"progid"===R(t.attributes.name)||R(t.attributes.property).match(/^article:/)||R(t.attributes.property).match(/^product:/)))return!0;if(r.headMetaVerification&&("google-site-verification"===R(t.attributes.name)||"yandex-verification"===R(t.attributes.name)||"csrf-token"===R(t.attributes.name)||"p:domain_verify"===R(t.attributes.name)||"verify-v1"===R(t.attributes.name)||"verification"===R(t.attributes.name)||"shopify-checkout-api-token"===R(t.attributes.name)))return!0}}return!1}(V,N)&&(z||V.type!==e.NodeType.Text||V.isStyle||V.textContent.replace(/^\s+|\s+$/gm,"").length)?T():-2;var q=Object.assign(V,{id:i});if(c.add(t,q),-2===i)return null;L&&L(t);var $=!m;if(q.type===e.NodeType.Element){$=$&&!q.needBlock,delete q.needBlock;var Y=t.shadowRoot;Y&&a(Y)&&(q.isShadowHost=!0)}if((q.type===e.NodeType.Document||q.type===e.NodeType.Element)&&$){N.headWhitespace&&q.type===e.NodeType.Element&&"head"===q.tagName&&(z=!1);for(var X={doc:s,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:p,skipChild:m,inlineStylesheet:v,maskInputOptions:g,maskTextFn:b,maskInputFn:k,slimDOMOptions:N,dataURLOptions:S,inlineImages:x,recordCanvas:I,preserveWhiteSpace:z,onSerialize:L,onIframeLoad:M,iframeLoadTimeout:D,onStylesheetLoad:_,stylesheetLoadTimeout:W,keepIframeSrcFn:B},J=0,K=Array.from(t.childNodes);J<K.length;J++){(ee=F(K[J],X))&&q.childNodes.push(ee)}if(r(t)&&t.shadowRoot)for(var Q=0,Z=Array.from(t.shadowRoot.childNodes);Q<Z.length;Q++){var ee;(ee=F(Z[Q],X))&&(a(t.shadowRoot)&&(ee.isShadow=!0),q.childNodes.push(ee))}}return t.parentNode&&n(t.parentNode)&&a(t.parentNode)&&(q.isShadow=!0),q.type===e.NodeType.Element&&"iframe"===q.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){var i="about:blank";if(n.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var s=setTimeout((function(){o||(t(),o=!0)}),r);e.addEventListener("load",(function(){clearTimeout(s),o=!0,t()}))}}}(t,(function(){var e=t.contentDocument;if(e&&M){var r=F(e,{doc:e,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:p,skipChild:!1,inlineStylesheet:v,maskInputOptions:g,maskTextFn:b,maskInputFn:k,slimDOMOptions:N,dataURLOptions:S,inlineImages:x,recordCanvas:I,preserveWhiteSpace:z,onSerialize:L,onIframeLoad:M,iframeLoadTimeout:D,onStylesheetLoad:_,stylesheetLoadTimeout:W,keepIframeSrcFn:B});r&&M(t,r)}}),D),q.type===e.NodeType.Element&&"link"===q.tagName&&"stylesheet"===q.attributes.rel&&function(e,t,r){var n,a=!1;try{n=e.sheet}catch(e){return}if(!n){var o=setTimeout((function(){a||(t(),a=!0)}),r);e.addEventListener("load",(function(){clearTimeout(o),a=!0,t()}))}}(t,(function(){if(_){var e=F(t,{doc:s,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:p,skipChild:!1,inlineStylesheet:v,maskInputOptions:g,maskTextFn:b,maskInputFn:k,slimDOMOptions:N,dataURLOptions:S,inlineImages:x,recordCanvas:I,preserveWhiteSpace:z,onSerialize:L,onIframeLoad:M,iframeLoadTimeout:D,onStylesheetLoad:_,stylesheetLoadTimeout:W,keepIframeSrcFn:B});e&&_(t,e)}}),W),q}var U=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function W(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),f(),t}}var i=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("".concat(t.source||"",":").concat(r,":").concat(n,": ").concat(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 l(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){var t,r=[];for(f(),m(r);e.length&&"}"!==e.charAt(0)&&(t=w()||x());)!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 f(){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 j(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=j(t[0]);if(!p(/^:\s*/))return c("property missing ':'");var n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),a=e({type:"declaration",property:r.replace(U,""),value:n?j(n[0]).replace(U,""):""});return p(/^[;\s]*/),a}}function g(){var e,t=[];if(!l())return c("missing '{'");for(m(t);e=y();)!1!==e&&(t.push(e),m(t)),e=y();return u()?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"),N=S("charset"),C=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(!l())return c("@keyframes missing '{'");for(var i=m();n=T();)i.push(n),i=i.concat(m());return u()?e({type:"keyframes",name:a,vendor:r,keyframes:i}):c("@keyframes missing '}'")}}()||function(){var e=o(),t=p(/^@media *([^{]+)/);if(t){var r=j(t[1]);if(!l())return c("@media missing '{'");var n=m().concat(d());return u()?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:j(t[1]),media:j(t[2])})}()||function(){var e=o(),t=p(/^@supports *([^{]+)/);if(t){var r=j(t[1]);if(!l())return c("@supports missing '{'");var n=m().concat(d());return u()?e({type:"supports",supports:r,rules:n}):c("@supports missing '}'")}}()||k()||N()||C()||function(){var e=o(),t=p(/^@([-\w]+)?document *([^{]+)/);if(t){var r=j(t[1]),n=j(t[2]);if(!l())return c("@document missing '{'");var a=m().concat(d());return u()?e({type:"document",document:n,vendor:r,rules:a}):c("@document missing '}'")}}()||function(){var e=o();if(p(/^@page */)){var t=v()||[];if(!l())return c("@page missing '{'");for(var r,n=m();r=y();)n.push(r),n=n.concat(m());return u()?e({type:"page",selectors:t,declarations:n}):c("@page missing '}'")}}()||function(){var e=o();if(p(/^@host\s*/)){if(!l())return c("@host missing '{'");var t=m().concat(d());return u()?e({type:"host",rules:t}):c("@host missing '}'")}}()||function(){var e=o();if(p(/^@font-face\s*/)){if(!l())return c("@font-face missing '{'");for(var t,r=m();t=y();)r.push(t),r=r.concat(m());return u()?e({type:"font-face",declarations:r}):c("@font-face missing '}'")}}()}function x(){var e=o(),t=v();return t?(m(),e({type:"rule",selectors:t,declarations:g()})):c("selector missing")}return B((b=d(),{type:"stylesheet",stylesheet:{source:t.source,rules:b,parsingErrors:s}}))}function j(e){return e?e.replace(/^\s+|\s+$/g,""):""}function B(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){B(e,n)})):i&&"object"==typeof i&&B(i,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var P={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};var G=/([^\\]):hover/,H=new RegExp(G.source,"g");function z(e,t){var r=null==t?void 0:t.stylesWithHoverClass.get(e);if(r)return r;var n=W(e,{silent:!0});if(!n.stylesheet)return e;var a=[];if(n.stylesheet.rules.forEach((function(e){"selectors"in e&&(e.selectors||[]).forEach((function(e){G.test(e)&&a.push(e)}))})),0===a.length)return e;var o=new RegExp(a.filter((function(e,t){return a.indexOf(e)===t})).sort((function(e,t){return t.length-e.length})).map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})).join("|"),"g"),i=e.replace(o,(function(e){var t=e.replace(H,"$1.\\:hover");return"".concat(e,", ").concat(t)}));return null==t||t.stylesWithHoverClass.set(e,i),i}function V(t,r){var n=r.doc,a=r.hackCss,o=r.cache;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 i,s=function(e){var t=P[e.tagName]?P[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(t);i=t.isSVG?n.createElementNS("http://www.w3.org/2000/svg",s):n.createElement(s);var c={};for(var l in t.attributes)if(Object.prototype.hasOwnProperty.call(t.attributes,l)){var u=t.attributes[l];if(("option"!==s||"selected"!==l||!1!==u)&&null!==u)if(!0===u&&(u=""),l.startsWith("rr_"))c[l]=u;else{var d="textarea"===s&&"value"===l,p="style"===s&&"_cssText"===l;if(p&&a&&"string"==typeof u&&(u=z(u,o)),!d&&!p||"string"!=typeof u)try{if(t.isSVG&&"xlink:href"===l)i.setAttributeNS("http://www.w3.org/1999/xlink",l,u.toString());else if("onload"===l||"onclick"===l||"onmouse"===l.substring(0,7))i.setAttribute("_"+l,u.toString());else{if("meta"===s&&"Content-Security-Policy"===t.attributes["http-equiv"]&&"content"===l){i.setAttribute("csp-content",u.toString());continue}("link"!==s||"preload"!==t.attributes.rel&&"modulepreload"!==t.attributes.rel||"script"!==t.attributes.as)&&("link"===s&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")||("img"===s&&t.attributes.srcset&&t.attributes.rr_dataURL?i.setAttribute("rrweb-original-srcset",t.attributes.srcset):i.setAttribute(l,u.toString())))}}catch(e){}else{for(var f=n.createTextNode(u),m=0,h=Array.from(i.childNodes);m<h.length;m++){var v=h[m];v.nodeType===i.TEXT_NODE&&i.removeChild(v)}i.appendChild(f)}}}var y=function(e){var r=c[e];if("canvas"===s&&"rr_dataURL"===e){var n=document.createElement("img");n.onload=function(){var e=i.getContext("2d");e&&e.drawImage(n,0,0,n.width,n.height)},n.src=r.toString(),i.RRNodeType&&(i.rr_dataURL=r.toString())}else if("img"===s&&"rr_dataURL"===e){var a=i;a.currentSrc.startsWith("data:")||(a.setAttribute("rrweb-original-src",t.attributes.src),a.src=r.toString())}if("rr_width"===e)i.style.width=r.toString();else if("rr_height"===e)i.style.height=r.toString();else if("rr_mediaCurrentTime"===e&&"number"==typeof r)i.currentTime=r;else if("rr_mediaState"===e)switch(r){case"played":i.play().catch((function(e){return console.warn("media playback error",e)}));break;case"paused":i.pause()}};for(var g in c)y(g);if(t.isShadowHost)if(i.shadowRoot)for(;i.shadowRoot.firstChild;)i.shadowRoot.removeChild(i.shadowRoot.firstChild);else i.attachShadow({mode:"open"});return i;case e.NodeType.Text:return n.createTextNode(t.isStyle&&a?z(t.textContent,o):t.textContent);case e.NodeType.CDATA:return n.createCDATASection(t.textContent);case e.NodeType.Comment:return n.createComment(t.textContent);default:return null}}function q(t,n){var a=n.doc,o=n.mirror,i=n.skipChild,s=void 0!==i&&i,c=n.hackCss,l=void 0===c||c,u=n.afterAppend,d=n.cache;if(o.has(t.id)){var p=o.getNode(t.id);if(f(o.getMeta(p),t))return o.getNode(t.id)}var m=V(t,{doc:a,hackCss:l,cache:d});if(!m)return null;if(t.rootId&&o.getNode(t.rootId)!==a&&o.replace(t.rootId,a),t.type===e.NodeType.Document&&(a.close(),a.open(),"BackCompat"===t.compatMode&&t.childNodes&&t.childNodes[0].type!==e.NodeType.DocumentType&&(t.childNodes[0].type===e.NodeType.Element&&"xmlns"in t.childNodes[0].attributes&&"http://www.w3.org/1999/xhtml"===t.childNodes[0].attributes.xmlns?a.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):a.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),m=a),o.add(m,t),(t.type===e.NodeType.Document||t.type===e.NodeType.Element)&&!s)for(var h=function(n){var i=q(n,{doc:a,mirror:o,skipChild:!1,hackCss:l,afterAppend:u,cache:d});if(!i)return console.warn("Failed to rebuild",n),"continue";if(n.isShadow&&r(m)&&m.shadowRoot)m.shadowRoot.appendChild(i);else if(t.type===e.NodeType.Document&&n.type==e.NodeType.Element){var s=i,c=null;s.childNodes.forEach((function(e){"BODY"===e.nodeName&&(c=e)})),c?(s.removeChild(c),m.appendChild(i),s.appendChild(c)):m.appendChild(i)}else m.appendChild(i);u&&u(i,n.id)},v=0,y=t.childNodes;v<y.length;v++){h(y[v])}return m}return e.IGNORED_NODE=-2,e.Mirror=c,e.addHoverClass=z,e.buildNodeWithSN=q,e.classMatchesRegex=D,e.cleanupSnapshot=function(){y=1},e.createCache=function(){return{stylesWithHoverClass:new Map}},e.createMirror=function(){return new c},e.genId=T,e.getCssRuleString=i,e.getCssRulesString=o,e.getInputType=m,e.ignoreAttribute=O,e.is2DCanvasBlank=p,e.isCSSImportRule=s,e.isElement=r,e.isNativeShadowDom=a,e.isNodeMetaEqual=f,e.isShadowRoot=n,e.maskInputValue=l,e.needMaskingText=_,e.rebuild=function(t,r){var n=r.doc,a=r.onVisit,o=r.hackCss,i=void 0===o||o,s=r.afterAppend,l=r.cache,u=r.mirror,d=void 0===u?new c:u,p=q(t,{doc:n,mirror:d,skipChild:!1,hackCss:i,afterAppend:s,cache:l});return function(e,t){for(var r=0,n=e.getIds();r<n.length;r++){var a=n[r];e.has(a)&&t(e.getNode(a))}}(d,(function(t){a&&a(t),function(t,r){var n=r.getMeta(t);if((null==n?void 0:n.type)===e.NodeType.Element){var a=t;for(var o in n.attributes)if(Object.prototype.hasOwnProperty.call(n.attributes,o)&&o.startsWith("rr_")){var i=n.attributes[o];"rr_scrollLeft"===o&&(a.scrollLeft=i),"rr_scrollTop"===o&&(a.scrollTop=i)}}}(t,d)})),p},e.serializeNodeWithId=F,e.snapshot=function(e,t){var r=t||{},n=r.mirror,a=void 0===n?new c:n,o=r.blockClass,i=void 0===o?"rr-block":o,s=r.blockSelector,l=void 0===s?null:s,u=r.maskTextClass,d=void 0===u?"rr-mask":u,p=r.maskTextSelector,f=void 0===p?null:p,m=r.inlineStylesheet,h=void 0===m||m,v=r.inlineImages,y=void 0!==v&&v,g=r.recordCanvas,T=void 0!==g&&g,b=r.maskAllInputs,k=void 0!==b&&b,N=r.maskTextFn,C=r.maskInputFn,S=r.slimDOM,w=void 0!==S&&S,x=r.dataURLOptions,E=r.preserveWhiteSpace,I=r.onSerialize,L=r.onIframeLoad,M=r.iframeLoadTimeout,O=r.onStylesheetLoad,D=r.stylesheetLoadTimeout,_=r.keepIframeSrcFn;return F(e,{doc:e,mirror:a,blockClass:i,blockSelector:l,maskTextClass:d,maskTextSelector:f,skipChild:!1,inlineStylesheet:h,maskInputOptions:!0===k?{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===k?{password:!0}:k,maskTextFn:N,maskInputFn:C,slimDOMOptions:!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===w,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===w?{}:w,dataURLOptions:x,inlineImages:y,recordCanvas:T,preserveWhiteSpace:E,onSerialize:I,onIframeLoad:L,iframeLoadTimeout:M,onStylesheetLoad:O,stylesheetLoadTimeout:D,keepIframeSrcFn:void 0===_?function(){return!1}:_,newlyAddedElement:!1})},e.toLowerCase=u,e.transformAttribute=M,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)},Object.defineProperty(e,"__esModule",{value:!0}),e}({}); | ||
var rrwebSnapshot=function(e){"use strict";var t;function r(e){return e.nodeType===e.ELEMENT_NODE}function n(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function a(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function o(e){try{var t=e.rules||e.cssRules;return t?((r=Array.from(t).map(i).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),r):null}catch(e){return null}var r}function i(e){var t=e.cssText;if(c(e))try{t=o(e.styleSheet)||t}catch(e){}return s(t)}function s(e){if(e.includes(":")){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}return e}function c(e){return"styleSheet"in e}e.NodeType=void 0,(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 l=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var r=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=r?r:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,r=this.getId(e);this.idNodeMap.delete(r),e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){var r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function u(e){var t=e.element,r=e.maskInputOptions,n=e.tagName,a=e.type,o=e.value,i=e.maskInputFn,s=o||"",c=a&&d(a);return(r[n.toLowerCase()]||c&&r[c])&&(s=i?i(s,t):"*".repeat(s.length)),s}function d(e){return e.toLowerCase()}var p="__rrweb_original__";function f(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;r<e.width;r+=50)for(var n=0;n<e.height;n+=50){var a=t.getImageData,o=p in a?a.__rrweb_original__:a;if(new Uint32Array(o.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((function(e){return 0!==e})))return!1}return!0}function m(t,r){return!(!t||!r||t.type!==r.type)&&(t.type===e.NodeType.Document?t.compatMode===r.compatMode:t.type===e.NodeType.DocumentType?t.name===r.name&&t.publicId===r.publicId&&t.systemId===r.systemId:t.type===e.NodeType.Comment||t.type===e.NodeType.Text||t.type===e.NodeType.CDATA?t.textContent===r.textContent:t.type===e.NodeType.Element&&(t.tagName===r.tagName&&JSON.stringify(t.attributes)===JSON.stringify(r.attributes)&&t.isSVG===r.isSVG&&t.needBlock===r.needBlock))}function h(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?d(t):null}var v,y,g=1,T=new RegExp("[^a-z0-9-_:]");function b(){return g++}var k=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,N=/^(?:[a-z+]+:)?\/\//i,C=/^www\..*/i,S=/^(data:)([^,]*),(.*)/i;function w(e,t){return(e||"").replace(k,(function(e,r,n,a,o,i){var s,c=n||o||i,l=r||a||"";if(!c)return e;if(N.test(c)||C.test(c))return"url(".concat(l).concat(c).concat(l,")");if(S.test(c))return"url(".concat(l).concat(c).concat(l,")");if("/"===c[0])return"url(".concat(l).concat((s=t,(s.indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+c)).concat(l,")");var u=t.split("/"),d=c.split("/");u.pop();for(var p=0,f=d;p<f.length;p++){var m=f[p];"."!==m&&(".."===m?u.pop():u.push(m))}return"url(".concat(l).concat(u.join("/")).concat(l,")")}))}var x=/^[^ \t\n\r\u000c]+/,E=/^[, \t\n\r\u000c]+/;function I(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function L(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function M(){var e=document.createElement("a");return e.href="",e.href}function O(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?I(e,n):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?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(E),!(r>=t.length);){var o=n(x);if(","===o.slice(-1))o=I(e,o.substring(0,o.length-1)),a.push(o);else{var i="";o=I(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?w(n,M()):"object"===t&&"data"===r?I(e,n):n:I(e,n):n}function D(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function _(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&_(e.parentNode,t,r);for(var n=e.classList.length;n--;){var a=e.classList[n];if(t.test(a))return!0}return!!r&&_(e.parentNode,t,r)}function R(e,t,r){try{var n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===n)return!1;if("string"==typeof t){if(n.classList.contains(t))return!0;if(n.closest(".".concat(t)))return!0}else if(_(n,t,!0))return!0;if(r){if(n.matches(r))return!0;if(n.closest(r))return!0}}catch(e){}return!1}function A(t,r){var n=r.doc,a=r.mirror,i=r.blockClass,c=r.blockSelector,l=r.maskTextClass,p=r.maskTextSelector,m=r.inlineStylesheet,g=r.maskInputOptions,b=void 0===g?{}:g,k=r.maskTextFn,N=r.maskInputFn,C=r.dataURLOptions,S=void 0===C?{}:C,x=r.inlineImages,E=r.recordCanvas,I=r.keepIframeSrcFn,_=r.newlyAddedElement,A=void 0!==_&&_,F=function(e,t){if(!t.hasNode(e))return;var r=t.getId(e);return 1===r?void 0:r}(n,a);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.NodeType.Document,childNodes:[],compatMode:t.compatMode}:{type:e.NodeType.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.NodeType.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:F};case t.ELEMENT_NODE:return function(t,r){for(var n=r.doc,a=r.blockClass,i=r.blockSelector,s=r.inlineStylesheet,c=r.maskInputOptions,l=void 0===c?{}:c,p=r.maskInputFn,m=r.dataURLOptions,g=void 0===m?{}:m,b=r.inlineImages,k=r.recordCanvas,N=r.keepIframeSrcFn,C=r.newlyAddedElement,S=void 0!==C&&C,x=r.rootId,E=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var a=e.classList[n];if(t.test(a))return!0}if(r)return e.matches(r)}catch(e){}return!1}(t,a,i),I=function(e){if(e instanceof HTMLFormElement)return"form";var t=d(e.tagName);return T.test(t)?"div":t}(t),_={},R=t.attributes.length,A=0;A<R;A++){var F=t.attributes[A];D(I,F.name,F.value)||(_[F.name]=O(n,I,d(F.name),F.value))}if("link"===I&&s){var U=Array.from(n.styleSheets).find((function(e){return e.href===t.href})),W=null;U&&(W=o(U)),W&&(delete _.rel,delete _.href,_._cssText=w(W,U.href))}if("style"===I&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){(W=o(t.sheet))&&(_._cssText=w(W,M()))}if("input"===I||"textarea"===I||"select"===I){var j=t.value,B=t.checked;if("radio"!==_.type&&"checkbox"!==_.type&&"submit"!==_.type&&"button"!==_.type&&j){var P=h(t);_.value=u({element:t,type:P,tagName:I,value:j,maskInputOptions:l,maskInputFn:p})}else B&&(_.checked=B)}"option"===I&&(t.selected&&!l.select?_.selected=!0:delete _.selected);if("canvas"===I&&k)if("2d"===t.__context)f(t)||(_.rr_dataURL=t.toDataURL(g.type,g.quality));else if(!("__context"in t)){var G=t.toDataURL(g.type,g.quality),H=document.createElement("canvas");H.width=t.width,H.height=t.height,G!==H.toDataURL(g.type,g.quality)&&(_.rr_dataURL=G)}if("img"===I&&b){v||(v=n.createElement("canvas"),y=v.getContext("2d"));var z=t,V=z.crossOrigin;z.crossOrigin="anonymous";var q=function(){z.removeEventListener("load",q);try{v.width=z.naturalWidth,v.height=z.naturalHeight,y.drawImage(z,0,0),_.rr_dataURL=v.toDataURL(g.type,g.quality)}catch(e){console.warn("Cannot inline img src=".concat(z.currentSrc,"! Error: ").concat(e))}V?_.crossOrigin=V:z.removeAttribute("crossorigin")};z.complete&&0!==z.naturalWidth?q():z.addEventListener("load",q)}"audio"!==I&&"video"!==I||(_.rr_mediaState=t.paused?"paused":"played",_.rr_mediaCurrentTime=t.currentTime);S||(t.scrollLeft&&(_.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(_.rr_scrollTop=t.scrollTop));if(E){var $=t.getBoundingClientRect(),Y=$.width,X=$.height;_={class:_.class,rr_width:"".concat(Y,"px"),rr_height:"".concat(X,"px")}}"iframe"!==I||N(_.src)||(t.contentDocument||(_.rr_src=_.src),delete _.src);return{type:e.NodeType.Element,tagName:I,attributes:_,childNodes:[],isSVG:L(t)||void 0,needBlock:E,rootId:x}}(t,{doc:n,blockClass:i,blockSelector:c,inlineStylesheet:m,maskInputOptions:b,maskInputFn:N,dataURLOptions:S,inlineImages:x,recordCanvas:E,keepIframeSrcFn:I,newlyAddedElement:A,rootId:F});case t.TEXT_NODE:return function(t,r){var n,a=r.maskTextClass,o=r.maskTextSelector,i=r.maskTextFn,c=r.rootId,l=t.parentNode&&t.parentNode.tagName,u=t.textContent,d="STYLE"===l||void 0,p="SCRIPT"===l||void 0;if(d&&u){try{t.nextSibling||t.previousSibling||(null===(n=t.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(u=(f=t.parentNode.sheet).cssRules?Array.from(f.cssRules).map((function(e){return e.cssText?s(e.cssText):""})).join(""):"")}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(e),t)}u=w(u,M())}var f;p&&(u="SCRIPT_PLACEHOLDER");!d&&!p&&u&&R(t,a,o)&&(u=i?i(u):u.replace(/[\S]/g,"*"));return{type:e.NodeType.Text,textContent:u||"",isStyle:d,rootId:c}}(t,{maskTextClass:l,maskTextSelector:p,maskTextFn:k,rootId:F});case t.CDATA_SECTION_NODE:return{type:e.NodeType.CDATA,textContent:"",rootId:F};case t.COMMENT_NODE:return{type:e.NodeType.Comment,textContent:t.textContent||"",rootId:F};default:return!1}}function F(e){return null==e?"":e.toLowerCase()}function U(t,o){var i,s=o.doc,c=o.mirror,l=o.blockClass,u=o.blockSelector,d=o.maskTextClass,p=o.maskTextSelector,f=o.skipChild,m=void 0!==f&&f,h=o.inlineStylesheet,v=void 0===h||h,y=o.maskInputOptions,g=void 0===y?{}:y,T=o.maskTextFn,k=o.maskInputFn,N=o.slimDOMOptions,C=o.dataURLOptions,S=void 0===C?{}:C,w=o.inlineImages,x=void 0!==w&&w,E=o.recordCanvas,I=void 0!==E&&E,L=o.onSerialize,M=o.onIframeLoad,O=o.iframeLoadTimeout,D=void 0===O?5e3:O,_=o.onStylesheetLoad,R=o.stylesheetLoadTimeout,W=void 0===R?5e3:R,j=o.keepIframeSrcFn,B=void 0===j?function(){return!1}:j,P=o.newlyAddedElement,G=void 0!==P&&P,H=o.preserveWhiteSpace,z=void 0===H||H,V=A(t,{doc:s,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:p,inlineStylesheet:v,maskInputOptions:g,maskTextFn:T,maskInputFn:k,dataURLOptions:S,inlineImages:x,recordCanvas:I,keepIframeSrcFn:B,newlyAddedElement:G});if(!V)return console.warn(t,"not serialized"),null;i=c.hasNode(t)?c.getId(t):!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||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")))return!0;if(r.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(F(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===F(t.attributes.name)||"icon"===F(t.attributes.rel)||"apple-touch-icon"===F(t.attributes.rel)||"shortcut icon"===F(t.attributes.rel))))return!0;if("meta"===t.tagName){if(r.headMetaDescKeywords&&F(t.attributes.name).match(/^description|keywords$/))return!0;if(r.headMetaSocial&&(F(t.attributes.property).match(/^(og|twitter|fb):/)||F(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===F(t.attributes.name)))return!0;if(r.headMetaRobots&&("robots"===F(t.attributes.name)||"googlebot"===F(t.attributes.name)||"bingbot"===F(t.attributes.name)))return!0;if(r.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(r.headMetaAuthorship&&("author"===F(t.attributes.name)||"generator"===F(t.attributes.name)||"framework"===F(t.attributes.name)||"publisher"===F(t.attributes.name)||"progid"===F(t.attributes.name)||F(t.attributes.property).match(/^article:/)||F(t.attributes.property).match(/^product:/)))return!0;if(r.headMetaVerification&&("google-site-verification"===F(t.attributes.name)||"yandex-verification"===F(t.attributes.name)||"csrf-token"===F(t.attributes.name)||"p:domain_verify"===F(t.attributes.name)||"verify-v1"===F(t.attributes.name)||"verification"===F(t.attributes.name)||"shopify-checkout-api-token"===F(t.attributes.name)))return!0}}return!1}(V,N)&&(z||V.type!==e.NodeType.Text||V.isStyle||V.textContent.replace(/^\s+|\s+$/gm,"").length)?b():-2;var q=Object.assign(V,{id:i});if(c.add(t,q),-2===i)return null;L&&L(t);var $=!m;if(q.type===e.NodeType.Element){$=$&&!q.needBlock,delete q.needBlock;var Y=t.shadowRoot;Y&&a(Y)&&(q.isShadowHost=!0)}if((q.type===e.NodeType.Document||q.type===e.NodeType.Element)&&$){N.headWhitespace&&q.type===e.NodeType.Element&&"head"===q.tagName&&(z=!1);for(var X={doc:s,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:p,skipChild:m,inlineStylesheet:v,maskInputOptions:g,maskTextFn:T,maskInputFn:k,slimDOMOptions:N,dataURLOptions:S,inlineImages:x,recordCanvas:I,preserveWhiteSpace:z,onSerialize:L,onIframeLoad:M,iframeLoadTimeout:D,onStylesheetLoad:_,stylesheetLoadTimeout:W,keepIframeSrcFn:B},J=0,K=Array.from(t.childNodes);J<K.length;J++){(ee=U(K[J],X))&&q.childNodes.push(ee)}if(r(t)&&t.shadowRoot)for(var Q=0,Z=Array.from(t.shadowRoot.childNodes);Q<Z.length;Q++){var ee;(ee=U(Z[Q],X))&&(a(t.shadowRoot)&&(ee.isShadow=!0),q.childNodes.push(ee))}}return t.parentNode&&n(t.parentNode)&&a(t.parentNode)&&(q.isShadow=!0),q.type===e.NodeType.Element&&"iframe"===q.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){var i="about:blank";if(n.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var s=setTimeout((function(){o||(t(),o=!0)}),r);e.addEventListener("load",(function(){clearTimeout(s),o=!0,t()}))}}}(t,(function(){var e=t.contentDocument;if(e&&M){var r=U(e,{doc:e,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:p,skipChild:!1,inlineStylesheet:v,maskInputOptions:g,maskTextFn:T,maskInputFn:k,slimDOMOptions:N,dataURLOptions:S,inlineImages:x,recordCanvas:I,preserveWhiteSpace:z,onSerialize:L,onIframeLoad:M,iframeLoadTimeout:D,onStylesheetLoad:_,stylesheetLoadTimeout:W,keepIframeSrcFn:B});r&&M(t,r)}}),D),q.type===e.NodeType.Element&&"link"===q.tagName&&"stylesheet"===q.attributes.rel&&function(e,t,r){var n,a=!1;try{n=e.sheet}catch(e){return}if(!n){var o=setTimeout((function(){a||(t(),a=!0)}),r);e.addEventListener("load",(function(){clearTimeout(o),a=!0,t()}))}}(t,(function(){if(_){var e=U(t,{doc:s,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:p,skipChild:!1,inlineStylesheet:v,maskInputOptions:g,maskTextFn:T,maskInputFn:k,slimDOMOptions:N,dataURLOptions:S,inlineImages:x,recordCanvas:I,preserveWhiteSpace:z,onSerialize:L,onIframeLoad:M,iframeLoadTimeout:D,onStylesheetLoad:_,stylesheetLoadTimeout:W,keepIframeSrcFn:B});e&&_(t,e)}}),W),q}var W=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function j(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),f(),t}}var i=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("".concat(t.source||"",":").concat(r,":").concat(n,": ").concat(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 l(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){var t,r=[];for(f(),m(r);e.length&&"}"!==e.charAt(0)&&(t=w()||x());)!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 f(){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 B(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=B(t[0]);if(!p(/^:\s*/))return c("property missing ':'");var n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),a=e({type:"declaration",property:r.replace(W,""),value:n?B(n[0]).replace(W,""):""});return p(/^[;\s]*/),a}}function g(){var e,t=[];if(!l())return c("missing '{'");for(m(t);e=y();)!1!==e&&(t.push(e),m(t)),e=y();return u()?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"),N=S("charset"),C=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(!l())return c("@keyframes missing '{'");for(var i=m();n=T();)i.push(n),i=i.concat(m());return u()?e({type:"keyframes",name:a,vendor:r,keyframes:i}):c("@keyframes missing '}'")}}()||function(){var e=o(),t=p(/^@media *([^{]+)/);if(t){var r=B(t[1]);if(!l())return c("@media missing '{'");var n=m().concat(d());return u()?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:B(t[1]),media:B(t[2])})}()||function(){var e=o(),t=p(/^@supports *([^{]+)/);if(t){var r=B(t[1]);if(!l())return c("@supports missing '{'");var n=m().concat(d());return u()?e({type:"supports",supports:r,rules:n}):c("@supports missing '}'")}}()||k()||N()||C()||function(){var e=o(),t=p(/^@([-\w]+)?document *([^{]+)/);if(t){var r=B(t[1]),n=B(t[2]);if(!l())return c("@document missing '{'");var a=m().concat(d());return u()?e({type:"document",document:n,vendor:r,rules:a}):c("@document missing '}'")}}()||function(){var e=o();if(p(/^@page */)){var t=v()||[];if(!l())return c("@page missing '{'");for(var r,n=m();r=y();)n.push(r),n=n.concat(m());return u()?e({type:"page",selectors:t,declarations:n}):c("@page missing '}'")}}()||function(){var e=o();if(p(/^@host\s*/)){if(!l())return c("@host missing '{'");var t=m().concat(d());return u()?e({type:"host",rules:t}):c("@host missing '}'")}}()||function(){var e=o();if(p(/^@font-face\s*/)){if(!l())return c("@font-face missing '{'");for(var t,r=m();t=y();)r.push(t),r=r.concat(m());return u()?e({type:"font-face",declarations:r}):c("@font-face missing '}'")}}()}function x(){var e=o(),t=v();return t?(m(),e({type:"rule",selectors:t,declarations:g()})):c("selector missing")}return P((b=d(),{type:"stylesheet",stylesheet:{source:t.source,rules:b,parsingErrors:s}}))}function B(e){return e?e.replace(/^\s+|\s+$/g,""):""}function P(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){P(e,n)})):i&&"object"==typeof i&&P(i,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var G={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};var H=/([^\\]):hover/,z=new RegExp(H.source,"g");function V(e,t){var r=null==t?void 0:t.stylesWithHoverClass.get(e);if(r)return r;var n=j(e,{silent:!0});if(!n.stylesheet)return e;var a=[];if(n.stylesheet.rules.forEach((function(e){"selectors"in e&&(e.selectors||[]).forEach((function(e){H.test(e)&&a.push(e)}))})),0===a.length)return e;var o=new RegExp(a.filter((function(e,t){return a.indexOf(e)===t})).sort((function(e,t){return t.length-e.length})).map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})).join("|"),"g"),i=e.replace(o,(function(e){var t=e.replace(z,"$1.\\:hover");return"".concat(e,", ").concat(t)}));return null==t||t.stylesWithHoverClass.set(e,i),i}function q(t,r){var n=r.doc,a=r.hackCss,o=r.cache;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 i,s=function(e){var t=G[e.tagName]?G[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(t);i=t.isSVG?n.createElementNS("http://www.w3.org/2000/svg",s):n.createElement(s);var c={};for(var l in t.attributes)if(Object.prototype.hasOwnProperty.call(t.attributes,l)){var u=t.attributes[l];if(("option"!==s||"selected"!==l||!1!==u)&&null!==u)if(!0===u&&(u=""),l.startsWith("rr_"))c[l]=u;else{var d="textarea"===s&&"value"===l,p="style"===s&&"_cssText"===l;if(p&&a&&"string"==typeof u&&(u=V(u,o)),!d&&!p||"string"!=typeof u)try{if(t.isSVG&&"xlink:href"===l)i.setAttributeNS("http://www.w3.org/1999/xlink",l,u.toString());else if("onload"===l||"onclick"===l||"onmouse"===l.substring(0,7))i.setAttribute("_"+l,u.toString());else{if("meta"===s&&"Content-Security-Policy"===t.attributes["http-equiv"]&&"content"===l){i.setAttribute("csp-content",u.toString());continue}("link"!==s||"preload"!==t.attributes.rel&&"modulepreload"!==t.attributes.rel||"script"!==t.attributes.as)&&("link"===s&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")||("img"===s&&t.attributes.srcset&&t.attributes.rr_dataURL?i.setAttribute("rrweb-original-srcset",t.attributes.srcset):i.setAttribute(l,u.toString())))}}catch(e){}else{for(var f=n.createTextNode(u),m=0,h=Array.from(i.childNodes);m<h.length;m++){var v=h[m];v.nodeType===i.TEXT_NODE&&i.removeChild(v)}i.appendChild(f)}}}var y=function(e){var r=c[e];if("canvas"===s&&"rr_dataURL"===e){var n=document.createElement("img");n.onload=function(){var e=i.getContext("2d");e&&e.drawImage(n,0,0,n.width,n.height)},n.src=r.toString(),i.RRNodeType&&(i.rr_dataURL=r.toString())}else if("img"===s&&"rr_dataURL"===e){var a=i;a.currentSrc.startsWith("data:")||(a.setAttribute("rrweb-original-src",t.attributes.src),a.src=r.toString())}if("rr_width"===e)i.style.width=r.toString();else if("rr_height"===e)i.style.height=r.toString();else if("rr_mediaCurrentTime"===e&&"number"==typeof r)i.currentTime=r;else if("rr_mediaState"===e)switch(r){case"played":i.play().catch((function(e){return console.warn("media playback error",e)}));break;case"paused":i.pause()}};for(var g in c)y(g);if(t.isShadowHost)if(i.shadowRoot)for(;i.shadowRoot.firstChild;)i.shadowRoot.removeChild(i.shadowRoot.firstChild);else i.attachShadow({mode:"open"});return i;case e.NodeType.Text:return n.createTextNode(t.isStyle&&a?V(t.textContent,o):t.textContent);case e.NodeType.CDATA:return n.createCDATASection(t.textContent);case e.NodeType.Comment:return n.createComment(t.textContent);default:return null}}function $(t,n){var a=n.doc,o=n.mirror,i=n.skipChild,s=void 0!==i&&i,c=n.hackCss,l=void 0===c||c,u=n.afterAppend,d=n.cache;if(o.has(t.id)){var p=o.getNode(t.id);if(m(o.getMeta(p),t))return o.getNode(t.id)}var f=q(t,{doc:a,hackCss:l,cache:d});if(!f)return null;if(t.rootId&&o.getNode(t.rootId)!==a&&o.replace(t.rootId,a),t.type===e.NodeType.Document&&(a.close(),a.open(),"BackCompat"===t.compatMode&&t.childNodes&&t.childNodes[0].type!==e.NodeType.DocumentType&&(t.childNodes[0].type===e.NodeType.Element&&"xmlns"in t.childNodes[0].attributes&&"http://www.w3.org/1999/xhtml"===t.childNodes[0].attributes.xmlns?a.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):a.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),f=a),o.add(f,t),(t.type===e.NodeType.Document||t.type===e.NodeType.Element)&&!s)for(var h=function(n){var i=$(n,{doc:a,mirror:o,skipChild:!1,hackCss:l,afterAppend:u,cache:d});if(!i)return console.warn("Failed to rebuild",n),"continue";if(n.isShadow&&r(f)&&f.shadowRoot)f.shadowRoot.appendChild(i);else if(t.type===e.NodeType.Document&&n.type==e.NodeType.Element){var s=i,c=null;s.childNodes.forEach((function(e){"BODY"===e.nodeName&&(c=e)})),c?(s.removeChild(c),f.appendChild(i),s.appendChild(c)):f.appendChild(i)}else f.appendChild(i);u&&u(i,n.id)},v=0,y=t.childNodes;v<y.length;v++){h(y[v])}return f}return e.IGNORED_NODE=-2,e.Mirror=l,e.addHoverClass=V,e.buildNodeWithSN=$,e.classMatchesRegex=_,e.cleanupSnapshot=function(){g=1},e.createCache=function(){return{stylesWithHoverClass:new Map}},e.createMirror=function(){return new l},e.genId=b,e.getCssRuleString=i,e.getCssRulesString=o,e.getInputType=h,e.ignoreAttribute=D,e.is2DCanvasBlank=f,e.isCSSImportRule=c,e.isElement=r,e.isNativeShadowDom=a,e.isNodeMetaEqual=m,e.isShadowRoot=n,e.maskInputValue=u,e.needMaskingText=R,e.rebuild=function(t,r){var n=r.doc,a=r.onVisit,o=r.hackCss,i=void 0===o||o,s=r.afterAppend,c=r.cache,u=r.mirror,d=void 0===u?new l:u,p=$(t,{doc:n,mirror:d,skipChild:!1,hackCss:i,afterAppend:s,cache:c});return function(e,t){for(var r=0,n=e.getIds();r<n.length;r++){var a=n[r];e.has(a)&&t(e.getNode(a))}}(d,(function(t){a&&a(t),function(t,r){var n=r.getMeta(t);if((null==n?void 0:n.type)===e.NodeType.Element){var a=t;for(var o in n.attributes)if(Object.prototype.hasOwnProperty.call(n.attributes,o)&&o.startsWith("rr_")){var i=n.attributes[o];"rr_scrollLeft"===o&&(a.scrollLeft=i),"rr_scrollTop"===o&&(a.scrollTop=i)}}}(t,d)})),p},e.serializeNodeWithId=U,e.snapshot=function(e,t){var r=t||{},n=r.mirror,a=void 0===n?new l:n,o=r.blockClass,i=void 0===o?"rr-block":o,s=r.blockSelector,c=void 0===s?null:s,u=r.maskTextClass,d=void 0===u?"rr-mask":u,p=r.maskTextSelector,f=void 0===p?null:p,m=r.inlineStylesheet,h=void 0===m||m,v=r.inlineImages,y=void 0!==v&&v,g=r.recordCanvas,T=void 0!==g&&g,b=r.maskAllInputs,k=void 0!==b&&b,N=r.maskTextFn,C=r.maskInputFn,S=r.slimDOM,w=void 0!==S&&S,x=r.dataURLOptions,E=r.preserveWhiteSpace,I=r.onSerialize,L=r.onIframeLoad,M=r.iframeLoadTimeout,O=r.onStylesheetLoad,D=r.stylesheetLoadTimeout,_=r.keepIframeSrcFn;return U(e,{doc:e,mirror:a,blockClass:i,blockSelector:c,maskTextClass:d,maskTextSelector:f,skipChild:!1,inlineStylesheet:h,maskInputOptions:!0===k?{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===k?{password:!0}:k,maskTextFn:N,maskInputFn:C,slimDOMOptions:!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===w,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===w?{}:w,dataURLOptions:x,inlineImages:y,recordCanvas:T,preserveWhiteSpace:E,onSerialize:I,onIframeLoad:L,iframeLoadTimeout:M,onStylesheetLoad:O,stylesheetLoadTimeout:D,keepIframeSrcFn:void 0===_?function(){return!1}:_,newlyAddedElement:!1})},e.toLowerCase=d,e.transformAttribute=O,e.validateStringifiedCssRule=s,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)},Object.defineProperty(e,"__esModule",{value:!0}),e}({}); | ||
//# sourceMappingURL=rrweb-snapshot.min.js.map |
@@ -1,2 +0,2 @@ | ||
var e;function t(e){return e.nodeType===e.ELEMENT_NODE}function r(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function n(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function a(e){try{var t=e.rules||e.cssRules;return t?((r=Array.from(t).map(o).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),r):null}catch(e){return null}var r}function o(e){var t=e.cssText;if(i(e))try{t=a(e.styleSheet)||t}catch(e){}return t}function i(e){return"styleSheet"in 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"}(e||(e={}));var s=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var r=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=r?r:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,r=this.getId(e);this.idNodeMap.delete(r),e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){var r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function c(){return new s}function l(e){var t=e.element,r=e.maskInputOptions,n=e.tagName,a=e.type,o=e.value,i=e.maskInputFn,s=o||"",c=a&&u(a);return(r[n.toLowerCase()]||c&&r[c])&&(s=i?i(s,t):"*".repeat(s.length)),s}function u(e){return e.toLowerCase()}function d(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;r<e.width;r+=50)for(var n=0;n<e.height;n+=50){var a=t.getImageData,o="__rrweb_original__"in a?a.__rrweb_original__:a;if(new Uint32Array(o.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((function(e){return 0!==e})))return!1}return!0}function f(t,r){return!(!t||!r||t.type!==r.type)&&(t.type===e.Document?t.compatMode===r.compatMode:t.type===e.DocumentType?t.name===r.name&&t.publicId===r.publicId&&t.systemId===r.systemId:t.type===e.Comment||t.type===e.Text||t.type===e.CDATA?t.textContent===r.textContent:t.type===e.Element&&(t.tagName===r.tagName&&JSON.stringify(t.attributes)===JSON.stringify(r.attributes)&&t.isSVG===r.isSVG&&t.needBlock===r.needBlock))}function p(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?u(t):null}var m,h,v=1,g=new RegExp("[^a-z0-9-_:]"),y=-2;function b(){return v++}var k=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,C=/^(?:[a-z+]+:)?\/\//i,T=/^www\..*/i,S=/^(data:)([^,]*),(.*)/i;function w(e,t){return(e||"").replace(k,(function(e,r,n,a,o,i){var s,c=n||o||i,l=r||a||"";if(!c)return e;if(C.test(c)||T.test(c))return"url(".concat(l).concat(c).concat(l,")");if(S.test(c))return"url(".concat(l).concat(c).concat(l,")");if("/"===c[0])return"url(".concat(l).concat((s=t,(s.indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+c)).concat(l,")");var u=t.split("/"),d=c.split("/");u.pop();for(var f=0,p=d;f<p.length;f++){var m=p[f];"."!==m&&(".."===m?u.pop():u.push(m))}return"url(".concat(l).concat(u.join("/")).concat(l,")")}))}var x=/^[^ \t\n\r\u000c]+/,N=/^[, \t\n\r\u000c]+/;function E(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function I(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function L(){var e=document.createElement("a");return e.href="",e.href}function M(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?E(e,n):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?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(N),!(r>=t.length);){var o=n(x);if(","===o.slice(-1))o=E(e,o.substring(0,o.length-1)),a.push(o);else{var i="";o=E(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?w(n,L()):"object"===t&&"data"===r?E(e,n):n:E(e,n):n}function O(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function D(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&D(e.parentNode,t,r);for(var n=e.classList.length;n--;){var a=e.classList[n];if(t.test(a))return!0}return!!r&&D(e.parentNode,t,r)}function _(e,t,r){try{var n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===n)return!1;if("string"==typeof t){if(n.classList.contains(t))return!0;if(n.closest(".".concat(t)))return!0}else if(D(n,t,!0))return!0;if(r){if(n.matches(r))return!0;if(n.closest(r))return!0}}catch(e){}return!1}function A(t,r){var n=r.doc,o=r.mirror,i=r.blockClass,s=r.blockSelector,c=r.maskTextClass,f=r.maskTextSelector,v=r.inlineStylesheet,y=r.maskInputOptions,b=void 0===y?{}:y,k=r.maskTextFn,C=r.maskInputFn,T=r.dataURLOptions,S=void 0===T?{}:T,x=r.inlineImages,N=r.recordCanvas,E=r.keepIframeSrcFn,D=r.newlyAddedElement,A=void 0!==D&&D,R=function(e,t){if(!t.hasNode(e))return;var r=t.getId(e);return 1===r?void 0:r}(n,o);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.Document,childNodes:[],compatMode:t.compatMode}:{type:e.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:R};case t.ELEMENT_NODE:return function(t,r){for(var n=r.doc,o=r.blockClass,i=r.blockSelector,s=r.inlineStylesheet,c=r.maskInputOptions,f=void 0===c?{}:c,v=r.maskInputFn,y=r.dataURLOptions,b=void 0===y?{}:y,k=r.inlineImages,C=r.recordCanvas,T=r.keepIframeSrcFn,S=r.newlyAddedElement,x=void 0!==S&&S,N=r.rootId,E=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var a=e.classList[n];if(t.test(a))return!0}if(r)return e.matches(r)}catch(e){}return!1}(t,o,i),D=function(e){if(e instanceof HTMLFormElement)return"form";var t=u(e.tagName);return g.test(t)?"div":t}(t),_={},A=t.attributes.length,R=0;R<A;R++){var F=t.attributes[R];O(D,F.name,F.value)||(_[F.name]=M(n,D,u(F.name),F.value))}if("link"===D&&s){var U=Array.from(n.styleSheets).find((function(e){return e.href===t.href})),W=null;U&&(W=a(U)),W&&(delete _.rel,delete _.href,_._cssText=w(W,U.href))}if("style"===D&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){(W=a(t.sheet))&&(_._cssText=w(W,L()))}if("input"===D||"textarea"===D||"select"===D){var j=t.value,B=t.checked;if("radio"!==_.type&&"checkbox"!==_.type&&"submit"!==_.type&&"button"!==_.type&&j){var P=p(t);_.value=l({element:t,type:P,tagName:D,value:j,maskInputOptions:f,maskInputFn:v})}else B&&(_.checked=B)}"option"===D&&(t.selected&&!f.select?_.selected=!0:delete _.selected);if("canvas"===D&&C)if("2d"===t.__context)d(t)||(_.rr_dataURL=t.toDataURL(b.type,b.quality));else if(!("__context"in t)){var G=t.toDataURL(b.type,b.quality),H=document.createElement("canvas");H.width=t.width,H.height=t.height,G!==H.toDataURL(b.type,b.quality)&&(_.rr_dataURL=G)}if("img"===D&&k){m||(m=n.createElement("canvas"),h=m.getContext("2d"));var z=t,V=z.crossOrigin;z.crossOrigin="anonymous";var q=function(){z.removeEventListener("load",q);try{m.width=z.naturalWidth,m.height=z.naturalHeight,h.drawImage(z,0,0),_.rr_dataURL=m.toDataURL(b.type,b.quality)}catch(e){console.warn("Cannot inline img src=".concat(z.currentSrc,"! Error: ").concat(e))}V?_.crossOrigin=V:z.removeAttribute("crossorigin")};z.complete&&0!==z.naturalWidth?q():z.addEventListener("load",q)}"audio"!==D&&"video"!==D||(_.rr_mediaState=t.paused?"paused":"played",_.rr_mediaCurrentTime=t.currentTime);x||(t.scrollLeft&&(_.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(_.rr_scrollTop=t.scrollTop));if(E){var $=t.getBoundingClientRect(),Y=$.width,X=$.height;_={class:_.class,rr_width:"".concat(Y,"px"),rr_height:"".concat(X,"px")}}"iframe"!==D||T(_.src)||(t.contentDocument||(_.rr_src=_.src),delete _.src);return{type:e.Element,tagName:D,attributes:_,childNodes:[],isSVG:I(t)||void 0,needBlock:E,rootId:N}}(t,{doc:n,blockClass:i,blockSelector:s,inlineStylesheet:v,maskInputOptions:b,maskInputFn:C,dataURLOptions:S,inlineImages:x,recordCanvas:N,keepIframeSrcFn:E,newlyAddedElement:A,rootId:R});case t.TEXT_NODE:return function(t,r){var n,a=r.maskTextClass,o=r.maskTextSelector,i=r.maskTextFn,s=r.rootId,c=t.parentNode&&t.parentNode.tagName,l=t.textContent,u="STYLE"===c||void 0,d="SCRIPT"===c||void 0;if(u&&l){try{t.nextSibling||t.previousSibling||(null===(n=t.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(l=(f=t.parentNode.sheet).cssRules?Array.from(f.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(e),t)}l=w(l,L())}var f;d&&(l="SCRIPT_PLACEHOLDER");!u&&!d&&l&&_(t,a,o)&&(l=i?i(l):l.replace(/[\S]/g,"*"));return{type:e.Text,textContent:l||"",isStyle:u,rootId:s}}(t,{maskTextClass:c,maskTextSelector:f,maskTextFn:k,rootId:R});case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:R};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:R};default:return!1}}function R(e){return null==e?"":e.toLowerCase()}function F(a,o){var i,s=o.doc,c=o.mirror,l=o.blockClass,u=o.blockSelector,d=o.maskTextClass,f=o.maskTextSelector,p=o.skipChild,m=void 0!==p&&p,h=o.inlineStylesheet,v=void 0===h||h,g=o.maskInputOptions,y=void 0===g?{}:g,k=o.maskTextFn,C=o.maskInputFn,T=o.slimDOMOptions,S=o.dataURLOptions,w=void 0===S?{}:S,x=o.inlineImages,N=void 0!==x&&x,E=o.recordCanvas,I=void 0!==E&&E,L=o.onSerialize,M=o.onIframeLoad,O=o.iframeLoadTimeout,D=void 0===O?5e3:O,_=o.onStylesheetLoad,U=o.stylesheetLoadTimeout,W=void 0===U?5e3:U,j=o.keepIframeSrcFn,B=void 0===j?function(){return!1}:j,P=o.newlyAddedElement,G=void 0!==P&&P,H=o.preserveWhiteSpace,z=void 0===H||H,V=A(a,{doc:s,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:f,inlineStylesheet:v,maskInputOptions:y,maskTextFn:k,maskInputFn:C,dataURLOptions:w,inlineImages:N,recordCanvas:I,keepIframeSrcFn:B,newlyAddedElement:G});if(!V)return console.warn(a,"not serialized"),null;i=c.hasNode(a)?c.getId(a):!function(t,r){if(r.comment&&t.type===e.Comment)return!0;if(t.type===e.Element){if(r.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")))return!0;if(r.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(R(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===R(t.attributes.name)||"icon"===R(t.attributes.rel)||"apple-touch-icon"===R(t.attributes.rel)||"shortcut icon"===R(t.attributes.rel))))return!0;if("meta"===t.tagName){if(r.headMetaDescKeywords&&R(t.attributes.name).match(/^description|keywords$/))return!0;if(r.headMetaSocial&&(R(t.attributes.property).match(/^(og|twitter|fb):/)||R(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===R(t.attributes.name)))return!0;if(r.headMetaRobots&&("robots"===R(t.attributes.name)||"googlebot"===R(t.attributes.name)||"bingbot"===R(t.attributes.name)))return!0;if(r.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(r.headMetaAuthorship&&("author"===R(t.attributes.name)||"generator"===R(t.attributes.name)||"framework"===R(t.attributes.name)||"publisher"===R(t.attributes.name)||"progid"===R(t.attributes.name)||R(t.attributes.property).match(/^article:/)||R(t.attributes.property).match(/^product:/)))return!0;if(r.headMetaVerification&&("google-site-verification"===R(t.attributes.name)||"yandex-verification"===R(t.attributes.name)||"csrf-token"===R(t.attributes.name)||"p:domain_verify"===R(t.attributes.name)||"verify-v1"===R(t.attributes.name)||"verification"===R(t.attributes.name)||"shopify-checkout-api-token"===R(t.attributes.name)))return!0}}return!1}(V,T)&&(z||V.type!==e.Text||V.isStyle||V.textContent.replace(/^\s+|\s+$/gm,"").length)?b():-2;var q=Object.assign(V,{id:i});if(c.add(a,q),-2===i)return null;L&&L(a);var $=!m;if(q.type===e.Element){$=$&&!q.needBlock,delete q.needBlock;var Y=a.shadowRoot;Y&&n(Y)&&(q.isShadowHost=!0)}if((q.type===e.Document||q.type===e.Element)&&$){T.headWhitespace&&q.type===e.Element&&"head"===q.tagName&&(z=!1);for(var X={doc:s,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:f,skipChild:m,inlineStylesheet:v,maskInputOptions:y,maskTextFn:k,maskInputFn:C,slimDOMOptions:T,dataURLOptions:w,inlineImages:N,recordCanvas:I,preserveWhiteSpace:z,onSerialize:L,onIframeLoad:M,iframeLoadTimeout:D,onStylesheetLoad:_,stylesheetLoadTimeout:W,keepIframeSrcFn:B},J=0,K=Array.from(a.childNodes);J<K.length;J++){(ee=F(K[J],X))&&q.childNodes.push(ee)}if(t(a)&&a.shadowRoot)for(var Q=0,Z=Array.from(a.shadowRoot.childNodes);Q<Z.length;Q++){var ee;(ee=F(Z[Q],X))&&(n(a.shadowRoot)&&(ee.isShadow=!0),q.childNodes.push(ee))}}return a.parentNode&&r(a.parentNode)&&n(a.parentNode)&&(q.isShadow=!0),q.type===e.Element&&"iframe"===q.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){var i="about:blank";if(n.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var s=setTimeout((function(){o||(t(),o=!0)}),r);e.addEventListener("load",(function(){clearTimeout(s),o=!0,t()}))}}}(a,(function(){var e=a.contentDocument;if(e&&M){var t=F(e,{doc:e,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:f,skipChild:!1,inlineStylesheet:v,maskInputOptions:y,maskTextFn:k,maskInputFn:C,slimDOMOptions:T,dataURLOptions:w,inlineImages:N,recordCanvas:I,preserveWhiteSpace:z,onSerialize:L,onIframeLoad:M,iframeLoadTimeout:D,onStylesheetLoad:_,stylesheetLoadTimeout:W,keepIframeSrcFn:B});t&&M(a,t)}}),D),q.type===e.Element&&"link"===q.tagName&&"stylesheet"===q.attributes.rel&&function(e,t,r){var n,a=!1;try{n=e.sheet}catch(e){return}if(!n){var o=setTimeout((function(){a||(t(),a=!0)}),r);e.addEventListener("load",(function(){clearTimeout(o),a=!0,t()}))}}(a,(function(){if(_){var e=F(a,{doc:s,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:f,skipChild:!1,inlineStylesheet:v,maskInputOptions:y,maskTextFn:k,maskInputFn:C,slimDOMOptions:T,dataURLOptions:w,inlineImages:N,recordCanvas:I,preserveWhiteSpace:z,onSerialize:L,onIframeLoad:M,iframeLoadTimeout:D,onStylesheetLoad:_,stylesheetLoadTimeout:W,keepIframeSrcFn:B});e&&_(a,e)}}),W),q}function U(e,t){var r=t||{},n=r.mirror,a=void 0===n?new s:n,o=r.blockClass,i=void 0===o?"rr-block":o,c=r.blockSelector,l=void 0===c?null:c,u=r.maskTextClass,d=void 0===u?"rr-mask":u,f=r.maskTextSelector,p=void 0===f?null:f,m=r.inlineStylesheet,h=void 0===m||m,v=r.inlineImages,g=void 0!==v&&v,y=r.recordCanvas,b=void 0!==y&&y,k=r.maskAllInputs,C=void 0!==k&&k,T=r.maskTextFn,S=r.maskInputFn,w=r.slimDOM,x=void 0!==w&&w,N=r.dataURLOptions,E=r.preserveWhiteSpace,I=r.onSerialize,L=r.onIframeLoad,M=r.iframeLoadTimeout,O=r.onStylesheetLoad,D=r.stylesheetLoadTimeout,_=r.keepIframeSrcFn;return F(e,{doc:e,mirror:a,blockClass:i,blockSelector:l,maskTextClass:d,maskTextSelector:p,skipChild:!1,inlineStylesheet:h,maskInputOptions:!0===C?{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===C?{password:!0}:C,maskTextFn:T,maskInputFn:S,slimDOMOptions:!0===x||"all"===x?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===x,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===x?{}:x,dataURLOptions:N,inlineImages:g,recordCanvas:b,preserveWhiteSpace:E,onSerialize:I,onIframeLoad:L,iframeLoadTimeout:M,onStylesheetLoad:O,stylesheetLoadTimeout:D,keepIframeSrcFn:void 0===_?function(){return!1}:_,newlyAddedElement:!1})}function W(t,r){!function t(n){r(n),n.type!==e.Document&&n.type!==e.Element||n.childNodes.forEach(t)}(t)}function j(){v=1}var B=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function P(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),p(),t}}var i=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("".concat(t.source||"",":").concat(r,":").concat(n,": ").concat(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 l(){return f(/^{\s*/)}function u(){return f(/^}/)}function d(){var t,r=[];for(p(),m(r);e.length&&"}"!==e.charAt(0)&&(t=x()||N());)!1!==t&&(r.push(t),m(r));return r}function f(t){var r=t.exec(e);if(r){var n=r[0];return a(n),e=e.slice(n.length),r}}function p(){f(/^\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=f(/^([^{]+)/);if(e)return G(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=f(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=G(t[0]);if(!f(/^:\s*/))return c("property missing ':'");var n=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),a=e({type:"declaration",property:r.replace(B,""),value:n?G(n[0]).replace(B,""):""});return f(/^[;\s]*/),a}}function y(){var e,t=[];if(!l())return c("missing '{'");for(m(t);e=g();)!1!==e&&(t.push(e),m(t)),e=g();return u()?t:c("missing '}'")}function b(){for(var e,t=[],r=o();e=f(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),f(/^,\s*/);if(t.length)return r({type:"keyframe",values:t,declarations:y()})}var k,C=w("import"),T=w("charset"),S=w("namespace");function w(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=o(),n=f(t);if(n){var a={type:e};return a[e]=n[1].trim(),r(a)}}}function x(){if("@"===e[0])return function(){var e=o(),t=f(/^@([-\w]+)?keyframes\s*/);if(t){var r=t[1];if(!(t=f(/^([-\w]+)\s*/)))return c("@keyframes missing name");var n,a=t[1];if(!l())return c("@keyframes missing '{'");for(var i=m();n=b();)i.push(n),i=i.concat(m());return u()?e({type:"keyframes",name:a,vendor:r,keyframes:i}):c("@keyframes missing '}'")}}()||function(){var e=o(),t=f(/^@media *([^{]+)/);if(t){var r=G(t[1]);if(!l())return c("@media missing '{'");var n=m().concat(d());return u()?e({type:"media",media:r,rules:n}):c("@media missing '}'")}}()||function(){var e=o(),t=f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:G(t[1]),media:G(t[2])})}()||function(){var e=o(),t=f(/^@supports *([^{]+)/);if(t){var r=G(t[1]);if(!l())return c("@supports missing '{'");var n=m().concat(d());return u()?e({type:"supports",supports:r,rules:n}):c("@supports missing '}'")}}()||C()||T()||S()||function(){var e=o(),t=f(/^@([-\w]+)?document *([^{]+)/);if(t){var r=G(t[1]),n=G(t[2]);if(!l())return c("@document missing '{'");var a=m().concat(d());return u()?e({type:"document",document:n,vendor:r,rules:a}):c("@document missing '}'")}}()||function(){var e=o();if(f(/^@page */)){var t=v()||[];if(!l())return c("@page missing '{'");for(var r,n=m();r=g();)n.push(r),n=n.concat(m());return u()?e({type:"page",selectors:t,declarations:n}):c("@page missing '}'")}}()||function(){var e=o();if(f(/^@host\s*/)){if(!l())return c("@host missing '{'");var t=m().concat(d());return u()?e({type:"host",rules:t}):c("@host missing '}'")}}()||function(){var e=o();if(f(/^@font-face\s*/)){if(!l())return c("@font-face missing '{'");for(var t,r=m();t=g();)r.push(t),r=r.concat(m());return u()?e({type:"font-face",declarations:r}):c("@font-face missing '}'")}}()}function N(){var e=o(),t=v();return t?(m(),e({type:"rule",selectors:t,declarations:y()})):c("selector missing")}return H((k=d(),{type:"stylesheet",stylesheet:{source:t.source,rules:k,parsingErrors:s}}))}function G(e){return e?e.replace(/^\s+|\s+$/g,""):""}function H(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){H(e,n)})):i&&"object"==typeof i&&H(i,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var z={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 V=/([^\\]):hover/,q=new RegExp(V.source,"g");function $(e,t){var r=null==t?void 0:t.stylesWithHoverClass.get(e);if(r)return r;var n=P(e,{silent:!0});if(!n.stylesheet)return e;var a=[];if(n.stylesheet.rules.forEach((function(e){"selectors"in e&&(e.selectors||[]).forEach((function(e){V.test(e)&&a.push(e)}))})),0===a.length)return e;var o=new RegExp(a.filter((function(e,t){return a.indexOf(e)===t})).sort((function(e,t){return t.length-e.length})).map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})).join("|"),"g"),i=e.replace(o,(function(e){var t=e.replace(q,"$1.\\:hover");return"".concat(e,", ").concat(t)}));return null==t||t.stylesWithHoverClass.set(e,i),i}function Y(){return{stylesWithHoverClass:new Map}}function X(t,r){var n=r.doc,a=r.hackCss,o=r.cache;switch(t.type){case e.Document:return n.implementation.createDocument(null,"",null);case e.DocumentType:return n.implementation.createDocumentType(t.name||"html",t.publicId,t.systemId);case e.Element:var i,s=function(e){var t=z[e.tagName]?z[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(t);i=t.isSVG?n.createElementNS("http://www.w3.org/2000/svg",s):n.createElement(s);var c={};for(var l in t.attributes)if(Object.prototype.hasOwnProperty.call(t.attributes,l)){var u=t.attributes[l];if(("option"!==s||"selected"!==l||!1!==u)&&null!==u)if(!0===u&&(u=""),l.startsWith("rr_"))c[l]=u;else{var d="textarea"===s&&"value"===l,f="style"===s&&"_cssText"===l;if(f&&a&&"string"==typeof u&&(u=$(u,o)),!d&&!f||"string"!=typeof u)try{if(t.isSVG&&"xlink:href"===l)i.setAttributeNS("http://www.w3.org/1999/xlink",l,u.toString());else if("onload"===l||"onclick"===l||"onmouse"===l.substring(0,7))i.setAttribute("_"+l,u.toString());else{if("meta"===s&&"Content-Security-Policy"===t.attributes["http-equiv"]&&"content"===l){i.setAttribute("csp-content",u.toString());continue}("link"!==s||"preload"!==t.attributes.rel&&"modulepreload"!==t.attributes.rel||"script"!==t.attributes.as)&&("link"===s&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")||("img"===s&&t.attributes.srcset&&t.attributes.rr_dataURL?i.setAttribute("rrweb-original-srcset",t.attributes.srcset):i.setAttribute(l,u.toString())))}}catch(e){}else{for(var p=n.createTextNode(u),m=0,h=Array.from(i.childNodes);m<h.length;m++){var v=h[m];v.nodeType===i.TEXT_NODE&&i.removeChild(v)}i.appendChild(p)}}}var g=function(e){var r=c[e];if("canvas"===s&&"rr_dataURL"===e){var n=document.createElement("img");n.onload=function(){var e=i.getContext("2d");e&&e.drawImage(n,0,0,n.width,n.height)},n.src=r.toString(),i.RRNodeType&&(i.rr_dataURL=r.toString())}else if("img"===s&&"rr_dataURL"===e){var a=i;a.currentSrc.startsWith("data:")||(a.setAttribute("rrweb-original-src",t.attributes.src),a.src=r.toString())}if("rr_width"===e)i.style.width=r.toString();else if("rr_height"===e)i.style.height=r.toString();else if("rr_mediaCurrentTime"===e&&"number"==typeof r)i.currentTime=r;else if("rr_mediaState"===e)switch(r){case"played":i.play().catch((function(e){return console.warn("media playback error",e)}));break;case"paused":i.pause()}};for(var y in c)g(y);if(t.isShadowHost)if(i.shadowRoot)for(;i.shadowRoot.firstChild;)i.shadowRoot.removeChild(i.shadowRoot.firstChild);else i.attachShadow({mode:"open"});return i;case e.Text:return n.createTextNode(t.isStyle&&a?$(t.textContent,o):t.textContent);case e.CDATA:return n.createCDATASection(t.textContent);case e.Comment:return n.createComment(t.textContent);default:return null}}function J(r,n){var a=n.doc,o=n.mirror,i=n.skipChild,s=void 0!==i&&i,c=n.hackCss,l=void 0===c||c,u=n.afterAppend,d=n.cache;if(o.has(r.id)){var p=o.getNode(r.id);if(f(o.getMeta(p),r))return o.getNode(r.id)}var m=X(r,{doc:a,hackCss:l,cache:d});if(!m)return null;if(r.rootId&&o.getNode(r.rootId)!==a&&o.replace(r.rootId,a),r.type===e.Document&&(a.close(),a.open(),"BackCompat"===r.compatMode&&r.childNodes&&r.childNodes[0].type!==e.DocumentType&&(r.childNodes[0].type===e.Element&&"xmlns"in r.childNodes[0].attributes&&"http://www.w3.org/1999/xhtml"===r.childNodes[0].attributes.xmlns?a.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):a.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),m=a),o.add(m,r),(r.type===e.Document||r.type===e.Element)&&!s)for(var h=function(n){var i=J(n,{doc:a,mirror:o,skipChild:!1,hackCss:l,afterAppend:u,cache:d});if(!i)return console.warn("Failed to rebuild",n),"continue";if(n.isShadow&&t(m)&&m.shadowRoot)m.shadowRoot.appendChild(i);else if(r.type===e.Document&&n.type==e.Element){var s=i,c=null;s.childNodes.forEach((function(e){"BODY"===e.nodeName&&(c=e)})),c?(s.removeChild(c),m.appendChild(i),s.appendChild(c)):m.appendChild(i)}else m.appendChild(i);u&&u(i,n.id)},v=0,g=r.childNodes;v<g.length;v++){h(g[v])}return m}function K(t,r){var n=r.doc,a=r.onVisit,o=r.hackCss,i=void 0===o||o,c=r.afterAppend,l=r.cache,u=r.mirror,d=void 0===u?new s:u,f=J(t,{doc:n,mirror:d,skipChild:!1,hackCss:i,afterAppend:c,cache:l});return function(e,t){for(var r=0,n=e.getIds();r<n.length;r++){var a=n[r];e.has(a)&&t(e.getNode(a))}}(d,(function(t){a&&a(t),function(t,r){var n=r.getMeta(t);if((null==n?void 0:n.type)===e.Element){var a=t;for(var o in n.attributes)if(Object.prototype.hasOwnProperty.call(n.attributes,o)&&o.startsWith("rr_")){var i=n.attributes[o];"rr_scrollLeft"===o&&(a.scrollLeft=i),"rr_scrollTop"===o&&(a.scrollTop=i)}}}(t,d)})),f}export{y as IGNORED_NODE,s as Mirror,e as NodeType,$ as addHoverClass,J as buildNodeWithSN,D as classMatchesRegex,j as cleanupSnapshot,Y as createCache,c as createMirror,b as genId,o as getCssRuleString,a as getCssRulesString,p as getInputType,O as ignoreAttribute,d as is2DCanvasBlank,i as isCSSImportRule,t as isElement,n as isNativeShadowDom,f as isNodeMetaEqual,r as isShadowRoot,l as maskInputValue,_ as needMaskingText,K as rebuild,F as serializeNodeWithId,U as snapshot,u as toLowerCase,M as transformAttribute,W as visitSnapshot}; | ||
var e;function t(e){return e.nodeType===e.ELEMENT_NODE}function r(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function n(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function a(e){try{var t=e.rules||e.cssRules;return t?((r=Array.from(t).map(o).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),r):null}catch(e){return null}var r}function o(e){var t=e.cssText;if(s(e))try{t=a(e.styleSheet)||t}catch(e){}return i(t)}function i(e){if(e.includes(":")){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}return e}function s(e){return"styleSheet"in 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"}(e||(e={}));var c=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var r=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=r?r:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,r=this.getId(e);this.idNodeMap.delete(r),e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){var r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function l(){return new c}function u(e){var t=e.element,r=e.maskInputOptions,n=e.tagName,a=e.type,o=e.value,i=e.maskInputFn,s=o||"",c=a&&d(a);return(r[n.toLowerCase()]||c&&r[c])&&(s=i?i(s,t):"*".repeat(s.length)),s}function d(e){return e.toLowerCase()}function f(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;r<e.width;r+=50)for(var n=0;n<e.height;n+=50){var a=t.getImageData,o="__rrweb_original__"in a?a.__rrweb_original__:a;if(new Uint32Array(o.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((function(e){return 0!==e})))return!1}return!0}function p(t,r){return!(!t||!r||t.type!==r.type)&&(t.type===e.Document?t.compatMode===r.compatMode:t.type===e.DocumentType?t.name===r.name&&t.publicId===r.publicId&&t.systemId===r.systemId:t.type===e.Comment||t.type===e.Text||t.type===e.CDATA?t.textContent===r.textContent:t.type===e.Element&&(t.tagName===r.tagName&&JSON.stringify(t.attributes)===JSON.stringify(r.attributes)&&t.isSVG===r.isSVG&&t.needBlock===r.needBlock))}function m(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?d(t):null}var h,v,g=1,y=new RegExp("[^a-z0-9-_:]"),b=-2;function k(){return g++}var T=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,C=/^(?:[a-z+]+:)?\/\//i,S=/^www\..*/i,w=/^(data:)([^,]*),(.*)/i;function x(e,t){return(e||"").replace(T,(function(e,r,n,a,o,i){var s,c=n||o||i,l=r||a||"";if(!c)return e;if(C.test(c)||S.test(c))return"url(".concat(l).concat(c).concat(l,")");if(w.test(c))return"url(".concat(l).concat(c).concat(l,")");if("/"===c[0])return"url(".concat(l).concat((s=t,(s.indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+c)).concat(l,")");var u=t.split("/"),d=c.split("/");u.pop();for(var f=0,p=d;f<p.length;f++){var m=p[f];"."!==m&&(".."===m?u.pop():u.push(m))}return"url(".concat(l).concat(u.join("/")).concat(l,")")}))}var N=/^[^ \t\n\r\u000c]+/,E=/^[, \t\n\r\u000c]+/;function I(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function L(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function M(){var e=document.createElement("a");return e.href="",e.href}function O(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?I(e,n):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?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(E),!(r>=t.length);){var o=n(N);if(","===o.slice(-1))o=I(e,o.substring(0,o.length-1)),a.push(o);else{var i="";o=I(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?x(n,M()):"object"===t&&"data"===r?I(e,n):n:I(e,n):n}function D(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function _(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&_(e.parentNode,t,r);for(var n=e.classList.length;n--;){var a=e.classList[n];if(t.test(a))return!0}return!!r&&_(e.parentNode,t,r)}function A(e,t,r){try{var n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===n)return!1;if("string"==typeof t){if(n.classList.contains(t))return!0;if(n.closest(".".concat(t)))return!0}else if(_(n,t,!0))return!0;if(r){if(n.matches(r))return!0;if(n.closest(r))return!0}}catch(e){}return!1}function R(t,r){var n=r.doc,o=r.mirror,s=r.blockClass,c=r.blockSelector,l=r.maskTextClass,p=r.maskTextSelector,g=r.inlineStylesheet,b=r.maskInputOptions,k=void 0===b?{}:b,T=r.maskTextFn,C=r.maskInputFn,S=r.dataURLOptions,w=void 0===S?{}:S,N=r.inlineImages,E=r.recordCanvas,I=r.keepIframeSrcFn,_=r.newlyAddedElement,R=void 0!==_&&_,F=function(e,t){if(!t.hasNode(e))return;var r=t.getId(e);return 1===r?void 0:r}(n,o);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.Document,childNodes:[],compatMode:t.compatMode}:{type:e.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:F};case t.ELEMENT_NODE:return function(t,r){for(var n=r.doc,o=r.blockClass,i=r.blockSelector,s=r.inlineStylesheet,c=r.maskInputOptions,l=void 0===c?{}:c,p=r.maskInputFn,g=r.dataURLOptions,b=void 0===g?{}:g,k=r.inlineImages,T=r.recordCanvas,C=r.keepIframeSrcFn,S=r.newlyAddedElement,w=void 0!==S&&S,N=r.rootId,E=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var a=e.classList[n];if(t.test(a))return!0}if(r)return e.matches(r)}catch(e){}return!1}(t,o,i),I=function(e){if(e instanceof HTMLFormElement)return"form";var t=d(e.tagName);return y.test(t)?"div":t}(t),_={},A=t.attributes.length,R=0;R<A;R++){var F=t.attributes[R];D(I,F.name,F.value)||(_[F.name]=O(n,I,d(F.name),F.value))}if("link"===I&&s){var U=Array.from(n.styleSheets).find((function(e){return e.href===t.href})),W=null;U&&(W=a(U)),W&&(delete _.rel,delete _.href,_._cssText=x(W,U.href))}if("style"===I&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){(W=a(t.sheet))&&(_._cssText=x(W,M()))}if("input"===I||"textarea"===I||"select"===I){var j=t.value,B=t.checked;if("radio"!==_.type&&"checkbox"!==_.type&&"submit"!==_.type&&"button"!==_.type&&j){var P=m(t);_.value=u({element:t,type:P,tagName:I,value:j,maskInputOptions:l,maskInputFn:p})}else B&&(_.checked=B)}"option"===I&&(t.selected&&!l.select?_.selected=!0:delete _.selected);if("canvas"===I&&T)if("2d"===t.__context)f(t)||(_.rr_dataURL=t.toDataURL(b.type,b.quality));else if(!("__context"in t)){var G=t.toDataURL(b.type,b.quality),H=document.createElement("canvas");H.width=t.width,H.height=t.height,G!==H.toDataURL(b.type,b.quality)&&(_.rr_dataURL=G)}if("img"===I&&k){h||(h=n.createElement("canvas"),v=h.getContext("2d"));var z=t,V=z.crossOrigin;z.crossOrigin="anonymous";var $=function(){z.removeEventListener("load",$);try{h.width=z.naturalWidth,h.height=z.naturalHeight,v.drawImage(z,0,0),_.rr_dataURL=h.toDataURL(b.type,b.quality)}catch(e){console.warn("Cannot inline img src=".concat(z.currentSrc,"! Error: ").concat(e))}V?_.crossOrigin=V:z.removeAttribute("crossorigin")};z.complete&&0!==z.naturalWidth?$():z.addEventListener("load",$)}"audio"!==I&&"video"!==I||(_.rr_mediaState=t.paused?"paused":"played",_.rr_mediaCurrentTime=t.currentTime);w||(t.scrollLeft&&(_.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(_.rr_scrollTop=t.scrollTop));if(E){var q=t.getBoundingClientRect(),Y=q.width,X=q.height;_={class:_.class,rr_width:"".concat(Y,"px"),rr_height:"".concat(X,"px")}}"iframe"!==I||C(_.src)||(t.contentDocument||(_.rr_src=_.src),delete _.src);return{type:e.Element,tagName:I,attributes:_,childNodes:[],isSVG:L(t)||void 0,needBlock:E,rootId:N}}(t,{doc:n,blockClass:s,blockSelector:c,inlineStylesheet:g,maskInputOptions:k,maskInputFn:C,dataURLOptions:w,inlineImages:N,recordCanvas:E,keepIframeSrcFn:I,newlyAddedElement:R,rootId:F});case t.TEXT_NODE:return function(t,r){var n,a=r.maskTextClass,o=r.maskTextSelector,s=r.maskTextFn,c=r.rootId,l=t.parentNode&&t.parentNode.tagName,u=t.textContent,d="STYLE"===l||void 0,f="SCRIPT"===l||void 0;if(d&&u){try{t.nextSibling||t.previousSibling||(null===(n=t.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(u=(p=t.parentNode.sheet).cssRules?Array.from(p.cssRules).map((function(e){return e.cssText?i(e.cssText):""})).join(""):"")}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(e),t)}u=x(u,M())}var p;f&&(u="SCRIPT_PLACEHOLDER");!d&&!f&&u&&A(t,a,o)&&(u=s?s(u):u.replace(/[\S]/g,"*"));return{type:e.Text,textContent:u||"",isStyle:d,rootId:c}}(t,{maskTextClass:l,maskTextSelector:p,maskTextFn:T,rootId:F});case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:F};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:F};default:return!1}}function F(e){return null==e?"":e.toLowerCase()}function U(a,o){var i,s=o.doc,c=o.mirror,l=o.blockClass,u=o.blockSelector,d=o.maskTextClass,f=o.maskTextSelector,p=o.skipChild,m=void 0!==p&&p,h=o.inlineStylesheet,v=void 0===h||h,g=o.maskInputOptions,y=void 0===g?{}:g,b=o.maskTextFn,T=o.maskInputFn,C=o.slimDOMOptions,S=o.dataURLOptions,w=void 0===S?{}:S,x=o.inlineImages,N=void 0!==x&&x,E=o.recordCanvas,I=void 0!==E&&E,L=o.onSerialize,M=o.onIframeLoad,O=o.iframeLoadTimeout,D=void 0===O?5e3:O,_=o.onStylesheetLoad,A=o.stylesheetLoadTimeout,W=void 0===A?5e3:A,j=o.keepIframeSrcFn,B=void 0===j?function(){return!1}:j,P=o.newlyAddedElement,G=void 0!==P&&P,H=o.preserveWhiteSpace,z=void 0===H||H,V=R(a,{doc:s,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:f,inlineStylesheet:v,maskInputOptions:y,maskTextFn:b,maskInputFn:T,dataURLOptions:w,inlineImages:N,recordCanvas:I,keepIframeSrcFn:B,newlyAddedElement:G});if(!V)return console.warn(a,"not serialized"),null;i=c.hasNode(a)?c.getId(a):!function(t,r){if(r.comment&&t.type===e.Comment)return!0;if(t.type===e.Element){if(r.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")))return!0;if(r.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(F(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===F(t.attributes.name)||"icon"===F(t.attributes.rel)||"apple-touch-icon"===F(t.attributes.rel)||"shortcut icon"===F(t.attributes.rel))))return!0;if("meta"===t.tagName){if(r.headMetaDescKeywords&&F(t.attributes.name).match(/^description|keywords$/))return!0;if(r.headMetaSocial&&(F(t.attributes.property).match(/^(og|twitter|fb):/)||F(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===F(t.attributes.name)))return!0;if(r.headMetaRobots&&("robots"===F(t.attributes.name)||"googlebot"===F(t.attributes.name)||"bingbot"===F(t.attributes.name)))return!0;if(r.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(r.headMetaAuthorship&&("author"===F(t.attributes.name)||"generator"===F(t.attributes.name)||"framework"===F(t.attributes.name)||"publisher"===F(t.attributes.name)||"progid"===F(t.attributes.name)||F(t.attributes.property).match(/^article:/)||F(t.attributes.property).match(/^product:/)))return!0;if(r.headMetaVerification&&("google-site-verification"===F(t.attributes.name)||"yandex-verification"===F(t.attributes.name)||"csrf-token"===F(t.attributes.name)||"p:domain_verify"===F(t.attributes.name)||"verify-v1"===F(t.attributes.name)||"verification"===F(t.attributes.name)||"shopify-checkout-api-token"===F(t.attributes.name)))return!0}}return!1}(V,C)&&(z||V.type!==e.Text||V.isStyle||V.textContent.replace(/^\s+|\s+$/gm,"").length)?k():-2;var $=Object.assign(V,{id:i});if(c.add(a,$),-2===i)return null;L&&L(a);var q=!m;if($.type===e.Element){q=q&&!$.needBlock,delete $.needBlock;var Y=a.shadowRoot;Y&&n(Y)&&($.isShadowHost=!0)}if(($.type===e.Document||$.type===e.Element)&&q){C.headWhitespace&&$.type===e.Element&&"head"===$.tagName&&(z=!1);for(var X={doc:s,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:f,skipChild:m,inlineStylesheet:v,maskInputOptions:y,maskTextFn:b,maskInputFn:T,slimDOMOptions:C,dataURLOptions:w,inlineImages:N,recordCanvas:I,preserveWhiteSpace:z,onSerialize:L,onIframeLoad:M,iframeLoadTimeout:D,onStylesheetLoad:_,stylesheetLoadTimeout:W,keepIframeSrcFn:B},J=0,K=Array.from(a.childNodes);J<K.length;J++){(ee=U(K[J],X))&&$.childNodes.push(ee)}if(t(a)&&a.shadowRoot)for(var Q=0,Z=Array.from(a.shadowRoot.childNodes);Q<Z.length;Q++){var ee;(ee=U(Z[Q],X))&&(n(a.shadowRoot)&&(ee.isShadow=!0),$.childNodes.push(ee))}}return a.parentNode&&r(a.parentNode)&&n(a.parentNode)&&($.isShadow=!0),$.type===e.Element&&"iframe"===$.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){var i="about:blank";if(n.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var s=setTimeout((function(){o||(t(),o=!0)}),r);e.addEventListener("load",(function(){clearTimeout(s),o=!0,t()}))}}}(a,(function(){var e=a.contentDocument;if(e&&M){var t=U(e,{doc:e,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:f,skipChild:!1,inlineStylesheet:v,maskInputOptions:y,maskTextFn:b,maskInputFn:T,slimDOMOptions:C,dataURLOptions:w,inlineImages:N,recordCanvas:I,preserveWhiteSpace:z,onSerialize:L,onIframeLoad:M,iframeLoadTimeout:D,onStylesheetLoad:_,stylesheetLoadTimeout:W,keepIframeSrcFn:B});t&&M(a,t)}}),D),$.type===e.Element&&"link"===$.tagName&&"stylesheet"===$.attributes.rel&&function(e,t,r){var n,a=!1;try{n=e.sheet}catch(e){return}if(!n){var o=setTimeout((function(){a||(t(),a=!0)}),r);e.addEventListener("load",(function(){clearTimeout(o),a=!0,t()}))}}(a,(function(){if(_){var e=U(a,{doc:s,mirror:c,blockClass:l,blockSelector:u,maskTextClass:d,maskTextSelector:f,skipChild:!1,inlineStylesheet:v,maskInputOptions:y,maskTextFn:b,maskInputFn:T,slimDOMOptions:C,dataURLOptions:w,inlineImages:N,recordCanvas:I,preserveWhiteSpace:z,onSerialize:L,onIframeLoad:M,iframeLoadTimeout:D,onStylesheetLoad:_,stylesheetLoadTimeout:W,keepIframeSrcFn:B});e&&_(a,e)}}),W),$}function W(e,t){var r=t||{},n=r.mirror,a=void 0===n?new c:n,o=r.blockClass,i=void 0===o?"rr-block":o,s=r.blockSelector,l=void 0===s?null:s,u=r.maskTextClass,d=void 0===u?"rr-mask":u,f=r.maskTextSelector,p=void 0===f?null:f,m=r.inlineStylesheet,h=void 0===m||m,v=r.inlineImages,g=void 0!==v&&v,y=r.recordCanvas,b=void 0!==y&&y,k=r.maskAllInputs,T=void 0!==k&&k,C=r.maskTextFn,S=r.maskInputFn,w=r.slimDOM,x=void 0!==w&&w,N=r.dataURLOptions,E=r.preserveWhiteSpace,I=r.onSerialize,L=r.onIframeLoad,M=r.iframeLoadTimeout,O=r.onStylesheetLoad,D=r.stylesheetLoadTimeout,_=r.keepIframeSrcFn;return U(e,{doc:e,mirror:a,blockClass:i,blockSelector:l,maskTextClass:d,maskTextSelector:p,skipChild:!1,inlineStylesheet:h,maskInputOptions:!0===T?{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===T?{password:!0}:T,maskTextFn:C,maskInputFn:S,slimDOMOptions:!0===x||"all"===x?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===x,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===x?{}:x,dataURLOptions:N,inlineImages:g,recordCanvas:b,preserveWhiteSpace:E,onSerialize:I,onIframeLoad:L,iframeLoadTimeout:M,onStylesheetLoad:O,stylesheetLoadTimeout:D,keepIframeSrcFn:void 0===_?function(){return!1}:_,newlyAddedElement:!1})}function j(t,r){!function t(n){r(n),n.type!==e.Document&&n.type!==e.Element||n.childNodes.forEach(t)}(t)}function B(){g=1}var P=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function G(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),p(),t}}var i=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("".concat(t.source||"",":").concat(r,":").concat(n,": ").concat(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 l(){return f(/^{\s*/)}function u(){return f(/^}/)}function d(){var t,r=[];for(p(),m(r);e.length&&"}"!==e.charAt(0)&&(t=x()||N());)!1!==t&&(r.push(t),m(r));return r}function f(t){var r=t.exec(e);if(r){var n=r[0];return a(n),e=e.slice(n.length),r}}function p(){f(/^\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=f(/^([^{]+)/);if(e)return H(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=f(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=H(t[0]);if(!f(/^:\s*/))return c("property missing ':'");var n=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),a=e({type:"declaration",property:r.replace(P,""),value:n?H(n[0]).replace(P,""):""});return f(/^[;\s]*/),a}}function y(){var e,t=[];if(!l())return c("missing '{'");for(m(t);e=g();)!1!==e&&(t.push(e),m(t)),e=g();return u()?t:c("missing '}'")}function b(){for(var e,t=[],r=o();e=f(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),f(/^,\s*/);if(t.length)return r({type:"keyframe",values:t,declarations:y()})}var k,T=w("import"),C=w("charset"),S=w("namespace");function w(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=o(),n=f(t);if(n){var a={type:e};return a[e]=n[1].trim(),r(a)}}}function x(){if("@"===e[0])return function(){var e=o(),t=f(/^@([-\w]+)?keyframes\s*/);if(t){var r=t[1];if(!(t=f(/^([-\w]+)\s*/)))return c("@keyframes missing name");var n,a=t[1];if(!l())return c("@keyframes missing '{'");for(var i=m();n=b();)i.push(n),i=i.concat(m());return u()?e({type:"keyframes",name:a,vendor:r,keyframes:i}):c("@keyframes missing '}'")}}()||function(){var e=o(),t=f(/^@media *([^{]+)/);if(t){var r=H(t[1]);if(!l())return c("@media missing '{'");var n=m().concat(d());return u()?e({type:"media",media:r,rules:n}):c("@media missing '}'")}}()||function(){var e=o(),t=f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:H(t[1]),media:H(t[2])})}()||function(){var e=o(),t=f(/^@supports *([^{]+)/);if(t){var r=H(t[1]);if(!l())return c("@supports missing '{'");var n=m().concat(d());return u()?e({type:"supports",supports:r,rules:n}):c("@supports missing '}'")}}()||T()||C()||S()||function(){var e=o(),t=f(/^@([-\w]+)?document *([^{]+)/);if(t){var r=H(t[1]),n=H(t[2]);if(!l())return c("@document missing '{'");var a=m().concat(d());return u()?e({type:"document",document:n,vendor:r,rules:a}):c("@document missing '}'")}}()||function(){var e=o();if(f(/^@page */)){var t=v()||[];if(!l())return c("@page missing '{'");for(var r,n=m();r=g();)n.push(r),n=n.concat(m());return u()?e({type:"page",selectors:t,declarations:n}):c("@page missing '}'")}}()||function(){var e=o();if(f(/^@host\s*/)){if(!l())return c("@host missing '{'");var t=m().concat(d());return u()?e({type:"host",rules:t}):c("@host missing '}'")}}()||function(){var e=o();if(f(/^@font-face\s*/)){if(!l())return c("@font-face missing '{'");for(var t,r=m();t=g();)r.push(t),r=r.concat(m());return u()?e({type:"font-face",declarations:r}):c("@font-face missing '}'")}}()}function N(){var e=o(),t=v();return t?(m(),e({type:"rule",selectors:t,declarations:y()})):c("selector missing")}return z((k=d(),{type:"stylesheet",stylesheet:{source:t.source,rules:k,parsingErrors:s}}))}function H(e){return e?e.replace(/^\s+|\s+$/g,""):""}function z(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){z(e,n)})):i&&"object"==typeof i&&z(i,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var V={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 $=/([^\\]):hover/,q=new RegExp($.source,"g");function Y(e,t){var r=null==t?void 0:t.stylesWithHoverClass.get(e);if(r)return r;var n=G(e,{silent:!0});if(!n.stylesheet)return e;var a=[];if(n.stylesheet.rules.forEach((function(e){"selectors"in e&&(e.selectors||[]).forEach((function(e){$.test(e)&&a.push(e)}))})),0===a.length)return e;var o=new RegExp(a.filter((function(e,t){return a.indexOf(e)===t})).sort((function(e,t){return t.length-e.length})).map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})).join("|"),"g"),i=e.replace(o,(function(e){var t=e.replace(q,"$1.\\:hover");return"".concat(e,", ").concat(t)}));return null==t||t.stylesWithHoverClass.set(e,i),i}function X(){return{stylesWithHoverClass:new Map}}function J(t,r){var n=r.doc,a=r.hackCss,o=r.cache;switch(t.type){case e.Document:return n.implementation.createDocument(null,"",null);case e.DocumentType:return n.implementation.createDocumentType(t.name||"html",t.publicId,t.systemId);case e.Element:var i,s=function(e){var t=V[e.tagName]?V[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(t);i=t.isSVG?n.createElementNS("http://www.w3.org/2000/svg",s):n.createElement(s);var c={};for(var l in t.attributes)if(Object.prototype.hasOwnProperty.call(t.attributes,l)){var u=t.attributes[l];if(("option"!==s||"selected"!==l||!1!==u)&&null!==u)if(!0===u&&(u=""),l.startsWith("rr_"))c[l]=u;else{var d="textarea"===s&&"value"===l,f="style"===s&&"_cssText"===l;if(f&&a&&"string"==typeof u&&(u=Y(u,o)),!d&&!f||"string"!=typeof u)try{if(t.isSVG&&"xlink:href"===l)i.setAttributeNS("http://www.w3.org/1999/xlink",l,u.toString());else if("onload"===l||"onclick"===l||"onmouse"===l.substring(0,7))i.setAttribute("_"+l,u.toString());else{if("meta"===s&&"Content-Security-Policy"===t.attributes["http-equiv"]&&"content"===l){i.setAttribute("csp-content",u.toString());continue}("link"!==s||"preload"!==t.attributes.rel&&"modulepreload"!==t.attributes.rel||"script"!==t.attributes.as)&&("link"===s&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")||("img"===s&&t.attributes.srcset&&t.attributes.rr_dataURL?i.setAttribute("rrweb-original-srcset",t.attributes.srcset):i.setAttribute(l,u.toString())))}}catch(e){}else{for(var p=n.createTextNode(u),m=0,h=Array.from(i.childNodes);m<h.length;m++){var v=h[m];v.nodeType===i.TEXT_NODE&&i.removeChild(v)}i.appendChild(p)}}}var g=function(e){var r=c[e];if("canvas"===s&&"rr_dataURL"===e){var n=document.createElement("img");n.onload=function(){var e=i.getContext("2d");e&&e.drawImage(n,0,0,n.width,n.height)},n.src=r.toString(),i.RRNodeType&&(i.rr_dataURL=r.toString())}else if("img"===s&&"rr_dataURL"===e){var a=i;a.currentSrc.startsWith("data:")||(a.setAttribute("rrweb-original-src",t.attributes.src),a.src=r.toString())}if("rr_width"===e)i.style.width=r.toString();else if("rr_height"===e)i.style.height=r.toString();else if("rr_mediaCurrentTime"===e&&"number"==typeof r)i.currentTime=r;else if("rr_mediaState"===e)switch(r){case"played":i.play().catch((function(e){return console.warn("media playback error",e)}));break;case"paused":i.pause()}};for(var y in c)g(y);if(t.isShadowHost)if(i.shadowRoot)for(;i.shadowRoot.firstChild;)i.shadowRoot.removeChild(i.shadowRoot.firstChild);else i.attachShadow({mode:"open"});return i;case e.Text:return n.createTextNode(t.isStyle&&a?Y(t.textContent,o):t.textContent);case e.CDATA:return n.createCDATASection(t.textContent);case e.Comment:return n.createComment(t.textContent);default:return null}}function K(r,n){var a=n.doc,o=n.mirror,i=n.skipChild,s=void 0!==i&&i,c=n.hackCss,l=void 0===c||c,u=n.afterAppend,d=n.cache;if(o.has(r.id)){var f=o.getNode(r.id);if(p(o.getMeta(f),r))return o.getNode(r.id)}var m=J(r,{doc:a,hackCss:l,cache:d});if(!m)return null;if(r.rootId&&o.getNode(r.rootId)!==a&&o.replace(r.rootId,a),r.type===e.Document&&(a.close(),a.open(),"BackCompat"===r.compatMode&&r.childNodes&&r.childNodes[0].type!==e.DocumentType&&(r.childNodes[0].type===e.Element&&"xmlns"in r.childNodes[0].attributes&&"http://www.w3.org/1999/xhtml"===r.childNodes[0].attributes.xmlns?a.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):a.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),m=a),o.add(m,r),(r.type===e.Document||r.type===e.Element)&&!s)for(var h=function(n){var i=K(n,{doc:a,mirror:o,skipChild:!1,hackCss:l,afterAppend:u,cache:d});if(!i)return console.warn("Failed to rebuild",n),"continue";if(n.isShadow&&t(m)&&m.shadowRoot)m.shadowRoot.appendChild(i);else if(r.type===e.Document&&n.type==e.Element){var s=i,c=null;s.childNodes.forEach((function(e){"BODY"===e.nodeName&&(c=e)})),c?(s.removeChild(c),m.appendChild(i),s.appendChild(c)):m.appendChild(i)}else m.appendChild(i);u&&u(i,n.id)},v=0,g=r.childNodes;v<g.length;v++){h(g[v])}return m}function Q(t,r){var n=r.doc,a=r.onVisit,o=r.hackCss,i=void 0===o||o,s=r.afterAppend,l=r.cache,u=r.mirror,d=void 0===u?new c:u,f=K(t,{doc:n,mirror:d,skipChild:!1,hackCss:i,afterAppend:s,cache:l});return function(e,t){for(var r=0,n=e.getIds();r<n.length;r++){var a=n[r];e.has(a)&&t(e.getNode(a))}}(d,(function(t){a&&a(t),function(t,r){var n=r.getMeta(t);if((null==n?void 0:n.type)===e.Element){var a=t;for(var o in n.attributes)if(Object.prototype.hasOwnProperty.call(n.attributes,o)&&o.startsWith("rr_")){var i=n.attributes[o];"rr_scrollLeft"===o&&(a.scrollLeft=i),"rr_scrollTop"===o&&(a.scrollTop=i)}}}(t,d)})),f}export{b as IGNORED_NODE,c as Mirror,e as NodeType,Y as addHoverClass,K as buildNodeWithSN,_ as classMatchesRegex,B as cleanupSnapshot,X as createCache,l as createMirror,k as genId,o as getCssRuleString,a as getCssRulesString,m as getInputType,D as ignoreAttribute,f as is2DCanvasBlank,s as isCSSImportRule,t as isElement,n as isNativeShadowDom,p as isNodeMetaEqual,r as isShadowRoot,u as maskInputValue,A as needMaskingText,Q as rebuild,U as serializeNodeWithId,W as snapshot,d as toLowerCase,O as transformAttribute,i as validateStringifiedCssRule,j as visitSnapshot}; | ||
//# sourceMappingURL=rrweb-snapshot.min.js.map |
{ | ||
"name": "rrweb-snapshot", | ||
"version": "2.0.0-alpha.9", | ||
"version": "2.0.0-alpha.10", | ||
"description": "rrweb's component to take a snapshot of DOM, aka DOM serializer", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -7,2 +7,3 @@ import { MaskInputFn, MaskInputOptions, IMirror, serializedNodeWithId, serializedNode } from './types'; | ||
export declare function getCssRuleString(rule: CSSRule): string; | ||
export declare function validateStringifiedCssRule(cssStringified: string): string; | ||
export declare function isCSSImportRule(rule: CSSRule): rule is CSSImportRule; | ||
@@ -9,0 +10,0 @@ export declare class Mirror implements IMirror<Node> { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
290530
6397