ghostplay-sdk 0.2.0 → 0.2.1

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.
@@ -56,7 +56,7 @@ You tried to parse Less with the standard CSS parser; try again with the postcss
56
56
  https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
57
57
  https://www.w3ctech.com/topic/2226`));let l=t(...o);return l.postcssPlugin=e,l.postcssVersion=new ci().version,l}let n;return Object.defineProperty(i,"postcss",{get(){return n||(n=i()),n}}),i.process=function(o,l,a){return A([i(a)]).process(o,l)},i};A.stringify=Hh;A.parse=Jh;A.fromJSON=jh;A.list=Kh;A.comment=s=>new jo(s);A.atRule=s=>new Yo(s);A.decl=s=>new Vo(s);A.rule=s=>new Zo(s);A.root=s=>new Xo(s);A.document=s=>new Ho(s);A.CssSyntaxError=Gh;A.Declaration=Vo;A.Container=Vh;A.Processor=ci;A.Document=Ho;A.Comment=jo;A.Warning=Yh;A.AtRule=Yo;A.Result=Zh;A.Input=Xh;A.Rule=Zo;A.Root=Xo;A.Node=qh;zh.registerPostcss(A);var Qh=A;A.default=A;var F=cu(Qh);F.stringify;F.fromJSON;F.plugin;F.parse;F.list;F.document;F.comment;F.atRule;F.rule;F.decl;F.root;F.CssSyntaxError;F.Declaration;F.Container;F.Processor;F.Document;F.Comment;F.Warning;F.AtRule;F.Result;F.Input;F.Rule;F.Root;F.Node;var Os=class s{constructor(...e){te(this,"parentElement",null),te(this,"parentNode",null),te(this,"ownerDocument"),te(this,"firstChild",null),te(this,"lastChild",null),te(this,"previousSibling",null),te(this,"nextSibling",null),te(this,"ELEMENT_NODE",1),te(this,"TEXT_NODE",3),te(this,"nodeType"),te(this,"nodeName"),te(this,"RRNodeType");}get childNodes(){let e=[],t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(e instanceof s){if(e.ownerDocument!==this.ownerDocument)return false;if(e===this)return true}else return false;for(;e.parentNode;){if(e.parentNode===this)return true;e=e.parentNode;}return false}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"}};var an={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ln={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Lt={},ef=()=>!!globalThis.Zone;function ui(s){if(Lt[s])return Lt[s];let e=globalThis[s],t=e.prototype,r=s in an?an[s]:void 0,i=!!(r&&r.every(l=>{var a,c;return !!((c=(a=Object.getOwnPropertyDescriptor(t,l))==null?void 0:a.get)!=null&&c.toString().includes("[native code]"))})),n=s in ln?ln[s]:void 0,o=!!(n&&n.every(l=>{var a;return typeof t[l]=="function"&&((a=t[l])==null?void 0:a.toString().includes("[native code]"))}));if(i&&o&&!ef())return Lt[s]=e.prototype,e.prototype;try{let l=document.createElement("iframe");document.body.appendChild(l);let a=l.contentWindow;if(!a)return e.prototype;let c=a[s].prototype;return document.body.removeChild(l),c?Lt[s]=c:t}catch{return t}}var Xr={};function ye(s,e,t){var r;let i=`${s}.${String(t)}`;if(Xr[i])return Xr[i].call(e);let n=ui(s),o=(r=Object.getOwnPropertyDescriptor(n,t))==null?void 0:r.get;return o?(Xr[i]=o,o.call(e)):e[t]}var Jr={};function Jo(s,e,t){let r=`${s}.${String(t)}`;if(Jr[r])return Jr[r].bind(e);let n=ui(s)[t];return typeof n!="function"?e[t]:(Jr[r]=n,n.bind(e))}function tf(s){return ye("Node",s,"ownerDocument")}function rf(s){return ye("Node",s,"childNodes")}function sf(s){return ye("Node",s,"parentNode")}function nf(s){return ye("Node",s,"parentElement")}function of(s){return ye("Node",s,"textContent")}function af(s,e){return Jo("Node",s,"contains")(e)}function lf(s){return Jo("Node",s,"getRootNode")()}function cf(s){return !s||!("host"in s)?null:ye("ShadowRoot",s,"host")}function uf(s){return s.styleSheets}function hf(s){return !s||!("shadowRoot"in s)?null:ye("Element",s,"shadowRoot")}function ff(s,e){return ye("Element",s,"querySelector")(e)}function df(s,e){return ye("Element",s,"querySelectorAll")(e)}function Ko(){return ui("MutationObserver").constructor}function Ne(s,e,t){try{if(!(e in s))return ()=>{};let r=s[e],i=t(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),s[e]=i,()=>{s[e]=r;}}catch{return ()=>{}}}var C={ownerDocument:tf,childNodes:rf,parentNode:sf,parentElement:nf,textContent:of,contains:af,getRootNode:lf,host:cf,styleSheets:uf,shadowRoot:hf,querySelector:ff,querySelectorAll:df,mutationObserver:Ko,patch:Ne};function X(s,e,t=document){let r={capture:true,passive:true};return t.addEventListener(s,e,r),()=>t.removeEventListener(s,e,r)}var Re=`Please stop import mirror directly. Instead of that,\r
