core-outline 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/main.js +16 -0
- package/.storybook/preview.js +13 -0
- package/dist/index.es.js +15 -0
- package/dist/index.js +15 -0
- package/package.json +37 -15
- package/rollup.config.js +35 -0
- package/src/components/CoreOutline/CoreOutline.js +45 -0
- package/src/components/CoreOutline/RWebRecorder.js +26 -0
- package/src/components/CoreOutline/index.js +1 -0
- package/src/index.js +1 -0
- package/src/stories/Button.jsx +40 -0
- package/src/stories/Button.stories.js +49 -0
- package/src/stories/Configure.mdx +364 -0
- package/src/stories/Header.jsx +60 -0
- package/src/stories/Header.stories.js +29 -0
- package/src/stories/Page.jsx +69 -0
- package/src/stories/Page.stories.js +28 -0
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +1 -0
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +1 -0
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +1 -0
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +1 -0
- package/src/stories/assets/youtube.svg +1 -0
- package/src/stories/button.css +30 -0
- package/src/stories/header.css +32 -0
- package/src/stories/page.css +69 -0
- package/README.md +0 -2
- package/index.js +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** @type { import('@storybook/react-webpack5').StorybookConfig } */
|
|
2
|
+
const config = {
|
|
3
|
+
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
|
|
4
|
+
addons: [
|
|
5
|
+
"@storybook/addon-webpack5-compiler-swc",
|
|
6
|
+
"@storybook/addon-onboarding",
|
|
7
|
+
"@storybook/addon-essentials",
|
|
8
|
+
"@chromatic-com/storybook",
|
|
9
|
+
"@storybook/addon-interactions",
|
|
10
|
+
],
|
|
11
|
+
framework: {
|
|
12
|
+
name: "@storybook/react-webpack5",
|
|
13
|
+
options: {},
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
export default config;
|
package/dist/index.es.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import e,{useRef as t,useEffect as n}from"react";var o;function r(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function s(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function a(e){try{var t=e.rules||e.cssRules;return t?((n=Array.from(t).map(i).join("")).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),n):null}catch(e){return null}var n}function i(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=a(e.styleSheet)||t}catch(e){}return t}!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"}(o||(o={}));var c=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var n=this.getNode(e);if(n){var o=this.nodeMetaMap.get(n);o&&this.nodeMetaMap.set(t,o)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function l(e){var t=e.maskInputOptions,n=e.tagName,o=e.type,r=e.value,s=e.maskInputFn,a=r||"";return(t[n.toLowerCase()]||t[o])&&(a=s?s(a):"*".repeat(a.length)),a}var d="__rrweb_original__";var u,h,p=1,g=new RegExp("[^a-z0-9-_:]");function m(){return p++}var I=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,C=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,f=/^(data:)([^,]*),(.*)/i;function y(e,t){return(e||"").replace(I,(function(e,n,o,r,s,a){var i,c=o||s||a,l=n||r||"";if(!c)return e;if(!C.test(c))return"url(".concat(l).concat(c).concat(l,")");if(f.test(c))return"url(".concat(l).concat(c).concat(l,")");if("/"===c[0])return"url(".concat(l).concat((i=t,(i.indexOf("//")>-1?i.split("/").slice(0,3).join("/"):i.split("/")[0]).split("?")[0]+c)).concat(l,")");var d=t.split("/"),u=c.split("/");d.pop();for(var h=0,p=u;h<p.length;h++){var g=p[h];"."!==g&&(".."===g?d.pop():d.push(g))}return"url(".concat(l).concat(d.join("/")).concat(l,")")}))}var S=/^[^ \t\n\r\u000c]+/,b=/^[, \t\n\r\u000c]+/;function v(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function A(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function k(){var e=document.createElement("a");return e.href="",e.href}function w(e,t,n,o){return"src"===n||"href"===n&&o&&("use"!==t||"#"!==o[0])||"xlink:href"===n&&o&&"#"!==o[0]?v(e,o):"background"!==n||!o||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n&&o?function(e,t){if(""===t.trim())return t;var n=0;function o(e){var o,r=e.exec(t.substring(n));return r?(o=r[0],n+=o.length,o):""}for(var r=[];o(b),!(n>=t.length);){var s=o(S);if(","===s.slice(-1))s=v(e,s.substring(0,s.length-1)),r.push(s);else{var a="";s=v(e,s);for(var i=!1;;){var c=t.charAt(n);if(""===c){r.push((s+a).trim());break}if(i)")"===c&&(i=!1);else{if(","===c){n+=1,r.push((s+a).trim());break}"("===c&&(i=!0)}a+=c,n+=1}}}return r.join(", ")}(e,o):"style"===n&&o?y(o,k()):"object"===t&&"data"===n&&o?v(e,o):o:v(e,o)}function M(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&M(e.parentNode,t,n);for(var o=e.classList.length;o--;){var r=e.classList[o];if(t.test(r))return!0}return!!n&&M(e.parentNode,t,n)}function T(e,t,n){var o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===o)return!1;if("string"==typeof t){if(o.classList.contains(t))return!0;if(o.closest(".".concat(t)))return!0}else if(M(o,t,!0))return!0;if(n){if(o.matches(n))return!0;if(o.closest(n))return!0}return!1}function N(e,t){var n=t.doc,r=t.mirror,s=t.blockClass,i=t.blockSelector,c=t.maskTextClass,p=t.maskTextSelector,m=t.inlineStylesheet,I=t.maskInputOptions,C=void 0===I?{}:I,f=t.maskTextFn,S=t.maskInputFn,b=t.dataURLOptions,v=void 0===b?{}:b,M=t.inlineImages,N=t.recordCanvas,R=t.keepIframeSrcFn,E=t.newlyAddedElement,O=void 0!==E&&E,F=function(e,t){if(!t.hasNode(e))return;var n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:o.Document,childNodes:[],compatMode:e.compatMode}:{type:o.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:o.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:F};case e.ELEMENT_NODE:return function(e,t){for(var n=t.doc,r=t.blockClass,s=t.blockSelector,i=t.inlineStylesheet,c=t.maskInputOptions,p=void 0===c?{}:c,m=t.maskInputFn,I=t.dataURLOptions,C=void 0===I?{}:I,f=t.inlineImages,S=t.recordCanvas,b=t.keepIframeSrcFn,v=t.newlyAddedElement,M=void 0!==v&&v,T=t.rootId,N=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var o=e.classList.length;o--;){var r=e.classList[o];if(t.test(r))return!0}return!!n&&e.matches(n)}(e,r,s),R=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return g.test(t)?"div":t}(e),E={},O=e.attributes.length,F=0;F<O;F++){var x=e.attributes[F];E[x.name]=w(n,R,x.name,x.value)}if("link"===R&&i){var L=Array.from(n.styleSheets).find((function(t){return t.href===e.href})),D=null;L&&(D=a(L)),D&&(delete E.rel,delete E.href,E._cssText=y(D,L.href))}if("style"===R&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){(D=a(e.sheet))&&(E._cssText=y(D,k()))}if("input"===R||"textarea"===R||"select"===R){var W=e.value,Z=e.checked;"radio"!==E.type&&"checkbox"!==E.type&&"submit"!==E.type&&"button"!==E.type&&W?E.value=l({type:E.type,tagName:R,value:W,maskInputOptions:p,maskInputFn:m}):Z&&(E.checked=Z)}"option"===R&&(e.selected&&!p.select?E.selected=!0:delete E.selected);if("canvas"===R&&S)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var o=0;o<e.height;o+=50){var r=t.getImageData,s=d in r?r[d]:r;if(new Uint32Array(s.call(t,n,o,Math.min(50,e.width-n),Math.min(50,e.height-o)).data.buffer).some((function(e){return 0!==e})))return!1}return!0})(e)||(E.rr_dataURL=e.toDataURL(C.type,C.quality));else if(!("__context"in e)){var B=e.toDataURL(C.type,C.quality),G=document.createElement("canvas");G.width=e.width,G.height=e.height,B!==G.toDataURL(C.type,C.quality)&&(E.rr_dataURL=B)}if("img"===R&&f){u||(u=n.createElement("canvas"),h=u.getContext("2d"));var V=e,U=V.crossOrigin;V.crossOrigin="anonymous";var K=function(){try{u.width=V.naturalWidth,u.height=V.naturalHeight,h.drawImage(V,0,0),E.rr_dataURL=u.toDataURL(C.type,C.quality)}catch(e){console.warn("Cannot inline img src=".concat(V.currentSrc,"! Error: ").concat(e))}U?E.crossOrigin=U:V.removeAttribute("crossorigin")};V.complete&&0!==V.naturalWidth?K():V.onload=K}"audio"!==R&&"video"!==R||(E.rr_mediaState=e.paused?"paused":"played",E.rr_mediaCurrentTime=e.currentTime);M||(e.scrollLeft&&(E.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(E.rr_scrollTop=e.scrollTop));if(N){var Y=e.getBoundingClientRect(),_=Y.width,J=Y.height;E={class:E.class,rr_width:"".concat(_,"px"),rr_height:"".concat(J,"px")}}"iframe"!==R||b(E.src)||(e.contentDocument||(E.rr_src=E.src),delete E.src);return{type:o.Element,tagName:R,attributes:E,childNodes:[],isSVG:A(e)||void 0,needBlock:N,rootId:T}}(e,{doc:n,blockClass:s,blockSelector:i,inlineStylesheet:m,maskInputOptions:C,maskInputFn:S,dataURLOptions:v,inlineImages:M,recordCanvas:N,keepIframeSrcFn:R,newlyAddedElement:O,rootId:F});case e.TEXT_NODE:return function(e,t){var n,r=t.maskTextClass,s=t.maskTextSelector,a=t.maskTextFn,i=t.rootId,c=e.parentNode&&e.parentNode.tagName,l=e.textContent,d="STYLE"===c||void 0,u="SCRIPT"===c||void 0;if(d&&l){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(l=(h=e.parentNode.sheet).cssRules?Array.from(h.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(t),e)}l=y(l,k())}var h;u&&(l="SCRIPT_PLACEHOLDER");!d&&!u&&l&&T(e,r,s)&&(l=a?a(l):l.replace(/[\S]/g,"*"));return{type:o.Text,textContent:l||"",isStyle:d,rootId:i}}(e,{maskTextClass:c,maskTextSelector:p,maskTextFn:f,rootId:F});case e.CDATA_SECTION_NODE:return{type:o.CDATA,textContent:"",rootId:F};case e.COMMENT_NODE:return{type:o.Comment,textContent:e.textContent||"",rootId:F};default:return!1}}function R(e){return void 0===e?"":e.toLowerCase()}function E(e,t){var n,a=t.doc,i=t.mirror,c=t.blockClass,l=t.blockSelector,d=t.maskTextClass,u=t.maskTextSelector,h=t.skipChild,p=void 0!==h&&h,g=t.inlineStylesheet,I=void 0===g||g,C=t.maskInputOptions,f=void 0===C?{}:C,y=t.maskTextFn,S=t.maskInputFn,b=t.slimDOMOptions,v=t.dataURLOptions,A=void 0===v?{}:v,k=t.inlineImages,w=void 0!==k&&k,M=t.recordCanvas,T=void 0!==M&&M,O=t.onSerialize,F=t.onIframeLoad,x=t.iframeLoadTimeout,L=void 0===x?5e3:x,D=t.onStylesheetLoad,W=t.stylesheetLoadTimeout,Z=void 0===W?5e3:W,B=t.keepIframeSrcFn,G=void 0===B?function(){return!1}:B,V=t.newlyAddedElement,U=void 0!==V&&V,K=t.preserveWhiteSpace,Y=void 0===K||K,_=N(e,{doc:a,mirror:i,blockClass:c,blockSelector:l,maskTextClass:d,maskTextSelector:u,inlineStylesheet:I,maskInputOptions:f,maskTextFn:y,maskInputFn:S,dataURLOptions:A,inlineImages:w,recordCanvas:T,keepIframeSrcFn:G,newlyAddedElement:U});if(!_)return console.warn(e,"not serialized"),null;n=i.hasNode(e)?i.getId(e):!function(e,t){if(t.comment&&e.type===o.Comment)return!0;if(e.type===o.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&"preload"===e.attributes.rel&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(R(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===R(e.attributes.name)||"icon"===R(e.attributes.rel)||"apple-touch-icon"===R(e.attributes.rel)||"shortcut icon"===R(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&R(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(R(e.attributes.property).match(/^(og|twitter|fb):/)||R(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===R(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===R(e.attributes.name)||"googlebot"===R(e.attributes.name)||"bingbot"===R(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===R(e.attributes.name)||"generator"===R(e.attributes.name)||"framework"===R(e.attributes.name)||"publisher"===R(e.attributes.name)||"progid"===R(e.attributes.name)||R(e.attributes.property).match(/^article:/)||R(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===R(e.attributes.name)||"yandex-verification"===R(e.attributes.name)||"csrf-token"===R(e.attributes.name)||"p:domain_verify"===R(e.attributes.name)||"verify-v1"===R(e.attributes.name)||"verification"===R(e.attributes.name)||"shopify-checkout-api-token"===R(e.attributes.name)))return!0}}return!1}(_,b)&&(Y||_.type!==o.Text||_.isStyle||_.textContent.replace(/^\s+|\s+$/gm,"").length)?m():-2;var J=Object.assign(_,{id:n});if(i.add(e,J),-2===n)return null;O&&O(e);var z=!p;if(J.type===o.Element){z=z&&!J.needBlock,delete J.needBlock;var Q=e.shadowRoot;Q&&s(Q)&&(J.isShadowHost=!0)}if((J.type===o.Document||J.type===o.Element)&&z){b.headWhitespace&&J.type===o.Element&&"head"===J.tagName&&(Y=!1);for(var H={doc:a,mirror:i,blockClass:c,blockSelector:l,maskTextClass:d,maskTextSelector:u,skipChild:p,inlineStylesheet:I,maskInputOptions:f,maskTextFn:y,maskInputFn:S,slimDOMOptions:b,dataURLOptions:A,inlineImages:w,recordCanvas:T,preserveWhiteSpace:Y,onSerialize:O,onIframeLoad:F,iframeLoadTimeout:L,onStylesheetLoad:D,stylesheetLoadTimeout:Z,keepIframeSrcFn:G},X=0,j=Array.from(e.childNodes);X<j.length;X++){($=E(j[X],H))&&J.childNodes.push($)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(var P=0,q=Array.from(e.shadowRoot.childNodes);P<q.length;P++){var $;($=E(q[P],H))&&(s(e.shadowRoot)&&($.isShadow=!0),J.childNodes.push($))}}return e.parentNode&&r(e.parentNode)&&s(e.parentNode)&&(J.isShadow=!0),J.type===o.Element&&"iframe"===J.tagName&&function(e,t,n){var o=e.contentWindow;if(o){var r,s=!1;try{r=o.document.readyState}catch(e){return}if("complete"===r){var a="about:blank";if(o.location.href!==a||e.src===a||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var i=setTimeout((function(){s||(t(),s=!0)}),n);e.addEventListener("load",(function(){clearTimeout(i),s=!0,t()}))}}}(e,(function(){var t=e.contentDocument;if(t&&F){var n=E(t,{doc:t,mirror:i,blockClass:c,blockSelector:l,maskTextClass:d,maskTextSelector:u,skipChild:!1,inlineStylesheet:I,maskInputOptions:f,maskTextFn:y,maskInputFn:S,slimDOMOptions:b,dataURLOptions:A,inlineImages:w,recordCanvas:T,preserveWhiteSpace:Y,onSerialize:O,onIframeLoad:F,iframeLoadTimeout:L,onStylesheetLoad:D,stylesheetLoadTimeout:Z,keepIframeSrcFn:G});n&&F(e,n)}}),L),J.type===o.Element&&"link"===J.tagName&&"stylesheet"===J.attributes.rel&&function(e,t,n){var o,r=!1;try{o=e.sheet}catch(e){return}if(!o){var s=setTimeout((function(){r||(t(),r=!0)}),n);e.addEventListener("load",(function(){clearTimeout(s),r=!0,t()}))}}(e,(function(){if(D){var t=E(e,{doc:a,mirror:i,blockClass:c,blockSelector:l,maskTextClass:d,maskTextSelector:u,skipChild:!1,inlineStylesheet:I,maskInputOptions:f,maskTextFn:y,maskInputFn:S,slimDOMOptions:b,dataURLOptions:A,inlineImages:w,recordCanvas:T,preserveWhiteSpace:Y,onSerialize:O,onIframeLoad:F,iframeLoadTimeout:L,onStylesheetLoad:D,stylesheetLoadTimeout:Z,keepIframeSrcFn:G});t&&D(e,t)}}),Z),J}function O(e,t,n=document){const o={capture:!0,passive:!0};return n.addEventListener(e,t,o),()=>n.removeEventListener(e,t,o)}const F="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let x={map:{},getId:()=>(console.error(F),-1),getNode:()=>(console.error(F),null),removeNodeFromMap(){console.error(F)},has:()=>(console.error(F),!1),reset(){console.error(F)}};function L(e,t,n={}){let o=null,r=0;return function(...s){const a=Date.now();r||!1!==n.leading||(r=a);const i=t-(a-r),c=this;i<=0||i>t?(o&&(clearTimeout(o),o=null),r=a,e.apply(c,s)):o||!1===n.trailing||(o=setTimeout((()=>{r=!1===n.leading?0:Date.now(),o=null,e.apply(c,s)}),i))}}function D(e,t,n,o,r=window){const s=r.Object.getOwnPropertyDescriptor(e,t);return r.Object.defineProperty(e,t,o?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>D(e,t,s||{},!0)}function W(e,t,n){try{if(!(t in e))return()=>{};const o=e[t],r=n(o);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:o}})),e[t]=r,()=>{e[t]=o}}catch(e){return()=>{}}}function Z(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function B(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function G(e,t,n,o){if(!e)return!1;const r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!r)return!1;if("string"==typeof t){if(r.classList.contains(t))return!0;if(o&&null!==r.closest("."+t))return!0}else if(M(r,t,o))return!0;if(n){if(e.matches(n))return!0;if(o&&null!==r.closest(n))return!0}return!1}function V(e,t){return-2===t.getId(e)}function U(e,t){if(r(e))return!1;const n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||U(e.parentNode,t))}function K(e){return Boolean(e.changedTouches)}function Y(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function _(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function J(e){return Boolean(null==e?void 0:e.shadowRoot)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(x=new Proxy(x,{get:(e,t,n)=>("map"===t&&console.error(F),Reflect.get(e,t,n))}));class z{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}var Q=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(Q||{}),H=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e))(H||{}),X=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(X||{}),j=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(j||{});function P(e){return"__ln"in e}class q{constructor(){this.length=0,this.head=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&P(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&P(e.nextSibling)&&e.nextSibling.__ln.previous){const n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)}}const $=(e,t)=>`${e}@${t}`;class ee{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],t=new q,n=e=>{let t=e,n=-2;for(;-2===n;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},o=o=>{var s,a,i,c;let l=null;(null===(a=null===(s=o.getRootNode)||void 0===s?void 0:s.call(o))||void 0===a?void 0:a.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&o.getRootNode().host&&(l=o.getRootNode().host);let d=l;for(;(null===(c=null===(i=null==d?void 0:d.getRootNode)||void 0===i?void 0:i.call(d))||void 0===c?void 0:c.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&d.getRootNode().host;)d=d.getRootNode().host;const u=!(this.doc.contains(o)||d&&this.doc.contains(d));if(!o.parentNode||u)return;const h=r(o.parentNode)?this.mirror.getId(l):this.mirror.getId(o.parentNode),p=n(o);if(-1===h||-1===p)return t.addNode(o);const g=E(o,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{Y(e,this.mirror)&&this.iframeManager.addIframe(e),_(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),J(o)&&this.shadowDomManager.addShadowRoot(o.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});g&&e.push({parentId:h,nextId:p,node:g})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of Array.from(this.movedSet.values()))ne(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||o(e);for(const e of Array.from(this.addedSet.values()))re(this.droppedSet,e)||ne(this.removes,e,this.mirror)?re(this.movedSet,e)?o(e):this.droppedSet.add(e):o(e);let s=null;for(;t.length;){let e=null;if(s){const t=this.mirror.getId(s.value.parentNode),o=n(s.value);-1!==t&&-1!==o&&(e=s)}if(!e)for(let o=t.length-1;o>=0;o--){const r=t.get(o);if(r){const t=this.mirror.getId(r.value.parentNode);if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const n=t.parentNode.host;if(-1!==this.mirror.getId(n)){e=r;break}}}}}if(!e){for(;t.head;)t.removeNode(t.head.value);break}s=e.previous,t.removeNode(e.value),o(e.value)}const a={texts:this.texts.map((e=>({id:this.mirror.getId(e.node),value:e.value}))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>({id:this.mirror.getId(e.node),attributes:e.attributes}))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(a.texts.length||a.attributes.length||a.removes.length||a.adds.length)&&(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.processMutation=e=>{if(!V(e.target,this.mirror))switch(e.type){case"characterData":{const t=e.target.textContent;G(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:T(e.target,this.maskTextClass,this.maskTextSelector)&&t?this.maskTextFn?this.maskTextFn(t):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.target.getAttribute(e.attributeName);if("value"===e.attributeName&&(n=l({maskInputOptions:this.maskInputOptions,tagName:e.target.tagName,type:e.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),G(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;let o=this.attributes.find((t=>t.node===e.target));if("IFRAME"===t.tagName&&"src"===e.attributeName&&!this.keepIframeSrcFn(n)){if(t.contentDocument)return;e.attributeName="rr_src"}if(o||(o={node:e.target,attributes:{}},this.attributes.push(o)),"style"===e.attributeName){const n=this.doc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue),void 0!==o.attributes.style&&null!==o.attributes.style||(o.attributes.style={});const r=o.attributes.style;for(const e of Array.from(t.style)){const o=t.style.getPropertyValue(e),s=t.style.getPropertyPriority(e);o===n.style.getPropertyValue(e)&&s===n.style.getPropertyPriority(e)||(r[e]=""===s?o:[o,s])}for(const e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(r[e]=!1)}else o.attributes[e.attributeName]=w(this.doc,t.tagName,e.attributeName,n);break}case"childList":if(G(e.target,this.blockClass,this.blockSelector,!0))return;e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{const n=this.mirror.getId(t),o=r(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);G(e.target,this.blockClass,this.blockSelector,!1)||V(t,this.mirror)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(te(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||U(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[$(n,o)]?te(this.movedSet,t):this.removes.push({parentId:o,id:n,isShadow:!(!r(e.target)||!s(e.target))||void 0})),this.mapRemoves.push(t))}))}},this.genAdds=(e,t)=>{if(this.mirror.hasNode(e)){if(V(e,this.mirror))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[$(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);G(e,this.blockClass,this.blockSelector,!1)||e.childNodes.forEach((e=>this.genAdds(e)))}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].forEach((t=>{this[t]=e[t]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function te(e,t){e.delete(t),t.childNodes.forEach((t=>te(e,t)))}function ne(e,t,n){return 0!==e.length&&oe(e,t,n)}function oe(e,t,n){const{parentNode:o}=t;if(!o)return!1;const r=n.getId(o);return!!e.some((e=>e.id===r))||oe(e,o,n)}function re(e,t){return 0!==e.size&&se(e,t)}function se(e,t){const{parentNode:n}=t;return!!n&&(!!e.has(n)||se(e,n))}const ae=[],ie="undefined"!=typeof CSSGroupingRule,ce="undefined"!=typeof CSSMediaRule,le="undefined"!=typeof CSSSupportsRule,de="undefined"!=typeof CSSConditionRule;function ue(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function he(e,t){var n,o;const r=new ee;ae.push(r),r.init(e);let s=window.MutationObserver||window.__rrMutationObserver;const a=null===(o=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===o?void 0:o.call(n,"MutationObserver");a&&window[a]&&(s=window[a]);const i=new s(r.processMutations.bind(r));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function pe({mouseInteractionCb:e,doc:t,mirror:n,blockClass:o,blockSelector:r,sampling:s}){if(!1===s.mouseInteraction)return()=>{};const a=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,i=[];return Object.keys(X).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e])).forEach((s=>{const a=s.toLowerCase(),c=(t=>s=>{const a=ue(s);if(G(a,o,r,!0))return;const i=K(s)?s.changedTouches[0]:s;if(!i)return;const c=n.getId(a),{clientX:l,clientY:d}=i;e({type:X[t],id:c,x:l,y:d})})(s);i.push(O(a,c,t))})),()=>{i.forEach((e=>e()))}}function ge({scrollCb:e,doc:t,mirror:n,blockClass:o,blockSelector:r,sampling:s}){return O("scroll",L((s=>{const a=ue(s);if(!a||G(a,o,r,!0))return;const i=n.getId(a);if(a===t){const n=t.scrollingElement||t.documentElement;e({id:i,x:n.scrollLeft,y:n.scrollTop})}else e({id:i,x:a.scrollLeft,y:a.scrollTop})}),s.scroll||100),t)}function me(e,t){const n=Object.assign({},e);return t||delete n.userTriggered,n}const Ie=["INPUT","TEXTAREA","SELECT"],Ce=new WeakMap;function fe(e){return function(e,t){if(ie&&e.parentRule instanceof CSSGroupingRule||ce&&e.parentRule instanceof CSSMediaRule||le&&e.parentRule instanceof CSSSupportsRule||de&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function ye(e,t,n){let o,r;return e?(e.ownerNode?o=t.getId(e.ownerNode):r=n.getId(e),{styleId:r,id:o}):{}}function Se({mirror:e,stylesheetManager:t},n){var o,r,s;let a=null;a="#document"===n.nodeName?e.getId(n):e.getId(n.host);const i="#document"===n.nodeName?null===(o=n.defaultView)||void 0===o?void 0:o.Document:null===(s=null===(r=n.ownerDocument)||void 0===r?void 0:r.defaultView)||void 0===s?void 0:s.ShadowRoot,c=Object.getOwnPropertyDescriptor(null==i?void 0:i.prototype,"adoptedStyleSheets");return null!==a&&-1!==a&&i&&c?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null===(e=c.get)||void 0===e?void 0:e.call(this)},set(e){var n;const o=null===(n=c.set)||void 0===n?void 0:n.call(this,e);if(null!==a&&-1!==a)try{t.adoptStyleSheets(e,a)}catch(e){}return o}}),()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}):()=>{}}function be(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};!function(e,t){const{mutationCb:n,mousemoveCb:o,mouseInteractionCb:r,scrollCb:s,viewportResizeCb:a,inputCb:i,mediaInteractionCb:c,styleSheetRuleCb:l,styleDeclarationCb:d,canvasMutationCb:u,fontCb:h,selectionCb:p}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),o(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),r(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),s(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),a(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),i(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),c(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),l(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),d(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),u(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),h(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)}}(e,t);const o=he(e,e.doc),r=function({mousemoveCb:e,sampling:t,doc:n,mirror:o}){if(!1===t.mousemove)return()=>{};const r="number"==typeof t.mousemove?t.mousemove:50,s="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let a,i=[];const c=L((t=>{const n=Date.now()-a;e(i.map((e=>(e.timeOffset-=n,e))),t),i=[],a=null}),s),l=L((e=>{const t=ue(e),{clientX:n,clientY:r}=K(e)?e.changedTouches[0]:e;a||(a=Date.now()),i.push({x:n,y:r,id:o.getId(t),timeOffset:Date.now()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?H.Drag:e instanceof MouseEvent?H.MouseMove:H.TouchMove)}),r,{trailing:!1}),d=[O("mousemove",l,n),O("touchmove",l,n),O("drag",l,n)];return()=>{d.forEach((e=>e()))}}(e),s=pe(e),a=ge(e),i=function({viewportResizeCb:e}){let t=-1,n=-1;return O("resize",L((()=>{const o=Z(),r=B();t===o&&n===r||(e({width:Number(r),height:Number(o)}),t=o,n=r)}),200),window)}(e),c=function({inputCb:e,doc:t,mirror:n,blockClass:o,blockSelector:r,ignoreClass:s,maskInputOptions:a,maskInputFn:i,sampling:c,userTriggeredOnInput:d}){function u(e){let n=ue(e);const c=e.isTrusted;if(n&&"OPTION"===n.tagName&&(n=n.parentElement),!n||!n.tagName||Ie.indexOf(n.tagName)<0||G(n,o,r,!0))return;const u=n.type;if(n.classList.contains(s))return;let p=n.value,g=!1;"radio"===u||"checkbox"===u?g=n.checked:(a[n.tagName.toLowerCase()]||a[u])&&(p=l({maskInputOptions:a,tagName:n.tagName,type:u,value:p,maskInputFn:i})),h(n,me({text:p,isChecked:g,userTriggered:c},d));const m=n.name;"radio"===u&&m&&g&&t.querySelectorAll(`input[type="radio"][name="${m}"]`).forEach((e=>{e!==n&&h(e,me({text:e.value,isChecked:!g,userTriggered:!1},d))}))}function h(t,o){const r=Ce.get(t);if(!r||r.text!==o.text||r.isChecked!==o.isChecked){Ce.set(t,o);const r=n.getId(t);e(Object.assign(Object.assign({},o),{id:r}))}}const p=("last"===c.input?["change"]:["input","change"]).map((e=>O(e,u,t))),g=t.defaultView;if(!g)return()=>{p.forEach((e=>e()))};const m=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value"),I=[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&p.push(...I.map((e=>D(e[0],e[1],{set(){u({target:this})}},!1,g)))),()=>{p.forEach((e=>e()))}}(e),d=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:o,sampling:r}){const s=s=>L((r=>{const a=ue(r);if(!a||G(a,t,n,!0))return;const{currentTime:i,volume:c,muted:l,playbackRate:d}=a;e({type:s,id:o.getId(a),currentTime:i,volume:c,muted:l,playbackRate:d})}),r.media||500),a=[O("play",s(0)),O("pause",s(1)),O("seeked",s(2)),O("volumechange",s(3)),O("ratechange",s(4))];return()=>{a.forEach((e=>e()))}}(e),u=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:o}){const r=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=function(o,s){const{id:a,styleId:i}=ye(this,t,n.styleMirror);return(a&&-1!==a||i&&-1!==i)&&e({id:a,styleId:i,adds:[{rule:o,index:s}]}),r.apply(this,[o,s])};const s=o.CSSStyleSheet.prototype.deleteRule;let a,i;o.CSSStyleSheet.prototype.deleteRule=function(o){const{id:r,styleId:a}=ye(this,t,n.styleMirror);return(r&&-1!==r||a&&-1!==a)&&e({id:r,styleId:a,removes:[{index:o}]}),s.apply(this,[o])},o.CSSStyleSheet.prototype.replace&&(a=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=function(o){const{id:r,styleId:s}=ye(this,t,n.styleMirror);return(r&&-1!==r||s&&-1!==s)&&e({id:r,styleId:s,replace:o}),a.apply(this,[o])}),o.CSSStyleSheet.prototype.replaceSync&&(i=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=function(o){const{id:r,styleId:s}=ye(this,t,n.styleMirror);return(r&&-1!==r||s&&-1!==s)&&e({id:r,styleId:s,replaceSync:o}),i.apply(this,[o])});const c={};ie?c.CSSGroupingRule=o.CSSGroupingRule:(ce&&(c.CSSMediaRule=o.CSSMediaRule),de&&(c.CSSConditionRule=o.CSSConditionRule),le&&(c.CSSSupportsRule=o.CSSSupportsRule));const l={};return Object.entries(c).forEach((([o,r])=>{l[o]={insertRule:r.prototype.insertRule,deleteRule:r.prototype.deleteRule},r.prototype.insertRule=function(r,s){const{id:a,styleId:i}=ye(this.parentStyleSheet,t,n.styleMirror);return(a&&-1!==a||i&&-1!==i)&&e({id:a,styleId:i,adds:[{rule:r,index:[...fe(this),s||0]}]}),l[o].insertRule.apply(this,[r,s])},r.prototype.deleteRule=function(r){const{id:s,styleId:a}=ye(this.parentStyleSheet,t,n.styleMirror);return(s&&-1!==s||a&&-1!==a)&&e({id:s,styleId:a,removes:[{index:[...fe(this),r]}]}),l[o].deleteRule.apply(this,[r])}})),()=>{o.CSSStyleSheet.prototype.insertRule=r,o.CSSStyleSheet.prototype.deleteRule=s,a&&(o.CSSStyleSheet.prototype.replace=a),i&&(o.CSSStyleSheet.prototype.replaceSync=i),Object.entries(c).forEach((([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule}))}}(e,{win:n}),h=Se(e,e.doc),p=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:o},{win:r}){const s=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=function(r,a,i){var c;if(n.has(r))return s.apply(this,[r,a,i]);const{id:l,styleId:d}=ye(null===(c=this.parentRule)||void 0===c?void 0:c.parentStyleSheet,t,o.styleMirror);return(l&&-1!==l||d&&-1!==d)&&e({id:l,styleId:d,set:{property:r,value:a,priority:i},index:fe(this.parentRule)}),s.apply(this,[r,a,i])};const a=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=function(r){var s;if(n.has(r))return a.apply(this,[r]);const{id:i,styleId:c}=ye(null===(s=this.parentRule)||void 0===s?void 0:s.parentStyleSheet,t,o.styleMirror);return(i&&-1!==i||c&&-1!==c)&&e({id:i,styleId:c,remove:{property:r},index:fe(this.parentRule)}),a.apply(this,[r])},()=>{r.CSSStyleDeclaration.prototype.setProperty=s,r.CSSStyleDeclaration.prototype.removeProperty=a}}(e,{win:n}),g=e.collectFonts?function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const o=[],r=new WeakMap,s=n.FontFace;n.FontFace=function(e,t,n){const o=new s(e,t,n);return r.set(o,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),o};const a=W(t.fonts,"add",(function(t){return function(n){return setTimeout((()=>{const t=r.get(n);t&&(e(t),r.delete(n))}),0),t.apply(this,[n])}}));return o.push((()=>{n.FontFace=s})),o.push(a),()=>{o.forEach((e=>e()))}}(e):()=>{},m=function(e){const{doc:t,mirror:n,blockClass:o,blockSelector:r,selectionCb:s}=e;let a=!0;const i=()=>{const e=t.getSelection();if(!e||a&&(null==e?void 0:e.isCollapsed))return;a=e.isCollapsed||!1;const i=[],c=e.rangeCount||0;for(let t=0;t<c;t++){const s=e.getRangeAt(t),{startContainer:a,startOffset:c,endContainer:l,endOffset:d}=s;G(a,o,r,!0)||G(l,o,r,!0)||i.push({start:n.getId(a),startOffset:c,end:n.getId(l),endOffset:d})}s({ranges:i})};return i(),O("selectionchange",i)}(e),I=[];for(const t of e.plugins)I.push(t.observer(t.callback,n,t.options));return()=>{ae.forEach((e=>e.reset())),o.disconnect(),r(),s(),a(),i(),c(),d(),u(),h(),p(),g(),m(),I.forEach((e=>e()))}}class ve{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,o){const r=n||this.getIdToRemoteIdMap(e),s=o||this.getRemoteIdToIdMap(e);let a=r.get(t);return a||(a=this.generateIdFn(),r.set(t,a),s.set(a,t)),a}getIds(e,t){const n=this.getIdToRemoteIdMap(e),o=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,n,o)))}getRemoteId(e,t,n){const o=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const r=o.get(t);return r||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,n)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Ae{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new ve(m),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ve(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){if("rrweb"===e.data.type){if(!e.source)return;const t=this.crossOriginIframeMap.get(e.source);if(!t)return;const n=this.transformCrossOriginEvent(t,e.data.event);n&&this.wrappedEmit(n,e.data.isCheckout)}}transformCrossOriginEvent(e,t){var n;switch(t.type){case Q.FullSnapshot:return this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e),{timestamp:t.timestamp,type:Q.IncrementalSnapshot,data:{source:H.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Q.Meta:case Q.Load:case Q.DomContentLoaded:return!1;case Q.Plugin:return t;case Q.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Q.IncrementalSnapshot:switch(t.data.source){case H.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case H.Drag:case H.TouchMove:case H.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case H.ViewportResize:return!1;case H.MediaInteraction:case H.MouseInteraction:case H.Scroll:case H.CanvasMutation:case H.Input:return this.replaceIds(t.data,e,["id"]),t;case H.StyleSheetRule:case H.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case H.Font:return t;case H.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case H.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(n=t.data.styles)||void 0===n||n.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}}replace(e,t,n,o){for(const r of o)(Array.isArray(t[r])||"number"==typeof t[r])&&(Array.isArray(t[r])?t[r]=e.getIds(n,t[r]):t[r]=e.getId(n,t[r]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}}class ke{constructor(e){this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;const t=this;this.restorePatches.push(W(Element.prototype,"attachShadow",(function(e){return function(n){const o=e.call(this,n);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),o}})))}addShadowRoot(e,t){s(e)&&(this.shadowDoms.has(e)||(this.shadowDoms.add(e),he(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),ge(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),Se({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e)}),0)))}observeAttachShadow(e){if(e.contentWindow){const t=this;this.restorePatches.push(W(e.contentWindow.HTMLElement.prototype,"attachShadow",(function(n){return function(o){const r=n.call(this,o);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),r}})))}}reset(){this.restorePatches.forEach((e=>e())),this.shadowDoms=new WeakSet}}
|
|
2
|
+
/*! *****************************************************************************
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
+
***************************************************************************** */function we(e,t,n,o){return new(n||(n=Promise))((function(r,s){function a(e){try{c(o.next(e))}catch(e){s(e)}}function i(e){try{c(o.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,i)}c((o=o.apply(e,t||[])).next())}))}for(var Me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Te="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ne=0;Ne<64;Ne++)Te[Me.charCodeAt(Ne)]=Ne;const Re=new Map;const Ee=(e,t,n)=>{if(!e||!xe(e,t)&&"object"!=typeof e)return;const o=function(e,t){let n=Re.get(e);return n||(n=new Map,Re.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let r=o.indexOf(e);return-1===r&&(r=o.length,o.push(e)),r};function Oe(e,t,n){if(e instanceof Array)return e.map((e=>Oe(e,t,n)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){const t=e.constructor.name,n=function(e){var t,n=new Uint8Array(e),o=n.length,r="";for(t=0;t<o;t+=3)r+=Me[n[t]>>2],r+=Me[(3&n[t])<<4|n[t+1]>>4],r+=Me[(15&n[t+1])<<2|n[t+2]>>6],r+=Me[63&n[t+2]];return o%3==2?r=r.substring(0,r.length-1)+"=":o%3==1&&(r=r.substring(0,r.length-2)+"=="),r}(e);return{rr_type:t,base64:n}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[Oe(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[Oe(e.data,t,n),e.width,e.height]}}if(xe(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:Ee(e,t,n)}}return e}const Fe=(e,t,n)=>[...e].map((e=>Oe(e,t,n))),xe=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(n.find((n=>e instanceof t[n])))};function Le(e,t,n){const o=[];try{const r=W(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(o,...r){return G(this,t,n,!0)||"__context"in this||(this.__context=o),e.apply(this,[o,...r])}}));o.push(r)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach((e=>e()))}}function De(e,t,n,o,r,s,a){const i=[],c=Object.getOwnPropertyNames(e);for(const s of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(s))try{if("function"!=typeof e[s])continue;const c=W(e,s,(function(e){return function(...i){const c=e.apply(this,i);if(Ee(c,a,this),!G(this.canvas,o,r,!0)){const e=Fe([...i],a,this),o={type:t,property:s,args:e};n(this.canvas,o)}return c}}));i.push(c)}catch(o){const r=D(e,s,{set(e){n(this.canvas,{type:t,property:s,args:[e],setter:!0})}});i.push(r)}return i}var We=null;try{var Ze="undefined"!=typeof module&&"function"==typeof module.require&&module.require("worker_threads")||"function"==typeof __non_webpack_require__&&__non_webpack_require__("worker_threads")||"function"==typeof require&&require("worker_threads");We=Ze.Worker}catch(e){}function Be(e,t,n){var o=void 0===t?null:t,r=function(e,t){return Buffer.from(e,"base64").toString(t?"utf16":"utf8")}(e,void 0!==n&&n),s=r.indexOf("\n",10)+1,a=r.substring(s)+(o?"//# sourceMappingURL="+o:"");return function(e){return new We(a,Object.assign({},e,{eval:!0}))}}function Ge(e,t,n){var o=void 0===t?null:t,r=function(e,t){var n=atob(e);if(t){for(var o=new Uint8Array(n.length),r=0,s=n.length;r<s;++r)o[r]=n.charCodeAt(r);return String.fromCharCode.apply(null,new Uint16Array(o.buffer))}return n}(e,void 0!==n&&n),s=r.indexOf("\n",10)+1,a=r.substring(s)+(o?"//# sourceMappingURL="+o:""),i=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(i)}var Ve="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);var Ue,Ke,Ye,_e=(Ue="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUk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GFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYW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mFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",Ke=null,Ye=!1,Ve?Be(Ue,Ke,Ye):function(e,t,n){var o;return function(r){return o=o||Ge(e,t,n),new Worker(o,r)}}(Ue,Ke,Ye));class Je{constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};const{sampling:t="all",win:n,blockClass:o,blockSelector:r,recordCanvas:s,dataURLOptions:a}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===t&&this.initCanvasMutationObserver(n,o,r),s&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,o,r,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,n,o,r){const s=Le(t,n,o),a=new Map,i=new _e;i.onmessage=e=>{const{id:t}=e.data;if(a.set(t,!1),!("base64"in e.data))return;const{base64:n,type:o,width:r,height:s}=e.data;this.mutationCb({id:t,type:j["2D"],commands:[{property:"clearRect",args:[0,0,r,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:o}]},0,0]}]})};const c=1e3/e;let l,d=0;const u=e=>{d&&e-d<c||(d=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach((t=>{G(t,n,o,!0)||e.push(t)})),e})().forEach((e=>we(this,void 0,void 0,(function*(){var t;const n=this.mirror.getId(e);if(a.get(n))return;if(a.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null===(t=null==n?void 0:n.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&(null==n||n.clear(n.COLOR_BUFFER_BIT))}const o=yield createImageBitmap(e);i.postMessage({id:n,bitmap:o,width:e.width,height:e.height,dataURLOptions:r.dataURLOptions},[o])}))))),l=requestAnimationFrame(u)};l=requestAnimationFrame(u),this.resetObservers=()=>{s(),cancelAnimationFrame(l)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const o=Le(e,t,n),r=function(e,t,n,o){const r=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of s)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[a])continue;const s=W(t.CanvasRenderingContext2D.prototype,a,(function(r){return function(...s){return G(this.canvas,n,o,!0)||setTimeout((()=>{const n=Fe([...s],t,this);e(this.canvas,{type:j["2D"],property:a,args:n})}),0),r.apply(this,s)}}));r.push(s)}catch(n){const o=D(t.CanvasRenderingContext2D.prototype,a,{set(t){e(this.canvas,{type:j["2D"],property:a,args:[t],setter:!0})}});r.push(o)}return()=>{r.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n),s=function(e,t,n,o){const r=[];return r.push(...De(t.WebGLRenderingContext.prototype,j.WebGL,e,n,o,0,t)),void 0!==t.WebGL2RenderingContext&&r.push(...De(t.WebGL2RenderingContext.prototype,j.WebGL2,e,n,o,0,t)),()=>{r.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=()=>{o(),r(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const o=n.map((e=>{const t=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}(e,["type"]);return t})),{type:r}=n[0];this.mutationCb({id:t,type:r,commands:o}),this.pendingCanvasMutations.delete(e)}}class ze{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new z,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},o=[];for(const t of e){let e;if(this.styleMirror.has(t))e=this.styleMirror.getId(t);else{e=this.styleMirror.add(t);const n=Array.from(t.rules||CSSRule);o.push({styleId:e,rules:n.map(((e,t)=>({rule:i(e),index:t})))})}n.styleIds.push(e)}o.length>0&&(n.styles=o),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}function Qe(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}let He,Xe,je,Pe=!1;const qe=new c;function $e(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:o,blockClass:r="rr-block",blockSelector:s=null,ignoreClass:a="rr-ignore",maskTextClass:i="rr-mask",maskTextSelector:l=null,inlineStylesheet:d=!0,maskAllInputs:u,maskInputOptions:h,slimDOMOptions:p,maskInputFn:g,maskTextFn:m,hooks:I,packFn:C,sampling:f={},dataURLOptions:y={},mousemoveWait:S,recordCanvas:b=!1,recordCrossOriginIframes:v=!1,userTriggeredOnInput:A=!1,collectFonts:k=!1,inlineImages:w=!1,plugins:M,keepIframeSrcFn:T=()=>!1,ignoreCSSAttributes:N=new Set([])}=e,R=!v||window.parent===window;let F=!1;if(!R)try{window.parent.document,F=!1}catch(e){F=!0}if(R&&!t)throw new Error("emit function is required");void 0!==S&&void 0===f.mousemove&&(f.mousemove=S),qe.reset();const x=!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}:void 0!==h?h:{password:!0},L=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p}:p||{};let D;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}();let W=0;const G=e=>{for(const t of M||[])t.eventProcessor&&(e=t.eventProcessor(e));return C&&(e=C(e)),e};He=(e,r)=>{var s;if(!(null===(s=ae[0])||void 0===s?void 0:s.isFrozen())||e.type===Q.FullSnapshot||e.type===Q.IncrementalSnapshot&&e.data.source===H.Mutation||ae.forEach((e=>e.unfreeze())),R)null==t||t(G(e),r);else if(F){const t={type:"rrweb",event:G(e),isCheckout:r};window.parent.postMessage(t,"*")}if(e.type===Q.FullSnapshot)D=e,W=0;else if(e.type===Q.IncrementalSnapshot){if(e.data.source===H.Mutation&&e.data.isAttachIframe)return;W++;const t=o&&W>=o,r=n&&e.timestamp-D.timestamp>n;(t||r)&&Xe(!0)}};const V=e=>{He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.Mutation},e)}))},U=e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.Scroll},e)})),K=e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.CanvasMutation},e)})),z=new ze({mutationCb:V,adoptedStyleSheetCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.AdoptedStyleSheet},e)}))}),X=new Ae({mirror:qe,mutationCb:V,stylesheetManager:z,recordCrossOriginIframes:v,wrappedEmit:He});for(const e of M||[])e.getMirror&&e.getMirror({nodeMirror:qe,crossOriginIframeMirror:X.crossOriginIframeMirror,crossOriginIframeStyleMirror:X.crossOriginIframeStyleMirror});je=new Je({recordCanvas:b,mutationCb:K,win:window,blockClass:r,blockSelector:s,mirror:qe,sampling:f.canvas,dataURLOptions:y});const j=new ke({mutationCb:V,scrollCb:U,bypassOptions:{blockClass:r,blockSelector:s,maskTextClass:i,maskTextSelector:l,inlineStylesheet:d,maskInputOptions:x,dataURLOptions:y,maskTextFn:m,maskInputFn:g,recordCanvas:b,inlineImages:w,sampling:f,slimDOMOptions:L,iframeManager:X,stylesheetManager:z,canvasManager:je,keepIframeSrcFn:T},mirror:qe});Xe=(e=!1)=>{var t,n,o,a,u,h;He(Qe({type:Q.Meta,data:{href:window.location.href,width:B(),height:Z()}}),e),z.reset(),ae.forEach((e=>e.lock()));const p=function(e,t){var n=t||{},o=n.mirror,r=void 0===o?new c:o,s=n.blockClass,a=void 0===s?"rr-block":s,i=n.blockSelector,l=void 0===i?null:i,d=n.maskTextClass,u=void 0===d?"rr-mask":d,h=n.maskTextSelector,p=void 0===h?null:h,g=n.inlineStylesheet,m=void 0===g||g,I=n.inlineImages,C=void 0!==I&&I,f=n.recordCanvas,y=void 0!==f&&f,S=n.maskAllInputs,b=void 0!==S&&S,v=n.maskTextFn,A=n.maskInputFn,k=n.slimDOM,w=void 0!==k&&k,M=n.dataURLOptions,T=n.preserveWhiteSpace,N=n.onSerialize,R=n.onIframeLoad,O=n.iframeLoadTimeout,F=n.onStylesheetLoad,x=n.stylesheetLoadTimeout,L=n.keepIframeSrcFn;return E(e,{doc:e,mirror:r,blockClass:a,blockSelector:l,maskTextClass:u,maskTextSelector:p,skipChild:!1,inlineStylesheet:m,maskInputOptions:!0===b?{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===b?{password:!0}:b,maskTextFn:v,maskInputFn:A,slimDOMOptions:!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===w,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===w?{}:w,dataURLOptions:M,inlineImages:C,recordCanvas:y,preserveWhiteSpace:T,onSerialize:N,onIframeLoad:R,iframeLoadTimeout:O,onStylesheetLoad:F,stylesheetLoadTimeout:x,keepIframeSrcFn:void 0===L?function(){return!1}:L,newlyAddedElement:!1})}(document,{mirror:qe,blockClass:r,blockSelector:s,maskTextClass:i,maskTextSelector:l,inlineStylesheet:d,maskAllInputs:x,maskTextFn:m,slimDOM:L,dataURLOptions:y,recordCanvas:b,inlineImages:w,onSerialize:e=>{Y(e,qe)&&X.addIframe(e),_(e,qe)&&z.trackLinkElement(e),J(e)&&j.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{X.attachIframe(e,t),j.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{z.attachLinkElement(e,t)},keepIframeSrcFn:T});if(!p)return console.warn("Failed to snapshot the document");He(Qe({type:Q.FullSnapshot,data:{node:p,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(o=null===document||void 0===document?void 0:document.body)||void 0===o?void 0:o.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(u=null===(a=null===document||void 0===document?void 0:document.body)||void 0===a?void 0:a.parentElement)||void 0===u?void 0:u.scrollTop)||(null===(h=null===document||void 0===document?void 0:document.body)||void 0===h?void 0:h.scrollTop)||0}}})),ae.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,qe.getId(document))};try{const e=[];e.push(O("DOMContentLoaded",(()=>{He(Qe({type:Q.DomContentLoaded,data:{}}))})));const t=e=>{var t;return be({mutationCb:V,mousemoveCb:(e,t)=>He(Qe({type:Q.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.MouseInteraction},e)})),scrollCb:U,viewportResizeCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.ViewportResize},e)})),inputCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.Input},e)})),mediaInteractionCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.MediaInteraction},e)})),styleSheetRuleCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.StyleSheetRule},e)})),styleDeclarationCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.StyleDeclaration},e)})),canvasMutationCb:K,fontCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.Font},e)})),selectionCb:e=>{He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.Selection},e)}))},blockClass:r,ignoreClass:a,maskTextClass:i,maskTextSelector:l,maskInputOptions:x,inlineStylesheet:d,sampling:f,recordCanvas:b,inlineImages:w,userTriggeredOnInput:A,collectFonts:k,doc:e,maskInputFn:g,maskTextFn:m,keepIframeSrcFn:T,blockSelector:s,slimDOMOptions:L,dataURLOptions:y,mirror:qe,iframeManager:X,stylesheetManager:z,shadowDomManager:j,canvasManager:je,ignoreCSSAttributes:N,plugins:(null===(t=null==M?void 0:M.filter((e=>e.observer)))||void 0===t?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>He(Qe({type:Q.Plugin,data:{plugin:e.name,payload:t}}))}))))||[]},I)};X.addLoadListener((n=>{e.push(t(n.contentDocument))}));const n=()=>{Xe(),e.push(t(document)),Pe=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():e.push(O("load",(()=>{He(Qe({type:Q.Load,data:{}})),n()}),window)),()=>{e.forEach((e=>e())),Pe=!1}}catch(e){console.warn(e)}}$e.addCustomEvent=(e,t)=>{if(!Pe)throw new Error("please add custom event after start recording");He(Qe({type:Q.Custom,data:{tag:e,payload:t}}))},$e.freezePage=()=>{ae.forEach((e=>e.freeze()))},$e.takeFullSnapshot=e=>{if(!Pe)throw new Error("please take full snapshot after start recording");Xe(e)},$e.mirror=qe;const et=({children:o})=>{const r=(()=>{const e=t([]);return n((()=>{const t=$e({emit(t){t&&e.current.push(t)}});return()=>{t&&t()}}),[]),e})();return n((()=>{const e=r.current;localStorage.setItem("rrweb-events",JSON.stringify(e))}),[]),n((()=>()=>{const e=r.current;localStorage.setItem("rrweb-events",JSON.stringify(e));const t={method:"PUT",headers:{"Content-Type":"application/json"},body:localStorage.getItem("rrweb-events")};let n="";fetch("http://localhost:8000/generate-s3-url").then((e=>e.json())).then((e=>{n=e.signed_url,fetch(n,t).catch((e=>{console.error("Error uploading to S3:",e)}))})).catch((e=>{console.error("Error fetching S3 URL:",e)}))}),[]),e.createElement(e.Fragment,null,o)};export{et as default};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";var e=require("react");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n,o=t(e);function r(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function s(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function a(e){try{var t=e.rules||e.cssRules;return t?((n=Array.from(t).map(i).join("")).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),n):null}catch(e){return null}var n}function i(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=a(e.styleSheet)||t}catch(e){}return t}!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"}(n||(n={}));var c=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var n=this.getNode(e);if(n){var o=this.nodeMetaMap.get(n);o&&this.nodeMetaMap.set(t,o)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function l(e){var t=e.maskInputOptions,n=e.tagName,o=e.type,r=e.value,s=e.maskInputFn,a=r||"";return(t[n.toLowerCase()]||t[o])&&(a=s?s(a):"*".repeat(a.length)),a}var d="__rrweb_original__";var u,h,p=1,g=new RegExp("[^a-z0-9-_:]");function m(){return p++}var I=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,C=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,f=/^(data:)([^,]*),(.*)/i;function y(e,t){return(e||"").replace(I,(function(e,n,o,r,s,a){var i,c=o||s||a,l=n||r||"";if(!c)return e;if(!C.test(c))return"url(".concat(l).concat(c).concat(l,")");if(f.test(c))return"url(".concat(l).concat(c).concat(l,")");if("/"===c[0])return"url(".concat(l).concat((i=t,(i.indexOf("//")>-1?i.split("/").slice(0,3).join("/"):i.split("/")[0]).split("?")[0]+c)).concat(l,")");var d=t.split("/"),u=c.split("/");d.pop();for(var h=0,p=u;h<p.length;h++){var g=p[h];"."!==g&&(".."===g?d.pop():d.push(g))}return"url(".concat(l).concat(d.join("/")).concat(l,")")}))}var S=/^[^ \t\n\r\u000c]+/,b=/^[, \t\n\r\u000c]+/;function v(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function A(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function k(){var e=document.createElement("a");return e.href="",e.href}function w(e,t,n,o){return"src"===n||"href"===n&&o&&("use"!==t||"#"!==o[0])||"xlink:href"===n&&o&&"#"!==o[0]?v(e,o):"background"!==n||!o||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n&&o?function(e,t){if(""===t.trim())return t;var n=0;function o(e){var o,r=e.exec(t.substring(n));return r?(o=r[0],n+=o.length,o):""}for(var r=[];o(b),!(n>=t.length);){var s=o(S);if(","===s.slice(-1))s=v(e,s.substring(0,s.length-1)),r.push(s);else{var a="";s=v(e,s);for(var i=!1;;){var c=t.charAt(n);if(""===c){r.push((s+a).trim());break}if(i)")"===c&&(i=!1);else{if(","===c){n+=1,r.push((s+a).trim());break}"("===c&&(i=!0)}a+=c,n+=1}}}return r.join(", ")}(e,o):"style"===n&&o?y(o,k()):"object"===t&&"data"===n&&o?v(e,o):o:v(e,o)}function M(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&M(e.parentNode,t,n);for(var o=e.classList.length;o--;){var r=e.classList[o];if(t.test(r))return!0}return!!n&&M(e.parentNode,t,n)}function T(e,t,n){var o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===o)return!1;if("string"==typeof t){if(o.classList.contains(t))return!0;if(o.closest(".".concat(t)))return!0}else if(M(o,t,!0))return!0;if(n){if(o.matches(n))return!0;if(o.closest(n))return!0}return!1}function N(e,t){var o=t.doc,r=t.mirror,s=t.blockClass,i=t.blockSelector,c=t.maskTextClass,p=t.maskTextSelector,m=t.inlineStylesheet,I=t.maskInputOptions,C=void 0===I?{}:I,f=t.maskTextFn,S=t.maskInputFn,b=t.dataURLOptions,v=void 0===b?{}:b,M=t.inlineImages,N=t.recordCanvas,R=t.keepIframeSrcFn,E=t.newlyAddedElement,O=void 0!==E&&E,F=function(e,t){if(!t.hasNode(e))return;var n=t.getId(e);return 1===n?void 0:n}(o,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:n.Document,childNodes:[],compatMode:e.compatMode}:{type:n.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:n.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:F};case e.ELEMENT_NODE:return function(e,t){for(var o=t.doc,r=t.blockClass,s=t.blockSelector,i=t.inlineStylesheet,c=t.maskInputOptions,p=void 0===c?{}:c,m=t.maskInputFn,I=t.dataURLOptions,C=void 0===I?{}:I,f=t.inlineImages,S=t.recordCanvas,b=t.keepIframeSrcFn,v=t.newlyAddedElement,M=void 0!==v&&v,T=t.rootId,N=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var o=e.classList.length;o--;){var r=e.classList[o];if(t.test(r))return!0}return!!n&&e.matches(n)}(e,r,s),R=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return g.test(t)?"div":t}(e),E={},O=e.attributes.length,F=0;F<O;F++){var x=e.attributes[F];E[x.name]=w(o,R,x.name,x.value)}if("link"===R&&i){var L=Array.from(o.styleSheets).find((function(t){return t.href===e.href})),D=null;L&&(D=a(L)),D&&(delete E.rel,delete E.href,E._cssText=y(D,L.href))}if("style"===R&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){(D=a(e.sheet))&&(E._cssText=y(D,k()))}if("input"===R||"textarea"===R||"select"===R){var W=e.value,Z=e.checked;"radio"!==E.type&&"checkbox"!==E.type&&"submit"!==E.type&&"button"!==E.type&&W?E.value=l({type:E.type,tagName:R,value:W,maskInputOptions:p,maskInputFn:m}):Z&&(E.checked=Z)}"option"===R&&(e.selected&&!p.select?E.selected=!0:delete E.selected);if("canvas"===R&&S)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var o=0;o<e.height;o+=50){var r=t.getImageData,s=d in r?r[d]:r;if(new Uint32Array(s.call(t,n,o,Math.min(50,e.width-n),Math.min(50,e.height-o)).data.buffer).some((function(e){return 0!==e})))return!1}return!0})(e)||(E.rr_dataURL=e.toDataURL(C.type,C.quality));else if(!("__context"in e)){var B=e.toDataURL(C.type,C.quality),G=document.createElement("canvas");G.width=e.width,G.height=e.height,B!==G.toDataURL(C.type,C.quality)&&(E.rr_dataURL=B)}if("img"===R&&f){u||(u=o.createElement("canvas"),h=u.getContext("2d"));var V=e,U=V.crossOrigin;V.crossOrigin="anonymous";var K=function(){try{u.width=V.naturalWidth,u.height=V.naturalHeight,h.drawImage(V,0,0),E.rr_dataURL=u.toDataURL(C.type,C.quality)}catch(e){console.warn("Cannot inline img src=".concat(V.currentSrc,"! Error: ").concat(e))}U?E.crossOrigin=U:V.removeAttribute("crossorigin")};V.complete&&0!==V.naturalWidth?K():V.onload=K}"audio"!==R&&"video"!==R||(E.rr_mediaState=e.paused?"paused":"played",E.rr_mediaCurrentTime=e.currentTime);M||(e.scrollLeft&&(E.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(E.rr_scrollTop=e.scrollTop));if(N){var Y=e.getBoundingClientRect(),_=Y.width,J=Y.height;E={class:E.class,rr_width:"".concat(_,"px"),rr_height:"".concat(J,"px")}}"iframe"!==R||b(E.src)||(e.contentDocument||(E.rr_src=E.src),delete E.src);return{type:n.Element,tagName:R,attributes:E,childNodes:[],isSVG:A(e)||void 0,needBlock:N,rootId:T}}(e,{doc:o,blockClass:s,blockSelector:i,inlineStylesheet:m,maskInputOptions:C,maskInputFn:S,dataURLOptions:v,inlineImages:M,recordCanvas:N,keepIframeSrcFn:R,newlyAddedElement:O,rootId:F});case e.TEXT_NODE:return function(e,t){var o,r=t.maskTextClass,s=t.maskTextSelector,a=t.maskTextFn,i=t.rootId,c=e.parentNode&&e.parentNode.tagName,l=e.textContent,d="STYLE"===c||void 0,u="SCRIPT"===c||void 0;if(d&&l){try{e.nextSibling||e.previousSibling||(null===(o=e.parentNode.sheet)||void 0===o?void 0:o.cssRules)&&(l=(h=e.parentNode.sheet).cssRules?Array.from(h.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(t),e)}l=y(l,k())}var h;u&&(l="SCRIPT_PLACEHOLDER");!d&&!u&&l&&T(e,r,s)&&(l=a?a(l):l.replace(/[\S]/g,"*"));return{type:n.Text,textContent:l||"",isStyle:d,rootId:i}}(e,{maskTextClass:c,maskTextSelector:p,maskTextFn:f,rootId:F});case e.CDATA_SECTION_NODE:return{type:n.CDATA,textContent:"",rootId:F};case e.COMMENT_NODE:return{type:n.Comment,textContent:e.textContent||"",rootId:F};default:return!1}}function R(e){return void 0===e?"":e.toLowerCase()}function E(e,t){var o,a=t.doc,i=t.mirror,c=t.blockClass,l=t.blockSelector,d=t.maskTextClass,u=t.maskTextSelector,h=t.skipChild,p=void 0!==h&&h,g=t.inlineStylesheet,I=void 0===g||g,C=t.maskInputOptions,f=void 0===C?{}:C,y=t.maskTextFn,S=t.maskInputFn,b=t.slimDOMOptions,v=t.dataURLOptions,A=void 0===v?{}:v,k=t.inlineImages,w=void 0!==k&&k,M=t.recordCanvas,T=void 0!==M&&M,O=t.onSerialize,F=t.onIframeLoad,x=t.iframeLoadTimeout,L=void 0===x?5e3:x,D=t.onStylesheetLoad,W=t.stylesheetLoadTimeout,Z=void 0===W?5e3:W,B=t.keepIframeSrcFn,G=void 0===B?function(){return!1}:B,V=t.newlyAddedElement,U=void 0!==V&&V,K=t.preserveWhiteSpace,Y=void 0===K||K,_=N(e,{doc:a,mirror:i,blockClass:c,blockSelector:l,maskTextClass:d,maskTextSelector:u,inlineStylesheet:I,maskInputOptions:f,maskTextFn:y,maskInputFn:S,dataURLOptions:A,inlineImages:w,recordCanvas:T,keepIframeSrcFn:G,newlyAddedElement:U});if(!_)return console.warn(e,"not serialized"),null;o=i.hasNode(e)?i.getId(e):!function(e,t){if(t.comment&&e.type===n.Comment)return!0;if(e.type===n.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&"preload"===e.attributes.rel&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(R(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===R(e.attributes.name)||"icon"===R(e.attributes.rel)||"apple-touch-icon"===R(e.attributes.rel)||"shortcut icon"===R(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&R(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(R(e.attributes.property).match(/^(og|twitter|fb):/)||R(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===R(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===R(e.attributes.name)||"googlebot"===R(e.attributes.name)||"bingbot"===R(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===R(e.attributes.name)||"generator"===R(e.attributes.name)||"framework"===R(e.attributes.name)||"publisher"===R(e.attributes.name)||"progid"===R(e.attributes.name)||R(e.attributes.property).match(/^article:/)||R(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===R(e.attributes.name)||"yandex-verification"===R(e.attributes.name)||"csrf-token"===R(e.attributes.name)||"p:domain_verify"===R(e.attributes.name)||"verify-v1"===R(e.attributes.name)||"verification"===R(e.attributes.name)||"shopify-checkout-api-token"===R(e.attributes.name)))return!0}}return!1}(_,b)&&(Y||_.type!==n.Text||_.isStyle||_.textContent.replace(/^\s+|\s+$/gm,"").length)?m():-2;var J=Object.assign(_,{id:o});if(i.add(e,J),-2===o)return null;O&&O(e);var z=!p;if(J.type===n.Element){z=z&&!J.needBlock,delete J.needBlock;var Q=e.shadowRoot;Q&&s(Q)&&(J.isShadowHost=!0)}if((J.type===n.Document||J.type===n.Element)&&z){b.headWhitespace&&J.type===n.Element&&"head"===J.tagName&&(Y=!1);for(var H={doc:a,mirror:i,blockClass:c,blockSelector:l,maskTextClass:d,maskTextSelector:u,skipChild:p,inlineStylesheet:I,maskInputOptions:f,maskTextFn:y,maskInputFn:S,slimDOMOptions:b,dataURLOptions:A,inlineImages:w,recordCanvas:T,preserveWhiteSpace:Y,onSerialize:O,onIframeLoad:F,iframeLoadTimeout:L,onStylesheetLoad:D,stylesheetLoadTimeout:Z,keepIframeSrcFn:G},j=0,X=Array.from(e.childNodes);j<X.length;j++){($=E(X[j],H))&&J.childNodes.push($)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(var P=0,q=Array.from(e.shadowRoot.childNodes);P<q.length;P++){var $;($=E(q[P],H))&&(s(e.shadowRoot)&&($.isShadow=!0),J.childNodes.push($))}}return e.parentNode&&r(e.parentNode)&&s(e.parentNode)&&(J.isShadow=!0),J.type===n.Element&&"iframe"===J.tagName&&function(e,t,n){var o=e.contentWindow;if(o){var r,s=!1;try{r=o.document.readyState}catch(e){return}if("complete"===r){var a="about:blank";if(o.location.href!==a||e.src===a||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var i=setTimeout((function(){s||(t(),s=!0)}),n);e.addEventListener("load",(function(){clearTimeout(i),s=!0,t()}))}}}(e,(function(){var t=e.contentDocument;if(t&&F){var n=E(t,{doc:t,mirror:i,blockClass:c,blockSelector:l,maskTextClass:d,maskTextSelector:u,skipChild:!1,inlineStylesheet:I,maskInputOptions:f,maskTextFn:y,maskInputFn:S,slimDOMOptions:b,dataURLOptions:A,inlineImages:w,recordCanvas:T,preserveWhiteSpace:Y,onSerialize:O,onIframeLoad:F,iframeLoadTimeout:L,onStylesheetLoad:D,stylesheetLoadTimeout:Z,keepIframeSrcFn:G});n&&F(e,n)}}),L),J.type===n.Element&&"link"===J.tagName&&"stylesheet"===J.attributes.rel&&function(e,t,n){var o,r=!1;try{o=e.sheet}catch(e){return}if(!o){var s=setTimeout((function(){r||(t(),r=!0)}),n);e.addEventListener("load",(function(){clearTimeout(s),r=!0,t()}))}}(e,(function(){if(D){var t=E(e,{doc:a,mirror:i,blockClass:c,blockSelector:l,maskTextClass:d,maskTextSelector:u,skipChild:!1,inlineStylesheet:I,maskInputOptions:f,maskTextFn:y,maskInputFn:S,slimDOMOptions:b,dataURLOptions:A,inlineImages:w,recordCanvas:T,preserveWhiteSpace:Y,onSerialize:O,onIframeLoad:F,iframeLoadTimeout:L,onStylesheetLoad:D,stylesheetLoadTimeout:Z,keepIframeSrcFn:G});t&&D(e,t)}}),Z),J}function O(e,t,n=document){const o={capture:!0,passive:!0};return n.addEventListener(e,t,o),()=>n.removeEventListener(e,t,o)}const F="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let x={map:{},getId:()=>(console.error(F),-1),getNode:()=>(console.error(F),null),removeNodeFromMap(){console.error(F)},has:()=>(console.error(F),!1),reset(){console.error(F)}};function L(e,t,n={}){let o=null,r=0;return function(...s){const a=Date.now();r||!1!==n.leading||(r=a);const i=t-(a-r),c=this;i<=0||i>t?(o&&(clearTimeout(o),o=null),r=a,e.apply(c,s)):o||!1===n.trailing||(o=setTimeout((()=>{r=!1===n.leading?0:Date.now(),o=null,e.apply(c,s)}),i))}}function D(e,t,n,o,r=window){const s=r.Object.getOwnPropertyDescriptor(e,t);return r.Object.defineProperty(e,t,o?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>D(e,t,s||{},!0)}function W(e,t,n){try{if(!(t in e))return()=>{};const o=e[t],r=n(o);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:o}})),e[t]=r,()=>{e[t]=o}}catch(e){return()=>{}}}function Z(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function B(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function G(e,t,n,o){if(!e)return!1;const r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!r)return!1;if("string"==typeof t){if(r.classList.contains(t))return!0;if(o&&null!==r.closest("."+t))return!0}else if(M(r,t,o))return!0;if(n){if(e.matches(n))return!0;if(o&&null!==r.closest(n))return!0}return!1}function V(e,t){return-2===t.getId(e)}function U(e,t){if(r(e))return!1;const n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||U(e.parentNode,t))}function K(e){return Boolean(e.changedTouches)}function Y(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function _(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function J(e){return Boolean(null==e?void 0:e.shadowRoot)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(x=new Proxy(x,{get:(e,t,n)=>("map"===t&&console.error(F),Reflect.get(e,t,n))}));class z{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}var Q=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(Q||{}),H=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e))(H||{}),j=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(j||{}),X=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(X||{});function P(e){return"__ln"in e}class q{constructor(){this.length=0,this.head=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&P(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&P(e.nextSibling)&&e.nextSibling.__ln.previous){const n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)}}const $=(e,t)=>`${e}@${t}`;class ee{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],t=new q,n=e=>{let t=e,n=-2;for(;-2===n;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},o=o=>{var s,a,i,c;let l=null;(null===(a=null===(s=o.getRootNode)||void 0===s?void 0:s.call(o))||void 0===a?void 0:a.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&o.getRootNode().host&&(l=o.getRootNode().host);let d=l;for(;(null===(c=null===(i=null==d?void 0:d.getRootNode)||void 0===i?void 0:i.call(d))||void 0===c?void 0:c.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&d.getRootNode().host;)d=d.getRootNode().host;const u=!(this.doc.contains(o)||d&&this.doc.contains(d));if(!o.parentNode||u)return;const h=r(o.parentNode)?this.mirror.getId(l):this.mirror.getId(o.parentNode),p=n(o);if(-1===h||-1===p)return t.addNode(o);const g=E(o,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{Y(e,this.mirror)&&this.iframeManager.addIframe(e),_(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),J(o)&&this.shadowDomManager.addShadowRoot(o.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});g&&e.push({parentId:h,nextId:p,node:g})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of Array.from(this.movedSet.values()))ne(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||o(e);for(const e of Array.from(this.addedSet.values()))re(this.droppedSet,e)||ne(this.removes,e,this.mirror)?re(this.movedSet,e)?o(e):this.droppedSet.add(e):o(e);let s=null;for(;t.length;){let e=null;if(s){const t=this.mirror.getId(s.value.parentNode),o=n(s.value);-1!==t&&-1!==o&&(e=s)}if(!e)for(let o=t.length-1;o>=0;o--){const r=t.get(o);if(r){const t=this.mirror.getId(r.value.parentNode);if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const n=t.parentNode.host;if(-1!==this.mirror.getId(n)){e=r;break}}}}}if(!e){for(;t.head;)t.removeNode(t.head.value);break}s=e.previous,t.removeNode(e.value),o(e.value)}const a={texts:this.texts.map((e=>({id:this.mirror.getId(e.node),value:e.value}))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>({id:this.mirror.getId(e.node),attributes:e.attributes}))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(a.texts.length||a.attributes.length||a.removes.length||a.adds.length)&&(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.processMutation=e=>{if(!V(e.target,this.mirror))switch(e.type){case"characterData":{const t=e.target.textContent;G(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:T(e.target,this.maskTextClass,this.maskTextSelector)&&t?this.maskTextFn?this.maskTextFn(t):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.target.getAttribute(e.attributeName);if("value"===e.attributeName&&(n=l({maskInputOptions:this.maskInputOptions,tagName:e.target.tagName,type:e.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),G(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;let o=this.attributes.find((t=>t.node===e.target));if("IFRAME"===t.tagName&&"src"===e.attributeName&&!this.keepIframeSrcFn(n)){if(t.contentDocument)return;e.attributeName="rr_src"}if(o||(o={node:e.target,attributes:{}},this.attributes.push(o)),"style"===e.attributeName){const n=this.doc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue),void 0!==o.attributes.style&&null!==o.attributes.style||(o.attributes.style={});const r=o.attributes.style;for(const e of Array.from(t.style)){const o=t.style.getPropertyValue(e),s=t.style.getPropertyPriority(e);o===n.style.getPropertyValue(e)&&s===n.style.getPropertyPriority(e)||(r[e]=""===s?o:[o,s])}for(const e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(r[e]=!1)}else o.attributes[e.attributeName]=w(this.doc,t.tagName,e.attributeName,n);break}case"childList":if(G(e.target,this.blockClass,this.blockSelector,!0))return;e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{const n=this.mirror.getId(t),o=r(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);G(e.target,this.blockClass,this.blockSelector,!1)||V(t,this.mirror)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(te(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||U(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[$(n,o)]?te(this.movedSet,t):this.removes.push({parentId:o,id:n,isShadow:!(!r(e.target)||!s(e.target))||void 0})),this.mapRemoves.push(t))}))}},this.genAdds=(e,t)=>{if(this.mirror.hasNode(e)){if(V(e,this.mirror))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[$(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);G(e,this.blockClass,this.blockSelector,!1)||e.childNodes.forEach((e=>this.genAdds(e)))}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].forEach((t=>{this[t]=e[t]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function te(e,t){e.delete(t),t.childNodes.forEach((t=>te(e,t)))}function ne(e,t,n){return 0!==e.length&&oe(e,t,n)}function oe(e,t,n){const{parentNode:o}=t;if(!o)return!1;const r=n.getId(o);return!!e.some((e=>e.id===r))||oe(e,o,n)}function re(e,t){return 0!==e.size&&se(e,t)}function se(e,t){const{parentNode:n}=t;return!!n&&(!!e.has(n)||se(e,n))}const ae=[],ie="undefined"!=typeof CSSGroupingRule,ce="undefined"!=typeof CSSMediaRule,le="undefined"!=typeof CSSSupportsRule,de="undefined"!=typeof CSSConditionRule;function ue(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function he(e,t){var n,o;const r=new ee;ae.push(r),r.init(e);let s=window.MutationObserver||window.__rrMutationObserver;const a=null===(o=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===o?void 0:o.call(n,"MutationObserver");a&&window[a]&&(s=window[a]);const i=new s(r.processMutations.bind(r));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function pe({mouseInteractionCb:e,doc:t,mirror:n,blockClass:o,blockSelector:r,sampling:s}){if(!1===s.mouseInteraction)return()=>{};const a=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,i=[];return Object.keys(j).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e])).forEach((s=>{const a=s.toLowerCase(),c=(t=>s=>{const a=ue(s);if(G(a,o,r,!0))return;const i=K(s)?s.changedTouches[0]:s;if(!i)return;const c=n.getId(a),{clientX:l,clientY:d}=i;e({type:j[t],id:c,x:l,y:d})})(s);i.push(O(a,c,t))})),()=>{i.forEach((e=>e()))}}function ge({scrollCb:e,doc:t,mirror:n,blockClass:o,blockSelector:r,sampling:s}){return O("scroll",L((s=>{const a=ue(s);if(!a||G(a,o,r,!0))return;const i=n.getId(a);if(a===t){const n=t.scrollingElement||t.documentElement;e({id:i,x:n.scrollLeft,y:n.scrollTop})}else e({id:i,x:a.scrollLeft,y:a.scrollTop})}),s.scroll||100),t)}function me(e,t){const n=Object.assign({},e);return t||delete n.userTriggered,n}const Ie=["INPUT","TEXTAREA","SELECT"],Ce=new WeakMap;function fe(e){return function(e,t){if(ie&&e.parentRule instanceof CSSGroupingRule||ce&&e.parentRule instanceof CSSMediaRule||le&&e.parentRule instanceof CSSSupportsRule||de&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function ye(e,t,n){let o,r;return e?(e.ownerNode?o=t.getId(e.ownerNode):r=n.getId(e),{styleId:r,id:o}):{}}function Se({mirror:e,stylesheetManager:t},n){var o,r,s;let a=null;a="#document"===n.nodeName?e.getId(n):e.getId(n.host);const i="#document"===n.nodeName?null===(o=n.defaultView)||void 0===o?void 0:o.Document:null===(s=null===(r=n.ownerDocument)||void 0===r?void 0:r.defaultView)||void 0===s?void 0:s.ShadowRoot,c=Object.getOwnPropertyDescriptor(null==i?void 0:i.prototype,"adoptedStyleSheets");return null!==a&&-1!==a&&i&&c?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null===(e=c.get)||void 0===e?void 0:e.call(this)},set(e){var n;const o=null===(n=c.set)||void 0===n?void 0:n.call(this,e);if(null!==a&&-1!==a)try{t.adoptStyleSheets(e,a)}catch(e){}return o}}),()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}):()=>{}}function be(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};!function(e,t){const{mutationCb:n,mousemoveCb:o,mouseInteractionCb:r,scrollCb:s,viewportResizeCb:a,inputCb:i,mediaInteractionCb:c,styleSheetRuleCb:l,styleDeclarationCb:d,canvasMutationCb:u,fontCb:h,selectionCb:p}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),o(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),r(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),s(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),a(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),i(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),c(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),l(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),d(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),u(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),h(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)}}(e,t);const o=he(e,e.doc),r=function({mousemoveCb:e,sampling:t,doc:n,mirror:o}){if(!1===t.mousemove)return()=>{};const r="number"==typeof t.mousemove?t.mousemove:50,s="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let a,i=[];const c=L((t=>{const n=Date.now()-a;e(i.map((e=>(e.timeOffset-=n,e))),t),i=[],a=null}),s),l=L((e=>{const t=ue(e),{clientX:n,clientY:r}=K(e)?e.changedTouches[0]:e;a||(a=Date.now()),i.push({x:n,y:r,id:o.getId(t),timeOffset:Date.now()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?H.Drag:e instanceof MouseEvent?H.MouseMove:H.TouchMove)}),r,{trailing:!1}),d=[O("mousemove",l,n),O("touchmove",l,n),O("drag",l,n)];return()=>{d.forEach((e=>e()))}}(e),s=pe(e),a=ge(e),i=function({viewportResizeCb:e}){let t=-1,n=-1;return O("resize",L((()=>{const o=Z(),r=B();t===o&&n===r||(e({width:Number(r),height:Number(o)}),t=o,n=r)}),200),window)}(e),c=function({inputCb:e,doc:t,mirror:n,blockClass:o,blockSelector:r,ignoreClass:s,maskInputOptions:a,maskInputFn:i,sampling:c,userTriggeredOnInput:d}){function u(e){let n=ue(e);const c=e.isTrusted;if(n&&"OPTION"===n.tagName&&(n=n.parentElement),!n||!n.tagName||Ie.indexOf(n.tagName)<0||G(n,o,r,!0))return;const u=n.type;if(n.classList.contains(s))return;let p=n.value,g=!1;"radio"===u||"checkbox"===u?g=n.checked:(a[n.tagName.toLowerCase()]||a[u])&&(p=l({maskInputOptions:a,tagName:n.tagName,type:u,value:p,maskInputFn:i})),h(n,me({text:p,isChecked:g,userTriggered:c},d));const m=n.name;"radio"===u&&m&&g&&t.querySelectorAll(`input[type="radio"][name="${m}"]`).forEach((e=>{e!==n&&h(e,me({text:e.value,isChecked:!g,userTriggered:!1},d))}))}function h(t,o){const r=Ce.get(t);if(!r||r.text!==o.text||r.isChecked!==o.isChecked){Ce.set(t,o);const r=n.getId(t);e(Object.assign(Object.assign({},o),{id:r}))}}const p=("last"===c.input?["change"]:["input","change"]).map((e=>O(e,u,t))),g=t.defaultView;if(!g)return()=>{p.forEach((e=>e()))};const m=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value"),I=[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&p.push(...I.map((e=>D(e[0],e[1],{set(){u({target:this})}},!1,g)))),()=>{p.forEach((e=>e()))}}(e),d=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:o,sampling:r}){const s=s=>L((r=>{const a=ue(r);if(!a||G(a,t,n,!0))return;const{currentTime:i,volume:c,muted:l,playbackRate:d}=a;e({type:s,id:o.getId(a),currentTime:i,volume:c,muted:l,playbackRate:d})}),r.media||500),a=[O("play",s(0)),O("pause",s(1)),O("seeked",s(2)),O("volumechange",s(3)),O("ratechange",s(4))];return()=>{a.forEach((e=>e()))}}(e),u=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:o}){const r=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=function(o,s){const{id:a,styleId:i}=ye(this,t,n.styleMirror);return(a&&-1!==a||i&&-1!==i)&&e({id:a,styleId:i,adds:[{rule:o,index:s}]}),r.apply(this,[o,s])};const s=o.CSSStyleSheet.prototype.deleteRule;let a,i;o.CSSStyleSheet.prototype.deleteRule=function(o){const{id:r,styleId:a}=ye(this,t,n.styleMirror);return(r&&-1!==r||a&&-1!==a)&&e({id:r,styleId:a,removes:[{index:o}]}),s.apply(this,[o])},o.CSSStyleSheet.prototype.replace&&(a=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=function(o){const{id:r,styleId:s}=ye(this,t,n.styleMirror);return(r&&-1!==r||s&&-1!==s)&&e({id:r,styleId:s,replace:o}),a.apply(this,[o])}),o.CSSStyleSheet.prototype.replaceSync&&(i=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=function(o){const{id:r,styleId:s}=ye(this,t,n.styleMirror);return(r&&-1!==r||s&&-1!==s)&&e({id:r,styleId:s,replaceSync:o}),i.apply(this,[o])});const c={};ie?c.CSSGroupingRule=o.CSSGroupingRule:(ce&&(c.CSSMediaRule=o.CSSMediaRule),de&&(c.CSSConditionRule=o.CSSConditionRule),le&&(c.CSSSupportsRule=o.CSSSupportsRule));const l={};return Object.entries(c).forEach((([o,r])=>{l[o]={insertRule:r.prototype.insertRule,deleteRule:r.prototype.deleteRule},r.prototype.insertRule=function(r,s){const{id:a,styleId:i}=ye(this.parentStyleSheet,t,n.styleMirror);return(a&&-1!==a||i&&-1!==i)&&e({id:a,styleId:i,adds:[{rule:r,index:[...fe(this),s||0]}]}),l[o].insertRule.apply(this,[r,s])},r.prototype.deleteRule=function(r){const{id:s,styleId:a}=ye(this.parentStyleSheet,t,n.styleMirror);return(s&&-1!==s||a&&-1!==a)&&e({id:s,styleId:a,removes:[{index:[...fe(this),r]}]}),l[o].deleteRule.apply(this,[r])}})),()=>{o.CSSStyleSheet.prototype.insertRule=r,o.CSSStyleSheet.prototype.deleteRule=s,a&&(o.CSSStyleSheet.prototype.replace=a),i&&(o.CSSStyleSheet.prototype.replaceSync=i),Object.entries(c).forEach((([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule}))}}(e,{win:n}),h=Se(e,e.doc),p=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:o},{win:r}){const s=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=function(r,a,i){var c;if(n.has(r))return s.apply(this,[r,a,i]);const{id:l,styleId:d}=ye(null===(c=this.parentRule)||void 0===c?void 0:c.parentStyleSheet,t,o.styleMirror);return(l&&-1!==l||d&&-1!==d)&&e({id:l,styleId:d,set:{property:r,value:a,priority:i},index:fe(this.parentRule)}),s.apply(this,[r,a,i])};const a=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=function(r){var s;if(n.has(r))return a.apply(this,[r]);const{id:i,styleId:c}=ye(null===(s=this.parentRule)||void 0===s?void 0:s.parentStyleSheet,t,o.styleMirror);return(i&&-1!==i||c&&-1!==c)&&e({id:i,styleId:c,remove:{property:r},index:fe(this.parentRule)}),a.apply(this,[r])},()=>{r.CSSStyleDeclaration.prototype.setProperty=s,r.CSSStyleDeclaration.prototype.removeProperty=a}}(e,{win:n}),g=e.collectFonts?function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const o=[],r=new WeakMap,s=n.FontFace;n.FontFace=function(e,t,n){const o=new s(e,t,n);return r.set(o,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),o};const a=W(t.fonts,"add",(function(t){return function(n){return setTimeout((()=>{const t=r.get(n);t&&(e(t),r.delete(n))}),0),t.apply(this,[n])}}));return o.push((()=>{n.FontFace=s})),o.push(a),()=>{o.forEach((e=>e()))}}(e):()=>{},m=function(e){const{doc:t,mirror:n,blockClass:o,blockSelector:r,selectionCb:s}=e;let a=!0;const i=()=>{const e=t.getSelection();if(!e||a&&(null==e?void 0:e.isCollapsed))return;a=e.isCollapsed||!1;const i=[],c=e.rangeCount||0;for(let t=0;t<c;t++){const s=e.getRangeAt(t),{startContainer:a,startOffset:c,endContainer:l,endOffset:d}=s;G(a,o,r,!0)||G(l,o,r,!0)||i.push({start:n.getId(a),startOffset:c,end:n.getId(l),endOffset:d})}s({ranges:i})};return i(),O("selectionchange",i)}(e),I=[];for(const t of e.plugins)I.push(t.observer(t.callback,n,t.options));return()=>{ae.forEach((e=>e.reset())),o.disconnect(),r(),s(),a(),i(),c(),d(),u(),h(),p(),g(),m(),I.forEach((e=>e()))}}class ve{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,o){const r=n||this.getIdToRemoteIdMap(e),s=o||this.getRemoteIdToIdMap(e);let a=r.get(t);return a||(a=this.generateIdFn(),r.set(t,a),s.set(a,t)),a}getIds(e,t){const n=this.getIdToRemoteIdMap(e),o=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,n,o)))}getRemoteId(e,t,n){const o=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const r=o.get(t);return r||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,n)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Ae{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new ve(m),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ve(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){if("rrweb"===e.data.type){if(!e.source)return;const t=this.crossOriginIframeMap.get(e.source);if(!t)return;const n=this.transformCrossOriginEvent(t,e.data.event);n&&this.wrappedEmit(n,e.data.isCheckout)}}transformCrossOriginEvent(e,t){var n;switch(t.type){case Q.FullSnapshot:return this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e),{timestamp:t.timestamp,type:Q.IncrementalSnapshot,data:{source:H.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Q.Meta:case Q.Load:case Q.DomContentLoaded:return!1;case Q.Plugin:return t;case Q.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Q.IncrementalSnapshot:switch(t.data.source){case H.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case H.Drag:case H.TouchMove:case H.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case H.ViewportResize:return!1;case H.MediaInteraction:case H.MouseInteraction:case H.Scroll:case H.CanvasMutation:case H.Input:return this.replaceIds(t.data,e,["id"]),t;case H.StyleSheetRule:case H.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case H.Font:return t;case H.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case H.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(n=t.data.styles)||void 0===n||n.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}}replace(e,t,n,o){for(const r of o)(Array.isArray(t[r])||"number"==typeof t[r])&&(Array.isArray(t[r])?t[r]=e.getIds(n,t[r]):t[r]=e.getId(n,t[r]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}}class ke{constructor(e){this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;const t=this;this.restorePatches.push(W(Element.prototype,"attachShadow",(function(e){return function(n){const o=e.call(this,n);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),o}})))}addShadowRoot(e,t){s(e)&&(this.shadowDoms.has(e)||(this.shadowDoms.add(e),he(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),ge(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),Se({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e)}),0)))}observeAttachShadow(e){if(e.contentWindow){const t=this;this.restorePatches.push(W(e.contentWindow.HTMLElement.prototype,"attachShadow",(function(n){return function(o){const r=n.call(this,o);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),r}})))}}reset(){this.restorePatches.forEach((e=>e())),this.shadowDoms=new WeakSet}}
|
|
2
|
+
/*! *****************************************************************************
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
+
***************************************************************************** */function we(e,t,n,o){return new(n||(n=Promise))((function(r,s){function a(e){try{c(o.next(e))}catch(e){s(e)}}function i(e){try{c(o.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,i)}c((o=o.apply(e,t||[])).next())}))}for(var Me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Te="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ne=0;Ne<64;Ne++)Te[Me.charCodeAt(Ne)]=Ne;const Re=new Map;const Ee=(e,t,n)=>{if(!e||!xe(e,t)&&"object"!=typeof e)return;const o=function(e,t){let n=Re.get(e);return n||(n=new Map,Re.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let r=o.indexOf(e);return-1===r&&(r=o.length,o.push(e)),r};function Oe(e,t,n){if(e instanceof Array)return e.map((e=>Oe(e,t,n)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){const t=e.constructor.name,n=function(e){var t,n=new Uint8Array(e),o=n.length,r="";for(t=0;t<o;t+=3)r+=Me[n[t]>>2],r+=Me[(3&n[t])<<4|n[t+1]>>4],r+=Me[(15&n[t+1])<<2|n[t+2]>>6],r+=Me[63&n[t+2]];return o%3==2?r=r.substring(0,r.length-1)+"=":o%3==1&&(r=r.substring(0,r.length-2)+"=="),r}(e);return{rr_type:t,base64:n}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[Oe(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[Oe(e.data,t,n),e.width,e.height]}}if(xe(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:Ee(e,t,n)}}return e}const Fe=(e,t,n)=>[...e].map((e=>Oe(e,t,n))),xe=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(n.find((n=>e instanceof t[n])))};function Le(e,t,n){const o=[];try{const r=W(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(o,...r){return G(this,t,n,!0)||"__context"in this||(this.__context=o),e.apply(this,[o,...r])}}));o.push(r)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach((e=>e()))}}function De(e,t,n,o,r,s,a){const i=[],c=Object.getOwnPropertyNames(e);for(const s of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(s))try{if("function"!=typeof e[s])continue;const c=W(e,s,(function(e){return function(...i){const c=e.apply(this,i);if(Ee(c,a,this),!G(this.canvas,o,r,!0)){const e=Fe([...i],a,this),o={type:t,property:s,args:e};n(this.canvas,o)}return c}}));i.push(c)}catch(o){const r=D(e,s,{set(e){n(this.canvas,{type:t,property:s,args:[e],setter:!0})}});i.push(r)}return i}var We=null;try{var Ze="undefined"!=typeof module&&"function"==typeof module.require&&module.require("worker_threads")||"function"==typeof __non_webpack_require__&&__non_webpack_require__("worker_threads")||"function"==typeof require&&require("worker_threads");We=Ze.Worker}catch(e){}function Be(e,t,n){var o=void 0===t?null:t,r=function(e,t){return Buffer.from(e,"base64").toString(t?"utf16":"utf8")}(e,void 0!==n&&n),s=r.indexOf("\n",10)+1,a=r.substring(s)+(o?"//# sourceMappingURL="+o:"");return function(e){return new We(a,Object.assign({},e,{eval:!0}))}}function Ge(e,t,n){var o=void 0===t?null:t,r=function(e,t){var n=atob(e);if(t){for(var o=new Uint8Array(n.length),r=0,s=n.length;r<s;++r)o[r]=n.charCodeAt(r);return String.fromCharCode.apply(null,new Uint16Array(o.buffer))}return n}(e,void 0!==n&&n),s=r.indexOf("\n",10)+1,a=r.substring(s)+(o?"//# sourceMappingURL="+o:""),i=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(i)}var Ve="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);var Ue,Ke,Ye,_e=(Ue="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZS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2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",Ke=null,Ye=!1,Ve?Be(Ue,Ke,Ye):function(e,t,n){var o;return function(r){return o=o||Ge(e,t,n),new Worker(o,r)}}(Ue,Ke,Ye));class Je{constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};const{sampling:t="all",win:n,blockClass:o,blockSelector:r,recordCanvas:s,dataURLOptions:a}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===t&&this.initCanvasMutationObserver(n,o,r),s&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,o,r,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,n,o,r){const s=Le(t,n,o),a=new Map,i=new _e;i.onmessage=e=>{const{id:t}=e.data;if(a.set(t,!1),!("base64"in e.data))return;const{base64:n,type:o,width:r,height:s}=e.data;this.mutationCb({id:t,type:X["2D"],commands:[{property:"clearRect",args:[0,0,r,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:o}]},0,0]}]})};const c=1e3/e;let l,d=0;const u=e=>{d&&e-d<c||(d=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach((t=>{G(t,n,o,!0)||e.push(t)})),e})().forEach((e=>we(this,void 0,void 0,(function*(){var t;const n=this.mirror.getId(e);if(a.get(n))return;if(a.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null===(t=null==n?void 0:n.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&(null==n||n.clear(n.COLOR_BUFFER_BIT))}const o=yield createImageBitmap(e);i.postMessage({id:n,bitmap:o,width:e.width,height:e.height,dataURLOptions:r.dataURLOptions},[o])}))))),l=requestAnimationFrame(u)};l=requestAnimationFrame(u),this.resetObservers=()=>{s(),cancelAnimationFrame(l)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const o=Le(e,t,n),r=function(e,t,n,o){const r=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of s)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[a])continue;const s=W(t.CanvasRenderingContext2D.prototype,a,(function(r){return function(...s){return G(this.canvas,n,o,!0)||setTimeout((()=>{const n=Fe([...s],t,this);e(this.canvas,{type:X["2D"],property:a,args:n})}),0),r.apply(this,s)}}));r.push(s)}catch(n){const o=D(t.CanvasRenderingContext2D.prototype,a,{set(t){e(this.canvas,{type:X["2D"],property:a,args:[t],setter:!0})}});r.push(o)}return()=>{r.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n),s=function(e,t,n,o){const r=[];return r.push(...De(t.WebGLRenderingContext.prototype,X.WebGL,e,n,o,0,t)),void 0!==t.WebGL2RenderingContext&&r.push(...De(t.WebGL2RenderingContext.prototype,X.WebGL2,e,n,o,0,t)),()=>{r.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=()=>{o(),r(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const o=n.map((e=>{const t=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}(e,["type"]);return t})),{type:r}=n[0];this.mutationCb({id:t,type:r,commands:o}),this.pendingCanvasMutations.delete(e)}}class ze{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new z,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},o=[];for(const t of e){let e;if(this.styleMirror.has(t))e=this.styleMirror.getId(t);else{e=this.styleMirror.add(t);const n=Array.from(t.rules||CSSRule);o.push({styleId:e,rules:n.map(((e,t)=>({rule:i(e),index:t})))})}n.styleIds.push(e)}o.length>0&&(n.styles=o),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}function Qe(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}let He,je,Xe,Pe=!1;const qe=new c;function $e(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:o,blockClass:r="rr-block",blockSelector:s=null,ignoreClass:a="rr-ignore",maskTextClass:i="rr-mask",maskTextSelector:l=null,inlineStylesheet:d=!0,maskAllInputs:u,maskInputOptions:h,slimDOMOptions:p,maskInputFn:g,maskTextFn:m,hooks:I,packFn:C,sampling:f={},dataURLOptions:y={},mousemoveWait:S,recordCanvas:b=!1,recordCrossOriginIframes:v=!1,userTriggeredOnInput:A=!1,collectFonts:k=!1,inlineImages:w=!1,plugins:M,keepIframeSrcFn:T=()=>!1,ignoreCSSAttributes:N=new Set([])}=e,R=!v||window.parent===window;let F=!1;if(!R)try{window.parent.document,F=!1}catch(e){F=!0}if(R&&!t)throw new Error("emit function is required");void 0!==S&&void 0===f.mousemove&&(f.mousemove=S),qe.reset();const x=!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}:void 0!==h?h:{password:!0},L=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p}:p||{};let D;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}();let W=0;const G=e=>{for(const t of M||[])t.eventProcessor&&(e=t.eventProcessor(e));return C&&(e=C(e)),e};He=(e,r)=>{var s;if(!(null===(s=ae[0])||void 0===s?void 0:s.isFrozen())||e.type===Q.FullSnapshot||e.type===Q.IncrementalSnapshot&&e.data.source===H.Mutation||ae.forEach((e=>e.unfreeze())),R)null==t||t(G(e),r);else if(F){const t={type:"rrweb",event:G(e),isCheckout:r};window.parent.postMessage(t,"*")}if(e.type===Q.FullSnapshot)D=e,W=0;else if(e.type===Q.IncrementalSnapshot){if(e.data.source===H.Mutation&&e.data.isAttachIframe)return;W++;const t=o&&W>=o,r=n&&e.timestamp-D.timestamp>n;(t||r)&&je(!0)}};const V=e=>{He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.Mutation},e)}))},U=e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.Scroll},e)})),K=e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.CanvasMutation},e)})),z=new ze({mutationCb:V,adoptedStyleSheetCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.AdoptedStyleSheet},e)}))}),j=new Ae({mirror:qe,mutationCb:V,stylesheetManager:z,recordCrossOriginIframes:v,wrappedEmit:He});for(const e of M||[])e.getMirror&&e.getMirror({nodeMirror:qe,crossOriginIframeMirror:j.crossOriginIframeMirror,crossOriginIframeStyleMirror:j.crossOriginIframeStyleMirror});Xe=new Je({recordCanvas:b,mutationCb:K,win:window,blockClass:r,blockSelector:s,mirror:qe,sampling:f.canvas,dataURLOptions:y});const X=new ke({mutationCb:V,scrollCb:U,bypassOptions:{blockClass:r,blockSelector:s,maskTextClass:i,maskTextSelector:l,inlineStylesheet:d,maskInputOptions:x,dataURLOptions:y,maskTextFn:m,maskInputFn:g,recordCanvas:b,inlineImages:w,sampling:f,slimDOMOptions:L,iframeManager:j,stylesheetManager:z,canvasManager:Xe,keepIframeSrcFn:T},mirror:qe});je=(e=!1)=>{var t,n,o,a,u,h;He(Qe({type:Q.Meta,data:{href:window.location.href,width:B(),height:Z()}}),e),z.reset(),ae.forEach((e=>e.lock()));const p=function(e,t){var n=t||{},o=n.mirror,r=void 0===o?new c:o,s=n.blockClass,a=void 0===s?"rr-block":s,i=n.blockSelector,l=void 0===i?null:i,d=n.maskTextClass,u=void 0===d?"rr-mask":d,h=n.maskTextSelector,p=void 0===h?null:h,g=n.inlineStylesheet,m=void 0===g||g,I=n.inlineImages,C=void 0!==I&&I,f=n.recordCanvas,y=void 0!==f&&f,S=n.maskAllInputs,b=void 0!==S&&S,v=n.maskTextFn,A=n.maskInputFn,k=n.slimDOM,w=void 0!==k&&k,M=n.dataURLOptions,T=n.preserveWhiteSpace,N=n.onSerialize,R=n.onIframeLoad,O=n.iframeLoadTimeout,F=n.onStylesheetLoad,x=n.stylesheetLoadTimeout,L=n.keepIframeSrcFn;return E(e,{doc:e,mirror:r,blockClass:a,blockSelector:l,maskTextClass:u,maskTextSelector:p,skipChild:!1,inlineStylesheet:m,maskInputOptions:!0===b?{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===b?{password:!0}:b,maskTextFn:v,maskInputFn:A,slimDOMOptions:!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===w,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===w?{}:w,dataURLOptions:M,inlineImages:C,recordCanvas:y,preserveWhiteSpace:T,onSerialize:N,onIframeLoad:R,iframeLoadTimeout:O,onStylesheetLoad:F,stylesheetLoadTimeout:x,keepIframeSrcFn:void 0===L?function(){return!1}:L,newlyAddedElement:!1})}(document,{mirror:qe,blockClass:r,blockSelector:s,maskTextClass:i,maskTextSelector:l,inlineStylesheet:d,maskAllInputs:x,maskTextFn:m,slimDOM:L,dataURLOptions:y,recordCanvas:b,inlineImages:w,onSerialize:e=>{Y(e,qe)&&j.addIframe(e),_(e,qe)&&z.trackLinkElement(e),J(e)&&X.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{j.attachIframe(e,t),X.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{z.attachLinkElement(e,t)},keepIframeSrcFn:T});if(!p)return console.warn("Failed to snapshot the document");He(Qe({type:Q.FullSnapshot,data:{node:p,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(o=null===document||void 0===document?void 0:document.body)||void 0===o?void 0:o.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(u=null===(a=null===document||void 0===document?void 0:document.body)||void 0===a?void 0:a.parentElement)||void 0===u?void 0:u.scrollTop)||(null===(h=null===document||void 0===document?void 0:document.body)||void 0===h?void 0:h.scrollTop)||0}}})),ae.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,qe.getId(document))};try{const e=[];e.push(O("DOMContentLoaded",(()=>{He(Qe({type:Q.DomContentLoaded,data:{}}))})));const t=e=>{var t;return be({mutationCb:V,mousemoveCb:(e,t)=>He(Qe({type:Q.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.MouseInteraction},e)})),scrollCb:U,viewportResizeCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.ViewportResize},e)})),inputCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.Input},e)})),mediaInteractionCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.MediaInteraction},e)})),styleSheetRuleCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.StyleSheetRule},e)})),styleDeclarationCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.StyleDeclaration},e)})),canvasMutationCb:K,fontCb:e=>He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.Font},e)})),selectionCb:e=>{He(Qe({type:Q.IncrementalSnapshot,data:Object.assign({source:H.Selection},e)}))},blockClass:r,ignoreClass:a,maskTextClass:i,maskTextSelector:l,maskInputOptions:x,inlineStylesheet:d,sampling:f,recordCanvas:b,inlineImages:w,userTriggeredOnInput:A,collectFonts:k,doc:e,maskInputFn:g,maskTextFn:m,keepIframeSrcFn:T,blockSelector:s,slimDOMOptions:L,dataURLOptions:y,mirror:qe,iframeManager:j,stylesheetManager:z,shadowDomManager:X,canvasManager:Xe,ignoreCSSAttributes:N,plugins:(null===(t=null==M?void 0:M.filter((e=>e.observer)))||void 0===t?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>He(Qe({type:Q.Plugin,data:{plugin:e.name,payload:t}}))}))))||[]},I)};j.addLoadListener((n=>{e.push(t(n.contentDocument))}));const n=()=>{je(),e.push(t(document)),Pe=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():e.push(O("load",(()=>{He(Qe({type:Q.Load,data:{}})),n()}),window)),()=>{e.forEach((e=>e())),Pe=!1}}catch(e){console.warn(e)}}$e.addCustomEvent=(e,t)=>{if(!Pe)throw new Error("please add custom event after start recording");He(Qe({type:Q.Custom,data:{tag:e,payload:t}}))},$e.freezePage=()=>{ae.forEach((e=>e.freeze()))},$e.takeFullSnapshot=e=>{if(!Pe)throw new Error("please take full snapshot after start recording");je(e)},$e.mirror=qe;module.exports=({children:t})=>{const n=(()=>{const t=e.useRef([]);return e.useEffect((()=>{const e=$e({emit(e){e&&t.current.push(e)}});return()=>{e&&e()}}),[]),t})();return e.useEffect((()=>{const e=n.current;localStorage.setItem("rrweb-events",JSON.stringify(e))}),[]),e.useEffect((()=>()=>{const e=n.current;localStorage.setItem("rrweb-events",JSON.stringify(e));const t={method:"PUT",headers:{"Content-Type":"application/json"},body:localStorage.getItem("rrweb-events")};let o="";fetch("http://localhost:8000/generate-s3-url").then((e=>e.json())).then((e=>{o=e.signed_url,fetch(o,t).catch((e=>{console.error("Error uploading to S3:",e)}))})).catch((e=>{console.error("Error fetching S3 URL:",e)}))}),[]),o.default.createElement(o.default.Fragment,null,t)};
|
package/package.json
CHANGED
|
@@ -1,23 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "core-outline",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "
|
|
5
|
-
"main": "index.js",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "A React component for Core&Outline",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.es.js",
|
|
6
7
|
"scripts": {
|
|
7
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
"url": "git+https://github.com/TomiTsuma/core-outline-npm.git"
|
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
|
+
"storybook": "storybook dev -p 6006",
|
|
10
|
+
"build-storybook": "storybook build",
|
|
11
|
+
"build-lib": "rollup -c"
|
|
12
12
|
},
|
|
13
13
|
"keywords": [
|
|
14
|
-
"
|
|
15
|
-
"
|
|
14
|
+
"Core",
|
|
15
|
+
"Outline"
|
|
16
16
|
],
|
|
17
|
-
"author": "
|
|
18
|
-
"license": "
|
|
19
|
-
"
|
|
20
|
-
"
|
|
17
|
+
"author": "Core&Outline",
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@babel/core": "^7.12.10",
|
|
21
|
+
"@babel/preset-react": "^7.12.10",
|
|
22
|
+
"@rollup/plugin-node-resolve": "^11.1.1",
|
|
23
|
+
"@storybook/addon-actions": "^6.1.16",
|
|
24
|
+
"@storybook/addon-essentials": "^6.1.16",
|
|
25
|
+
"@storybook/addon-links": "^6.1.16",
|
|
26
|
+
"@storybook/react": "^6.1.16",
|
|
27
|
+
"babel-loader": "^8.2.2",
|
|
28
|
+
"react": "^17.0.1",
|
|
29
|
+
"react-dom": "^17.0.1",
|
|
30
|
+
"rollup": "^2.38.4",
|
|
31
|
+
"rollup-plugin-babel": "^4.4.0",
|
|
32
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
33
|
+
"rollup-plugin-postcss": "^4.0.0",
|
|
34
|
+
"rollup-plugin-terser": "^7.0.2"
|
|
35
|
+
},
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"react": "^17.0.1",
|
|
38
|
+
"react-dom": "^17.0.1"
|
|
21
39
|
},
|
|
22
|
-
"
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"react-error-boundary": "^5.0.0",
|
|
42
|
+
"react-tracking": "^9.3.2",
|
|
43
|
+
"rrweb": "^2.0.0-alpha.4"
|
|
44
|
+
}
|
|
23
45
|
}
|
package/rollup.config.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import babel from 'rollup-plugin-babel';
|
|
2
|
+
import resolve from '@rollup/plugin-node-resolve';
|
|
3
|
+
import external from 'rollup-plugin-peer-deps-external';
|
|
4
|
+
import { terser } from 'rollup-plugin-terser';
|
|
5
|
+
import postcss from 'rollup-plugin-postcss';
|
|
6
|
+
|
|
7
|
+
export default [
|
|
8
|
+
{
|
|
9
|
+
input: './src/components/CoreOutline/CoreOutline.js',
|
|
10
|
+
output: [
|
|
11
|
+
{
|
|
12
|
+
file: 'dist/index.js',
|
|
13
|
+
format: 'cjs',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
file: 'dist/index.es.js',
|
|
17
|
+
format: 'es',
|
|
18
|
+
exports: 'named',
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
plugins: [
|
|
22
|
+
postcss({
|
|
23
|
+
plugins: [],
|
|
24
|
+
minimize: true,
|
|
25
|
+
}),
|
|
26
|
+
babel({
|
|
27
|
+
exclude: 'node_modules/**',
|
|
28
|
+
presets: ['@babel/preset-react']
|
|
29
|
+
}),
|
|
30
|
+
external(),
|
|
31
|
+
resolve(),
|
|
32
|
+
terser(),
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
];
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React, { useEffect } from "react";
|
|
2
|
+
import useRRWebRecorder from "./RWebRecorder";
|
|
3
|
+
|
|
4
|
+
const CoreOutline = ({children}) =>{
|
|
5
|
+
const eventsRef = useRRWebRecorder();
|
|
6
|
+
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
const events = eventsRef.current;
|
|
9
|
+
localStorage.setItem("rrweb-events", JSON.stringify(events));
|
|
10
|
+
}, []);
|
|
11
|
+
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
return () => {
|
|
14
|
+
const events = eventsRef.current;
|
|
15
|
+
localStorage.setItem("rrweb-events", JSON.stringify(events));
|
|
16
|
+
const savedEvents = localStorage.getItem("rrweb-events");
|
|
17
|
+
// const jsonData = JSON.stringify(savedEvents);
|
|
18
|
+
|
|
19
|
+
const requestOptions = {
|
|
20
|
+
method: 'PUT',
|
|
21
|
+
headers: {
|
|
22
|
+
'Content-Type': 'application/json',
|
|
23
|
+
},
|
|
24
|
+
body: savedEvents,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
let uploadURL = "";
|
|
28
|
+
fetch("http://localhost:8000/generate-s3-url")
|
|
29
|
+
.then(response => response.json())
|
|
30
|
+
.then(data => {
|
|
31
|
+
uploadURL = data.signed_url;
|
|
32
|
+
fetch(uploadURL, requestOptions).catch(error => {
|
|
33
|
+
console.error("Error uploading to S3:", error);
|
|
34
|
+
});
|
|
35
|
+
})
|
|
36
|
+
.catch(error => {
|
|
37
|
+
console.error("Error fetching S3 URL:", error);
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
}, []);
|
|
41
|
+
|
|
42
|
+
return <>{children}</>;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export default CoreOutline;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useEffect, useRef } from "react";
|
|
2
|
+
import { record } from "rrweb";
|
|
3
|
+
|
|
4
|
+
const useRRWebRecorder = () => {
|
|
5
|
+
const eventsRef = useRef([]);
|
|
6
|
+
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
const stopRecording = record({
|
|
9
|
+
emit(event) {
|
|
10
|
+
if (event){
|
|
11
|
+
eventsRef.current.push(event);
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
return () => {
|
|
17
|
+
if (stopRecording) {
|
|
18
|
+
stopRecording();
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}, []);
|
|
22
|
+
|
|
23
|
+
return eventsRef;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default useRRWebRecorder;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CoreOutline';
|
package/src/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/CoreOutline';
|