ionblink-js 0.1.2 → 0.1.6

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.
@@ -1 +1 @@
1
- "use strict";(()=>{var e,t=Object.defineProperty,r=(e,r,n)=>((e,r,n)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n)(e,"symbol"!=typeof r?r+"":r,n),n=((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[e.Asset=7]="Asset",e[e.Annotation=8]="Annotation",e),a=(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[e.CustomElement=16]="CustomElement",e))({}),o=(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))({}),s=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))({}),i=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))({}),l=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))({}),d=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))({}),c={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},u={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},h={},p={},m=0;function f(e){if(h[e])return h[e];let t=(e=>{var t,r;let n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);if(n&&globalThis[n])return globalThis[n]})(e)||globalThis[e],r=t.prototype,n=e in c?c[e]:void 0,a=!(!n||!n.every(e=>{var t,n;return!(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)||!n.toString().includes("[native code]"))})),o=e in u?u[e]:void 0,s=!(!o||!o.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(a&&s)return h[e]=t.prototype,t.prototype;try{let n=document.createElement("iframe");n.style.display="none",document.body.appendChild(n);let a=n.contentWindow;if(!a)return t.prototype;let o=a[e].prototype;if(!o)return n.remove(),r;let s=navigator.userAgent;return s.includes("Safari")&&!s.includes("Chrome")?(n.classList.add("rr-block"),n.setAttribute("__rrwebUntaintedMutationObserver",""),p[e]=()=>n.remove()):n.remove(),h[e]=o}catch{return r}}var y={};function g(e,t,r){var n,a;let o=null==(n=y[e])?void 0:n[r];if(o)return o.call(t);let s=f(e),i=null==(a=Object.getOwnPropertyDescriptor(s,r))?void 0:a.get;return i?((y[e]||(y[e]={}))[r]=i,i.call(t)):t[r]}var b={};function S(e,t,r){let n=`${e}.${String(r)}`;if(b[n])return b[n].bind(t);let a=f(e)[r];return"function"!=typeof a?t[r]:(b[n]=a,a.bind(t))}var v=Date.now;function w(e,t,r){try{if(!(t in e))return()=>{};let n=e[t],a=r(n);return"function"==typeof a&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=a,()=>{e[t]=n}}catch{return()=>{}}}/[1-9][0-9]{12}/.test(Date.now().toString())||(v=()=>(new Date).getTime());var I=e=>g("Node",e,"ownerDocument"),C=e=>g("Node",e,"childNodes"),M=e=>g("Node",e,"parentNode"),k=e=>g("Node",e,"parentElement"),T=e=>g("Node",e,"textContent"),O=e=>g("Node",e,"lastChild"),R=e=>g("Node",e,"nextSibling"),E=e=>g("Node",e,"previousSibling"),x=(e,t)=>S("Node",e,"contains")(t),L=e=>S("Node",e,"getRootNode")(),D=e=>e&&"host"in e?g("ShadowRoot",e,"host"):null,N=e=>e&&"shadowRoot"in e?g("Element",e,"shadowRoot"):null;function A(e){return e.nodeType===e.ELEMENT_NODE}function _(e){let t=e&&"host"in e&&"mode"in e&&D(e)||null;return!(!t||!("shadowRoot"in t)||N(t)!==e)}function F(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function U(e){try{let t=e.rules||e.cssRules;if(!t)return null;let r=e.href;return!r&&e.ownerNode&&(r=e.ownerNode.baseURI),(e=>(e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e))(Array.from(t,e=>P(e,r)).join(""))}catch{return null}}function P(e,t){if((e=>"styleSheet"in e)(e)){let t;try{t=U(e.styleSheet)||(e=>{let{cssText:t}=e;if(t.split('"').length<3)return t;let r=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"})(e)}catch{t=e.cssText}return e.styleSheet.href?Z(t,e.styleSheet.href):t}{let r=e.cssText;return(e=>"selectorText"in e)(e)&&e.selectorText.includes(":")&&(r=(e=>e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2"))(r)),t?Z(r,t):r}}var W=class{constructor(){r(this,"idNodeMap",new Map),r(this,"nodeMetaMap",new WeakMap)}getId(e){var t,r;return e&&null!=(r=null==(t=this.getMeta(e))?void 0:t.id)?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e));let r=N(e);r&&this.removeNodeFromMap(r)}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){let r=this.getNode(e);if(r){let e=this.nodeMetaMap.get(r);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function $({element:e,maskInputOptions:t,tagName:r,type:n,value:a,maskInputFn:o}){let s=a||"",i=n&&z(n);return(t[r.toLowerCase()]||i&&t[i])&&(s=o?o(s,e):"*".repeat(s.length)),s}function z(e){return e.toLowerCase()}var B="__rrweb_original__";function j(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?z(t):null}function V(e,t){var r,n;let a;try{a=new URL(e,null!=t?t:window.location.href)}catch{return null}return null!=(n=null==(r=a.pathname.match(/\.([0-9a-z]+)(?:$)/i))?void 0:r[1])?n:null}var H=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,G=/^(?:[a-z+]+:)?\/\//i,q=/^www\..*/i,X=/^(data:)([^,]*),(.*)/i,Y=/^blob:/i;function Z(e,t){return(e||"").replace(H,(e,r,n,a,o,s)=>{let i=n||o||s,l=r||a||"";if(!i)return e;if(G.test(i)||q.test(i))return`url(${l}${i}${l})`;if(X.test(i)||Y.test(i))return`url(${l}${i}${l})`;if("#"===i[0])return`url(${l}${i}${l})`;if("/"===i[0])return`url(${l}${(e=>{let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t})(t)+i}${l})`;let d=i.split("#")[0],c=i.substring(d.length),u=t.split("#")[0].split("/"),h=d.split("/");u.pop();for(let e of h)"."!==e&&(".."===e?u.pop():u.push(e));return`url(${l}${u.join("/")}${c}${l})`})}var J="(?:/\\*[^*]*\\*/)|[\\s;]",K=new RegExp(`${J}|\\b(0)px?`,"g"),Q=new RegExp(J,"g");function ee(e,t=!1){return t?e.replace(Q,""):e.replace(K,"$1")}var te=1,re=new RegExp("[^a-z0-9-_:]");function ne(){return te++}var ae,oe,se=/^[^ \t\n\r\u000c]+/,ie=/^[, \t\n\r\u000c]+/,le=new WeakMap;function de(e,t){return t&&""!==t.trim()?ue(e,t):t}function ce(e){return!("svg"!==e.tagName&&!e.ownerSVGElement)}function ue(e,t){let r=le.get(e);if(r||(r=e.createElement("a"),le.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function he(e,t,r,n){return n&&("src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]||"background"===r&&["table","td","th"].includes(t)?de(e,n):"srcset"===r?((e,t)=>{if(""===t.trim())return t;let r=0;function n(e){let n,a=e.exec(t.substring(r));return a?(n=a[0],r+=n.length,n):""}let a=[];for(;n(ie),!(r>=t.length);){let o=n(se);if(","===o.slice(-1))o=de(e,o.substring(0,o.length-1)),a.push(o);else{let n="";o=de(e,o);let s=!1;for(;;){let e=t.charAt(r);if(""===e){a.push((o+n).trim());break}if(s)")"===e&&(s=!1);else{if(","===e){r+=1,a.push((o+n).trim());break}"("===e&&(s=!0)}n+=e,r+=1}}}return a.join(", ")})(e,n):"style"===r?Z(n,ue(e)):"object"===t&&"data"===r?de(e,n):n)}function pe(e,t,r){return["video","audio"].includes(e)&&"autoplay"===z(t)}function me(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let r=e.classList.length;r--;){let n=e.classList[r];if(t.test(n))return!0}if(r)return e.matches(r)}catch{}return!1}function fe(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&fe(M(e),t,r);for(let r=e.classList.length;r--;){let n=e.classList[r];if(t.test(n))return!0}return!!r&&fe(M(e),t,r)}function ye(e,t,r,n){let a;if(A(e)){if(a=e,!C(a).length)return!1}else{if(null===k(e))return!1;a=k(e)}try{if("string"==typeof t){if(n){if(a.closest(`.${t}`))return!0}else if(a.classList.contains(t))return!0}else if(fe(a,t,n))return!0;if(r)if(n){if(a.closest(r))return!0}else if(a.matches(r))return!0}catch{}return!1}function ge(e){return null==e?"":e.toLowerCase()}function be(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:e||{}}function Se(e,t){let{doc:r,mirror:n,blockClass:a,blockSelector:o,maskTextClass:s,maskTextSelector:i,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:h,maskInputFn:p,slimDOMOptions:m,dataURLOptions:f={},inlineImages:y=!1,recordCanvas:g=!1,onSerialize:b,onIframeLoad:S,iframeLoadTimeout:v=5e3,onStylesheetLoad:w,stylesheetLoadTimeout:I=5e3,keepIframeSrcFn:O=()=>!1,newlyAddedElement:R=!1,cssCaptured:E=!1}=t,{needsMask:x}=t,{preserveWhiteSpace:L=!0}=t;x||(x=ye(e,s,i,void 0===x));let D,P=function(e,t){let{doc:r,mirror:n,blockClass:a,blockSelector:o,needsMask:s,inlineStylesheet:i,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:h={},inlineImages:p,recordCanvas:m,keepIframeSrcFn:f,newlyAddedElement:y=!1,cssCaptured:g=!1}=t,b=((e,t)=>{if(!t.hasNode(e))return;let r=t.getId(e);return 1===r?void 0:r})(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:d.Document,childNodes:[],compatMode:e.compatMode}:{type:d.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:d.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:b};case e.ELEMENT_NODE:return((e,t)=>{let r,{doc:n,blockClass:a,blockSelector:o,inlineStylesheet:s,maskInputOptions:i={},maskInputFn:l,dataURLOptions:c={},inlineImages:u,recordCanvas:h,keepIframeSrcFn:p,newlyAddedElement:m=!1,rootId:f}=t,y=me(e,a,o),g=(e=>{if(e instanceof HTMLFormElement)return"form";let t=z(e.tagName);return re.test(t)?"div":t})(e),b={},S=e.attributes.length;for(let t=0;t<S;t++){let r=e.attributes[t];pe(g,r.name,r.value)||(b[r.name]=he(n,g,z(r.name),r.value))}if("link"===g&&s){let t=Array.from(n.styleSheets).find(t=>t.href===e.href),r=null;t&&(r=U(t)),r&&(delete b.rel,delete b.href,b._cssText=r)}if("style"===g&&e.sheet){let t=U(e.sheet);t&&(e.childNodes.length>1&&(t=((e,t)=>((e,t,r=!1)=>{let n=Array.from(t.childNodes),a=[],o=0;if(n.length>1&&e&&"string"==typeof e){let t=ee(e,r),s=t.length/e.length;for(let i=1;i<n.length;i++)if(n[i].textContent&&"string"==typeof n[i].textContent){let l=ee(n[i].textContent,r),d=100,c=3;for(;c<l.length&&(l[c].match(/[a-zA-Z0-9]/)||-1!==l.indexOf(l.substring(0,c),1));c++);for(;c<l.length;c++){let u=l.substring(0,c),h=t.split(u),p=-1;if(2===h.length)p=h[0].length;else if(h.length>2&&""===h[0]&&""!==n[i-1].textContent)p=t.indexOf(u,1);else if(1===h.length){if(u=u.substring(0,u.length-1),h=t.split(u),h.length<=1)return a.push(e),a;c=101}else c===l.length-1&&(p=t.indexOf(u));if(h.length>=2&&c>d){let e=n[i-1].textContent;if(e&&"string"==typeof e){let r=ee(e).length;p=t.indexOf(u,r)}-1===p&&(p=h[0].length)}if(-1!==p){let i=Math.floor(p/s);for(;i>0&&i<e.length;){if(o+=1,o>50*n.length)return a.push(e),a;let l=ee(e.substring(0,i),r);if(l.length===p){a.push(e.substring(0,i)),e=e.substring(i),t=t.substring(p);break}l.length<p?i+=Math.max(1,Math.floor((p-l.length)/s)):i-=Math.max(1,Math.floor((l.length-p)*s))}break}}}}return a.push(e),a})(e,t).join("/* rr_split */"))(t,e)),b._cssText=t)}if(["input","textarea","select"].includes(g)){let t=e.value,r=e.checked;"radio"!==b.type&&"checkbox"!==b.type&&"submit"!==b.type&&"button"!==b.type&&t?b.value=$({element:e,type:j(e),tagName:g,value:t,maskInputOptions:i,maskInputFn:l}):r&&(b.checked=r)}if("option"===g&&(e.selected&&!i.select?b.selected=!0:delete b.selected),"dialog"===g&&e.open&&(b.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),"canvas"===g&&h)if("2d"===e.__context)(e=>{let t=e.getContext("2d");if(!t)return!0;for(let r=0;r<e.width;r+=50)for(let n=0;n<e.height;n+=50){let a=t.getImageData,o=B in a?a[B]:a;if(new Uint32Array(o.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some(e=>0!==e))return!1}return!0})(e)||(b.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){let t=e.toDataURL(c.type,c.quality),r=n.createElement("canvas");r.width=e.width,r.height=e.height,t!==r.toDataURL(c.type,c.quality)&&(b.rr_dataURL=t)}if("img"===g&&u){ae||(ae=n.createElement("canvas"),oe=ae.getContext("2d"));let t=e,r=t.currentSrc||t.getAttribute("src")||"<unknown-src>",a=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{ae.width=t.naturalWidth,ae.height=t.naturalHeight,oe.drawImage(t,0,0),b.rr_dataURL=ae.toDataURL(c.type,c.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o));console.warn(`Cannot inline img src=${r}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(a?b.crossOrigin=a:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o)}if(["audio","video"].includes(g)){let t=b;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}if(m||(e.scrollLeft&&(b.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(b.rr_scrollTop=e.scrollTop)),y){let{width:t,height:r}=e.getBoundingClientRect();b={class:b.class,rr_width:`${t}px`,rr_height:`${r}px`}}"iframe"===g&&!p(b.src)&&(e.contentDocument||(b.rr_src=b.src),delete b.src);try{customElements.get(g)&&(r=!0)}catch{}return{type:d.Element,tagName:g,attributes:b,childNodes:[],isSVG:ce(e)||void 0,needBlock:y,rootId:f,isCustom:r}})(e,{doc:r,blockClass:a,blockSelector:o,inlineStylesheet:i,maskInputOptions:l,maskInputFn:u,dataURLOptions:h,inlineImages:p,recordCanvas:m,keepIframeSrcFn:f,newlyAddedElement:y,rootId:b});case e.TEXT_NODE:return((e,t)=>{let{needsMask:r,maskTextFn:n,rootId:a,cssCaptured:o}=t,s=M(e),i=s&&s.tagName,l="",c="STYLE"===i||void 0,u="SCRIPT"===i||void 0;return u?l="SCRIPT_PLACEHOLDER":o||(l=T(e),c&&l&&(l=Z(l,ue(t.doc)))),!c&&!u&&l&&r&&(l=n?n(l,k(e)):l.replace(/[\S]/g,"*")),{type:d.Text,textContent:l||"",rootId:a}})(e,{doc:r,needsMask:s,maskTextFn:c,rootId:b,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:d.CDATA,textContent:"",rootId:b};case e.COMMENT_NODE:return{type:d.Comment,textContent:T(e)||"",rootId:b};default:return!1}}(e,{doc:r,mirror:n,blockClass:a,blockSelector:o,needsMask:x,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:p,dataURLOptions:f,inlineImages:y,recordCanvas:g,keepIframeSrcFn:O,newlyAddedElement:R,cssCaptured:E});if(!P)return console.warn(e,"not serialized"),null;D=n.hasNode(e)?n.getId(e):((e,t)=>{if(t.comment&&e.type===d.Comment)return!0;if(e.type===d.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===V(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(ge(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===ge(e.attributes.name)||"icon"===ge(e.attributes.rel)||"apple-touch-icon"===ge(e.attributes.rel)||"shortcut icon"===ge(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&ge(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ge(e.attributes.property).match(/^(og|twitter|fb):/)||ge(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===ge(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===ge(e.attributes.name)||"googlebot"===ge(e.attributes.name)||"bingbot"===ge(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===ge(e.attributes.name)||"generator"===ge(e.attributes.name)||"framework"===ge(e.attributes.name)||"publisher"===ge(e.attributes.name)||"progid"===ge(e.attributes.name)||ge(e.attributes.property).match(/^article:/)||ge(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===ge(e.attributes.name)||"yandex-verification"===ge(e.attributes.name)||"csrf-token"===ge(e.attributes.name)||"p:domain_verify"===ge(e.attributes.name)||"verify-v1"===ge(e.attributes.name)||"verification"===ge(e.attributes.name)||"shopify-checkout-api-token"===ge(e.attributes.name)))return!0}}return!1})(P,m)||!L&&P.type===d.Text&&!P.textContent.replace(/^\s+|\s+$/gm,"").length?-2:ne();let W=Object.assign(P,{id:D});if(n.add(e,W),-2===D)return null;b&&b(e);let H=!l;if(W.type===d.Element){H=H&&!W.needBlock,delete W.needBlock;let t=N(e);t&&F(t)&&(W.isShadowHost=!0)}if((W.type===d.Document||W.type===d.Element)&&H){m.headWhitespace&&W.type===d.Element&&"head"===W.tagName&&(L=!1);let t={doc:r,mirror:n,blockClass:a,blockSelector:o,needsMask:x,maskTextClass:s,maskTextSelector:i,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:p,slimDOMOptions:m,dataURLOptions:f,inlineImages:y,recordCanvas:g,preserveWhiteSpace:L,onSerialize:b,onIframeLoad:S,iframeLoadTimeout:v,onStylesheetLoad:w,stylesheetLoadTimeout:I,keepIframeSrcFn:O,cssCaptured:!1};if(W.type!==d.Element||"textarea"!==W.tagName||void 0===W.attributes.value){W.type===d.Element&&void 0!==W.attributes._cssText&&"string"==typeof W.attributes._cssText&&(t.cssCaptured=!0);for(let r of Array.from(C(e))){let e=Se(r,t);e&&W.childNodes.push(e)}}let M=null;if(A(e)&&(M=N(e)))for(let e of Array.from(C(M))){let r=Se(e,t);r&&(F(M)&&(r.isShadow=!0),W.childNodes.push(r))}}let G=M(e);return G&&_(G)&&F(G)&&(W.isShadow=!0),W.type===d.Element&&"iframe"===W.tagName&&!me(e,a,o)&&((e,t,r)=>{let n=e.contentWindow;if(!n)return;let a,o=!1;try{a=n.document.readyState}catch{return}if("complete"!==a){let n=setTimeout(()=>{o||(t(),o=!0)},r);return void e.addEventListener("load",()=>{clearTimeout(n),o=!0,t()})}let s="about:blank";if(n.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)})(e,()=>{let t=e.contentDocument;if(t&&S){let r=Se(t,{doc:t,mirror:n,blockClass:a,blockSelector:o,needsMask:x,maskTextClass:s,maskTextSelector:i,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:p,slimDOMOptions:m,dataURLOptions:f,inlineImages:y,recordCanvas:g,preserveWhiteSpace:L,onSerialize:b,onIframeLoad:S,iframeLoadTimeout:v,onStylesheetLoad:w,stylesheetLoadTimeout:I,keepIframeSrcFn:O});r&&S(e,r)}},v),W.type===d.Element&&"link"===W.tagName&&"string"==typeof W.attributes.rel&&("stylesheet"===W.attributes.rel||"preload"===W.attributes.rel&&"string"==typeof W.attributes.href&&"css"===V(W.attributes.href))&&((e,t,r)=>{let n,a=!1;try{n=e.sheet}catch{return}if(n)return;let o=setTimeout(()=>{a||(t(),a=!0)},r);e.addEventListener("load",()=>{clearTimeout(o),a=!0,t()})})(e,()=>{if(w){let t=Se(e,{doc:r,mirror:n,blockClass:a,blockSelector:o,needsMask:x,maskTextClass:s,maskTextSelector:i,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:p,slimDOMOptions:m,dataURLOptions:f,inlineImages:y,recordCanvas:g,preserveWhiteSpace:L,onSerialize:b,onIframeLoad:S,iframeLoadTimeout:v,onStylesheetLoad:w,stylesheetLoadTimeout:I,keepIframeSrcFn:O});t&&w(e,t)}},I),W}var ve=class e{constructor(...e){r(this,"parentElement",null),r(this,"parentNode",null),r(this,"ownerDocument"),r(this,"firstChild",null),r(this,"lastChild",null),r(this,"previousSibling",null),r(this,"nextSibling",null),r(this,"ELEMENT_NODE",1),r(this,"TEXT_NODE",3),r(this,"nodeType"),r(this,"nodeName"),r(this,"RRNodeType")}get childNodes(){let e=[],t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};function we(e,t,r=document){let n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}var Ie="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.",Ce={map:{},getId:()=>(console.error(Ie),-1),getNode:()=>(console.error(Ie),null),removeNodeFromMap(){console.error(Ie)},has:()=>(console.error(Ie),!1),reset(){console.error(Ie)}};function Me(e,t,r={}){let n=null,a=0;return function(...o){let s=Date.now();!a&&!1===r.leading&&(a=s);let i=t-(s-a),l=this;i<=0||i>t?(n&&(clearTimeout(n),n=null),a=s,e.apply(l,o)):!n&&!1!==r.trailing&&(n=setTimeout(()=>{a=!1===r.leading?0:Date.now(),n=null,e.apply(l,o)},i))}}function ke(e,t,r,n,a=window){let o=a.Object.getOwnPropertyDescriptor(e,t);return a.Object.defineProperty(e,t,n?r:{set(e){setTimeout(()=>{r.set.call(this,e)},0),o&&o.set&&o.set.call(this,e)}}),()=>ke(e,t,o||{},!0)}function Te(e){var t,r,n,a;let o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=k(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(n=k(o.body))?void 0:n.scrollTop)||(null==(a=null==o?void 0:o.body)?void 0:a.scrollTop)||0}}function Oe(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Re(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ee(e){return e?e.nodeType===e.ELEMENT_NODE?e:k(e):null}function xe(e,t,r,n){if(!e)return!1;let a=Ee(e);if(!a)return!1;try{if("string"==typeof t){if(a.classList.contains(t)||n&&null!==a.closest("."+t))return!0}else if(fe(a,t,n))return!0}catch{}return!(!r||!(a.matches(r)||n&&null!==a.closest(r)))}function Le(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function De(e,t){if(_(e))return!1;let r=t.getId(e);if(!t.has(r))return!0;let n=M(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||De(n,t))}function Ne(e){return!!e.changedTouches}function Ae(e,t){return!("IFRAME"!==e.nodeName||!t.getMeta(e))}function _e(e,t){return!("LINK"!==e.nodeName||e.nodeType!==e.ELEMENT_NODE||!e.getAttribute||"stylesheet"!==e.getAttribute("rel")||!t.getMeta(e))}function Fe(e){return!!e&&(e instanceof ve&&"shadowRoot"in e?!!e.shadowRoot:!!N(e))}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Ce=new Proxy(Ce,{get:(e,t,r)=>("map"===t&&console.error(Ie),Reflect.get(e,t,r))}));var Ue=class{constructor(){r(this,"id",1),r(this,"styleIDMap",new WeakMap),r(this,"idStyleMap",new Map)}getId(e){var t;return null!=(t=this.styleIDMap.get(e))?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Pe(e){var t;let r=null;return"getRootNode"in e&&(null==(t=L(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&D(L(e))&&(r=D(L(e))),r}function We(e){let t=I(e);return!!t&&(x(t,e)||(e=>{let t=I(e);if(!t)return!1;let r=(e=>{let t,r=e;for(;t=Pe(r);)r=t;return r})(e);return x(t,r)})(e))}var $e,ze=(e,t)=>`${e}@${t}`,Be=class{constructor(){r(this,"frozen",!1),r(this,"locked",!1),r(this,"texts",[]),r(this,"attributes",[]),r(this,"attributeMap",new WeakMap),r(this,"removes",[]),r(this,"mapRemoves",[]),r(this,"movedMap",{}),r(this,"addedSet",new Set),r(this,"movedSet",new Set),r(this,"droppedSet",new Set),r(this,"removesSubTreeCache",new Set),r(this,"mutationCb"),r(this,"blockClass"),r(this,"blockSelector"),r(this,"maskTextClass"),r(this,"maskTextSelector"),r(this,"inlineStylesheet"),r(this,"maskInputOptions"),r(this,"maskTextFn"),r(this,"maskInputFn"),r(this,"keepIframeSrcFn"),r(this,"recordCanvas"),r(this,"inlineImages"),r(this,"slimDOMOptions"),r(this,"dataURLOptions"),r(this,"doc"),r(this,"mirror"),r(this,"iframeManager"),r(this,"stylesheetManager"),r(this,"shadowDomManager"),r(this,"processedNodeManager"),r(this,"unattachedDoc"),r(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),r(this,"emit",()=>{if(this.frozen||this.locked)return;let e=[],t=new Set;for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let e of this.movedSet){let t=M(e);this.removesSubTreeCache.has(t)&&!this.movedSet.has(t)||this.addedSet.add(e)}let r=null,n=null,a=-1,o=null,s=!1,i=new Set,l=this.addedSet.values(),d=l.next();for(;this.addedSet.size;){if(null!==r&&this.addedSet.has(E(r)))o=r,r=E(r);else{for(this.addedSet.has(d.value)||(d=l.next()),r=d.value;n=M(r),this.addedSet.has(n);)r=n;if(i.has(n))n=null;else if(n){if(We(n)?(s=Ve(this.droppedSet,n)||this.removesSubTreeCache.has(n),s&&Ve(this.movedSet,r)&&(s=!1)):s=!0,this.addedSet.has(O(n)))r=O(n),o=null;else for(;o=R(r),this.addedSet.has(o);)r=o;if(a=_(n)?this.mirror.getId(Pe(r)):this.mirror.getId(n),-1===a&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let e=D(n);a=this.mirror.getId(e)}}}if(this.addedSet.delete(r),!n||-1===a){i.add(r);continue}if(s){this.droppedSet.add(r);continue}let c=!1;if(r.nodeType===Node.TEXT_NODE){let e=n.tagName;if("TEXTAREA"===e)continue;"STYLE"===e&&t.has(a)&&(c=!0)}let u=o?this.mirror.getId(o):null;for(;-2===u;)o=o&&R(o),u=o&&this.mirror.getId(o);if(-1===u){console.warn("Couldn't record new node. Couldn't find mirror id for nextSibling:",o),r=null;continue}let h=Se(r,{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=>{Ae(e,this.mirror)&&this.iframeManager.addIframe(e),_e(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Fe(r)&&this.shadowDomManager.addShadowRoot(N(r),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:c});h&&(e.push({parentId:a,nextId:u,node:h}),t.add(h.id))}let c={texts:this.texts.map(e=>{let t=e.node,r=M(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{let{attributes:t}=e;if("string"==typeof t.style){let r=JSON.stringify(e.styleDiff),n=JSON.stringify(e._unchangedStyles);r.length<t.style.length&&(r+n).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};!c.texts.length&&!c.attributes.length&&!c.removes.length&&!c.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(c))}),r(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));let r=Array.from(C(e),e=>T(e)||"").join("");t.attributes.value=$({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:j(e),value:r,maskInputFn:this.maskInputFn})}),r(this,"processMutation",e=>{if(!Le(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{let t=T(e.target);!xe(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:ye(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Ee(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{let t=e.target,r=z(t.tagName),n=e.attributeName,a=e.target.getAttribute(n);if("value"===n){let e=j(t);a=$({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:a,maskInputFn:this.maskInputFn})}if(xe(e.target,this.blockClass,this.blockSelector,!1)||a===e.oldValue)return;let o=this.attributeMap.get(e.target);if("iframe"===r&&"src"===n&&!this.keepIframeSrcFn(a)){if(t.contentDocument)return;n="rr_src"}if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),"type"===n&&"input"===r&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!pe(r,n))if(o.attributes[n]=he(this.doc,r,z(n),a),"style"===n){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let r=this.unattachedDoc.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue);for(let e of Array.from(t.style)){let n=t.style.getPropertyValue(e),a=t.style.getPropertyPriority(e);n!==r.style.getPropertyValue(e)||a!==r.style.getPropertyPriority(e)?o.styleDiff[e]=""===a?n:[n,a]:o._unchangedStyles[e]=[n,a]}for(let e of Array.from(r.style))""===t.style.getPropertyValue(e)&&(o.styleDiff[e]=!1)}else"open"===n&&"DIALOG"===t.tagName&&(t.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":if(xe(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{We(t)||this.shadowDomManager.removeShadowRootsIn(t);let r=this.mirror.getId(t),n=_(e.target)?this.mirror.getId(D(e.target)):this.mirror.getId(e.target);xe(e.target,this.blockClass,this.blockSelector,!1)||Le(t,this.mirror,this.slimDOMOptions)||!(e=>-1!==this.mirror.getId(e))(t)||(this.addedSet.has(t)?(je(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||De(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[ze(r,n)]?je(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!_(e.target)||!F(e.target))||void 0}),((e,t)=>{let r=[e];for(;r.length;){let e=r.pop();t.has(e)||(t.add(e),C(e).forEach(e=>r.push(e)))}})(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),r(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Le(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[ze(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);xe(e,this.blockClass,this.blockSelector,!1)||(C(e).forEach(e=>this.genAdds(e)),Fe(e)&&C(N(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1,this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0}unlock(){this.locked=!1,this.emit()}};function je(e,t){e.delete(t),C(t).forEach(t=>je(e,t))}function Ve(e,t){return 0!==e.size&&He(e,t)}function He(e,t){if(e.has(t))return!0;let r=M(t);return!!r&&He(e,r)}var Ge=e=>$e?(...t)=>{try{return e(...t)}catch(e){if($e&&!0===$e(e))return;throw e}}:e,qe=new Set;function Xe(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Ye(e,t){let r=new Be;qe.add(r),r.init(e);let[n,a]=function(){let e=f("MutationObserver");m++;let t=!1;return[e.constructor,()=>{if(t||(t=!0,0!==--m))return;let e=p.MutationObserver;if(e)try{e()}finally{delete h.MutationObserver,delete p.MutationObserver}}]}(),o=new n(Ge(r.processMutations.bind(r)));return o.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),()=>{o.disconnect(),qe.delete(r),a()}}function Ze({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:a,sampling:o}){return we("scroll",Ge(Me(Ge(o=>{let s=Xe(o);if(!s||xe(s,n,a,!0))return;let i=r.getId(s);if(s===t&&t.defaultView){let r=Te(t.defaultView);e({id:i,x:r.left,y:r.top})}else e({id:i,x:s.scrollLeft,y:s.scrollTop})}),o.scroll||100)),t)}var Je=["INPUT","TEXTAREA","SELECT"],Ke=new WeakMap;function Qe(e){return function e(t,r){if(nt("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||nt("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||nt("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||nt("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){let n=Array.from(t.parentRule.cssRules).indexOf(t);return r.unshift(n),e(t.parentRule,r)}if(t.parentStyleSheet){let e=Array.from(t.parentStyleSheet.cssRules).indexOf(t);r.unshift(e)}return r}(e,[])}function et(e,t,r){let n,a;return e?(e.ownerNode?n=t.getId(e.ownerNode):a=r.getId(e),{styleId:a,id:n}):{}}function tt({mirror:e,stylesheetManager:t},r){var n,a,o;let s=null;s="#document"===r.nodeName?e.getId(r):e.getId(D(r));let i="#document"===r.nodeName?null==(n=r.defaultView)?void 0:n.Document:null==(o=null==(a=r.ownerDocument)?void 0:a.defaultView)?void 0:o.ShadowRoot,l=null!=i&&i.prototype?Object.getOwnPropertyDescriptor(null==i?void 0:i.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&i&&l?(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null==(e=l.get)?void 0:e.call(this)},set(e){var r;let n=null==(r=l.set)?void 0:r.call(this,e);if(null!==s&&-1!==s)try{t.adoptStyleSheets(e,s)}catch{}return n}}),Ge(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function rt(e,t={}){let r,n=e.doc.defaultView;if(!n)return()=>{};((e,t)=>{let{mutationCb:r,mousemoveCb:n,mouseInteractionCb:a,scrollCb:o,viewportResizeCb:s,inputCb:i,mediaInteractionCb:l,styleSheetRuleCb:d,styleDeclarationCb:c,canvasMutationCb:u,fontCb:h,selectionCb:p,customElementCb:m}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),r(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),n(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),a(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),o(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),s(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),i(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),l(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),d(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),c(...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.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),m(...e)}})(e,t),e.recordDOM&&(r=Ye(e,e.doc));let i=(({mousemoveCb:e,sampling:t,doc:r,mirror:n})=>{if(!1===t.mousemove)return()=>{};let o,s="number"==typeof t.mousemove?t.mousemove:50,i="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500,l=[],d=Me(Ge(t=>{let r=Date.now()-o;e(l.map(e=>(e.timeOffset-=r,e)),t),l=[],o=null}),i),c=Ge(Me(Ge(e=>{let t=Xe(e),{clientX:r,clientY:s}=Ne(e)?e.changedTouches[0]:e;o||(o=v()),l.push({x:r,y:s,id:n.getId(t),timeOffset:v()-o}),d("undefined"!=typeof DragEvent&&e instanceof DragEvent?a.Drag:e instanceof MouseEvent?a.MouseMove:a.TouchMove)}),s,{trailing:!1})),u=[we("mousemove",c,r),we("touchmove",c,r),we("drag",c,r)];return Ge(()=>{u.forEach(e=>e())})})(e),d=(({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:a,sampling:i})=>{if(!1===i.mouseInteraction)return()=>{};let l=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,d=[],c=null;return Object.keys(o).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==l[e]).forEach(i=>{let l=z(i),u=(t=>i=>{let l=Xe(i);if(xe(l,n,a,!0))return;let d=null,u=t;if("pointerType"in i){switch(i.pointerType){case"mouse":d=s.Mouse;break;case"touch":d=s.Touch;break;case"pen":d=s.Pen}d===s.Touch?o[t]===o.MouseDown?u="TouchStart":o[t]===o.MouseUp&&(u="TouchEnd"):s.Pen}else Ne(i)&&(d=s.Touch);null!==d?(c=d,(u.startsWith("Touch")&&d===s.Touch||u.startsWith("Mouse")&&d===s.Mouse)&&(d=null)):o[t]===o.Click&&(d=c,c=null);let h=Ne(i)?i.changedTouches[0]:i;if(!h)return;let p=r.getId(l),{clientX:m,clientY:f}=h;Ge(e)({type:o[u],id:p,x:m,y:f,...null!==d&&{pointerType:d}})})(i);if(window.PointerEvent)switch(o[i]){case o.MouseDown:case o.MouseUp:l=l.replace("mouse","pointer");break;case o.TouchStart:case o.TouchEnd:return}d.push(we(l,u,t))}),Ge(()=>{d.forEach(e=>e())})})(e),c=Ze(e),u=(({viewportResizeCb:e},{win:t})=>{let r=-1,n=-1;return we("resize",Ge(Me(Ge(()=>{let t=Oe(),a=Re();(r!==t||n!==a)&&(e({width:Number(a),height:Number(t)}),r=t,n=a)}),200)),t)})(e,{win:n}),h=function({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:a,ignoreClass:o,ignoreSelector:s,maskInputOptions:i,maskInputFn:l,sampling:d,userTriggeredOnInput:c}){function u(e){let r=Xe(e),d=e.isTrusted,u=r&&r.tagName;if(r&&"OPTION"===u&&(r=k(r)),!r||!u||Je.indexOf(u)<0||xe(r,n,a,!0)||r.classList.contains(o)||s&&r.matches(s))return;let p=r.value,m=!1,f=j(r)||"";"radio"===f||"checkbox"===f?m=r.checked:(i[u.toLowerCase()]||i[f])&&(p=$({element:r,maskInputOptions:i,tagName:u,type:f,value:p,maskInputFn:l})),h(r,c?{text:p,isChecked:m,userTriggered:d}:{text:p,isChecked:m});let y=r.name;"radio"===f&&y&&m&&t.querySelectorAll(`input[type="radio"][name="${y}"]`).forEach(e=>{if(e!==r){let t=e.value;h(e,c?{text:t,isChecked:!m,userTriggered:!1}:{text:t,isChecked:!m})}})}function h(t,n){let a=Ke.get(t);if(!a||a.text!==n.text||a.isChecked!==n.isChecked){Ke.set(t,n);let a=r.getId(t);Ge(e)({...n,id:a})}}let p=("last"===d.input?["change"]:["input","change"]).map(e=>we(e,Ge(u),t)),m=t.defaultView;if(!m)return()=>{p.forEach(e=>e())};let f=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),y=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return f&&f.set&&p.push(...y.map(e=>ke(e[0],e[1],{set(){Ge(u)({target:this,isTrusted:!1})}},!1,m))),Ge(()=>{p.forEach(e=>e())})}(e),p=(({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:a,doc:o})=>{let s=Ge(o=>Me(Ge(a=>{let s=Xe(a);if(!s||!(s instanceof HTMLMediaElement)||xe(s,t,r,!0))return;let{currentTime:i,volume:l,muted:d,playbackRate:c,loop:u}=s;e({type:o,id:n.getId(s),currentTime:i,volume:l,muted:d,playbackRate:c,loop:u})}),a.media||500)),i=[we("play",s(l.Play),o),we("pause",s(l.Pause),o),we("seeked",s(l.Seeked),o),we("volumechange",s(l.VolumeChange),o),we("ratechange",s(l.RateChange),o)];return Ge(()=>{i.forEach(e=>e())})})(e),m=()=>{},f=()=>{},y=()=>{},g=()=>{};e.recordDOM&&(m=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};let a=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(a,{apply:Ge((n,a,o)=>{let[s,i]=o,{id:l,styleId:d}=et(a,t,r.styleMirror);return(l&&-1!==l||d&&-1!==d)&&e({id:l,styleId:d,adds:[{rule:s,index:i}]}),n.apply(a,o)})}),n.CSSStyleSheet.prototype.addRule=function(e,t,r=this.cssRules.length){let a=`${e} { ${t} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[a,r])};let o,s,i=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:Ge((n,a,o)=>{let[s]=o,{id:i,styleId:l}=et(a,t,r.styleMirror);return(i&&-1!==i||l&&-1!==l)&&e({id:i,styleId:l,removes:[{index:s}]}),n.apply(a,o)})}),n.CSSStyleSheet.prototype.removeRule=function(e){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},n.CSSStyleSheet.prototype.replace&&(o=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:Ge((n,a,o)=>{let[s]=o,{id:i,styleId:l}=et(a,t,r.styleMirror);return(i&&-1!==i||l&&-1!==l)&&e({id:i,styleId:l,replace:s}),n.apply(a,o)})})),n.CSSStyleSheet.prototype.replaceSync&&(s=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(s,{apply:Ge((n,a,o)=>{let[s]=o,{id:i,styleId:l}=et(a,t,r.styleMirror);return(i&&-1!==i||l&&-1!==l)&&e({id:i,styleId:l,replaceSync:s}),n.apply(a,o)})}));let l={};at("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(at("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),at("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),at("CSSSupportsRule")&&(l.CSSSupportsRule=n.CSSSupportsRule));let d={};return Object.entries(l).forEach(([n,a])=>{d[n]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=new Proxy(d[n].insertRule,{apply:Ge((n,a,o)=>{let[s,i]=o,{id:l,styleId:d}=et(a.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||d&&-1!==d)&&e({id:l,styleId:d,adds:[{rule:s,index:[...Qe(a),i||0]}]}),n.apply(a,o)})}),a.prototype.deleteRule=new Proxy(d[n].deleteRule,{apply:Ge((n,a,o)=>{let[s]=o,{id:i,styleId:l}=et(a.parentStyleSheet,t,r.styleMirror);return(i&&-1!==i||l&&-1!==l)&&e({id:i,styleId:l,removes:[{index:[...Qe(a),s]}]}),n.apply(a,o)})})}),Ge(()=>{n.CSSStyleSheet.prototype.insertRule=a,n.CSSStyleSheet.prototype.deleteRule=i,o&&(n.CSSStyleSheet.prototype.replace=o),s&&(n.CSSStyleSheet.prototype.replaceSync=s),Object.entries(l).forEach(([e,t])=>{t.prototype.insertRule=d[e].insertRule,t.prototype.deleteRule=d[e].deleteRule})})}(e,{win:n}),f=tt(e,e.doc),y=(({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:a})=>{let o=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:Ge((a,s,i)=>{var l;let[d,c,u]=i;if(r.has(d))return o.apply(s,[d,c,u]);let{id:h,styleId:p}=et(null==(l=s.parentRule)?void 0:l.parentStyleSheet,t,n.styleMirror);return(h&&-1!==h||p&&-1!==p)&&e({id:h,styleId:p,set:{property:d,value:c,priority:u},index:Qe(s.parentRule)}),a.apply(s,i)})});let s=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:Ge((a,o,i)=>{var l;let[d]=i;if(r.has(d))return s.apply(o,[d]);let{id:c,styleId:u}=et(null==(l=o.parentRule)?void 0:l.parentStyleSheet,t,n.styleMirror);return(c&&-1!==c||u&&-1!==u)&&e({id:c,styleId:u,remove:{property:d},index:Qe(o.parentRule)}),a.apply(o,i)})}),Ge(()=>{a.CSSStyleDeclaration.prototype.setProperty=o,a.CSSStyleDeclaration.prototype.removeProperty=s})})(e,{win:n}),e.collectFonts&&(g=function({fontCb:e,doc:t}){let r=t.defaultView;if(!r)return()=>{};let n=[],a=new WeakMap,o=r.FontFace;r.FontFace=(e,t,r)=>{let n=new o(e,t,r);return a.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};let s=w(t.fonts,"add",function(t){return function(r){return setTimeout(Ge(()=>{let t=a.get(r);t&&(e(t),a.delete(r))}),0),t.apply(this,[r])}});return n.push(()=>{r.FontFace=o}),n.push(s),Ge(()=>{n.forEach(e=>e())})}(e)));let b=(e=>{let{doc:t,mirror:r,blockClass:n,blockSelector:a,selectionCb:o}=e,s=!0,i=Ge(()=>{let e=t.getSelection();if(!e||s&&null!=e&&e.isCollapsed)return;s=e.isCollapsed||!1;let i=[],l=e.rangeCount||0;for(let t=0;t<l;t++){let{startContainer:o,startOffset:s,endContainer:l,endOffset:d}=e.getRangeAt(t);xe(o,n,a,!0)||xe(l,n,a,!0)||i.push({start:r.getId(o),startOffset:s,end:r.getId(l),endOffset:d})}o({ranges:i})});return i(),we("selectionchange",i)})(e),S=function({doc:e,customElementCb:t}){let r=e.defaultView;return r&&r.customElements?w(r.customElements,"define",function(e){return function(r,n,a){try{t({define:{name:r}})}catch{console.warn(`Custom element callback failed for ${r}`)}return e.apply(this,[r,n,a])}}):()=>{}}(e),I=[];for(let t of e.plugins)I.push(t.observer(t.callback,n,t.options));return Ge(()=>{null==r||r(),i(),d(),c(),u(),h(),p(),m(),f(),y(),g(),b(),S(),I.forEach(e=>e())})}function nt(e){return void 0!==window[e]}function at(e){return!!(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var ot=class{constructor(e){r(this,"generateIdFn"),r(this,"iframeIdToRemoteIdMap",new WeakMap),r(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,n){let a=r||this.getIdToRemoteIdMap(e),o=n||this.getRemoteIdToIdMap(e),s=a.get(t);return s||(s=this.generateIdFn(),a.set(t,s),o.set(s,t)),s}getIds(e,t){let r=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,r,n))}getRemoteId(e,t,r){let n=r||this.getRemoteIdToIdMap(e);return"number"!=typeof t?t:n.get(t)||-1}getRemoteIds(e,t){let r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,r))}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}},st=class{constructor(e){r(this,"iframes",new WeakMap),r(this,"crossOriginIframeMap",new WeakMap),r(this,"crossOriginIframeMirror",new ot(ne)),r(this,"crossOriginIframeStyleMirror"),r(this,"crossOriginIframeRootIdMap",new WeakMap),r(this,"mirror"),r(this,"mutationCb"),r(this,"wrappedEmit"),r(this,"loadListener"),r(this,"unloadListener"),r(this,"attachedWindows",new Map),r(this,"messageHandler",e=>this.handleMessage(e)),r(this,"stylesheetManager"),r(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ot(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}addUnloadListener(e){this.unloadListener=e}attachIframe(e,t){var r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.watchIframeWindow(e),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}destroy(){window.removeEventListener("message",this.messageHandler),this.attachedWindows.forEach(e=>e())}watchIframeWindow(e){let t=e.contentWindow;if(!t||this.attachedWindows.has(t))return;let r=[],n=()=>{this.attachedWindows.delete(t),r.forEach(e=>{try{e()}catch{}})};this.attachedWindows.set(t,n),this.recordCrossOriginIframes&&r.push(we("message",this.messageHandler,t)),r.push(we("pagehide",e=>{var r;if(e.persisted)return;let a=t.document;n(),null==(r=this.unloadListener)||r.call(this,a)},t))}handleMessage(e){let t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin||!e.source)return;let r=this.crossOriginIframeMap.get(e.source);if(!r)return;let n=this.transformCrossOriginEvent(r,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case n.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let r=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(t.data.node,r),{timestamp:t.timestamp,type:n.IncrementalSnapshot,data:{source:a.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case n.Meta:case n.Load:case n.DomContentLoaded:return!1;case n.Annotation:case n.Plugin:return t;case n.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case n.IncrementalSnapshot:switch(t.data.source){case a.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);let r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)}),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 a.Drag:case a.TouchMove:case a.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case a.ViewportResize:return!1;case a.MediaInteraction:case a.MouseInteraction:case a.Scroll:case a.CanvasMutation:case a.Input:return this.replaceIds(t.data,e,["id"]),t;case a.StyleSheetRule:case a.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case a.Font:return t;case a.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case a.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}return!1}replace(e,t,r,n){for(let a of n)!Array.isArray(t[a])&&"number"!=typeof t[a]||(Array.isArray(t[a])?t[a]=e.getIds(r,t[a]):t[a]=e.getId(r,t[a]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type!==d.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}},it=class{constructor(e){r(this,"shadowDoms",new Map),r(this,"mutationCb"),r(this,"scrollCb"),r(this,"bypassOptions"),r(this,"mirror"),r(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!F(e)||this.shadowDoms.has(e))return;let r=[];this.shadowDoms.set(e,r);let n=Ye({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);r.push(n),r.push(Ze({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{this.shadowDoms.get(e)===r&&(e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(D(e))),r.push(tt({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e)))},0)}removeShadowRootsIn(e){if(0===this.shadowDoms.size)return;let t=N(e);t&&(this.shadowDoms.has(t)&&this.removeShadowRoot(t),this.removeShadowRootsIn(t)),C(e).forEach(e=>this.removeShadowRootsIn(e))}removeShadowRoot(e){let t=this.shadowDoms.get(e);this.shadowDoms.delete(e),null==t||t.forEach(lt)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){let r=this;this.restoreHandlers.push(w(e.prototype,"attachShadow",function(e){return function(n){let a=e.call(this,n),o=N(this);return o&&We(this)&&r.addShadowRoot(o,t),a}}))}reset(){this.restoreHandlers.forEach(lt),this.restoreHandlers=[];let e=this.shadowDoms;this.shadowDoms=new Map,e.forEach(e=>e.forEach(lt))}};function lt(e){try{e()}catch{}}var dt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ct="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(ut=0;ut<64;ut++)ct[dt.charCodeAt(ut)]=ut;var ut,ht=e=>{var t,r=new Uint8Array(e),n=r.length,a="";for(t=0;t<n;t+=3)a+=dt[r[t]>>2],a+=dt[(3&r[t])<<4|r[t+1]>>4],a+=dt[(15&r[t+1])<<2|r[t+2]>>6],a+=dt[63&r[t+2]];return n%3==2?a=a.substring(0,a.length-1)+"=":n%3==1&&(a=a.substring(0,a.length-2)+"=="),a},pt=new Map,mt=(e,t,r)=>{if(!e||!gt(e,t)&&"object"!=typeof e)return;let n=((e,t)=>{let r=pt.get(e);return r||(r=new Map,pt.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)})(r,e.constructor.name),a=n.indexOf(e);return-1===a&&(a=n.length,n.push(e)),a};function ft(e,t,r){if(e instanceof Array)return e.map(e=>ft(e,t,r));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)return{rr_type:e.constructor.name,base64:ht(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[ft(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let t=e.constructor.name,{src:r}=e;return{rr_type:t,src:r}}return e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL()}:e instanceof ImageData?{rr_type:e.constructor.name,args:[ft(e.data,t,r),e.width,e.height]}:gt(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:mt(e,t,r)}:e}var yt=(e,t,r)=>e.map(e=>ft(e,t,r)),gt=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]).find(r=>e instanceof t[r]);function bt(e,t,r,n){let a=[];try{let o=w(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(a,...o){if(!xe(this,t,r,!0)){let e=(e=>"experimental-webgl"===e?"webgl":e)(a);if("__context"in this||(this.__context=e),n&&["webgl","webgl2"].includes(e))if(o[0]&&"object"==typeof o[0]){let e=o[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[a,...o])}});a.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{a.forEach(e=>e())}}function St(e,t,r,n,a,o){let s=[],i=Object.getOwnPropertyNames(e);for(let l of i)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if("function"!=typeof e[l])continue;let i=w(e,l,function(e){return function(...s){let i=e.apply(this,s);if(mt(i,o,this),"tagName"in this.canvas&&!xe(this.canvas,n,a,!0)){let e=yt(s,o,this),n={type:t,property:l,args:e};r(this.canvas,n)}return i}});s.push(i)}catch{let n=ke(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});s.push(n)}return s}var vt='(function() {\n\t// ../../node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js\n\tvar chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n\tvar lookup = typeof Uint8Array === "undefined" ? [] : /* @__PURE__ */ new Uint8Array(256);\n\tfor (var i = 0; i < chars.length; i++) lookup[chars.charCodeAt(i)] = i;\n\tvar encode = function(arraybuffer) {\n\t\tvar bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = "";\n\t\tfor (i = 0; i < len; i += 3) {\n\t\t\tbase64 += chars[bytes[i] >> 2];\n\t\t\tbase64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n\t\t\tbase64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n\t\t\tbase64 += chars[bytes[i + 2] & 63];\n\t\t}\n\t\tif (len % 3 === 2) base64 = base64.substring(0, base64.length - 1) + "=";\n\t\telse if (len % 3 === 1) base64 = base64.substring(0, base64.length - 2) + "==";\n\t\treturn base64;\n\t};\n\t// ../rrweb/src/record/workers/image-bitmap-data-url-worker.ts\n\tconst lastBlobMap = /* @__PURE__ */ new Map();\n\tconst transparentBlobMap = /* @__PURE__ */ new Map();\n\tasync function getTransparentBlobFor(width, height, dataURLOptions) {\n\t\tconst id = `${width}-${height}`;\n\t\tif ("OffscreenCanvas" in globalThis) {\n\t\t\tif (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n\t\t\tconst offscreen = new OffscreenCanvas(width, height);\n\t\t\toffscreen.getContext("2d");\n\t\t\tconst base64 = encode(await (await offscreen.convertToBlob(dataURLOptions)).arrayBuffer());\n\t\t\ttransparentBlobMap.set(id, base64);\n\t\t\treturn base64;\n\t\t} else return "";\n\t}\n\tconst worker = self;\n\tworker.onmessage = async function(e) {\n\t\tif ("OffscreenCanvas" in globalThis) {\n\t\t\tconst { id, bitmap, width, height, dataURLOptions } = e.data;\n\t\t\tconst transparentBase64 = getTransparentBlobFor(width, height, dataURLOptions);\n\t\t\tconst offscreen = new OffscreenCanvas(width, height);\n\t\t\toffscreen.getContext("2d").drawImage(bitmap, 0, 0);\n\t\t\tbitmap.close();\n\t\t\tconst blob = await offscreen.convertToBlob(dataURLOptions);\n\t\t\tconst type = blob.type;\n\t\t\tconst base64 = encode(await blob.arrayBuffer());\n\t\t\tif (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n\t\t\t\tlastBlobMap.set(id, base64);\n\t\t\t\treturn worker.postMessage({ id });\n\t\t\t}\n\t\t\tif (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n\t\t\tworker.postMessage({\n\t\t\t\tid,\n\t\t\t\ttype,\n\t\t\t\tbase64,\n\t\t\t\twidth,\n\t\t\t\theight\n\t\t\t});\n\t\t\tlastBlobMap.set(id, base64);\n\t\t} else return worker.postMessage({ id: e.data.id });\n\t};\n})();\n\n//# sourceMappingURL=image-bitmap-data-url-worker-DVcMqE1_.js.map',wt="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",vt],{type:"text/javascript;charset=utf-8"});function It(e){let t;try{if(t=wt&&(self.URL||self.webkitURL).createObjectURL(wt),!t)throw"";let r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(vt),{name:null==e?void 0:e.name})}}var Ct,Mt,kt,Tt,Ot=class{constructor(e){r(this,"pendingCanvasMutations",new Map),r(this,"rafStamps",{latestId:0,invokeId:null}),r(this,"mirror"),r(this,"mutationCb"),r(this,"resetObservers"),r(this,"frozen",!1),r(this,"locked",!1),r(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)});let{sampling:t="all",win:n,blockClass:a,blockSelector:o,recordCanvas:s,dataURLOptions:i}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===t&&this.initCanvasMutationObserver(n,a,o),s&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,a,o,{dataURLOptions:i})}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,r,n,a){let o=bt(t,r,n,!0),s=new Map,l=new It;l.onmessage=e=>{let{id:t}=e.data;if(s.set(t,!1),!("base64"in e.data))return;let{base64:r,type:n,width:a,height:o}=e.data;this.mutationCb({id:t,type:i["2D"],commands:[{property:"clearRect",args:[0,0,a,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:n}]},0,0]}]})};let d,c=1e3/e,u=0,h=e=>{u&&e-u<c||(u=e,(()=>{let e=[];return t.document.querySelectorAll("canvas").forEach(t=>{xe(t,r,n,!0)||e.push(t)}),e})().forEach(async e=>{var t;let r=this.mirror.getId(e);if(s.get(r)||0===e.width||0===e.height)return;if(s.set(r,!0),["webgl","webgl2"].includes(e.__context)){let r=e.getContext(e.__context);!1===(null==(t=null==r?void 0:r.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&r.clear(r.COLOR_BUFFER_BIT)}let n=await createImageBitmap(e);l.postMessage({id:r,bitmap:n,width:e.width,height:e.height,dataURLOptions:a.dataURLOptions},[n])})),d=requestAnimationFrame(h)};d=requestAnimationFrame(h),this.resetObservers=()=>{o(),cancelAnimationFrame(d)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let n=bt(e,t,r,!1),a=function(e,t,r,n){let a=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let s of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])continue;let o=w(t.CanvasRenderingContext2D.prototype,s,function(a){return function(...o){return xe(this.canvas,r,n,!0)||setTimeout(()=>{let r=yt(o,t,this);e(this.canvas,{type:i["2D"],property:s,args:r})},0),a.apply(this,o)}});a.push(o)}catch{let r=ke(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:i["2D"],property:s,args:[t],setter:!0})}});a.push(r)}return()=>{a.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r),o=((e,t,r,n)=>{let a=[];return void 0!==t.WebGLRenderingContext&&a.push(...St(t.WebGLRenderingContext.prototype,i.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&a.push(...St(t.WebGL2RenderingContext.prototype,i.WebGL2,e,r,n,t)),()=>{a.forEach(e=>e())}})(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{n(),a(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let r=this.pendingCanvasMutations.get(e);if(!r||-1===t)return;let n=r.map(e=>{let{type:t,...r}=e;return r}),{type:a}=r[0];this.mutationCb({id:t,type:a,commands:n}),this.pendingCanvasMutations.delete(e)}},Rt=class{constructor(e){r(this,"trackedLinkElements",new WeakSet),r(this,"mutationCb"),r(this,"adoptedStyleSheetCb"),r(this,"styleMirror",new Ue),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;let r={id:t,styleIds:[]},n=[];for(let t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,(e,r)=>({rule:P(e,t.href),index:r}))})),r.styleIds.push(e)}n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},Et=class{constructor(){r(this,"nodeMap",new WeakMap),r(this,"active",!1)}inOtherBuffer(e,t){let r=this.nodeMap.get(e);return r&&Array.from(r).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}},xt=!1;try{if(2!==Array.from([1],e=>2*e)[0]){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(Tt=e.contentWindow)?void 0:Tt.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var Lt=new W;function Dt(e={}){let{emit:t,checkoutEveryNms:r,checkoutEveryNth:o,blockClass:s="rr-block",blockSelector:i=null,ignoreClass:l="rr-ignore",ignoreSelector:d=null,maskTextClass:c="rr-mask",maskTextSelector:u=null,inlineStylesheet:h=!0,maskAllInputs:p,maskInputOptions:m,slimDOMOptions:f,maskInputFn:y,maskTextFn:g,hooks:b,packFn:S,sampling:w={},dataURLOptions:I={},mousemoveWait:C,recordDOM:M=!0,recordCanvas:k=!1,recordCrossOriginIframes:T=!1,recordAfter:O=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:R=!1,collectFonts:E=!1,inlineImages:x=!1,plugins:L,keepIframeSrcFn:D=()=>!1,ignoreCSSAttributes:A=new Set([]),errorHandler:_}=e;(e=>{$e=e})(_);let F=!T||window.parent===window,U=!1;if(!F)try{window.parent.document&&(U=!1)}catch{U=!0}if(F&&!t)throw new Error("emit function is required");if(!F&&!U)return()=>{};void 0!==C&&void 0===w.mousemove&&(w.mousemove=C),Lt.reset();let P=!0===p?{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!==m?m:{password:!0},$=be(f);((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)})();let z,B=0,j=e=>{for(let t of L||[])t.eventProcessor&&(e=t.eventProcessor(e));return S&&!U&&(e=S(e)),e};Ct=(e,s)=>{let i=e;if(i.timestamp=v(),i.type!==n.FullSnapshot&&(i.type!==n.IncrementalSnapshot||i.data.source!==a.Mutation)){kt.unfreeze();for(let e of qe){if(!e.isFrozen())break;e.unfreeze()}}if(F)null==t||t(j(i),s);else if(U){let e={type:"rrweb",event:j(i),origin:window.location.origin,isCheckout:s};window.parent.postMessage(e,"*")}if(i.type===n.FullSnapshot)z=i,B=0;else if(i.type===n.IncrementalSnapshot){if(i.data.source===a.Mutation&&i.data.isAttachIframe)return;B++;let e=o&&B>=o,t=r&&i.timestamp-z.timestamp>r;(e||t)&&Mt(!0)}};let V=e=>{Ct({type:n.IncrementalSnapshot,data:{source:a.Mutation,...e}})},H=e=>Ct({type:n.IncrementalSnapshot,data:{source:a.Scroll,...e}}),G=e=>Ct({type:n.IncrementalSnapshot,data:{source:a.CanvasMutation,...e}}),q=new Rt({mutationCb:V,adoptedStyleSheetCb:e=>Ct({type:n.IncrementalSnapshot,data:{source:a.AdoptedStyleSheet,...e}})}),X=new st({mirror:Lt,mutationCb:V,stylesheetManager:q,recordCrossOriginIframes:T,wrappedEmit:Ct});for(let e of L||[])e.getMirror&&e.getMirror({nodeMirror:Lt,crossOriginIframeMirror:X.crossOriginIframeMirror,crossOriginIframeStyleMirror:X.crossOriginIframeStyleMirror});let Y=new Et;kt=new Ot({recordCanvas:k,mutationCb:G,win:window,blockClass:s,blockSelector:i,mirror:Lt,sampling:w.canvas,dataURLOptions:I});let Z=new it({mutationCb:V,scrollCb:H,bypassOptions:{blockClass:s,blockSelector:i,maskTextClass:c,maskTextSelector:u,inlineStylesheet:h,maskInputOptions:P,dataURLOptions:I,maskTextFn:g,maskInputFn:y,recordCanvas:k,inlineImages:x,sampling:w,slimDOMOptions:$,iframeManager:X,stylesheetManager:q,canvasManager:kt,keepIframeSrcFn:D,processedNodeManager:Y},mirror:Lt});Mt=(e=!1)=>{if(!M)return;Ct({type:n.Meta,data:{href:window.location.href,width:Re(),height:Oe()}},e),q.reset(),Z.init(),kt.lock(),qe.forEach(e=>e.lock());let t=((e,t)=>{let{mirror:r=new W,blockClass:n="rr-block",blockSelector:a=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:i=!0,inlineImages:l=!1,recordCanvas:d=!1,maskAllInputs:c=!1,maskTextFn:u,maskInputFn:h,slimDOM:p=!1,dataURLOptions:m,preserveWhiteSpace:f,onSerialize:y,onIframeLoad:g,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:v,keepIframeSrcFn:w=()=>!1}=t||{};return Se(e,{doc:e,mirror:r,blockClass:n,blockSelector:a,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:i,maskInputOptions:!0===c?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===c?{password:!0}:c,maskTextFn:u,maskInputFn:h,slimDOMOptions:be(p),dataURLOptions:m,inlineImages:l,recordCanvas:d,preserveWhiteSpace:f,onSerialize:y,onIframeLoad:g,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:v,keepIframeSrcFn:w,newlyAddedElement:!1})})(document,{mirror:Lt,blockClass:s,blockSelector:i,maskTextClass:c,maskTextSelector:u,inlineStylesheet:h,maskAllInputs:P,maskTextFn:g,maskInputFn:y,slimDOM:$,dataURLOptions:I,recordCanvas:k,inlineImages:x,onSerialize:e=>{Ae(e,Lt)&&X.addIframe(e),_e(e,Lt)&&q.trackLinkElement(e),Fe(e)&&Z.addShadowRoot(N(e),document)},onIframeLoad:(e,t)=>{X.attachIframe(e,t),Z.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{q.attachLinkElement(e,t)},keepIframeSrcFn:D});if(!t)return console.warn("Failed to snapshot the document");Ct({type:n.FullSnapshot,data:{node:t,initialOffset:Te(window)}},e),kt.unlock(),qe.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&q.adoptStyleSheets(document.adoptedStyleSheets,Lt.getId(document))};try{let e=[],t=e=>{var t;return Ge(rt)({mutationCb:V,mousemoveCb:(e,t)=>Ct({type:n.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Ct({type:n.IncrementalSnapshot,data:{source:a.MouseInteraction,...e}}),scrollCb:H,viewportResizeCb:e=>Ct({type:n.IncrementalSnapshot,data:{source:a.ViewportResize,...e}}),inputCb:e=>Ct({type:n.IncrementalSnapshot,data:{source:a.Input,...e}}),mediaInteractionCb:e=>Ct({type:n.IncrementalSnapshot,data:{source:a.MediaInteraction,...e}}),styleSheetRuleCb:e=>Ct({type:n.IncrementalSnapshot,data:{source:a.StyleSheetRule,...e}}),styleDeclarationCb:e=>Ct({type:n.IncrementalSnapshot,data:{source:a.StyleDeclaration,...e}}),canvasMutationCb:G,fontCb:e=>Ct({type:n.IncrementalSnapshot,data:{source:a.Font,...e}}),selectionCb:e=>{Ct({type:n.IncrementalSnapshot,data:{source:a.Selection,...e}})},customElementCb:e=>{Ct({type:n.IncrementalSnapshot,data:{source:a.CustomElement,...e}})},blockClass:s,ignoreClass:l,ignoreSelector:d,maskTextClass:c,maskTextSelector:u,maskInputOptions:P,inlineStylesheet:h,sampling:w,recordDOM:M,recordCanvas:k,inlineImages:x,userTriggeredOnInput:R,collectFonts:E,doc:e,maskInputFn:y,maskTextFn:g,keepIframeSrcFn:D,blockSelector:i,slimDOMOptions:$,dataURLOptions:I,mirror:Lt,iframeManager:X,stylesheetManager:q,shadowDomManager:Z,processedNodeManager:Y,canvasManager:kt,ignoreCSSAttributes:A,plugins:(null==(t=null==L?void 0:L.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>Ct({type:n.Plugin,data:{plugin:e.name,payload:t}})})))||[]},b)},r=new Map;X.addLoadListener(e=>{try{let n=e.contentDocument;if(r.has(n))return;r.set(n,t(n))}catch(e){console.warn(e)}}),X.addUnloadListener(e=>{let t=r.get(e);t&&(r.delete(e),t(),Z.removeShadowRootsIn(e),Lt.removeNodeFromMap(e))});let o=()=>{Mt(),e.push(t(document)),xt=!0};return["interactive","complete"].includes(document.readyState)?o():(e.push(we("DOMContentLoaded",()=>{Ct({type:n.DomContentLoaded,data:{}}),"DOMContentLoaded"===O&&o()})),e.push(we("load",()=>{Ct({type:n.Load,data:{}}),"load"===O&&o()},window))),()=>{[...e,...r.values()].forEach(e=>{try{e()}catch(e){String(e).toLowerCase().includes("cross-origin")||console.warn(e)}}),r.clear(),X.destroy(),Y.destroy(),Z.reset(),kt.reset(),xt=!1,$e=void 0}}catch(e){console.warn(e)}}function Nt(e,t){if(!e||!e.closest)return null;try{return e.closest(t)}catch{return null}}Dt.addCustomEvent=(e,t)=>{if(!xt)throw new Error("please add custom event after start recording");Ct({type:n.Custom,data:{tag:e,payload:t}})},Dt.addAnnotation=e=>{if(!xt)throw new Error("please add annotation after recording started");Ct({type:n.Annotation,data:e})},Dt.freezePage=()=>{kt.freeze(),qe.forEach(e=>e.freeze())},Dt.takeFullSnapshot=e=>{if(!xt)throw new Error("please take full snapshot after start recording");Mt(e)},Dt.mirror=Lt;var At=/[^\s@<>()[\]"',;:]{1,64}@[^\s@<>()[\]"',;:]{1,253}\.[a-z]{2,}/gi,_t=/\beyJ[\w-]{6,500}\.[\w-]{6,}\.[\w-]{6,}/g,Ft=/\b(?:sk_live_|sk_test_|rk_live_|pk_live_|ib_sk_|ghp_|gho_|ghs_|github_pat_|xox[abpr]-|AKIA|AIza|ya29\.)[\w.-]{8,}/g,Ut=/\b\d{3}-\d{2}-\d{4}\b/g,Pt=/\b[A-Z]{2}\d{2}(?: ?[A-Z0-9]{4}){2,7}(?: ?[A-Z0-9]{1,4})?\b/g,Wt=/\+?\(?\d[\d\s().-]{7,}\d/g,$t=/[A-Za-z0-9_-]{32,}/g,zt=e=>e.replace(/\S/g,"*");function Bt(e){let t=e.replace(/\D/g,"");return t.length>=13&&t.length<=19&&(e=>{let t=0,r=!1;for(let n=e.length-1;n>=0;n--){let a=e.charCodeAt(n)-48;r&&(a*=2,a>9&&(a-=9)),t+=a,r=!r}return t%10==0})(t)||t.length>=9&&t.length<=15&&/^\+|[\s().-]/.test(e)&&!/^\d{4}-\d{2}-\d{2}/.test(e)?zt(e):e}function jt(e){if(!e)return e;let t=e.indexOf("@")>=0,r=/\d/.test(e);return!t&&!r&&e.length<32||(t&&(e=e.replace(At,zt)),e.length>=20&&(e=e.replace(_t,zt).replace(Ft,zt)),r&&(e=e.replace(Ut,zt).replace(Pt,zt).replace(Wt,Bt)),e.length>=32&&(e=e.replace($t,e=>/\d/.test(e)&&/[A-Za-z]/.test(e)?zt(e):e))),e}var Vt=["gclid","gbraid","wbraid","fbclid","msclkid","ttclid","li_fat_id","twclid"];function Ht(e){return e.split("/").map(e=>{let t=e;try{t=decodeURIComponent(e)}catch{return":redacted"}return t.indexOf("@")>=0||t.indexOf("=")>=0||/^\d{9,}$/.test(t)||t.length>=24&&/\d/.test(t)&&/^[\w-]+$/.test(t)||jt(t)!==t?":redacted":e}).join("/")}function Gt(e,t=[]){let r;try{r=new URL(e,"undefined"!=typeof location?location.href:"http://localhost/")}catch{return{url:"",path:""}}let n=Ht(r.pathname)+(0===r.hash.indexOf("#/")?Ht(r.hash.split("?")[0]):""),a="";return r.searchParams.forEach((e,r)=>{let n=0===r.indexOf("utm_")||Vt.indexOf(r)>=0||t.indexOf(r)>=0;a+=(a?"&":"?")+encodeURIComponent(r)+"="+(n?encodeURIComponent(jt(e)):"*")}),{url:r.origin+n+a,path:n}}var qt,Xt="input[type=password],input[type=email],input[type=tel],input[type=hidden],[autocomplete^=cc-],[autocomplete=one-time-code],[autocomplete=current-password],[autocomplete=new-password],[autocomplete=email],[autocomplete=tel],input[name=pin i],input[id=pin i],textarea[name=pin i],"+["pass","pwd","card","ccnum","cc-num","cvc","cvv","iban","ssn","otp","secret","token","email","phone"].map(e=>`input[name*=${e} i],input[id*=${e} i],textarea[name*=${e} i]`).join(","),Yt=/pass|pwd|card|cc-?num|cvc|cvv|iban|ssn|otp|secret|token|email|phone|^pin$/i,Zt="[data-ib-mask],.ib-mask";function Jt(e,t){return(e.getAttribute(t)||"").toLowerCase()}function Kt(e){if(void 0===qt)try{e.createElement("input").matches(Xt),qt=!0}catch{qt=!1}return qt}var Qt=e=>e.replace(/\S/g,"*");function er(e,t){for(let r=e;r;){let e=Nt(r,t);if(e)return e;let n=r.getRootNode?r.getRootNode():null;r=n&&n.host?n.host:null}return null}function tr(e,t){let r=Zt+t;return(t,n)=>t&&t.trim()?"text"===e||er(n,r)||(e=>!(!e||!er(e,"[contenteditable]:not([contenteditable=false])")&&"on"!==e.ownerDocument.designMode))(n)||"controls"===e&&!er(n,"button,a,label,nav,th,summary,option,select,legend,[role=button],[role=link],[role=tab],[role=menuitem],[role=option],[role=checkbox],[role=radio],[role=switch],input[type=submit],input[type=button],input[type=reset],[data-ib-unmask]")?Qt(t):jt(t):t}function rr(e){if(jt(e)===e)return e;try{let t=new URL(e,location.href),r="";return t.searchParams.forEach((e,t)=>{r+=(r?"&":"?")+encodeURIComponent(t)+"="+encodeURIComponent(jt(e))}),t.origin+Ht(t.pathname)+r}catch{return jt(e)}}var nr=/^(href|action|formaction|cite|ping|xlink:href|rr_src)$/,ar=/^(src|srcset|poster|background|data)$/,or=/^(title|alt|placeholder|label|value|summary|abbr|aria-label|aria-description|aria-valuetext|aria-placeholder|aria-roledescription|aria-braillelabel|aria-brailleroledescription)$/,sr=/^(on|nonce$|srcdoc$)/,ir=/^[a-z][a-z-]{0,15}$/,lr=e=>!e||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)&&!/^(submit|button|reset|image|checkbox|radio)$/i.test(e.getAttribute("type")||"");function dr(e,t){return(e=>!(!e||!e.tagName)&&(Kt(e.ownerDocument)?e.matches(Xt):(e=>{let t=e.tagName.toLowerCase();if("input"!==t&&"textarea"!==t)return!1;let r=Jt(e,"type"),n=Jt(e,"autocomplete"),a=r=>Yt.test(Jt(e,r))&&("input"===t||"name"===r);return"input"===t&&["password","email","tel","hidden"].indexOf(r)>=0||0===n.indexOf("cc-")||["one-time-code","current-password","new-password","email","tel"].indexOf(n)>=0||a("name")||a("id")})(e)))(t)?"********":e&&"*".repeat(e.length)}function cr(e,t){if(!Array.isArray(e))return"";let r="";for(let n of e.slice(0,50))if("string"==typeof n&&n&&!(n.length>200))try{(t||document).querySelector(n),r+=","+n}catch{continue}return r}function ur(e,t="",r=""){return{maskAllInputs:!0,maskInputFn:dr,maskTextSelector:"*",maskTextFn:tr(e,t),blockSelector:'[data-ib-block],.ib-block,input[type=file],img[src^="blob:"],img[src^="data:"],img[srcset*="blob:"],img[srcset*="data:"],source[srcset*="blob:"],source[srcset*="data:"],video[src^="blob:"],image[href^="data:"],image[href^="blob:"]'+("text"===e?",img,picture,video,image":"")+r,ignoreSelector:Kt(document)?Xt:Xt.replace(/ i\]/g,"]"),slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!1,recordCanvas:!1,recordCrossOriginIframes:!1,recordAfter:"DOMContentLoaded",sampling:{mousemove:50,scroll:150,media:800,input:"last"}}}var hr=204800,pr=0,mr=/bot\b|crawl|spider|slurp|facebookexternalhit|embedly|lighthouse|pagespeed/i,fr=window;fr.__ionblink_chunk&&fr.__ionblink_chunk("r",e=>{if(mr.test(navigator.userAgent))return"crawler";if(document.getElementsByTagName("*").length>15e3)return"dom_too_large";let t=cr(e.mask),r=((e,t)=>{let r=tr(e,t),n=Zt+t;return(t,a,o)=>{for(let s in t){let i=t[s];if("string"!=typeof i||!i)continue;let l=s.toLowerCase();if(sr.test(l))o?t[s]=null:delete t[s];else if("value"===l&&lr(a))t[s]=dr(i,a);else if("content"===l)t[s]=a&&/^(viewport|theme-color|color-scheme)$/i.test(a.getAttribute("name")||"")?i:Qt(i);else if(nr.test(l)){let e=/^\s*([a-z][\w+.-]*):/i.exec(i),r=e?e[1].toLowerCase():"";t[s]="javascript"===r?"#":r&&"http"!==r&&"https"!==r?r+":*":Gt(i).url||"#"}else ar.test(l)?t[s]=/^\s*(blob|data):/i.test(i)?"":"srcset"===l?i.replace(/[^\s,]+/g,rr):rr(i):0===l.indexOf("data-")?t[s]="text"===e||er(a,n)?Qt(i):ir.test(i)?i:r(i,a):or.test(l)&&(t[s]=r(i,a))}}})(e.level,t),n=e=>{let t=Dt.mirror.getNode(e);return t&&1===t.nodeType?t:null};function a(e){let t=e?[e]:[];for(;t.length;){let e=t.pop();if(2===e.type&&e.attributes&&r(e.attributes,n(e.id),!1),e.childNodes)for(let r of e.childNodes)t.push(r)}}let o=[],s=0,i=0,l=!0;function d(){if(i&&clearTimeout(i),i=0,!o.length)return;let t=o;o=[],s=0,e.send(t)}let c=Dt({...ur(e.level,t,cr(e.block)),emit:t=>{try{(t=>{if(!l)return;if(pr>20971520)return l=!1,o=[],void e.stop("budget");4===t.type&&o.length&&d(),(e=>{let t=e.data;if(t)if(4===e.type&&t.href)t.href=Gt(t.href).url;else if(2===e.type)a(t.node);else if(3===e.type&&0===t.source){if(t.adds)for(let e of t.adds)a(e.node);if(t.attributes)for(let e of t.attributes)r(e.attributes,n(e.id),!0)}})(t),o.push(t);let c=t.data,u=2===t.type?hr:120+(c&&c.adds?400*c.adds.length:0)+(c&&c.texts?60*c.texts.length:0)+(c&&c.attributes?80*c.attributes.length:0);s+=u,pr+=u,s>=hr?d():i||(i=setTimeout(()=>{try{d()}catch(t){e.report("replay.flush",t)}},e.every()))})(t)}catch(t){e.report("replay.emit",t)}},errorHandler:t=>(e.report("rrweb",t),!0)});return{flush:d,stop(){l=!1,c&&c(),d()}}})})();
1
+ "use strict";(()=>{var e,t=Object.defineProperty,r=(e,r,n)=>((e,r,n)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n)(e,"symbol"!=typeof r?r+"":r,n),n=((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[e.Asset=7]="Asset",e[e.Annotation=8]="Annotation",e),a=(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[e.CustomElement=16]="CustomElement",e))({}),o=(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))({}),s=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))({}),i=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))({}),l=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))({}),d=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))({}),c={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},u={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},h={},p={},m=0;function f(e){if(h[e])return h[e];let t=(e=>{var t,r;let n=null==(r=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:r.call(t,e);if(n&&globalThis[n])return globalThis[n]})(e)||globalThis[e],r=t.prototype,n=e in c?c[e]:void 0,a=!(!n||!n.every(e=>{var t,n;return!(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)||!n.toString().includes("[native code]"))})),o=e in u?u[e]:void 0,s=!(!o||!o.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(a&&s)return h[e]=t.prototype,t.prototype;try{let n=document.createElement("iframe");n.style.display="none",document.body.appendChild(n);let a=n.contentWindow;if(!a)return t.prototype;let o=a[e].prototype;if(!o)return n.remove(),r;let s=navigator.userAgent;return s.includes("Safari")&&!s.includes("Chrome")?(n.classList.add("rr-block"),n.setAttribute("__rrwebUntaintedMutationObserver",""),p[e]=()=>n.remove()):n.remove(),h[e]=o}catch{return r}}var y={};function g(e,t,r){var n,a;let o=null==(n=y[e])?void 0:n[r];if(o)return o.call(t);let s=f(e),i=null==(a=Object.getOwnPropertyDescriptor(s,r))?void 0:a.get;return i?((y[e]||(y[e]={}))[r]=i,i.call(t)):t[r]}var b={};function S(e,t,r){let n=`${e}.${String(r)}`;if(b[n])return b[n].bind(t);let a=f(e)[r];return"function"!=typeof a?t[r]:(b[n]=a,a.bind(t))}var v=Date.now;function w(e,t,r){try{if(!(t in e))return()=>{};let n=e[t],a=r(n);return"function"==typeof a&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=a,()=>{e[t]=n}}catch{return()=>{}}}/[1-9][0-9]{12}/.test(Date.now().toString())||(v=()=>(new Date).getTime());var I=e=>g("Node",e,"ownerDocument"),C=e=>g("Node",e,"childNodes"),k=e=>g("Node",e,"parentNode"),M=e=>g("Node",e,"parentElement"),O=e=>g("Node",e,"textContent"),T=e=>g("Node",e,"lastChild"),E=e=>g("Node",e,"nextSibling"),R=e=>g("Node",e,"previousSibling"),x=(e,t)=>S("Node",e,"contains")(t),L=e=>S("Node",e,"getRootNode")(),D=e=>e&&"host"in e?g("ShadowRoot",e,"host"):null,N=e=>e&&"shadowRoot"in e?g("Element",e,"shadowRoot"):null;function A(e){return e.nodeType===e.ELEMENT_NODE}function _(e){let t=e&&"host"in e&&"mode"in e&&D(e)||null;return!(!t||!("shadowRoot"in t)||N(t)!==e)}function F(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function U(e){try{let t=e.rules||e.cssRules;if(!t)return null;let r=e.href;return!r&&e.ownerNode&&(r=e.ownerNode.baseURI),(e=>(e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e))(Array.from(t,e=>P(e,r)).join(""))}catch{return null}}function P(e,t){if((e=>"styleSheet"in e)(e)){let t;try{t=U(e.styleSheet)||(e=>{let{cssText:t}=e;if(t.split('"').length<3)return t;let r=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"})(e)}catch{t=e.cssText}return e.styleSheet.href?Y(t,e.styleSheet.href):t}{let r=e.cssText;return(e=>"selectorText"in e)(e)&&e.selectorText.includes(":")&&(r=(e=>e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2"))(r)),t?Y(r,t):r}}var W=class{constructor(){r(this,"idNodeMap",new Map),r(this,"nodeMetaMap",new WeakMap)}getId(e){var t,r;return e&&null!=(r=null==(t=this.getMeta(e))?void 0:t.id)?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e));let r=N(e);r&&this.removeNodeFromMap(r)}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){let r=this.getNode(e);if(r){let e=this.nodeMetaMap.get(r);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function z({element:e,maskInputOptions:t,tagName:r,type:n,value:a,maskInputFn:o}){let s=a||"",i=n&&$(n);return(t[r.toLowerCase()]||i&&t[i])&&(s=o?o(s,e):"*".repeat(s.length)),s}function $(e){return e.toLowerCase()}var j="__rrweb_original__";function B(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?$(t):null}function V(e,t){var r,n;let a;try{a=new URL(e,null!=t?t:window.location.href)}catch{return null}return null!=(n=null==(r=a.pathname.match(/\.([0-9a-z]+)(?:$)/i))?void 0:r[1])?n:null}var H=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,G=/^(?:[a-z+]+:)?\/\//i,q=/^www\..*/i,X=/^(data:)([^,]*),(.*)/i,Z=/^blob:/i;function Y(e,t){return(e||"").replace(H,(e,r,n,a,o,s)=>{let i=n||o||s,l=r||a||"";if(!i)return e;if(G.test(i)||q.test(i))return`url(${l}${i}${l})`;if(X.test(i)||Z.test(i))return`url(${l}${i}${l})`;if("#"===i[0])return`url(${l}${i}${l})`;if("/"===i[0])return`url(${l}${(e=>{let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t})(t)+i}${l})`;let d=i.split("#")[0],c=i.substring(d.length),u=t.split("#")[0].split("/"),h=d.split("/");u.pop();for(let e of h)"."!==e&&(".."===e?u.pop():u.push(e));return`url(${l}${u.join("/")}${c}${l})`})}var J="(?:/\\*[^*]*\\*/)|[\\s;]",K=new RegExp(`${J}|\\b(0)px?`,"g"),Q=new RegExp(J,"g");function ee(e,t=!1){return t?e.replace(Q,""):e.replace(K,"$1")}var te=1,re=new RegExp("[^a-z0-9-_:]");function ne(){return te++}var ae,oe,se=/^[^ \t\n\r\u000c]+/,ie=/^[, \t\n\r\u000c]+/,le=new WeakMap;function de(e,t){return t&&""!==t.trim()?ue(e,t):t}function ce(e){return!("svg"!==e.tagName&&!e.ownerSVGElement)}function ue(e,t){let r=le.get(e);if(r||(r=e.createElement("a"),le.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function he(e,t,r,n){return n&&("src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]||"background"===r&&["table","td","th"].includes(t)?de(e,n):"srcset"===r?((e,t)=>{if(""===t.trim())return t;let r=0;function n(e){let n,a=e.exec(t.substring(r));return a?(n=a[0],r+=n.length,n):""}let a=[];for(;n(ie),!(r>=t.length);){let o=n(se);if(","===o.slice(-1))o=de(e,o.substring(0,o.length-1)),a.push(o);else{let n="";o=de(e,o);let s=!1;for(;;){let e=t.charAt(r);if(""===e){a.push((o+n).trim());break}if(s)")"===e&&(s=!1);else{if(","===e){r+=1,a.push((o+n).trim());break}"("===e&&(s=!0)}n+=e,r+=1}}}return a.join(", ")})(e,n):"style"===r?Y(n,ue(e)):"object"===t&&"data"===r?de(e,n):n)}function pe(e,t,r){return["video","audio"].includes(e)&&"autoplay"===$(t)}function me(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let r=e.classList.length;r--;){let n=e.classList[r];if(t.test(n))return!0}if(r)return e.matches(r)}catch{}return!1}function fe(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&fe(k(e),t,r);for(let r=e.classList.length;r--;){let n=e.classList[r];if(t.test(n))return!0}return!!r&&fe(k(e),t,r)}function ye(e,t,r,n){let a;if(A(e)){if(a=e,!C(a).length)return!1}else{if(null===M(e))return!1;a=M(e)}try{if("string"==typeof t){if(n){if(a.closest(`.${t}`))return!0}else if(a.classList.contains(t))return!0}else if(fe(a,t,n))return!0;if(r)if(n){if(a.closest(r))return!0}else if(a.matches(r))return!0}catch{}return!1}function ge(e){return null==e?"":e.toLowerCase()}function be(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:e||{}}function Se(e,t){let{doc:r,mirror:n,blockClass:a,blockSelector:o,maskTextClass:s,maskTextSelector:i,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:h,maskInputFn:p,slimDOMOptions:m,dataURLOptions:f={},inlineImages:y=!1,recordCanvas:g=!1,onSerialize:b,onIframeLoad:S,iframeLoadTimeout:v=5e3,onStylesheetLoad:w,stylesheetLoadTimeout:I=5e3,keepIframeSrcFn:T=()=>!1,newlyAddedElement:E=!1,cssCaptured:R=!1}=t,{needsMask:x}=t,{preserveWhiteSpace:L=!0}=t;x||(x=ye(e,s,i,void 0===x));let D,P=function(e,t){let{doc:r,mirror:n,blockClass:a,blockSelector:o,needsMask:s,inlineStylesheet:i,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:h={},inlineImages:p,recordCanvas:m,keepIframeSrcFn:f,newlyAddedElement:y=!1,cssCaptured:g=!1}=t,b=((e,t)=>{if(!t.hasNode(e))return;let r=t.getId(e);return 1===r?void 0:r})(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:d.Document,childNodes:[],compatMode:e.compatMode}:{type:d.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:d.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:b};case e.ELEMENT_NODE:return((e,t)=>{let r,{doc:n,blockClass:a,blockSelector:o,inlineStylesheet:s,maskInputOptions:i={},maskInputFn:l,dataURLOptions:c={},inlineImages:u,recordCanvas:h,keepIframeSrcFn:p,newlyAddedElement:m=!1,rootId:f}=t,y=me(e,a,o),g=(e=>{if(e instanceof HTMLFormElement)return"form";let t=$(e.tagName);return re.test(t)?"div":t})(e),b={},S=e.attributes.length;for(let t=0;t<S;t++){let r=e.attributes[t];pe(g,r.name,r.value)||(b[r.name]=he(n,g,$(r.name),r.value))}if("link"===g&&s){let t=Array.from(n.styleSheets).find(t=>t.href===e.href),r=null;t&&(r=U(t)),r&&(delete b.rel,delete b.href,b._cssText=r)}if("style"===g&&e.sheet){let t=U(e.sheet);t&&(e.childNodes.length>1&&(t=((e,t)=>((e,t,r=!1)=>{let n=Array.from(t.childNodes),a=[],o=0;if(n.length>1&&e&&"string"==typeof e){let t=ee(e,r),s=t.length/e.length;for(let i=1;i<n.length;i++)if(n[i].textContent&&"string"==typeof n[i].textContent){let l=ee(n[i].textContent,r),d=100,c=3;for(;c<l.length&&(l[c].match(/[a-zA-Z0-9]/)||-1!==l.indexOf(l.substring(0,c),1));c++);for(;c<l.length;c++){let u=l.substring(0,c),h=t.split(u),p=-1;if(2===h.length)p=h[0].length;else if(h.length>2&&""===h[0]&&""!==n[i-1].textContent)p=t.indexOf(u,1);else if(1===h.length){if(u=u.substring(0,u.length-1),h=t.split(u),h.length<=1)return a.push(e),a;c=101}else c===l.length-1&&(p=t.indexOf(u));if(h.length>=2&&c>d){let e=n[i-1].textContent;if(e&&"string"==typeof e){let r=ee(e).length;p=t.indexOf(u,r)}-1===p&&(p=h[0].length)}if(-1!==p){let i=Math.floor(p/s);for(;i>0&&i<e.length;){if(o+=1,o>50*n.length)return a.push(e),a;let l=ee(e.substring(0,i),r);if(l.length===p){a.push(e.substring(0,i)),e=e.substring(i),t=t.substring(p);break}l.length<p?i+=Math.max(1,Math.floor((p-l.length)/s)):i-=Math.max(1,Math.floor((l.length-p)*s))}break}}}}return a.push(e),a})(e,t).join("/* rr_split */"))(t,e)),b._cssText=t)}if(["input","textarea","select"].includes(g)){let t=e.value,r=e.checked;"radio"!==b.type&&"checkbox"!==b.type&&"submit"!==b.type&&"button"!==b.type&&t?b.value=z({element:e,type:B(e),tagName:g,value:t,maskInputOptions:i,maskInputFn:l}):r&&(b.checked=r)}if("option"===g&&(e.selected&&!i.select?b.selected=!0:delete b.selected),"dialog"===g&&e.open&&(b.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),"canvas"===g&&h)if("2d"===e.__context)(e=>{let t=e.getContext("2d");if(!t)return!0;for(let r=0;r<e.width;r+=50)for(let n=0;n<e.height;n+=50){let a=t.getImageData,o=j in a?a[j]:a;if(new Uint32Array(o.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some(e=>0!==e))return!1}return!0})(e)||(b.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){let t=e.toDataURL(c.type,c.quality),r=n.createElement("canvas");r.width=e.width,r.height=e.height,t!==r.toDataURL(c.type,c.quality)&&(b.rr_dataURL=t)}if("img"===g&&u){ae||(ae=n.createElement("canvas"),oe=ae.getContext("2d"));let t=e,r=t.currentSrc||t.getAttribute("src")||"<unknown-src>",a=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{ae.width=t.naturalWidth,ae.height=t.naturalHeight,oe.drawImage(t,0,0),b.rr_dataURL=ae.toDataURL(c.type,c.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o));console.warn(`Cannot inline img src=${r}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(a?b.crossOrigin=a:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o)}if(["audio","video"].includes(g)){let t=b;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}if(m||(e.scrollLeft&&(b.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(b.rr_scrollTop=e.scrollTop)),y){let{width:t,height:r}=e.getBoundingClientRect();b={class:b.class,rr_width:`${t}px`,rr_height:`${r}px`}}"iframe"===g&&!p(b.src)&&(e.contentDocument||(b.rr_src=b.src),delete b.src);try{customElements.get(g)&&(r=!0)}catch{}return{type:d.Element,tagName:g,attributes:b,childNodes:[],isSVG:ce(e)||void 0,needBlock:y,rootId:f,isCustom:r}})(e,{doc:r,blockClass:a,blockSelector:o,inlineStylesheet:i,maskInputOptions:l,maskInputFn:u,dataURLOptions:h,inlineImages:p,recordCanvas:m,keepIframeSrcFn:f,newlyAddedElement:y,rootId:b});case e.TEXT_NODE:return((e,t)=>{let{needsMask:r,maskTextFn:n,rootId:a,cssCaptured:o}=t,s=k(e),i=s&&s.tagName,l="",c="STYLE"===i||void 0,u="SCRIPT"===i||void 0;return u?l="SCRIPT_PLACEHOLDER":o||(l=O(e),c&&l&&(l=Y(l,ue(t.doc)))),!c&&!u&&l&&r&&(l=n?n(l,M(e)):l.replace(/[\S]/g,"*")),{type:d.Text,textContent:l||"",rootId:a}})(e,{doc:r,needsMask:s,maskTextFn:c,rootId:b,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:d.CDATA,textContent:"",rootId:b};case e.COMMENT_NODE:return{type:d.Comment,textContent:O(e)||"",rootId:b};default:return!1}}(e,{doc:r,mirror:n,blockClass:a,blockSelector:o,needsMask:x,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:p,dataURLOptions:f,inlineImages:y,recordCanvas:g,keepIframeSrcFn:T,newlyAddedElement:E,cssCaptured:R});if(!P)return console.warn(e,"not serialized"),null;D=n.hasNode(e)?n.getId(e):((e,t)=>{if(t.comment&&e.type===d.Comment)return!0;if(e.type===d.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===V(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(ge(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===ge(e.attributes.name)||"icon"===ge(e.attributes.rel)||"apple-touch-icon"===ge(e.attributes.rel)||"shortcut icon"===ge(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&ge(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ge(e.attributes.property).match(/^(og|twitter|fb):/)||ge(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===ge(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===ge(e.attributes.name)||"googlebot"===ge(e.attributes.name)||"bingbot"===ge(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===ge(e.attributes.name)||"generator"===ge(e.attributes.name)||"framework"===ge(e.attributes.name)||"publisher"===ge(e.attributes.name)||"progid"===ge(e.attributes.name)||ge(e.attributes.property).match(/^article:/)||ge(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===ge(e.attributes.name)||"yandex-verification"===ge(e.attributes.name)||"csrf-token"===ge(e.attributes.name)||"p:domain_verify"===ge(e.attributes.name)||"verify-v1"===ge(e.attributes.name)||"verification"===ge(e.attributes.name)||"shopify-checkout-api-token"===ge(e.attributes.name)))return!0}}return!1})(P,m)||!L&&P.type===d.Text&&!P.textContent.replace(/^\s+|\s+$/gm,"").length?-2:ne();let W=Object.assign(P,{id:D});if(n.add(e,W),-2===D)return null;b&&b(e);let H=!l;if(W.type===d.Element){H=H&&!W.needBlock,delete W.needBlock;let t=N(e);t&&F(t)&&(W.isShadowHost=!0)}if((W.type===d.Document||W.type===d.Element)&&H){m.headWhitespace&&W.type===d.Element&&"head"===W.tagName&&(L=!1);let t={doc:r,mirror:n,blockClass:a,blockSelector:o,needsMask:x,maskTextClass:s,maskTextSelector:i,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:p,slimDOMOptions:m,dataURLOptions:f,inlineImages:y,recordCanvas:g,preserveWhiteSpace:L,onSerialize:b,onIframeLoad:S,iframeLoadTimeout:v,onStylesheetLoad:w,stylesheetLoadTimeout:I,keepIframeSrcFn:T,cssCaptured:!1};if(W.type!==d.Element||"textarea"!==W.tagName||void 0===W.attributes.value){W.type===d.Element&&void 0!==W.attributes._cssText&&"string"==typeof W.attributes._cssText&&(t.cssCaptured=!0);for(let r of Array.from(C(e))){let e=Se(r,t);e&&W.childNodes.push(e)}}let k=null;if(A(e)&&(k=N(e)))for(let e of Array.from(C(k))){let r=Se(e,t);r&&(F(k)&&(r.isShadow=!0),W.childNodes.push(r))}}let G=k(e);return G&&_(G)&&F(G)&&(W.isShadow=!0),W.type===d.Element&&"iframe"===W.tagName&&!me(e,a,o)&&((e,t,r)=>{let n=e.contentWindow;if(!n)return;let a,o=!1;try{a=n.document.readyState}catch{return}if("complete"!==a){let n=setTimeout(()=>{o||(t(),o=!0)},r);return void e.addEventListener("load",()=>{clearTimeout(n),o=!0,t()})}let s="about:blank";if(n.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)})(e,()=>{let t=e.contentDocument;if(t&&S){let r=Se(t,{doc:t,mirror:n,blockClass:a,blockSelector:o,needsMask:x,maskTextClass:s,maskTextSelector:i,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:p,slimDOMOptions:m,dataURLOptions:f,inlineImages:y,recordCanvas:g,preserveWhiteSpace:L,onSerialize:b,onIframeLoad:S,iframeLoadTimeout:v,onStylesheetLoad:w,stylesheetLoadTimeout:I,keepIframeSrcFn:T});r&&S(e,r)}},v),W.type===d.Element&&"link"===W.tagName&&"string"==typeof W.attributes.rel&&("stylesheet"===W.attributes.rel||"preload"===W.attributes.rel&&"string"==typeof W.attributes.href&&"css"===V(W.attributes.href))&&((e,t,r)=>{let n,a=!1;try{n=e.sheet}catch{return}if(n)return;let o=setTimeout(()=>{a||(t(),a=!0)},r);e.addEventListener("load",()=>{clearTimeout(o),a=!0,t()})})(e,()=>{if(w){let t=Se(e,{doc:r,mirror:n,blockClass:a,blockSelector:o,needsMask:x,maskTextClass:s,maskTextSelector:i,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:p,slimDOMOptions:m,dataURLOptions:f,inlineImages:y,recordCanvas:g,preserveWhiteSpace:L,onSerialize:b,onIframeLoad:S,iframeLoadTimeout:v,onStylesheetLoad:w,stylesheetLoadTimeout:I,keepIframeSrcFn:T});t&&w(e,t)}},I),W}var ve=class e{constructor(...e){r(this,"parentElement",null),r(this,"parentNode",null),r(this,"ownerDocument"),r(this,"firstChild",null),r(this,"lastChild",null),r(this,"previousSibling",null),r(this,"nextSibling",null),r(this,"ELEMENT_NODE",1),r(this,"TEXT_NODE",3),r(this,"nodeType"),r(this,"nodeName"),r(this,"RRNodeType")}get childNodes(){let e=[],t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};function we(e,t,r=document){let n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}var Ie="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.",Ce={map:{},getId:()=>(console.error(Ie),-1),getNode:()=>(console.error(Ie),null),removeNodeFromMap(){console.error(Ie)},has:()=>(console.error(Ie),!1),reset(){console.error(Ie)}};function ke(e,t,r={}){let n=null,a=0;return function(...o){let s=Date.now();!a&&!1===r.leading&&(a=s);let i=t-(s-a),l=this;i<=0||i>t?(n&&(clearTimeout(n),n=null),a=s,e.apply(l,o)):!n&&!1!==r.trailing&&(n=setTimeout(()=>{a=!1===r.leading?0:Date.now(),n=null,e.apply(l,o)},i))}}function Me(e,t,r,n,a=window){let o=a.Object.getOwnPropertyDescriptor(e,t);return a.Object.defineProperty(e,t,n?r:{set(e){setTimeout(()=>{r.set.call(this,e)},0),o&&o.set&&o.set.call(this,e)}}),()=>Me(e,t,o||{},!0)}function Oe(e){var t,r,n,a;let o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=M(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(n=M(o.body))?void 0:n.scrollTop)||(null==(a=null==o?void 0:o.body)?void 0:a.scrollTop)||0}}function Te(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ee(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Re(e){return e?e.nodeType===e.ELEMENT_NODE?e:M(e):null}function xe(e,t,r,n){if(!e)return!1;let a=Re(e);if(!a)return!1;try{if("string"==typeof t){if(a.classList.contains(t)||n&&null!==a.closest("."+t))return!0}else if(fe(a,t,n))return!0}catch{}return!(!r||!(a.matches(r)||n&&null!==a.closest(r)))}function Le(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function De(e,t){if(_(e))return!1;let r=t.getId(e);if(!t.has(r))return!0;let n=k(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||De(n,t))}function Ne(e){return!!e.changedTouches}function Ae(e,t){return!("IFRAME"!==e.nodeName||!t.getMeta(e))}function _e(e,t){return!("LINK"!==e.nodeName||e.nodeType!==e.ELEMENT_NODE||!e.getAttribute||"stylesheet"!==e.getAttribute("rel")||!t.getMeta(e))}function Fe(e){return!!e&&(e instanceof ve&&"shadowRoot"in e?!!e.shadowRoot:!!N(e))}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Ce=new Proxy(Ce,{get:(e,t,r)=>("map"===t&&console.error(Ie),Reflect.get(e,t,r))}));var Ue=class{constructor(){r(this,"id",1),r(this,"styleIDMap",new WeakMap),r(this,"idStyleMap",new Map)}getId(e){var t;return null!=(t=this.styleIDMap.get(e))?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Pe(e){var t;let r=null;return"getRootNode"in e&&(null==(t=L(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&D(L(e))&&(r=D(L(e))),r}function We(e){let t=I(e);return!!t&&(x(t,e)||(e=>{let t=I(e);if(!t)return!1;let r=(e=>{let t,r=e;for(;t=Pe(r);)r=t;return r})(e);return x(t,r)})(e))}var ze,$e=(e,t)=>`${e}@${t}`,je=class{constructor(){r(this,"frozen",!1),r(this,"locked",!1),r(this,"texts",[]),r(this,"attributes",[]),r(this,"attributeMap",new WeakMap),r(this,"removes",[]),r(this,"mapRemoves",[]),r(this,"movedMap",{}),r(this,"addedSet",new Set),r(this,"movedSet",new Set),r(this,"droppedSet",new Set),r(this,"removesSubTreeCache",new Set),r(this,"mutationCb"),r(this,"blockClass"),r(this,"blockSelector"),r(this,"maskTextClass"),r(this,"maskTextSelector"),r(this,"inlineStylesheet"),r(this,"maskInputOptions"),r(this,"maskTextFn"),r(this,"maskInputFn"),r(this,"keepIframeSrcFn"),r(this,"recordCanvas"),r(this,"inlineImages"),r(this,"slimDOMOptions"),r(this,"dataURLOptions"),r(this,"doc"),r(this,"mirror"),r(this,"iframeManager"),r(this,"stylesheetManager"),r(this,"shadowDomManager"),r(this,"processedNodeManager"),r(this,"unattachedDoc"),r(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),r(this,"emit",()=>{if(this.frozen||this.locked)return;let e=[],t=new Set;for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let e of this.movedSet){let t=k(e);this.removesSubTreeCache.has(t)&&!this.movedSet.has(t)||this.addedSet.add(e)}let r=null,n=null,a=-1,o=null,s=!1,i=new Set,l=this.addedSet.values(),d=l.next();for(;this.addedSet.size;){if(null!==r&&this.addedSet.has(R(r)))o=r,r=R(r);else{for(this.addedSet.has(d.value)||(d=l.next()),r=d.value;n=k(r),this.addedSet.has(n);)r=n;if(i.has(n))n=null;else if(n){if(We(n)?(s=Ve(this.droppedSet,n)||this.removesSubTreeCache.has(n),s&&Ve(this.movedSet,r)&&(s=!1)):s=!0,this.addedSet.has(T(n)))r=T(n),o=null;else for(;o=E(r),this.addedSet.has(o);)r=o;if(a=_(n)?this.mirror.getId(Pe(r)):this.mirror.getId(n),-1===a&&n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let e=D(n);a=this.mirror.getId(e)}}}if(this.addedSet.delete(r),!n||-1===a){i.add(r);continue}if(s){this.droppedSet.add(r);continue}let c=!1;if(r.nodeType===Node.TEXT_NODE){let e=n.tagName;if("TEXTAREA"===e)continue;"STYLE"===e&&t.has(a)&&(c=!0)}let u=o?this.mirror.getId(o):null;for(;-2===u;)o=o&&E(o),u=o&&this.mirror.getId(o);if(-1===u){console.warn("Couldn't record new node. Couldn't find mirror id for nextSibling:",o),r=null;continue}let h=Se(r,{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=>{Ae(e,this.mirror)&&this.iframeManager.addIframe(e),_e(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Fe(r)&&this.shadowDomManager.addShadowRoot(N(r),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:c});h&&(e.push({parentId:a,nextId:u,node:h}),t.add(h.id))}let c={texts:this.texts.map(e=>{let t=e.node,r=k(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{let{attributes:t}=e;if("string"==typeof t.style){let r=JSON.stringify(e.styleDiff),n=JSON.stringify(e._unchangedStyles);r.length<t.style.length&&(r+n).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};!c.texts.length&&!c.attributes.length&&!c.removes.length&&!c.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(c))}),r(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));let r=Array.from(C(e),e=>O(e)||"").join("");t.attributes.value=z({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:B(e),value:r,maskInputFn:this.maskInputFn})}),r(this,"processMutation",e=>{if(!Le(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{let t=O(e.target);!xe(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:ye(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Re(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{let t=e.target,r=$(t.tagName),n=e.attributeName,a=e.target.getAttribute(n);if("value"===n){let e=B(t);a=z({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:a,maskInputFn:this.maskInputFn})}if(xe(e.target,this.blockClass,this.blockSelector,!1)||a===e.oldValue)return;let o=this.attributeMap.get(e.target);if("iframe"===r&&"src"===n&&!this.keepIframeSrcFn(a)){if(t.contentDocument)return;n="rr_src"}if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),"type"===n&&"input"===r&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!pe(r,n))if(o.attributes[n]=he(this.doc,r,$(n),a),"style"===n){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let r=this.unattachedDoc.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue);for(let e of Array.from(t.style)){let n=t.style.getPropertyValue(e),a=t.style.getPropertyPriority(e);n!==r.style.getPropertyValue(e)||a!==r.style.getPropertyPriority(e)?o.styleDiff[e]=""===a?n:[n,a]:o._unchangedStyles[e]=[n,a]}for(let e of Array.from(r.style))""===t.style.getPropertyValue(e)&&(o.styleDiff[e]=!1)}else"open"===n&&"DIALOG"===t.tagName&&(t.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":if(xe(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{We(t)||this.shadowDomManager.removeShadowRootsIn(t);let r=this.mirror.getId(t),n=_(e.target)?this.mirror.getId(D(e.target)):this.mirror.getId(e.target);xe(e.target,this.blockClass,this.blockSelector,!1)||Le(t,this.mirror,this.slimDOMOptions)||!(e=>-1!==this.mirror.getId(e))(t)||(this.addedSet.has(t)?(Be(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||De(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[$e(r,n)]?Be(this.movedSet,t):(this.removes.push({parentId:n,id:r,isShadow:!(!_(e.target)||!F(e.target))||void 0}),((e,t)=>{let r=[e];for(;r.length;){let e=r.pop();t.has(e)||(t.add(e),C(e).forEach(e=>r.push(e)))}})(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),r(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Le(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[$e(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);xe(e,this.blockClass,this.blockSelector,!1)||(C(e).forEach(e=>this.genAdds(e)),Fe(e)&&C(N(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1,this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0}unlock(){this.locked=!1,this.emit()}};function Be(e,t){e.delete(t),C(t).forEach(t=>Be(e,t))}function Ve(e,t){return 0!==e.size&&He(e,t)}function He(e,t){if(e.has(t))return!0;let r=k(t);return!!r&&He(e,r)}var Ge=e=>ze?(...t)=>{try{return e(...t)}catch(e){if(ze&&!0===ze(e))return;throw e}}:e,qe=new Set;function Xe(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Ze(e,t){let r=new je;qe.add(r),r.init(e);let[n,a]=function(){let e=f("MutationObserver");m++;let t=!1;return[e.constructor,()=>{if(t||(t=!0,0!==--m))return;let e=p.MutationObserver;if(e)try{e()}finally{delete h.MutationObserver,delete p.MutationObserver}}]}(),o=new n(Ge(r.processMutations.bind(r)));return o.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),()=>{o.disconnect(),qe.delete(r),a()}}function Ye({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:a,sampling:o}){return we("scroll",Ge(ke(Ge(o=>{let s=Xe(o);if(!s||xe(s,n,a,!0))return;let i=r.getId(s);if(s===t&&t.defaultView){let r=Oe(t.defaultView);e({id:i,x:r.left,y:r.top})}else e({id:i,x:s.scrollLeft,y:s.scrollTop})}),o.scroll||100)),t)}var Je=["INPUT","TEXTAREA","SELECT"],Ke=new WeakMap;function Qe(e){return function e(t,r){if(nt("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||nt("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||nt("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||nt("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){let n=Array.from(t.parentRule.cssRules).indexOf(t);return r.unshift(n),e(t.parentRule,r)}if(t.parentStyleSheet){let e=Array.from(t.parentStyleSheet.cssRules).indexOf(t);r.unshift(e)}return r}(e,[])}function et(e,t,r){let n,a;return e?(e.ownerNode?n=t.getId(e.ownerNode):a=r.getId(e),{styleId:a,id:n}):{}}function tt({mirror:e,stylesheetManager:t},r){var n,a,o;let s=null;s="#document"===r.nodeName?e.getId(r):e.getId(D(r));let i="#document"===r.nodeName?null==(n=r.defaultView)?void 0:n.Document:null==(o=null==(a=r.ownerDocument)?void 0:a.defaultView)?void 0:o.ShadowRoot,l=null!=i&&i.prototype?Object.getOwnPropertyDescriptor(null==i?void 0:i.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&i&&l?(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null==(e=l.get)?void 0:e.call(this)},set(e){var r;let n=null==(r=l.set)?void 0:r.call(this,e);if(null!==s&&-1!==s)try{t.adoptStyleSheets(e,s)}catch{}return n}}),Ge(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function rt(e,t={}){let r,n=e.doc.defaultView;if(!n)return()=>{};((e,t)=>{let{mutationCb:r,mousemoveCb:n,mouseInteractionCb:a,scrollCb:o,viewportResizeCb:s,inputCb:i,mediaInteractionCb:l,styleSheetRuleCb:d,styleDeclarationCb:c,canvasMutationCb:u,fontCb:h,selectionCb:p,customElementCb:m}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),r(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),n(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),a(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),o(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),s(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),i(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),l(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),d(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),c(...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.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),m(...e)}})(e,t),e.recordDOM&&(r=Ze(e,e.doc));let i=(({mousemoveCb:e,sampling:t,doc:r,mirror:n})=>{if(!1===t.mousemove)return()=>{};let o,s="number"==typeof t.mousemove?t.mousemove:50,i="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500,l=[],d=ke(Ge(t=>{let r=Date.now()-o;e(l.map(e=>(e.timeOffset-=r,e)),t),l=[],o=null}),i),c=Ge(ke(Ge(e=>{let t=Xe(e),{clientX:r,clientY:s}=Ne(e)?e.changedTouches[0]:e;o||(o=v()),l.push({x:r,y:s,id:n.getId(t),timeOffset:v()-o}),d("undefined"!=typeof DragEvent&&e instanceof DragEvent?a.Drag:e instanceof MouseEvent?a.MouseMove:a.TouchMove)}),s,{trailing:!1})),u=[we("mousemove",c,r),we("touchmove",c,r),we("drag",c,r)];return Ge(()=>{u.forEach(e=>e())})})(e),d=(({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:a,sampling:i})=>{if(!1===i.mouseInteraction)return()=>{};let l=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,d=[],c=null;return Object.keys(o).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==l[e]).forEach(i=>{let l=$(i),u=(t=>i=>{let l=Xe(i);if(xe(l,n,a,!0))return;let d=null,u=t;if("pointerType"in i){switch(i.pointerType){case"mouse":d=s.Mouse;break;case"touch":d=s.Touch;break;case"pen":d=s.Pen}d===s.Touch?o[t]===o.MouseDown?u="TouchStart":o[t]===o.MouseUp&&(u="TouchEnd"):s.Pen}else Ne(i)&&(d=s.Touch);null!==d?(c=d,(u.startsWith("Touch")&&d===s.Touch||u.startsWith("Mouse")&&d===s.Mouse)&&(d=null)):o[t]===o.Click&&(d=c,c=null);let h=Ne(i)?i.changedTouches[0]:i;if(!h)return;let p=r.getId(l),{clientX:m,clientY:f}=h;Ge(e)({type:o[u],id:p,x:m,y:f,...null!==d&&{pointerType:d}})})(i);if(window.PointerEvent)switch(o[i]){case o.MouseDown:case o.MouseUp:l=l.replace("mouse","pointer");break;case o.TouchStart:case o.TouchEnd:return}d.push(we(l,u,t))}),Ge(()=>{d.forEach(e=>e())})})(e),c=Ye(e),u=(({viewportResizeCb:e},{win:t})=>{let r=-1,n=-1;return we("resize",Ge(ke(Ge(()=>{let t=Te(),a=Ee();(r!==t||n!==a)&&(e({width:Number(a),height:Number(t)}),r=t,n=a)}),200)),t)})(e,{win:n}),h=function({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:a,ignoreClass:o,ignoreSelector:s,maskInputOptions:i,maskInputFn:l,sampling:d,userTriggeredOnInput:c}){function u(e){let r=Xe(e),d=e.isTrusted,u=r&&r.tagName;if(r&&"OPTION"===u&&(r=M(r)),!r||!u||Je.indexOf(u)<0||xe(r,n,a,!0)||r.classList.contains(o)||s&&r.matches(s))return;let p=r.value,m=!1,f=B(r)||"";"radio"===f||"checkbox"===f?m=r.checked:(i[u.toLowerCase()]||i[f])&&(p=z({element:r,maskInputOptions:i,tagName:u,type:f,value:p,maskInputFn:l})),h(r,c?{text:p,isChecked:m,userTriggered:d}:{text:p,isChecked:m});let y=r.name;"radio"===f&&y&&m&&t.querySelectorAll(`input[type="radio"][name="${y}"]`).forEach(e=>{if(e!==r){let t=e.value;h(e,c?{text:t,isChecked:!m,userTriggered:!1}:{text:t,isChecked:!m})}})}function h(t,n){let a=Ke.get(t);if(!a||a.text!==n.text||a.isChecked!==n.isChecked){Ke.set(t,n);let a=r.getId(t);Ge(e)({...n,id:a})}}let p=("last"===d.input?["change"]:["input","change"]).map(e=>we(e,Ge(u),t)),m=t.defaultView;if(!m)return()=>{p.forEach(e=>e())};let f=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),y=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return f&&f.set&&p.push(...y.map(e=>Me(e[0],e[1],{set(){Ge(u)({target:this,isTrusted:!1})}},!1,m))),Ge(()=>{p.forEach(e=>e())})}(e),p=(({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:a,doc:o})=>{let s=Ge(o=>ke(Ge(a=>{let s=Xe(a);if(!s||!(s instanceof HTMLMediaElement)||xe(s,t,r,!0))return;let{currentTime:i,volume:l,muted:d,playbackRate:c,loop:u}=s;e({type:o,id:n.getId(s),currentTime:i,volume:l,muted:d,playbackRate:c,loop:u})}),a.media||500)),i=[we("play",s(l.Play),o),we("pause",s(l.Pause),o),we("seeked",s(l.Seeked),o),we("volumechange",s(l.VolumeChange),o),we("ratechange",s(l.RateChange),o)];return Ge(()=>{i.forEach(e=>e())})})(e),m=()=>{},f=()=>{},y=()=>{},g=()=>{};e.recordDOM&&(m=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};let a=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(a,{apply:Ge((n,a,o)=>{let[s,i]=o,{id:l,styleId:d}=et(a,t,r.styleMirror);return(l&&-1!==l||d&&-1!==d)&&e({id:l,styleId:d,adds:[{rule:s,index:i}]}),n.apply(a,o)})}),n.CSSStyleSheet.prototype.addRule=function(e,t,r=this.cssRules.length){let a=`${e} { ${t} }`;return n.CSSStyleSheet.prototype.insertRule.apply(this,[a,r])};let o,s,i=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:Ge((n,a,o)=>{let[s]=o,{id:i,styleId:l}=et(a,t,r.styleMirror);return(i&&-1!==i||l&&-1!==l)&&e({id:i,styleId:l,removes:[{index:s}]}),n.apply(a,o)})}),n.CSSStyleSheet.prototype.removeRule=function(e){return n.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},n.CSSStyleSheet.prototype.replace&&(o=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:Ge((n,a,o)=>{let[s]=o,{id:i,styleId:l}=et(a,t,r.styleMirror);return(i&&-1!==i||l&&-1!==l)&&e({id:i,styleId:l,replace:s}),n.apply(a,o)})})),n.CSSStyleSheet.prototype.replaceSync&&(s=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(s,{apply:Ge((n,a,o)=>{let[s]=o,{id:i,styleId:l}=et(a,t,r.styleMirror);return(i&&-1!==i||l&&-1!==l)&&e({id:i,styleId:l,replaceSync:s}),n.apply(a,o)})}));let l={};at("CSSGroupingRule")?l.CSSGroupingRule=n.CSSGroupingRule:(at("CSSMediaRule")&&(l.CSSMediaRule=n.CSSMediaRule),at("CSSConditionRule")&&(l.CSSConditionRule=n.CSSConditionRule),at("CSSSupportsRule")&&(l.CSSSupportsRule=n.CSSSupportsRule));let d={};return Object.entries(l).forEach(([n,a])=>{d[n]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=new Proxy(d[n].insertRule,{apply:Ge((n,a,o)=>{let[s,i]=o,{id:l,styleId:d}=et(a.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||d&&-1!==d)&&e({id:l,styleId:d,adds:[{rule:s,index:[...Qe(a),i||0]}]}),n.apply(a,o)})}),a.prototype.deleteRule=new Proxy(d[n].deleteRule,{apply:Ge((n,a,o)=>{let[s]=o,{id:i,styleId:l}=et(a.parentStyleSheet,t,r.styleMirror);return(i&&-1!==i||l&&-1!==l)&&e({id:i,styleId:l,removes:[{index:[...Qe(a),s]}]}),n.apply(a,o)})})}),Ge(()=>{n.CSSStyleSheet.prototype.insertRule=a,n.CSSStyleSheet.prototype.deleteRule=i,o&&(n.CSSStyleSheet.prototype.replace=o),s&&(n.CSSStyleSheet.prototype.replaceSync=s),Object.entries(l).forEach(([e,t])=>{t.prototype.insertRule=d[e].insertRule,t.prototype.deleteRule=d[e].deleteRule})})}(e,{win:n}),f=tt(e,e.doc),y=(({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:a})=>{let o=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:Ge((a,s,i)=>{var l;let[d,c,u]=i;if(r.has(d))return o.apply(s,[d,c,u]);let{id:h,styleId:p}=et(null==(l=s.parentRule)?void 0:l.parentStyleSheet,t,n.styleMirror);return(h&&-1!==h||p&&-1!==p)&&e({id:h,styleId:p,set:{property:d,value:c,priority:u},index:Qe(s.parentRule)}),a.apply(s,i)})});let s=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:Ge((a,o,i)=>{var l;let[d]=i;if(r.has(d))return s.apply(o,[d]);let{id:c,styleId:u}=et(null==(l=o.parentRule)?void 0:l.parentStyleSheet,t,n.styleMirror);return(c&&-1!==c||u&&-1!==u)&&e({id:c,styleId:u,remove:{property:d},index:Qe(o.parentRule)}),a.apply(o,i)})}),Ge(()=>{a.CSSStyleDeclaration.prototype.setProperty=o,a.CSSStyleDeclaration.prototype.removeProperty=s})})(e,{win:n}),e.collectFonts&&(g=function({fontCb:e,doc:t}){let r=t.defaultView;if(!r)return()=>{};let n=[],a=new WeakMap,o=r.FontFace;r.FontFace=(e,t,r)=>{let n=new o(e,t,r);return a.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};let s=w(t.fonts,"add",function(t){return function(r){return setTimeout(Ge(()=>{let t=a.get(r);t&&(e(t),a.delete(r))}),0),t.apply(this,[r])}});return n.push(()=>{r.FontFace=o}),n.push(s),Ge(()=>{n.forEach(e=>e())})}(e)));let b=(e=>{let{doc:t,mirror:r,blockClass:n,blockSelector:a,selectionCb:o}=e,s=!0,i=Ge(()=>{let e=t.getSelection();if(!e||s&&null!=e&&e.isCollapsed)return;s=e.isCollapsed||!1;let i=[],l=e.rangeCount||0;for(let t=0;t<l;t++){let{startContainer:o,startOffset:s,endContainer:l,endOffset:d}=e.getRangeAt(t);xe(o,n,a,!0)||xe(l,n,a,!0)||i.push({start:r.getId(o),startOffset:s,end:r.getId(l),endOffset:d})}o({ranges:i})});return i(),we("selectionchange",i)})(e),S=function({doc:e,customElementCb:t}){let r=e.defaultView;return r&&r.customElements?w(r.customElements,"define",function(e){return function(r,n,a){try{t({define:{name:r}})}catch{console.warn(`Custom element callback failed for ${r}`)}return e.apply(this,[r,n,a])}}):()=>{}}(e),I=[];for(let t of e.plugins)I.push(t.observer(t.callback,n,t.options));return Ge(()=>{null==r||r(),i(),d(),c(),u(),h(),p(),m(),f(),y(),g(),b(),S(),I.forEach(e=>e())})}function nt(e){return void 0!==window[e]}function at(e){return!!(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var ot=class{constructor(e){r(this,"generateIdFn"),r(this,"iframeIdToRemoteIdMap",new WeakMap),r(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,n){let a=r||this.getIdToRemoteIdMap(e),o=n||this.getRemoteIdToIdMap(e),s=a.get(t);return s||(s=this.generateIdFn(),a.set(t,s),o.set(s,t)),s}getIds(e,t){let r=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,r,n))}getRemoteId(e,t,r){let n=r||this.getRemoteIdToIdMap(e);return"number"!=typeof t?t:n.get(t)||-1}getRemoteIds(e,t){let r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,r))}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}},st=class{constructor(e){r(this,"iframes",new WeakMap),r(this,"crossOriginIframeMap",new WeakMap),r(this,"crossOriginIframeMirror",new ot(ne)),r(this,"crossOriginIframeStyleMirror"),r(this,"crossOriginIframeRootIdMap",new WeakMap),r(this,"mirror"),r(this,"mutationCb"),r(this,"wrappedEmit"),r(this,"loadListener"),r(this,"unloadListener"),r(this,"attachedWindows",new Map),r(this,"messageHandler",e=>this.handleMessage(e)),r(this,"stylesheetManager"),r(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ot(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}addUnloadListener(e){this.unloadListener=e}attachIframe(e,t){var r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.watchIframeWindow(e),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}destroy(){window.removeEventListener("message",this.messageHandler),this.attachedWindows.forEach(e=>e())}watchIframeWindow(e){let t=e.contentWindow;if(!t||this.attachedWindows.has(t))return;let r=[],n=()=>{this.attachedWindows.delete(t),r.forEach(e=>{try{e()}catch{}})};this.attachedWindows.set(t,n),this.recordCrossOriginIframes&&r.push(we("message",this.messageHandler,t)),r.push(we("pagehide",e=>{var r;if(e.persisted)return;let a=t.document;n(),null==(r=this.unloadListener)||r.call(this,a)},t))}handleMessage(e){let t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin||!e.source)return;let r=this.crossOriginIframeMap.get(e.source);if(!r)return;let n=this.transformCrossOriginEvent(r,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case n.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let r=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(t.data.node,r),{timestamp:t.timestamp,type:n.IncrementalSnapshot,data:{source:a.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case n.Meta:case n.Load:case n.DomContentLoaded:return!1;case n.Annotation:case n.Plugin:return t;case n.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case n.IncrementalSnapshot:switch(t.data.source){case a.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);let r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)}),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 a.Drag:case a.TouchMove:case a.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case a.ViewportResize:return!1;case a.MediaInteraction:case a.MouseInteraction:case a.Scroll:case a.CanvasMutation:case a.Input:return this.replaceIds(t.data,e,["id"]),t;case a.StyleSheetRule:case a.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case a.Font:return t;case a.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case a.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}return!1}replace(e,t,r,n){for(let a of n)!Array.isArray(t[a])&&"number"!=typeof t[a]||(Array.isArray(t[a])?t[a]=e.getIds(r,t[a]):t[a]=e.getId(r,t[a]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type!==d.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}},it=class{constructor(e){r(this,"shadowDoms",new Map),r(this,"mutationCb"),r(this,"scrollCb"),r(this,"bypassOptions"),r(this,"mirror"),r(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!F(e)||this.shadowDoms.has(e))return;let r=[];this.shadowDoms.set(e,r);let n=Ze({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);r.push(n),r.push(Ye({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{this.shadowDoms.get(e)===r&&(e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(D(e))),r.push(tt({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e)))},0)}removeShadowRootsIn(e){if(0===this.shadowDoms.size)return;let t=N(e);t&&(this.shadowDoms.has(t)&&this.removeShadowRoot(t),this.removeShadowRootsIn(t)),C(e).forEach(e=>this.removeShadowRootsIn(e))}removeShadowRoot(e){let t=this.shadowDoms.get(e);this.shadowDoms.delete(e),null==t||t.forEach(lt)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){let r=this;this.restoreHandlers.push(w(e.prototype,"attachShadow",function(e){return function(n){let a=e.call(this,n),o=N(this);return o&&We(this)&&r.addShadowRoot(o,t),a}}))}reset(){this.restoreHandlers.forEach(lt),this.restoreHandlers=[];let e=this.shadowDoms;this.shadowDoms=new Map,e.forEach(e=>e.forEach(lt))}};function lt(e){try{e()}catch{}}var dt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ct="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(ut=0;ut<64;ut++)ct[dt.charCodeAt(ut)]=ut;var ut,ht=e=>{var t,r=new Uint8Array(e),n=r.length,a="";for(t=0;t<n;t+=3)a+=dt[r[t]>>2],a+=dt[(3&r[t])<<4|r[t+1]>>4],a+=dt[(15&r[t+1])<<2|r[t+2]>>6],a+=dt[63&r[t+2]];return n%3==2?a=a.substring(0,a.length-1)+"=":n%3==1&&(a=a.substring(0,a.length-2)+"=="),a},pt=new Map,mt=(e,t,r)=>{if(!e||!gt(e,t)&&"object"!=typeof e)return;let n=((e,t)=>{let r=pt.get(e);return r||(r=new Map,pt.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)})(r,e.constructor.name),a=n.indexOf(e);return-1===a&&(a=n.length,n.push(e)),a};function ft(e,t,r){if(e instanceof Array)return e.map(e=>ft(e,t,r));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)return{rr_type:e.constructor.name,base64:ht(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[ft(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let t=e.constructor.name,{src:r}=e;return{rr_type:t,src:r}}return e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL()}:e instanceof ImageData?{rr_type:e.constructor.name,args:[ft(e.data,t,r),e.width,e.height]}:gt(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:mt(e,t,r)}:e}var yt=(e,t,r)=>e.map(e=>ft(e,t,r)),gt=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]).find(r=>e instanceof t[r]);function bt(e,t,r,n){let a=[];try{let o=w(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(a,...o){if(!xe(this,t,r,!0)){let e=(e=>"experimental-webgl"===e?"webgl":e)(a);if("__context"in this||(this.__context=e),n&&["webgl","webgl2"].includes(e))if(o[0]&&"object"==typeof o[0]){let e=o[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[a,...o])}});a.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{a.forEach(e=>e())}}function St(e,t,r,n,a,o){let s=[],i=Object.getOwnPropertyNames(e);for(let l of i)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if("function"!=typeof e[l])continue;let i=w(e,l,function(e){return function(...s){let i=e.apply(this,s);if(mt(i,o,this),"tagName"in this.canvas&&!xe(this.canvas,n,a,!0)){let e=yt(s,o,this),n={type:t,property:l,args:e};r(this.canvas,n)}return i}});s.push(i)}catch{let n=Me(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});s.push(n)}return s}var vt='(function() {\n\t// ../../node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js\n\tvar chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n\tvar lookup = typeof Uint8Array === "undefined" ? [] : /* @__PURE__ */ new Uint8Array(256);\n\tfor (var i = 0; i < chars.length; i++) lookup[chars.charCodeAt(i)] = i;\n\tvar encode = function(arraybuffer) {\n\t\tvar bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = "";\n\t\tfor (i = 0; i < len; i += 3) {\n\t\t\tbase64 += chars[bytes[i] >> 2];\n\t\t\tbase64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n\t\t\tbase64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n\t\t\tbase64 += chars[bytes[i + 2] & 63];\n\t\t}\n\t\tif (len % 3 === 2) base64 = base64.substring(0, base64.length - 1) + "=";\n\t\telse if (len % 3 === 1) base64 = base64.substring(0, base64.length - 2) + "==";\n\t\treturn base64;\n\t};\n\t// ../rrweb/src/record/workers/image-bitmap-data-url-worker.ts\n\tconst lastBlobMap = /* @__PURE__ */ new Map();\n\tconst transparentBlobMap = /* @__PURE__ */ new Map();\n\tasync function getTransparentBlobFor(width, height, dataURLOptions) {\n\t\tconst id = `${width}-${height}`;\n\t\tif ("OffscreenCanvas" in globalThis) {\n\t\t\tif (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n\t\t\tconst offscreen = new OffscreenCanvas(width, height);\n\t\t\toffscreen.getContext("2d");\n\t\t\tconst base64 = encode(await (await offscreen.convertToBlob(dataURLOptions)).arrayBuffer());\n\t\t\ttransparentBlobMap.set(id, base64);\n\t\t\treturn base64;\n\t\t} else return "";\n\t}\n\tconst worker = self;\n\tworker.onmessage = async function(e) {\n\t\tif ("OffscreenCanvas" in globalThis) {\n\t\t\tconst { id, bitmap, width, height, dataURLOptions } = e.data;\n\t\t\tconst transparentBase64 = getTransparentBlobFor(width, height, dataURLOptions);\n\t\t\tconst offscreen = new OffscreenCanvas(width, height);\n\t\t\toffscreen.getContext("2d").drawImage(bitmap, 0, 0);\n\t\t\tbitmap.close();\n\t\t\tconst blob = await offscreen.convertToBlob(dataURLOptions);\n\t\t\tconst type = blob.type;\n\t\t\tconst base64 = encode(await blob.arrayBuffer());\n\t\t\tif (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n\t\t\t\tlastBlobMap.set(id, base64);\n\t\t\t\treturn worker.postMessage({ id });\n\t\t\t}\n\t\t\tif (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n\t\t\tworker.postMessage({\n\t\t\t\tid,\n\t\t\t\ttype,\n\t\t\t\tbase64,\n\t\t\t\twidth,\n\t\t\t\theight\n\t\t\t});\n\t\t\tlastBlobMap.set(id, base64);\n\t\t} else return worker.postMessage({ id: e.data.id });\n\t};\n})();\n\n//# sourceMappingURL=image-bitmap-data-url-worker-DVcMqE1_.js.map',wt="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",vt],{type:"text/javascript;charset=utf-8"});function It(e){let t;try{if(t=wt&&(self.URL||self.webkitURL).createObjectURL(wt),!t)throw"";let r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(vt),{name:null==e?void 0:e.name})}}var Ct,kt,Mt,Ot,Tt=class{constructor(e){r(this,"pendingCanvasMutations",new Map),r(this,"rafStamps",{latestId:0,invokeId:null}),r(this,"mirror"),r(this,"mutationCb"),r(this,"resetObservers"),r(this,"frozen",!1),r(this,"locked",!1),r(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)});let{sampling:t="all",win:n,blockClass:a,blockSelector:o,recordCanvas:s,dataURLOptions:i}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===t&&this.initCanvasMutationObserver(n,a,o),s&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,a,o,{dataURLOptions:i})}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,r,n,a){let o=bt(t,r,n,!0),s=new Map,l=new It;l.onmessage=e=>{let{id:t}=e.data;if(s.set(t,!1),!("base64"in e.data))return;let{base64:r,type:n,width:a,height:o}=e.data;this.mutationCb({id:t,type:i["2D"],commands:[{property:"clearRect",args:[0,0,a,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:n}]},0,0]}]})};let d,c=1e3/e,u=0,h=e=>{u&&e-u<c||(u=e,(()=>{let e=[];return t.document.querySelectorAll("canvas").forEach(t=>{xe(t,r,n,!0)||e.push(t)}),e})().forEach(async e=>{var t;let r=this.mirror.getId(e);if(s.get(r)||0===e.width||0===e.height)return;if(s.set(r,!0),["webgl","webgl2"].includes(e.__context)){let r=e.getContext(e.__context);!1===(null==(t=null==r?void 0:r.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&r.clear(r.COLOR_BUFFER_BIT)}let n=await createImageBitmap(e);l.postMessage({id:r,bitmap:n,width:e.width,height:e.height,dataURLOptions:a.dataURLOptions},[n])})),d=requestAnimationFrame(h)};d=requestAnimationFrame(h),this.resetObservers=()=>{o(),cancelAnimationFrame(d)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let n=bt(e,t,r,!1),a=function(e,t,r,n){let a=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let s of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])continue;let o=w(t.CanvasRenderingContext2D.prototype,s,function(a){return function(...o){return xe(this.canvas,r,n,!0)||setTimeout(()=>{let r=yt(o,t,this);e(this.canvas,{type:i["2D"],property:s,args:r})},0),a.apply(this,o)}});a.push(o)}catch{let r=Me(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:i["2D"],property:s,args:[t],setter:!0})}});a.push(r)}return()=>{a.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r),o=((e,t,r,n)=>{let a=[];return void 0!==t.WebGLRenderingContext&&a.push(...St(t.WebGLRenderingContext.prototype,i.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&a.push(...St(t.WebGL2RenderingContext.prototype,i.WebGL2,e,r,n,t)),()=>{a.forEach(e=>e())}})(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{n(),a(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let r=this.pendingCanvasMutations.get(e);if(!r||-1===t)return;let n=r.map(e=>{let{type:t,...r}=e;return r}),{type:a}=r[0];this.mutationCb({id:t,type:a,commands:n}),this.pendingCanvasMutations.delete(e)}},Et=class{constructor(e){r(this,"trackedLinkElements",new WeakSet),r(this,"mutationCb"),r(this,"adoptedStyleSheetCb"),r(this,"styleMirror",new Ue),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;let r={id:t,styleIds:[]},n=[];for(let t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,(e,r)=>({rule:P(e,t.href),index:r}))})),r.styleIds.push(e)}n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},Rt=class{constructor(){r(this,"nodeMap",new WeakMap),r(this,"active",!1)}inOtherBuffer(e,t){let r=this.nodeMap.get(e);return r&&Array.from(r).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}},xt=!1;try{if(2!==Array.from([1],e=>2*e)[0]){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(Ot=e.contentWindow)?void 0:Ot.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var Lt=new W;function Dt(e={}){let{emit:t,checkoutEveryNms:r,checkoutEveryNth:o,blockClass:s="rr-block",blockSelector:i=null,ignoreClass:l="rr-ignore",ignoreSelector:d=null,maskTextClass:c="rr-mask",maskTextSelector:u=null,inlineStylesheet:h=!0,maskAllInputs:p,maskInputOptions:m,slimDOMOptions:f,maskInputFn:y,maskTextFn:g,hooks:b,packFn:S,sampling:w={},dataURLOptions:I={},mousemoveWait:C,recordDOM:k=!0,recordCanvas:M=!1,recordCrossOriginIframes:O=!1,recordAfter:T=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:E=!1,collectFonts:R=!1,inlineImages:x=!1,plugins:L,keepIframeSrcFn:D=()=>!1,ignoreCSSAttributes:A=new Set([]),errorHandler:_}=e;(e=>{ze=e})(_);let F=!O||window.parent===window,U=!1;if(!F)try{window.parent.document&&(U=!1)}catch{U=!0}if(F&&!t)throw new Error("emit function is required");if(!F&&!U)return()=>{};void 0!==C&&void 0===w.mousemove&&(w.mousemove=C),Lt.reset();let P=!0===p?{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!==m?m:{password:!0},z=be(f);((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)})();let $,j=0,B=e=>{for(let t of L||[])t.eventProcessor&&(e=t.eventProcessor(e));return S&&!U&&(e=S(e)),e};Ct=(e,s)=>{let i=e;if(i.timestamp=v(),i.type!==n.FullSnapshot&&(i.type!==n.IncrementalSnapshot||i.data.source!==a.Mutation)){Mt.unfreeze();for(let e of qe){if(!e.isFrozen())break;e.unfreeze()}}if(F)null==t||t(B(i),s);else if(U){let e={type:"rrweb",event:B(i),origin:window.location.origin,isCheckout:s};window.parent.postMessage(e,"*")}if(i.type===n.FullSnapshot)$=i,j=0;else if(i.type===n.IncrementalSnapshot){if(i.data.source===a.Mutation&&i.data.isAttachIframe)return;j++;let e=o&&j>=o,t=r&&i.timestamp-$.timestamp>r;(e||t)&&kt(!0)}};let V=e=>{Ct({type:n.IncrementalSnapshot,data:{source:a.Mutation,...e}})},H=e=>Ct({type:n.IncrementalSnapshot,data:{source:a.Scroll,...e}}),G=e=>Ct({type:n.IncrementalSnapshot,data:{source:a.CanvasMutation,...e}}),q=new Et({mutationCb:V,adoptedStyleSheetCb:e=>Ct({type:n.IncrementalSnapshot,data:{source:a.AdoptedStyleSheet,...e}})}),X=new st({mirror:Lt,mutationCb:V,stylesheetManager:q,recordCrossOriginIframes:O,wrappedEmit:Ct});for(let e of L||[])e.getMirror&&e.getMirror({nodeMirror:Lt,crossOriginIframeMirror:X.crossOriginIframeMirror,crossOriginIframeStyleMirror:X.crossOriginIframeStyleMirror});let Z=new Rt;Mt=new Tt({recordCanvas:M,mutationCb:G,win:window,blockClass:s,blockSelector:i,mirror:Lt,sampling:w.canvas,dataURLOptions:I});let Y=new it({mutationCb:V,scrollCb:H,bypassOptions:{blockClass:s,blockSelector:i,maskTextClass:c,maskTextSelector:u,inlineStylesheet:h,maskInputOptions:P,dataURLOptions:I,maskTextFn:g,maskInputFn:y,recordCanvas:M,inlineImages:x,sampling:w,slimDOMOptions:z,iframeManager:X,stylesheetManager:q,canvasManager:Mt,keepIframeSrcFn:D,processedNodeManager:Z},mirror:Lt});kt=(e=!1)=>{if(!k)return;Ct({type:n.Meta,data:{href:window.location.href,width:Ee(),height:Te()}},e),q.reset(),Y.init(),Mt.lock(),qe.forEach(e=>e.lock());let t=((e,t)=>{let{mirror:r=new W,blockClass:n="rr-block",blockSelector:a=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:i=!0,inlineImages:l=!1,recordCanvas:d=!1,maskAllInputs:c=!1,maskTextFn:u,maskInputFn:h,slimDOM:p=!1,dataURLOptions:m,preserveWhiteSpace:f,onSerialize:y,onIframeLoad:g,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:v,keepIframeSrcFn:w=()=>!1}=t||{};return Se(e,{doc:e,mirror:r,blockClass:n,blockSelector:a,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:i,maskInputOptions:!0===c?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===c?{password:!0}:c,maskTextFn:u,maskInputFn:h,slimDOMOptions:be(p),dataURLOptions:m,inlineImages:l,recordCanvas:d,preserveWhiteSpace:f,onSerialize:y,onIframeLoad:g,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:v,keepIframeSrcFn:w,newlyAddedElement:!1})})(document,{mirror:Lt,blockClass:s,blockSelector:i,maskTextClass:c,maskTextSelector:u,inlineStylesheet:h,maskAllInputs:P,maskTextFn:g,maskInputFn:y,slimDOM:z,dataURLOptions:I,recordCanvas:M,inlineImages:x,onSerialize:e=>{Ae(e,Lt)&&X.addIframe(e),_e(e,Lt)&&q.trackLinkElement(e),Fe(e)&&Y.addShadowRoot(N(e),document)},onIframeLoad:(e,t)=>{X.attachIframe(e,t),Y.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{q.attachLinkElement(e,t)},keepIframeSrcFn:D});if(!t)return console.warn("Failed to snapshot the document");Ct({type:n.FullSnapshot,data:{node:t,initialOffset:Oe(window)}},e),Mt.unlock(),qe.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&q.adoptStyleSheets(document.adoptedStyleSheets,Lt.getId(document))};try{let e=[],t=e=>{var t;return Ge(rt)({mutationCb:V,mousemoveCb:(e,t)=>Ct({type:n.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Ct({type:n.IncrementalSnapshot,data:{source:a.MouseInteraction,...e}}),scrollCb:H,viewportResizeCb:e=>Ct({type:n.IncrementalSnapshot,data:{source:a.ViewportResize,...e}}),inputCb:e=>Ct({type:n.IncrementalSnapshot,data:{source:a.Input,...e}}),mediaInteractionCb:e=>Ct({type:n.IncrementalSnapshot,data:{source:a.MediaInteraction,...e}}),styleSheetRuleCb:e=>Ct({type:n.IncrementalSnapshot,data:{source:a.StyleSheetRule,...e}}),styleDeclarationCb:e=>Ct({type:n.IncrementalSnapshot,data:{source:a.StyleDeclaration,...e}}),canvasMutationCb:G,fontCb:e=>Ct({type:n.IncrementalSnapshot,data:{source:a.Font,...e}}),selectionCb:e=>{Ct({type:n.IncrementalSnapshot,data:{source:a.Selection,...e}})},customElementCb:e=>{Ct({type:n.IncrementalSnapshot,data:{source:a.CustomElement,...e}})},blockClass:s,ignoreClass:l,ignoreSelector:d,maskTextClass:c,maskTextSelector:u,maskInputOptions:P,inlineStylesheet:h,sampling:w,recordDOM:k,recordCanvas:M,inlineImages:x,userTriggeredOnInput:E,collectFonts:R,doc:e,maskInputFn:y,maskTextFn:g,keepIframeSrcFn:D,blockSelector:i,slimDOMOptions:z,dataURLOptions:I,mirror:Lt,iframeManager:X,stylesheetManager:q,shadowDomManager:Y,processedNodeManager:Z,canvasManager:Mt,ignoreCSSAttributes:A,plugins:(null==(t=null==L?void 0:L.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>Ct({type:n.Plugin,data:{plugin:e.name,payload:t}})})))||[]},b)},r=new Map;X.addLoadListener(e=>{try{let n=e.contentDocument;if(r.has(n))return;r.set(n,t(n))}catch(e){console.warn(e)}}),X.addUnloadListener(e=>{let t=r.get(e);t&&(r.delete(e),t(),Y.removeShadowRootsIn(e),Lt.removeNodeFromMap(e))});let o=()=>{kt(),e.push(t(document)),xt=!0};return["interactive","complete"].includes(document.readyState)?o():(e.push(we("DOMContentLoaded",()=>{Ct({type:n.DomContentLoaded,data:{}}),"DOMContentLoaded"===T&&o()})),e.push(we("load",()=>{Ct({type:n.Load,data:{}}),"load"===T&&o()},window))),()=>{[...e,...r.values()].forEach(e=>{try{e()}catch(e){String(e).toLowerCase().includes("cross-origin")||console.warn(e)}}),r.clear(),X.destroy(),Z.destroy(),Y.reset(),Mt.reset(),xt=!1,ze=void 0}}catch(e){console.warn(e)}}function Nt(e,t){if(!e||!e.closest)return null;try{return e.closest(t)}catch{return null}}Dt.addCustomEvent=(e,t)=>{if(!xt)throw new Error("please add custom event after start recording");Ct({type:n.Custom,data:{tag:e,payload:t}})},Dt.addAnnotation=e=>{if(!xt)throw new Error("please add annotation after recording started");Ct({type:n.Annotation,data:e})},Dt.freezePage=()=>{Mt.freeze(),qe.forEach(e=>e.freeze())},Dt.takeFullSnapshot=e=>{if(!xt)throw new Error("please take full snapshot after start recording");kt(e)},Dt.mirror=Lt;var At=/[^\s@<>()[\]"',;:]{1,64}@[^\s@<>()[\]"',;:]{1,253}\.[a-z]{2,}/gi,_t=/\beyJ[\w-]{6,500}\.[\w-]{6,}\.[\w-]{6,}/g,Ft=/\b(?:sk_live_|sk_test_|rk_live_|pk_live_|ib_sk_|ghp_|gho_|ghs_|github_pat_|xox[abpr]-|AKIA|AIza|ya29\.)[\w.-]{8,}/g,Ut=/\b\d{3}-\d{2}-\d{4}\b/g,Pt=/\b[A-Z]{2}\d{2}(?: ?[A-Z0-9]{4}){2,7}(?: ?[A-Z0-9]{1,4})?\b/g,Wt=/\+?\(?\d[\d\s().-]{7,}\d/g,zt=/[A-Za-z0-9_-]{32,}/g,$t=e=>e.replace(/\S/g,"*");function jt(e){let t=e.replace(/\D/g,"");return t.length>=13&&t.length<=19&&(e=>{let t=0,r=!1;for(let n=e.length-1;n>=0;n--){let a=e.charCodeAt(n)-48;r&&(a*=2,a>9&&(a-=9)),t+=a,r=!r}return t%10==0})(t)||t.length>=9&&t.length<=15&&/^\+|[\s().-]/.test(e)&&!/^\d{4}-\d{2}-\d{2}/.test(e)?$t(e):e}function Bt(e){if(!e)return e;let t=e.indexOf("@")>=0,r=/\d/.test(e);return!t&&!r&&e.length<32||(t&&(e=e.replace(At,$t)),e.length>=20&&(e=e.replace(_t,$t).replace(Ft,$t)),r&&(e=e.replace(Ut,$t).replace(Pt,$t).replace(Wt,jt)),e.length>=32&&(e=e.replace(zt,e=>/\d/.test(e)&&/[A-Za-z]/.test(e)?$t(e):e))),e}var Vt=["gclid","gbraid","wbraid","fbclid","msclkid","ttclid","li_fat_id","twclid"];function Ht(e){return e.split("/").map(e=>{let t=e;try{t=decodeURIComponent(e)}catch{return":redacted"}return t.indexOf("@")>=0||t.indexOf("=")>=0||/^\d{9,}$/.test(t)||t.length>=24&&/\d/.test(t)&&/^[\w-]+$/.test(t)||Bt(t)!==t?":redacted":e}).join("/")}function Gt(e,t=[]){let r;try{r=new URL(e,"undefined"!=typeof location?location.href:"http://localhost/")}catch{return{url:"",path:""}}let n=Ht(r.pathname)+(0===r.hash.indexOf("#/")?Ht(r.hash.split("?")[0]):""),a="";return r.searchParams.forEach((e,r)=>{let n=0===r.indexOf("utm_")||Vt.indexOf(r)>=0||t.indexOf(r)>=0;a+=(a?"&":"?")+encodeURIComponent(r)+"="+(n?encodeURIComponent(Bt(e)):"*")}),{url:r.origin+n+a,path:n}}var qt,Xt="input[type=password],input[type=email],input[type=tel],input[type=hidden],[autocomplete^=cc-],[autocomplete=one-time-code],[autocomplete=current-password],[autocomplete=new-password],[autocomplete=email],[autocomplete=tel],input[name=pin i],input[id=pin i],textarea[name=pin i],"+["pass","pwd","card","ccnum","cc-num","cvc","cvv","iban","ssn","otp","secret","token","email","phone"].map(e=>`input[name*=${e} i],input[id*=${e} i],textarea[name*=${e} i]`).join(","),Zt=/pass|pwd|card|cc-?num|cvc|cvv|iban|ssn|otp|secret|token|email|phone|^pin$/i,Yt="[data-ib-mask],.ib-mask,[data-ph-mask],.ph-mask,.ph-sensitive";function Jt(e,t){return(e.getAttribute(t)||"").toLowerCase()}function Kt(e){if(void 0===qt)try{e.createElement("input").matches(Xt),qt=!0}catch{qt=!1}return qt}var Qt=e=>e.replace(/\S/g,"*");function er(e,t){for(let r=e;r;){let e=Nt(r,t);if(e)return e;let n=r.getRootNode?r.getRootNode():null;r=n&&n.host?n.host:null}return null}function tr(e,t){let r=Yt+t;return(t,n)=>t&&t.trim()?"text"===e||er(n,r)||(e=>!(!e||!er(e,"[contenteditable]:not([contenteditable=false])")&&"on"!==e.ownerDocument.designMode))(n)||"controls"===e&&!er(n,"button,a,label,nav,th,summary,option,select,legend,[role=button],[role=link],[role=tab],[role=menuitem],[role=option],[role=checkbox],[role=radio],[role=switch],input[type=submit],input[type=button],input[type=reset],[data-ib-unmask]")?Qt(t):Bt(t):t}var rr=/^((?:[a-z\d]{1,23}[-_.])+)[\da-f]{8,64}\.[a-z\d]{2,5}$/i;function nr(e){let t=rr.exec(e);return t&&/[g-z]/i.test(t[1])&&Bt(t[1])===t[1]?e:Ht(e)}function ar(e){if(Bt(e)===e)return e;try{let t=new URL(e,location.href),r="";return t.searchParams.forEach((e,t)=>{r+=(r?"&":"?")+encodeURIComponent(t)+"="+encodeURIComponent(Bt(e))}),t.origin+t.pathname.split("/").map(nr).join("/")+r}catch{return Bt(e)}}var or=/^(href|action|formaction|cite|ping|xlink:href|rr_src)$/,sr=/^(src|srcset|poster|background|data)$/,ir=/^(title|alt|placeholder|label|value|summary|abbr|aria-label|aria-description|aria-valuetext|aria-placeholder|aria-roledescription|aria-braillelabel|aria-brailleroledescription)$/,lr=/^(on|nonce$|srcdoc$)/,dr=/data:[\w/+.-]+;base64,[\w+/=]{32768,}/g,cr=/^[a-z][a-z-]{0,15}$/,ur=e=>!e||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)&&!/^(submit|button|reset|image|checkbox|radio)$/i.test(e.getAttribute("type")||"");function hr(e,t){return(e=>!(!e||!e.tagName)&&(Kt(e.ownerDocument)?e.matches(Xt):(e=>{let t=e.tagName.toLowerCase();if("input"!==t&&"textarea"!==t)return!1;let r=Jt(e,"type"),n=Jt(e,"autocomplete"),a=r=>Zt.test(Jt(e,r))&&("input"===t||"name"===r);return"input"===t&&["password","email","tel","hidden"].indexOf(r)>=0||0===n.indexOf("cc-")||["one-time-code","current-password","new-password","email","tel"].indexOf(n)>=0||a("name")||a("id")})(e)))(t)?"********":e&&"*".repeat(e.length)}function pr(e,t){if(!Array.isArray(e))return"";let r="";for(let n of e.slice(0,50))if("string"==typeof n&&n&&!(n.length>200))try{(t||document).querySelector(n),r+=","+n}catch{continue}return r}function mr(e,t="",r=""){return{maskAllInputs:!0,maskInputFn:hr,maskTextSelector:"*",maskTextFn:tr(e,t),blockSelector:'[data-ib-block],.ib-block,.ph-no-capture,[data-testid=ph-no-capture],input[type=file],img[src^="blob:"],img[src^="data:"],img[srcset*="blob:"],img[srcset*="data:"],source[srcset*="blob:"],source[srcset*="data:"],video[src^="blob:"],image[href^="data:"],image[href^="blob:"]'+("text"===e?",img,picture,video,image":"")+r,ignoreSelector:Kt(document)?Xt:Xt.replace(/ i\]/g,"]"),slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!1,recordCanvas:!1,recordCrossOriginIframes:!1,recordAfter:"DOMContentLoaded",sampling:{mousemove:50,scroll:150,media:800,input:"last"}}}var fr=204800,yr=0,gr=/bot\b|crawl|spider|slurp|facebookexternalhit|embedly|lighthouse|pagespeed/i,br=window,Sr=document.currentScript,vr=Sr&&Sr.src?Sr.src.slice(0,Sr.src.lastIndexOf("/")+1):"https://cdn.ionblink.com/sdk/",wr=null;function Ir(){return wr||(wr=new Promise((e,t)=>{let r=br.__ionblink_chunk;br.__ionblink_chunk=(t,n)=>{if("i"!==t)return r&&r(t,n);br.__ionblink_chunk=r,e(n)};let n=document.createElement("script");n.async=!0,n.src=vr+"i-729781ba45.js",n.integrity="sha256-cpeBukWbbd8rZRdFZDlftF+YZQcUwVu95Ca97w+E7xc=",n.crossOrigin="anonymous",Sr&&Sr.nonce&&(n.nonce=Sr.nonce),n.onerror=()=>{br.__ionblink_chunk=r,wr=null,t(new Error("chunk failed to load (network, CSP or integrity): "+n.src))},(document.head||document.documentElement).appendChild(n)}),wr)}br.__ionblink_chunk&&br.__ionblink_chunk("r",e=>((e,t)=>{if(gr.test(navigator.userAgent))return"crawler";if(document.getElementsByTagName("*").length>15e3)return"dom_too_large";let r=pr(e.mask),n=((e,t)=>{let r=tr(e,t),n=Yt+t;return(t,a,o)=>{for(let s in t){let i=t[s];if("string"!=typeof i||!i)continue;let l=s.toLowerCase();if("_csstext"===l)i.length>1e6&&(t[s]=i.replace(dr,"data:,"));else if(lr.test(l))o?t[s]=null:delete t[s];else if("value"===l&&ur(a))t[s]=hr(i,a);else if("content"===l)t[s]=a&&/^(viewport|theme-color|color-scheme)$/i.test(a.getAttribute("name")||"")?i:Qt(i);else if(or.test(l)){let e=/^\s*([a-z][\w+.-]*):/i.exec(i),r=e?e[1].toLowerCase():"";t[s]="javascript"===r?"#":r&&"http"!==r&&"https"!==r?r+":*":Gt(i).url||"#"}else sr.test(l)?t[s]=/^\s*(blob|data):/i.test(i)?"":"srcset"===l?i.replace(/[^\s,]+/g,ar):ar(i):0===l.indexOf("data-")?t[s]="text"===e||er(a,n)?Qt(i):cr.test(i)?i:r(i,a):ir.test(l)&&(t[s]=r(i,a))}}})(e.level,r),a=e=>{let t=Dt.mirror.getNode(e);return t&&1===t.nodeType?t:null};function o(e){let t=e?[e]:[];for(;t.length;){let e=t.pop();if(2===e.type&&e.attributes&&n(e.attributes,a(e.id),!1),e.childNodes)for(let r of e.childNodes)t.push(r)}}let s=[],i=0,l=0,d=!0;function c(){if(l&&clearTimeout(l),l=0,!s.length)return;let t=s;s=[],i=0,e.send(t)}function u(t){if(!d)return;if(yr>20971520)return d=!1,s=[],void e.stop("budget");4===t.type&&s.length&&c(),(e=>{let t=e.data;if(t)if(4===e.type&&t.href)t.href=Gt(t.href).url;else if(2===e.type)o(t.node);else if(3===e.type&&0===t.source){if(t.adds)for(let e of t.adds)o(e.node);if(t.attributes)for(let e of t.attributes)n(e.attributes,a(e.id),!0)}})(t),s.push(t);let r=t.data,u=2===t.type?fr:6===t.type?60+JSON.stringify(r).length:120+(r&&r.adds?400*r.adds.length:0)+(r&&r.texts?60*r.texts.length:0)+(r&&r.attributes?80*r.attributes.length:0);i+=u,yr+=u,i>=fr?c():l||(l=setTimeout(()=>{try{c()}catch(t){e.report("replay.flush",t)}},e.every()))}let h=Dt({...mr(e.level,r,pr(e.block)),emit:t=>{try{u(t)}catch(t){e.report("replay.emit",t)}},errorHandler:t=>(e.report("rrweb",t),!0)}),p=null,m=e.opts,f=m.network,y=t=>{let r=e.cfg();return!!r&&!0===r[t]&&!1!==m[t]};return t&&(y("console")||y("network"))&&t().then(t=>{if(d)try{p=t({get console(){return y("console")},get network(){return y("network")},star:"text"===e.level,fresh:e.fresh,keep:f&&"object"==typeof f&&Array.isArray(f.keepParams)?f.keepParams.filter(e=>"string"==typeof e).slice(0,20):[],push:t=>{try{u(t)}catch(t){e.report("inspect.emit",t)}},report:e.report,scrub:Bt,seg:Ht})}catch(t){e.report("inspect.start",t)}},t=>e.report("inspect.load",t)),{flush:c,stop(){p&&p.stop(),p=null,d=!1,h&&h(),c()}}})(e,Ir))})();
@@ -18,7 +18,8 @@ export interface Auto {
18
18
  click(e: MouseEvent, t: number, box?: DOMRect | null, late?: boolean): DOMRect | null;
19
19
  scroll(t: number): void;
20
20
  selection(t: number): void;
21
- field(e: FocusEvent, focus: boolean, t: number): void;
21
+ /** A field's focus, blur, or a choice made (select, checkbox, radio). */
22
+ field(el: EventTarget | null, action: 'focus' | 'blur' | 'change', t: number): void;
22
23
  input(e: Event, t: number): void;
23
24
  submit(e: Event, t: number): void;
24
25
  error(e: ErrorEvent): void;
@@ -1,4 +1,10 @@
1
- import type { CaptureMode, MaskLevel, RemoteConfig } from './protocol';
1
+ import type { CaptureMode, MaskLevel, PhoneReplayConfig, RemoteConfig } from './protocol';
2
+ export declare const clamp: (v: number, lo: number, hi: number) => number;
3
+ /** FNV-1a, 32 bit. Deterministic sampling and short storage-key suffixes. */
4
+ export declare function fnv1a(s: string): number;
5
+ /** Whether this session is recorded: the same session id always gets the same answer, on every SDK. `local` is the
6
+ * app's own sample, which can only lower the site's. */
7
+ export declare const sampledIn: (session: string, sample: number, local?: number) => boolean;
2
8
  export declare const MODES: CaptureMode[];
3
9
  export declare const rank: (m: CaptureMode) => number;
4
10
  export declare const minMode: (a: CaptureMode, b: CaptureMode) => CaptureMode;
@@ -33,3 +39,5 @@ export declare function parseConfig(j: unknown): RemoteConfig | null;
33
39
  export declare function versionMatches(v: string, spec: string): boolean;
34
40
  /** What the kill switch stops for this SDK: 'all' > 'auto' > 'replay', or null. */
35
41
  export declare function killLevel(cfg: RemoteConfig | null, sdk: string, version: string): 'all' | 'auto' | 'replay' | null;
42
+ export declare const PHONE_REPLAY: Required<PhoneReplayConfig>;
43
+ export declare function phoneKnobs(j: unknown): Required<PhoneReplayConfig>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,29 @@
1
+ import type { InspectApi, InspectHandle } from './types';
2
+ /** Characters one console line keeps, all its arguments together. */
3
+ export declare const LINE = 2000;
4
+ export declare const MAX_LINES = 1000;
5
+ export declare const MAX_CHARS = 400000;
6
+ export declare const MAX_REQS = 1000;
7
+ /** Lines (or requests) a second once the burst is spent. */
8
+ export declare const RATE = 20;
9
+ export declare const BURST = 100;
10
+ declare const LEVELS: readonly ['log', 'info', 'warn', 'error'];
11
+ type Level = (typeof LEVELS)[number];
12
+ /** A string from the page as it may leave (see the top of this file), at most `max` characters: masked raw, with room
13
+ * for an email or a token across the cut, then cut. */
14
+ export declare function str(s: string, max: number): string;
15
+ /** One argument as JSON text, bounded: at most 100 values visited, nested strings cut to 300 characters. */
16
+ export declare function text(v: unknown, room: number): string;
17
+ /** Stack frames: 'at …' (V8) or 'fn@url:line:col' (Firefox, Safari), at most 10. They are code locations (a frame
18
+ * can still carry page text: the player shows them as text, never as links): URLs lose their query and fragment, then
19
+ * scrubbed, then cut. */
20
+ export declare function frames(stack: unknown): string[];
21
+ /** Records one console line, masked and cut (see the top of this file). `trace`: read only once the line is let
22
+ * through; `lead`: the SDK's own words ('Uncaught'), never starred. */
23
+ export declare function line(level: Level, args: ArrayLike<unknown>, trace?: () => string[], lead?: string): void;
24
+ /** Origin and path only (see the top of this file). */
25
+ export declare function cleanUrl(href: string, keep: string[]): string;
26
+ export declare function start(a: InspectApi): InspectHandle;
27
+ /** Tests only: back to a page that never loaded the chunk (the wrappers stay, as they would). */
28
+ export declare function resetForTests(): void;
29
+ export {};
@@ -5,9 +5,10 @@ export { closest };
5
5
  export declare const SENSITIVE: string;
6
6
  /** Interactive controls whose labels stay readable at level `controls`. */
7
7
  export declare const CONTROLS: string;
8
- export declare const MASKED = "[data-ib-mask],.ib-mask";
9
- export declare const NO_CAPTURE = "[data-ib-no-capture],.ib-no-capture,[data-ib-block],.ib-block";
10
- /** Always blocked in replay: marked elements, file inputs, and upload previews (`blob:` and `data:` images). */
8
+ export declare const MASKED = "[data-ib-mask],.ib-mask,[data-ph-mask],.ph-mask,.ph-sensitive";
9
+ export declare const NO_CAPTURE = "[data-ib-no-capture],.ib-no-capture,[data-ib-block],.ib-block,.ph-no-capture";
10
+ /** Always blocked in replay: marked elements (ours and PostHog's), file inputs, and upload previews (`blob:` and
11
+ * `data:` images). */
11
12
  export declare const BLOCKED: string;
12
13
  /** True for fields that must never be captured. Matches SENSITIVE, or the same rule without selectors in an engine
13
14
  * that can't parse the selector `i` flag. */
@@ -23,8 +24,8 @@ export declare function textFor(el: Element, level: MaskLevel): string | undefin
23
24
  export declare function labelFor(el: Element, level: MaskLevel): string | undefined;
24
25
  /** rrweb `maskTextFn` for a level: every text node passes through it (maskTextSelector '*'). */
25
26
  export declare function maskTextFn(level: MaskLevel, extraMask: string): (text: string, el: HTMLElement | null) => string;
26
- /** A resource URL (img src): unchanged unless it carries PII; then the path is redacted segment by segment and each
27
- * query value scrubbed, so most images still load in the player. */
27
+ /** A resource URL (img src): unchanged unless it carries PII; then the path is redacted segment by segment (a built
28
+ * asset's name kept) and each query value scrubbed, so most images still load in the player. */
28
29
  export declare function scrubUrl(href: string): string;
29
30
  /** rrweb records attribute values verbatim (rrweb 2 has no attribute hook), so the replay chunk passes every
30
31
  * serialized element's attributes through this: inline handlers, nonces and srcdoc dropped, links masked like page
@@ -0,0 +1,42 @@
1
+ import { type MaskLevel, type RrwebEvent } from './protocol';
2
+ /** rrweb's numbers (rrweb 2.x `EventType`, `IncrementalSource`, `MouseInteractions`). */
3
+ export declare const RR: {
4
+ readonly FULL: 2;
5
+ readonly INCR: 3;
6
+ readonly META: 4;
7
+ readonly CUSTOM: 5;
8
+ readonly MUTATION: 0;
9
+ readonly MOUSE: 2;
10
+ readonly TOUCH_MOVE: 6;
11
+ readonly TOUCH_START: 7;
12
+ readonly TOUCH_END: 9;
13
+ };
14
+ /** The node id of the one picture in a phone's document. */
15
+ export declare const PHONE_IMG_ID = 8;
16
+ /** The one-picture document, as rrweb serializes a DOM. */
17
+ export declare function frameDocument(src: string, w: number, h: number): unknown;
18
+ /** A frame as an image `data:` URL. */
19
+ export declare const frameSrc: (mime: string, base64: string) => string;
20
+ /** What a new screen (or a checkout) starts with: Meta, the ib.mobile mark, and a full snapshot of the frame. */
21
+ export declare function phoneSnapshot(t: number, o: {
22
+ href: string;
23
+ src: string;
24
+ w: number;
25
+ h: number;
26
+ platform: string;
27
+ mask: MaskLevel;
28
+ }): RrwebEvent[];
29
+ /** The next frame on the same screen: the picture's src, nothing else. */
30
+ export declare const phoneFrame: (t: number, src: string) => RrwebEvent;
31
+ /** A finger down or up, in points. */
32
+ export declare const phoneTouch: (t: number, phase: 'start' | 'end', x: number, y: number) => RrwebEvent;
33
+ /** A finger's path while it moves; the event's time is the last point's, each point's `timeOffset` is relative to it. */
34
+ export declare function phoneMoves(points: {
35
+ x: number;
36
+ y: number;
37
+ t: number;
38
+ }[]): RrwebEvent;
39
+ /** A screen change, by route pattern. */
40
+ export declare const phoneScreen: (t: number, name: string) => RrwebEvent;
41
+ /** A replay a phone recorded (its ib.mobile mark), not a page's DOM. */
42
+ export declare const isPhoneReplay: (events: RrwebEvent[]) => boolean;