58
58
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
59
- or you can use record.mirror to access the mirror instance during recording.`,cn={map:{},getId(){return console.error(Re),-1},getNode(){return console.error(Re),null},removeNodeFromMap(){console.error(Re);},has(){return console.error(Re),false},reset(){console.error(Re);}};typeof window<"u"&&window.Proxy&&window.Reflect&&(cn=new Proxy(cn,{get(s,e,t){return e==="map"&&console.error(Re),Reflect.get(s,e,t)}}));function nt(s,e,t={}){let r=null,i=0;return function(...n){let o=Date.now();!i&&t.leading===false&&(i=o);let l=e-(o-i),a=this;l<=0||l>e?(r&&(clearTimeout(r),r=null),i=o,s.apply(a,n)):!r&&t.trailing!==false&&(r=setTimeout(()=>{i=t.leading===false?0:Date.now(),r=null,s.apply(a,n);},l));}}function vr(s,e,t,r,i=window){let n=i.Object.getOwnPropertyDescriptor(s,e);return i.Object.defineProperty(s,e,r?t:{set(o){setTimeout(()=>{t.set.call(this,o);},0),n&&n.set&&n.set.call(this,o);}}),()=>vr(s,e,n||{},true)}var ir=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(ir=()=>new Date().getTime());function qo(s){var e,t,r,i;let n=s.document;return {left:n.scrollingElement?n.scrollingElement.scrollLeft:s.pageXOffset!==void 0?s.pageXOffset:n.documentElement.scrollLeft||n?.body&&((e=C.parentElement(n.body))==null?void 0:e.scrollLeft)||((t=n?.body)==null?void 0:t.scrollLeft)||0,top:n.scrollingElement?n.scrollingElement.scrollTop:s.pageYOffset!==void 0?s.pageYOffset:n?.documentElement.scrollTop||n?.body&&((r=C.parentElement(n.body))==null?void 0:r.scrollTop)||((i=n?.body)==null?void 0:i.scrollTop)||0}}function Qo(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ea(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ta(s){return s?s.nodeType===s.ELEMENT_NODE?s:C.parentElement(s):null}function J(s,e,t,r){if(!s)return false;let i=ta(s);if(!i)return false;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return !0}else if(Xt(i,e,r))return !0}catch{}return !!(t&&(i.matches(t)||r&&i.closest(t)!==null))}function pf(s,e){return e.getId(s)!==-1}function Kr(s,e,t){return s.tagName==="TITLE"&&t.headTitleMutations?true:e.getId(s)===Je}function ra(s,e){if(Ye(s))return false;let t=e.getId(s);if(!e.has(t))return true;let r=C.parentNode(s);return r&&r.nodeType===s.DOCUMENT_NODE?false:r?ra(r,e):true}function Ds(s){return !!s.changedTouches}function mf(s=window){"NodeList"in s&&!s.NodeList.prototype.forEach&&(s.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in s&&!s.DOMTokenList.prototype.forEach&&(s.DOMTokenList.prototype.forEach=Array.prototype.forEach);}function sa(s,e){return !!(s.nodeName==="IFRAME"&&e.getMeta(s))}function ia(s,e){return !!(s.nodeName==="LINK"&&s.nodeType===s.ELEMENT_NODE&&s.getAttribute&&s.getAttribute("rel")==="stylesheet"&&e.getMeta(s))}function Ts(s){return s?s instanceof Os&&"shadowRoot"in s?!!s.shadowRoot:!!C.shadowRoot(s):false}var ks=class{constructor(){v(this,"id",1),v(this,"styleIDMap",new WeakMap),v(this,"idStyleMap",new Map);}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return t===void 0?r=this.id++:r=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 na(s){var e;let t=null;return "getRootNode"in s&&((e=C.getRootNode(s))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&C.host(C.getRootNode(s))&&(t=C.host(C.getRootNode(s))),t}function gf(s){let e=s,t;for(;t=na(e);)e=t;return e}function yf(s){let e=C.ownerDocument(s);if(!e)return false;let t=gf(s);return C.contains(e,t)}function oa(s){let e=C.ownerDocument(s);return e?C.contains(e,s)||yf(s):false}var x=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(x||{}),E=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s))(E||{}),K=(s=>(s[s.MouseUp=0]="MouseUp",s[s.MouseDown=1]="MouseDown",s[s.Click=2]="Click",s[s.ContextMenu=3]="ContextMenu",s[s.DblClick=4]="DblClick",s[s.Focus=5]="Focus",s[s.Blur=6]="Blur",s[s.TouchStart=7]="TouchStart",s[s.TouchMove_Departed=8]="TouchMove_Departed",s[s.TouchEnd=9]="TouchEnd",s[s.TouchCancel=10]="TouchCancel",s))(K||{}),de=(s=>(s[s.Mouse=0]="Mouse",s[s.Pen=1]="Pen",s[s.Touch=2]="Touch",s))(de||{}),Be=(s=>(s[s["2D"]=0]="2D",s[s.WebGL=1]="WebGL",s[s.WebGL2=2]="WebGL2",s))(Be||{}),Ae=(s=>(s[s.Play=0]="Play",s[s.Pause=1]="Pause",s[s.Seeked=2]="Seeked",s[s.VolumeChange=3]="VolumeChange",s[s.RateChange=4]="RateChange",s))(Ae||{});var aa=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(aa||{});function un(s){return "__ln"in s}var _s=class{constructor(){v(this,"length",0),v(this,"head",null),v(this,"tail",null);}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=t?.next||null;return t}addNode(e){let t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&un(e.previousSibling)){let r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t);}else if(e.nextSibling&&un(e.nextSibling)&&e.nextSibling.__ln.previous){let r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t);}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++;}removeNode(e){let t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--);}},hn=(s,e)=>`${s}@${e}`,Ps=class{constructor(){v(this,"frozen",false),v(this,"locked",false),v(this,"texts",[]),v(this,"attributes",[]),v(this,"attributeMap",new WeakMap),v(this,"removes",[]),v(this,"mapRemoves",[]),v(this,"movedMap",{}),v(this,"addedSet",new Set),v(this,"movedSet",new Set),v(this,"droppedSet",new Set),v(this,"removesSubTreeCache",new Set),v(this,"mutationCb"),v(this,"blockClass"),v(this,"blockSelector"),v(this,"maskTextClass"),v(this,"maskTextSelector"),v(this,"inlineStylesheet"),v(this,"maskInputOptions"),v(this,"maskTextFn"),v(this,"maskInputFn"),v(this,"keepIframeSrcFn"),v(this,"recordCanvas"),v(this,"inlineImages"),v(this,"slimDOMOptions"),v(this,"dataURLOptions"),v(this,"doc"),v(this,"mirror"),v(this,"iframeManager"),v(this,"stylesheetManager"),v(this,"shadowDomManager"),v(this,"canvasManager"),v(this,"processedNodeManager"),v(this,"unattachedDoc"),v(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit();}),v(this,"emit",()=>{if(this.frozen||this.locked)return;let e=[],t=new Set,r=new _s,i=a=>{let c=a,u=Je;for(;u===Je;)c=c&&c.nextSibling,u=c&&this.mirror.getId(c);return u},n=a=>{let c=C.parentNode(a);if(!c||!oa(a))return;let u=false;if(a.nodeType===Node.TEXT_NODE){let m=c.tagName;if(m==="TEXTAREA")return;m==="STYLE"&&this.addedSet.has(c)&&(u=true);}let h=Ye(c)?this.mirror.getId(na(a)):this.mirror.getId(c),p=i(a);if(h===-1||p===-1)return r.addNode(a);let g=De(a,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:true,newlyAddedElement:true,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:m=>{sa(m,this.mirror)&&this.iframeManager.addIframe(m),ia(m,this.mirror)&&this.stylesheetManager.trackLinkElement(m),Ts(a)&&this.shadowDomManager.addShadowRoot(C.shadowRoot(a),this.doc);},onIframeLoad:(m,d)=>{this.iframeManager.attachIframe(m,d),this.shadowDomManager.observeAttachShadow(m);},onStylesheetLoad:(m,d)=>{this.stylesheetManager.attachLinkElement(m,d);},cssCaptured:u});g&&(e.push({parentId:h,nextId:p,node:g}),t.add(g.id));};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let a of this.movedSet)fn(this.removesSubTreeCache,a,this.mirror)&&!this.movedSet.has(C.parentNode(a))||n(a);for(let a of this.addedSet)!dn(this.droppedSet,a)&&!fn(this.removesSubTreeCache,a,this.mirror)||dn(this.movedSet,a)?n(a):this.droppedSet.add(a);let o=null;for(;r.length;){let a=null;if(o){let c=this.mirror.getId(C.parentNode(o.value)),u=i(o.value);c!==-1&&u!==-1&&(a=o);}if(!a){let c=r.tail;for(;c;){let u=c;if(c=c.previous,u){let h=this.mirror.getId(C.parentNode(u.value));if(i(u.value)===-1)continue;if(h!==-1){a=u;break}else {let g=u.value,m=C.parentNode(g);if(m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let d=C.host(m);if(this.mirror.getId(d)!==-1){a=u;break}}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}o=a.previous,r.removeNode(a.value),n(a.value);}let l={texts:this.texts.map(a=>{let c=a.node,u=C.parentNode(c);return u&&u.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(u),{id:this.mirror.getId(c),value:a.value}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{let{attributes:c}=a;if(typeof c.style=="string"){let u=JSON.stringify(a.styleDiff),h=JSON.stringify(a._unchangedStyles);u.length<c.style.length&&(u+h).split("var(").length===c.style.split("var(").length&&(c.style=a.styleDiff);}return {id:this.mirror.getId(a.node),attributes:c}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:e};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.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(l));}),v(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.childNodes(e),i=>C.textContent(i)||"").join("");t.attributes.value=jt({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Yt(e),value:r,maskInputFn:this.maskInputFn});}),v(this,"processMutation",e=>{if(!Kr(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case "characterData":{let t=C.textContent(e.target);!J(e.target,this.blockClass,this.blockSelector,false)&&t!==e.oldValue&&this.texts.push({value:Mn(e.target,this.maskTextClass,this.maskTextSelector,true)&&t?this.maskTextFn?this.maskTextFn(t,ta(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case "attributes":{let t=e.target,r=e.attributeName,i=e.target.getAttribute(r);if(r==="value"){let o=Yt(t);i=jt({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:o,value:i,maskInputFn:this.maskInputFn});}if(J(e.target,this.blockClass,this.blockSelector,false)||i===e.oldValue)return;let n=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!t.contentDocument)r="rr_src";else return;if(n||(n={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(e.target,n)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!Nn(t.tagName,r))if(n.attributes[r]=xn(this.doc,Ee(t.tagName),Ee(r),i),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument();}catch{this.unattachedDoc=this.doc;}let o=this.unattachedDoc.createElement("span");e.oldValue&&o.setAttribute("style",e.oldValue);for(let l of Array.from(t.style)){let a=t.style.getPropertyValue(l),c=t.style.getPropertyPriority(l);a!==o.style.getPropertyValue(l)||c!==o.style.getPropertyPriority(l)?c===""?n.styleDiff[l]=a:n.styleDiff[l]=[a,c]:n._unchangedStyles[l]=[a,c];}for(let l of Array.from(o.style))t.style.getPropertyValue(l)===""&&(n.styleDiff[l]=false);}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?n.attributes.rr_open_mode="modal":n.attributes.rr_open_mode="non-modal");break}case "childList":{if(J(e.target,this.blockClass,this.blockSelector,true))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{let r=this.mirror.getId(t),i=Ye(e.target)?this.mirror.getId(C.host(e.target)):this.mirror.getId(e.target);J(e.target,this.blockClass,this.blockSelector,false)||Kr(t,this.mirror,this.slimDOMOptions)||!pf(t,this.mirror)||(this.addedSet.has(t)?(Ls(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||ra(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[hn(r,i)]?Ls(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:Ye(e.target)&&Ze(e.target)?true:void 0}),vf(t,this.removesSubTreeCache))),this.mapRemoves.push(t));});break}}}),v(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Kr(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&r!==-1&&(this.movedMap[hn(this.mirror.getId(e),r)]=true);}else this.addedSet.add(e),this.droppedSet.delete(e);J(e,this.blockClass,this.blockSelector,false)||(C.childNodes(e).forEach(r=>this.genAdds(r)),Ts(e)&&C.childNodes(C.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e);}));}});}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t];});}freeze(){this.frozen=true,this.canvasManager.freeze();}unfreeze(){this.frozen=false,this.canvasManager.unfreeze(),this.emit();}isFrozen(){return this.frozen}lock(){this.locked=true,this.canvasManager.lock();}unlock(){this.locked=false,this.canvasManager.unlock(),this.emit();}reset(){this.shadowDomManager.reset(),this.canvasManager.reset();}};function Ls(s,e){s.delete(e),C.childNodes(e).forEach(t=>Ls(s,t));}function vf(s,e){let t=[s];for(;t.length;){let r=t.pop();e.has(r)||(e.add(r),C.childNodes(r).forEach(i=>t.push(i)));}}function fn(s,e,t){return s.size===0?false:wf(s,e)}function wf(s,e,t){let r=C.parentNode(e);return r?s.has(r):false}function dn(s,e){return s.size===0?false:la(s,e)}function la(s,e){let t=C.parentNode(e);return t?s.has(t)?true:la(s,t):false}var Xe;function bf(s){Xe=s;}function Sf(){Xe=void 0;}var I=s=>Xe?(...t)=>{try{return s(...t)}catch(r){if(Xe&&Xe(r)===true)return;throw r}}:s,Ce=[];function ut(s){try{if("composedPath"in s){let e=s.composedPath();if(e.length)return e[0]}else if("path"in s&&s.path.length)return s.path[0]}catch{}return s&&s.target}function ca(s,e){let t=new Ps;Ce.push(t),t.init(s);let r=new(Ko())(I(t.processMutations.bind(t)));return r.observe(e,{attributes:true,attributeOldValue:true,characterData:true,characterDataOldValue:true,childList:true,subtree:true}),r}function Cf({mousemoveCb:s,sampling:e,doc:t,mirror:r}){if(e.mousemove===false)return ()=>{};let i=typeof e.mousemove=="number"?e.mousemove:50,n=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500,o=[],l,a=nt(I(h=>{let p=Date.now()-l;s(o.map(g=>(g.timeOffset-=p,g)),h),o=[],l=null;}),n),c=I(nt(I(h=>{let p=ut(h),{clientX:g,clientY:m}=Ds(h)?h.changedTouches[0]:h;l||(l=ir()),o.push({x:g,y:m,id:r.getId(p),timeOffset:ir()-l}),a(typeof DragEvent<"u"&&h instanceof DragEvent?E.Drag:h instanceof MouseEvent?E.MouseMove:E.TouchMove);}),i,{trailing:!1})),u=[X("mousemove",c,t),X("touchmove",c,t),X("drag",c,t)];return I(()=>{u.forEach(h=>h());})}function Ef({mouseInteractionCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){if(n.mouseInteraction===false)return ()=>{};let o=n.mouseInteraction===true||n.mouseInteraction===void 0?{}:n.mouseInteraction,l=[],a=null,c=u=>h=>{let p=ut(h);if(J(p,r,i,true))return;let g=null,m=u;if("pointerType"in h){switch(h.pointerType){case "mouse":g=de.Mouse;break;case "touch":g=de.Touch;break;case "pen":g=de.Pen;break}g===de.Touch?K[u]===K.MouseDown?m="TouchStart":K[u]===K.MouseUp&&(m="TouchEnd"):de.Pen;}else Ds(h)&&(g=de.Touch);g!==null?(a=g,(m.startsWith("Touch")&&g===de.Touch||m.startsWith("Mouse")&&g===de.Mouse)&&(g=null)):K[u]===K.Click&&(g=a,a=null);let d=Ds(h)?h.changedTouches[0]:h;if(!d)return;let f=t.getId(p),{clientX:w,clientY:b}=d;I(s)({type:K[m],id:f,x:w,y:b,...g!==null&&{pointerType:g}});};return Object.keys(K).filter(u=>Number.isNaN(Number(u))&&!u.endsWith("_Departed")&&o[u]!==false).forEach(u=>{let h=Ee(u),p=c(u);if(window.PointerEvent)switch(K[u]){case K.MouseDown:case K.MouseUp:h=h.replace("mouse","pointer");break;case K.TouchStart:case K.TouchEnd:return}l.push(X(h,p,e));}),I(()=>{l.forEach(u=>u());})}function ua({scrollCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){let o=I(nt(I(l=>{let a=ut(l);if(!a||J(a,r,i,!0))return;let c=t.getId(a);if(a===e&&e.defaultView){let u=qo(e.defaultView);s({id:c,x:u.left,y:u.top});}else s({id:c,x:a.scrollLeft,y:a.scrollTop});}),n.scroll||100));return X("scroll",o,e)}function If({viewportResizeCb:s},{win:e}){let t=-1,r=-1,i=I(nt(I(()=>{let n=Qo(),o=ea();(t!==n||r!==o)&&(s({width:Number(o),height:Number(n)}),t=n,r=o);}),200));return X("resize",i,e)}var xf=["INPUT","TEXTAREA","SELECT"],pn=new WeakMap;function Nf({inputCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,ignoreClass:n,ignoreSelector:o,maskInputOptions:l,maskInputFn:a,sampling:c,userTriggeredOnInput:u}){function h(b){let y=ut(b),S=b.isTrusted,O=y&&y.tagName;if(y&&O==="OPTION"&&(y=C.parentElement(y)),!y||!O||xf.indexOf(O)<0||J(y,r,i,true)||y.classList.contains(n)||o&&y.matches(o))return;let T=y.value,V=false,L=Yt(y)||"";L==="radio"||L==="checkbox"?V=y.checked:(l[O.toLowerCase()]||l[L])&&(T=jt({element:y,maskInputOptions:l,tagName:O,type:L,value:T,maskInputFn:a})),p(y,u?{text:T,isChecked:V,userTriggered:S}:{text:T,isChecked:V});let z=y.name;L==="radio"&&z&&V&&e.querySelectorAll(`input[type="radio"][name="${z}"]`).forEach(Y=>{if(Y!==y){let Q=Y.value;p(Y,u?{text:Q,isChecked:!V,userTriggered:false}:{text:Q,isChecked:!V});}});}function p(b,y){let S=pn.get(b);if(!S||S.text!==y.text||S.isChecked!==y.isChecked){pn.set(b,y);let O=t.getId(b);I(s)({...y,id:O});}}let m=(c.input==="last"?["change"]:["input","change"]).map(b=>X(b,I(h),e)),d=e.defaultView;if(!d)return ()=>{m.forEach(b=>b());};let f=d.Object.getOwnPropertyDescriptor(d.HTMLInputElement.prototype,"value"),w=[[d.HTMLInputElement.prototype,"value"],[d.HTMLInputElement.prototype,"checked"],[d.HTMLSelectElement.prototype,"value"],[d.HTMLTextAreaElement.prototype,"value"],[d.HTMLSelectElement.prototype,"selectedIndex"],[d.HTMLOptionElement.prototype,"selected"]];return f&&f.set&&m.push(...w.map(b=>vr(b[0],b[1],{set(){I(h)({target:this,isTrusted:false});}},false,d))),I(()=>{m.forEach(b=>b());})}function nr(s){let e=[];function t(r,i){if($t("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||$t("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||$t("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||$t("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){let o=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(o);}else if(r.parentStyleSheet){let o=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(o);}return i}return t(s,e)}function ve(s,e,t){let r,i;return s?(s.ownerNode?r=e.getId(s.ownerNode):i=t.getId(s),{styleId:i,id:r}):{}}function Mf({styleSheetRuleCb:s,mirror:e,stylesheetManager:t},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return ()=>{};let i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:I((u,h,p)=>{let[g,m]=p,{id:d,styleId:f}=ve(h,e,t.styleMirror);return (d&&d!==-1||f&&f!==-1)&&s({id:d,styleId:f,adds:[{rule:g,index:m}]}),u.apply(h,p)})}),r.CSSStyleSheet.prototype.addRule=function(u,h,p=this.cssRules.length){let g=`${u} { ${h} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[g,p])};let n=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(n,{apply:I((u,h,p)=>{let[g]=p,{id:m,styleId:d}=ve(h,e,t.styleMirror);return (m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,removes:[{index:g}]}),u.apply(h,p)})}),r.CSSStyleSheet.prototype.removeRule=function(u){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[u])};let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:I((u,h,p)=>{let[g]=p,{id:m,styleId:d}=ve(h,e,t.styleMirror);return (m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,replace:g}),u.apply(h,p)})}));let l;r.CSSStyleSheet.prototype.replaceSync&&(l=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:I((u,h,p)=>{let[g]=p,{id:m,styleId:d}=ve(h,e,t.styleMirror);return (m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,replaceSync:g}),u.apply(h,p)})}));let a={};Ft("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(Ft("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),Ft("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),Ft("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));let c={};return Object.entries(a).forEach(([u,h])=>{c[u]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(c[u].insertRule,{apply:I((p,g,m)=>{let[d,f]=m,{id:w,styleId:b}=ve(g.parentStyleSheet,e,t.styleMirror);return (w&&w!==-1||b&&b!==-1)&&s({id:w,styleId:b,adds:[{rule:d,index:[...nr(g),f||0]}]}),p.apply(g,m)})}),h.prototype.deleteRule=new Proxy(c[u].deleteRule,{apply:I((p,g,m)=>{let[d]=m,{id:f,styleId:w}=ve(g.parentStyleSheet,e,t.styleMirror);return (f&&f!==-1||w&&w!==-1)&&s({id:f,styleId:w,removes:[{index:[...nr(g),d]}]}),p.apply(g,m)})});}),I(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=n,o&&(r.CSSStyleSheet.prototype.replace=o),l&&(r.CSSStyleSheet.prototype.replaceSync=l),Object.entries(a).forEach(([u,h])=>{h.prototype.insertRule=c[u].insertRule,h.prototype.deleteRule=c[u].deleteRule;});})}function ha({mirror:s,stylesheetManager:e},t){var r,i,n;let o=null;t.nodeName==="#document"?o=s.getId(t):o=s.getId(C.host(t));let l=t.nodeName==="#document"?(r=t.defaultView)==null?void 0:r.Document:(n=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:n.ShadowRoot,a=l?.prototype?Object.getOwnPropertyDescriptor(l?.prototype,"adoptedStyleSheets"):void 0;return o===null||o===-1||!l||!a?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var c;return (c=a.get)==null?void 0:c.call(this)},set(c){var u;let h=(u=a.set)==null?void 0:u.call(this,c);if(o!==null&&o!==-1)try{e.adoptStyleSheets(c,o);}catch{}return h}}),I(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set});}))}function Rf({styleDeclarationCb:s,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:i}){let n=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(n,{apply:I((l,a,c)=>{var u;let[h,p,g]=c;if(t.has(h))return n.apply(a,[h,p,g]);let{id:m,styleId:d}=ve((u=a.parentRule)==null?void 0:u.parentStyleSheet,e,r.styleMirror);return (m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,set:{property:h,value:p,priority:g},index:nr(a.parentRule)}),l.apply(a,c)})});let o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:I((l,a,c)=>{var u;let[h]=c;if(t.has(h))return o.apply(a,[h]);let{id:p,styleId:g}=ve((u=a.parentRule)==null?void 0:u.parentStyleSheet,e,r.styleMirror);return (p&&p!==-1||g&&g!==-1)&&s({id:p,styleId:g,remove:{property:h},index:nr(a.parentRule)}),l.apply(a,c)})}),I(()=>{i.CSSStyleDeclaration.prototype.setProperty=n,i.CSSStyleDeclaration.prototype.removeProperty=o;})}function Af({mediaInteractionCb:s,blockClass:e,blockSelector:t,mirror:r,sampling:i,doc:n}){let o=I(a=>nt(I(c=>{let u=ut(c);if(!u||J(u,e,t,!0))return;let{currentTime:h,volume:p,muted:g,playbackRate:m,loop:d}=u;s({type:a,id:r.getId(u),currentTime:h,volume:p,muted:g,playbackRate:m,loop:d});}),i.media||500)),l=[X("play",o(Ae.Play),n),X("pause",o(Ae.Pause),n),X("seeked",o(Ae.Seeked),n),X("volumechange",o(Ae.VolumeChange),n),X("ratechange",o(Ae.RateChange),n)];return I(()=>{l.forEach(a=>a());})}function Of({fontCb:s,doc:e}){let t=e.defaultView;if(!t)return ()=>{};let r=[],i=new WeakMap,n=t.FontFace;t.FontFace=function(a,c,u){let h=new n(a,c,u);return i.set(h,{family:a,buffer:typeof c!="string",descriptors:u,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),h};let o=Ne(e.fonts,"add",function(l){return function(a){return setTimeout(I(()=>{let c=i.get(a);c&&(s(c),i.delete(a));}),0),l.apply(this,[a])}});return r.push(()=>{t.FontFace=n;}),r.push(o),I(()=>{r.forEach(l=>l());})}function Df(s){let{doc:e,mirror:t,blockClass:r,blockSelector:i,selectionCb:n}=s,o=true,l=I(()=>{let a=e.getSelection();if(!a||o&&a?.isCollapsed)return;o=a.isCollapsed||!1;let c=[],u=a.rangeCount||0;for(let h=0;h<u;h++){let p=a.getRangeAt(h),{startContainer:g,startOffset:m,endContainer:d,endOffset:f}=p;J(g,r,i,!0)||J(d,r,i,!0)||c.push({start:t.getId(g),startOffset:m,end:t.getId(d),endOffset:f});}n({ranges:c});});return l(),X("selectionchange",l)}function Tf({doc:s,customElementCb:e}){let t=s.defaultView;return !t||!t.customElements?()=>{}:Ne(t.customElements,"define",function(i){return function(n,o,l){try{e({define:{name:n}});}catch{console.warn(`Custom element callback failed for ${n}`);}return i.apply(this,[n,o,l])}})}function kf(s,e){let{mutationCb:t,mousemoveCb:r,mouseInteractionCb:i,scrollCb:n,viewportResizeCb:o,inputCb:l,mediaInteractionCb:a,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:h,fontCb:p,selectionCb:g,customElementCb:m}=s;s.mutationCb=(...d)=>{e.mutation&&e.mutation(...d),t(...d);},s.mousemoveCb=(...d)=>{e.mousemove&&e.mousemove(...d),r(...d);},s.mouseInteractionCb=(...d)=>{e.mouseInteraction&&e.mouseInteraction(...d),i(...d);},s.scrollCb=(...d)=>{e.scroll&&e.scroll(...d),n(...d);},s.viewportResizeCb=(...d)=>{e.viewportResize&&e.viewportResize(...d),o(...d);},s.inputCb=(...d)=>{e.input&&e.input(...d),l(...d);},s.mediaInteractionCb=(...d)=>{e.mediaInteaction&&e.mediaInteaction(...d),a(...d);},s.styleSheetRuleCb=(...d)=>{e.styleSheetRule&&e.styleSheetRule(...d),c(...d);},s.styleDeclarationCb=(...d)=>{e.styleDeclaration&&e.styleDeclaration(...d),u(...d);},s.canvasMutationCb=(...d)=>{e.canvasMutation&&e.canvasMutation(...d),h(...d);},s.fontCb=(...d)=>{e.font&&e.font(...d),p(...d);},s.selectionCb=(...d)=>{e.selection&&e.selection(...d),g(...d);},s.customElementCb=(...d)=>{e.customElement&&e.customElement(...d),m(...d);};}function _f(s,e={}){let t=s.doc.defaultView;if(!t)return ()=>{};kf(s,e);let r;s.recordDOM&&(r=ca(s,s.doc));let i=Cf(s),n=Ef(s),o=ua(s),l=If(s,{win:t}),a=Nf(s),c=Af(s),u=()=>{},h=()=>{},p=()=>{},g=()=>{};s.recordDOM&&(u=Mf(s,{win:t}),h=ha(s,s.doc),p=Rf(s,{win:t}),s.collectFonts&&(g=Of(s)));let m=Df(s),d=Tf(s),f=[];for(let w of s.plugins)f.push(w.observer(w.callback,t,w.options));return I(()=>{Ce.forEach(w=>w.reset()),r?.disconnect(),i(),n(),o(),l(),a(),c(),u(),h(),p(),g(),m(),d(),f.forEach(w=>w());})}function $t(s){return typeof window[s]<"u"}function Ft(s){return !!(typeof window[s]<"u"&&window[s].prototype&&"insertRule"in window[s].prototype&&"deleteRule"in window[s].prototype)}var or=class{constructor(e){v(this,"iframeIdToRemoteIdMap",new WeakMap),v(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e;}getId(e,t,r,i){let n=r||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e),l=n.get(t);return l||(l=this.generateIdFn(),n.set(t,l),o.set(l,t)),l}getIds(e,t){let r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(n=>this.getId(e,n,r,i))}getRemoteId(e,t,r){let i=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;let n=i.get(t);return n||-1}getRemoteIds(e,t){let r=this.getRemoteIdToIdMap(e);return t.map(i=>this.getRemoteId(e,i,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}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}},$s=class{constructor(e){v(this,"iframes",new WeakMap),v(this,"crossOriginIframeMap",new WeakMap),v(this,"crossOriginIframeMirror",new or(In)),v(this,"crossOriginIframeStyleMirror"),v(this,"crossOriginIframeRootIdMap",new WeakMap),v(this,"mirror"),v(this,"mutationCb"),v(this,"wrappedEmit"),v(this,"loadListener"),v(this,"stylesheetManager"),v(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new or(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this));}addIframe(e){this.iframes.set(e,true),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e);}addLoadListener(e){this.loadListener=e;}attachIframe(e,t){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:true}),this.recordCrossOriginIframes&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument));}handleMessage(e){let t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;let i=this.crossOriginIframeMap.get(e.source);if(!i)return;let n=this.transformCrossOriginEvent(i,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout);}transformCrossOriginEvent(e,t){var r;switch(t.type){case x.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:x.IncrementalSnapshot,data:{source:E.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:true}}}case x.Meta:case x.Load:case x.DomContentLoaded:return false;case x.Plugin:return t;case x.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case x.IncrementalSnapshot:switch(t.data.source){case E.Mutation:return t.data.adds.forEach(i=>{this.replaceIds(i,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,e);let n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(i.node,n);}),t.data.removes.forEach(i=>{this.replaceIds(i,e,["parentId","id"]);}),t.data.attributes.forEach(i=>{this.replaceIds(i,e,["id"]);}),t.data.texts.forEach(i=>{this.replaceIds(i,e,["id"]);}),t;case E.Drag:case E.TouchMove:case E.MouseMove:return t.data.positions.forEach(i=>{this.replaceIds(i,e,["id"]);}),t;case E.ViewportResize:return false;case E.MediaInteraction:case E.MouseInteraction:case E.Scroll:case E.CanvasMutation:case E.Input:return this.replaceIds(t.data,e,["id"]),t;case E.StyleSheetRule:case E.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case E.Font:return t;case E.Selection:return t.data.ranges.forEach(i=>{this.replaceIds(i,e,["start","end"]);}),t;case E.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(r=t.data.styles)==null||r.forEach(i=>{this.replaceStyleIds(i,e,["styleId"]);}),t}}return false}replace(e,t,r,i){for(let n of i)!Array.isArray(t[n])&&typeof t[n]!="number"||(Array.isArray(t[n])?t[n]=e.getIds(r,t[n]):t[n]=e.getId(r,t[n]));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(r=>{this.replaceIdOnNode(r,t);});}patchRootIdOnNode(e,t){e.type!==aa.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t);});}},Fs=class{constructor(e){v(this,"shadowDoms",new WeakSet),v(this,"mutationCb"),v(this,"scrollCb"),v(this,"bypassOptions"),v(this,"mirror"),v(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(!Ze(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);let r=ca({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(ua({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(C.host(e))),this.restoreHandlers.push(ha({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e));},0);}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument);}patchAttachShadow(e,t){let r=this;this.restoreHandlers.push(Ne(e.prototype,"attachShadow",function(i){return function(n){let o=i.call(this,n),l=C.shadowRoot(this);return l&&oa(this)&&r.addShadowRoot(l,t),o}}));}reset(){this.restoreHandlers.forEach(e=>{try{e();}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet;}},Te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Pf=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(je=0;je<Te.length;je++)Pf[Te.charCodeAt(je)]=je;var je,Lf=function(s){var e=new Uint8Array(s),t,r=e.length,i="";for(t=0;t<r;t+=3)i+=Te[e[t]>>2],i+=Te[(e[t]&3)<<4|e[t+1]>>4],i+=Te[(e[t+1]&15)<<2|e[t+2]>>6],i+=Te[e[t+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i};var mn=new Map;function $f(s,e){let t=mn.get(s);return t||(t=new Map,mn.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}var fa=(s,e,t)=>{if(!s||!(pa(s,e)||typeof s=="object"))return;let r=s.constructor.name,i=$f(t,r),n=i.indexOf(s);return n===-1&&(n=i.length,i.push(s)),n};function zt(s,e,t){if(s instanceof Array)return s.map(r=>zt(r,e,t));if(s===null)return s;if(s instanceof Float32Array||s instanceof Float64Array||s instanceof Int32Array||s instanceof Uint32Array||s instanceof Uint8Array||s instanceof Uint16Array||s instanceof Int16Array||s instanceof Int8Array||s instanceof Uint8ClampedArray)return {rr_type:s.constructor.name,args:[Object.values(s)]};if(s instanceof ArrayBuffer){let r=s.constructor.name,i=Lf(s);return {rr_type:r,base64:i}}else {if(s instanceof DataView)return {rr_type:s.constructor.name,args:[zt(s.buffer,e,t),s.byteOffset,s.byteLength]};if(s instanceof HTMLImageElement){let r=s.constructor.name,{src:i}=s;return {rr_type:r,src:i}}else if(s instanceof HTMLCanvasElement){let r="HTMLImageElement",i=s.toDataURL();return {rr_type:r,src:i}}else {if(s instanceof ImageData)return {rr_type:s.constructor.name,args:[zt(s.data,e,t),s.width,s.height]};if(pa(s,e)||typeof s=="object"){let r=s.constructor.name,i=fa(s,e,t);return {rr_type:r,index:i}}}}return s}var da=(s,e,t)=>s.map(r=>zt(r,e,t)),pa=(s,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof e[i]=="function").find(i=>s instanceof e[i]);function Ff(s,e,t,r){let i=[],n=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(let o of n)try{if(typeof e.CanvasRenderingContext2D.prototype[o]!="function")continue;let l=Ne(e.CanvasRenderingContext2D.prototype,o,function(a){return function(...c){return J(this.canvas,t,r,!0)||setTimeout(()=>{let u=da(c,e,this);s(this.canvas,{type:Be["2D"],property:o,args:u});},0),a.apply(this,c)}});i.push(l);}catch{let l=vr(e.CanvasRenderingContext2D.prototype,o,{set(a){s(this.canvas,{type:Be["2D"],property:o,args:[a],setter:true});}});i.push(l);}return ()=>{i.forEach(o=>o());}}function Bf(s){return s==="experimental-webgl"?"webgl":s}function gn(s,e,t,r){let i=[];try{let n=Ne(s.HTMLCanvasElement.prototype,"getContext",function(o){return function(l,...a){if(!J(this,e,t,!0)){let c=Bf(l);if("__context"in this||(this.__context=c),r&&["webgl","webgl2"].includes(c))if(a[0]&&typeof a[0]=="object"){let u=a[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0);}else a.splice(0,1,{preserveDrawingBuffer:!0});}return o.apply(this,[l,...a])}});i.push(n);}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext");}return ()=>{i.forEach(n=>n());}}function yn(s,e,t,r,i,n){let o=[],l=Object.getOwnPropertyNames(s);for(let a of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))try{if(typeof s[a]!="function")continue;let c=Ne(s,a,function(u){return function(...h){let p=u.apply(this,h);if(fa(p,n,this),"tagName"in this.canvas&&!J(this.canvas,r,i,!0)){let g=da(h,n,this),m={type:e,property:a,args:g};t(this.canvas,m);}return p}});o.push(c);}catch{let c=vr(s,a,{set(u){t(this.canvas,{type:e,property:a,args:[u],setter:true});}});o.push(c);}return o}function Uf(s,e,t,r){let i=[];return i.push(...yn(e.WebGLRenderingContext.prototype,Be.WebGL,s,t,r,e)),typeof e.WebGL2RenderingContext<"u"&&i.push(...yn(e.WebGL2RenderingContext.prototype,Be.WebGL2,s,t,r,e)),()=>{i.forEach(n=>n());}}var ma="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Wf=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0)),vn=typeof window<"u"&&window.Blob&&new Blob([Wf(ma)],{type:"text/javascript;charset=utf-8"});function Gf(s){let e;try{if(e=vn&&(window.URL||window.webkitURL).createObjectURL(vn),!e)throw "";let t=new Worker(e,{name:s?.name});return t.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e);}),t}catch{return new Worker("data:text/javascript;base64,"+ma,{name:s?.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e);}}var Bs=class{constructor(e){v(this,"pendingCanvasMutations",new Map),v(this,"rafStamps",{latestId:0,invokeId:null}),v(this,"mirror"),v(this,"mutationCb"),v(this,"resetObservers"),v(this,"frozen",false),v(this,"locked",false),v(this,"processMutation",(a,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(c);});let{sampling:t="all",win:r,blockClass:i,blockSelector:n,recordCanvas:o,dataURLOptions:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&t==="all"&&this.initCanvasMutationObserver(r,i,n),o&&typeof t=="number"&&this.initCanvasFPSObserver(t,r,i,n,{dataURLOptions:l});}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers();}freeze(){this.frozen=true;}unfreeze(){this.frozen=false;}lock(){this.locked=true;}unlock(){this.locked=false;}initCanvasFPSObserver(e,t,r,i,n){let o=gn(t,r,i,true),l=new Map,a=new Gf;a.onmessage=m=>{let{id:d}=m.data;if(l.set(d,false),!("base64"in m.data))return;let{base64:f,type:w,width:b,height:y}=m.data;this.mutationCb({id:d,type:Be["2D"],commands:[{property:"clearRect",args:[0,0,b,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:f}],type:w}]},0,0]}]});};let c=1e3/e,u=0,h,p=()=>{let m=[];return t.document.querySelectorAll("canvas").forEach(d=>{J(d,r,i,true)||m.push(d);}),m},g=m=>{if(u&&m-u<c){h=requestAnimationFrame(g);return}u=m,p().forEach(async d=>{var f;let w=this.mirror.getId(d);if(l.get(w)||d.width===0||d.height===0)return;if(l.set(w,true),["webgl","webgl2"].includes(d.__context)){let y=d.getContext(d.__context);((f=y?.getContextAttributes())==null?void 0:f.preserveDrawingBuffer)===false&&y.clear(y.COLOR_BUFFER_BIT);}let b=await createImageBitmap(d);a.postMessage({id:w,bitmap:b,width:d.width,height:d.height,dataURLOptions:n.dataURLOptions},[b]);}),h=requestAnimationFrame(g);};h=requestAnimationFrame(g),this.resetObservers=()=>{o(),cancelAnimationFrame(h);};}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let i=gn(e,t,r,false),n=Ff(this.processMutation.bind(this),e,t,r),o=Uf(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),n(),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||t===-1)return;let i=r.map(o=>{let{type:l,...a}=o;return a}),{type:n}=r[0];this.mutationCb({id:t,type:n,commands:i}),this.pendingCanvasMutations.delete(e);}},Us=class{constructor(e){v(this,"trackedLinkElements",new WeakSet),v(this,"mutationCb"),v(this,"adoptedStyleSheetCb"),v(this,"styleMirror",new ks),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(e.length===0)return;let r={id:t,styleIds:[]},i=[];for(let n of e){let o;this.styleMirror.has(n)?o=this.styleMirror.getId(n):(o=this.styleMirror.add(n),i.push({styleId:o,rules:Array.from(n.rules||CSSRule,(l,a)=>({rule:Cn(l,n.href),index:a}))})),r.styleIds.push(o);}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r);}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet;}trackStylesheetInLinkElement(e){}},Ws=class{constructor(){v(this,"nodeMap",new WeakMap),v(this,"active",false);}inOtherBuffer(e,t){let r=this.nodeMap.get(e);return r&&Array.from(r).some(i=>i!==t)}add(e,t){this.active||(this.active=true,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=false;})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t));}destroy(){}},W,Vt,qr,ar=false;try{if(Array.from([1],s=>s*2)[0]!==2){let s=document.createElement("iframe");document.body.appendChild(s),Array.from=((wi=s.contentWindow)==null?void 0:wi.Array.from)||Array.from,document.body.removeChild(s);}}catch(s){console.debug("Unable to override Array.from",s);}var se=Va();function he(s={}){let{emit:e,checkoutEveryNms:t,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:n=null,ignoreClass:o="rr-ignore",ignoreSelector:l=null,maskTextClass:a="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=true,maskAllInputs:h,maskInputOptions:p,slimDOMOptions:g,maskInputFn:m,maskTextFn:d,hooks:f,packFn:w,sampling:b={},dataURLOptions:y={},mousemoveWait:S,recordDOM:O=true,recordCanvas:T=false,recordCrossOriginIframes:V=false,recordAfter:L=s.recordAfter==="DOMContentLoaded"?s.recordAfter:"load",userTriggeredOnInput:z=false,collectFonts:Y=false,inlineImages:Q=false,plugins:ae,keepIframeSrcFn:N=()=>false,ignoreCSSAttributes:Ue=new Set([]),errorHandler:We}=s;bf(We);let H=V?window.parent===window:true,ee=false;if(!H)try{window.parent.document&&(ee=!1);}catch{ee=true;}if(H&&!e)throw new Error("emit function is required");if(!H&&!ee)return ()=>{};S!==void 0&&b.mousemove===void 0&&(b.mousemove=S),se.reset();let we=h===true?{color:true,date:true,"datetime-local":true,email:true,month:true,number:true,range:true,search:true,tel:true,text:true,time:true,url:true,week:true,textarea:true,select:true,password:true}:p!==void 0?p:{password:true},le=Rn(g);mf();let di,Lr=0,pi=M=>{for(let re of ae||[])re.eventProcessor&&(M=re.eventProcessor(M));return w&&!ee&&(M=w(M)),M};W=(M,re)=>{var B;let U=M;if(U.timestamp=ir(),(B=Ce[0])!=null&&B.isFrozen()&&U.type!==x.FullSnapshot&&!(U.type===x.IncrementalSnapshot&&U.data.source===E.Mutation)&&Ce.forEach(q=>q.unfreeze()),H)e?.(pi(U),re);else if(ee){let q={type:"rrweb",event:pi(U),origin:window.location.origin,isCheckout:re};window.parent.postMessage(q,"*");}if(U.type===x.FullSnapshot)di=U,Lr=0;else if(U.type===x.IncrementalSnapshot){if(U.data.source===E.Mutation&&U.data.isAttachIframe)return;Lr++;let q=r&&Lr>=r,D=t&&U.timestamp-di.timestamp>t;(q||D)&&Vt(true);}};let dt=M=>{W({type:x.IncrementalSnapshot,data:{source:E.Mutation,...M}});},mi=M=>W({type:x.IncrementalSnapshot,data:{source:E.Scroll,...M}}),gi=M=>W({type:x.IncrementalSnapshot,data:{source:E.CanvasMutation,...M}}),va=M=>W({type:x.IncrementalSnapshot,data:{source:E.AdoptedStyleSheet,...M}}),be=new Us({mutationCb:dt,adoptedStyleSheetCb:va}),Se=new $s({mirror:se,mutationCb:dt,stylesheetManager:be,recordCrossOriginIframes:V,wrappedEmit:W});for(let M of ae||[])M.getMirror&&M.getMirror({nodeMirror:se,crossOriginIframeMirror:Se.crossOriginIframeMirror,crossOriginIframeStyleMirror:Se.crossOriginIframeStyleMirror});let $r=new Ws;qr=new Bs({recordCanvas:T,mutationCb:gi,win:window,blockClass:i,blockSelector:n,mirror:se,sampling:b.canvas,dataURLOptions:y});let pt=new Fs({mutationCb:dt,scrollCb:mi,bypassOptions:{blockClass:i,blockSelector:n,maskTextClass:a,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:we,dataURLOptions:y,maskTextFn:d,maskInputFn:m,recordCanvas:T,inlineImages:Q,sampling:b,slimDOMOptions:le,iframeManager:Se,stylesheetManager:be,canvasManager:qr,keepIframeSrcFn:N,processedNodeManager:$r},mirror:se});Vt=(M=false)=>{if(!O)return;W({type:x.Meta,data:{href:window.location.href,width:ea(),height:Qo()}},M),be.reset(),pt.init(),Ce.forEach(B=>B.lock());let re=pl(document,{mirror:se,blockClass:i,blockSelector:n,maskTextClass:a,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:we,maskTextFn:d,maskInputFn:m,slimDOM:le,dataURLOptions:y,recordCanvas:T,inlineImages:Q,onSerialize:B=>{sa(B,se)&&Se.addIframe(B),ia(B,se)&&be.trackLinkElement(B),Ts(B)&&pt.addShadowRoot(C.shadowRoot(B),document);},onIframeLoad:(B,U)=>{Se.attachIframe(B,U),pt.observeAttachShadow(B);},onStylesheetLoad:(B,U)=>{be.attachLinkElement(B,U);},keepIframeSrcFn:N});if(!re)return console.warn("Failed to snapshot the document");W({type:x.FullSnapshot,data:{node:re,initialOffset:qo(window)}},M),Ce.forEach(B=>B.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&be.adoptStyleSheets(document.adoptedStyleSheets,se.getId(document));};try{let M=[],re=U=>{var q;return I(_f)({mutationCb:dt,mousemoveCb:(D,Fr)=>W({type:x.IncrementalSnapshot,data:{source:Fr,positions:D}}),mouseInteractionCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.MouseInteraction,...D}}),scrollCb:mi,viewportResizeCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.ViewportResize,...D}}),inputCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.Input,...D}}),mediaInteractionCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.MediaInteraction,...D}}),styleSheetRuleCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.StyleSheetRule,...D}}),styleDeclarationCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.StyleDeclaration,...D}}),canvasMutationCb:gi,fontCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.Font,...D}}),selectionCb:D=>{W({type:x.IncrementalSnapshot,data:{source:E.Selection,...D}});},customElementCb:D=>{W({type:x.IncrementalSnapshot,data:{source:E.CustomElement,...D}});},blockClass:i,ignoreClass:o,ignoreSelector:l,maskTextClass:a,maskTextSelector:c,maskInputOptions:we,inlineStylesheet:u,sampling:b,recordDOM:O,recordCanvas:T,inlineImages:Q,userTriggeredOnInput:z,collectFonts:Y,doc:U,maskInputFn:m,maskTextFn:d,keepIframeSrcFn:N,blockSelector:n,slimDOMOptions:le,dataURLOptions:y,mirror:se,iframeManager:Se,stylesheetManager:be,shadowDomManager:pt,processedNodeManager:$r,canvasManager:qr,ignoreCSSAttributes:Ue,plugins:((q=ae?.filter(D=>D.observer))==null?void 0:q.map(D=>({observer:D.observer,options:D.options,callback:Fr=>W({type:x.Plugin,data:{plugin:D.name,payload:Fr}})})))||[]},f)};Se.addLoadListener(U=>{try{M.push(re(U.contentDocument));}catch(q){console.warn(q);}});let B=()=>{Vt(),M.push(re(document)),ar=!0;};return ["interactive","complete"].includes(document.readyState)?B():(M.push(X("DOMContentLoaded",()=>{W({type:x.DomContentLoaded,data:{}}),L==="DOMContentLoaded"&&B();})),M.push(X("load",()=>{W({type:x.Load,data:{}}),L==="load"&&B();},window))),()=>{M.forEach(U=>{try{U();}catch(q){String(q).toLowerCase().includes("cross-origin")||console.warn(q);}}),$r.destroy(),ar=!1,Sf();}}catch(M){console.warn(M);}}he.addCustomEvent=(s,e)=>{if(!ar)throw new Error("please add custom event after start recording");W({type:x.Custom,data:{tag:s,payload:e}});};he.freezePage=()=>{Ce.forEach(s=>s.freeze());};he.takeFullSnapshot=s=>{if(!ar)throw new Error("please take full snapshot after start recording");Vt(s);};he.mirror=se;var wn;(function(s){s[s.NotStarted=0]="NotStarted",s[s.Running=1]="Running",s[s.Stopped=2]="Stopped";})(wn||(wn={}));var{addCustomEvent:Fd}=he,{freezePage:Bd}=he,{takeFullSnapshot:Ud}=he;var wr=class{constructor(e,t,r){this.sessionId=e;this.emit=t;this.rrwebConfig=r;this.stopFn=null;}start(){this.stopFn=he({...this.rrwebConfig,emit:e=>{this.emit({type:"rrweb",timestamp:e.timestamp,sessionId:this.sessionId,data:e});}})??null;}takeFullSnapshot(){this.stopFn&&he.takeFullSnapshot();}stop(){this.stopFn&&(this.stopFn(),this.stopFn=null);}};var br=class{constructor(e,t){this.sessionId=e;this.emit=t;this.onErrorHandler=null;this.onRejectionHandler=null;this.previousOnError=null;}start(){this.previousOnError=window.onerror,this.onErrorHandler=(e,t,r,i,n)=>{let o={message:String(e),stack:n?.stack,source:t??void 0,lineno:r??void 0,colno:i??void 0,type:"onerror"};return this.emit({type:"error",timestamp:Date.now(),sessionId:this.sessionId,data:o}),this.previousOnError?this.previousOnError.call(window,e,t,r,i,n):false},this.onRejectionHandler=e=>{let t=e.reason,r={message:t instanceof Error?t.message:String(t),stack:t instanceof Error?t.stack:void 0,type:"unhandledrejection"};this.emit({type:"error",timestamp:Date.now(),sessionId:this.sessionId,data:r});},window.onerror=this.onErrorHandler,window.addEventListener("unhandledrejection",this.onRejectionHandler);}stop(){this.previousOnError?window.onerror=this.previousOnError:window.onerror=null,this.onRejectionHandler&&window.removeEventListener("unhandledrejection",this.onRejectionHandler),this.onErrorHandler=null,this.onRejectionHandler=null;}};var zf=/ghostplay\.dev/;var Sr=class{constructor(e,t){this.sessionId=e;this.emit=t;this.originalFetch=null;this.active=false;}start(){this.active=true,this.patchFetch();}stop(){this.active=false,this.restoreFetch();}patchFetch(){this.originalFetch=globalThis.fetch;let e=this;globalThis.fetch=async function(t,r){let i=typeof t=="string"?t:t instanceof URL?t.toString():t.url,n=r?.method??"GET";if(zf.test(i))return e.originalFetch.call(globalThis,t,r);let o=Date.now(),l=Vf(r?.headers),a=Hf(r?.body);try{let c=await e.originalFetch.call(globalThis,t,r);if(e.active){let u={};c.headers.forEach((g,m)=>{u[m]=g;});let h;try{let g=c.headers.get("content-type")??"";if(g.includes("json")||g.includes("text")){let d=await c.clone().text();h=d.length>1048576?d.substring(0,1048576)+"...[truncated]":d;}}catch{}let p={method:n.toUpperCase(),url:i,status:c.status,statusText:c.statusText,requestHeaders:l,responseHeaders:u,requestBody:a,responseBody:h,startTime:o,endTime:Date.now(),duration:Date.now()-o};e.emit({type:"network",timestamp:o,sessionId:e.sessionId,data:p});}return c}catch(c){if(e.active){let u={method:n.toUpperCase(),url:i,requestHeaders:l,requestBody:a,startTime:o,endTime:Date.now(),duration:Date.now()-o};e.emit({type:"network",timestamp:o,sessionId:e.sessionId,data:u});}throw c}};}restoreFetch(){this.originalFetch&&(globalThis.fetch=this.originalFetch,this.originalFetch=null);}};function Vf(s){let e={};if(!s)return e;if(s instanceof Headers)s.forEach((t,r)=>{e[r]=t;});else if(Array.isArray(s))for(let[t,r]of s)e[t]=r;else for(let[t,r]of Object.entries(s))e[t]=r;return e}function Hf(s){if(s){if(typeof s=="string")return s.length>1048576?s.substring(0,1048576)+"...[truncated]":s;if(s instanceof URLSearchParams)return s.toString()}}var ga=["log","warn","error","info","debug"],Cr=class{constructor(e,t){this.sessionId=e;this.emit=t;this.originals={};}start(){for(let e of ga)this.originals[e]=console[e].bind(console),console[e]=(...t)=>{let r={level:e,args:t.map(i=>this.serialize(i))};this.emit({type:"console",timestamp:Date.now(),sessionId:this.sessionId,data:r}),this.originals[e]?.(...t);};}stop(){for(let e of ga)this.originals[e]&&(console[e]=this.originals[e]);this.originals={};}serialize(e){if(e instanceof Error)return {__type:"Error",message:e.message,stack:e.stack};if(typeof e=="object"&&e!==null)try{return JSON.stringify(e),e}catch{return String(e)}return e}};var jf={LCP:[1e3,4e3],FID:[100,300],CLS:[.1,.25],TTFB:[800,1800],INP:[200,500]},Er=class{constructor(e,t){this.sessionId=e;this.emit=t;this.observers=[];}start(){typeof PerformanceObserver>"u"||(this.observeLCP(),this.observeFID(),this.observeCLS(),this.observeTTFB(),this.observeINP());}stop(){this.observers.forEach(e=>e.disconnect()),this.observers=[];}handleMetric(e,t){let[r,i]=jf[e],n=t<=r?"good":t<=i?"needs-improvement":"poor";this.emit({type:"performance",timestamp:Date.now(),sessionId:this.sessionId,data:{metric:e,value:t,rating:n}});}observeLCP(){try{let e=new PerformanceObserver(t=>{let r=t.getEntries(),i=r[r.length-1];i&&this.handleMetric("LCP",i.startTime);});e.observe({type:"largest-contentful-paint",buffered:!0}),this.observers.push(e);}catch{}}observeFID(){try{let e=new PerformanceObserver(t=>{let i=t.getEntries()[0];i&&this.handleMetric("FID",i.processingStart-i.startTime);});e.observe({type:"first-input",buffered:!0}),this.observers.push(e);}catch{}}observeCLS(){let e=0;try{let t=new PerformanceObserver(r=>{for(let i of r.getEntries())i.hadRecentInput||(e+=i.value);this.handleMetric("CLS",e);});t.observe({type:"layout-shift",buffered:!0}),this.observers.push(t);}catch{}}observeTTFB(){try{let e=new PerformanceObserver(t=>{let r=t.getEntries()[0];r&&this.handleMetric("TTFB",r.responseStart);});e.observe({type:"navigation",buffered:!0}),this.observers.push(e);}catch{}}observeINP(){try{let e=new PerformanceObserver(t=>{for(let r of t.getEntries())this.handleMetric("INP",r.duration);});e.observe({type:"event",buffered:!0}),this.observers.push(e);}catch{}}};var Ir=class{constructor(e,t){this.sessionId=e;this.emit=t;this.clickHandler=null;this.recentClicks=[];}start(){this.clickHandler=e=>{let t=e.target;if(!t)return;let r=Date.now(),i=this.recentClicks.find(n=>n.element===t);if(i||(i={element:t,timestamps:[]},this.recentClicks.push(i)),i.timestamps.push(r),i.timestamps=i.timestamps.filter(n=>r-n<1e3),i.timestamps.length>=3){let n={selector:this.getSelector(t),clickCount:i.timestamps.length,x:e.clientX,y:e.clientY};this.emit({type:"rage-click",timestamp:r,sessionId:this.sessionId,data:n}),i.timestamps=[];}this.recentClicks=this.recentClicks.filter(n=>n.timestamps.length>0);},document.addEventListener("click",this.clickHandler,true);}stop(){this.clickHandler&&(document.removeEventListener("click",this.clickHandler,true),this.clickHandler=null),this.recentClicks=[];}getSelector(e){if(e.id)return `#${e.id}`;let t=e.getAttribute("data-testid");if(t)return `[data-testid="${t}"]`;let r=e.tagName.toLowerCase(),i=e.className?`.${e.className.split(" ").filter(Boolean).join(".")}`:"";return `${r}${i}`}};var xr=class{constructor(e=50){this.maxSize=e;this.trail=[];}add(e,t,r){let i={category:e,message:t};r&&(i.data=r),this.trail.push(i),this.trail.length>this.maxSize&&(this.trail=this.trail.slice(-this.maxSize));}getTrail(){return [...this.trail]}clear(){this.trail=[];}};var Nr=class{constructor(e,t){this.sessionId=e;this.emit=t;this.currentUrl="";this.originalPushState=null;this.originalReplaceState=null;this.popstateHandler=null;this.hashchangeHandler=null;}start(){this.currentUrl=window.location.href,this.emitNavigation(null,this.currentUrl,"initial"),this.originalPushState=history.pushState.bind(history),history.pushState=(...e)=>{this.originalPushState(...e),this.handleUrlChange("pushState");},this.originalReplaceState=history.replaceState.bind(history),history.replaceState=(...e)=>{this.originalReplaceState(...e),this.handleUrlChange("replaceState");},this.popstateHandler=()=>this.handleUrlChange("popstate"),window.addEventListener("popstate",this.popstateHandler),this.hashchangeHandler=()=>this.handleUrlChange("hashchange"),window.addEventListener("hashchange",this.hashchangeHandler);}stop(){this.originalPushState&&(history.pushState=this.originalPushState,this.originalPushState=null),this.originalReplaceState&&(history.replaceState=this.originalReplaceState,this.originalReplaceState=null),this.popstateHandler&&(window.removeEventListener("popstate",this.popstateHandler),this.popstateHandler=null),this.hashchangeHandler&&(window.removeEventListener("hashchange",this.hashchangeHandler),this.hashchangeHandler=null);}handleUrlChange(e){let t=window.location.href;if(t!==this.currentUrl){let r=this.currentUrl;this.currentUrl=t,this.emitNavigation(r,t,e);}}emitNavigation(e,t,r){let i={from:e,to:t,trigger:r};this.emit({type:"navigation",timestamp:Date.now(),sessionId:this.sessionId,data:i});}};var Yf=["set-cookie"],Mr=class{constructor(e){this.options=e;}sanitizeNetworkEvent(e){let t={...e},r=this.options.networkSanitize;return t.responseHeaders&&(t.responseHeaders=this.filterHeaders(t.responseHeaders,Yf)),r&&(t.requestHeaders&&r.denyHeaders.length>0&&(t.requestHeaders=this.filterHeaders(t.requestHeaders,r.denyHeaders)),t.responseHeaders&&r.denyHeaders.length>0&&(t.responseHeaders=this.filterHeaders(t.responseHeaders,r.denyHeaders)),r.denyBodyUrls.length>0&&this.urlMatchesDeny(e.url,r.denyBodyUrls)&&(t.requestBody&&(t.requestBody="[REDACTED]"),t.responseBody&&(t.responseBody="[REDACTED]"))),t}filterHeaders(e,t){let r=t.map(n=>n.toLowerCase()),i={};for(let[n,o]of Object.entries(e))r.includes(n.toLowerCase())||(i[n]=o);return i}urlMatchesDeny(e,t){return t.some(r=>new RegExp("^"+r.replace(/\*/g,".*")+"$").test(e))}};var Rr=class{constructor(e){this.config=e;this.buffer=[];this.bufferBytes=0;this.flushTimer=null;}start(){this.flushTimer=setInterval(()=>{this.flush();},this.config.flushIntervalMs);}stop(){this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null),this.flush();}send(e){let t=JSON.stringify(e).length;this.buffer.push(e),this.bufferBytes+=t,this.bufferBytes>=this.config.flushMaxBytes&&this.flush();}flush(){if(this.buffer.length===0)return;let e=this.buffer;this.buffer=[],this.bufferBytes=0;let t={projectId:this.config.projectId,sessionId:this.config.sessionId,events:e,sentAt:Date.now()},r=JSON.stringify(t),i=`${this.config.apiUrl}/events`,n=r.length<6e4;try{fetch(i,{method:"POST",headers:{"Content-Type":"application/json","x-project-id":this.config.projectId},body:r,keepalive:n}).then(o=>{o.ok||console.warn(`[Ghostplay] Event batch rejected (${o.status})`);}).catch(()=>{this.sendBeacon(i,r);});}catch{this.sendBeacon(i,r);}}sendBeacon(e,t){typeof navigator<"u"&&navigator.sendBeacon&&navigator.sendBeacon(e,new Blob([t],{type:"application/json"}));}};var Zf="0.1.0",G=null,oe=null,ht=null,Ar=null,Or=null,Dr=null,Tr=null,kr=null,_r=null,Pr=null,hi=null,ft=null;function fi(){if(!oe)throw new Error("[Ghostplay] SDK not initialized. Call Ghostplay.init() first.")}function fe(s){_r&&s.type!=="rrweb"&&_r.add(s.type==="error"?"error":s.type==="network"?"network":s.type==="rage-click"?"click":"custom",`${s.type}: ${JSON.stringify(s.data).substring(0,100)}`),ft?.send(s);}function Xf(s){ya(),G=vi(s),oe=new mt(G.projectId);let e=oe.start();hi=new Mr({networkSanitize:G.networkSanitize}),ft=new Rr({apiUrl:G.apiUrl,projectId:G.projectId,sessionId:e.id,flushIntervalMs:G.flushIntervalMs,flushMaxBytes:G.flushMaxBytes}),ft.start(),_r=new xr,ht=new wr(e.id,fe,{maskAllInputs:G.maskAllInputs,...G.maskInputSelector?{maskInputSelector:G.maskInputSelector}:{},...G.blockSelector?{blockSelector:G.blockSelector}:{},...G.ignoreSelector?{ignoreSelector:G.ignoreSelector}:{},...G.rrwebConfig});let t=()=>{ht?.start(),setTimeout(()=>ht?.takeFullSnapshot(),3e3);};document.readyState==="complete"?requestAnimationFrame(()=>requestAnimationFrame(t)):window.addEventListener("load",()=>requestAnimationFrame(t),{once:true}),Ar=new br(e.id,fe),Ar.start(),G.recordNetwork&&(Or=new Sr(e.id,r=>{let i=hi.sanitizeNetworkEvent(r.data);fe({...r,data:i});}),Or.start()),G.recordConsole&&(Dr=new Cr(e.id,fe),Dr.start()),G.trackPerformance&&(Tr=new Er(e.id,fe),Tr.start()),G.trackRageClicks&&(kr=new Ir(e.id,fe),kr.start()),G.trackNavigation&&(Pr=new Nr(e.id,fe),Pr.start());}function Jf(s,e){fi(),oe.identify(s,e),fe({type:"identify",timestamp:Date.now(),sessionId:oe.current().id,data:{userId:s,traits:e}});}function Kf(s){fi(),oe.addTag(s),fe({type:"tag",timestamp:Date.now(),sessionId:oe.current().id,data:{tag:s}});}function qf(s){fi(),oe.setMetadata(s),fe({type:"metadata",timestamp:Date.now(),sessionId:oe.current().id,data:s});}function ya(){ht?.stop(),Ar?.stop(),Or?.stop(),Dr?.stop(),Tr?.stop(),kr?.stop(),Pr?.stop(),ft?.stop(),oe?.end(),ht=null,Ar=null,Or=null,Dr=null,Tr=null,kr=null,Pr=null,ft=null,oe=null,_r=null,hi=null,G=null;}var Qf={VERSION:Zf,init:Xf,identify:Jf,tag:Kf,setMetadata:qf,stop:ya},hp=Qf;/*! Bundled license information:
59
+ or you can use record.mirror to access the mirror instance during recording.`,cn={map:{},getId(){return console.error(Re),-1},getNode(){return console.error(Re),null},removeNodeFromMap(){console.error(Re);},has(){return console.error(Re),false},reset(){console.error(Re);}};typeof window<"u"&&window.Proxy&&window.Reflect&&(cn=new Proxy(cn,{get(s,e,t){return e==="map"&&console.error(Re),Reflect.get(s,e,t)}}));function nt(s,e,t={}){let r=null,i=0;return function(...n){let o=Date.now();!i&&t.leading===false&&(i=o);let l=e-(o-i),a=this;l<=0||l>e?(r&&(clearTimeout(r),r=null),i=o,s.apply(a,n)):!r&&t.trailing!==false&&(r=setTimeout(()=>{i=t.leading===false?0:Date.now(),r=null,s.apply(a,n);},l));}}function vr(s,e,t,r,i=window){let n=i.Object.getOwnPropertyDescriptor(s,e);return i.Object.defineProperty(s,e,r?t:{set(o){setTimeout(()=>{t.set.call(this,o);},0),n&&n.set&&n.set.call(this,o);}}),()=>vr(s,e,n||{},true)}var ir=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(ir=()=>new Date().getTime());function qo(s){var e,t,r,i;let n=s.document;return {left:n.scrollingElement?n.scrollingElement.scrollLeft:s.pageXOffset!==void 0?s.pageXOffset:n.documentElement.scrollLeft||n?.body&&((e=C.parentElement(n.body))==null?void 0:e.scrollLeft)||((t=n?.body)==null?void 0:t.scrollLeft)||0,top:n.scrollingElement?n.scrollingElement.scrollTop:s.pageYOffset!==void 0?s.pageYOffset:n?.documentElement.scrollTop||n?.body&&((r=C.parentElement(n.body))==null?void 0:r.scrollTop)||((i=n?.body)==null?void 0:i.scrollTop)||0}}function Qo(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ea(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ta(s){return s?s.nodeType===s.ELEMENT_NODE?s:C.parentElement(s):null}function J(s,e,t,r){if(!s)return false;let i=ta(s);if(!i)return false;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return !0}else if(Xt(i,e,r))return !0}catch{}return !!(t&&(i.matches(t)||r&&i.closest(t)!==null))}function pf(s,e){return e.getId(s)!==-1}function Kr(s,e,t){return s.tagName==="TITLE"&&t.headTitleMutations?true:e.getId(s)===Je}function ra(s,e){if(Ye(s))return false;let t=e.getId(s);if(!e.has(t))return true;let r=C.parentNode(s);return r&&r.nodeType===s.DOCUMENT_NODE?false:r?ra(r,e):true}function Ds(s){return !!s.changedTouches}function mf(s=window){"NodeList"in s&&!s.NodeList.prototype.forEach&&(s.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in s&&!s.DOMTokenList.prototype.forEach&&(s.DOMTokenList.prototype.forEach=Array.prototype.forEach);}function sa(s,e){return !!(s.nodeName==="IFRAME"&&e.getMeta(s))}function ia(s,e){return !!(s.nodeName==="LINK"&&s.nodeType===s.ELEMENT_NODE&&s.getAttribute&&s.getAttribute("rel")==="stylesheet"&&e.getMeta(s))}function Ts(s){return s?s instanceof Os&&"shadowRoot"in s?!!s.shadowRoot:!!C.shadowRoot(s):false}var ks=class{constructor(){v(this,"id",1),v(this,"styleIDMap",new WeakMap),v(this,"idStyleMap",new Map);}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return t===void 0?r=this.id++:r=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 na(s){var e;let t=null;return "getRootNode"in s&&((e=C.getRootNode(s))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&C.host(C.getRootNode(s))&&(t=C.host(C.getRootNode(s))),t}function gf(s){let e=s,t;for(;t=na(e);)e=t;return e}function yf(s){let e=C.ownerDocument(s);if(!e)return false;let t=gf(s);return C.contains(e,t)}function oa(s){let e=C.ownerDocument(s);return e?C.contains(e,s)||yf(s):false}var x=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(x||{}),E=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s))(E||{}),K=(s=>(s[s.MouseUp=0]="MouseUp",s[s.MouseDown=1]="MouseDown",s[s.Click=2]="Click",s[s.ContextMenu=3]="ContextMenu",s[s.DblClick=4]="DblClick",s[s.Focus=5]="Focus",s[s.Blur=6]="Blur",s[s.TouchStart=7]="TouchStart",s[s.TouchMove_Departed=8]="TouchMove_Departed",s[s.TouchEnd=9]="TouchEnd",s[s.TouchCancel=10]="TouchCancel",s))(K||{}),de=(s=>(s[s.Mouse=0]="Mouse",s[s.Pen=1]="Pen",s[s.Touch=2]="Touch",s))(de||{}),Be=(s=>(s[s["2D"]=0]="2D",s[s.WebGL=1]="WebGL",s[s.WebGL2=2]="WebGL2",s))(Be||{}),Ae=(s=>(s[s.Play=0]="Play",s[s.Pause=1]="Pause",s[s.Seeked=2]="Seeked",s[s.VolumeChange=3]="VolumeChange",s[s.RateChange=4]="RateChange",s))(Ae||{});var aa=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(aa||{});function un(s){return "__ln"in s}var _s=class{constructor(){v(this,"length",0),v(this,"head",null),v(this,"tail",null);}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=t?.next||null;return t}addNode(e){let t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&un(e.previousSibling)){let r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t);}else if(e.nextSibling&&un(e.nextSibling)&&e.nextSibling.__ln.previous){let r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t);}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++;}removeNode(e){let t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--);}},hn=(s,e)=>`${s}@${e}`,Ps=class{constructor(){v(this,"frozen",false),v(this,"locked",false),v(this,"texts",[]),v(this,"attributes",[]),v(this,"attributeMap",new WeakMap),v(this,"removes",[]),v(this,"mapRemoves",[]),v(this,"movedMap",{}),v(this,"addedSet",new Set),v(this,"movedSet",new Set),v(this,"droppedSet",new Set),v(this,"removesSubTreeCache",new Set),v(this,"mutationCb"),v(this,"blockClass"),v(this,"blockSelector"),v(this,"maskTextClass"),v(this,"maskTextSelector"),v(this,"inlineStylesheet"),v(this,"maskInputOptions"),v(this,"maskTextFn"),v(this,"maskInputFn"),v(this,"keepIframeSrcFn"),v(this,"recordCanvas"),v(this,"inlineImages"),v(this,"slimDOMOptions"),v(this,"dataURLOptions"),v(this,"doc"),v(this,"mirror"),v(this,"iframeManager"),v(this,"stylesheetManager"),v(this,"shadowDomManager"),v(this,"canvasManager"),v(this,"processedNodeManager"),v(this,"unattachedDoc"),v(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit();}),v(this,"emit",()=>{if(this.frozen||this.locked)return;let e=[],t=new Set,r=new _s,i=a=>{let c=a,u=Je;for(;u===Je;)c=c&&c.nextSibling,u=c&&this.mirror.getId(c);return u},n=a=>{let c=C.parentNode(a);if(!c||!oa(a))return;let u=false;if(a.nodeType===Node.TEXT_NODE){let m=c.tagName;if(m==="TEXTAREA")return;m==="STYLE"&&this.addedSet.has(c)&&(u=true);}let h=Ye(c)?this.mirror.getId(na(a)):this.mirror.getId(c),p=i(a);if(h===-1||p===-1)return r.addNode(a);let g=De(a,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:true,newlyAddedElement:true,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:m=>{sa(m,this.mirror)&&this.iframeManager.addIframe(m),ia(m,this.mirror)&&this.stylesheetManager.trackLinkElement(m),Ts(a)&&this.shadowDomManager.addShadowRoot(C.shadowRoot(a),this.doc);},onIframeLoad:(m,d)=>{this.iframeManager.attachIframe(m,d),this.shadowDomManager.observeAttachShadow(m);},onStylesheetLoad:(m,d)=>{this.stylesheetManager.attachLinkElement(m,d);},cssCaptured:u});g&&(e.push({parentId:h,nextId:p,node:g}),t.add(g.id));};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let a of this.movedSet)fn(this.removesSubTreeCache,a,this.mirror)&&!this.movedSet.has(C.parentNode(a))||n(a);for(let a of this.addedSet)!dn(this.droppedSet,a)&&!fn(this.removesSubTreeCache,a,this.mirror)||dn(this.movedSet,a)?n(a):this.droppedSet.add(a);let o=null;for(;r.length;){let a=null;if(o){let c=this.mirror.getId(C.parentNode(o.value)),u=i(o.value);c!==-1&&u!==-1&&(a=o);}if(!a){let c=r.tail;for(;c;){let u=c;if(c=c.previous,u){let h=this.mirror.getId(C.parentNode(u.value));if(i(u.value)===-1)continue;if(h!==-1){a=u;break}else {let g=u.value,m=C.parentNode(g);if(m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let d=C.host(m);if(this.mirror.getId(d)!==-1){a=u;break}}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}o=a.previous,r.removeNode(a.value),n(a.value);}let l={texts:this.texts.map(a=>{let c=a.node,u=C.parentNode(c);return u&&u.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(u),{id:this.mirror.getId(c),value:a.value}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{let{attributes:c}=a;if(typeof c.style=="string"){let u=JSON.stringify(a.styleDiff),h=JSON.stringify(a._unchangedStyles);u.length<c.style.length&&(u+h).split("var(").length===c.style.split("var(").length&&(c.style=a.styleDiff);}return {id:this.mirror.getId(a.node),attributes:c}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:e};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.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(l));}),v(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.childNodes(e),i=>C.textContent(i)||"").join("");t.attributes.value=jt({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Yt(e),value:r,maskInputFn:this.maskInputFn});}),v(this,"processMutation",e=>{if(!Kr(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case "characterData":{let t=C.textContent(e.target);!J(e.target,this.blockClass,this.blockSelector,false)&&t!==e.oldValue&&this.texts.push({value:Mn(e.target,this.maskTextClass,this.maskTextSelector,true)&&t?this.maskTextFn?this.maskTextFn(t,ta(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case "attributes":{let t=e.target,r=e.attributeName,i=e.target.getAttribute(r);if(r==="value"){let o=Yt(t);i=jt({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:o,value:i,maskInputFn:this.maskInputFn});}if(J(e.target,this.blockClass,this.blockSelector,false)||i===e.oldValue)return;let n=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!t.contentDocument)r="rr_src";else return;if(n||(n={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(e.target,n)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!Nn(t.tagName,r))if(n.attributes[r]=xn(this.doc,Ee(t.tagName),Ee(r),i),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument();}catch{this.unattachedDoc=this.doc;}let o=this.unattachedDoc.createElement("span");e.oldValue&&o.setAttribute("style",e.oldValue);for(let l of Array.from(t.style)){let a=t.style.getPropertyValue(l),c=t.style.getPropertyPriority(l);a!==o.style.getPropertyValue(l)||c!==o.style.getPropertyPriority(l)?c===""?n.styleDiff[l]=a:n.styleDiff[l]=[a,c]:n._unchangedStyles[l]=[a,c];}for(let l of Array.from(o.style))t.style.getPropertyValue(l)===""&&(n.styleDiff[l]=false);}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?n.attributes.rr_open_mode="modal":n.attributes.rr_open_mode="non-modal");break}case "childList":{if(J(e.target,this.blockClass,this.blockSelector,true))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{let r=this.mirror.getId(t),i=Ye(e.target)?this.mirror.getId(C.host(e.target)):this.mirror.getId(e.target);J(e.target,this.blockClass,this.blockSelector,false)||Kr(t,this.mirror,this.slimDOMOptions)||!pf(t,this.mirror)||(this.addedSet.has(t)?(Ls(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||ra(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[hn(r,i)]?Ls(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:Ye(e.target)&&Ze(e.target)?true:void 0}),vf(t,this.removesSubTreeCache))),this.mapRemoves.push(t));});break}}}),v(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Kr(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&r!==-1&&(this.movedMap[hn(this.mirror.getId(e),r)]=true);}else this.addedSet.add(e),this.droppedSet.delete(e);J(e,this.blockClass,this.blockSelector,false)||(C.childNodes(e).forEach(r=>this.genAdds(r)),Ts(e)&&C.childNodes(C.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e);}));}});}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t];});}freeze(){this.frozen=true,this.canvasManager.freeze();}unfreeze(){this.frozen=false,this.canvasManager.unfreeze(),this.emit();}isFrozen(){return this.frozen}lock(){this.locked=true,this.canvasManager.lock();}unlock(){this.locked=false,this.canvasManager.unlock(),this.emit();}reset(){this.shadowDomManager.reset(),this.canvasManager.reset();}};function Ls(s,e){s.delete(e),C.childNodes(e).forEach(t=>Ls(s,t));}function vf(s,e){let t=[s];for(;t.length;){let r=t.pop();e.has(r)||(e.add(r),C.childNodes(r).forEach(i=>t.push(i)));}}function fn(s,e,t){return s.size===0?false:wf(s,e)}function wf(s,e,t){let r=C.parentNode(e);return r?s.has(r):false}function dn(s,e){return s.size===0?false:la(s,e)}function la(s,e){let t=C.parentNode(e);return t?s.has(t)?true:la(s,t):false}var Xe;function bf(s){Xe=s;}function Sf(){Xe=void 0;}var I=s=>Xe?(...t)=>{try{return s(...t)}catch(r){if(Xe&&Xe(r)===true)return;throw r}}:s,Ce=[];function ut(s){try{if("composedPath"in s){let e=s.composedPath();if(e.length)return e[0]}else if("path"in s&&s.path.length)return s.path[0]}catch{}return s&&s.target}function ca(s,e){let t=new Ps;Ce.push(t),t.init(s);let r=new(Ko())(I(t.processMutations.bind(t)));return r.observe(e,{attributes:true,attributeOldValue:true,characterData:true,characterDataOldValue:true,childList:true,subtree:true}),r}function Cf({mousemoveCb:s,sampling:e,doc:t,mirror:r}){if(e.mousemove===false)return ()=>{};let i=typeof e.mousemove=="number"?e.mousemove:50,n=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500,o=[],l,a=nt(I(h=>{let p=Date.now()-l;s(o.map(g=>(g.timeOffset-=p,g)),h),o=[],l=null;}),n),c=I(nt(I(h=>{let p=ut(h),{clientX:g,clientY:m}=Ds(h)?h.changedTouches[0]:h;l||(l=ir()),o.push({x:g,y:m,id:r.getId(p),timeOffset:ir()-l}),a(typeof DragEvent<"u"&&h instanceof DragEvent?E.Drag:h instanceof MouseEvent?E.MouseMove:E.TouchMove);}),i,{trailing:!1})),u=[X("mousemove",c,t),X("touchmove",c,t),X("drag",c,t)];return I(()=>{u.forEach(h=>h());})}function Ef({mouseInteractionCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){if(n.mouseInteraction===false)return ()=>{};let o=n.mouseInteraction===true||n.mouseInteraction===void 0?{}:n.mouseInteraction,l=[],a=null,c=u=>h=>{let p=ut(h);if(J(p,r,i,true))return;let g=null,m=u;if("pointerType"in h){switch(h.pointerType){case "mouse":g=de.Mouse;break;case "touch":g=de.Touch;break;case "pen":g=de.Pen;break}g===de.Touch?K[u]===K.MouseDown?m="TouchStart":K[u]===K.MouseUp&&(m="TouchEnd"):de.Pen;}else Ds(h)&&(g=de.Touch);g!==null?(a=g,(m.startsWith("Touch")&&g===de.Touch||m.startsWith("Mouse")&&g===de.Mouse)&&(g=null)):K[u]===K.Click&&(g=a,a=null);let d=Ds(h)?h.changedTouches[0]:h;if(!d)return;let f=t.getId(p),{clientX:w,clientY:b}=d;I(s)({type:K[m],id:f,x:w,y:b,...g!==null&&{pointerType:g}});};return Object.keys(K).filter(u=>Number.isNaN(Number(u))&&!u.endsWith("_Departed")&&o[u]!==false).forEach(u=>{let h=Ee(u),p=c(u);if(window.PointerEvent)switch(K[u]){case K.MouseDown:case K.MouseUp:h=h.replace("mouse","pointer");break;case K.TouchStart:case K.TouchEnd:return}l.push(X(h,p,e));}),I(()=>{l.forEach(u=>u());})}function ua({scrollCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){let o=I(nt(I(l=>{let a=ut(l);if(!a||J(a,r,i,!0))return;let c=t.getId(a);if(a===e&&e.defaultView){let u=qo(e.defaultView);s({id:c,x:u.left,y:u.top});}else s({id:c,x:a.scrollLeft,y:a.scrollTop});}),n.scroll||100));return X("scroll",o,e)}function If({viewportResizeCb:s},{win:e}){let t=-1,r=-1,i=I(nt(I(()=>{let n=Qo(),o=ea();(t!==n||r!==o)&&(s({width:Number(o),height:Number(n)}),t=n,r=o);}),200));return X("resize",i,e)}var xf=["INPUT","TEXTAREA","SELECT"],pn=new WeakMap;function Nf({inputCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,ignoreClass:n,ignoreSelector:o,maskInputOptions:l,maskInputFn:a,sampling:c,userTriggeredOnInput:u}){function h(b){let y=ut(b),S=b.isTrusted,O=y&&y.tagName;if(y&&O==="OPTION"&&(y=C.parentElement(y)),!y||!O||xf.indexOf(O)<0||J(y,r,i,true)||y.classList.contains(n)||o&&y.matches(o))return;let T=y.value,V=false,L=Yt(y)||"";L==="radio"||L==="checkbox"?V=y.checked:(l[O.toLowerCase()]||l[L])&&(T=jt({element:y,maskInputOptions:l,tagName:O,type:L,value:T,maskInputFn:a})),p(y,u?{text:T,isChecked:V,userTriggered:S}:{text:T,isChecked:V});let z=y.name;L==="radio"&&z&&V&&e.querySelectorAll(`input[type="radio"][name="${z}"]`).forEach(Y=>{if(Y!==y){let Q=Y.value;p(Y,u?{text:Q,isChecked:!V,userTriggered:false}:{text:Q,isChecked:!V});}});}function p(b,y){let S=pn.get(b);if(!S||S.text!==y.text||S.isChecked!==y.isChecked){pn.set(b,y);let O=t.getId(b);I(s)({...y,id:O});}}let m=(c.input==="last"?["change"]:["input","change"]).map(b=>X(b,I(h),e)),d=e.defaultView;if(!d)return ()=>{m.forEach(b=>b());};let f=d.Object.getOwnPropertyDescriptor(d.HTMLInputElement.prototype,"value"),w=[[d.HTMLInputElement.prototype,"value"],[d.HTMLInputElement.prototype,"checked"],[d.HTMLSelectElement.prototype,"value"],[d.HTMLTextAreaElement.prototype,"value"],[d.HTMLSelectElement.prototype,"selectedIndex"],[d.HTMLOptionElement.prototype,"selected"]];return f&&f.set&&m.push(...w.map(b=>vr(b[0],b[1],{set(){I(h)({target:this,isTrusted:false});}},false,d))),I(()=>{m.forEach(b=>b());})}function nr(s){let e=[];function t(r,i){if($t("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||$t("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||$t("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||$t("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){let o=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(o);}else if(r.parentStyleSheet){let o=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(o);}return i}return t(s,e)}function ve(s,e,t){let r,i;return s?(s.ownerNode?r=e.getId(s.ownerNode):i=t.getId(s),{styleId:i,id:r}):{}}function Mf({styleSheetRuleCb:s,mirror:e,stylesheetManager:t},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return ()=>{};let i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:I((u,h,p)=>{let[g,m]=p,{id:d,styleId:f}=ve(h,e,t.styleMirror);return (d&&d!==-1||f&&f!==-1)&&s({id:d,styleId:f,adds:[{rule:g,index:m}]}),u.apply(h,p)})}),r.CSSStyleSheet.prototype.addRule=function(u,h,p=this.cssRules.length){let g=`${u} { ${h} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[g,p])};let n=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(n,{apply:I((u,h,p)=>{let[g]=p,{id:m,styleId:d}=ve(h,e,t.styleMirror);return (m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,removes:[{index:g}]}),u.apply(h,p)})}),r.CSSStyleSheet.prototype.removeRule=function(u){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[u])};let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:I((u,h,p)=>{let[g]=p,{id:m,styleId:d}=ve(h,e,t.styleMirror);return (m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,replace:g}),u.apply(h,p)})}));let l;r.CSSStyleSheet.prototype.replaceSync&&(l=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:I((u,h,p)=>{let[g]=p,{id:m,styleId:d}=ve(h,e,t.styleMirror);return (m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,replaceSync:g}),u.apply(h,p)})}));let a={};Ft("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(Ft("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),Ft("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),Ft("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));let c={};return Object.entries(a).forEach(([u,h])=>{c[u]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(c[u].insertRule,{apply:I((p,g,m)=>{let[d,f]=m,{id:w,styleId:b}=ve(g.parentStyleSheet,e,t.styleMirror);return (w&&w!==-1||b&&b!==-1)&&s({id:w,styleId:b,adds:[{rule:d,index:[...nr(g),f||0]}]}),p.apply(g,m)})}),h.prototype.deleteRule=new Proxy(c[u].deleteRule,{apply:I((p,g,m)=>{let[d]=m,{id:f,styleId:w}=ve(g.parentStyleSheet,e,t.styleMirror);return (f&&f!==-1||w&&w!==-1)&&s({id:f,styleId:w,removes:[{index:[...nr(g),d]}]}),p.apply(g,m)})});}),I(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=n,o&&(r.CSSStyleSheet.prototype.replace=o),l&&(r.CSSStyleSheet.prototype.replaceSync=l),Object.entries(a).forEach(([u,h])=>{h.prototype.insertRule=c[u].insertRule,h.prototype.deleteRule=c[u].deleteRule;});})}function ha({mirror:s,stylesheetManager:e},t){var r,i,n;let o=null;t.nodeName==="#document"?o=s.getId(t):o=s.getId(C.host(t));let l=t.nodeName==="#document"?(r=t.defaultView)==null?void 0:r.Document:(n=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:n.ShadowRoot,a=l?.prototype?Object.getOwnPropertyDescriptor(l?.prototype,"adoptedStyleSheets"):void 0;return o===null||o===-1||!l||!a?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var c;return (c=a.get)==null?void 0:c.call(this)},set(c){var u;let h=(u=a.set)==null?void 0:u.call(this,c);if(o!==null&&o!==-1)try{e.adoptStyleSheets(c,o);}catch{}return h}}),I(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set});}))}function Rf({styleDeclarationCb:s,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:i}){let n=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(n,{apply:I((l,a,c)=>{var u;let[h,p,g]=c;if(t.has(h))return n.apply(a,[h,p,g]);let{id:m,styleId:d}=ve((u=a.parentRule)==null?void 0:u.parentStyleSheet,e,r.styleMirror);return (m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,set:{property:h,value:p,priority:g},index:nr(a.parentRule)}),l.apply(a,c)})});let o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:I((l,a,c)=>{var u;let[h]=c;if(t.has(h))return o.apply(a,[h]);let{id:p,styleId:g}=ve((u=a.parentRule)==null?void 0:u.parentStyleSheet,e,r.styleMirror);return (p&&p!==-1||g&&g!==-1)&&s({id:p,styleId:g,remove:{property:h},index:nr(a.parentRule)}),l.apply(a,c)})}),I(()=>{i.CSSStyleDeclaration.prototype.setProperty=n,i.CSSStyleDeclaration.prototype.removeProperty=o;})}function Af({mediaInteractionCb:s,blockClass:e,blockSelector:t,mirror:r,sampling:i,doc:n}){let o=I(a=>nt(I(c=>{let u=ut(c);if(!u||J(u,e,t,!0))return;let{currentTime:h,volume:p,muted:g,playbackRate:m,loop:d}=u;s({type:a,id:r.getId(u),currentTime:h,volume:p,muted:g,playbackRate:m,loop:d});}),i.media||500)),l=[X("play",o(Ae.Play),n),X("pause",o(Ae.Pause),n),X("seeked",o(Ae.Seeked),n),X("volumechange",o(Ae.VolumeChange),n),X("ratechange",o(Ae.RateChange),n)];return I(()=>{l.forEach(a=>a());})}function Of({fontCb:s,doc:e}){let t=e.defaultView;if(!t)return ()=>{};let r=[],i=new WeakMap,n=t.FontFace;t.FontFace=function(a,c,u){let h=new n(a,c,u);return i.set(h,{family:a,buffer:typeof c!="string",descriptors:u,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),h};let o=Ne(e.fonts,"add",function(l){return function(a){return setTimeout(I(()=>{let c=i.get(a);c&&(s(c),i.delete(a));}),0),l.apply(this,[a])}});return r.push(()=>{t.FontFace=n;}),r.push(o),I(()=>{r.forEach(l=>l());})}function Df(s){let{doc:e,mirror:t,blockClass:r,blockSelector:i,selectionCb:n}=s,o=true,l=I(()=>{let a=e.getSelection();if(!a||o&&a?.isCollapsed)return;o=a.isCollapsed||!1;let c=[],u=a.rangeCount||0;for(let h=0;h<u;h++){let p=a.getRangeAt(h),{startContainer:g,startOffset:m,endContainer:d,endOffset:f}=p;J(g,r,i,!0)||J(d,r,i,!0)||c.push({start:t.getId(g),startOffset:m,end:t.getId(d),endOffset:f});}n({ranges:c});});return l(),X("selectionchange",l)}function Tf({doc:s,customElementCb:e}){let t=s.defaultView;return !t||!t.customElements?()=>{}:Ne(t.customElements,"define",function(i){return function(n,o,l){try{e({define:{name:n}});}catch{console.warn(`Custom element callback failed for ${n}`);}return i.apply(this,[n,o,l])}})}function kf(s,e){let{mutationCb:t,mousemoveCb:r,mouseInteractionCb:i,scrollCb:n,viewportResizeCb:o,inputCb:l,mediaInteractionCb:a,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:h,fontCb:p,selectionCb:g,customElementCb:m}=s;s.mutationCb=(...d)=>{e.mutation&&e.mutation(...d),t(...d);},s.mousemoveCb=(...d)=>{e.mousemove&&e.mousemove(...d),r(...d);},s.mouseInteractionCb=(...d)=>{e.mouseInteraction&&e.mouseInteraction(...d),i(...d);},s.scrollCb=(...d)=>{e.scroll&&e.scroll(...d),n(...d);},s.viewportResizeCb=(...d)=>{e.viewportResize&&e.viewportResize(...d),o(...d);},s.inputCb=(...d)=>{e.input&&e.input(...d),l(...d);},s.mediaInteractionCb=(...d)=>{e.mediaInteaction&&e.mediaInteaction(...d),a(...d);},s.styleSheetRuleCb=(...d)=>{e.styleSheetRule&&e.styleSheetRule(...d),c(...d);},s.styleDeclarationCb=(...d)=>{e.styleDeclaration&&e.styleDeclaration(...d),u(...d);},s.canvasMutationCb=(...d)=>{e.canvasMutation&&e.canvasMutation(...d),h(...d);},s.fontCb=(...d)=>{e.font&&e.font(...d),p(...d);},s.selectionCb=(...d)=>{e.selection&&e.selection(...d),g(...d);},s.customElementCb=(...d)=>{e.customElement&&e.customElement(...d),m(...d);};}function _f(s,e={}){let t=s.doc.defaultView;if(!t)return ()=>{};kf(s,e);let r;s.recordDOM&&(r=ca(s,s.doc));let i=Cf(s),n=Ef(s),o=ua(s),l=If(s,{win:t}),a=Nf(s),c=Af(s),u=()=>{},h=()=>{},p=()=>{},g=()=>{};s.recordDOM&&(u=Mf(s,{win:t}),h=ha(s,s.doc),p=Rf(s,{win:t}),s.collectFonts&&(g=Of(s)));let m=Df(s),d=Tf(s),f=[];for(let w of s.plugins)f.push(w.observer(w.callback,t,w.options));return I(()=>{Ce.forEach(w=>w.reset()),r?.disconnect(),i(),n(),o(),l(),a(),c(),u(),h(),p(),g(),m(),d(),f.forEach(w=>w());})}function $t(s){return typeof window[s]<"u"}function Ft(s){return !!(typeof window[s]<"u"&&window[s].prototype&&"insertRule"in window[s].prototype&&"deleteRule"in window[s].prototype)}var or=class{constructor(e){v(this,"iframeIdToRemoteIdMap",new WeakMap),v(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e;}getId(e,t,r,i){let n=r||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e),l=n.get(t);return l||(l=this.generateIdFn(),n.set(t,l),o.set(l,t)),l}getIds(e,t){let r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(n=>this.getId(e,n,r,i))}getRemoteId(e,t,r){let i=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;let n=i.get(t);return n||-1}getRemoteIds(e,t){let r=this.getRemoteIdToIdMap(e);return t.map(i=>this.getRemoteId(e,i,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}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}},$s=class{constructor(e){v(this,"iframes",new WeakMap),v(this,"crossOriginIframeMap",new WeakMap),v(this,"crossOriginIframeMirror",new or(In)),v(this,"crossOriginIframeStyleMirror"),v(this,"crossOriginIframeRootIdMap",new WeakMap),v(this,"mirror"),v(this,"mutationCb"),v(this,"wrappedEmit"),v(this,"loadListener"),v(this,"stylesheetManager"),v(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new or(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this));}addIframe(e){this.iframes.set(e,true),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e);}addLoadListener(e){this.loadListener=e;}attachIframe(e,t){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:true}),this.recordCrossOriginIframes&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument));}handleMessage(e){let t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;let i=this.crossOriginIframeMap.get(e.source);if(!i)return;let n=this.transformCrossOriginEvent(i,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout);}transformCrossOriginEvent(e,t){var r;switch(t.type){case x.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:x.IncrementalSnapshot,data:{source:E.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:true}}}case x.Meta:case x.Load:case x.DomContentLoaded:return false;case x.Plugin:return t;case x.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case x.IncrementalSnapshot:switch(t.data.source){case E.Mutation:return t.data.adds.forEach(i=>{this.replaceIds(i,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,e);let n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(i.node,n);}),t.data.removes.forEach(i=>{this.replaceIds(i,e,["parentId","id"]);}),t.data.attributes.forEach(i=>{this.replaceIds(i,e,["id"]);}),t.data.texts.forEach(i=>{this.replaceIds(i,e,["id"]);}),t;case E.Drag:case E.TouchMove:case E.MouseMove:return t.data.positions.forEach(i=>{this.replaceIds(i,e,["id"]);}),t;case E.ViewportResize:return false;case E.MediaInteraction:case E.MouseInteraction:case E.Scroll:case E.CanvasMutation:case E.Input:return this.replaceIds(t.data,e,["id"]),t;case E.StyleSheetRule:case E.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case E.Font:return t;case E.Selection:return t.data.ranges.forEach(i=>{this.replaceIds(i,e,["start","end"]);}),t;case E.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(r=t.data.styles)==null||r.forEach(i=>{this.replaceStyleIds(i,e,["styleId"]);}),t}}return false}replace(e,t,r,i){for(let n of i)!Array.isArray(t[n])&&typeof t[n]!="number"||(Array.isArray(t[n])?t[n]=e.getIds(r,t[n]):t[n]=e.getId(r,t[n]));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(r=>{this.replaceIdOnNode(r,t);});}patchRootIdOnNode(e,t){e.type!==aa.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t);});}},Fs=class{constructor(e){v(this,"shadowDoms",new WeakSet),v(this,"mutationCb"),v(this,"scrollCb"),v(this,"bypassOptions"),v(this,"mirror"),v(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(!Ze(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);let r=ca({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(ua({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(C.host(e))),this.restoreHandlers.push(ha({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e));},0);}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument);}patchAttachShadow(e,t){let r=this;this.restoreHandlers.push(Ne(e.prototype,"attachShadow",function(i){return function(n){let o=i.call(this,n),l=C.shadowRoot(this);return l&&oa(this)&&r.addShadowRoot(l,t),o}}));}reset(){this.restoreHandlers.forEach(e=>{try{e();}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet;}},Te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Pf=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(je=0;je<Te.length;je++)Pf[Te.charCodeAt(je)]=je;var je,Lf=function(s){var e=new Uint8Array(s),t,r=e.length,i="";for(t=0;t<r;t+=3)i+=Te[e[t]>>2],i+=Te[(e[t]&3)<<4|e[t+1]>>4],i+=Te[(e[t+1]&15)<<2|e[t+2]>>6],i+=Te[e[t+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i};var mn=new Map;function $f(s,e){let t=mn.get(s);return t||(t=new Map,mn.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}var fa=(s,e,t)=>{if(!s||!(pa(s,e)||typeof s=="object"))return;let r=s.constructor.name,i=$f(t,r),n=i.indexOf(s);return n===-1&&(n=i.length,i.push(s)),n};function zt(s,e,t){if(s instanceof Array)return s.map(r=>zt(r,e,t));if(s===null)return s;if(s instanceof Float32Array||s instanceof Float64Array||s instanceof Int32Array||s instanceof Uint32Array||s instanceof Uint8Array||s instanceof Uint16Array||s instanceof Int16Array||s instanceof Int8Array||s instanceof Uint8ClampedArray)return {rr_type:s.constructor.name,args:[Object.values(s)]};if(s instanceof ArrayBuffer){let r=s.constructor.name,i=Lf(s);return {rr_type:r,base64:i}}else {if(s instanceof DataView)return {rr_type:s.constructor.name,args:[zt(s.buffer,e,t),s.byteOffset,s.byteLength]};if(s instanceof HTMLImageElement){let r=s.constructor.name,{src:i}=s;return {rr_type:r,src:i}}else if(s instanceof HTMLCanvasElement){let r="HTMLImageElement",i=s.toDataURL();return {rr_type:r,src:i}}else {if(s instanceof ImageData)return {rr_type:s.constructor.name,args:[zt(s.data,e,t),s.width,s.height]};if(pa(s,e)||typeof s=="object"){let r=s.constructor.name,i=fa(s,e,t);return {rr_type:r,index:i}}}}return s}var da=(s,e,t)=>s.map(r=>zt(r,e,t)),pa=(s,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof e[i]=="function").find(i=>s instanceof e[i]);function Ff(s,e,t,r){let i=[],n=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(let o of n)try{if(typeof e.CanvasRenderingContext2D.prototype[o]!="function")continue;let l=Ne(e.CanvasRenderingContext2D.prototype,o,function(a){return function(...c){return J(this.canvas,t,r,!0)||setTimeout(()=>{let u=da(c,e,this);s(this.canvas,{type:Be["2D"],property:o,args:u});},0),a.apply(this,c)}});i.push(l);}catch{let l=vr(e.CanvasRenderingContext2D.prototype,o,{set(a){s(this.canvas,{type:Be["2D"],property:o,args:[a],setter:true});}});i.push(l);}return ()=>{i.forEach(o=>o());}}function Bf(s){return s==="experimental-webgl"?"webgl":s}function gn(s,e,t,r){let i=[];try{let n=Ne(s.HTMLCanvasElement.prototype,"getContext",function(o){return function(l,...a){if(!J(this,e,t,!0)){let c=Bf(l);if("__context"in this||(this.__context=c),r&&["webgl","webgl2"].includes(c))if(a[0]&&typeof a[0]=="object"){let u=a[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0);}else a.splice(0,1,{preserveDrawingBuffer:!0});}return o.apply(this,[l,...a])}});i.push(n);}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext");}return ()=>{i.forEach(n=>n());}}function yn(s,e,t,r,i,n){let o=[],l=Object.getOwnPropertyNames(s);for(let a of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))try{if(typeof s[a]!="function")continue;let c=Ne(s,a,function(u){return function(...h){let p=u.apply(this,h);if(fa(p,n,this),"tagName"in this.canvas&&!J(this.canvas,r,i,!0)){let g=da(h,n,this),m={type:e,property:a,args:g};t(this.canvas,m);}return p}});o.push(c);}catch{let c=vr(s,a,{set(u){t(this.canvas,{type:e,property:a,args:[u],setter:true});}});o.push(c);}return o}function Uf(s,e,t,r){let i=[];return i.push(...yn(e.WebGLRenderingContext.prototype,Be.WebGL,s,t,r,e)),typeof e.WebGL2RenderingContext<"u"&&i.push(...yn(e.WebGL2RenderingContext.prototype,Be.WebGL2,s,t,r,e)),()=>{i.forEach(n=>n());}}var ma="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Wf=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0)),vn=typeof window<"u"&&window.Blob&&new Blob([Wf(ma)],{type:"text/javascript;charset=utf-8"});function Gf(s){let e;try{if(e=vn&&(window.URL||window.webkitURL).createObjectURL(vn),!e)throw "";let t=new Worker(e,{name:s?.name});return t.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e);}),t}catch{return new Worker("data:text/javascript;base64,"+ma,{name:s?.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e);}}var Bs=class{constructor(e){v(this,"pendingCanvasMutations",new Map),v(this,"rafStamps",{latestId:0,invokeId:null}),v(this,"mirror"),v(this,"mutationCb"),v(this,"resetObservers"),v(this,"frozen",false),v(this,"locked",false),v(this,"processMutation",(a,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(c);});let{sampling:t="all",win:r,blockClass:i,blockSelector:n,recordCanvas:o,dataURLOptions:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&t==="all"&&this.initCanvasMutationObserver(r,i,n),o&&typeof t=="number"&&this.initCanvasFPSObserver(t,r,i,n,{dataURLOptions:l});}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers();}freeze(){this.frozen=true;}unfreeze(){this.frozen=false;}lock(){this.locked=true;}unlock(){this.locked=false;}initCanvasFPSObserver(e,t,r,i,n){let o=gn(t,r,i,true),l=new Map,a=new Gf;a.onmessage=m=>{let{id:d}=m.data;if(l.set(d,false),!("base64"in m.data))return;let{base64:f,type:w,width:b,height:y}=m.data;this.mutationCb({id:d,type:Be["2D"],commands:[{property:"clearRect",args:[0,0,b,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:f}],type:w}]},0,0]}]});};let c=1e3/e,u=0,h,p=()=>{let m=[];return t.document.querySelectorAll("canvas").forEach(d=>{J(d,r,i,true)||m.push(d);}),m},g=m=>{if(u&&m-u<c){h=requestAnimationFrame(g);return}u=m,p().forEach(async d=>{var f;let w=this.mirror.getId(d);if(l.get(w)||d.width===0||d.height===0)return;if(l.set(w,true),["webgl","webgl2"].includes(d.__context)){let y=d.getContext(d.__context);((f=y?.getContextAttributes())==null?void 0:f.preserveDrawingBuffer)===false&&y.clear(y.COLOR_BUFFER_BIT);}let b=await createImageBitmap(d);a.postMessage({id:w,bitmap:b,width:d.width,height:d.height,dataURLOptions:n.dataURLOptions},[b]);}),h=requestAnimationFrame(g);};h=requestAnimationFrame(g),this.resetObservers=()=>{o(),cancelAnimationFrame(h);};}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let i=gn(e,t,r,false),n=Ff(this.processMutation.bind(this),e,t,r),o=Uf(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),n(),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||t===-1)return;let i=r.map(o=>{let{type:l,...a}=o;return a}),{type:n}=r[0];this.mutationCb({id:t,type:n,commands:i}),this.pendingCanvasMutations.delete(e);}},Us=class{constructor(e){v(this,"trackedLinkElements",new WeakSet),v(this,"mutationCb"),v(this,"adoptedStyleSheetCb"),v(this,"styleMirror",new ks),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(e.length===0)return;let r={id:t,styleIds:[]},i=[];for(let n of e){let o;this.styleMirror.has(n)?o=this.styleMirror.getId(n):(o=this.styleMirror.add(n),i.push({styleId:o,rules:Array.from(n.rules||CSSRule,(l,a)=>({rule:Cn(l,n.href),index:a}))})),r.styleIds.push(o);}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r);}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet;}trackStylesheetInLinkElement(e){}},Ws=class{constructor(){v(this,"nodeMap",new WeakMap),v(this,"active",false);}inOtherBuffer(e,t){let r=this.nodeMap.get(e);return r&&Array.from(r).some(i=>i!==t)}add(e,t){this.active||(this.active=true,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=false;})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t));}destroy(){}},W,Vt,qr,ar=false;try{if(Array.from([1],s=>s*2)[0]!==2){let s=document.createElement("iframe");document.body.appendChild(s),Array.from=((wi=s.contentWindow)==null?void 0:wi.Array.from)||Array.from,document.body.removeChild(s);}}catch(s){console.debug("Unable to override Array.from",s);}var se=Va();function he(s={}){let{emit:e,checkoutEveryNms:t,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:n=null,ignoreClass:o="rr-ignore",ignoreSelector:l=null,maskTextClass:a="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=true,maskAllInputs:h,maskInputOptions:p,slimDOMOptions:g,maskInputFn:m,maskTextFn:d,hooks:f,packFn:w,sampling:b={},dataURLOptions:y={},mousemoveWait:S,recordDOM:O=true,recordCanvas:T=false,recordCrossOriginIframes:V=false,recordAfter:L=s.recordAfter==="DOMContentLoaded"?s.recordAfter:"load",userTriggeredOnInput:z=false,collectFonts:Y=false,inlineImages:Q=false,plugins:ae,keepIframeSrcFn:N=()=>false,ignoreCSSAttributes:Ue=new Set([]),errorHandler:We}=s;bf(We);let H=V?window.parent===window:true,ee=false;if(!H)try{window.parent.document&&(ee=!1);}catch{ee=true;}if(H&&!e)throw new Error("emit function is required");if(!H&&!ee)return ()=>{};S!==void 0&&b.mousemove===void 0&&(b.mousemove=S),se.reset();let we=h===true?{color:true,date:true,"datetime-local":true,email:true,month:true,number:true,range:true,search:true,tel:true,text:true,time:true,url:true,week:true,textarea:true,select:true,password:true}:p!==void 0?p:{password:true},le=Rn(g);mf();let di,Lr=0,pi=M=>{for(let re of ae||[])re.eventProcessor&&(M=re.eventProcessor(M));return w&&!ee&&(M=w(M)),M};W=(M,re)=>{var B;let U=M;if(U.timestamp=ir(),(B=Ce[0])!=null&&B.isFrozen()&&U.type!==x.FullSnapshot&&!(U.type===x.IncrementalSnapshot&&U.data.source===E.Mutation)&&Ce.forEach(q=>q.unfreeze()),H)e?.(pi(U),re);else if(ee){let q={type:"rrweb",event:pi(U),origin:window.location.origin,isCheckout:re};window.parent.postMessage(q,"*");}if(U.type===x.FullSnapshot)di=U,Lr=0;else if(U.type===x.IncrementalSnapshot){if(U.data.source===E.Mutation&&U.data.isAttachIframe)return;Lr++;let q=r&&Lr>=r,D=t&&U.timestamp-di.timestamp>t;(q||D)&&Vt(true);}};let dt=M=>{W({type:x.IncrementalSnapshot,data:{source:E.Mutation,...M}});},mi=M=>W({type:x.IncrementalSnapshot,data:{source:E.Scroll,...M}}),gi=M=>W({type:x.IncrementalSnapshot,data:{source:E.CanvasMutation,...M}}),va=M=>W({type:x.IncrementalSnapshot,data:{source:E.AdoptedStyleSheet,...M}}),be=new Us({mutationCb:dt,adoptedStyleSheetCb:va}),Se=new $s({mirror:se,mutationCb:dt,stylesheetManager:be,recordCrossOriginIframes:V,wrappedEmit:W});for(let M of ae||[])M.getMirror&&M.getMirror({nodeMirror:se,crossOriginIframeMirror:Se.crossOriginIframeMirror,crossOriginIframeStyleMirror:Se.crossOriginIframeStyleMirror});let $r=new Ws;qr=new Bs({recordCanvas:T,mutationCb:gi,win:window,blockClass:i,blockSelector:n,mirror:se,sampling:b.canvas,dataURLOptions:y});let pt=new Fs({mutationCb:dt,scrollCb:mi,bypassOptions:{blockClass:i,blockSelector:n,maskTextClass:a,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:we,dataURLOptions:y,maskTextFn:d,maskInputFn:m,recordCanvas:T,inlineImages:Q,sampling:b,slimDOMOptions:le,iframeManager:Se,stylesheetManager:be,canvasManager:qr,keepIframeSrcFn:N,processedNodeManager:$r},mirror:se});Vt=(M=false)=>{if(!O)return;W({type:x.Meta,data:{href:window.location.href,width:ea(),height:Qo()}},M),be.reset(),pt.init(),Ce.forEach(B=>B.lock());let re=pl(document,{mirror:se,blockClass:i,blockSelector:n,maskTextClass:a,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:we,maskTextFn:d,maskInputFn:m,slimDOM:le,dataURLOptions:y,recordCanvas:T,inlineImages:Q,onSerialize:B=>{sa(B,se)&&Se.addIframe(B),ia(B,se)&&be.trackLinkElement(B),Ts(B)&&pt.addShadowRoot(C.shadowRoot(B),document);},onIframeLoad:(B,U)=>{Se.attachIframe(B,U),pt.observeAttachShadow(B);},onStylesheetLoad:(B,U)=>{be.attachLinkElement(B,U);},keepIframeSrcFn:N});if(!re)return console.warn("Failed to snapshot the document");W({type:x.FullSnapshot,data:{node:re,initialOffset:qo(window)}},M),Ce.forEach(B=>B.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&be.adoptStyleSheets(document.adoptedStyleSheets,se.getId(document));};try{let M=[],re=U=>{var q;return I(_f)({mutationCb:dt,mousemoveCb:(D,Fr)=>W({type:x.IncrementalSnapshot,data:{source:Fr,positions:D}}),mouseInteractionCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.MouseInteraction,...D}}),scrollCb:mi,viewportResizeCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.ViewportResize,...D}}),inputCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.Input,...D}}),mediaInteractionCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.MediaInteraction,...D}}),styleSheetRuleCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.StyleSheetRule,...D}}),styleDeclarationCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.StyleDeclaration,...D}}),canvasMutationCb:gi,fontCb:D=>W({type:x.IncrementalSnapshot,data:{source:E.Font,...D}}),selectionCb:D=>{W({type:x.IncrementalSnapshot,data:{source:E.Selection,...D}});},customElementCb:D=>{W({type:x.IncrementalSnapshot,data:{source:E.CustomElement,...D}});},blockClass:i,ignoreClass:o,ignoreSelector:l,maskTextClass:a,maskTextSelector:c,maskInputOptions:we,inlineStylesheet:u,sampling:b,recordDOM:O,recordCanvas:T,inlineImages:Q,userTriggeredOnInput:z,collectFonts:Y,doc:U,maskInputFn:m,maskTextFn:d,keepIframeSrcFn:N,blockSelector:n,slimDOMOptions:le,dataURLOptions:y,mirror:se,iframeManager:Se,stylesheetManager:be,shadowDomManager:pt,processedNodeManager:$r,canvasManager:qr,ignoreCSSAttributes:Ue,plugins:((q=ae?.filter(D=>D.observer))==null?void 0:q.map(D=>({observer:D.observer,options:D.options,callback:Fr=>W({type:x.Plugin,data:{plugin:D.name,payload:Fr}})})))||[]},f)};Se.addLoadListener(U=>{try{M.push(re(U.contentDocument));}catch(q){console.warn(q);}});let B=()=>{Vt(),M.push(re(document)),ar=!0;};return ["interactive","complete"].includes(document.readyState)?B():(M.push(X("DOMContentLoaded",()=>{W({type:x.DomContentLoaded,data:{}}),L==="DOMContentLoaded"&&B();})),M.push(X("load",()=>{W({type:x.Load,data:{}}),L==="load"&&B();},window))),()=>{M.forEach(U=>{try{U();}catch(q){String(q).toLowerCase().includes("cross-origin")||console.warn(q);}}),$r.destroy(),ar=!1,Sf();}}catch(M){console.warn(M);}}he.addCustomEvent=(s,e)=>{if(!ar)throw new Error("please add custom event after start recording");W({type:x.Custom,data:{tag:s,payload:e}});};he.freezePage=()=>{Ce.forEach(s=>s.freeze());};he.takeFullSnapshot=s=>{if(!ar)throw new Error("please take full snapshot after start recording");Vt(s);};he.mirror=se;var wn;(function(s){s[s.NotStarted=0]="NotStarted",s[s.Running=1]="Running",s[s.Stopped=2]="Stopped";})(wn||(wn={}));var{addCustomEvent:Fd}=he,{freezePage:Bd}=he,{takeFullSnapshot:Ud}=he;var wr=class{constructor(e,t,r){this.sessionId=e;this.emit=t;this.rrwebConfig=r;this.stopFn=null;}start(){this.stopFn=he({...this.rrwebConfig,emit:e=>{this.emit({type:"rrweb",timestamp:e.timestamp,sessionId:this.sessionId,data:e});}})??null;}takeFullSnapshot(){this.stopFn&&he.takeFullSnapshot();}stop(){this.stopFn&&(this.stopFn(),this.stopFn=null);}};var br=class{constructor(e,t){this.sessionId=e;this.emit=t;this.onErrorHandler=null;this.onRejectionHandler=null;this.previousOnError=null;}start(){this.previousOnError=window.onerror,this.onErrorHandler=(e,t,r,i,n)=>{let o={message:String(e),stack:n?.stack,source:t??void 0,lineno:r??void 0,colno:i??void 0,type:"onerror"};return this.emit({type:"error",timestamp:Date.now(),sessionId:this.sessionId,data:o}),this.previousOnError?this.previousOnError.call(window,e,t,r,i,n):false},this.onRejectionHandler=e=>{let t=e.reason,r={message:t instanceof Error?t.message:String(t),stack:t instanceof Error?t.stack:void 0,type:"unhandledrejection"};this.emit({type:"error",timestamp:Date.now(),sessionId:this.sessionId,data:r});},window.onerror=this.onErrorHandler,window.addEventListener("unhandledrejection",this.onRejectionHandler);}stop(){this.previousOnError?window.onerror=this.previousOnError:window.onerror=null,this.onRejectionHandler&&window.removeEventListener("unhandledrejection",this.onRejectionHandler),this.onErrorHandler=null,this.onRejectionHandler=null;}};var zf=/ghostplay\.dev/;var Sr=class{constructor(e,t){this.sessionId=e;this.emit=t;this.originalFetch=null;this.active=false;}start(){this.active=true,this.patchFetch();}stop(){this.active=false,this.restoreFetch();}patchFetch(){this.originalFetch=globalThis.fetch;let e=this;globalThis.fetch=async function(t,r){let i=typeof t=="string"?t:t instanceof URL?t.toString():t.url,n=r?.method??"GET";if(zf.test(i))return e.originalFetch.call(globalThis,t,r);let o=Date.now(),l=Vf(r?.headers),a=Hf(r?.body);try{let c=await e.originalFetch.call(globalThis,t,r);if(e.active){let u={};c.headers.forEach((g,m)=>{u[m]=g;});let h;try{let g=c.headers.get("content-type")??"";if(g.includes("json")||g.includes("text")){let d=await c.clone().text();h=d.length>1048576?d.substring(0,1048576)+"...[truncated]":d;}}catch{}let p={method:n.toUpperCase(),url:i,status:c.status,statusText:c.statusText,requestHeaders:l,responseHeaders:u,requestBody:a,responseBody:h,startTime:o,endTime:Date.now(),duration:Date.now()-o};e.emit({type:"network",timestamp:o,sessionId:e.sessionId,data:p}),c.status>=500&&e.emit({type:"error",timestamp:Date.now(),sessionId:e.sessionId,data:{message:`HTTP ${c.status}: ${n.toUpperCase()} ${i}`,type:"onerror",source:"network-interceptor"}});}return c}catch(c){if(e.active){let u=Date.now(),h={method:n.toUpperCase(),url:i,requestHeaders:l,requestBody:a,startTime:o,endTime:u,duration:u-o};e.emit({type:"network",timestamp:o,sessionId:e.sessionId,data:h});let p=c instanceof Error?c.message:String(c);e.emit({type:"error",timestamp:u,sessionId:e.sessionId,data:{message:`Network error: ${n.toUpperCase()} ${i} \u2014 ${p}`,type:"onerror",source:"network-interceptor"}});}throw c}};}restoreFetch(){this.originalFetch&&(globalThis.fetch=this.originalFetch,this.originalFetch=null);}};function Vf(s){let e={};if(!s)return e;if(s instanceof Headers)s.forEach((t,r)=>{e[r]=t;});else if(Array.isArray(s))for(let[t,r]of s)e[t]=r;else for(let[t,r]of Object.entries(s))e[t]=r;return e}function Hf(s){if(s){if(typeof s=="string")return s.length>1048576?s.substring(0,1048576)+"...[truncated]":s;if(s instanceof URLSearchParams)return s.toString()}}var ga=["log","warn","error","info","debug"],Cr=class{constructor(e,t){this.sessionId=e;this.emit=t;this.originals={};}start(){for(let e of ga)this.originals[e]=console[e].bind(console),console[e]=(...t)=>{let r={level:e,args:t.map(i=>this.serialize(i))};this.emit({type:"console",timestamp:Date.now(),sessionId:this.sessionId,data:r}),this.originals[e]?.(...t);};}stop(){for(let e of ga)this.originals[e]&&(console[e]=this.originals[e]);this.originals={};}serialize(e){if(e instanceof Error)return {__type:"Error",message:e.message,stack:e.stack};if(typeof e=="object"&&e!==null)try{return JSON.stringify(e),e}catch{return String(e)}return e}};var jf={LCP:[1e3,4e3],FID:[100,300],CLS:[.1,.25],TTFB:[800,1800],INP:[200,500]},Er=class{constructor(e,t){this.sessionId=e;this.emit=t;this.observers=[];}start(){typeof PerformanceObserver>"u"||(this.observeLCP(),this.observeFID(),this.observeCLS(),this.observeTTFB(),this.observeINP());}stop(){this.observers.forEach(e=>e.disconnect()),this.observers=[];}handleMetric(e,t){let[r,i]=jf[e],n=t<=r?"good":t<=i?"needs-improvement":"poor";this.emit({type:"performance",timestamp:Date.now(),sessionId:this.sessionId,data:{metric:e,value:t,rating:n}});}observeLCP(){try{let e=new PerformanceObserver(t=>{let r=t.getEntries(),i=r[r.length-1];i&&this.handleMetric("LCP",i.startTime);});e.observe({type:"largest-contentful-paint",buffered:!0}),this.observers.push(e);}catch{}}observeFID(){try{let e=new PerformanceObserver(t=>{let i=t.getEntries()[0];i&&this.handleMetric("FID",i.processingStart-i.startTime);});e.observe({type:"first-input",buffered:!0}),this.observers.push(e);}catch{}}observeCLS(){let e=0;try{let t=new PerformanceObserver(r=>{for(let i of r.getEntries())i.hadRecentInput||(e+=i.value);this.handleMetric("CLS",e);});t.observe({type:"layout-shift",buffered:!0}),this.observers.push(t);}catch{}}observeTTFB(){try{let e=new PerformanceObserver(t=>{let r=t.getEntries()[0];r&&this.handleMetric("TTFB",r.responseStart);});e.observe({type:"navigation",buffered:!0}),this.observers.push(e);}catch{}}observeINP(){try{let e=new PerformanceObserver(t=>{for(let r of t.getEntries())this.handleMetric("INP",r.duration);});e.observe({type:"event",buffered:!0}),this.observers.push(e);}catch{}}};var Ir=class{constructor(e,t){this.sessionId=e;this.emit=t;this.clickHandler=null;this.recentClicks=[];}start(){this.clickHandler=e=>{let t=e.target;if(!t)return;let r=Date.now(),i=this.recentClicks.find(n=>n.element===t);if(i||(i={element:t,timestamps:[]},this.recentClicks.push(i)),i.timestamps.push(r),i.timestamps=i.timestamps.filter(n=>r-n<1e3),i.timestamps.length>=3){let n={selector:this.getSelector(t),clickCount:i.timestamps.length,x:e.clientX,y:e.clientY};this.emit({type:"rage-click",timestamp:r,sessionId:this.sessionId,data:n}),i.timestamps=[];}this.recentClicks=this.recentClicks.filter(n=>n.timestamps.length>0);},document.addEventListener("click",this.clickHandler,true);}stop(){this.clickHandler&&(document.removeEventListener("click",this.clickHandler,true),this.clickHandler=null),this.recentClicks=[];}getSelector(e){if(e.id)return `#${e.id}`;let t=e.getAttribute("data-testid");if(t)return `[data-testid="${t}"]`;let r=e.tagName.toLowerCase(),i=e.className?`.${e.className.split(" ").filter(Boolean).join(".")}`:"";return `${r}${i}`}};var xr=class{constructor(e=50){this.maxSize=e;this.trail=[];}add(e,t,r){let i={category:e,message:t};r&&(i.data=r),this.trail.push(i),this.trail.length>this.maxSize&&(this.trail=this.trail.slice(-this.maxSize));}getTrail(){return [...this.trail]}clear(){this.trail=[];}};var Nr=class{constructor(e,t){this.sessionId=e;this.emit=t;this.currentUrl="";this.originalPushState=null;this.originalReplaceState=null;this.popstateHandler=null;this.hashchangeHandler=null;}start(){this.currentUrl=window.location.href,this.emitNavigation(null,this.currentUrl,"initial"),this.originalPushState=history.pushState.bind(history),history.pushState=(...e)=>{this.originalPushState(...e),this.handleUrlChange("pushState");},this.originalReplaceState=history.replaceState.bind(history),history.replaceState=(...e)=>{this.originalReplaceState(...e),this.handleUrlChange("replaceState");},this.popstateHandler=()=>this.handleUrlChange("popstate"),window.addEventListener("popstate",this.popstateHandler),this.hashchangeHandler=()=>this.handleUrlChange("hashchange"),window.addEventListener("hashchange",this.hashchangeHandler);}stop(){this.originalPushState&&(history.pushState=this.originalPushState,this.originalPushState=null),this.originalReplaceState&&(history.replaceState=this.originalReplaceState,this.originalReplaceState=null),this.popstateHandler&&(window.removeEventListener("popstate",this.popstateHandler),this.popstateHandler=null),this.hashchangeHandler&&(window.removeEventListener("hashchange",this.hashchangeHandler),this.hashchangeHandler=null);}handleUrlChange(e){let t=window.location.href;if(t!==this.currentUrl){let r=this.currentUrl;this.currentUrl=t,this.emitNavigation(r,t,e);}}emitNavigation(e,t,r){let i={from:e,to:t,trigger:r};this.emit({type:"navigation",timestamp:Date.now(),sessionId:this.sessionId,data:i});}};var Yf=["set-cookie"],Mr=class{constructor(e){this.options=e;}sanitizeNetworkEvent(e){let t={...e},r=this.options.networkSanitize;return t.responseHeaders&&(t.responseHeaders=this.filterHeaders(t.responseHeaders,Yf)),r&&(t.requestHeaders&&r.denyHeaders.length>0&&(t.requestHeaders=this.filterHeaders(t.requestHeaders,r.denyHeaders)),t.responseHeaders&&r.denyHeaders.length>0&&(t.responseHeaders=this.filterHeaders(t.responseHeaders,r.denyHeaders)),r.denyBodyUrls.length>0&&this.urlMatchesDeny(e.url,r.denyBodyUrls)&&(t.requestBody&&(t.requestBody="[REDACTED]"),t.responseBody&&(t.responseBody="[REDACTED]"))),t}filterHeaders(e,t){let r=t.map(n=>n.toLowerCase()),i={};for(let[n,o]of Object.entries(e))r.includes(n.toLowerCase())||(i[n]=o);return i}urlMatchesDeny(e,t){return t.some(r=>new RegExp("^"+r.replace(/\*/g,".*")+"$").test(e))}};var Rr=class{constructor(e){this.config=e;this.buffer=[];this.bufferBytes=0;this.flushTimer=null;}start(){this.flushTimer=setInterval(()=>{this.flush();},this.config.flushIntervalMs);}stop(){this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null),this.flush();}send(e){let t=JSON.stringify(e).length;this.buffer.push(e),this.bufferBytes+=t,this.bufferBytes>=this.config.flushMaxBytes&&this.flush();}flush(){if(this.buffer.length===0)return;let e=this.buffer;this.buffer=[],this.bufferBytes=0;let t={projectId:this.config.projectId,sessionId:this.config.sessionId,events:e,sentAt:Date.now()},r=JSON.stringify(t),i=`${this.config.apiUrl}/events`,n=r.length<6e4;try{fetch(i,{method:"POST",headers:{"Content-Type":"application/json","x-project-id":this.config.projectId},body:r,keepalive:n}).then(o=>{o.ok||console.warn(`[Ghostplay] Event batch rejected (${o.status})`);}).catch(()=>{this.sendBeacon(i,r);});}catch{this.sendBeacon(i,r);}}sendBeacon(e,t){typeof navigator<"u"&&navigator.sendBeacon&&navigator.sendBeacon(e,new Blob([t],{type:"application/json"}));}};var Zf="0.1.0",G=null,oe=null,ht=null,Ar=null,Or=null,Dr=null,Tr=null,kr=null,_r=null,Pr=null,hi=null,ft=null;function fi(){if(!oe)throw new Error("[Ghostplay] SDK not initialized. Call Ghostplay.init() first.")}function fe(s){_r&&s.type!=="rrweb"&&_r.add(s.type==="error"?"error":s.type==="network"?"network":s.type==="rage-click"?"click":"custom",`${s.type}: ${JSON.stringify(s.data).substring(0,100)}`),ft?.send(s);}function Xf(s){ya(),G=vi(s),oe=new mt(G.projectId);let e=oe.start();hi=new Mr({networkSanitize:G.networkSanitize}),ft=new Rr({apiUrl:G.apiUrl,projectId:G.projectId,sessionId:e.id,flushIntervalMs:G.flushIntervalMs,flushMaxBytes:G.flushMaxBytes}),ft.start(),_r=new xr,ht=new wr(e.id,fe,{maskAllInputs:G.maskAllInputs,...G.maskInputSelector?{maskInputSelector:G.maskInputSelector}:{},...G.blockSelector?{blockSelector:G.blockSelector}:{},...G.ignoreSelector?{ignoreSelector:G.ignoreSelector}:{},...G.rrwebConfig});let t=()=>{ht?.start(),setTimeout(()=>ht?.takeFullSnapshot(),3e3);};document.readyState==="complete"?requestAnimationFrame(()=>requestAnimationFrame(t)):window.addEventListener("load",()=>requestAnimationFrame(t),{once:true}),Ar=new br(e.id,fe),Ar.start(),G.recordNetwork&&(Or=new Sr(e.id,r=>{let i=hi.sanitizeNetworkEvent(r.data);fe({...r,data:i});}),Or.start()),G.recordConsole&&(Dr=new Cr(e.id,fe),Dr.start()),G.trackPerformance&&(Tr=new Er(e.id,fe),Tr.start()),G.trackRageClicks&&(kr=new Ir(e.id,fe),kr.start()),G.trackNavigation&&(Pr=new Nr(e.id,fe),Pr.start());}function Jf(s,e){fi(),oe.identify(s,e),fe({type:"identify",timestamp:Date.now(),sessionId:oe.current().id,data:{userId:s,traits:e}});}function Kf(s){fi(),oe.addTag(s),fe({type:"tag",timestamp:Date.now(),sessionId:oe.current().id,data:{tag:s}});}function qf(s){fi(),oe.setMetadata(s),fe({type:"metadata",timestamp:Date.now(),sessionId:oe.current().id,data:s});}function ya(){ht?.stop(),Ar?.stop(),Or?.stop(),Dr?.stop(),Tr?.stop(),kr?.stop(),Pr?.stop(),ft?.stop(),oe?.end(),ht=null,Ar=null,Or=null,Dr=null,Tr=null,kr=null,Pr=null,ft=null,oe=null,_r=null,hi=null,G=null;}var Qf={VERSION:Zf,init:Xf,identify:Jf,tag:Kf,setMetadata:qf,stop:ya},hp=Qf;/*! Bundled license information:
60
60
 
61
61
  rrweb/dist/rrweb.js:
62
62
  (*! *****************************************************************************