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