@appsurify-testmap/rrweb 3.4.0-alpha.1 → 3.5.0-alpha.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.
- package/dist/rrweb.cjs +3 -5
- package/dist/rrweb.cjs.map +1 -1
- package/dist/rrweb.js +3 -5
- package/dist/rrweb.js.map +1 -1
- package/dist/rrweb.umd.cjs +3 -5
- package/dist/rrweb.umd.cjs.map +2 -2
- package/dist/rrweb.umd.min.cjs +2 -2
- package/dist/rrweb.umd.min.cjs.map +2 -2
- package/package.json +5 -5
package/dist/rrweb.umd.min.cjs
CHANGED
|
@@ -76,7 +76,7 @@ Common causes:
|
|
|
76
76
|
2. Element from one iframe, root from another
|
|
77
77
|
3. Element from main document, root from iframe (or vice versa)
|
|
78
78
|
|
|
79
|
-
Solution: Ensure element and root parameter are from the same document context.`)}function Tg(i,e={}){var j,J,ie,N;var t;if(!i||!i.ownerDocument||!i.isConnected)return null;const s=A(A({},eg),e);if(s.root)try{Rg(i,s.root)}catch(F){return console.error("Cross-document generation detected:",F),null}const r=(j=s.cache)!=null?j:Ng(),n=r.getEID(i);if(n!==void 0)return n;if(i.tagName.toLowerCase()==="html"){const F=new $o(s,r),W=$g(i,s,F);return r.setEID(i,W),W}const o=new tg(s,r),l=new ag(s,r),a=new $o(s,r),c=new xg,u=o.findAnchor(i);if(!u&&!s.fallbackToBody)return null;const h=(ie=(J=u==null?void 0:u.element)!=null?J:(t=i.ownerDocument)==null?void 0:t.body)!=null?ie:null;if(!h)return null;const d=!u||u.tier==="C",f=h.tagName.toLowerCase(),m=h.parentElement;let y;if(m&&f!=="body"&&f!=="html"){const F=Array.from(m.children).indexOf(h);F!==-1&&(y=F+1)}const p=a.extract(h),g={tag:h.tagName.toLowerCase(),semantics:p,score:(N=u==null?void 0:u.score)!=null?N:Ae.DEGRADED_SCORE,degraded:d,nthChild:y},S=l.buildPath(h,i,a),v=a.extract(i);s.enableSvgFingerprint&&Og(i)&&(v.svg=c.fingerprint(i));const w=i.parentElement;let C;if(w){const F=Array.from(w.children).indexOf(i);F!==-1&&(C=F+1)}const x={tag:i.tagName.toLowerCase(),semantics:v,score:a.scoreElement(i),nthChild:C},R=[],T={onMultiple:"best-score",onMissing:"anchor-only",maxDepth:3},z=g.degraded||S.degraded,U=Dg(g.degraded,S),P={version:"1.0",anchor:g,path:S.path,target:x,constraints:R,fallback:T,meta:{confidence:0,generatedAt:new Date().toISOString(),generator:"dom-eid@1.0",source:s.source,degraded:z,degradationReason:U}};return P.meta.confidence=Eg(P),P.meta.confidence<s.confidenceThreshold?null:(r.setEID(i,P),P)}function Og(i){return i.namespaceURI==="http://www.w3.org/2000/svg"||i.tagName.toLowerCase()==="svg"||i instanceof SVGElement}function Dg(i,e){if(i&&e.degraded)return"anchor-and-path-degraded";if(i)return"no-semantic-anchor";if(e.degraded)return e.degradationReason}function $g(i,e,t,s){const r={tag:"html",semantics:t.extract(i),score:1,degraded:!1,nthChild:void 0};return{version:"1.0",anchor:r,path:[],target:r,constraints:[],fallback:{onMultiple:"best-score",onMissing:"anchor-only",maxDepth:3},meta:{confidence:1,generatedAt:new Date().toISOString(),generator:"dom-eid@1.0",source:e.source,degraded:!1,degradationReason:void 0}}}const ec={maxClasses:2,maxAttributes:5,includeText:!0,maxTextLength:50,simplifyTarget:!0,includeConstraints:!0};function _o(i){return i==="id"?101:Ve[i]!==void 0?Ve[i]:i.startsWith("data-")?Ve["data-*"]:i.startsWith("aria-")?Ve["aria-*"]:0}function kg(i){return["id","data-testid","data-qa","data-cy","href","text","role"].includes(i)}function _g(i){return!!(/@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/.test(i)||/(\+?\d{1,3}[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}/.test(i)||/\d{4}[-\s]?\d{4}[-\s]?\d{4}[-\s]?\d{4}/.test(i))}function Lg(i,e){const t=A(A({},ec),e),s=`v${i.version}`,r=_i(i.anchor,!1,t),n=i.path.length>0?i.path.map(a=>_i(a,!1,t)).join(" > ")+" > ":"",o=_i(i.target,!0,t),l=t.includeConstraints?Pg(i):"";return`${s}: ${r} :: ${n}${o}${l}`}function _i(i,e=!1,t=ec){const{tag:s,semantics:r}=i;let n=s;const o=[],l=A({},r.attributes);r.id&&(l.id=r.id),r.role&&!l.role&&(l.role=r.role);const a=Object.entries(l).map(([h,d])=>{const f=_o(h),m=h==="href"||h==="src"?Ql(h,d):d;return{name:h,value:m,priority:f}}).filter(h=>h.name!=="id"&&h.name!=="class"&&Jl.has(h.name)||ql.has(h.name)&&Kl(h.value)?!1:h.priority>0||h.name==="role"||h.name==="id");a.sort((h,d)=>d.priority-h.priority);const c=a.slice(0,t.maxAttributes);c.sort((h,d)=>h.name.localeCompare(d.name));for(const{name:h,value:d}of c)o.push(`${h}="${Cr(d)}"`);if(t.includeText&&r.text&&!_g(r.text.normalized)){const h=r.text.normalized;h.length>0&&h.length<=t.maxTextLength&&o.push(`text="${Cr(h)}"`)}let u=o;if(o.length>0&&(e&&t.simplifyTarget&&r.id&&(u=o.filter(h=>{const d=h.split("=")[0];return _o(d)>=60||d==="text"||d==="id"||d==="role"})),u.length>0&&u.sort((h,d)=>h.localeCompare(d))),r.classes&&r.classes.length>0){const h=ng(r.classes),d=!!r.id||o.some(f=>f.startsWith("href=")||f.startsWith("data-testid=")||f.startsWith("text=")||f.startsWith("role="));if(!(e&&t.simplifyTarget&&d)&&h.length>0){const f=h.sort().slice(0,t.maxClasses);n+=f.map(m=>`.${m}`).join("")}}if(u.length>0&&(n+=`[${u.join(",")}]`),"nthChild"in i&&i.nthChild){const h=!!r.id||r.attributes&&Object.keys(r.attributes).some(kg);e&&t.simplifyTarget&&h||(n+=`#${i.nthChild}`)}return n}function Pg(i){if(!i.constraints||i.constraints.length===0)return"";const e=[];for(const t of i.constraints)switch(t.type){case"uniqueness":e.push("unique=true");break;case"position":t.params&&t.params.strategy&&e.push(`pos=${t.params.strategy}`);break;case"text-proximity":if(t.params&&t.params.reference){const s=Cr(String(t.params.reference));e.push(`text="${s}"`)}break}return e.length===0?"":` {${e.join(",")}}`}function Cr(i){return i.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/>/g,"\\>").replace(/:/g,"\\:")}function Fg(i,e,t){const s=Tg(i,e);return s?Lg(s,t):null}const It={maxPathDepth:10,enableSvgFingerprint:!0,confidenceThreshold:0,fallbackToBody:!0};function zg(i){var e,t,s,r;return i===!1?null:i===!0||i===void 0?A({},It):{maxPathDepth:(e=i.maxPathDepth)!=null?e:It.maxPathDepth,enableSvgFingerprint:(t=i.enableSvgFingerprint)!=null?t:It.enableSvgFingerprint,confidenceThreshold:(s=i.confidenceThreshold)!=null?s:It.confidenceThreshold,fallbackToBody:(r=i.fallbackToBody)!=null?r:It.fallbackToBody}}function Lo(i,e,t,s){const r=e.getMeta(i),n=r==null?void 0:r.selector;if(n&&!(s!=null&&s.force))return n;const o=i.nodeType===Node.ELEMENT_NODE?i:hi(i);if(!o)return n;const l=e.getMeta(o),a=l==null?void 0:l.selector;if(a&&!(s!=null&&s.force))return a;if(!t)return a!=null?a:n;const c={maxPathDepth:t.maxPathDepth,enableSvgFingerprint:t.enableSvgFingerprint,fallbackToBody:t.fallbackToBody};try{const u=Fg(o,c);if(u)return l?l.selector=u:r&&(r.selector=u),u}catch(u){}return a!=null?a:n}function Po(i){return"__ln"in i}class Bg{constructor(){b(this,"length",0),b(this,"head",null),b(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let s=0;s<e;s++)t=(t==null?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Po(e.previousSibling)){const s=e.previousSibling.__ln.next;t.next=s,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,s&&(s.previous=t)}else if(e.nextSibling&&Po(e.nextSibling)&&e.nextSibling.__ln.previous){const s=e.nextSibling.__ln.previous;t.previous=s,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,s&&(s.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){const 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--)}}const Fo=(i,e)=>`${i}@${e}`,Wg=new Set(["id","class","name","role","title","alt","placeholder","for","type"]);function Ug(i){const e=i.toLowerCase();return Wg.has(e)||e.startsWith("data-")||e.startsWith("aria-")}class Vg{constructor(){b(this,"frozen",!1),b(this,"locked",!1),b(this,"texts",[]),b(this,"attributes",[]),b(this,"attributeMap",new WeakMap),b(this,"removes",[]),b(this,"mapRemoves",[]),b(this,"movedMap",{}),b(this,"addedSet",new Set),b(this,"movedSet",new Set),b(this,"droppedSet",new Set),b(this,"removesSubTreeCache",new Set),b(this,"mutationCb"),b(this,"blockClass"),b(this,"blockSelector"),b(this,"maskTextClass"),b(this,"maskTextSelector"),b(this,"excludeAttribute"),b(this,"inlineStylesheet"),b(this,"maskInputOptions"),b(this,"maskTextFn"),b(this,"maskInputFn"),b(this,"keepIframeSrcFn"),b(this,"recordCanvas"),b(this,"inlineImages"),b(this,"slimDOMOptions"),b(this,"dataURLOptions"),b(this,"selectorOptions",null),b(this,"doc"),b(this,"mirror"),b(this,"iframeManager"),b(this,"stylesheetManager"),b(this,"shadowDomManager"),b(this,"canvasManager"),b(this,"processedNodeManager"),b(this,"unattachedDoc"),b(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),b(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,s=new Bg,r=a=>{let c=a,u=Lt;for(;u===Lt;)c=c&&c.nextSibling,u=c&&this.mirror.getId(c);return u},n=a=>{const c=k.parentNode(a);if(!c||!mn(a))return;let u=!1;if(a.nodeType===Node.TEXT_NODE){const m=c.tagName;if(m==="TEXTAREA")return;m==="STYLE"&&this.addedSet.has(c)&&(u=!0)}const h=Ot(c)?this.mirror.getId(pn(a)):this.mirror.getId(c),d=r(a);if(h===-1||d===-1)return s.addNode(a);const f=nt(a,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,excludeAttribute:this.excludeAttribute,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:m=>{ct(m,this.mirror)&&this.iframeManager.addIframe(m),hn(m,this.mirror)&&this.stylesheetManager.trackLinkElement(m),Ue(a)&&this.shadowDomManager.addShadowRoot(k.shadowRoot(a),this.doc)},onIframeLoad:(m,y)=>{this.iframeManager.attachIframe(m,y),this.shadowDomManager.observeAttachShadow(m)},onStylesheetLoad:(m,y)=>{this.stylesheetManager.attachLinkElement(m,y)},cssCaptured:u,selectorOptions:this.selectorOptions});f&&(e.push({parentId:h,nextId:d,node:f}),t.add(f.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)zo(this.removesSubTreeCache,a,this.mirror)&&!this.movedSet.has(k.parentNode(a))||n(a);for(const a of this.addedSet)!Bo(this.droppedSet,a)&&!zo(this.removesSubTreeCache,a,this.mirror)||Bo(this.movedSet,a)?n(a):this.droppedSet.add(a);let o=null;for(;s.length;){let a=null;if(o){const c=this.mirror.getId(k.parentNode(o.value)),u=r(o.value);c!==-1&&u!==-1&&(a=o)}if(!a){let c=s.tail;for(;c;){const u=c;if(c=c.previous,u){const h=this.mirror.getId(k.parentNode(u.value));if(r(u.value)===-1)continue;if(h!==-1){a=u;break}else{const f=u.value,m=k.parentNode(f);if(m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const y=k.host(m);if(this.mirror.getId(y)!==-1){a=u;break}}}}}}if(!a){for(;s.head;)s.removeNode(s.head.value);break}o=a.previous,s.removeNode(a.value),n(a.value)}const l={texts:this.texts.map(a=>{const c=a.node,u=k.parentNode(c);return u&&u.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(u),{id:this.mirror.getId(c),value:a.value,selector:Lo(c,this.mirror,this.selectorOptions)}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{const{attributes:c}=a;if(typeof c.style=="string"){const 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,selector:Lo(a.node,this.mirror,this.selectorOptions,{force:Object.keys(c).some(Ug)})}}).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))}),b(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));const s=Array.from(k.childNodes(e),r=>k.textContent(r)||"").join("");t.attributes.value=ks({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:_s(e),value:s,maskInputFn:this.maskInputFn})}),b(this,"processMutation",e=>{if(!Ds(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=k.textContent(e.target);!le(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:ma(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,hi(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let s=e.attributeName,r=e.target.getAttribute(s);const o=t[s],l=typeof o=="boolean",a=document.contains(t),c=Nr(t),u=Ui(s,this.excludeAttribute);if(r===null&&!t.hasAttribute(s)&&e.oldValue!==null&&(o===""||o===null||typeof o=="undefined")){console.debug(`[${ye()}] [rrweb:record/mutation] \u26D4 phantom attribute mutation ignored`,{node:k.describeNode(t),tag:t.tagName,nodeType:t.nodeType,attribute:s,value:r,oldValue:e.oldValue,excludeAttribute:this.excludeAttribute,propValue:o,isBooleanAttr:l,inDOM:a,isVisible:c,isExcludeAttributeName:u});return}if(Ui(s,this.excludeAttribute)){console.debug(`[${ye()}] [rrweb:record/mutation] \u26D4 excluded attribute mutation ignored`,{node:k.describeNode(t),tag:t.tagName,nodeType:t.nodeType,attribute:s,value:r,oldValue:e.oldValue,excludeAttribute:this.excludeAttribute,propValue:o,isBooleanAttr:l,inDOM:a,isVisible:c,isExcludeAttributeName:u});return}if(s==="value"){const f=_s(t);r=ks({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:f,value:r,maskInputFn:this.maskInputFn})}if(le(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue)return;let d=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&s==="src"&&!this.keepIframeSrcFn(r))if(!t.contentDocument)s="rr_src";else return;if(d||(d={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(d),this.attributeMap.set(e.target,d)),s==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!pa(t.tagName,s))if(d.attributes[s]=fa(this.doc,Ge(t.tagName),Ge(s),r),s!=="class"&&(e.oldValue===null||r===""||r!==e.oldValue)&&console.debug(`[${ye()}] [rrweb:record/mutation] \u26A0\uFE0F suspicious attribute mutation`,{reason:[r===e.oldValue?"no change in value":null,r===o?"mirrored in DOM property":null,r===d.attributes[s]?"redundant assignment":null].filter(Boolean).join(", ")||"uncategorized",node:k.describeNode(t),tag:t.tagName,nodeType:t.nodeType,attribute:s,value:r,oldValue:e.oldValue,transformedValue:d.attributes[s],excludeAttribute:this.excludeAttribute,propValue:o,isBooleanAttr:l,inDOM:a,isVisible:c,isExcludeAttributeName:u}),s==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(y){this.unattachedDoc=this.doc}const m=this.unattachedDoc.createElement("span");e.oldValue&&m.setAttribute("style",e.oldValue);for(const y of Array.from(t.style)){const p=t.style.getPropertyValue(y),g=t.style.getPropertyPriority(y);p!==m.style.getPropertyValue(y)||g!==m.style.getPropertyPriority(y)?g===""?d.styleDiff[y]=p:d.styleDiff[y]=[p,g]:d._unchangedStyles[y]=[p,g]}for(const y of Array.from(m.style))t.style.getPropertyValue(y)===""&&(d.styleDiff[y]=!1)}else s==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?d.attributes.rr_open_mode="modal":d.attributes.rr_open_mode="non-modal");break}case"childList":{if(le(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const s=this.mirror.getId(t),r=Ot(e.target)?this.mirror.getId(k.host(e.target)):this.mirror.getId(e.target);le(e.target,this.blockClass,this.blockSelector,!1)||Ds(t,this.mirror,this.slimDOMOptions)||!Gl(t,this.mirror)||(this.addedSet.has(t)?(xr(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&s===-1||ln(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Fo(s,r)]?xr(this.movedSet,t):(this.removes.push({parentId:r,id:s,isShadow:Ot(e.target)&&Dt(e.target)?!0:void 0}),Hg(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}}),b(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Ds(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let s=null;t&&this.mirror.hasNode(t)&&(s=this.mirror.getId(t)),s&&s!==-1&&(this.movedMap[Fo(this.mirror.getId(e),s)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);le(e,this.blockClass,this.blockSelector,!1)||(k.childNodes(e).forEach(s=>this.genAdds(s)),Ue(e)&&k.childNodes(k.shadowRoot(e)).forEach(s=>{this.processedNodeManager.add(s,this),this.genAdds(s,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","excludeAttribute","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","selectorOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}resetBuffers(){this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.mapRemoves=[],this.movedMap={},this.attributes=[],this.texts=[],this.attributeMap=new WeakMap,this.removes=[]}unsetFrozen(){this.frozen=!1,this.canvasManager.unfreeze()}}function xr(i,e){i.delete(e),k.childNodes(e).forEach(t=>xr(i,t))}function Hg(i,e){const t=[i];for(;t.length;){const s=t.pop();e.has(s)||(e.add(s),k.childNodes(s).forEach(r=>t.push(r)))}}function zo(i,e,t){return i.size===0?!1:Gg(i,e)}function Gg(i,e,t){const s=k.parentNode(e);return s?i.has(s):!1}function Bo(i,e){return i.size===0?!1:tc(i,e)}function tc(i,e){const t=k.parentNode(e);return t?i.has(t)?!0:tc(i,t):!1}let kt;function jg(i){kt=i}function Yg(){kt=void 0}const L=i=>kt?(...t)=>{try{return i(...t)}catch(s){if(kt&&kt(s)===!0)return;throw s}}:i,we=[];function yt(i){try{if("composedPath"in i){const e=i.composedPath();if(e.length)return e[0]}else if("path"in i&&i.path.length)return i.path[0]}catch(e){}return i&&i.target}function sc(i,e){const t=new Vg;we.push(t),t.init(i);const s=new(rn())(L(t.processMutations.bind(t)));return s.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function Zg({mousemoveCb:i,sampling:e,doc:t,mirror:s}){if(e.mousemove===!1)return()=>{};const r=typeof e.mousemove=="number"?e.mousemove:50,n=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let o=[],l;const a=gt(L(h=>{const d=Date.now()-l;i(o.map(f=>(f.timeOffset-=d,f)),h),o=[],l=null}),n),c=L(gt(L(h=>{const d=yt(h),{clientX:f,clientY:m}=Zs(h)?h.changedTouches[0]:h;l||(l=ye()),o.push({x:f,y:m,id:s.getId(d),timeOffset:ye()-l}),a(typeof DragEvent!="undefined"&&h instanceof DragEvent?E.Drag:h instanceof MouseEvent?E.MouseMove:E.TouchMove)}),r,{trailing:!1})),u=[ne("mousemove",c,t),ne("touchmove",c,t),ne("drag",c,t)];return L(()=>{u.forEach(h=>h())})}function Xg({mouseInteractionCb:i,doc:e,mirror:t,blockClass:s,blockSelector:r,sampling:n}){if(n.mouseInteraction===!1)return()=>{console.debug("MouseInteractionObserver: No operation needed")};const o=n.mouseInteraction===!0||n.mouseInteraction===void 0?{}:n.mouseInteraction,l=[];let a=null;const c=u=>h=>{const d=yt(h);if(le(d,s,r,!0))return;let f=null,m=u;if("pointerType"in h){switch(h.pointerType){case"mouse":f=Te.Mouse;break;case"touch":f=Te.Touch;break;case"pen":f=Te.Pen;break}f===Te.Touch?H[u]===H.MouseDown?m="TouchStart":H[u]===H.MouseUp&&(m="TouchEnd"):Te.Pen}else Zs(h)&&(f=Te.Touch);f!==null?(a=f,(m.startsWith("Touch")&&f===Te.Touch||m.startsWith("Mouse")&&f===Te.Mouse)&&(f=null)):H[u]===H.Click&&(f=a,a=null);const y=Zs(h)?h.changedTouches[0]:h;if(!y)return;const p=t.getId(d),{clientX:g,clientY:S}=y;L(i)(A({type:H[m],id:p,x:g,y:S},f!==null&&{pointerType:f}))};return Object.keys(H).filter(u=>Number.isNaN(Number(u))&&!u.endsWith("_Departed")&&o[u]!==!1).forEach(u=>{let h=Ge(u);const d=c(u);if(window.PointerEvent)switch(H[u]){case H.MouseDown:case H.MouseUp:h=h.replace("mouse","pointer");break;case H.TouchStart:case H.TouchEnd:return}l.push(ne(h,d,e))}),L(()=>{l.forEach(u=>u())})}function ic({scrollCb:i,doc:e,mirror:t,blockClass:s,blockSelector:r,sampling:n}){const o=L(gt(L(l=>{const a=yt(l);if(!a||le(a,s,r,!0))return;const c=t.getId(a);if(a===e&&e.defaultView){const u=nn(e.defaultView);i({id:c,x:u.left,y:u.top})}else i({id:c,x:a.scrollLeft,y:a.scrollTop})}),n.scroll||100));return ne("scroll",o,e)}function Jg({viewportResizeCb:i},{win:e}){let t=-1,s=-1;const r=L(gt(L(()=>{const n=on(),o=an();(t!==n||s!==o)&&(i({width:Number(o),height:Number(n)}),t=n,s=o)}),200));return ne("resize",r,e)}function qg({navigationCb:i,doc:e,sampling:t}){var u;if(t.navigation===!1)return()=>{};const s=e.defaultView;if(!s)return()=>{};let r=s.location.href;const n=[],o=L(h=>{const d=s.location.href;d!==r&&(i({href:d,oldHref:r,navigationType:h}),r=d)}),l=ke(s.history,"pushState",function(h){return function(...d){const f=h.apply(this,d);return o("pushState"),f}});n.push(l);const a=ke(s.history,"replaceState",function(h){return function(...d){const f=h.apply(this,d);return o("replaceState"),f}});if(n.push(a),n.push(ne("popstate",()=>o("popstate"),s)),n.push(ne("hashchange",()=>o("hashchange"),s)),(typeof t.navigation=="object"&&(u=t.navigation.useNavigationAPI)!=null?u:!0)&&"navigation"in s)try{const h=s.navigation,d=f=>{var m;const y=f;if(y.navigationType==="push"||y.navigationType==="replace"){const p=(m=y.destination)==null?void 0:m.url;p&&p!==r&&(i({href:p,oldHref:r,navigationType:"navigate"}),r=p)}};h.addEventListener("navigate",d),n.push(()=>h.removeEventListener("navigate",d))}catch(h){}return L(()=>{n.forEach(h=>h())})}const Li=["INPUT","TEXTAREA","SELECT"],Wo=new WeakMap,Kg=["Enter","Tab","Escape","ArrowDown","ArrowUp","Delete"],Uo=new WeakMap;function Qg({inputCb:i,doc:e,mirror:t,blockClass:s,blockSelector:r,ignoreClass:n,ignoreSelector:o,maskInputOptions:l,maskInputFn:a,sampling:c,userTriggeredOnInput:u}){function h(v){let w=yt(v);const C=v.isTrusted,x=w&&w.tagName;if(w&&x==="OPTION"&&(w=k.parentElement(w)),!w||!x||Li.indexOf(x)<0||le(w,s,r,!0)||w.classList.contains(n)||o&&w.matches(o))return;let R=w.value,T=!1;const z=_s(w)||"";z==="radio"||z==="checkbox"?T=w.checked:(l[x.toLowerCase()]||l[z])&&(R=ks({element:w,maskInputOptions:l,tagName:x,type:z,value:R,maskInputFn:a})),d(w,u?{text:R,isChecked:T,userTriggered:C}:{text:R,isChecked:T});const U=w.name;z==="radio"&&U&&T&&e.querySelectorAll(`input[type="radio"][name="${U}"]`).forEach(P=>{if(P!==w){const j=P.value;d(P,u?{text:j,isChecked:!T,userTriggered:!1}:{text:j,isChecked:!T})}})}function d(v,w){const C=Wo.get(v),x=v,R=x.hasAttribute("placeholder"),T=x.value==="",z=typeof x.defaultValue=="string"?x.defaultValue==="":!0,U=!w.userTriggered,P=!C||C.text==="",j=R&&T&&z&&P&&U&&!w.isChecked&&x.type!=="hidden"&&Li.includes(x.tagName),J=x.tagName==="INPUT"&&x.type==="text"&&!w.userTriggered&&w.text===x.defaultValue&&!C&&x.hasAttribute("placeholder"),ie=!w.userTriggered&&x.value===x.defaultValue&&!C&&x.hasAttribute("placeholder")&&!w.isChecked&&x.type!=="hidden"&&Li.includes(x.tagName),N=x.type==="checkbox"&&!w.userTriggered&&!w.isChecked&&!C,F=x.type==="radio"&&!w.userTriggered&&!w.isChecked&&!C;if(j||J||ie||N||F){console.debug(`[${ye()}] [rrweb:record/observer] \u26D4 phantom input ignored`,{node:k.describeNode(x),tag:x.tagName,nodeType:x.nodeType,attribute:x.attributes,value:x.value,isLikelyPhantom:j,isRenderDrivenTextInput:J,isValueFromDefault:ie,isPhantomCheckbox:N,isPhantomRadio:F});return}if(!C||C.text!==w.text||C.isChecked!==w.isChecked){Wo.set(v,w);const W=t.getId(v);L(i)(re(A({},w),{id:W}))}}const m=(c.input==="last"?["change"]:["input","change"]).map(v=>ne(v,L(h),e)),y=v=>{const w=yt(v);if(!w||!w.tagName)return;if(c.input==="all"){h(v);return}const C=w.tagName,x=v.key,R=Kg.includes(x),T=C==="TEXTAREA",z=e.activeElement===w,U=w.value,P=Uo.get(w);if(Uo.set(w,U),!z){h(v);return}if(R){if(!T){h(v);return}let j=P!=null?P:"",J=0;const ie=2,N=()=>{const F=w.value,W=e.activeElement===w,q=F!==j;if(!W){h(v);return}if(q)J=0,j=F;else if(J++,J>=ie){h(v);return}requestAnimationFrame(N)};requestAnimationFrame(N);return}};m.push(ne("keydown",L(y),e));const p=e.defaultView;if(!p)return()=>{m.forEach(v=>v())};const g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value"),S=[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&m.push(...S.map(v=>qt(v[0],v[1],{set(){L(h)({target:this,isTrusted:!1})}},!1,p))),L(()=>{m.forEach(v=>v())})}function Xs(i){const e=[];function t(s,r){if(Es("CSSGroupingRule")&&s.parentRule instanceof CSSGroupingRule||Es("CSSMediaRule")&&s.parentRule instanceof CSSMediaRule||Es("CSSSupportsRule")&&s.parentRule instanceof CSSSupportsRule||Es("CSSConditionRule")&&s.parentRule instanceof CSSConditionRule){const o=Array.from(s.parentRule.cssRules).indexOf(s);r.unshift(o)}else if(s.parentStyleSheet){const o=Array.from(s.parentStyleSheet.cssRules).indexOf(s);r.unshift(o)}return r}return t(i,e)}function ze(i,e,t){let s,r;return i?(i.ownerNode?s=e.getId(i.ownerNode):r=t.getId(i),{styleId:r,id:s}):{}}function ey({styleSheetRuleCb:i,mirror:e,stylesheetManager:t},{win:s}){if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};const r=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(r,{apply:L((u,h,d)=>{const[f,m]=d,{id:y,styleId:p}=ze(h,e,t.styleMirror);return(y&&y!==-1||p&&p!==-1)&&i({id:y,styleId:p,adds:[{rule:f,index:m}]}),u.apply(h,d)})}),s.CSSStyleSheet.prototype.addRule=function(u,h,d=this.cssRules.length){const f=`${u} { ${h} }`;return s.CSSStyleSheet.prototype.insertRule.apply(this,[f,d])};const n=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(n,{apply:L((u,h,d)=>{const[f]=d,{id:m,styleId:y}=ze(h,e,t.styleMirror);return(m&&m!==-1||y&&y!==-1)&&i({id:m,styleId:y,removes:[{index:f}]}),u.apply(h,d)})}),s.CSSStyleSheet.prototype.removeRule=function(u){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[u])};let o;s.CSSStyleSheet.prototype.replace&&(o=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:L((u,h,d)=>{const[f]=d,{id:m,styleId:y}=ze(h,e,t.styleMirror);return(m&&m!==-1||y&&y!==-1)&&i({id:m,styleId:y,replace:f}),u.apply(h,d)})}));let l;s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:L((u,h,d)=>{const[f]=d,{id:m,styleId:y}=ze(h,e,t.styleMirror);return(m&&m!==-1||y&&y!==-1)&&i({id:m,styleId:y,replaceSync:f}),u.apply(h,d)})}));const a={};Ms("CSSGroupingRule")?a.CSSGroupingRule=s.CSSGroupingRule:(Ms("CSSMediaRule")&&(a.CSSMediaRule=s.CSSMediaRule),Ms("CSSConditionRule")&&(a.CSSConditionRule=s.CSSConditionRule),Ms("CSSSupportsRule")&&(a.CSSSupportsRule=s.CSSSupportsRule));const 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:L((d,f,m)=>{const[y,p]=m,{id:g,styleId:S}=ze(f.parentStyleSheet,e,t.styleMirror);return(g&&g!==-1||S&&S!==-1)&&i({id:g,styleId:S,adds:[{rule:y,index:[...Xs(f),p||0]}]}),d.apply(f,m)})}),h.prototype.deleteRule=new Proxy(c[u].deleteRule,{apply:L((d,f,m)=>{const[y]=m,{id:p,styleId:g}=ze(f.parentStyleSheet,e,t.styleMirror);return(p&&p!==-1||g&&g!==-1)&&i({id:p,styleId:g,removes:[{index:[...Xs(f),y]}]}),d.apply(f,m)})})}),L(()=>{s.CSSStyleSheet.prototype.insertRule=r,s.CSSStyleSheet.prototype.deleteRule=n,o&&(s.CSSStyleSheet.prototype.replace=o),l&&(s.CSSStyleSheet.prototype.replaceSync=l),Object.entries(a).forEach(([u,h])=>{h.prototype.insertRule=c[u].insertRule,h.prototype.deleteRule=c[u].deleteRule})})}function rc({mirror:i,stylesheetManager:e},t){var s,r,n;let o=null;t.nodeName==="#document"?o=i.getId(t):o=i.getId(k.host(t));const l=t.nodeName==="#document"?(s=t.defaultView)==null?void 0:s.Document:(n=(r=t.ownerDocument)==null?void 0:r.defaultView)==null?void 0:n.ShadowRoot,a=l!=null&&l.prototype?Object.getOwnPropertyDescriptor(l==null?void 0: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;const h=(u=a.set)==null?void 0:u.call(this,c);if(o!==null&&o!==-1)try{e.adoptStyleSheets(c,o)}catch(d){}return h}}),L(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function ty({styleDeclarationCb:i,mirror:e,ignoreCSSAttributes:t,stylesheetManager:s},{win:r}){const n=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=new Proxy(n,{apply:L((l,a,c)=>{var u;const[h,d,f]=c;if(t.has(h))return n.apply(a,[h,d,f]);const{id:m,styleId:y}=ze((u=a.parentRule)==null?void 0:u.parentStyleSheet,e,s.styleMirror);return(m&&m!==-1||y&&y!==-1)&&i({id:m,styleId:y,set:{property:h,value:d,priority:f},index:Xs(a.parentRule)}),l.apply(a,c)})});const o=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:L((l,a,c)=>{var u;const[h]=c;if(t.has(h))return o.apply(a,[h]);const{id:d,styleId:f}=ze((u=a.parentRule)==null?void 0:u.parentStyleSheet,e,s.styleMirror);return(d&&d!==-1||f&&f!==-1)&&i({id:d,styleId:f,remove:{property:h},index:Xs(a.parentRule)}),l.apply(a,c)})}),L(()=>{r.CSSStyleDeclaration.prototype.setProperty=n,r.CSSStyleDeclaration.prototype.removeProperty=o})}function sy({mediaInteractionCb:i,blockClass:e,blockSelector:t,mirror:s,sampling:r,doc:n}){const o=L(a=>gt(L(c=>{const u=yt(c);if(!u||le(u,e,t,!0))return;const{currentTime:h,volume:d,muted:f,playbackRate:m,loop:y}=u;i({type:a,id:s.getId(u),currentTime:h,volume:d,muted:f,playbackRate:m,loop:y})}),r.media||500)),l=[ne("play",o(Be.Play),n),ne("pause",o(Be.Pause),n),ne("seeked",o(Be.Seeked),n),ne("volumechange",o(Be.VolumeChange),n),ne("ratechange",o(Be.RateChange),n)];return L(()=>{l.forEach(a=>a())})}function iy({fontCb:i,doc:e}){const t=e.defaultView;if(!t)return()=>{};const s=[],r=new WeakMap,n=t.FontFace;t.FontFace=function(a,c,u){const h=new n(a,c,u);return r.set(h,{family:a,buffer:typeof c!="string",descriptors:u,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(ArrayBuffer.isView(c)?new Uint8Array(c.buffer,c.byteOffset,c.byteLength):new Uint8Array(c)))}),h};const o=ke(e.fonts,"add",function(l){return function(a){return setTimeout(L(()=>{const c=r.get(a);c&&(i(c),r.delete(a))}),0),l.apply(this,[a])}});return s.push(()=>{t.FontFace=n}),s.push(o),L(()=>{s.forEach(l=>l())})}function ry(i){const{doc:e,mirror:t,blockClass:s,blockSelector:r,selectionCb:n}=i;let o=!0;const l=L(()=>{const a=e.getSelection();if(!a||o&&(a!=null&&a.isCollapsed))return;o=a.isCollapsed||!1;const c=[],u=a.rangeCount||0;for(let h=0;h<u;h++){const d=a.getRangeAt(h),{startContainer:f,startOffset:m,endContainer:y,endOffset:p}=d;le(f,s,r,!0)||le(y,s,r,!0)||c.push({start:t.getId(f),startOffset:m,end:t.getId(y),endOffset:p})}n({ranges:c})});return l(),ne("selectionchange",l)}function ny({doc:i,customElementCb:e}){const t=i.defaultView;return!t||!t.customElements?()=>{}:ke(t.customElements,"define",function(r){return function(n,o,l){try{e({define:{name:n}})}catch(a){console.warn(`Custom element callback failed for ${n}`)}return r.apply(this,[n,o,l])}})}function oy(i,e){const{mutationCb:t,mousemoveCb:s,mouseInteractionCb:r,scrollCb:n,viewportResizeCb:o,navigationCb:l,inputCb:a,mediaInteractionCb:c,styleSheetRuleCb:u,styleDeclarationCb:h,canvasMutationCb:d,fontCb:f,selectionCb:m,customElementCb:y}=i;i.mutationCb=(...p)=>{e.mutation&&e.mutation(...p),t(...p)},i.mousemoveCb=(...p)=>{e.mousemove&&e.mousemove(...p),s(...p)},i.mouseInteractionCb=(...p)=>{e.mouseInteraction&&e.mouseInteraction(...p),r(...p)},i.scrollCb=(...p)=>{e.scroll&&e.scroll(...p),n(...p)},i.viewportResizeCb=(...p)=>{e.viewportResize&&e.viewportResize(...p),o(...p)},i.navigationCb=(...p)=>{e.navigation&&e.navigation(...p),l(...p)},i.inputCb=(...p)=>{e.input&&e.input(...p),a(...p)},i.mediaInteractionCb=(...p)=>{e.mediaInteaction&&e.mediaInteaction(...p),c(...p)},i.styleSheetRuleCb=(...p)=>{e.styleSheetRule&&e.styleSheetRule(...p),u(...p)},i.styleDeclarationCb=(...p)=>{e.styleDeclaration&&e.styleDeclaration(...p),h(...p)},i.canvasMutationCb=(...p)=>{e.canvasMutation&&e.canvasMutation(...p),d(...p)},i.fontCb=(...p)=>{e.font&&e.font(...p),f(...p)},i.selectionCb=(...p)=>{e.selection&&e.selection(...p),m(...p)},i.customElementCb=(...p)=>{e.customElement&&e.customElement(...p),y(...p)}}function ay(i,e={}){const t=i.doc.defaultView;if(!t)return()=>{};oy(i,e);let s;i.recordDOM&&(s=sc(i,i.doc));const r=Zg(i),n=Xg(i),o=ic(i),l=Jg(i,{win:t}),a=qg(i),c=Qg(i),u=sy(i);let h=()=>{},d=()=>{},f=()=>{},m=()=>{};i.recordDOM&&(h=ey(i,{win:t}),d=rc(i,i.doc),f=ty(i,{win:t}),i.collectFonts&&(m=iy(i)));const y=ry(i),p=ny(i),g=[];for(const S of i.plugins)g.push(S.observer(S.callback,t,S.options));return L(()=>{var S;we.forEach(v=>v.reset()),(S=i.visibilityManager)==null||S.reset(),s==null||s.disconnect(),r(),n(),o(),l(),a(),c(),u(),h(),d(),f(),m(),y(),p(),g.forEach(v=>v())})}function Es(i){return typeof window[i]!="undefined"}function Ms(i){return!!(typeof window[i]!="undefined"&&window[i].prototype&&"insertRule"in window[i].prototype&&"deleteRule"in window[i].prototype)}class Vo{constructor(e){b(this,"iframeIdToRemoteIdMap",new WeakMap),b(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,s,r){const n=s||this.getIdToRemoteIdMap(e),o=r||this.getRemoteIdToIdMap(e);let l=n.get(t);return l||(l=this.generateIdFn(),n.set(t,l),o.set(l,t)),l}getIds(e,t){const s=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(n=>this.getId(e,n,s,r))}getRemoteId(e,t,s){const r=s||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;const n=r.get(t);return n||-1}getRemoteIds(e,t){const s=this.getRemoteIdToIdMap(e);return t.map(r=>this.getRemoteId(e,r,s))}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}}class ly{constructor(e){b(this,"iframes",new WeakMap),b(this,"crossOriginIframeMap",new WeakMap),b(this,"crossOriginIframeMirror",new Vo(da)),b(this,"crossOriginIframeStyleMirror"),b(this,"crossOriginIframeRootIdMap",new WeakMap),b(this,"mirror"),b(this,"mutationCb"),b(this,"wrappedEmit"),b(this,"loadListener"),b(this,"stylesheetManager"),b(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Vo(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var s,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((s=e.contentWindow)==null||s.addEventListener("message",this.handleMessage.bind(this))),(r=this.loadListener)==null||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if(t.data.type!=="rrweb"||!e.source)return;const r=this.crossOriginIframeMap.get(e.source);if(!r)return;const n=this.transformCrossOriginEvent(r,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var s;switch(t.type){case I.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const r=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(t.data.node,r),{timestamp:t.timestamp,type:I.IncrementalSnapshot,data:{source:E.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case I.Meta:case I.Load:case I.DomContentLoaded:return!1;case I.Plugin:return t;case I.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case I.IncrementalSnapshot:switch(t.data.source){case E.Mutation:return t.data.adds.forEach(r=>{this.replaceIds(r,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(r.node,n)}),t.data.removes.forEach(r=>{this.replaceIds(r,e,["parentId","id"])}),t.data.attributes.forEach(r=>{this.replaceIds(r,e,["id"])}),t.data.texts.forEach(r=>{this.replaceIds(r,e,["id"])}),t;case E.Drag:case E.TouchMove:case E.MouseMove:return t.data.positions.forEach(r=>{this.replaceIds(r,e,["id"])}),t;case E.ViewportResize:return!1;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(r=>{this.replaceIds(r,e,["start","end"])}),t;case E.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(s=t.data.styles)==null||s.forEach(r=>{this.replaceStyleIds(r,e,["styleId"])}),t}}return!1}replace(e,t,s,r){for(const n of r)!Array.isArray(t[n])&&typeof t[n]!="number"||(Array.isArray(t[n])?t[n]=e.getIds(s,t[n]):t[n]=e.getId(s,t[n]));return t}replaceIds(e,t,s){return this.replace(this.crossOriginIframeMirror,e,t,s)}replaceStyleIds(e,t,s){return this.replace(this.crossOriginIframeStyleMirror,e,t,s)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(s=>{this.replaceIdOnNode(s,t)})}patchRootIdOnNode(e,t){e.type!==Oe.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(s=>{this.patchRootIdOnNode(s,t)})}}class cy{constructor(e){b(this,"shadowDoms",new WeakSet),b(this,"mutationCb"),b(this,"scrollCb"),b(this,"bypassOptions"),b(this,"mirror"),b(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(!Dt(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const s=sc(re(A({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push(()=>s.disconnect()),this.restoreHandlers.push(ic(re(A({},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(k.host(e))),this.restoreHandlers.push(rc({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){const s=this;this.restoreHandlers.push(ke(e.prototype,"attachShadow",function(r){return function(n){const o=r.call(this,n),l=k.shadowRoot(this);return l&&mn(this)&&s.addShadowRoot(l,t),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}var at="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Nt=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var As=0;As<at.length;As++)Nt[at.charCodeAt(As)]=As;var uy=function(i){var e=new Uint8Array(i),t,s=e.length,r="";for(t=0;t<s;t+=3)r+=at[e[t]>>2],r+=at[(e[t]&3)<<4|e[t+1]>>4],r+=at[(e[t+1]&15)<<2|e[t+2]>>6],r+=at[e[t+2]&63];return s%3===2?r=r.substring(0,r.length-1)+"=":s%3===1&&(r=r.substring(0,r.length-2)+"=="),r},hy=function(i){var e=i.length*.75,t=i.length,s,r=0,n,o,l,a;i[i.length-1]==="="&&(e--,i[i.length-2]==="="&&e--);var c=new ArrayBuffer(e),u=new Uint8Array(c);for(s=0;s<t;s+=4)n=Nt[i.charCodeAt(s)],o=Nt[i.charCodeAt(s+1)],l=Nt[i.charCodeAt(s+2)],a=Nt[i.charCodeAt(s+3)],u[r++]=n<<2|o>>4,u[r++]=(o&15)<<4|l>>2,u[r++]=(l&3)<<6|a&63;return c};const Ho=new Map;function dy(i,e){let t=Ho.get(i);return t||(t=new Map,Ho.set(i,t)),t.has(e)||t.set(e,[]),t.get(e)}const nc=(i,e,t)=>{if(!i||!(ac(i,e)||typeof i=="object"))return;const s=i.constructor.name,r=dy(t,s);let n=r.indexOf(i);return n===-1&&(n=r.length,r.push(i)),n};function $s(i,e,t){if(i instanceof Array)return i.map(s=>$s(s,e,t));if(i===null)return i;if(i instanceof Float32Array||i instanceof Float64Array||i instanceof Int32Array||i instanceof Uint32Array||i instanceof Uint8Array||i instanceof Uint16Array||i instanceof Int16Array||i instanceof Int8Array||i instanceof Uint8ClampedArray)return{rr_type:i.constructor.name,args:[Object.values(i)]};if(i instanceof ArrayBuffer){const s=i.constructor.name,r=uy(i);return{rr_type:s,base64:r}}else{if(i instanceof DataView)return{rr_type:i.constructor.name,args:[$s(i.buffer,e,t),i.byteOffset,i.byteLength]};if(i instanceof HTMLImageElement){const s=i.constructor.name,{src:r}=i;return{rr_type:s,src:r}}else if(i instanceof HTMLCanvasElement){const s="HTMLImageElement",r=i.toDataURL();return{rr_type:s,src:r}}else{if(i instanceof ImageData)return{rr_type:i.constructor.name,args:[$s(i.data,e,t),i.width,i.height]};if(ac(i,e)||typeof i=="object"){const s=i.constructor.name,r=nc(i,e,t);return{rr_type:s,index:r}}}}return i}const oc=(i,e,t)=>i.map(s=>$s(s,e,t)),ac=(i,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(r=>typeof e[r]=="function").find(r=>i instanceof e[r]);function fy(i,e,t,s){const r=[],n=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const o of n)try{if(typeof e.CanvasRenderingContext2D.prototype[o]!="function")continue;const l=ke(e.CanvasRenderingContext2D.prototype,o,function(a){return function(...c){return le(this.canvas,t,s,!0)||setTimeout(()=>{const u=oc(c,e,this);i(this.canvas,{type:_e["2D"],property:o,args:u})},0),a.apply(this,c)}});r.push(l)}catch(l){const a=qt(e.CanvasRenderingContext2D.prototype,o,{set(c){i(this.canvas,{type:_e["2D"],property:o,args:[c],setter:!0})}});r.push(a)}return()=>{r.forEach(o=>o())}}function py(i){return i==="experimental-webgl"?"webgl":i}function Go(i,e,t,s){const r=[];try{const n=ke(i.HTMLCanvasElement.prototype,"getContext",function(o){return function(l,...a){if(!le(this,e,t,!0)){const c=py(l);if("__context"in this||(this.__context=c),s&&["webgl","webgl2"].includes(c))if(a[0]&&typeof a[0]=="object"){const u=a[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0})}return o.apply(this,[l,...a])}});r.push(n)}catch(n){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(n=>n())}}function jo(i,e,t,s,r,n){const o=[],l=Object.getOwnPropertyNames(i);for(const a of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))try{if(typeof i[a]!="function")continue;const c=ke(i,a,function(u){return function(...h){const d=u.apply(this,h);if(nc(d,n,this),"tagName"in this.canvas&&!le(this.canvas,s,r,!0)){const f=oc(h,n,this),m={type:e,property:a,args:f};t(this.canvas,m)}return d}});o.push(c)}catch(c){const u=qt(i,a,{set(h){t(this.canvas,{type:e,property:a,args:[h],setter:!0})}});o.push(u)}return o}function my(i,e,t,s){const r=[];return r.push(...jo(e.WebGLRenderingContext.prototype,_e.WebGL,i,t,s,e)),typeof e.WebGL2RenderingContext!="undefined"&&r.push(...jo(e.WebGL2RenderingContext.prototype,_e.WebGL2,i,t,s,e)),()=>{r.forEach(n=>n())}}const lc="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",gy=i=>Uint8Array.from(atob(i),e=>e.charCodeAt(0)),Yo=typeof self!="undefined"&&self.Blob&&new Blob([gy(lc)],{type:"text/javascript;charset=utf-8"});function yy(i){let e;try{if(e=Yo&&(self.URL||self.webkitURL).createObjectURL(Yo),!e)throw"";const t=new Worker(e,{name:i==null?void 0:i.name});return t.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),t}catch(t){return new Worker("data:text/javascript;base64,"+lc,{name:i==null?void 0:i.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class by{constructor(e){b(this,"pendingCanvasMutations",new Map),b(this,"rafStamps",{latestId:0,invokeId:null}),b(this,"mirror"),b(this,"mutationCb"),b(this,"resetObservers"),b(this,"frozen",!1),b(this,"locked",!1),b(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)});const{sampling:t="all",win:s,blockClass:r,blockSelector:n,recordCanvas:o,dataURLOptions:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&t==="all"&&this.initCanvasMutationObserver(s,r,n),o&&typeof t=="number"&&this.initCanvasFPSObserver(t,s,r,n,{dataURLOptions:l})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,s,r,n){const o=Go(t,s,r,!0),l=new Map,a=new yy;a.onmessage=m=>{const{id:y}=m.data;if(l.set(y,!1),!("base64"in m.data))return;const{base64:p,type:g,width:S,height:v}=m.data;this.mutationCb({id:y,type:_e["2D"],commands:[{property:"clearRect",args:[0,0,S,v]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:p}],type:g}]},0,0]}]})};const c=1e3/e;let u=0,h;const d=()=>{const m=[];return t.document.querySelectorAll("canvas").forEach(y=>{le(y,s,r,!0)||m.push(y)}),m},f=m=>{if(u&&m-u<c){h=requestAnimationFrame(f);return}u=m,d().forEach(async y=>{var p;const g=this.mirror.getId(y);if(l.get(g)||y.width===0||y.height===0)return;if(l.set(g,!0),["webgl","webgl2"].includes(y.__context)){const v=y.getContext(y.__context);((p=v==null?void 0:v.getContextAttributes())==null?void 0:p.preserveDrawingBuffer)===!1&&v.clear(v.COLOR_BUFFER_BIT)}const S=await createImageBitmap(y);a.postMessage({id:g,bitmap:S,width:y.width,height:y.height,dataURLOptions:n.dataURLOptions},[S])}),h=requestAnimationFrame(f)};h=requestAnimationFrame(f),this.resetObservers=()=>{o(),cancelAnimationFrame(h)}}initCanvasMutationObserver(e,t,s){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=Go(e,t,s,!1),n=fy(this.processMutation.bind(this),e,t,s),o=my(this.processMutation.bind(this),e,t,s);this.resetObservers=()=>{r(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const s=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,s)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const s=this.pendingCanvasMutations.get(e);if(!s||t===-1)return;const r=s.map(o=>{const c=o,{type:l}=c;return Qe(c,["type"])}),{type:n}=s[0];this.mutationCb({id:t,type:n,commands:r}),this.pendingCanvasMutations.delete(e)}}function Zo(i,e,t){var u,h,d,f,m,y;const s=(u=t==null?void 0:t.root)!=null?u:null,r=(h=t==null?void 0:t.threshold)!=null?h:.5,n=(d=t==null?void 0:t.sensitivity)!=null?d:.05,o=wy((f=t==null?void 0:t.rootMargin)!=null?f:"0px"),l=new Map,a=vy(s),c=Sy(a,o);for(const p of i){const g=p.getBoundingClientRect();let S=Ey(),v=0;g.width>0&&g.height>0&&(S=Cy(g,c),v=xy(g,S),v=Math.round(v*100)/100);const w=My(p),C=(m=e.get(p))!=null?m:null,x=(y=C==null?void 0:C.intersectionRatio)!=null?y:0,R=v,T=(C==null?void 0:C.isStyleVisible)&&x>r,z=w&&R>r;!C||T!==z||T!==z&&Math.abs(R-x)>n?l.set(p,{target:p,isVisible:z,isStyleVisible:w,intersectionRatio:R,intersectionRect:S,oldValue:C}):l.set(p,C)}return l}function wy(i){const e=i.trim().split(/\s+/),t=(s,r)=>s.endsWith("%")?parseFloat(s)/100*r:parseFloat(s)||0;return function(s){const r=t(e[0]||"0px",s.height),n=t(e[1]||e[0]||"0px",s.width),o=t(e[2]||e[0]||"0px",s.height),l=t(e[3]||e[1]||e[0]||"0px",s.width);return{top:r,right:n,bottom:o,left:l,width:0,height:0}}}function vy(i){return i?i.getBoundingClientRect():new DOMRect(0,0,window.innerWidth,window.innerHeight)}function Sy(i,e){const t=e(i);return new DOMRect(i.left-t.left,i.top-t.top,i.width+t.left+t.right,i.height+t.top+t.bottom)}function Cy(i,e){const t=Math.max(i.top,e.top),s=Math.max(i.left,e.left),r=Math.min(i.bottom,e.bottom),n=Math.min(i.right,e.right),o=Math.max(0,n-s),l=Math.max(0,r-t);return{top:t,left:s,bottom:r,right:n,width:o,height:l}}function xy(i,e){const t=i.width*i.height,s=e.width*e.height;return t>0?s/t:0}function Ey(){return{top:0,left:0,right:0,bottom:0,width:0,height:0}}function My(i){const e=getComputedStyle(i);return e&&e.display!=="none"&&e.visibility!=="hidden"&&parseFloat(e.opacity||"1")>0}class Ay{constructor(e){var c,u,h,d,f,m;b(this,"frozen",!1),b(this,"locked",!1),b(this,"pending",new Map),b(this,"mirror"),b(this,"mutationCb"),b(this,"rafId",null),b(this,"intervalId",null),b(this,"rafThrottle"),b(this,"lastFlushTime",0),b(this,"elements",new Set),b(this,"previousState",new Map),b(this,"root",null),b(this,"threshold"),b(this,"sensitivity"),b(this,"rootMargin"),b(this,"hasInitialized",!1),b(this,"mode","none"),b(this,"debounce",50),b(this,"throttle",100),b(this,"buffer",new Map),b(this,"debounceTimer",null),b(this,"lastThrottleTime",0),b(this,"disabled",!1),b(this,"notifyActivity");const{doc:t,mirror:s,sampling:r,mutationCb:n,notifyActivity:o}=e;if(this.mirror=s,this.mutationCb=n,this.notifyActivity=o,this.rootMargin="0px",r===!1){this.disabled=!0;return}const l=typeof r=="object"&&r!==null?r:{};this.mode=(c=l==null?void 0:l.mode)!=null?c:"none",this.debounce=Number((u=l==null?void 0:l.debounce)!=null?u:100),this.throttle=Number((h=l==null?void 0:l.throttle)!=null?h:100),this.threshold=Number((d=l==null?void 0:l.threshold)!=null?d:.5),this.sensitivity=Number((f=l==null?void 0:l.sensitivity)!=null?f:.05),this.rafThrottle=Number((m=l==null?void 0:l.rafThrottle)!=null?m:50),t.querySelectorAll("*").forEach(y=>this.observe(y)),new MutationObserver(y=>{y.forEach(p=>{p.addedNodes.forEach(g=>{g.nodeType===Node.ELEMENT_NODE&&(this.observe(g),g.querySelectorAll("*").forEach(S=>this.observe(S)))}),p.removedNodes.forEach(g=>{g.nodeType===Node.ELEMENT_NODE&&this.unobserve(g)})})}).observe(t.body,{childList:!0,subtree:!0}),this.startPendingFlushLoop()}startPendingFlushLoop(){if(!this.disabled)if(typeof requestAnimationFrame=="function"){const e=t=>{t-this.lastFlushTime>=this.rafThrottle&&(this.lastFlushTime=t,this.flushPendingVisibilityMutations()),this.rafId=requestAnimationFrame(e)};this.rafId=requestAnimationFrame(e)}else{const e=()=>{const t=performance.now();t-this.lastFlushTime>=this.rafThrottle&&(this.lastFlushTime=t,this.flushPendingVisibilityMutations())};this.intervalId=setInterval(e,this.rafThrottle)}}flushPendingVisibilityMutations(){if(this.disabled||this.frozen||this.locked||this.elements.size===0)return;const e=Zo(this.elements,this.previousState,{root:this.root,threshold:this.threshold,sensitivity:this.sensitivity,rootMargin:this.rootMargin});for(const[t,s]of e.entries()){const r=this.previousState.get(t);if(!r||r.isVisible!==s.isVisible||Math.abs(r.intersectionRatio-s.intersectionRatio)>this.sensitivity){const o=this.mirror.getId(t);o!==-1&&this.buffer.set(t,{id:o,isVisible:s.isVisible,ratio:s.intersectionRatio}),this.previousState.set(t,s)}}if(this.previousState=e,!this.hasInitialized){this.hasInitialized=!0,this.buffer.clear();return}this.scheduleEmit()}scheduleEmit(){if(this.mode==="debounce")clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>this.flushBuffer(),this.debounce);else if(this.mode==="throttle"){const e=performance.now();e-this.lastThrottleTime>=this.throttle&&(this.lastThrottleTime=e,this.flushBuffer())}else this.flushBuffer()}flushBuffer(){var e;if(this.frozen||this.locked||this.buffer.size===0)return;const t=Array.from(this.buffer.values()),s=t.length;this.buffer.clear(),this.mutationCb({mutations:t}),(e=this.notifyActivity)==null||e.call(this,s)}observe(e){this.disabled||this.elements.add(e)}unobserve(e){this.disabled||(this.elements.delete(e),this.previousState.delete(e),this.pending.delete(e))}freeze(){this.frozen=!0,this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null)}unfreeze(){this.frozen=!1,this.flushPendingVisibilityMutations()}lock(){this.locked=!0,this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null)}unlock(){this.locked=!1,this.buffer.clear(),this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),!this.disabled&&this.elements.size>0&&(this.previousState=Zo(this.elements,new Map,{root:this.root,threshold:this.threshold,sensitivity:this.sensitivity,rootMargin:this.rootMargin}))}unsetFrozen(){this.frozen=!1}reset(){this.elements.clear(),this.previousState.clear(),this.pending.clear(),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)}}const Iy=150,Ny=5e3,Ry=100;class Ty{constructor(e){var n,o,l;b(this,"frozen",!1),b(this,"locked",!1),b(this,"disabled",!1),b(this,"settleTimeout"),b(this,"maxWait"),b(this,"debounceMs"),b(this,"settlingObserver",null),b(this,"debounceTimer",null),b(this,"settleCheckTimer",null),b(this,"maxWaitTimer",null),b(this,"lastMutationTime",0),b(this,"pendingNavigation",null),b(this,"doc"),b(this,"onSnapshot");const{doc:t,config:s,onSnapshot:r}=e;this.doc=t,this.onSnapshot=L(r),this.settleTimeout=(n=s.settleTimeout)!=null?n:Iy,this.maxWait=(o=s.maxWait)!=null?o:Ny,this.debounceMs=(l=s.debounce)!=null?l:Ry}handleNavigation(e){this.disabled||this.locked||(this.cancelTimers(),this.disconnectSettlingObserver(),this.pendingNavigation=e,!this.frozen&&this.startDebounce())}cancelPending(){this.cancelTimers(),this.disconnectSettlingObserver(),this.pendingNavigation=null}freeze(){this.frozen=!0,this.cancelTimers(),this.disconnectSettlingObserver()}unfreeze(){this.frozen=!1,this.pendingNavigation&&!this.locked&&!this.disabled&&this.startDebounce()}lock(){this.locked=!0,this.cancelTimers(),this.disconnectSettlingObserver()}unlock(){this.locked=!1,this.pendingNavigation=null}unsetFrozen(){this.frozen=!1}reset(){this.cancelTimers(),this.disconnectSettlingObserver(),this.pendingNavigation=null,this.frozen=!1,this.locked=!1}destroy(){const e=this.pendingNavigation!==null;this.reset(),this.disabled=!0,e&&this.onSnapshot(!0)}startDebounce(){this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.startDOMSettling()},this.debounceMs)}startDOMSettling(){if(this.frozen||this.locked||this.disabled)return;this.lastMutationTime=performance.now();const e=rn();this.settlingObserver=new e(()=>{this.lastMutationTime=performance.now(),this.settleCheckTimer!==null&&clearTimeout(this.settleCheckTimer),this.settleCheckTimer=setTimeout(()=>this.checkSettled(),this.settleTimeout)}),this.settlingObserver.observe(this.doc,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),this.settleCheckTimer=setTimeout(()=>this.checkSettled(),this.settleTimeout),this.maxWaitTimer=setTimeout(()=>{this.maxWaitTimer=null,this.completeSettling()},this.maxWait)}checkSettled(){this.settleCheckTimer=null;const e=performance.now()-this.lastMutationTime;e>=this.settleTimeout?this.completeSettling():this.settleCheckTimer=setTimeout(()=>this.checkSettled(),this.settleTimeout-e)}completeSettling(){this.frozen||this.locked||this.disabled||this.pendingNavigation&&(this.cancelTimers(),this.disconnectSettlingObserver(),this.pendingNavigation=null,this.onSnapshot(!0))}cancelTimers(){this.debounceTimer!==null&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.settleCheckTimer!==null&&(clearTimeout(this.settleCheckTimer),this.settleCheckTimer=null),this.maxWaitTimer!==null&&(clearTimeout(this.maxWaitTimer),this.maxWaitTimer=null)}disconnectSettlingObserver(){this.settlingObserver&&(this.settlingObserver.disconnect(),this.settlingObserver=null)}}class Oy{constructor(e){b(this,"trackedLinkElements",new WeakSet),b(this,"mutationCb"),b(this,"adoptedStyleSheetCb"),b(this,"styleMirror",new fn),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;const s={id:t,styleIds:[]},r=[];for(const n of e){let o;this.styleMirror.has(n)?o=this.styleMirror.getId(n):(o=this.styleMirror.add(n),r.push({styleId:o,rules:Array.from(n.rules||CSSRule,(l,a)=>({rule:na(l,n.href),index:a}))})),s.styleIds.push(o)}r.length>0&&(s.styles=r),this.adoptedStyleSheetCb(s)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Dy{constructor(){b(this,"nodeMap",new WeakMap),b(this,"active",!1)}inOtherBuffer(e,t){const s=this.nodeMap.get(e);return s&&Array.from(s).some(r=>r!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}const $y="3.4.0-alpha.1";let te,Fe,Pi,jt=!1;const Js=[];let Rt;try{if(Array.from([1],i=>i*2)[0]!==2){const i=document.createElement("iframe");document.body.appendChild(i),Array.from=((In=i.contentWindow)==null?void 0:In.Array.from)||Array.from,document.body.removeChild(i)}}catch(i){console.debug("Unable to override Array.from",i)}const ge=oa();function de(i={}){const{emit:e,checkoutEveryNms:t,checkoutEveryNth:s,checkoutEveryNvm:r,checkoutDebounce:n,blockClass:o="rr-block",blockSelector:l=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,excludeAttribute:u,maskTextClass:h="rr-mask",maskTextSelector:d=null,inlineStylesheet:f=!0,maskAllInputs:m,maskInputOptions:y,slimDOMOptions:p,maskInputFn:g,maskTextFn:S,hooks:v,packFn:w,sampling:C={},dataURLOptions:x={},mousemoveWait:R,recordDOM:T=!0,recordCanvas:z=!1,recordCrossOriginIframes:U=!1,recordAfter:P=i.recordAfter==="DOMContentLoaded"?i.recordAfter:"load",flushCustomEvent:j=i.flushCustomEvent!==void 0?i.flushCustomEvent:"after",userTriggeredOnInput:J=!1,collectFonts:ie=!1,inlineImages:N=!1,plugins:F,keepIframeSrcFn:W=()=>!1,ignoreCSSAttributes:q=new Set([]),selector:ce,errorHandler:Le}=i;jg(Le);const be=U?window.parent===window:!0;let wt=!1;if(!be)try{window.parent.document&&(wt=!1)}catch(O){wt=!0}if(be&&!e)throw new Error("emit function is required");if(!be&&!wt)return()=>{};R!==void 0&&C.mousemove===void 0&&(C.mousemove=R),ge.reset();const di=u===void 0?/.^/:u,fi=m===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:y!==void 0?y:{password:!0},pi=p===!0||p==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:p==="all",headMetaDescKeywords:p==="all",headTitleMutations:p==="all"}:p||{},bn=zg(ce);cn();let wn,mi=0,Kt=0,vn=0,Pe=!1,fe=null,Ke=null;const Sn=O=>{for(const he of F||[])he.eventProcessor&&(O=he.eventProcessor(O));return w&&!wt&&(O=w(O)),O},Qt=()=>{fe=null,Pe=!1,Ke=null,ue==null||ue.cancelPending(),Fe(!0),we.forEach(O=>{O.resetBuffers(),O.unsetFrozen()}),ae&&ae.unsetFrozen(),ue&&ue.unsetFrozen()};te=(O,he)=>{var X;const K=O;if(K.timestamp=ye(),K.checkoutId=vn,(X=we[0])!=null&&X.isFrozen()&&!Pe&&K.type!==I.FullSnapshot&&!(K.type===I.IncrementalSnapshot&&K.data.source===E.Mutation)&&(we.forEach(me=>me.unfreeze()),ae==null||ae.unfreeze(),ue==null||ue.unfreeze()),be)e==null||e(Sn(K),he);else if(wt){const me={type:"rrweb",event:Sn(K),isCheckout:he};window.parent.postMessage(me,"*")}if(K.type===I.FullSnapshot)wn=K,mi=0,Kt=0;else if(K.type===I.IncrementalSnapshot){if(K.data.source===E.Mutation&&K.data.isAttachIframe)return;if(K.data.source!==E.Visibility){mi++;const me=s&&mi>=s,G=t&&K.timestamp-wn.timestamp>t;if(me||G)if(n){Pe||(Pe=!0,Ke=ye(),we.forEach(wc=>wc.freeze()),ae==null||ae.freeze()),fe&&clearTimeout(fe);const vt=ye()-Ke,bc=n*3;vt>=bc?Qt():fe=setTimeout(()=>Qt(),n)}else Fe(!0)}}};const es=O=>{te({type:I.IncrementalSnapshot,data:A({source:E.Mutation},O)})},mc=O=>{te({type:I.IncrementalSnapshot,data:A({source:E.Visibility},O)})},Cn=O=>te({type:I.IncrementalSnapshot,data:A({source:E.Scroll},O)}),xn=O=>te({type:I.IncrementalSnapshot,data:A({source:E.CanvasMutation},O)}),gc=O=>te({type:I.IncrementalSnapshot,data:A({source:E.AdoptedStyleSheet},O)}),Ze=new Oy({mutationCb:es,adoptedStyleSheetCb:gc}),Xe=new ly({mirror:ge,mutationCb:es,stylesheetManager:Ze,recordCrossOriginIframes:U,wrappedEmit:te});for(const O of F||[])O.getMirror&&O.getMirror({nodeMirror:ge,crossOriginIframeMirror:Xe.crossOriginIframeMirror,crossOriginIframeStyleMirror:Xe.crossOriginIframeStyleMirror});const gi=new Dy;Pi=new by({recordCanvas:z,mutationCb:xn,win:window,blockClass:o,blockSelector:l,mirror:ge,sampling:C.canvas,dataURLOptions:x});const ts=new cy({mutationCb:es,scrollCb:Cn,bypassOptions:{blockClass:o,blockSelector:l,maskTextClass:h,maskTextSelector:d,excludeAttribute:di,inlineStylesheet:f,maskInputOptions:fi,dataURLOptions:x,maskTextFn:S,maskInputFn:g,recordCanvas:z,inlineImages:N,sampling:C,slimDOMOptions:pi,iframeManager:Xe,stylesheetManager:Ze,canvasManager:Pi,keepIframeSrcFn:W,processedNodeManager:gi,selectorOptions:bn},mirror:ge}),yc=T&&(r!=null||(C==null?void 0:C.visibility)!==void 0&&(C==null?void 0:C.visibility)!==!1);let ae;if(yc){const O=typeof(C==null?void 0:C.visibility)=="object"&&(C==null?void 0:C.visibility)!==null?C.visibility:{},he=O.recordVisibility===!0;ae=new Ay({doc:document,mirror:ge,sampling:O,mutationCb:he?mc:()=>{},notifyActivity:r!=null?X=>{if(Kt+=X,Kt>=r)if(Kt=0,n){Pe||(Pe=!0,Ke=ye(),we.forEach(G=>G.freeze()),ae==null||ae.freeze()),fe&&clearTimeout(fe);const K=ye()-Ke,me=n*3;K>=me?Qt():fe=setTimeout(()=>Qt(),n)}else Fe(!0)}:void 0})}Fe=(O=!1)=>{if(!T)return;vn++,te({type:I.Meta,data:{href:window.location.href,width:an(),height:on()}},O),Ze.reset(),ts.init(),we.forEach(X=>X.lock()),ae==null||ae.lock(),ue==null||ue.lock();const he=fh(document,{mirror:ge,blockClass:o,blockSelector:l,maskTextClass:h,maskTextSelector:d,excludeAttribute:di,inlineStylesheet:f,maskAllInputs:fi,maskTextFn:S,maskInputFn:g,slimDOM:pi,dataURLOptions:x,recordCanvas:z,inlineImages:N,onSerialize:X=>{ct(X,ge)&&Xe.addIframe(X),hn(X,ge)&&Ze.trackLinkElement(X),Ue(X)&&ts.addShadowRoot(k.shadowRoot(X),document)},onIframeLoad:(X,K)=>{Xe.attachIframe(X,K),ts.observeAttachShadow(X)},onStylesheetLoad:(X,K)=>{Ze.attachLinkElement(X,K)},keepIframeSrcFn:W,selector:ce});if(!he)return console.warn("Failed to snapshot the document");te({type:I.FullSnapshot,data:{node:he,initialOffset:nn(window)}},O),we.forEach(X=>X.unlock()),ae==null||ae.unlock(),ue==null||ue.unlock(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Ze.adoptStyleSheets(document.adoptedStyleSheets,ge.getId(document))},Rt=()=>{for(const O of Js)te(O);Js.length=0};let ue;const yi=C.navigation;if(yi!==!1){const O=typeof yi=="object"?yi:{};ue=new Ty({doc:document,config:O,onSnapshot:he=>{Pe&&(fe&&(clearTimeout(fe),fe=null),Pe=!1,Ke=null,we.forEach(X=>{X.resetBuffers(),X.unsetFrozen()}),ae==null||ae.unsetFrozen()),Fe(he)}})}try{const O=[],he=K=>{var me;return L(ay)({mutationCb:es,mousemoveCb:(G,vt)=>te({type:I.IncrementalSnapshot,data:{source:vt,positions:G}}),mouseInteractionCb:G=>te({type:I.IncrementalSnapshot,data:A({source:E.MouseInteraction},G)}),scrollCb:Cn,viewportResizeCb:G=>te({type:I.IncrementalSnapshot,data:A({source:E.ViewportResize},G)}),navigationCb:G=>{ue?ue.handleNavigation(G):Fe(!0)},inputCb:G=>te({type:I.IncrementalSnapshot,data:A({source:E.Input},G)}),mediaInteractionCb:G=>te({type:I.IncrementalSnapshot,data:A({source:E.MediaInteraction},G)}),styleSheetRuleCb:G=>te({type:I.IncrementalSnapshot,data:A({source:E.StyleSheetRule},G)}),styleDeclarationCb:G=>te({type:I.IncrementalSnapshot,data:A({source:E.StyleDeclaration},G)}),canvasMutationCb:xn,visibilityManager:ae,fontCb:G=>te({type:I.IncrementalSnapshot,data:A({source:E.Font},G)}),selectionCb:G=>{te({type:I.IncrementalSnapshot,data:A({source:E.Selection},G)})},customElementCb:G=>{te({type:I.IncrementalSnapshot,data:A({source:E.CustomElement},G)})},blockClass:o,ignoreClass:a,ignoreSelector:c,maskTextClass:h,maskTextSelector:d,excludeAttribute:di,maskInputOptions:fi,inlineStylesheet:f,sampling:C,recordDOM:T,recordCanvas:z,inlineImages:N,userTriggeredOnInput:J,collectFonts:ie,doc:K,maskInputFn:g,maskTextFn:S,keepIframeSrcFn:W,blockSelector:l,slimDOMOptions:pi,dataURLOptions:x,selectorOptions:bn,mirror:ge,iframeManager:Xe,stylesheetManager:Ze,shadowDomManager:ts,processedNodeManager:gi,canvasManager:Pi,ignoreCSSAttributes:q,plugins:((me=F==null?void 0:F.filter(G=>G.observer))==null?void 0:me.map(G=>({observer:G.observer,options:G.options,callback:vt=>te({type:I.Plugin,data:{plugin:G.name,payload:vt}})})))||[]},v)};Xe.addLoadListener(K=>{try{O.push(he(K.contentDocument))}catch(me){console.warn(me)}});const X=()=>{j==="before"&&Rt(),Fe(),O.push(he(document)),jt=!0,j==="after"&&Rt()};return document.readyState==="interactive"||document.readyState==="complete"?X():(O.push(ne("DOMContentLoaded",()=>{te({type:I.DomContentLoaded,data:{}}),P==="DOMContentLoaded"&&X()})),O.push(ne("load",()=>{te({type:I.Load,data:{}}),P==="load"&&X()},window))),()=>{fe&&(clearTimeout(fe),fe=null),Rt(),O.forEach(K=>K()),ue==null||ue.destroy(),gi.destroy(),jt=!1,Yg()}}catch(O){console.warn(O)}}de.getVersion=()=>$y;de.isRecording=()=>jt;de.flushCustomEventQueue=()=>{console.warn(`[rrweb] CustomEvent flushing: ${Js.length} events`),Rt()};de.addCustomEvent=(i,e)=>{const t={type:I.Custom,data:{tag:i,payload:e}};if(!jt){console.warn(`[rrweb] CustomEvent buffered before/after recording start: ${i}`),Js.push(t);return}te(t)};de.freezePage=()=>{we.forEach(i=>i.freeze())};de.takeFullSnapshot=i=>{if(!jt)throw new Error("please take full snapshot after start recording");Fe(i)};de.mirror=ge;function cc(i){return{all:i=i||new Map,on:function(e,t){var s=i.get(e);s?s.push(t):i.set(e,[t])},off:function(e,t){var s=i.get(e);s&&(t?s.splice(s.indexOf(t)>>>0,1):i.set(e,[]))},emit:function(e,t){var s=i.get(e);s&&s.slice().map(function(r){r(t)}),(s=i.get("*"))&&s.slice().map(function(r){r(e,t)})}}}const ky=Object.freeze(Object.defineProperty({__proto__:null,default:cc},Symbol.toStringTag,{value:"Module"}));function _y(i=window,e=document){if("scrollBehavior"in e.documentElement.style&&i.__forceSmoothScrollPolyfill__!==!0)return;const t=i.HTMLElement||i.Element,s=468,r={scroll:i.scroll||i.scrollTo,scrollBy:i.scrollBy,elementScroll:t.prototype.scroll||a,scrollIntoView:t.prototype.scrollIntoView},n=i.performance&&i.performance.now?i.performance.now.bind(i.performance):Date.now;function o(g){const S=["MSIE ","Trident/","Edge/"];return new RegExp(S.join("|")).test(g)}const l=o(i.navigator.userAgent)?1:0;function a(g,S){this.scrollLeft=g,this.scrollTop=S}function c(g){return .5*(1-Math.cos(Math.PI*g))}function u(g){if(g===null||typeof g!="object"||g.behavior===void 0||g.behavior==="auto"||g.behavior==="instant")return!0;if(typeof g=="object"&&g.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+g.behavior+" is not a valid value for enumeration ScrollBehavior.")}function h(g,S){if(S==="Y")return g.clientHeight+l<g.scrollHeight;if(S==="X")return g.clientWidth+l<g.scrollWidth}function d(g,S){const v=i.getComputedStyle(g,null)["overflow"+S];return v==="auto"||v==="scroll"}function f(g){const S=h(g,"Y")&&d(g,"Y"),v=h(g,"X")&&d(g,"X");return S||v}function m(g){for(;g!==e.body&&f(g)===!1;)g=g.parentNode||g.host;return g}function y(g){const S=n();let v,w,C,x=(S-g.startTime)/s;x=x>1?1:x,v=c(x),w=g.startX+(g.x-g.startX)*v,C=g.startY+(g.y-g.startY)*v,g.method.call(g.scrollable,w,C),(w!==g.x||C!==g.y)&&i.requestAnimationFrame(y.bind(i,g))}function p(g,S,v){let w,C,x,R;const T=n();g===e.body?(w=i,C=i.scrollX||i.pageXOffset,x=i.scrollY||i.pageYOffset,R=r.scroll):(w=g,C=g.scrollLeft,x=g.scrollTop,R=a),y({scrollable:w,method:R,startTime:T,startX:C,startY:x,x:S,y:v})}i.scroll=i.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){r.scroll.call(i,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:i.scrollX||i.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:i.scrollY||i.pageYOffset);return}p.call(i,e.body,arguments[0].left!==void 0?~~arguments[0].left:i.scrollX||i.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:i.scrollY||i.pageYOffset)}},i.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])){r.scrollBy.call(i,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}p.call(i,e.body,~~arguments[0].left+(i.scrollX||i.pageXOffset),~~arguments[0].top+(i.scrollY||i.pageYOffset))}},t.prototype.scroll=t.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(u(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");r.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const g=arguments[0].left,S=arguments[0].top;p.call(this,this,typeof g=="undefined"?this.scrollLeft:~~g,typeof S=="undefined"?this.scrollTop:~~S)},t.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){r.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},t.prototype.scrollIntoView=function(){if(u(arguments[0])===!0){r.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const g=m(this),S=g.getBoundingClientRect(),v=this.getBoundingClientRect();g!==e.body?(p.call(this,g,g.scrollLeft+v.left-S.left,g.scrollTop+v.top-S.top),i.getComputedStyle(g).position!=="fixed"&&i.scrollBy({left:S.left,top:S.top,behavior:"smooth"})):i.scrollBy({left:v.left,top:v.top,behavior:"smooth"})}}class Ly{constructor(e=[],t){b(this,"timeOffset",0),b(this,"speed"),b(this,"actions"),b(this,"raf",null),b(this,"lastTimestamp"),this.actions=e,this.speed=t.speed}addAction(e){const t=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=e.delay)this.actions.push(e);else{const s=this.findActionIndex(e);this.actions.splice(s,0,e)}t&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}rafCheck(){const e=performance.now();for(this.timeOffset+=(e-this.lastTimestamp)*this.speed,this.lastTimestamp=e;this.actions.length;){const t=this.actions[0];if(this.timeOffset>=t.delay)this.actions.shift(),t.doAction();else break}this.actions.length>0?this.raf=requestAnimationFrame(this.rafCheck.bind(this)):this.raf=!0}clear(){this.raf&&(this.raf!==!0&&cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(e){this.speed=e}isActive(){return this.raf!==null}findActionIndex(e){let t=0,s=this.actions.length-1;for(;t<=s;){const r=Math.floor((t+s)/2);if(this.actions[r].delay<e.delay)t=r+1;else if(this.actions[r].delay>e.delay)s=r-1;else return r+1}return t}}function Xo(i,e){if(i.type===I.IncrementalSnapshot&&i.data.source===E.MouseMove&&i.data.positions&&i.data.positions.length){const t=i.data.positions[0].timeOffset,s=i.timestamp+t;return i.delay=s-e,s-e}return i.delay=i.timestamp-e,i.delay}/*! *****************************************************************************
|
|
79
|
+
Solution: Ensure element and root parameter are from the same document context.`)}function Tg(i,e={}){var j,J,ie,N;var t;if(!i||!i.ownerDocument||!i.isConnected)return null;const s=A(A({},eg),e);if(s.root)try{Rg(i,s.root)}catch(F){return console.error("Cross-document generation detected:",F),null}const r=(j=s.cache)!=null?j:Ng(),n=r.getEID(i);if(n!==void 0)return n;if(i.tagName.toLowerCase()==="html"){const F=new $o(s,r),W=$g(i,s,F);return r.setEID(i,W),W}const o=new tg(s,r),l=new ag(s,r),a=new $o(s,r),c=new xg,u=o.findAnchor(i);if(!u&&!s.fallbackToBody)return null;const h=(ie=(J=u==null?void 0:u.element)!=null?J:(t=i.ownerDocument)==null?void 0:t.body)!=null?ie:null;if(!h)return null;const d=!u||u.tier==="C",f=h.tagName.toLowerCase(),m=h.parentElement;let y;if(m&&f!=="body"&&f!=="html"){const F=Array.from(m.children).indexOf(h);F!==-1&&(y=F+1)}const p=a.extract(h),g={tag:h.tagName.toLowerCase(),semantics:p,score:(N=u==null?void 0:u.score)!=null?N:Ae.DEGRADED_SCORE,degraded:d,nthChild:y},S=l.buildPath(h,i,a),v=a.extract(i);s.enableSvgFingerprint&&Og(i)&&(v.svg=c.fingerprint(i));const w=i.parentElement;let C;if(w){const F=Array.from(w.children).indexOf(i);F!==-1&&(C=F+1)}const x={tag:i.tagName.toLowerCase(),semantics:v,score:a.scoreElement(i),nthChild:C},R=[],T={onMultiple:"best-score",onMissing:"anchor-only",maxDepth:3},z=g.degraded||S.degraded,U=Dg(g.degraded,S),P={version:"1.0",anchor:g,path:S.path,target:x,constraints:R,fallback:T,meta:{confidence:0,generatedAt:new Date().toISOString(),generator:"dom-eid@1.0",source:s.source,degraded:z,degradationReason:U}};return P.meta.confidence=Eg(P),P.meta.confidence<s.confidenceThreshold?null:(r.setEID(i,P),P)}function Og(i){return i.namespaceURI==="http://www.w3.org/2000/svg"||i.tagName.toLowerCase()==="svg"||i instanceof SVGElement}function Dg(i,e){if(i&&e.degraded)return"anchor-and-path-degraded";if(i)return"no-semantic-anchor";if(e.degraded)return e.degradationReason}function $g(i,e,t,s){const r={tag:"html",semantics:t.extract(i),score:1,degraded:!1,nthChild:void 0};return{version:"1.0",anchor:r,path:[],target:r,constraints:[],fallback:{onMultiple:"best-score",onMissing:"anchor-only",maxDepth:3},meta:{confidence:1,generatedAt:new Date().toISOString(),generator:"dom-eid@1.0",source:e.source,degraded:!1,degradationReason:void 0}}}const ec={maxClasses:2,maxAttributes:5,includeText:!0,maxTextLength:50,simplifyTarget:!0,includeConstraints:!0};function _o(i){return i==="id"?101:Ve[i]!==void 0?Ve[i]:i.startsWith("data-")?Ve["data-*"]:i.startsWith("aria-")?Ve["aria-*"]:0}function kg(i){return["id","data-testid","data-qa","data-cy","href","text","role"].includes(i)}function _g(i){return!!(/@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/.test(i)||/(\+?\d{1,3}[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}/.test(i)||/\d{4}[-\s]?\d{4}[-\s]?\d{4}[-\s]?\d{4}/.test(i))}function Lg(i,e){const t=A(A({},ec),e),s=`v${i.version}`,r=_i(i.anchor,!1,t),n=i.path.length>0?i.path.map(a=>_i(a,!1,t)).join(" > ")+" > ":"",o=_i(i.target,!0,t),l=t.includeConstraints?Pg(i):"";return`${s}: ${r} :: ${n}${o}${l}`}function _i(i,e=!1,t=ec){const{tag:s,semantics:r}=i;let n=s;const o=[],l=A({},r.attributes);r.id&&(l.id=r.id),r.role&&!l.role&&(l.role=r.role);const a=Object.entries(l).map(([h,d])=>{const f=_o(h),m=h==="href"||h==="src"?Ql(h,d):d;return{name:h,value:m,priority:f}}).filter(h=>h.name!=="id"&&h.name!=="class"&&Jl.has(h.name)||ql.has(h.name)&&Kl(h.value)?!1:h.priority>0||h.name==="role"||h.name==="id");a.sort((h,d)=>d.priority-h.priority);const c=a.slice(0,t.maxAttributes);c.sort((h,d)=>h.name.localeCompare(d.name));for(const{name:h,value:d}of c)o.push(`${h}="${Cr(d)}"`);if(t.includeText&&r.text&&!_g(r.text.normalized)){const h=r.text.normalized;h.length>0&&h.length<=t.maxTextLength&&o.push(`text="${Cr(h)}"`)}let u=o;if(o.length>0&&(e&&t.simplifyTarget&&r.id&&(u=o.filter(h=>{const d=h.split("=")[0];return _o(d)>=60||d==="text"||d==="id"||d==="role"})),u.length>0&&u.sort((h,d)=>h.localeCompare(d))),r.classes&&r.classes.length>0){const h=ng(r.classes),d=!!r.id||o.some(f=>f.startsWith("href=")||f.startsWith("data-testid=")||f.startsWith("text=")||f.startsWith("role="));if(!(e&&t.simplifyTarget&&d)&&h.length>0){const f=h.sort().slice(0,t.maxClasses);n+=f.map(m=>`.${m}`).join("")}}if(u.length>0&&(n+=`[${u.join(",")}]`),"nthChild"in i&&i.nthChild){const h=!!r.id||r.attributes&&Object.keys(r.attributes).some(kg);e&&t.simplifyTarget&&h||(n+=`#${i.nthChild}`)}return n}function Pg(i){if(!i.constraints||i.constraints.length===0)return"";const e=[];for(const t of i.constraints)switch(t.type){case"uniqueness":e.push("unique=true");break;case"position":t.params&&t.params.strategy&&e.push(`pos=${t.params.strategy}`);break;case"text-proximity":if(t.params&&t.params.reference){const s=Cr(String(t.params.reference));e.push(`text="${s}"`)}break}return e.length===0?"":` {${e.join(",")}}`}function Cr(i){return i.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/>/g,"\\>").replace(/:/g,"\\:")}function Fg(i,e,t){const s=Tg(i,e);return s?Lg(s,t):null}const It={maxPathDepth:10,enableSvgFingerprint:!0,confidenceThreshold:0,fallbackToBody:!0};function zg(i){var e,t,s,r;return i===!1?null:i===!0||i===void 0?A({},It):{maxPathDepth:(e=i.maxPathDepth)!=null?e:It.maxPathDepth,enableSvgFingerprint:(t=i.enableSvgFingerprint)!=null?t:It.enableSvgFingerprint,confidenceThreshold:(s=i.confidenceThreshold)!=null?s:It.confidenceThreshold,fallbackToBody:(r=i.fallbackToBody)!=null?r:It.fallbackToBody}}function Lo(i,e,t,s){const r=e.getMeta(i),n=r==null?void 0:r.selector;if(n&&!(s!=null&&s.force))return n;const o=i.nodeType===Node.ELEMENT_NODE?i:hi(i);if(!o)return n;const l=e.getMeta(o),a=l==null?void 0:l.selector;if(a&&!(s!=null&&s.force))return a;if(!t)return a!=null?a:n;const c={maxPathDepth:t.maxPathDepth,enableSvgFingerprint:t.enableSvgFingerprint,fallbackToBody:t.fallbackToBody};try{const u=Fg(o,c);if(u)return l?l.selector=u:r&&(r.selector=u),u}catch(u){}return a!=null?a:n}function Po(i){return"__ln"in i}class Bg{constructor(){b(this,"length",0),b(this,"head",null),b(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let s=0;s<e;s++)t=(t==null?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Po(e.previousSibling)){const s=e.previousSibling.__ln.next;t.next=s,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,s&&(s.previous=t)}else if(e.nextSibling&&Po(e.nextSibling)&&e.nextSibling.__ln.previous){const s=e.nextSibling.__ln.previous;t.previous=s,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,s&&(s.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){const 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--)}}const Fo=(i,e)=>`${i}@${e}`,Wg=new Set(["id","class","name","role","title","alt","placeholder","for","type"]);function Ug(i){const e=i.toLowerCase();return Wg.has(e)||e.startsWith("data-")||e.startsWith("aria-")}class Vg{constructor(){b(this,"frozen",!1),b(this,"locked",!1),b(this,"texts",[]),b(this,"attributes",[]),b(this,"attributeMap",new WeakMap),b(this,"removes",[]),b(this,"mapRemoves",[]),b(this,"movedMap",{}),b(this,"addedSet",new Set),b(this,"movedSet",new Set),b(this,"droppedSet",new Set),b(this,"removesSubTreeCache",new Set),b(this,"mutationCb"),b(this,"blockClass"),b(this,"blockSelector"),b(this,"maskTextClass"),b(this,"maskTextSelector"),b(this,"excludeAttribute"),b(this,"inlineStylesheet"),b(this,"maskInputOptions"),b(this,"maskTextFn"),b(this,"maskInputFn"),b(this,"keepIframeSrcFn"),b(this,"recordCanvas"),b(this,"inlineImages"),b(this,"slimDOMOptions"),b(this,"dataURLOptions"),b(this,"selectorOptions",null),b(this,"doc"),b(this,"mirror"),b(this,"iframeManager"),b(this,"stylesheetManager"),b(this,"shadowDomManager"),b(this,"canvasManager"),b(this,"processedNodeManager"),b(this,"unattachedDoc"),b(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),b(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,s=new Bg,r=a=>{let c=a,u=Lt;for(;u===Lt;)c=c&&c.nextSibling,u=c&&this.mirror.getId(c);return u},n=a=>{const c=k.parentNode(a);if(!c||!mn(a))return;let u=!1;if(a.nodeType===Node.TEXT_NODE){const m=c.tagName;if(m==="TEXTAREA")return;m==="STYLE"&&this.addedSet.has(c)&&(u=!0)}const h=Ot(c)?this.mirror.getId(pn(a)):this.mirror.getId(c),d=r(a);if(h===-1||d===-1)return s.addNode(a);const f=nt(a,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,excludeAttribute:this.excludeAttribute,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:m=>{ct(m,this.mirror)&&this.iframeManager.addIframe(m),hn(m,this.mirror)&&this.stylesheetManager.trackLinkElement(m),Ue(a)&&this.shadowDomManager.addShadowRoot(k.shadowRoot(a),this.doc)},onIframeLoad:(m,y)=>{this.iframeManager.attachIframe(m,y),this.shadowDomManager.observeAttachShadow(m)},onStylesheetLoad:(m,y)=>{this.stylesheetManager.attachLinkElement(m,y)},cssCaptured:u,selectorOptions:this.selectorOptions});f&&(e.push({parentId:h,nextId:d,node:f}),t.add(f.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)zo(this.removesSubTreeCache,a,this.mirror)&&!this.movedSet.has(k.parentNode(a))||n(a);for(const a of this.addedSet)!Bo(this.droppedSet,a)&&!zo(this.removesSubTreeCache,a,this.mirror)||Bo(this.movedSet,a)?n(a):this.droppedSet.add(a);let o=null;for(;s.length;){let a=null;if(o){const c=this.mirror.getId(k.parentNode(o.value)),u=r(o.value);c!==-1&&u!==-1&&(a=o)}if(!a){let c=s.tail;for(;c;){const u=c;if(c=c.previous,u){const h=this.mirror.getId(k.parentNode(u.value));if(r(u.value)===-1)continue;if(h!==-1){a=u;break}else{const f=u.value,m=k.parentNode(f);if(m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const y=k.host(m);if(this.mirror.getId(y)!==-1){a=u;break}}}}}}if(!a){for(;s.head;)s.removeNode(s.head.value);break}o=a.previous,s.removeNode(a.value),n(a.value)}const l={texts:this.texts.map(a=>{const c=a.node,u=k.parentNode(c);return u&&u.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(u),{id:this.mirror.getId(c),value:a.value,selector:Lo(c,this.mirror,this.selectorOptions)}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{const{attributes:c}=a;if(typeof c.style=="string"){const 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,selector:Lo(a.node,this.mirror,this.selectorOptions,{force:Object.keys(c).some(Ug)})}}).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))}),b(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));const s=Array.from(k.childNodes(e),r=>k.textContent(r)||"").join("");t.attributes.value=ks({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:_s(e),value:s,maskInputFn:this.maskInputFn})}),b(this,"processMutation",e=>{if(!Ds(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=k.textContent(e.target);!le(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:ma(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,hi(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let s=e.attributeName,r=e.target.getAttribute(s);const o=t[s],l=typeof o=="boolean",a=document.contains(t),c=Nr(t),u=Ui(s,this.excludeAttribute);if(r===null&&!t.hasAttribute(s)&&e.oldValue!==null&&(o===""||o===null||typeof o=="undefined")){console.debug(`[${ye()}] [rrweb:record/mutation] \u26D4 phantom attribute mutation ignored`,{node:k.describeNode(t),tag:t.tagName,nodeType:t.nodeType,attribute:s,value:r,oldValue:e.oldValue,excludeAttribute:this.excludeAttribute,propValue:o,isBooleanAttr:l,inDOM:a,isVisible:c,isExcludeAttributeName:u});return}if(Ui(s,this.excludeAttribute)){console.debug(`[${ye()}] [rrweb:record/mutation] \u26D4 excluded attribute mutation ignored`,{node:k.describeNode(t),tag:t.tagName,nodeType:t.nodeType,attribute:s,value:r,oldValue:e.oldValue,excludeAttribute:this.excludeAttribute,propValue:o,isBooleanAttr:l,inDOM:a,isVisible:c,isExcludeAttributeName:u});return}if(s==="value"){const f=_s(t);r=ks({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:f,value:r,maskInputFn:this.maskInputFn})}if(le(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue)return;let d=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&s==="src"&&!this.keepIframeSrcFn(r))if(!t.contentDocument)s="rr_src";else return;if(d||(d={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(d),this.attributeMap.set(e.target,d)),s==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!pa(t.tagName,s))if(d.attributes[s]=fa(this.doc,Ge(t.tagName),Ge(s),r),s!=="class"&&(e.oldValue===null||r===""||r!==e.oldValue)&&console.debug(`[${ye()}] [rrweb:record/mutation] \u26A0\uFE0F suspicious attribute mutation`,{reason:[r===e.oldValue?"no change in value":null,r===o?"mirrored in DOM property":null,r===d.attributes[s]?"redundant assignment":null].filter(Boolean).join(", ")||"uncategorized",node:k.describeNode(t),tag:t.tagName,nodeType:t.nodeType,attribute:s,value:r,oldValue:e.oldValue,transformedValue:d.attributes[s],excludeAttribute:this.excludeAttribute,propValue:o,isBooleanAttr:l,inDOM:a,isVisible:c,isExcludeAttributeName:u}),s==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(y){this.unattachedDoc=this.doc}const m=this.unattachedDoc.createElement("span");e.oldValue&&m.setAttribute("style",e.oldValue);for(const y of Array.from(t.style)){const p=t.style.getPropertyValue(y),g=t.style.getPropertyPriority(y);p!==m.style.getPropertyValue(y)||g!==m.style.getPropertyPriority(y)?g===""?d.styleDiff[y]=p:d.styleDiff[y]=[p,g]:d._unchangedStyles[y]=[p,g]}for(const y of Array.from(m.style))t.style.getPropertyValue(y)===""&&(d.styleDiff[y]=!1)}else s==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?d.attributes.rr_open_mode="modal":d.attributes.rr_open_mode="non-modal");break}case"childList":{if(le(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const s=this.mirror.getId(t),r=Ot(e.target)?this.mirror.getId(k.host(e.target)):this.mirror.getId(e.target);le(e.target,this.blockClass,this.blockSelector,!1)||Ds(t,this.mirror,this.slimDOMOptions)||!Gl(t,this.mirror)||(this.addedSet.has(t)?(xr(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&s===-1||ln(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Fo(s,r)]?xr(this.movedSet,t):(this.removes.push({parentId:r,id:s,isShadow:Ot(e.target)&&Dt(e.target)?!0:void 0}),Hg(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}}),b(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Ds(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let s=null;t&&this.mirror.hasNode(t)&&(s=this.mirror.getId(t)),s&&s!==-1&&(this.movedMap[Fo(this.mirror.getId(e),s)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);le(e,this.blockClass,this.blockSelector,!1)||(k.childNodes(e).forEach(s=>this.genAdds(s)),Ue(e)&&k.childNodes(k.shadowRoot(e)).forEach(s=>{this.processedNodeManager.add(s,this),this.genAdds(s,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","excludeAttribute","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","selectorOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}resetBuffers(){this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.mapRemoves=[],this.movedMap={},this.attributes=[],this.texts=[],this.attributeMap=new WeakMap,this.removes=[]}unsetFrozen(){this.frozen=!1,this.canvasManager.unfreeze()}}function xr(i,e){i.delete(e),k.childNodes(e).forEach(t=>xr(i,t))}function Hg(i,e){const t=[i];for(;t.length;){const s=t.pop();e.has(s)||(e.add(s),k.childNodes(s).forEach(r=>t.push(r)))}}function zo(i,e,t){return i.size===0?!1:Gg(i,e)}function Gg(i,e,t){const s=k.parentNode(e);return s?i.has(s):!1}function Bo(i,e){return i.size===0?!1:tc(i,e)}function tc(i,e){const t=k.parentNode(e);return t?i.has(t)?!0:tc(i,t):!1}let kt;function jg(i){kt=i}function Yg(){kt=void 0}const L=i=>kt?(...t)=>{try{return i(...t)}catch(s){if(kt&&kt(s)===!0)return;throw s}}:i,we=[];function yt(i){try{if("composedPath"in i){const e=i.composedPath();if(e.length)return e[0]}else if("path"in i&&i.path.length)return i.path[0]}catch(e){}return i&&i.target}function sc(i,e){const t=new Vg;we.push(t),t.init(i);const s=new(rn())(L(t.processMutations.bind(t)));return s.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function Zg({mousemoveCb:i,sampling:e,doc:t,mirror:s}){if(e.mousemove===!1)return()=>{};const r=typeof e.mousemove=="number"?e.mousemove:50,n=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let o=[],l;const a=gt(L(h=>{const d=Date.now()-l;i(o.map(f=>(f.timeOffset-=d,f)),h),o=[],l=null}),n),c=L(gt(L(h=>{const d=yt(h),{clientX:f,clientY:m}=Zs(h)?h.changedTouches[0]:h;l||(l=ye()),o.push({x:f,y:m,id:s.getId(d),timeOffset:ye()-l}),a(typeof DragEvent!="undefined"&&h instanceof DragEvent?E.Drag:h instanceof MouseEvent?E.MouseMove:E.TouchMove)}),r,{trailing:!1})),u=[ne("mousemove",c,t),ne("touchmove",c,t),ne("drag",c,t)];return L(()=>{u.forEach(h=>h())})}function Xg({mouseInteractionCb:i,doc:e,mirror:t,blockClass:s,blockSelector:r,sampling:n}){if(n.mouseInteraction===!1)return()=>{console.debug("MouseInteractionObserver: No operation needed")};const o=n.mouseInteraction===!0||n.mouseInteraction===void 0?{}:n.mouseInteraction,l=[];let a=null;const c=u=>h=>{const d=yt(h);if(le(d,s,r,!0))return;let f=null,m=u;if("pointerType"in h){switch(h.pointerType){case"mouse":f=Te.Mouse;break;case"touch":f=Te.Touch;break;case"pen":f=Te.Pen;break}f===Te.Touch?H[u]===H.MouseDown?m="TouchStart":H[u]===H.MouseUp&&(m="TouchEnd"):Te.Pen}else Zs(h)&&(f=Te.Touch);f!==null?(a=f,(m.startsWith("Touch")&&f===Te.Touch||m.startsWith("Mouse")&&f===Te.Mouse)&&(f=null)):H[u]===H.Click&&(f=a,a=null);const y=Zs(h)?h.changedTouches[0]:h;if(!y)return;const p=t.getId(d),{clientX:g,clientY:S}=y;L(i)(A({type:H[m],id:p,x:g,y:S},f!==null&&{pointerType:f}))};return Object.keys(H).filter(u=>Number.isNaN(Number(u))&&!u.endsWith("_Departed")&&o[u]!==!1).forEach(u=>{let h=Ge(u);const d=c(u);if(window.PointerEvent)switch(H[u]){case H.MouseDown:case H.MouseUp:h=h.replace("mouse","pointer");break;case H.TouchStart:case H.TouchEnd:return}l.push(ne(h,d,e))}),L(()=>{l.forEach(u=>u())})}function ic({scrollCb:i,doc:e,mirror:t,blockClass:s,blockSelector:r,sampling:n}){const o=L(gt(L(l=>{const a=yt(l);if(!a||le(a,s,r,!0))return;const c=t.getId(a);if(a===e&&e.defaultView){const u=nn(e.defaultView);i({id:c,x:u.left,y:u.top})}else i({id:c,x:a.scrollLeft,y:a.scrollTop})}),n.scroll||100));return ne("scroll",o,e)}function Jg({viewportResizeCb:i},{win:e}){let t=-1,s=-1;const r=L(gt(L(()=>{const n=on(),o=an();(t!==n||s!==o)&&(i({width:Number(o),height:Number(n)}),t=n,s=o)}),200));return ne("resize",r,e)}function qg({navigationCb:i,doc:e,sampling:t}){var u;if(t.navigation===!1)return()=>{};const s=e.defaultView;if(!s)return()=>{};let r=s.location.href;const n=[],o=L(h=>{const d=s.location.href;d!==r&&(i({href:d,oldHref:r,navigationType:h}),r=d)}),l=ke(s.history,"pushState",function(h){return function(...d){const f=h.apply(this,d);return o("pushState"),f}});n.push(l);const a=ke(s.history,"replaceState",function(h){return function(...d){const f=h.apply(this,d);return o("replaceState"),f}});if(n.push(a),n.push(ne("popstate",()=>o("popstate"),s)),n.push(ne("hashchange",()=>o("hashchange"),s)),(typeof t.navigation=="object"&&(u=t.navigation.useNavigationAPI)!=null?u:!0)&&"navigation"in s)try{const h=s.navigation,d=f=>{var m;const y=f;if(y.navigationType==="push"||y.navigationType==="replace"){const p=(m=y.destination)==null?void 0:m.url;p&&p!==r&&(i({href:p,oldHref:r,navigationType:"navigate"}),r=p)}};h.addEventListener("navigate",d),n.push(()=>h.removeEventListener("navigate",d))}catch(h){}return L(()=>{n.forEach(h=>h())})}const Li=["INPUT","TEXTAREA","SELECT"],Wo=new WeakMap,Kg=["Enter","Tab","Escape","ArrowDown","ArrowUp","Delete"],Uo=new WeakMap;function Qg({inputCb:i,doc:e,mirror:t,blockClass:s,blockSelector:r,ignoreClass:n,ignoreSelector:o,maskInputOptions:l,maskInputFn:a,sampling:c,userTriggeredOnInput:u}){function h(v){let w=yt(v);const C=v.isTrusted,x=w&&w.tagName;if(w&&x==="OPTION"&&(w=k.parentElement(w)),!w||!x||Li.indexOf(x)<0||le(w,s,r,!0)||w.classList.contains(n)||o&&w.matches(o))return;let R=w.value,T=!1;const z=_s(w)||"";z==="radio"||z==="checkbox"?T=w.checked:(l[x.toLowerCase()]||l[z])&&(R=ks({element:w,maskInputOptions:l,tagName:x,type:z,value:R,maskInputFn:a})),d(w,u?{text:R,isChecked:T,userTriggered:C}:{text:R,isChecked:T});const U=w.name;z==="radio"&&U&&T&&e.querySelectorAll(`input[type="radio"][name="${U}"]`).forEach(P=>{if(P!==w){const j=P.value;d(P,u?{text:j,isChecked:!T,userTriggered:!1}:{text:j,isChecked:!T})}})}function d(v,w){const C=Wo.get(v),x=v,R=x.hasAttribute("placeholder"),T=x.value==="",z=typeof x.defaultValue=="string"?x.defaultValue==="":!0,U=!w.userTriggered,P=!C||C.text==="",j=R&&T&&z&&P&&U&&!w.isChecked&&x.type!=="hidden"&&Li.includes(x.tagName),J=x.tagName==="INPUT"&&x.type==="text"&&!w.userTriggered&&w.text===x.defaultValue&&!C&&x.hasAttribute("placeholder"),ie=!w.userTriggered&&x.value===x.defaultValue&&!C&&x.hasAttribute("placeholder")&&!w.isChecked&&x.type!=="hidden"&&Li.includes(x.tagName),N=x.type==="checkbox"&&!w.userTriggered&&!w.isChecked&&!C,F=x.type==="radio"&&!w.userTriggered&&!w.isChecked&&!C;if(j||J||ie||N||F){console.debug(`[${ye()}] [rrweb:record/observer] \u26D4 phantom input ignored`,{node:k.describeNode(x),tag:x.tagName,nodeType:x.nodeType,attribute:x.attributes,value:x.value,isLikelyPhantom:j,isRenderDrivenTextInput:J,isValueFromDefault:ie,isPhantomCheckbox:N,isPhantomRadio:F});return}if(!C||C.text!==w.text||C.isChecked!==w.isChecked){Wo.set(v,w);const W=t.getId(v);L(i)(re(A({},w),{id:W}))}}const m=(c.input==="last"?["change"]:["input","change"]).map(v=>ne(v,L(h),e)),y=v=>{const w=yt(v);if(!w||!w.tagName)return;if(c.input==="all"){h(v);return}const C=w.tagName,x=v.key,R=Kg.includes(x),T=C==="TEXTAREA",z=e.activeElement===w,U=w.value,P=Uo.get(w);if(Uo.set(w,U),!z){h(v);return}if(R){if(!T){h(v);return}let j=P!=null?P:"",J=0;const ie=2,N=()=>{const F=w.value,W=e.activeElement===w,q=F!==j;if(!W){h(v);return}if(q)J=0,j=F;else if(J++,J>=ie){h(v);return}requestAnimationFrame(N)};requestAnimationFrame(N);return}};m.push(ne("keydown",L(y),e));const p=e.defaultView;if(!p)return()=>{m.forEach(v=>v())};const g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value"),S=[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&m.push(...S.map(v=>qt(v[0],v[1],{set(){L(h)({target:this,isTrusted:!1})}},!1,p))),L(()=>{m.forEach(v=>v())})}function Xs(i){const e=[];function t(s,r){if(Es("CSSGroupingRule")&&s.parentRule instanceof CSSGroupingRule||Es("CSSMediaRule")&&s.parentRule instanceof CSSMediaRule||Es("CSSSupportsRule")&&s.parentRule instanceof CSSSupportsRule||Es("CSSConditionRule")&&s.parentRule instanceof CSSConditionRule){const o=Array.from(s.parentRule.cssRules).indexOf(s);r.unshift(o)}else if(s.parentStyleSheet){const o=Array.from(s.parentStyleSheet.cssRules).indexOf(s);r.unshift(o)}return r}return t(i,e)}function ze(i,e,t){let s,r;return i?(i.ownerNode?s=e.getId(i.ownerNode):r=t.getId(i),{styleId:r,id:s}):{}}function ey({styleSheetRuleCb:i,mirror:e,stylesheetManager:t},{win:s}){if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};const r=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(r,{apply:L((u,h,d)=>{const[f,m]=d,{id:y,styleId:p}=ze(h,e,t.styleMirror);return(y&&y!==-1||p&&p!==-1)&&i({id:y,styleId:p,adds:[{rule:f,index:m}]}),u.apply(h,d)})}),s.CSSStyleSheet.prototype.addRule=function(u,h,d=this.cssRules.length){const f=`${u} { ${h} }`;return s.CSSStyleSheet.prototype.insertRule.apply(this,[f,d])};const n=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(n,{apply:L((u,h,d)=>{const[f]=d,{id:m,styleId:y}=ze(h,e,t.styleMirror);return(m&&m!==-1||y&&y!==-1)&&i({id:m,styleId:y,removes:[{index:f}]}),u.apply(h,d)})}),s.CSSStyleSheet.prototype.removeRule=function(u){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[u])};let o;s.CSSStyleSheet.prototype.replace&&(o=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:L((u,h,d)=>{const[f]=d,{id:m,styleId:y}=ze(h,e,t.styleMirror);return(m&&m!==-1||y&&y!==-1)&&i({id:m,styleId:y,replace:f}),u.apply(h,d)})}));let l;s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:L((u,h,d)=>{const[f]=d,{id:m,styleId:y}=ze(h,e,t.styleMirror);return(m&&m!==-1||y&&y!==-1)&&i({id:m,styleId:y,replaceSync:f}),u.apply(h,d)})}));const a={};Ms("CSSGroupingRule")?a.CSSGroupingRule=s.CSSGroupingRule:(Ms("CSSMediaRule")&&(a.CSSMediaRule=s.CSSMediaRule),Ms("CSSConditionRule")&&(a.CSSConditionRule=s.CSSConditionRule),Ms("CSSSupportsRule")&&(a.CSSSupportsRule=s.CSSSupportsRule));const 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:L((d,f,m)=>{const[y,p]=m,{id:g,styleId:S}=ze(f.parentStyleSheet,e,t.styleMirror);return(g&&g!==-1||S&&S!==-1)&&i({id:g,styleId:S,adds:[{rule:y,index:[...Xs(f),p||0]}]}),d.apply(f,m)})}),h.prototype.deleteRule=new Proxy(c[u].deleteRule,{apply:L((d,f,m)=>{const[y]=m,{id:p,styleId:g}=ze(f.parentStyleSheet,e,t.styleMirror);return(p&&p!==-1||g&&g!==-1)&&i({id:p,styleId:g,removes:[{index:[...Xs(f),y]}]}),d.apply(f,m)})})}),L(()=>{s.CSSStyleSheet.prototype.insertRule=r,s.CSSStyleSheet.prototype.deleteRule=n,o&&(s.CSSStyleSheet.prototype.replace=o),l&&(s.CSSStyleSheet.prototype.replaceSync=l),Object.entries(a).forEach(([u,h])=>{h.prototype.insertRule=c[u].insertRule,h.prototype.deleteRule=c[u].deleteRule})})}function rc({mirror:i,stylesheetManager:e},t){var s,r,n;let o=null;t.nodeName==="#document"?o=i.getId(t):o=i.getId(k.host(t));const l=t.nodeName==="#document"?(s=t.defaultView)==null?void 0:s.Document:(n=(r=t.ownerDocument)==null?void 0:r.defaultView)==null?void 0:n.ShadowRoot,a=l!=null&&l.prototype?Object.getOwnPropertyDescriptor(l==null?void 0: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;const h=(u=a.set)==null?void 0:u.call(this,c);if(o!==null&&o!==-1)try{e.adoptStyleSheets(c,o)}catch(d){}return h}}),L(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function ty({styleDeclarationCb:i,mirror:e,ignoreCSSAttributes:t,stylesheetManager:s},{win:r}){const n=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=new Proxy(n,{apply:L((l,a,c)=>{var u;const[h,d,f]=c;if(t.has(h))return n.apply(a,[h,d,f]);const{id:m,styleId:y}=ze((u=a.parentRule)==null?void 0:u.parentStyleSheet,e,s.styleMirror);return(m&&m!==-1||y&&y!==-1)&&i({id:m,styleId:y,set:{property:h,value:d,priority:f},index:Xs(a.parentRule)}),l.apply(a,c)})});const o=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:L((l,a,c)=>{var u;const[h]=c;if(t.has(h))return o.apply(a,[h]);const{id:d,styleId:f}=ze((u=a.parentRule)==null?void 0:u.parentStyleSheet,e,s.styleMirror);return(d&&d!==-1||f&&f!==-1)&&i({id:d,styleId:f,remove:{property:h},index:Xs(a.parentRule)}),l.apply(a,c)})}),L(()=>{r.CSSStyleDeclaration.prototype.setProperty=n,r.CSSStyleDeclaration.prototype.removeProperty=o})}function sy({mediaInteractionCb:i,blockClass:e,blockSelector:t,mirror:s,sampling:r,doc:n}){const o=L(a=>gt(L(c=>{const u=yt(c);if(!u||le(u,e,t,!0))return;const{currentTime:h,volume:d,muted:f,playbackRate:m,loop:y}=u;i({type:a,id:s.getId(u),currentTime:h,volume:d,muted:f,playbackRate:m,loop:y})}),r.media||500)),l=[ne("play",o(Be.Play),n),ne("pause",o(Be.Pause),n),ne("seeked",o(Be.Seeked),n),ne("volumechange",o(Be.VolumeChange),n),ne("ratechange",o(Be.RateChange),n)];return L(()=>{l.forEach(a=>a())})}function iy({fontCb:i,doc:e}){const t=e.defaultView;if(!t)return()=>{};const s=[],r=new WeakMap,n=t.FontFace;t.FontFace=function(a,c,u){const h=new n(a,c,u);return r.set(h,{family:a,buffer:typeof c!="string",descriptors:u,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(ArrayBuffer.isView(c)?new Uint8Array(c.buffer,c.byteOffset,c.byteLength):new Uint8Array(c)))}),h};const o=ke(e.fonts,"add",function(l){return function(a){return setTimeout(L(()=>{const c=r.get(a);c&&(i(c),r.delete(a))}),0),l.apply(this,[a])}});return s.push(()=>{t.FontFace=n}),s.push(o),L(()=>{s.forEach(l=>l())})}function ry(i){const{doc:e,mirror:t,blockClass:s,blockSelector:r,selectionCb:n}=i;let o=!0;const l=L(()=>{const a=e.getSelection();if(!a||o&&(a!=null&&a.isCollapsed))return;o=a.isCollapsed||!1;const c=[],u=a.rangeCount||0;for(let h=0;h<u;h++){const d=a.getRangeAt(h),{startContainer:f,startOffset:m,endContainer:y,endOffset:p}=d;le(f,s,r,!0)||le(y,s,r,!0)||c.push({start:t.getId(f),startOffset:m,end:t.getId(y),endOffset:p})}n({ranges:c})});return l(),ne("selectionchange",l)}function ny({doc:i,customElementCb:e}){const t=i.defaultView;return!t||!t.customElements?()=>{}:ke(t.customElements,"define",function(r){return function(n,o,l){try{e({define:{name:n}})}catch(a){console.warn(`Custom element callback failed for ${n}`)}return r.apply(this,[n,o,l])}})}function oy(i,e){const{mutationCb:t,mousemoveCb:s,mouseInteractionCb:r,scrollCb:n,viewportResizeCb:o,navigationCb:l,inputCb:a,mediaInteractionCb:c,styleSheetRuleCb:u,styleDeclarationCb:h,canvasMutationCb:d,fontCb:f,selectionCb:m,customElementCb:y}=i;i.mutationCb=(...p)=>{e.mutation&&e.mutation(...p),t(...p)},i.mousemoveCb=(...p)=>{e.mousemove&&e.mousemove(...p),s(...p)},i.mouseInteractionCb=(...p)=>{e.mouseInteraction&&e.mouseInteraction(...p),r(...p)},i.scrollCb=(...p)=>{e.scroll&&e.scroll(...p),n(...p)},i.viewportResizeCb=(...p)=>{e.viewportResize&&e.viewportResize(...p),o(...p)},i.navigationCb=(...p)=>{e.navigation&&e.navigation(...p),l(...p)},i.inputCb=(...p)=>{e.input&&e.input(...p),a(...p)},i.mediaInteractionCb=(...p)=>{e.mediaInteaction&&e.mediaInteaction(...p),c(...p)},i.styleSheetRuleCb=(...p)=>{e.styleSheetRule&&e.styleSheetRule(...p),u(...p)},i.styleDeclarationCb=(...p)=>{e.styleDeclaration&&e.styleDeclaration(...p),h(...p)},i.canvasMutationCb=(...p)=>{e.canvasMutation&&e.canvasMutation(...p),d(...p)},i.fontCb=(...p)=>{e.font&&e.font(...p),f(...p)},i.selectionCb=(...p)=>{e.selection&&e.selection(...p),m(...p)},i.customElementCb=(...p)=>{e.customElement&&e.customElement(...p),y(...p)}}function ay(i,e={}){const t=i.doc.defaultView;if(!t)return()=>{};oy(i,e);let s;i.recordDOM&&(s=sc(i,i.doc));const r=Zg(i),n=Xg(i),o=ic(i),l=Jg(i,{win:t}),a=qg(i),c=Qg(i),u=sy(i);let h=()=>{},d=()=>{},f=()=>{},m=()=>{};i.recordDOM&&(h=ey(i,{win:t}),d=rc(i,i.doc),f=ty(i,{win:t}),i.collectFonts&&(m=iy(i)));const y=ry(i),p=ny(i),g=[];for(const S of i.plugins)g.push(S.observer(S.callback,t,S.options));return L(()=>{var S;we.forEach(v=>v.reset()),(S=i.visibilityManager)==null||S.reset(),s==null||s.disconnect(),r(),n(),o(),l(),a(),c(),u(),h(),d(),f(),m(),y(),p(),g.forEach(v=>v())})}function Es(i){return typeof window[i]!="undefined"}function Ms(i){return!!(typeof window[i]!="undefined"&&window[i].prototype&&"insertRule"in window[i].prototype&&"deleteRule"in window[i].prototype)}class Vo{constructor(e){b(this,"iframeIdToRemoteIdMap",new WeakMap),b(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,s,r){const n=s||this.getIdToRemoteIdMap(e),o=r||this.getRemoteIdToIdMap(e);let l=n.get(t);return l||(l=this.generateIdFn(),n.set(t,l),o.set(l,t)),l}getIds(e,t){const s=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(n=>this.getId(e,n,s,r))}getRemoteId(e,t,s){const r=s||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;const n=r.get(t);return n||-1}getRemoteIds(e,t){const s=this.getRemoteIdToIdMap(e);return t.map(r=>this.getRemoteId(e,r,s))}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}}class ly{constructor(e){b(this,"iframes",new WeakMap),b(this,"crossOriginIframeMap",new WeakMap),b(this,"crossOriginIframeMirror",new Vo(da)),b(this,"crossOriginIframeStyleMirror"),b(this,"crossOriginIframeRootIdMap",new WeakMap),b(this,"mirror"),b(this,"mutationCb"),b(this,"wrappedEmit"),b(this,"loadListener"),b(this,"stylesheetManager"),b(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Vo(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var s,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((s=e.contentWindow)==null||s.addEventListener("message",this.handleMessage.bind(this))),(r=this.loadListener)==null||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if(t.data.type!=="rrweb"||!e.source)return;const r=this.crossOriginIframeMap.get(e.source);if(!r)return;const n=this.transformCrossOriginEvent(r,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var s;switch(t.type){case I.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const r=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(t.data.node,r),{timestamp:t.timestamp,type:I.IncrementalSnapshot,data:{source:E.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case I.Meta:case I.Load:case I.DomContentLoaded:return!1;case I.Plugin:return t;case I.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case I.IncrementalSnapshot:switch(t.data.source){case E.Mutation:return t.data.adds.forEach(r=>{this.replaceIds(r,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(r.node,n)}),t.data.removes.forEach(r=>{this.replaceIds(r,e,["parentId","id"])}),t.data.attributes.forEach(r=>{this.replaceIds(r,e,["id"])}),t.data.texts.forEach(r=>{this.replaceIds(r,e,["id"])}),t;case E.Drag:case E.TouchMove:case E.MouseMove:return t.data.positions.forEach(r=>{this.replaceIds(r,e,["id"])}),t;case E.ViewportResize:return!1;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(r=>{this.replaceIds(r,e,["start","end"])}),t;case E.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(s=t.data.styles)==null||s.forEach(r=>{this.replaceStyleIds(r,e,["styleId"])}),t}}return!1}replace(e,t,s,r){for(const n of r)!Array.isArray(t[n])&&typeof t[n]!="number"||(Array.isArray(t[n])?t[n]=e.getIds(s,t[n]):t[n]=e.getId(s,t[n]));return t}replaceIds(e,t,s){return this.replace(this.crossOriginIframeMirror,e,t,s)}replaceStyleIds(e,t,s){return this.replace(this.crossOriginIframeStyleMirror,e,t,s)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(s=>{this.replaceIdOnNode(s,t)})}patchRootIdOnNode(e,t){e.type!==Oe.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(s=>{this.patchRootIdOnNode(s,t)})}}class cy{constructor(e){b(this,"shadowDoms",new WeakSet),b(this,"mutationCb"),b(this,"scrollCb"),b(this,"bypassOptions"),b(this,"mirror"),b(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(!Dt(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const s=sc(re(A({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push(()=>s.disconnect()),this.restoreHandlers.push(ic(re(A({},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(k.host(e))),this.restoreHandlers.push(rc({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){const s=this;this.restoreHandlers.push(ke(e.prototype,"attachShadow",function(r){return function(n){const o=r.call(this,n),l=k.shadowRoot(this);return l&&mn(this)&&s.addShadowRoot(l,t),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}var at="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Nt=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var As=0;As<at.length;As++)Nt[at.charCodeAt(As)]=As;var uy=function(i){var e=new Uint8Array(i),t,s=e.length,r="";for(t=0;t<s;t+=3)r+=at[e[t]>>2],r+=at[(e[t]&3)<<4|e[t+1]>>4],r+=at[(e[t+1]&15)<<2|e[t+2]>>6],r+=at[e[t+2]&63];return s%3===2?r=r.substring(0,r.length-1)+"=":s%3===1&&(r=r.substring(0,r.length-2)+"=="),r},hy=function(i){var e=i.length*.75,t=i.length,s,r=0,n,o,l,a;i[i.length-1]==="="&&(e--,i[i.length-2]==="="&&e--);var c=new ArrayBuffer(e),u=new Uint8Array(c);for(s=0;s<t;s+=4)n=Nt[i.charCodeAt(s)],o=Nt[i.charCodeAt(s+1)],l=Nt[i.charCodeAt(s+2)],a=Nt[i.charCodeAt(s+3)],u[r++]=n<<2|o>>4,u[r++]=(o&15)<<4|l>>2,u[r++]=(l&3)<<6|a&63;return c};const Ho=new Map;function dy(i,e){let t=Ho.get(i);return t||(t=new Map,Ho.set(i,t)),t.has(e)||t.set(e,[]),t.get(e)}const nc=(i,e,t)=>{if(!i||!(ac(i,e)||typeof i=="object"))return;const s=i.constructor.name,r=dy(t,s);let n=r.indexOf(i);return n===-1&&(n=r.length,r.push(i)),n};function $s(i,e,t){if(i instanceof Array)return i.map(s=>$s(s,e,t));if(i===null)return i;if(i instanceof Float32Array||i instanceof Float64Array||i instanceof Int32Array||i instanceof Uint32Array||i instanceof Uint8Array||i instanceof Uint16Array||i instanceof Int16Array||i instanceof Int8Array||i instanceof Uint8ClampedArray)return{rr_type:i.constructor.name,args:[Object.values(i)]};if(i instanceof ArrayBuffer){const s=i.constructor.name,r=uy(i);return{rr_type:s,base64:r}}else{if(i instanceof DataView)return{rr_type:i.constructor.name,args:[$s(i.buffer,e,t),i.byteOffset,i.byteLength]};if(i instanceof HTMLImageElement){const s=i.constructor.name,{src:r}=i;return{rr_type:s,src:r}}else if(i instanceof HTMLCanvasElement){const s="HTMLImageElement",r=i.toDataURL();return{rr_type:s,src:r}}else{if(i instanceof ImageData)return{rr_type:i.constructor.name,args:[$s(i.data,e,t),i.width,i.height]};if(ac(i,e)||typeof i=="object"){const s=i.constructor.name,r=nc(i,e,t);return{rr_type:s,index:r}}}}return i}const oc=(i,e,t)=>i.map(s=>$s(s,e,t)),ac=(i,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(r=>typeof e[r]=="function").find(r=>i instanceof e[r]);function fy(i,e,t,s){const r=[],n=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const o of n)try{if(typeof e.CanvasRenderingContext2D.prototype[o]!="function")continue;const l=ke(e.CanvasRenderingContext2D.prototype,o,function(a){return function(...c){return le(this.canvas,t,s,!0)||setTimeout(()=>{const u=oc(c,e,this);i(this.canvas,{type:_e["2D"],property:o,args:u})},0),a.apply(this,c)}});r.push(l)}catch(l){const a=qt(e.CanvasRenderingContext2D.prototype,o,{set(c){i(this.canvas,{type:_e["2D"],property:o,args:[c],setter:!0})}});r.push(a)}return()=>{r.forEach(o=>o())}}function py(i){return i==="experimental-webgl"?"webgl":i}function Go(i,e,t,s){const r=[];try{const n=ke(i.HTMLCanvasElement.prototype,"getContext",function(o){return function(l,...a){if(!le(this,e,t,!0)){const c=py(l);if("__context"in this||(this.__context=c),s&&["webgl","webgl2"].includes(c))if(a[0]&&typeof a[0]=="object"){const u=a[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0})}return o.apply(this,[l,...a])}});r.push(n)}catch(n){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(n=>n())}}function jo(i,e,t,s,r,n){const o=[],l=Object.getOwnPropertyNames(i);for(const a of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))try{if(typeof i[a]!="function")continue;const c=ke(i,a,function(u){return function(...h){const d=u.apply(this,h);if(nc(d,n,this),"tagName"in this.canvas&&!le(this.canvas,s,r,!0)){const f=oc(h,n,this),m={type:e,property:a,args:f};t(this.canvas,m)}return d}});o.push(c)}catch(c){const u=qt(i,a,{set(h){t(this.canvas,{type:e,property:a,args:[h],setter:!0})}});o.push(u)}return o}function my(i,e,t,s){const r=[];return r.push(...jo(e.WebGLRenderingContext.prototype,_e.WebGL,i,t,s,e)),typeof e.WebGL2RenderingContext!="undefined"&&r.push(...jo(e.WebGL2RenderingContext.prototype,_e.WebGL2,i,t,s,e)),()=>{r.forEach(n=>n())}}const lc="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",gy=i=>Uint8Array.from(atob(i),e=>e.charCodeAt(0)),Yo=typeof self!="undefined"&&self.Blob&&new Blob([gy(lc)],{type:"text/javascript;charset=utf-8"});function yy(i){let e;try{if(e=Yo&&(self.URL||self.webkitURL).createObjectURL(Yo),!e)throw"";const t=new Worker(e,{name:i==null?void 0:i.name});return t.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),t}catch(t){return new Worker("data:text/javascript;base64,"+lc,{name:i==null?void 0:i.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class by{constructor(e){b(this,"pendingCanvasMutations",new Map),b(this,"rafStamps",{latestId:0,invokeId:null}),b(this,"mirror"),b(this,"mutationCb"),b(this,"resetObservers"),b(this,"frozen",!1),b(this,"locked",!1),b(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)});const{sampling:t="all",win:s,blockClass:r,blockSelector:n,recordCanvas:o,dataURLOptions:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&t==="all"&&this.initCanvasMutationObserver(s,r,n),o&&typeof t=="number"&&this.initCanvasFPSObserver(t,s,r,n,{dataURLOptions:l})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,s,r,n){const o=Go(t,s,r,!0),l=new Map,a=new yy;a.onmessage=m=>{const{id:y}=m.data;if(l.set(y,!1),!("base64"in m.data))return;const{base64:p,type:g,width:S,height:v}=m.data;this.mutationCb({id:y,type:_e["2D"],commands:[{property:"clearRect",args:[0,0,S,v]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:p}],type:g}]},0,0]}]})};const c=1e3/e;let u=0,h;const d=()=>{const m=[];return t.document.querySelectorAll("canvas").forEach(y=>{le(y,s,r,!0)||m.push(y)}),m},f=m=>{if(u&&m-u<c){h=requestAnimationFrame(f);return}u=m,d().forEach(async y=>{var p;const g=this.mirror.getId(y);if(l.get(g)||y.width===0||y.height===0)return;if(l.set(g,!0),["webgl","webgl2"].includes(y.__context)){const v=y.getContext(y.__context);((p=v==null?void 0:v.getContextAttributes())==null?void 0:p.preserveDrawingBuffer)===!1&&v.clear(v.COLOR_BUFFER_BIT)}const S=await createImageBitmap(y);a.postMessage({id:g,bitmap:S,width:y.width,height:y.height,dataURLOptions:n.dataURLOptions},[S])}),h=requestAnimationFrame(f)};h=requestAnimationFrame(f),this.resetObservers=()=>{o(),cancelAnimationFrame(h)}}initCanvasMutationObserver(e,t,s){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=Go(e,t,s,!1),n=fy(this.processMutation.bind(this),e,t,s),o=my(this.processMutation.bind(this),e,t,s);this.resetObservers=()=>{r(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const s=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,s)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const s=this.pendingCanvasMutations.get(e);if(!s||t===-1)return;const r=s.map(o=>{const c=o,{type:l}=c;return Qe(c,["type"])}),{type:n}=s[0];this.mutationCb({id:t,type:n,commands:r}),this.pendingCanvasMutations.delete(e)}}function Zo(i,e,t){var u,h,d,f,m,y;const s=(u=t==null?void 0:t.root)!=null?u:null,r=(h=t==null?void 0:t.threshold)!=null?h:.5,n=(d=t==null?void 0:t.sensitivity)!=null?d:.05,o=wy((f=t==null?void 0:t.rootMargin)!=null?f:"0px"),l=new Map,a=vy(s),c=Sy(a,o);for(const p of i){const g=p.getBoundingClientRect();let S=Ey(),v=0;g.width>0&&g.height>0&&(S=Cy(g,c),v=xy(g,S),v=Math.round(v*100)/100);const w=My(p),C=(m=e.get(p))!=null?m:null,x=(y=C==null?void 0:C.intersectionRatio)!=null?y:0,R=v,T=(C==null?void 0:C.isStyleVisible)&&x>r,z=w&&R>r;!C||T!==z||T!==z&&Math.abs(R-x)>n?l.set(p,{target:p,isVisible:z,isStyleVisible:w,intersectionRatio:R,intersectionRect:S,oldValue:C}):l.set(p,C)}return l}function wy(i){const e=i.trim().split(/\s+/),t=(s,r)=>s.endsWith("%")?parseFloat(s)/100*r:parseFloat(s)||0;return function(s){const r=t(e[0]||"0px",s.height),n=t(e[1]||e[0]||"0px",s.width),o=t(e[2]||e[0]||"0px",s.height),l=t(e[3]||e[1]||e[0]||"0px",s.width);return{top:r,right:n,bottom:o,left:l,width:0,height:0}}}function vy(i){return i?i.getBoundingClientRect():new DOMRect(0,0,window.innerWidth,window.innerHeight)}function Sy(i,e){const t=e(i);return new DOMRect(i.left-t.left,i.top-t.top,i.width+t.left+t.right,i.height+t.top+t.bottom)}function Cy(i,e){const t=Math.max(i.top,e.top),s=Math.max(i.left,e.left),r=Math.min(i.bottom,e.bottom),n=Math.min(i.right,e.right),o=Math.max(0,n-s),l=Math.max(0,r-t);return{top:t,left:s,bottom:r,right:n,width:o,height:l}}function xy(i,e){const t=i.width*i.height,s=e.width*e.height;return t>0?s/t:0}function Ey(){return{top:0,left:0,right:0,bottom:0,width:0,height:0}}function My(i){const e=getComputedStyle(i);return e&&e.display!=="none"&&e.visibility!=="hidden"&&parseFloat(e.opacity||"1")>0}class Ay{constructor(e){var c,u,h,d,f,m;b(this,"frozen",!1),b(this,"locked",!1),b(this,"pending",new Map),b(this,"mirror"),b(this,"mutationCb"),b(this,"rafId",null),b(this,"intervalId",null),b(this,"rafThrottle"),b(this,"lastFlushTime",0),b(this,"elements",new Set),b(this,"previousState",new Map),b(this,"root",null),b(this,"threshold"),b(this,"sensitivity"),b(this,"rootMargin"),b(this,"hasInitialized",!1),b(this,"mode","none"),b(this,"debounce",50),b(this,"throttle",100),b(this,"buffer",new Map),b(this,"debounceTimer",null),b(this,"lastThrottleTime",0),b(this,"disabled",!1),b(this,"notifyActivity");const{doc:t,mirror:s,sampling:r,mutationCb:n,notifyActivity:o}=e;if(this.mirror=s,this.mutationCb=n,this.notifyActivity=o,this.rootMargin="0px",r===!1){this.disabled=!0;return}const l=typeof r=="object"&&r!==null?r:{};this.mode=(c=l==null?void 0:l.mode)!=null?c:"none",this.debounce=Number((u=l==null?void 0:l.debounce)!=null?u:100),this.throttle=Number((h=l==null?void 0:l.throttle)!=null?h:100),this.threshold=Number((d=l==null?void 0:l.threshold)!=null?d:.5),this.sensitivity=Number((f=l==null?void 0:l.sensitivity)!=null?f:.05),this.rafThrottle=Number((m=l==null?void 0:l.rafThrottle)!=null?m:50),t.querySelectorAll("*").forEach(y=>this.observe(y)),new MutationObserver(y=>{y.forEach(p=>{p.addedNodes.forEach(g=>{g.nodeType===Node.ELEMENT_NODE&&(this.observe(g),g.querySelectorAll("*").forEach(S=>this.observe(S)))}),p.removedNodes.forEach(g=>{g.nodeType===Node.ELEMENT_NODE&&this.unobserve(g)})})}).observe(t.body,{childList:!0,subtree:!0}),this.startPendingFlushLoop()}startPendingFlushLoop(){if(!this.disabled)if(typeof requestAnimationFrame=="function"){const e=t=>{t-this.lastFlushTime>=this.rafThrottle&&(this.lastFlushTime=t,this.flushPendingVisibilityMutations()),this.rafId=requestAnimationFrame(e)};this.rafId=requestAnimationFrame(e)}else{const e=()=>{const t=performance.now();t-this.lastFlushTime>=this.rafThrottle&&(this.lastFlushTime=t,this.flushPendingVisibilityMutations())};this.intervalId=setInterval(e,this.rafThrottle)}}flushPendingVisibilityMutations(){if(this.disabled||this.frozen||this.locked||this.elements.size===0)return;const e=Zo(this.elements,this.previousState,{root:this.root,threshold:this.threshold,sensitivity:this.sensitivity,rootMargin:this.rootMargin});for(const[t,s]of e.entries()){const r=this.previousState.get(t);if(!r||r.isVisible!==s.isVisible||Math.abs(r.intersectionRatio-s.intersectionRatio)>this.sensitivity){const o=this.mirror.getId(t);o!==-1&&this.buffer.set(t,{id:o,isVisible:s.isVisible,ratio:s.intersectionRatio}),this.previousState.set(t,s)}}if(this.previousState=e,!this.hasInitialized){this.hasInitialized=!0,this.buffer.clear();return}this.scheduleEmit()}scheduleEmit(){if(this.mode==="debounce")clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>this.flushBuffer(),this.debounce);else if(this.mode==="throttle"){const e=performance.now();e-this.lastThrottleTime>=this.throttle&&(this.lastThrottleTime=e,this.flushBuffer())}else this.flushBuffer()}flushBuffer(){var e;if(this.frozen||this.locked||this.buffer.size===0)return;const t=Array.from(this.buffer.values()),s=t.length;this.buffer.clear(),this.mutationCb({mutations:t}),(e=this.notifyActivity)==null||e.call(this,s)}observe(e){this.disabled||this.elements.add(e)}unobserve(e){this.disabled||(this.elements.delete(e),this.previousState.delete(e),this.pending.delete(e))}freeze(){this.frozen=!0,this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null)}unfreeze(){this.frozen=!1,this.flushPendingVisibilityMutations()}lock(){this.locked=!0,this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null)}unlock(){this.locked=!1,this.buffer.clear(),this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),!this.disabled&&this.elements.size>0&&(this.previousState=Zo(this.elements,new Map,{root:this.root,threshold:this.threshold,sensitivity:this.sensitivity,rootMargin:this.rootMargin}))}unsetFrozen(){this.frozen=!1}reset(){this.elements.clear(),this.previousState.clear(),this.pending.clear(),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)}}const Iy=150,Ny=5e3,Ry=100;class Ty{constructor(e){var n,o,l;b(this,"frozen",!1),b(this,"locked",!1),b(this,"disabled",!1),b(this,"settleTimeout"),b(this,"maxWait"),b(this,"debounceMs"),b(this,"settlingObserver",null),b(this,"debounceTimer",null),b(this,"settleCheckTimer",null),b(this,"maxWaitTimer",null),b(this,"lastMutationTime",0),b(this,"pendingNavigation",null),b(this,"doc"),b(this,"onSnapshot");const{doc:t,config:s,onSnapshot:r}=e;this.doc=t,this.onSnapshot=L(r),this.settleTimeout=(n=s.settleTimeout)!=null?n:Iy,this.maxWait=(o=s.maxWait)!=null?o:Ny,this.debounceMs=(l=s.debounce)!=null?l:Ry}handleNavigation(e){this.disabled||this.locked||(this.cancelTimers(),this.disconnectSettlingObserver(),this.pendingNavigation=e,!this.frozen&&this.startDebounce())}cancelPending(){this.cancelTimers(),this.disconnectSettlingObserver(),this.pendingNavigation=null}freeze(){this.frozen=!0,this.cancelTimers(),this.disconnectSettlingObserver()}unfreeze(){this.frozen=!1,this.pendingNavigation&&!this.locked&&!this.disabled&&this.startDebounce()}lock(){this.locked=!0,this.cancelTimers(),this.disconnectSettlingObserver()}unlock(){this.locked=!1,this.pendingNavigation=null}unsetFrozen(){this.frozen=!1}reset(){this.cancelTimers(),this.disconnectSettlingObserver(),this.pendingNavigation=null,this.frozen=!1,this.locked=!1}destroy(){const e=this.pendingNavigation!==null;this.reset(),this.disabled=!0,e&&this.onSnapshot(!0)}startDebounce(){this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.startDOMSettling()},this.debounceMs)}startDOMSettling(){if(this.frozen||this.locked||this.disabled)return;this.lastMutationTime=performance.now();const e=rn();this.settlingObserver=new e(()=>{this.lastMutationTime=performance.now(),this.settleCheckTimer!==null&&clearTimeout(this.settleCheckTimer),this.settleCheckTimer=setTimeout(()=>this.checkSettled(),this.settleTimeout)}),this.settlingObserver.observe(this.doc,{childList:!0,subtree:!0}),this.settleCheckTimer=setTimeout(()=>this.checkSettled(),this.settleTimeout),this.maxWaitTimer=setTimeout(()=>{this.maxWaitTimer=null,this.completeSettling()},this.maxWait)}checkSettled(){this.settleCheckTimer=null;const e=performance.now()-this.lastMutationTime;e>=this.settleTimeout?this.completeSettling():this.settleCheckTimer=setTimeout(()=>this.checkSettled(),this.settleTimeout-e)}completeSettling(){this.frozen||this.locked||this.disabled||this.pendingNavigation&&(this.cancelTimers(),this.disconnectSettlingObserver(),this.pendingNavigation=null,this.onSnapshot(!0))}cancelTimers(){this.debounceTimer!==null&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.settleCheckTimer!==null&&(clearTimeout(this.settleCheckTimer),this.settleCheckTimer=null),this.maxWaitTimer!==null&&(clearTimeout(this.maxWaitTimer),this.maxWaitTimer=null)}disconnectSettlingObserver(){this.settlingObserver&&(this.settlingObserver.disconnect(),this.settlingObserver=null)}}class Oy{constructor(e){b(this,"trackedLinkElements",new WeakSet),b(this,"mutationCb"),b(this,"adoptedStyleSheetCb"),b(this,"styleMirror",new fn),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;const s={id:t,styleIds:[]},r=[];for(const n of e){let o;this.styleMirror.has(n)?o=this.styleMirror.getId(n):(o=this.styleMirror.add(n),r.push({styleId:o,rules:Array.from(n.rules||CSSRule,(l,a)=>({rule:na(l,n.href),index:a}))})),s.styleIds.push(o)}r.length>0&&(s.styles=r),this.adoptedStyleSheetCb(s)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Dy{constructor(){b(this,"nodeMap",new WeakMap),b(this,"active",!1)}inOtherBuffer(e,t){const s=this.nodeMap.get(e);return s&&Array.from(s).some(r=>r!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}const $y="3.5.0-alpha.1";let te,Fe,Pi,jt=!1;const Js=[];let Rt;try{if(Array.from([1],i=>i*2)[0]!==2){const i=document.createElement("iframe");document.body.appendChild(i),Array.from=((In=i.contentWindow)==null?void 0:In.Array.from)||Array.from,document.body.removeChild(i)}}catch(i){console.debug("Unable to override Array.from",i)}const ge=oa();function de(i={}){const{emit:e,checkoutEveryNms:t,checkoutEveryNth:s,checkoutEveryNvm:r,checkoutDebounce:n,blockClass:o="rr-block",blockSelector:l=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,excludeAttribute:u,maskTextClass:h="rr-mask",maskTextSelector:d=null,inlineStylesheet:f=!0,maskAllInputs:m,maskInputOptions:y,slimDOMOptions:p,maskInputFn:g,maskTextFn:S,hooks:v,packFn:w,sampling:C={},dataURLOptions:x={},mousemoveWait:R,recordDOM:T=!0,recordCanvas:z=!1,recordCrossOriginIframes:U=!1,recordAfter:P=i.recordAfter==="DOMContentLoaded"?i.recordAfter:"load",flushCustomEvent:j=i.flushCustomEvent!==void 0?i.flushCustomEvent:"after",userTriggeredOnInput:J=!1,collectFonts:ie=!1,inlineImages:N=!1,plugins:F,keepIframeSrcFn:W=()=>!1,ignoreCSSAttributes:q=new Set([]),selector:ce,errorHandler:Le}=i;jg(Le);const be=U?window.parent===window:!0;let wt=!1;if(!be)try{window.parent.document&&(wt=!1)}catch(O){wt=!0}if(be&&!e)throw new Error("emit function is required");if(!be&&!wt)return()=>{};R!==void 0&&C.mousemove===void 0&&(C.mousemove=R),ge.reset();const di=u===void 0?/.^/:u,fi=m===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:y!==void 0?y:{password:!0},pi=p===!0||p==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:p==="all",headMetaDescKeywords:p==="all",headTitleMutations:p==="all"}:p||{},bn=zg(ce);cn();let wn,mi=0,Kt=0,vn=0,Pe=!1,fe=null,Ke=null;const Sn=O=>{for(const he of F||[])he.eventProcessor&&(O=he.eventProcessor(O));return w&&!wt&&(O=w(O)),O},Qt=()=>{fe=null,Pe=!1,Ke=null,ue==null||ue.cancelPending(),Fe(!0),we.forEach(O=>{O.resetBuffers(),O.unsetFrozen()}),ae&&ae.unsetFrozen(),ue&&ue.unsetFrozen()};te=(O,he)=>{var X;const K=O;if(K.timestamp=ye(),K.checkoutId=vn,(X=we[0])!=null&&X.isFrozen()&&!Pe&&K.type!==I.FullSnapshot&&!(K.type===I.IncrementalSnapshot&&K.data.source===E.Mutation)&&(we.forEach(me=>me.unfreeze()),ae==null||ae.unfreeze(),ue==null||ue.unfreeze()),be)e==null||e(Sn(K),he);else if(wt){const me={type:"rrweb",event:Sn(K),isCheckout:he};window.parent.postMessage(me,"*")}if(K.type===I.FullSnapshot)wn=K,mi=0,Kt=0;else if(K.type===I.IncrementalSnapshot){if(K.data.source===E.Mutation&&K.data.isAttachIframe)return;if(K.data.source!==E.Visibility){mi++;const me=s&&mi>=s,G=t&&K.timestamp-wn.timestamp>t;if(me||G)if(n){Pe||(Pe=!0,Ke=ye(),we.forEach(wc=>wc.freeze()),ae==null||ae.freeze()),fe&&clearTimeout(fe);const vt=ye()-Ke,bc=n*3;vt>=bc?Qt():fe=setTimeout(()=>Qt(),n)}else Fe(!0)}}};const es=O=>{te({type:I.IncrementalSnapshot,data:A({source:E.Mutation},O)})},mc=O=>{te({type:I.IncrementalSnapshot,data:A({source:E.Visibility},O)})},Cn=O=>te({type:I.IncrementalSnapshot,data:A({source:E.Scroll},O)}),xn=O=>te({type:I.IncrementalSnapshot,data:A({source:E.CanvasMutation},O)}),gc=O=>te({type:I.IncrementalSnapshot,data:A({source:E.AdoptedStyleSheet},O)}),Ze=new Oy({mutationCb:es,adoptedStyleSheetCb:gc}),Xe=new ly({mirror:ge,mutationCb:es,stylesheetManager:Ze,recordCrossOriginIframes:U,wrappedEmit:te});for(const O of F||[])O.getMirror&&O.getMirror({nodeMirror:ge,crossOriginIframeMirror:Xe.crossOriginIframeMirror,crossOriginIframeStyleMirror:Xe.crossOriginIframeStyleMirror});const gi=new Dy;Pi=new by({recordCanvas:z,mutationCb:xn,win:window,blockClass:o,blockSelector:l,mirror:ge,sampling:C.canvas,dataURLOptions:x});const ts=new cy({mutationCb:es,scrollCb:Cn,bypassOptions:{blockClass:o,blockSelector:l,maskTextClass:h,maskTextSelector:d,excludeAttribute:di,inlineStylesheet:f,maskInputOptions:fi,dataURLOptions:x,maskTextFn:S,maskInputFn:g,recordCanvas:z,inlineImages:N,sampling:C,slimDOMOptions:pi,iframeManager:Xe,stylesheetManager:Ze,canvasManager:Pi,keepIframeSrcFn:W,processedNodeManager:gi,selectorOptions:bn},mirror:ge}),yc=T&&(r!=null||(C==null?void 0:C.visibility)!==void 0&&(C==null?void 0:C.visibility)!==!1);let ae;if(yc){const O=typeof(C==null?void 0:C.visibility)=="object"&&(C==null?void 0:C.visibility)!==null?C.visibility:{},he=O.recordVisibility===!0;ae=new Ay({doc:document,mirror:ge,sampling:O,mutationCb:he?mc:()=>{},notifyActivity:r!=null?X=>{if(Kt+=X,Kt>=r)if(Kt=0,n){Pe||(Pe=!0,Ke=ye(),we.forEach(G=>G.freeze()),ae==null||ae.freeze()),fe&&clearTimeout(fe);const K=ye()-Ke,me=n*3;K>=me?Qt():fe=setTimeout(()=>Qt(),n)}else Fe(!0)}:void 0})}Fe=(O=!1)=>{if(!T)return;vn++,te({type:I.Meta,data:{href:window.location.href,width:an(),height:on()}},O),Ze.reset(),ts.init(),we.forEach(X=>X.lock()),ae==null||ae.lock(),ue==null||ue.lock();const he=fh(document,{mirror:ge,blockClass:o,blockSelector:l,maskTextClass:h,maskTextSelector:d,excludeAttribute:di,inlineStylesheet:f,maskAllInputs:fi,maskTextFn:S,maskInputFn:g,slimDOM:pi,dataURLOptions:x,recordCanvas:z,inlineImages:N,onSerialize:X=>{ct(X,ge)&&Xe.addIframe(X),hn(X,ge)&&Ze.trackLinkElement(X),Ue(X)&&ts.addShadowRoot(k.shadowRoot(X),document)},onIframeLoad:(X,K)=>{Xe.attachIframe(X,K),ts.observeAttachShadow(X)},onStylesheetLoad:(X,K)=>{Ze.attachLinkElement(X,K)},keepIframeSrcFn:W,selector:ce});if(!he)return console.warn("Failed to snapshot the document");te({type:I.FullSnapshot,data:{node:he,initialOffset:nn(window)}},O),we.forEach(X=>X.unlock()),ae==null||ae.unlock(),ue==null||ue.unlock(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Ze.adoptStyleSheets(document.adoptedStyleSheets,ge.getId(document))},Rt=()=>{for(const O of Js)te(O);Js.length=0};let ue;const yi=C.navigation;if(yi!==!1){const O=typeof yi=="object"?yi:{};ue=new Ty({doc:document,config:O,onSnapshot:he=>{Pe&&(fe&&(clearTimeout(fe),fe=null),Pe=!1,Ke=null,we.forEach(X=>{X.resetBuffers(),X.unsetFrozen()}),ae==null||ae.unsetFrozen()),Fe(he)}})}try{const O=[],he=K=>{var me;return L(ay)({mutationCb:es,mousemoveCb:(G,vt)=>te({type:I.IncrementalSnapshot,data:{source:vt,positions:G}}),mouseInteractionCb:G=>te({type:I.IncrementalSnapshot,data:A({source:E.MouseInteraction},G)}),scrollCb:Cn,viewportResizeCb:G=>te({type:I.IncrementalSnapshot,data:A({source:E.ViewportResize},G)}),navigationCb:G=>{ue?ue.handleNavigation(G):Fe(!0)},inputCb:G=>te({type:I.IncrementalSnapshot,data:A({source:E.Input},G)}),mediaInteractionCb:G=>te({type:I.IncrementalSnapshot,data:A({source:E.MediaInteraction},G)}),styleSheetRuleCb:G=>te({type:I.IncrementalSnapshot,data:A({source:E.StyleSheetRule},G)}),styleDeclarationCb:G=>te({type:I.IncrementalSnapshot,data:A({source:E.StyleDeclaration},G)}),canvasMutationCb:xn,visibilityManager:ae,fontCb:G=>te({type:I.IncrementalSnapshot,data:A({source:E.Font},G)}),selectionCb:G=>{te({type:I.IncrementalSnapshot,data:A({source:E.Selection},G)})},customElementCb:G=>{te({type:I.IncrementalSnapshot,data:A({source:E.CustomElement},G)})},blockClass:o,ignoreClass:a,ignoreSelector:c,maskTextClass:h,maskTextSelector:d,excludeAttribute:di,maskInputOptions:fi,inlineStylesheet:f,sampling:C,recordDOM:T,recordCanvas:z,inlineImages:N,userTriggeredOnInput:J,collectFonts:ie,doc:K,maskInputFn:g,maskTextFn:S,keepIframeSrcFn:W,blockSelector:l,slimDOMOptions:pi,dataURLOptions:x,selectorOptions:bn,mirror:ge,iframeManager:Xe,stylesheetManager:Ze,shadowDomManager:ts,processedNodeManager:gi,canvasManager:Pi,ignoreCSSAttributes:q,plugins:((me=F==null?void 0:F.filter(G=>G.observer))==null?void 0:me.map(G=>({observer:G.observer,options:G.options,callback:vt=>te({type:I.Plugin,data:{plugin:G.name,payload:vt}})})))||[]},v)};Xe.addLoadListener(K=>{try{O.push(he(K.contentDocument))}catch(me){console.warn(me)}});const X=()=>{j==="before"&&Rt(),Fe(),O.push(he(document)),jt=!0,j==="after"&&Rt()};return document.readyState==="interactive"||document.readyState==="complete"?X():(O.push(ne("DOMContentLoaded",()=>{te({type:I.DomContentLoaded,data:{}}),P==="DOMContentLoaded"&&X()})),O.push(ne("load",()=>{te({type:I.Load,data:{}}),P==="load"&&X()},window))),()=>{fe&&(clearTimeout(fe),fe=null),Rt(),O.forEach(K=>K()),ue==null||ue.destroy(),gi.destroy(),jt=!1,Yg()}}catch(O){console.warn(O)}}de.getVersion=()=>$y;de.isRecording=()=>jt;de.flushCustomEventQueue=()=>{console.warn(`[rrweb] CustomEvent flushing: ${Js.length} events`),Rt()};de.addCustomEvent=(i,e)=>{const t={type:I.Custom,data:{tag:i,payload:e}};if(!jt){console.warn(`[rrweb] CustomEvent buffered before/after recording start: ${i}`),Js.push(t);return}te(t)};de.freezePage=()=>{we.forEach(i=>i.freeze())};de.takeFullSnapshot=i=>{if(!jt)throw new Error("please take full snapshot after start recording");Fe(i)};de.mirror=ge;function cc(i){return{all:i=i||new Map,on:function(e,t){var s=i.get(e);s?s.push(t):i.set(e,[t])},off:function(e,t){var s=i.get(e);s&&(t?s.splice(s.indexOf(t)>>>0,1):i.set(e,[]))},emit:function(e,t){var s=i.get(e);s&&s.slice().map(function(r){r(t)}),(s=i.get("*"))&&s.slice().map(function(r){r(e,t)})}}}const ky=Object.freeze(Object.defineProperty({__proto__:null,default:cc},Symbol.toStringTag,{value:"Module"}));function _y(i=window,e=document){if("scrollBehavior"in e.documentElement.style&&i.__forceSmoothScrollPolyfill__!==!0)return;const t=i.HTMLElement||i.Element,s=468,r={scroll:i.scroll||i.scrollTo,scrollBy:i.scrollBy,elementScroll:t.prototype.scroll||a,scrollIntoView:t.prototype.scrollIntoView},n=i.performance&&i.performance.now?i.performance.now.bind(i.performance):Date.now;function o(g){const S=["MSIE ","Trident/","Edge/"];return new RegExp(S.join("|")).test(g)}const l=o(i.navigator.userAgent)?1:0;function a(g,S){this.scrollLeft=g,this.scrollTop=S}function c(g){return .5*(1-Math.cos(Math.PI*g))}function u(g){if(g===null||typeof g!="object"||g.behavior===void 0||g.behavior==="auto"||g.behavior==="instant")return!0;if(typeof g=="object"&&g.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+g.behavior+" is not a valid value for enumeration ScrollBehavior.")}function h(g,S){if(S==="Y")return g.clientHeight+l<g.scrollHeight;if(S==="X")return g.clientWidth+l<g.scrollWidth}function d(g,S){const v=i.getComputedStyle(g,null)["overflow"+S];return v==="auto"||v==="scroll"}function f(g){const S=h(g,"Y")&&d(g,"Y"),v=h(g,"X")&&d(g,"X");return S||v}function m(g){for(;g!==e.body&&f(g)===!1;)g=g.parentNode||g.host;return g}function y(g){const S=n();let v,w,C,x=(S-g.startTime)/s;x=x>1?1:x,v=c(x),w=g.startX+(g.x-g.startX)*v,C=g.startY+(g.y-g.startY)*v,g.method.call(g.scrollable,w,C),(w!==g.x||C!==g.y)&&i.requestAnimationFrame(y.bind(i,g))}function p(g,S,v){let w,C,x,R;const T=n();g===e.body?(w=i,C=i.scrollX||i.pageXOffset,x=i.scrollY||i.pageYOffset,R=r.scroll):(w=g,C=g.scrollLeft,x=g.scrollTop,R=a),y({scrollable:w,method:R,startTime:T,startX:C,startY:x,x:S,y:v})}i.scroll=i.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){r.scroll.call(i,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:i.scrollX||i.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:i.scrollY||i.pageYOffset);return}p.call(i,e.body,arguments[0].left!==void 0?~~arguments[0].left:i.scrollX||i.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:i.scrollY||i.pageYOffset)}},i.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])){r.scrollBy.call(i,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}p.call(i,e.body,~~arguments[0].left+(i.scrollX||i.pageXOffset),~~arguments[0].top+(i.scrollY||i.pageYOffset))}},t.prototype.scroll=t.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(u(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");r.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const g=arguments[0].left,S=arguments[0].top;p.call(this,this,typeof g=="undefined"?this.scrollLeft:~~g,typeof S=="undefined"?this.scrollTop:~~S)},t.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){r.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},t.prototype.scrollIntoView=function(){if(u(arguments[0])===!0){r.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const g=m(this),S=g.getBoundingClientRect(),v=this.getBoundingClientRect();g!==e.body?(p.call(this,g,g.scrollLeft+v.left-S.left,g.scrollTop+v.top-S.top),i.getComputedStyle(g).position!=="fixed"&&i.scrollBy({left:S.left,top:S.top,behavior:"smooth"})):i.scrollBy({left:v.left,top:v.top,behavior:"smooth"})}}class Ly{constructor(e=[],t){b(this,"timeOffset",0),b(this,"speed"),b(this,"actions"),b(this,"raf",null),b(this,"lastTimestamp"),this.actions=e,this.speed=t.speed}addAction(e){const t=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=e.delay)this.actions.push(e);else{const s=this.findActionIndex(e);this.actions.splice(s,0,e)}t&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}rafCheck(){const e=performance.now();for(this.timeOffset+=(e-this.lastTimestamp)*this.speed,this.lastTimestamp=e;this.actions.length;){const t=this.actions[0];if(this.timeOffset>=t.delay)this.actions.shift(),t.doAction();else break}this.actions.length>0?this.raf=requestAnimationFrame(this.rafCheck.bind(this)):this.raf=!0}clear(){this.raf&&(this.raf!==!0&&cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(e){this.speed=e}isActive(){return this.raf!==null}findActionIndex(e){let t=0,s=this.actions.length-1;for(;t<=s;){const r=Math.floor((t+s)/2);if(this.actions[r].delay<e.delay)t=r+1;else if(this.actions[r].delay>e.delay)s=r-1;else return r+1}return t}}function Xo(i,e){if(i.type===I.IncrementalSnapshot&&i.data.source===E.MouseMove&&i.data.positions&&i.data.positions.length){const t=i.data.positions[0].timeOffset,s=i.timestamp+t;return i.delay=s-e,s-e}return i.delay=i.timestamp-e,i.delay}/*! *****************************************************************************
|
|
80
80
|
Copyright (c) Microsoft Corporation.
|
|
81
81
|
|
|
82
82
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -89,7 +89,7 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
89
89
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
90
90
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
91
91
|
PERFORMANCE OF THIS SOFTWARE.
|
|
92
|
-
***************************************************************************** */function Jo(i,e){var t=typeof Symbol=="function"&&i[Symbol.iterator];if(!t)return i;var s,r,n=t.call(i),o=[];try{for(;(e===void 0||e-- >0)&&!(s=n.next()).done;)o.push(s.value)}catch(l){r={error:l}}finally{try{s&&!s.done&&(t=n.return)&&t.call(n)}finally{if(r)throw r.error}}return o}var lt;(function(i){i[i.NotStarted=0]="NotStarted",i[i.Running=1]="Running",i[i.Stopped=2]="Stopped"})(lt||(lt={}));var uc={type:"xstate.init"};function Fi(i){return i===void 0?[]:[].concat(i)}function it(i){return{type:"xstate.assign",assignment:i}}function qo(i,e){return typeof(i=typeof i=="string"&&e&&e[i]?e[i]:i)=="string"?{type:i}:typeof i=="function"?{type:i.name,exec:i}:i}function qs(i){return function(e){return i===e}}function hc(i){return typeof i=="string"?{type:i}:i}function Ko(i,e){return{value:i,context:e,actions:[],changed:!1,matches:qs(i)}}function Qo(i,e,t){var s=e,r=!1;return[i.filter(function(n){if(n.type==="xstate.assign"){r=!0;var o=Object.assign({},s);return typeof n.assignment=="function"?o=n.assignment(s,t):Object.keys(n.assignment).forEach(function(l){o[l]=typeof n.assignment[l]=="function"?n.assignment[l](s,t):n.assignment[l]}),s=o,!1}return!0}),s,r]}function dc(i,e){e===void 0&&(e={});var t=Jo(Qo(Fi(i.states[i.initial].entry).map(function(o){return qo(o,e.actions)}),i.context,uc),2),s=t[0],r=t[1],n={config:i,_options:e,initialState:{value:i.initial,actions:s,context:r,matches:qs(i.initial)},transition:function(o,l){var a,c,u=typeof o=="string"?{value:o,context:i.context}:o,h=u.value,d=u.context,f=hc(l),m=i.states[h];if(m.on){var y=Fi(m.on[f.type]);try{for(var p=function(W){var q=typeof Symbol=="function"&&Symbol.iterator,ce=q&&W[q],Le=0;if(ce)return ce.call(W);if(W&&typeof W.length=="number")return{next:function(){return W&&Le>=W.length&&(W=void 0),{value:W&&W[Le++],done:!W}}};throw new TypeError(q?"Object is not iterable.":"Symbol.iterator is not defined.")}(y),g=p.next();!g.done;g=p.next()){var S=g.value;if(S===void 0)return Ko(h,d);var v=typeof S=="string"?{target:S}:S,w=v.target,C=v.actions,x=C===void 0?[]:C,R=v.cond,T=R===void 0?function(){return!0}:R,z=w===void 0,U=w!=null?w:h,P=i.states[U];if(T(d,f)){var j=Jo(Qo((z?Fi(x):[].concat(m.exit,x,P.entry).filter(function(W){return W})).map(function(W){return qo(W,n._options.actions)}),d,f),3),J=j[0],ie=j[1],N=j[2],F=w!=null?w:h;return{value:F,context:ie,actions:J,changed:w!==h||J.length>0||N,matches:qs(F)}}}}catch(W){a={error:W}}finally{try{g&&!g.done&&(c=p.return)&&c.call(p)}finally{if(a)throw a.error}}}return Ko(h,d)}};return n}var ea=function(i,e){return i.actions.forEach(function(t){var s=t.exec;return s&&s(i.context,e)})};function fc(i){var e=i.initialState,t=lt.NotStarted,s=new Set,r={_machine:i,send:function(n){t===lt.Running&&(e=i.transition(e,n),ea(e,hc(n)),s.forEach(function(o){return o(e)}))},subscribe:function(n){return s.add(n),n(e),{unsubscribe:function(){return s.delete(n)}}},start:function(n){if(n){var o=typeof n=="object"?n:{context:i.config.context,value:n};e={value:o.value,actions:[],context:o.context,matches:qs(o.value)}}return t=lt.Running,ea(e,uc),r},stop:function(){return t=lt.Stopped,s.clear(),r},get state(){return e},get status(){return t}};return r}function Py(i,e){for(let t=i.length-1;t>=0;t--){const s=i[t];if(s.type===I.Meta&&s.timestamp<=e)return i.slice(t)}return i}function Fy(i,{getCastFn:e,applyEventsSynchronously:t,emitter:s}){const r=dc({id:"player",context:i,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:it({lastPlayedEvent:(n,o)=>o.type==="CAST_EVENT"?o.payload.event:n.lastPlayedEvent}),recordTimeOffset:it((n,o)=>{let l=n.timeOffset;return"payload"in o&&"timeOffset"in o.payload&&(l=o.payload.timeOffset),re(A({},n),{timeOffset:l,baselineTime:n.events[0].timestamp+l})}),play(n){var o;const{timer:l,events:a,baselineTime:c,lastPlayedEvent:u}=n;l.clear();for(const m of a)Xo(m,c);const h=Py(a,c);let d=u==null?void 0:u.timestamp;(u==null?void 0:u.type)===I.IncrementalSnapshot&&u.data.source===E.MouseMove&&(d=u.timestamp+((o=u.data.positions[0])==null?void 0:o.timeOffset)),c<(d||0)&&s.emit(V.PlayBack);const f=new Array;for(const m of h)if(!(d&&d<c&&(m.timestamp<=d||m===u)))if(m.timestamp<=c)f.push(m);else{const y=e(m,!1);l.addAction({doAction:()=>{y()},delay:m.delay})}t(f),s.emit(V.Flush),l.start()},pause(n){n.timer.clear()},resetLastPlayedEvent:it(n=>re(A({},n),{lastPlayedEvent:null})),startLive:it({baselineTime:(n,o)=>(n.timer.start(),o.type==="TO_LIVE"&&o.payload.baselineTime?o.payload.baselineTime:Date.now())}),addEvent:it((n,o)=>{const{baselineTime:l,timer:a,events:c}=n;if(o.type==="ADD_EVENT"){const{event:u}=o.payload;Xo(u,l);let h=c.length-1;if(!c[h]||c[h].timestamp<=u.timestamp)c.push(u);else{let m=-1,y=0;for(;y<=h;){const p=Math.floor((y+h)/2);c[p].timestamp<=u.timestamp?y=p+1:h=p-1}m===-1&&(m=y),c.splice(m,0,u)}const d=u.timestamp<l,f=e(u,d);d?f():a.isActive()&&a.addAction({doAction:()=>{f()},delay:u.delay})}return re(A({},n),{events:c})})}});return fc(r)}function zy(i){const e=dc({id:"speed",context:i,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(t,s)=>{"payload"in s&&t.timer.setSpeed(s.payload.speed)},recordSpeed:it({normalSpeed:t=>t.timer.speed}),restoreSpeed:t=>{t.timer.setSpeed(t.normalSpeed)}}});return fc(e)}const By=i=>[`.${i} { background: currentColor }`,"noscript { display: none !important; }"],ta=new Map;function pc(i,e){let t=ta.get(i);return t||(t=new Map,ta.set(i,t)),t.has(e)||t.set(e,[]),t.get(e)}function He(i,e,t){return async s=>{if(s&&typeof s=="object"&&"rr_type"in s)if(t&&(t.isUnchanged=!1),s.rr_type==="ImageBitmap"&&"args"in s){const r=await He(i,e,t)(s.args);return await createImageBitmap.apply(null,r)}else if("index"in s){if(t||e===null)return s;const{rr_type:r,index:n}=s;return pc(e,r)[n]}else if("args"in s){const{rr_type:r,args:n}=s,o=window[r];return new o(...await Promise.all(n.map(He(i,e,t))))}else{if("base64"in s)return hy(s.base64);if("src"in s){const r=i.get(s.src);if(r)return r;{const n=new Image;return n.src=s.src,i.set(s.src,n),n}}else if("data"in s&&s.rr_type==="Blob"){const r=await Promise.all(s.data.map(He(i,e,t)));return new Blob(r,{type:s.type})}}else if(Array.isArray(s))return await Promise.all(s.map(He(i,e,t)));return s}}function Wy(i,e){try{return e===_e.WebGL?i.getContext("webgl")||i.getContext("experimental-webgl"):i.getContext("webgl2")}catch(t){return null}}const Uy=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function Vy(i,e){if(!(e!=null&&e.constructor))return;const{name:t}=e.constructor;if(!Uy.includes(t))return;const s=pc(i,t);s.includes(e)||s.push(e)}async function Hy({mutation:i,target:e,type:t,imageMap:s,errorHandler:r}){try{const n=Wy(e,t);if(!n)return;if(i.setter){n[i.property]=i.args[0];return}const o=n[i.property],l=await Promise.all(i.args.map(He(s,n))),a=o.apply(n,l);Vy(n,a);const c=!1}catch(n){r(i,n)}}async function Gy({event:i,mutations:e,target:t,imageMap:s,errorHandler:r}){const n=t.getContext("2d");if(!n){r(e[0],new Error("Canvas context is null"));return}const o=e.map(async a=>Promise.all(a.args.map(He(s,n))));(await Promise.all(o)).forEach((a,c)=>{const u=e[c];try{if(u.setter){n[u.property]=u.args[0];return}const h=n[u.property];u.property==="drawImage"&&typeof u.args[0]=="string"?(s.get(i),h.apply(n,u.args)):h.apply(n,a)}catch(h){r(u,h)}})}async function Er({event:i,mutation:e,target:t,imageMap:s,canvasEventMap:r,errorHandler:n}){try{const o=r.get(i)||e,l="commands"in o?o.commands:[o];if([_e.WebGL,_e.WebGL2].includes(e.type)){for(let a=0;a<l.length;a++){const c=l[a];await Hy({mutation:c,type:e.type,target:t,imageMap:s,errorHandler:n})}return}await Gy({event:i,mutations:l,target:t,imageMap:s,errorHandler:n})}catch(o){n(e,o)}}class jy{constructor(e){b(this,"mediaMap",new Map),b(this,"warn"),b(this,"service"),b(this,"speedService"),b(this,"emitter"),b(this,"getCurrentTime"),b(this,"metadataCallbackMap",new Map),this.warn=e.warn,this.service=e.service,this.speedService=e.speedService,this.emitter=e.emitter,this.getCurrentTime=e.getCurrentTime,this.emitter.on(V.Start,this.start.bind(this)),this.emitter.on(V.SkipStart,this.start.bind(this)),this.emitter.on(V.Pause,this.pause.bind(this)),this.emitter.on(V.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(e={pause:!1}){this.mediaMap.forEach((t,s)=>{this.syncTargetWithState(s),e.pause&&s.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:e,target:t,mediaState:s}){if(s.isPlaying){const n=(e-s.lastInteractionTimeOffset)/1e3*s.playbackRate,o="duration"in t&&t.duration;if(Number.isNaN(o)){this.waitForMetadata(t);return}let l=s.currentTimeAtLastInteraction+n;t.loop&&o!==!1&&(l=l%o),t.currentTime=l}else t.pause(),t.currentTime=s.currentTimeAtLastInteraction}waitForMetadata(e){if(this.metadataCallbackMap.has(e)||!("addEventListener"in e))return;const t=()=>{this.metadataCallbackMap.delete(e);const s=this.mediaMap.get(e);s&&this.seekTo({time:this.getCurrentTime(),target:e,mediaState:s})};this.metadataCallbackMap.set(e,t),e.addEventListener("loadedmetadata",t,{once:!0})}getMediaStateFromMutation({target:e,timeOffset:t,mutation:s}){var f,m,y,p,g;const r=this.mediaMap.get(e),{type:n,playbackRate:o,currentTime:l,muted:a,volume:c,loop:u}=s;return{isPlaying:n===Be.Play||n!==Be.Pause&&((r==null?void 0:r.isPlaying)||e.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:(f=l!=null?l:r==null?void 0:r.currentTimeAtLastInteraction)!=null?f:0,lastInteractionTimeOffset:t,playbackRate:(m=o!=null?o:r==null?void 0:r.playbackRate)!=null?m:1,volume:(y=c!=null?c:r==null?void 0:r.volume)!=null?y:1,muted:(p=a!=null?a:r==null?void 0:r.muted)!=null?p:e.getAttribute("muted")===null,loop:(g=u!=null?u:r==null?void 0:r.loop)!=null?g:e.getAttribute("loop")===null}}syncTargetWithState(e){const t=this.mediaMap.get(e);if(!t)return;const{muted:s,loop:r,volume:n,isPlaying:o}=t,l=this.service.state.matches("paused"),a=t.playbackRate*this.speedService.state.context.timer.speed;try{this.seekTo({time:this.getCurrentTime(),target:e,mediaState:t}),e.volume!==n&&(e.volume=n),e.muted=s,e.loop=r,e.playbackRate!==a&&(e.playbackRate=a),o&&!l?e.play():e.pause()}catch(c){this.warn(`Failed to replay media interactions: ${c.message||c}`)}}addMediaElements(e,t,s){if(!["AUDIO","VIDEO"].includes(e.nodeName))return;const r=e,n=s.getMeta(r);if(!n||!("attributes"in n))return;const o=this.service.state.matches("paused"),l=n.attributes;let a=!1;l.rr_mediaState?a=l.rr_mediaState==="played":a=r.getAttribute("autoplay")!==null,a&&o&&r.pause();let c=1;typeof l.rr_mediaPlaybackRate=="number"&&(c=l.rr_mediaPlaybackRate);let u=!1;typeof l.rr_mediaMuted=="boolean"?u=l.rr_mediaMuted:u=r.getAttribute("muted")!==null;let h=!1;typeof l.rr_mediaLoop=="boolean"?h=l.rr_mediaLoop:h=r.getAttribute("loop")!==null;let d=1;typeof l.rr_mediaVolume=="number"&&(d=l.rr_mediaVolume);let f=0;typeof l.rr_mediaCurrentTime=="number"&&(f=l.rr_mediaCurrentTime),this.mediaMap.set(r,{isPlaying:a,currentTimeAtLastInteraction:f,lastInteractionTimeOffset:t,playbackRate:c,volume:d,muted:u,loop:h}),this.syncTargetWithState(r)}mediaMutation({target:e,timeOffset:t,mutation:s}){this.mediaMap.set(e,this.getMediaStateFromMutation({target:e,timeOffset:t,mutation:s})),this.syncTargetWithState(e)}isSupportedMediaElement(e){return["AUDIO","VIDEO"].includes(e.nodeName)}reset(){this.mediaMap.clear()}}function Is(i,e){if(i.nodeName!=="DIALOG"||i instanceof Ce)return;const t=i,s=t.open,r=s&&t.matches("dialog:modal"),n=t.getAttribute("rr_open_mode"),o=typeof(e==null?void 0:e.attributes.open)=="string"||typeof t.getAttribute("open")=="string",l=n==="modal";if(!(s&&!(r&&n==="non-modal"||!r&&l))){if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}s&&t.close(),o&&(l?t.showModal():t.show())}}function Yy(i,e){if(i.nodeName!=="DIALOG"||i instanceof Ce)return;const t=i;if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}e.attributes.open===null&&(t.removeAttribute("open"),t.removeAttribute("rr_open_mode"))}const Zy=5*1e3,Xy=cc||ky,sa="[replayer]",zi={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function ia(i){return i.type==I.IncrementalSnapshot&&(i.data.source==E.TouchMove||i.data.source==E.MouseInteraction&&i.data.type==H.TouchStart)}class Jy{constructor(e,t){if(b(this,"wrapper"),b(this,"iframe"),b(this,"service"),b(this,"speedService"),b(this,"config"),b(this,"usingVirtualDom",!1),b(this,"virtualDom",new bt),b(this,"mouse"),b(this,"mouseTail",null),b(this,"tailPositions",[]),b(this,"emitter",Xy()),b(this,"nextUserInteractionEvent"),b(this,"legacy_missingNodeRetryMap",{}),b(this,"cache",oo()),b(this,"imageMap",new Map),b(this,"canvasEventMap",new Map),b(this,"mirror",oa()),b(this,"styleMirror",new fn),b(this,"mediaManager"),b(this,"firstFullSnapshot",null),b(this,"newDocumentQueue",[]),b(this,"mousePos",null),b(this,"touchActive",null),b(this,"lastMouseDownEvent",null),b(this,"lastHoveredRootNode"),b(this,"lastSelectionData",null),b(this,"constructedStyleMutations",[]),b(this,"adoptedStyleSheets",[]),b(this,"handleResize",l=>{this.iframe.style.display="inherit";for(const a of[this.mouseTail,this.iframe])a&&(a.setAttribute("width",String(l.width)),a.setAttribute("height",String(l.height)))}),b(this,"applyEventsSynchronously",l=>{for(const a of l){switch(a.type){case I.DomContentLoaded:case I.Load:case I.Custom:continue;case I.FullSnapshot:case I.Meta:case I.Plugin:case I.IncrementalSnapshot:break}this.getCastFn(a,!0)()}}),b(this,"getCastFn",(l,a=!1)=>{let c;switch(l.type){case I.DomContentLoaded:case I.Load:break;case I.Custom:c=()=>{this.emitter.emit(V.CustomEvent,l)};break;case I.Meta:c=()=>this.emitter.emit(V.Resize,{width:l.data.width,height:l.data.height});break;case I.FullSnapshot:c=()=>{var h;if(this.firstFullSnapshot){if(this.firstFullSnapshot===l){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(l,a),(h=this.iframe.contentWindow)==null||h.scrollTo(l.data.initialOffset)};break;case I.IncrementalSnapshot:c=()=>{if(this.applyIncremental(l,a),!a&&(l===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const h of this.service.state.context.events)if(!(h.timestamp<=l.timestamp)&&this.isUserInteraction(h)){h.delay-l.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=h);break}if(this.nextUserInteractionEvent){const h=this.nextUserInteractionEvent.delay-l.delay,d={speed:Math.min(Math.round(h/Zy),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:d}),this.emitter.emit(V.SkipStart,d)}}};break}return()=>{c&&c();for(const d of this.config.plugins||[])d.handler&&d.handler(l,a,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:l}});const h=this.service.state.context.events.length-1;if(!this.config.liveMode&&l===this.service.state.context.events[h]){const d=()=>{h<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(V.Finish))};let f=50;l.type===I.IncrementalSnapshot&&l.data.source===E.MouseMove&&l.data.positions.length&&(f+=Math.max(0,-l.data.positions[0].timeOffset)),setTimeout(d,f)}this.emitter.emit(V.EventCast,l)}}),!(t!=null&&t.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");const s={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,inactivePeriodThreshold:10*1e3,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:zi,useVirtualDom:!0,logger:console};this.config=Object.assign({},s,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(V.Resize,this.handleResize),this.setupDom();for(const l of this.config.plugins||[])l.getMirror&&l.getMirror({nodeMirror:this.mirror});this.emitter.on(V.Flush,()=>{if(this.usingVirtualDom){const l={mirror:this.mirror,applyCanvas:(a,c,u)=>{Er({event:a,mutation:c,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(a,c)=>{a.source===E.StyleSheetRule?this.applyStyleSheetRule(a,c):a.source===E.StyleDeclaration&&this.applyStyleDeclaration(a,c)},afterAppend:(a,c)=>{for(const u of this.config.plugins||[])u.onBuild&&u.onBuild(a,{id:c,replayer:this})}};if(this.iframe.contentDocument)try{js(this.iframe.contentDocument,this.virtualDom,l,this.virtualDom.mirror)}catch(a){console.warn(a)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const a in this.legacy_missingNodeRetryMap)try{const c=this.legacy_missingNodeRetryMap[a],u=Ys(c.node,this.mirror,this.virtualDom.mirror);js(u,c.node,l,this.virtualDom.mirror),c.node=u}catch(c){this.warn(c)}this.constructedStyleMutations.forEach(a=>{this.applyStyleSheetMutation(a)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(a=>{this.applyAdoptedStyleSheet(a)}),this.adoptedStyleSheets=[]}if(this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null,this.lastMouseDownEvent){const[l,a]=this.lastMouseDownEvent;l.dispatchEvent(a)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(V.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()});const r=new Ly([],{speed:this.config.speed});this.service=Fy({events:e.map(l=>t&&t.unpackFn?t.unpackFn(l):l).sort((l,a)=>l.timestamp-a.timestamp),timer:r,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(l=>{this.emitter.emit(V.StateChange,{player:l})}),this.speedService=zy({normalSpeed:-1,timer:r}),this.speedService.start(),this.speedService.subscribe(l=>{this.emitter.emit(V.StateChange,{speed:l})}),this.mediaManager=new jy({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});const n=this.service.state.context.events.find(l=>l.type===I.Meta),o=this.service.state.context.events.find(l=>l.type===I.FullSnapshot);if(n){const{width:l,height:a}=n.data;setTimeout(()=>{this.emitter.emit(V.Resize,{width:l,height:a})},0)}o&&setTimeout(()=>{var l;this.firstFullSnapshot||(this.firstFullSnapshot=o,this.rebuildFullSnapshot(o),(l=this.iframe.contentWindow)==null||l.scrollTo(o.data.initialOffset))},1),this.service.state.context.events.find(ia)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(e,t){return this.emitter.on(e,t),this}off(e,t){return this.emitter.off(e,t),this}setConfig(e){Object.keys(e).forEach(t=>{e[t],this.config[t]=e[t]}),this.config.skipInactive||this.backToNormal(),typeof e.speed!="undefined"&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),typeof e.mouseTail!="undefined"&&(e.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getMetaData(){const e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:e,events:t}=this.service.state.context;return e-t[0].timestamp}getMirror(){return this.mirror}play(e=0){var t,s;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:e}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}})),(s=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||s.classList.remove("rrweb-paused"),this.emitter.emit(V.Start)}pause(e){var t,s;e===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof e=="number"&&(this.play(e),this.service.send({type:"PAUSE"})),(s=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||s.classList.add("rrweb-paused"),this.emitter.emit(V.Pause)}resume(e=0){this.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(V.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(V.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){const t=this.config.unpackFn?this.config.unpackFn(e):e;ia(t)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:t}}))}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=oo()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");const e=["allow-same-origin","allow-scripts"];this.config.UNSAFE_replayCanvas,this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(_y(this.iframe.contentWindow,this.iframe.contentDocument),cn(this.iframe.contentWindow))}rebuildFullSnapshot(e,t=!1){if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&this.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const s=[],r=new Set,n=(a,c)=>{if(a.nodeName==="DIALOG"&&r.add(a),this.collectIframeAndAttachDocument(s,a),this.mediaManager.isSupportedMediaElement(a)){const{events:u}=this.service.state.context;this.mediaManager.addMediaElements(a,e.timestamp-u[0].timestamp,this.mirror)}for(const u of this.config.plugins||[])u.onBuild&&u.onBuild(a,{id:c,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),ff(e.data.node,{doc:this.iframe.contentDocument,afterAppend:n,cache:this.cache,mirror:this.mirror}),n(this.iframe.contentDocument,e.data.node.id);for(const{mutationInQueue:a,builtNode:c}of s)this.attachDocumentToIframe(a,c),this.newDocumentQueue=this.newDocumentQueue.filter(u=>u!==a);const{documentElement:o,head:l}=this.iframe.contentDocument;this.insertStyleRules(o,l),r.forEach(a=>Is(a)),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(V.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,t){var s;const r=By(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&r.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),!!r.length)if(this.usingVirtualDom){const n=this.virtualDom.createElement("style");this.virtualDom.mirror.add(n,Vl(n,this.virtualDom.unserializedId)),e.insertBefore(n,t),n.rules.push({source:E.StyleSheetRule,adds:r.map((o,l)=>({rule:o,index:l}))})}else{const n=document.createElement("style");e.insertBefore(n,t);for(let o=0;o<r.length;o++)(s=n.sheet)==null||s.insertRule(r[o],o)}}attachDocumentToIframe(e,t){const s=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,r=[],n=new Set,o=(l,a)=>{l.nodeName==="DIALOG"&&n.add(l),this.collectIframeAndAttachDocument(r,l);const c=s.getMeta(l);if((c==null?void 0:c.type)===Oe.Element&&(c==null?void 0:c.tagName.toUpperCase())==="HTML"){const{documentElement:u,head:h}=t.contentDocument;this.insertStyleRules(u,h)}if(!this.usingVirtualDom)for(const u of this.config.plugins||[])u.onBuild&&u.onBuild(l,{id:a,replayer:this})};$t(e.node,{doc:t.contentDocument,mirror:s,hackCss:!0,skipChild:!1,afterAppend:o,cache:this.cache}),o(t.contentDocument,e.node.id);for(const{mutationInQueue:l,builtNode:a}of r)this.attachDocumentToIframe(l,a),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==l);n.forEach(l=>Is(l))}collectIframeAndAttachDocument(e,t){if(ct(t,this.mirror)){const s=this.newDocumentQueue.find(r=>r.parentId===this.mirror.getId(t));s&&e.push({mutationInQueue:s,builtNode:t})}}waitForStylesheetLoad(){var e;const t=(e=this.iframe.contentDocument)==null?void 0:e.head;if(t){const s=new Set;let r,n=this.service.state;const o=()=>{n=this.service.state};this.emitter.on(V.Start,o),this.emitter.on(V.Pause,o);const l=()=>{this.emitter.off(V.Start,o),this.emitter.off(V.Pause,o)};t.querySelectorAll('link[rel="stylesheet"]').forEach(a=>{a.sheet||(s.add(a),a.addEventListener("load",()=>{s.delete(a),s.size===0&&r!==-1&&(n.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(V.LoadStylesheetEnd),r&&clearTimeout(r),l())}))}),s.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(V.LoadStylesheetStart),r=setTimeout(()=>{n.matches("playing")&&this.play(this.getCurrentTime()),r=-1,l()},this.config.loadTimeout))}}async preloadAllImages(){const e=[];for(const t of this.service.state.context.events)t.type===I.IncrementalSnapshot&&t.data.source===E.CanvasMutation&&(e.push(this.deserializeAndPreloadCanvasEvents(t.data,t)),("commands"in t.data?t.data.commands:[t.data]).forEach(r=>{this.preloadImages(r,t)}));return Promise.all(e)}preloadImages(e,t){if(e.property==="drawImage"&&typeof e.args[0]=="string"&&!this.imageMap.has(t)){const s=document.createElement("canvas"),r=s.getContext("2d"),n=r==null?void 0:r.createImageData(s.width,s.height);r==null||r.putImageData(n,0,0)}}async deserializeAndPreloadCanvasEvents(e,t){if(!this.canvasEventMap.has(t)){const s={isUnchanged:!0};if("commands"in e){const r=await Promise.all(e.commands.map(async n=>{const o=await Promise.all(n.args.map(He(this.imageMap,null,s)));return re(A({},n),{args:o})}));s.isUnchanged===!1&&this.canvasEventMap.set(t,re(A({},e),{commands:r}))}else{const r=await Promise.all(e.args.map(He(this.imageMap,null,s)));s.isUnchanged===!1&&this.canvasEventMap.set(t,re(A({},e),{args:r}))}}}applyIncremental(e,t){var s,r,n;const{data:o}=e;switch(o.source){case E.Mutation:{try{this.applyMutation(o,t)}catch(l){this.warn(`Exception in mutation ${l.message||l}`,o)}break}case E.Drag:case E.TouchMove:case E.MouseMove:if(t){const l=o.positions[o.positions.length-1];this.mousePos={x:l.x,y:l.y,id:l.id,debugData:o}}else o.positions.forEach(l=>{const a={doAction:()=>{this.moveAndHover(l.x,l.y,l.id,t,o)},delay:l.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(a)}),this.timer.addAction({doAction(){},delay:e.delay-((s=o.positions[0])==null?void 0:s.timeOffset)});break;case E.MouseInteraction:{if(o.id===-1)break;const l=new Event(Ge(H[o.type])),a=this.mirror.getNode(o.id);if(!a)return this.debugNodeNotFound(o,o.id);this.emitter.emit(V.MouseInteraction,{type:o.type,target:a});const{triggerFocus:c}=this.config;switch(o.type){case H.Blur:"blur"in a&&a.blur();break;case H.Focus:c&&a.focus&&a.focus({preventScroll:!0});break;case H.Click:case H.TouchStart:case H.TouchEnd:case H.MouseDown:case H.MouseUp:t?(o.type===H.TouchStart?this.touchActive=!0:o.type===H.TouchEnd&&(this.touchActive=!1),o.type===H.MouseDown?this.lastMouseDownEvent=[a,l]:o.type===H.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:o.x||0,y:o.y||0,id:o.id,debugData:o}):(o.type===H.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(o.x||0,o.y||0,o.id,t,o),o.type===H.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):o.type===H.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):o.type===H.TouchEnd?this.mouse.classList.remove("touch-active"):a.dispatchEvent(l));break;case H.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:a.dispatchEvent(l)}break}case E.Scroll:{if(o.id===-1)break;if(this.usingVirtualDom){const l=this.virtualDom.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);l.scrollData=o;break}this.applyScroll(o,t);break}case E.ViewportResize:this.emitter.emit(V.Resize,{width:o.width,height:o.height});break;case E.Input:{if(o.id===-1)break;if(this.usingVirtualDom){const l=this.virtualDom.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);l.inputData=o;break}this.applyInput(o);break}case E.MediaInteraction:{const l=this.usingVirtualDom?this.virtualDom.mirror.getNode(o.id):this.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);const a=l,{events:c}=this.service.state.context;this.mediaManager.mediaMutation({target:a,timeOffset:e.timestamp-c[0].timestamp,mutation:o});break}case E.StyleSheetRule:case E.StyleDeclaration:{this.usingVirtualDom?o.styleId?this.constructedStyleMutations.push(o):o.id&&((r=this.virtualDom.mirror.getNode(o.id))==null||r.rules.push(o)):this.applyStyleSheetMutation(o);break}case E.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const l=this.virtualDom.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);l.canvasMutations.push({event:e,mutation:o})}else{const l=this.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);Er({event:e,mutation:o,target:l,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case E.Font:{try{const l=new FontFace(o.family,o.buffer?new Uint8Array(JSON.parse(o.fontSource)):o.fontSource,o.descriptors);(n=this.iframe.contentDocument)==null||n.fonts.add(l)}catch(l){this.warn(l)}break}case E.Selection:{if(t){this.lastSelectionData=o;break}this.applySelection(o);break}case E.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(o):this.applyAdoptedStyleSheet(o);break}case E.Visibility:{const{mutations:l}=o;for(const a of l){const c=this.usingVirtualDom?this.virtualDom.mirror.getNode(a.id):this.mirror.getNode(a.id);c&&c instanceof Element&&(c.style.visibility=a.isVisible?"visible":"hidden")}break}}}applyMutation(e,t){if(this.config.useVirtualDom&&!this.usingVirtualDom&&t&&(this.usingVirtualDom=!0,km(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const c in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[c],h=Ul(u.node,this.virtualDom,this.mirror);h&&(u.node=h)}catch(u){this.warn(u)}const s=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter(c=>s.getNode(c.id)?!0:(this.warnNodeNotFound(e,c.id),!1)),e.removes.forEach(c=>{var u;const h=s.getNode(c.id);if(!h)return;let d=s.getNode(c.parentId);if(!d)return this.warnNodeNotFound(e,c.parentId);if(c.isShadow&&Ue(d)&&(d=d.shadowRoot),s.removeNodeFromMap(h),d)try{d.removeChild(h),this.usingVirtualDom&&h.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)==null?void 0:u.length)>0&&(d.rules=[])}catch(f){if(f instanceof DOMException)this.warn("parent could not remove child in mutation",d,h,e);else throw f}});const r=A({},this.legacy_missingNodeRetryMap),n=[],o=c=>{let u=null;return c.nextId&&(u=s.getNode(c.nextId)),c.nextId!==null&&c.nextId!==void 0&&c.nextId!==-1&&!u},l=c=>{var u,h;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let d=s.getNode(c.parentId);if(!d)return c.node.type===Oe.Document?this.newDocumentQueue.push(c):n.push(c);c.node.isShadow&&(Ue(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let f=null,m=null;if(c.previousId&&(f=s.getNode(c.previousId)),c.nextId&&(m=s.getNode(c.nextId)),o(c))return n.push(c);if(c.node.rootId&&!s.getNode(c.node.rootId))return;const y=c.node.rootId?s.getNode(c.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(ct(d,s)){this.attachDocumentToIframe(c,d);return}const p=(v,w)=>{if(!this.usingVirtualDom){Is(v);for(const C of this.config.plugins||[])C.onBuild&&C.onBuild(v,{id:w,replayer:this})}},g=$t(c.node,{doc:y,mirror:s,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:p});if(c.previousId===-1||c.nextId===-1){r[c.node.id]={node:g,mutation:c};return}const S=s.getMeta(d);if(S&&S.type===Oe.Element&&c.node.type===Oe.Text){const v=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);if(S.tagName==="textarea")for(const w of v)w.nodeType===d.TEXT_NODE&&d.removeChild(w);else if(S.tagName==="style"&&v.length===1)for(const w of v)w.nodeType===d.TEXT_NODE&&!s.hasNode(w)&&(g.textContent=w.textContent,d.removeChild(w))}else if((S==null?void 0:S.type)===Oe.Document){const v=d;c.node.type===Oe.DocumentType&&((u=v.childNodes[0])==null?void 0:u.nodeType)===Node.DOCUMENT_TYPE_NODE&&v.removeChild(v.childNodes[0]),g.nodeName==="HTML"&&v.documentElement&&v.removeChild(v.documentElement)}if(f&&f.nextSibling&&f.nextSibling.parentNode?d.insertBefore(g,f.nextSibling):m&&m.parentNode?d.contains(m)?d.insertBefore(g,m):d.insertBefore(g,null):d.appendChild(g),p(g,c.node.id),this.usingVirtualDom&&g.nodeName==="#text"&&d.nodeName==="STYLE"&&((h=d.rules)==null?void 0:h.length)>0&&(d.rules=[]),ct(g,this.mirror)){const v=this.mirror.getId(g),w=this.newDocumentQueue.find(C=>C.parentId===v);w&&(this.attachDocumentToIframe(w,g),this.newDocumentQueue=this.newDocumentQueue.filter(C=>C!==w))}(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(r,d,g,c)};e.adds.forEach(c=>{l(c)});const a=Date.now();for(;n.length;){const c=jl(n);if(n.length=0,Date.now()-a>500){this.warn("Timeout in the loop, please check the resolve tree data:",c);break}for(const u of c)s.getNode(u.value.parentId)?un(u,d=>{l(d)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(r).length&&Object.assign(this.legacy_missingNodeRetryMap,r),Yl(e.texts).forEach(c=>{var u;const h=s.getNode(c.id);if(!h)return e.removes.find(f=>f.id===c.id)?void 0:this.warnNodeNotFound(e,c.id);const d=h.parentElement;if(c.value&&d&&d.tagName==="STYLE"?h.textContent=ii(c.value,this.cache):h.textContent=c.value,this.usingVirtualDom){const f=h.parentNode;((u=f==null?void 0:f.rules)==null?void 0:u.length)>0&&(f.rules=[])}}),e.attributes.forEach(c=>{var u;const h=s.getNode(c.id);if(!h)return e.removes.find(d=>d.id===c.id)?void 0:this.warnNodeNotFound(e,c.id);for(const d in c.attributes)if(typeof d=="string"){const f=c.attributes[d];if(f===null)h.removeAttribute(d),d==="open"&&Yy(h,c);else if(typeof f=="string")try{if(d==="_cssText"&&(h.nodeName==="LINK"||h.nodeName==="STYLE"))try{const m=s.getMeta(h),y=$t(re(A({},m),{attributes:A(A({},m.attributes),c.attributes)}),{doc:h.ownerDocument,mirror:s,skipChild:!0,hackCss:!0,cache:this.cache});Object.assign(m.attributes,c.attributes);const p=h.nextSibling,g=h.parentNode;if(y&&g){g.removeChild(h),g.insertBefore(y,p),s.replace(c.id,y);break}}catch(m){}if(d==="value"&&h.nodeName==="TEXTAREA"){const m=h;m.childNodes.forEach(p=>m.removeChild(p));const y=(u=h.ownerDocument)==null?void 0:u.createTextNode(f);y&&m.appendChild(y)}else h.setAttribute(d,f);d==="rr_open_mode"&&h.nodeName==="DIALOG"&&Is(h,c)}catch(m){this.warn("An error occurred may due to the checkout feature.",m)}else if(d==="style"){const m=f,y=h;for(const p in m)if(m[p]===!1)y.style.removeProperty(p);else if(m[p]instanceof Array){const g=m[p];y.style.setProperty(p,g[0],g[1])}else{const g=m[p];y.style.setProperty(p,g)}}}})}applyScroll(e,t){var s,r;const n=this.mirror.getNode(e.id);if(!n)return this.debugNodeNotFound(e,e.id);const o=this.mirror.getMeta(n);if(n===this.iframe.contentDocument)(s=this.iframe.contentWindow)==null||s.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else if((o==null?void 0:o.type)===Oe.Document)(r=n.defaultView)==null||r.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else try{n.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"})}catch(l){}}applyInput(e){const t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch(s){}}applySelection(e){try{const t=new Set,s=e.ranges.map(({start:r,startOffset:n,end:o,endOffset:l})=>{const a=this.mirror.getNode(r),c=this.mirror.getNode(o);if(!a||!c)return;const u=new Range;u.setStart(a,n),u.setEnd(c,l);const h=a.ownerDocument,d=h==null?void 0:h.getSelection();return d&&t.add(d),{range:u,selection:d}});t.forEach(r=>r.removeAllRanges()),s.forEach(r=>{var n;return r&&((n=r.selection)==null?void 0:n.addRange(r.range))})}catch(t){}}applyStyleSheetMutation(e){var t;let s=null;e.styleId?s=this.styleMirror.getStyle(e.styleId):e.id&&(s=((t=this.mirror.getNode(e.id))==null?void 0:t.sheet)||null),s&&(e.source===E.StyleSheetRule?this.applyStyleSheetRule(e,s):e.source===E.StyleDeclaration&&this.applyStyleDeclaration(e,s))}applyStyleSheetRule(e,t){var s,r,n,o;if((s=e.adds)==null||s.forEach(({rule:l,index:a})=>{try{if(Array.isArray(a)){const{positions:c,index:u}=Sr(a);ot(t.cssRules,c).insertRule(l,u)}else{const c=a===void 0?void 0:Math.min(a,t.cssRules.length);t==null||t.insertRule(l,c)}}catch(c){}}),(r=e.removes)==null||r.forEach(({index:l})=>{try{if(Array.isArray(l)){const{positions:a,index:c}=Sr(l);ot(t.cssRules,a).deleteRule(c||0)}else t==null||t.deleteRule(l)}catch(a){}}),e.replace)try{(n=t.replace)==null||n.call(t,e.replace)}catch(l){}if(e.replaceSync)try{(o=t.replaceSync)==null||o.call(t,e.replaceSync)}catch(l){}}applyStyleDeclaration(e,t){e.set&&ot(t.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority),e.remove&&ot(t.rules,e.index).style.removeProperty(e.remove.property)}applyAdoptedStyleSheet(e){var t;const s=this.mirror.getNode(e.id);if(!s)return;(t=e.styles)==null||t.forEach(l=>{var a;let c=null,u=null;if(Ue(s)?u=((a=s.ownerDocument)==null?void 0:a.defaultView)||null:s.nodeName==="#document"&&(u=s.defaultView),!!u)try{c=new u.CSSStyleSheet,this.styleMirror.add(c,l.styleId),this.applyStyleSheetRule({source:E.StyleSheetRule,adds:l.rules},c)}catch(h){}});const r=10;let n=0;const o=(l,a)=>{const c=a.map(u=>this.styleMirror.getStyle(u)).filter(u=>u!==null);Ue(l)?l.shadowRoot.adoptedStyleSheets=c:l.nodeName==="#document"&&(l.adoptedStyleSheets=c),c.length!==a.length&&n<r&&(setTimeout(()=>o(l,a),0+100*n),n++)};o(s,e.styleIds)}legacy_resolveMissingNode(e,t,s,r){const{previousId:n,nextId:o}=r,l=n&&e[n],a=o&&e[o];if(l){const{node:c,mutation:u}=l;t.insertBefore(c,s),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}if(a){const{node:c,mutation:u}=a;t.insertBefore(c,s.nextSibling),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}}moveAndHover(e,t,s,r,n){const o=this.mirror.getNode(s);if(!o)return this.debugNodeNotFound(n,s);const l=dn(o,this.iframe),a=e*l.absoluteScale+l.x,c=t*l.absoluteScale+l.y;this.mouse.style.left=`${a}px`,this.mouse.style.top=`${c}px`,r||this.drawMouseTail({x:a,y:c}),this.hoverElements(o)}drawMouseTail(e){if(!this.mouseTail)return;const{lineCap:t,lineWidth:s,strokeStyle:r,duration:n}=this.config.mouseTail===!0?zi:Object.assign({},zi,this.config.mouseTail),o=()=>{if(!this.mouseTail)return;const l=this.mouseTail.getContext("2d");!l||!this.tailPositions.length||(l.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),l.beginPath(),l.lineWidth=s,l.lineCap=t,l.strokeStyle=r,l.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(a=>l.lineTo(a.x,a.y)),l.stroke())};this.tailPositions.push(e),o(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(l=>l!==e),o()},n/this.speedService.state.context.timer.speed)}hoverElements(e){var t;(t=this.lastHoveredRootNode||this.iframe.contentDocument)==null||t.querySelectorAll(".\\:hover").forEach(r=>{r.classList.remove(":hover")}),this.lastHoveredRootNode=e.getRootNode();let s=e;for(;s;)s.classList&&s.classList.add(":hover"),s=s.parentElement}isUserInteraction(e){return e.type!==I.IncrementalSnapshot?!1:e.data.source>E.Mutation&&e.data.source<=E.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(V.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,t){this.warn(`Node with id '${t}' not found. `,e)}warnCanvasMutationFailed(e,t){this.warn("Has error on canvas update",t,"canvas mutation:",e)}debugNodeNotFound(e,t){this.debug(`Node with id '${t}' not found. `,e)}warn(...e){this.config.showWarning&&this.config.logger.warn(sa,...e)}debug(...e){this.config.showDebug&&this.config.logger.log(sa,...e)}}const qy="3.4.0-alpha.1",{getVersion:Ky}=de,{isRecording:Qy}=de,{flushCustomEventQueue:eb}=de,{addCustomEvent:tb}=de,{freezePage:sb}=de,{takeFullSnapshot:ib}=de;exports.EventType=I;exports.IncrementalSource=E;exports.MouseInteractions=H;exports.Replayer=Jy;exports.ReplayerEvents=V;exports.addCustomEvent=tb;exports.canvasMutation=Er;exports.flushCustomEventQueue=eb;exports.freezePage=sb;exports.getVersion=Ky;exports.isRecording=Qy;exports.record=de;exports.takeFullSnapshot=ib;exports.utils=qm;exports.version=qy;
|
|
92
|
+
***************************************************************************** */function Jo(i,e){var t=typeof Symbol=="function"&&i[Symbol.iterator];if(!t)return i;var s,r,n=t.call(i),o=[];try{for(;(e===void 0||e-- >0)&&!(s=n.next()).done;)o.push(s.value)}catch(l){r={error:l}}finally{try{s&&!s.done&&(t=n.return)&&t.call(n)}finally{if(r)throw r.error}}return o}var lt;(function(i){i[i.NotStarted=0]="NotStarted",i[i.Running=1]="Running",i[i.Stopped=2]="Stopped"})(lt||(lt={}));var uc={type:"xstate.init"};function Fi(i){return i===void 0?[]:[].concat(i)}function it(i){return{type:"xstate.assign",assignment:i}}function qo(i,e){return typeof(i=typeof i=="string"&&e&&e[i]?e[i]:i)=="string"?{type:i}:typeof i=="function"?{type:i.name,exec:i}:i}function qs(i){return function(e){return i===e}}function hc(i){return typeof i=="string"?{type:i}:i}function Ko(i,e){return{value:i,context:e,actions:[],changed:!1,matches:qs(i)}}function Qo(i,e,t){var s=e,r=!1;return[i.filter(function(n){if(n.type==="xstate.assign"){r=!0;var o=Object.assign({},s);return typeof n.assignment=="function"?o=n.assignment(s,t):Object.keys(n.assignment).forEach(function(l){o[l]=typeof n.assignment[l]=="function"?n.assignment[l](s,t):n.assignment[l]}),s=o,!1}return!0}),s,r]}function dc(i,e){e===void 0&&(e={});var t=Jo(Qo(Fi(i.states[i.initial].entry).map(function(o){return qo(o,e.actions)}),i.context,uc),2),s=t[0],r=t[1],n={config:i,_options:e,initialState:{value:i.initial,actions:s,context:r,matches:qs(i.initial)},transition:function(o,l){var a,c,u=typeof o=="string"?{value:o,context:i.context}:o,h=u.value,d=u.context,f=hc(l),m=i.states[h];if(m.on){var y=Fi(m.on[f.type]);try{for(var p=function(W){var q=typeof Symbol=="function"&&Symbol.iterator,ce=q&&W[q],Le=0;if(ce)return ce.call(W);if(W&&typeof W.length=="number")return{next:function(){return W&&Le>=W.length&&(W=void 0),{value:W&&W[Le++],done:!W}}};throw new TypeError(q?"Object is not iterable.":"Symbol.iterator is not defined.")}(y),g=p.next();!g.done;g=p.next()){var S=g.value;if(S===void 0)return Ko(h,d);var v=typeof S=="string"?{target:S}:S,w=v.target,C=v.actions,x=C===void 0?[]:C,R=v.cond,T=R===void 0?function(){return!0}:R,z=w===void 0,U=w!=null?w:h,P=i.states[U];if(T(d,f)){var j=Jo(Qo((z?Fi(x):[].concat(m.exit,x,P.entry).filter(function(W){return W})).map(function(W){return qo(W,n._options.actions)}),d,f),3),J=j[0],ie=j[1],N=j[2],F=w!=null?w:h;return{value:F,context:ie,actions:J,changed:w!==h||J.length>0||N,matches:qs(F)}}}}catch(W){a={error:W}}finally{try{g&&!g.done&&(c=p.return)&&c.call(p)}finally{if(a)throw a.error}}}return Ko(h,d)}};return n}var ea=function(i,e){return i.actions.forEach(function(t){var s=t.exec;return s&&s(i.context,e)})};function fc(i){var e=i.initialState,t=lt.NotStarted,s=new Set,r={_machine:i,send:function(n){t===lt.Running&&(e=i.transition(e,n),ea(e,hc(n)),s.forEach(function(o){return o(e)}))},subscribe:function(n){return s.add(n),n(e),{unsubscribe:function(){return s.delete(n)}}},start:function(n){if(n){var o=typeof n=="object"?n:{context:i.config.context,value:n};e={value:o.value,actions:[],context:o.context,matches:qs(o.value)}}return t=lt.Running,ea(e,uc),r},stop:function(){return t=lt.Stopped,s.clear(),r},get state(){return e},get status(){return t}};return r}function Py(i,e){for(let t=i.length-1;t>=0;t--){const s=i[t];if(s.type===I.Meta&&s.timestamp<=e)return i.slice(t)}return i}function Fy(i,{getCastFn:e,applyEventsSynchronously:t,emitter:s}){const r=dc({id:"player",context:i,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:it({lastPlayedEvent:(n,o)=>o.type==="CAST_EVENT"?o.payload.event:n.lastPlayedEvent}),recordTimeOffset:it((n,o)=>{let l=n.timeOffset;return"payload"in o&&"timeOffset"in o.payload&&(l=o.payload.timeOffset),re(A({},n),{timeOffset:l,baselineTime:n.events[0].timestamp+l})}),play(n){var o;const{timer:l,events:a,baselineTime:c,lastPlayedEvent:u}=n;l.clear();for(const m of a)Xo(m,c);const h=Py(a,c);let d=u==null?void 0:u.timestamp;(u==null?void 0:u.type)===I.IncrementalSnapshot&&u.data.source===E.MouseMove&&(d=u.timestamp+((o=u.data.positions[0])==null?void 0:o.timeOffset)),c<(d||0)&&s.emit(V.PlayBack);const f=new Array;for(const m of h)if(!(d&&d<c&&(m.timestamp<=d||m===u)))if(m.timestamp<=c)f.push(m);else{const y=e(m,!1);l.addAction({doAction:()=>{y()},delay:m.delay})}t(f),s.emit(V.Flush),l.start()},pause(n){n.timer.clear()},resetLastPlayedEvent:it(n=>re(A({},n),{lastPlayedEvent:null})),startLive:it({baselineTime:(n,o)=>(n.timer.start(),o.type==="TO_LIVE"&&o.payload.baselineTime?o.payload.baselineTime:Date.now())}),addEvent:it((n,o)=>{const{baselineTime:l,timer:a,events:c}=n;if(o.type==="ADD_EVENT"){const{event:u}=o.payload;Xo(u,l);let h=c.length-1;if(!c[h]||c[h].timestamp<=u.timestamp)c.push(u);else{let m=-1,y=0;for(;y<=h;){const p=Math.floor((y+h)/2);c[p].timestamp<=u.timestamp?y=p+1:h=p-1}m===-1&&(m=y),c.splice(m,0,u)}const d=u.timestamp<l,f=e(u,d);d?f():a.isActive()&&a.addAction({doAction:()=>{f()},delay:u.delay})}return re(A({},n),{events:c})})}});return fc(r)}function zy(i){const e=dc({id:"speed",context:i,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(t,s)=>{"payload"in s&&t.timer.setSpeed(s.payload.speed)},recordSpeed:it({normalSpeed:t=>t.timer.speed}),restoreSpeed:t=>{t.timer.setSpeed(t.normalSpeed)}}});return fc(e)}const By=i=>[`.${i} { background: currentColor }`,"noscript { display: none !important; }"],ta=new Map;function pc(i,e){let t=ta.get(i);return t||(t=new Map,ta.set(i,t)),t.has(e)||t.set(e,[]),t.get(e)}function He(i,e,t){return async s=>{if(s&&typeof s=="object"&&"rr_type"in s)if(t&&(t.isUnchanged=!1),s.rr_type==="ImageBitmap"&&"args"in s){const r=await He(i,e,t)(s.args);return await createImageBitmap.apply(null,r)}else if("index"in s){if(t||e===null)return s;const{rr_type:r,index:n}=s;return pc(e,r)[n]}else if("args"in s){const{rr_type:r,args:n}=s,o=window[r];return new o(...await Promise.all(n.map(He(i,e,t))))}else{if("base64"in s)return hy(s.base64);if("src"in s){const r=i.get(s.src);if(r)return r;{const n=new Image;return n.src=s.src,i.set(s.src,n),n}}else if("data"in s&&s.rr_type==="Blob"){const r=await Promise.all(s.data.map(He(i,e,t)));return new Blob(r,{type:s.type})}}else if(Array.isArray(s))return await Promise.all(s.map(He(i,e,t)));return s}}function Wy(i,e){try{return e===_e.WebGL?i.getContext("webgl")||i.getContext("experimental-webgl"):i.getContext("webgl2")}catch(t){return null}}const Uy=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function Vy(i,e){if(!(e!=null&&e.constructor))return;const{name:t}=e.constructor;if(!Uy.includes(t))return;const s=pc(i,t);s.includes(e)||s.push(e)}async function Hy({mutation:i,target:e,type:t,imageMap:s,errorHandler:r}){try{const n=Wy(e,t);if(!n)return;if(i.setter){n[i.property]=i.args[0];return}const o=n[i.property],l=await Promise.all(i.args.map(He(s,n))),a=o.apply(n,l);Vy(n,a);const c=!1}catch(n){r(i,n)}}async function Gy({event:i,mutations:e,target:t,imageMap:s,errorHandler:r}){const n=t.getContext("2d");if(!n){r(e[0],new Error("Canvas context is null"));return}const o=e.map(async a=>Promise.all(a.args.map(He(s,n))));(await Promise.all(o)).forEach((a,c)=>{const u=e[c];try{if(u.setter){n[u.property]=u.args[0];return}const h=n[u.property];u.property==="drawImage"&&typeof u.args[0]=="string"?(s.get(i),h.apply(n,u.args)):h.apply(n,a)}catch(h){r(u,h)}})}async function Er({event:i,mutation:e,target:t,imageMap:s,canvasEventMap:r,errorHandler:n}){try{const o=r.get(i)||e,l="commands"in o?o.commands:[o];if([_e.WebGL,_e.WebGL2].includes(e.type)){for(let a=0;a<l.length;a++){const c=l[a];await Hy({mutation:c,type:e.type,target:t,imageMap:s,errorHandler:n})}return}await Gy({event:i,mutations:l,target:t,imageMap:s,errorHandler:n})}catch(o){n(e,o)}}class jy{constructor(e){b(this,"mediaMap",new Map),b(this,"warn"),b(this,"service"),b(this,"speedService"),b(this,"emitter"),b(this,"getCurrentTime"),b(this,"metadataCallbackMap",new Map),this.warn=e.warn,this.service=e.service,this.speedService=e.speedService,this.emitter=e.emitter,this.getCurrentTime=e.getCurrentTime,this.emitter.on(V.Start,this.start.bind(this)),this.emitter.on(V.SkipStart,this.start.bind(this)),this.emitter.on(V.Pause,this.pause.bind(this)),this.emitter.on(V.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(e={pause:!1}){this.mediaMap.forEach((t,s)=>{this.syncTargetWithState(s),e.pause&&s.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:e,target:t,mediaState:s}){if(s.isPlaying){const n=(e-s.lastInteractionTimeOffset)/1e3*s.playbackRate,o="duration"in t&&t.duration;if(Number.isNaN(o)){this.waitForMetadata(t);return}let l=s.currentTimeAtLastInteraction+n;t.loop&&o!==!1&&(l=l%o),t.currentTime=l}else t.pause(),t.currentTime=s.currentTimeAtLastInteraction}waitForMetadata(e){if(this.metadataCallbackMap.has(e)||!("addEventListener"in e))return;const t=()=>{this.metadataCallbackMap.delete(e);const s=this.mediaMap.get(e);s&&this.seekTo({time:this.getCurrentTime(),target:e,mediaState:s})};this.metadataCallbackMap.set(e,t),e.addEventListener("loadedmetadata",t,{once:!0})}getMediaStateFromMutation({target:e,timeOffset:t,mutation:s}){var f,m,y,p,g;const r=this.mediaMap.get(e),{type:n,playbackRate:o,currentTime:l,muted:a,volume:c,loop:u}=s;return{isPlaying:n===Be.Play||n!==Be.Pause&&((r==null?void 0:r.isPlaying)||e.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:(f=l!=null?l:r==null?void 0:r.currentTimeAtLastInteraction)!=null?f:0,lastInteractionTimeOffset:t,playbackRate:(m=o!=null?o:r==null?void 0:r.playbackRate)!=null?m:1,volume:(y=c!=null?c:r==null?void 0:r.volume)!=null?y:1,muted:(p=a!=null?a:r==null?void 0:r.muted)!=null?p:e.getAttribute("muted")===null,loop:(g=u!=null?u:r==null?void 0:r.loop)!=null?g:e.getAttribute("loop")===null}}syncTargetWithState(e){const t=this.mediaMap.get(e);if(!t)return;const{muted:s,loop:r,volume:n,isPlaying:o}=t,l=this.service.state.matches("paused"),a=t.playbackRate*this.speedService.state.context.timer.speed;try{this.seekTo({time:this.getCurrentTime(),target:e,mediaState:t}),e.volume!==n&&(e.volume=n),e.muted=s,e.loop=r,e.playbackRate!==a&&(e.playbackRate=a),o&&!l?e.play():e.pause()}catch(c){this.warn(`Failed to replay media interactions: ${c.message||c}`)}}addMediaElements(e,t,s){if(!["AUDIO","VIDEO"].includes(e.nodeName))return;const r=e,n=s.getMeta(r);if(!n||!("attributes"in n))return;const o=this.service.state.matches("paused"),l=n.attributes;let a=!1;l.rr_mediaState?a=l.rr_mediaState==="played":a=r.getAttribute("autoplay")!==null,a&&o&&r.pause();let c=1;typeof l.rr_mediaPlaybackRate=="number"&&(c=l.rr_mediaPlaybackRate);let u=!1;typeof l.rr_mediaMuted=="boolean"?u=l.rr_mediaMuted:u=r.getAttribute("muted")!==null;let h=!1;typeof l.rr_mediaLoop=="boolean"?h=l.rr_mediaLoop:h=r.getAttribute("loop")!==null;let d=1;typeof l.rr_mediaVolume=="number"&&(d=l.rr_mediaVolume);let f=0;typeof l.rr_mediaCurrentTime=="number"&&(f=l.rr_mediaCurrentTime),this.mediaMap.set(r,{isPlaying:a,currentTimeAtLastInteraction:f,lastInteractionTimeOffset:t,playbackRate:c,volume:d,muted:u,loop:h}),this.syncTargetWithState(r)}mediaMutation({target:e,timeOffset:t,mutation:s}){this.mediaMap.set(e,this.getMediaStateFromMutation({target:e,timeOffset:t,mutation:s})),this.syncTargetWithState(e)}isSupportedMediaElement(e){return["AUDIO","VIDEO"].includes(e.nodeName)}reset(){this.mediaMap.clear()}}function Is(i,e){if(i.nodeName!=="DIALOG"||i instanceof Ce)return;const t=i,s=t.open,r=s&&t.matches("dialog:modal"),n=t.getAttribute("rr_open_mode"),o=typeof(e==null?void 0:e.attributes.open)=="string"||typeof t.getAttribute("open")=="string",l=n==="modal";if(!(s&&!(r&&n==="non-modal"||!r&&l))){if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}s&&t.close(),o&&(l?t.showModal():t.show())}}function Yy(i,e){if(i.nodeName!=="DIALOG"||i instanceof Ce)return;const t=i;if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}e.attributes.open===null&&(t.removeAttribute("open"),t.removeAttribute("rr_open_mode"))}const Zy=5*1e3,Xy=cc||ky,sa="[replayer]",zi={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function ia(i){return i.type==I.IncrementalSnapshot&&(i.data.source==E.TouchMove||i.data.source==E.MouseInteraction&&i.data.type==H.TouchStart)}class Jy{constructor(e,t){if(b(this,"wrapper"),b(this,"iframe"),b(this,"service"),b(this,"speedService"),b(this,"config"),b(this,"usingVirtualDom",!1),b(this,"virtualDom",new bt),b(this,"mouse"),b(this,"mouseTail",null),b(this,"tailPositions",[]),b(this,"emitter",Xy()),b(this,"nextUserInteractionEvent"),b(this,"legacy_missingNodeRetryMap",{}),b(this,"cache",oo()),b(this,"imageMap",new Map),b(this,"canvasEventMap",new Map),b(this,"mirror",oa()),b(this,"styleMirror",new fn),b(this,"mediaManager"),b(this,"firstFullSnapshot",null),b(this,"newDocumentQueue",[]),b(this,"mousePos",null),b(this,"touchActive",null),b(this,"lastMouseDownEvent",null),b(this,"lastHoveredRootNode"),b(this,"lastSelectionData",null),b(this,"constructedStyleMutations",[]),b(this,"adoptedStyleSheets",[]),b(this,"handleResize",l=>{this.iframe.style.display="inherit";for(const a of[this.mouseTail,this.iframe])a&&(a.setAttribute("width",String(l.width)),a.setAttribute("height",String(l.height)))}),b(this,"applyEventsSynchronously",l=>{for(const a of l){switch(a.type){case I.DomContentLoaded:case I.Load:case I.Custom:continue;case I.FullSnapshot:case I.Meta:case I.Plugin:case I.IncrementalSnapshot:break}this.getCastFn(a,!0)()}}),b(this,"getCastFn",(l,a=!1)=>{let c;switch(l.type){case I.DomContentLoaded:case I.Load:break;case I.Custom:c=()=>{this.emitter.emit(V.CustomEvent,l)};break;case I.Meta:c=()=>this.emitter.emit(V.Resize,{width:l.data.width,height:l.data.height});break;case I.FullSnapshot:c=()=>{var h;if(this.firstFullSnapshot){if(this.firstFullSnapshot===l){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(l,a),(h=this.iframe.contentWindow)==null||h.scrollTo(l.data.initialOffset)};break;case I.IncrementalSnapshot:c=()=>{if(this.applyIncremental(l,a),!a&&(l===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const h of this.service.state.context.events)if(!(h.timestamp<=l.timestamp)&&this.isUserInteraction(h)){h.delay-l.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=h);break}if(this.nextUserInteractionEvent){const h=this.nextUserInteractionEvent.delay-l.delay,d={speed:Math.min(Math.round(h/Zy),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:d}),this.emitter.emit(V.SkipStart,d)}}};break}return()=>{c&&c();for(const d of this.config.plugins||[])d.handler&&d.handler(l,a,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:l}});const h=this.service.state.context.events.length-1;if(!this.config.liveMode&&l===this.service.state.context.events[h]){const d=()=>{h<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(V.Finish))};let f=50;l.type===I.IncrementalSnapshot&&l.data.source===E.MouseMove&&l.data.positions.length&&(f+=Math.max(0,-l.data.positions[0].timeOffset)),setTimeout(d,f)}this.emitter.emit(V.EventCast,l)}}),!(t!=null&&t.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");const s={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,inactivePeriodThreshold:10*1e3,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:zi,useVirtualDom:!0,logger:console};this.config=Object.assign({},s,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(V.Resize,this.handleResize),this.setupDom();for(const l of this.config.plugins||[])l.getMirror&&l.getMirror({nodeMirror:this.mirror});this.emitter.on(V.Flush,()=>{if(this.usingVirtualDom){const l={mirror:this.mirror,applyCanvas:(a,c,u)=>{Er({event:a,mutation:c,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(a,c)=>{a.source===E.StyleSheetRule?this.applyStyleSheetRule(a,c):a.source===E.StyleDeclaration&&this.applyStyleDeclaration(a,c)},afterAppend:(a,c)=>{for(const u of this.config.plugins||[])u.onBuild&&u.onBuild(a,{id:c,replayer:this})}};if(this.iframe.contentDocument)try{js(this.iframe.contentDocument,this.virtualDom,l,this.virtualDom.mirror)}catch(a){console.warn(a)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const a in this.legacy_missingNodeRetryMap)try{const c=this.legacy_missingNodeRetryMap[a],u=Ys(c.node,this.mirror,this.virtualDom.mirror);js(u,c.node,l,this.virtualDom.mirror),c.node=u}catch(c){this.warn(c)}this.constructedStyleMutations.forEach(a=>{this.applyStyleSheetMutation(a)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(a=>{this.applyAdoptedStyleSheet(a)}),this.adoptedStyleSheets=[]}if(this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null,this.lastMouseDownEvent){const[l,a]=this.lastMouseDownEvent;l.dispatchEvent(a)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(V.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()});const r=new Ly([],{speed:this.config.speed});this.service=Fy({events:e.map(l=>t&&t.unpackFn?t.unpackFn(l):l).sort((l,a)=>l.timestamp-a.timestamp),timer:r,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(l=>{this.emitter.emit(V.StateChange,{player:l})}),this.speedService=zy({normalSpeed:-1,timer:r}),this.speedService.start(),this.speedService.subscribe(l=>{this.emitter.emit(V.StateChange,{speed:l})}),this.mediaManager=new jy({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});const n=this.service.state.context.events.find(l=>l.type===I.Meta),o=this.service.state.context.events.find(l=>l.type===I.FullSnapshot);if(n){const{width:l,height:a}=n.data;setTimeout(()=>{this.emitter.emit(V.Resize,{width:l,height:a})},0)}o&&setTimeout(()=>{var l;this.firstFullSnapshot||(this.firstFullSnapshot=o,this.rebuildFullSnapshot(o),(l=this.iframe.contentWindow)==null||l.scrollTo(o.data.initialOffset))},1),this.service.state.context.events.find(ia)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(e,t){return this.emitter.on(e,t),this}off(e,t){return this.emitter.off(e,t),this}setConfig(e){Object.keys(e).forEach(t=>{e[t],this.config[t]=e[t]}),this.config.skipInactive||this.backToNormal(),typeof e.speed!="undefined"&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),typeof e.mouseTail!="undefined"&&(e.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getMetaData(){const e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:e,events:t}=this.service.state.context;return e-t[0].timestamp}getMirror(){return this.mirror}play(e=0){var t,s;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:e}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}})),(s=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||s.classList.remove("rrweb-paused"),this.emitter.emit(V.Start)}pause(e){var t,s;e===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof e=="number"&&(this.play(e),this.service.send({type:"PAUSE"})),(s=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||s.classList.add("rrweb-paused"),this.emitter.emit(V.Pause)}resume(e=0){this.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(V.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(V.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){const t=this.config.unpackFn?this.config.unpackFn(e):e;ia(t)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:t}}))}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=oo()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");const e=["allow-same-origin","allow-scripts"];this.config.UNSAFE_replayCanvas,this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(_y(this.iframe.contentWindow,this.iframe.contentDocument),cn(this.iframe.contentWindow))}rebuildFullSnapshot(e,t=!1){if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&this.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const s=[],r=new Set,n=(a,c)=>{if(a.nodeName==="DIALOG"&&r.add(a),this.collectIframeAndAttachDocument(s,a),this.mediaManager.isSupportedMediaElement(a)){const{events:u}=this.service.state.context;this.mediaManager.addMediaElements(a,e.timestamp-u[0].timestamp,this.mirror)}for(const u of this.config.plugins||[])u.onBuild&&u.onBuild(a,{id:c,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),ff(e.data.node,{doc:this.iframe.contentDocument,afterAppend:n,cache:this.cache,mirror:this.mirror}),n(this.iframe.contentDocument,e.data.node.id);for(const{mutationInQueue:a,builtNode:c}of s)this.attachDocumentToIframe(a,c),this.newDocumentQueue=this.newDocumentQueue.filter(u=>u!==a);const{documentElement:o,head:l}=this.iframe.contentDocument;this.insertStyleRules(o,l),r.forEach(a=>Is(a)),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(V.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,t){var s;const r=By(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&r.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),!!r.length)if(this.usingVirtualDom){const n=this.virtualDom.createElement("style");this.virtualDom.mirror.add(n,Vl(n,this.virtualDom.unserializedId)),e.insertBefore(n,t),n.rules.push({source:E.StyleSheetRule,adds:r.map((o,l)=>({rule:o,index:l}))})}else{const n=document.createElement("style");e.insertBefore(n,t);for(let o=0;o<r.length;o++)(s=n.sheet)==null||s.insertRule(r[o],o)}}attachDocumentToIframe(e,t){const s=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,r=[],n=new Set,o=(l,a)=>{l.nodeName==="DIALOG"&&n.add(l),this.collectIframeAndAttachDocument(r,l);const c=s.getMeta(l);if((c==null?void 0:c.type)===Oe.Element&&(c==null?void 0:c.tagName.toUpperCase())==="HTML"){const{documentElement:u,head:h}=t.contentDocument;this.insertStyleRules(u,h)}if(!this.usingVirtualDom)for(const u of this.config.plugins||[])u.onBuild&&u.onBuild(l,{id:a,replayer:this})};$t(e.node,{doc:t.contentDocument,mirror:s,hackCss:!0,skipChild:!1,afterAppend:o,cache:this.cache}),o(t.contentDocument,e.node.id);for(const{mutationInQueue:l,builtNode:a}of r)this.attachDocumentToIframe(l,a),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==l);n.forEach(l=>Is(l))}collectIframeAndAttachDocument(e,t){if(ct(t,this.mirror)){const s=this.newDocumentQueue.find(r=>r.parentId===this.mirror.getId(t));s&&e.push({mutationInQueue:s,builtNode:t})}}waitForStylesheetLoad(){var e;const t=(e=this.iframe.contentDocument)==null?void 0:e.head;if(t){const s=new Set;let r,n=this.service.state;const o=()=>{n=this.service.state};this.emitter.on(V.Start,o),this.emitter.on(V.Pause,o);const l=()=>{this.emitter.off(V.Start,o),this.emitter.off(V.Pause,o)};t.querySelectorAll('link[rel="stylesheet"]').forEach(a=>{a.sheet||(s.add(a),a.addEventListener("load",()=>{s.delete(a),s.size===0&&r!==-1&&(n.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(V.LoadStylesheetEnd),r&&clearTimeout(r),l())}))}),s.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(V.LoadStylesheetStart),r=setTimeout(()=>{n.matches("playing")&&this.play(this.getCurrentTime()),r=-1,l()},this.config.loadTimeout))}}async preloadAllImages(){const e=[];for(const t of this.service.state.context.events)t.type===I.IncrementalSnapshot&&t.data.source===E.CanvasMutation&&(e.push(this.deserializeAndPreloadCanvasEvents(t.data,t)),("commands"in t.data?t.data.commands:[t.data]).forEach(r=>{this.preloadImages(r,t)}));return Promise.all(e)}preloadImages(e,t){if(e.property==="drawImage"&&typeof e.args[0]=="string"&&!this.imageMap.has(t)){const s=document.createElement("canvas"),r=s.getContext("2d"),n=r==null?void 0:r.createImageData(s.width,s.height);r==null||r.putImageData(n,0,0)}}async deserializeAndPreloadCanvasEvents(e,t){if(!this.canvasEventMap.has(t)){const s={isUnchanged:!0};if("commands"in e){const r=await Promise.all(e.commands.map(async n=>{const o=await Promise.all(n.args.map(He(this.imageMap,null,s)));return re(A({},n),{args:o})}));s.isUnchanged===!1&&this.canvasEventMap.set(t,re(A({},e),{commands:r}))}else{const r=await Promise.all(e.args.map(He(this.imageMap,null,s)));s.isUnchanged===!1&&this.canvasEventMap.set(t,re(A({},e),{args:r}))}}}applyIncremental(e,t){var s,r,n;const{data:o}=e;switch(o.source){case E.Mutation:{try{this.applyMutation(o,t)}catch(l){this.warn(`Exception in mutation ${l.message||l}`,o)}break}case E.Drag:case E.TouchMove:case E.MouseMove:if(t){const l=o.positions[o.positions.length-1];this.mousePos={x:l.x,y:l.y,id:l.id,debugData:o}}else o.positions.forEach(l=>{const a={doAction:()=>{this.moveAndHover(l.x,l.y,l.id,t,o)},delay:l.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(a)}),this.timer.addAction({doAction(){},delay:e.delay-((s=o.positions[0])==null?void 0:s.timeOffset)});break;case E.MouseInteraction:{if(o.id===-1)break;const l=new Event(Ge(H[o.type])),a=this.mirror.getNode(o.id);if(!a)return this.debugNodeNotFound(o,o.id);this.emitter.emit(V.MouseInteraction,{type:o.type,target:a});const{triggerFocus:c}=this.config;switch(o.type){case H.Blur:"blur"in a&&a.blur();break;case H.Focus:c&&a.focus&&a.focus({preventScroll:!0});break;case H.Click:case H.TouchStart:case H.TouchEnd:case H.MouseDown:case H.MouseUp:t?(o.type===H.TouchStart?this.touchActive=!0:o.type===H.TouchEnd&&(this.touchActive=!1),o.type===H.MouseDown?this.lastMouseDownEvent=[a,l]:o.type===H.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:o.x||0,y:o.y||0,id:o.id,debugData:o}):(o.type===H.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(o.x||0,o.y||0,o.id,t,o),o.type===H.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):o.type===H.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):o.type===H.TouchEnd?this.mouse.classList.remove("touch-active"):a.dispatchEvent(l));break;case H.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:a.dispatchEvent(l)}break}case E.Scroll:{if(o.id===-1)break;if(this.usingVirtualDom){const l=this.virtualDom.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);l.scrollData=o;break}this.applyScroll(o,t);break}case E.ViewportResize:this.emitter.emit(V.Resize,{width:o.width,height:o.height});break;case E.Input:{if(o.id===-1)break;if(this.usingVirtualDom){const l=this.virtualDom.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);l.inputData=o;break}this.applyInput(o);break}case E.MediaInteraction:{const l=this.usingVirtualDom?this.virtualDom.mirror.getNode(o.id):this.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);const a=l,{events:c}=this.service.state.context;this.mediaManager.mediaMutation({target:a,timeOffset:e.timestamp-c[0].timestamp,mutation:o});break}case E.StyleSheetRule:case E.StyleDeclaration:{this.usingVirtualDom?o.styleId?this.constructedStyleMutations.push(o):o.id&&((r=this.virtualDom.mirror.getNode(o.id))==null||r.rules.push(o)):this.applyStyleSheetMutation(o);break}case E.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const l=this.virtualDom.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);l.canvasMutations.push({event:e,mutation:o})}else{const l=this.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);Er({event:e,mutation:o,target:l,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case E.Font:{try{const l=new FontFace(o.family,o.buffer?new Uint8Array(JSON.parse(o.fontSource)):o.fontSource,o.descriptors);(n=this.iframe.contentDocument)==null||n.fonts.add(l)}catch(l){this.warn(l)}break}case E.Selection:{if(t){this.lastSelectionData=o;break}this.applySelection(o);break}case E.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(o):this.applyAdoptedStyleSheet(o);break}case E.Visibility:{const{mutations:l}=o;for(const a of l){const c=this.usingVirtualDom?this.virtualDom.mirror.getNode(a.id):this.mirror.getNode(a.id);c&&c instanceof Element&&(c.style.visibility=a.isVisible?"visible":"hidden")}break}}}applyMutation(e,t){if(this.config.useVirtualDom&&!this.usingVirtualDom&&t&&(this.usingVirtualDom=!0,km(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const c in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[c],h=Ul(u.node,this.virtualDom,this.mirror);h&&(u.node=h)}catch(u){this.warn(u)}const s=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter(c=>s.getNode(c.id)?!0:(this.warnNodeNotFound(e,c.id),!1)),e.removes.forEach(c=>{var u;const h=s.getNode(c.id);if(!h)return;let d=s.getNode(c.parentId);if(!d)return this.warnNodeNotFound(e,c.parentId);if(c.isShadow&&Ue(d)&&(d=d.shadowRoot),s.removeNodeFromMap(h),d)try{d.removeChild(h),this.usingVirtualDom&&h.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)==null?void 0:u.length)>0&&(d.rules=[])}catch(f){if(f instanceof DOMException)this.warn("parent could not remove child in mutation",d,h,e);else throw f}});const r=A({},this.legacy_missingNodeRetryMap),n=[],o=c=>{let u=null;return c.nextId&&(u=s.getNode(c.nextId)),c.nextId!==null&&c.nextId!==void 0&&c.nextId!==-1&&!u},l=c=>{var u,h;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let d=s.getNode(c.parentId);if(!d)return c.node.type===Oe.Document?this.newDocumentQueue.push(c):n.push(c);c.node.isShadow&&(Ue(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let f=null,m=null;if(c.previousId&&(f=s.getNode(c.previousId)),c.nextId&&(m=s.getNode(c.nextId)),o(c))return n.push(c);if(c.node.rootId&&!s.getNode(c.node.rootId))return;const y=c.node.rootId?s.getNode(c.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(ct(d,s)){this.attachDocumentToIframe(c,d);return}const p=(v,w)=>{if(!this.usingVirtualDom){Is(v);for(const C of this.config.plugins||[])C.onBuild&&C.onBuild(v,{id:w,replayer:this})}},g=$t(c.node,{doc:y,mirror:s,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:p});if(c.previousId===-1||c.nextId===-1){r[c.node.id]={node:g,mutation:c};return}const S=s.getMeta(d);if(S&&S.type===Oe.Element&&c.node.type===Oe.Text){const v=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);if(S.tagName==="textarea")for(const w of v)w.nodeType===d.TEXT_NODE&&d.removeChild(w);else if(S.tagName==="style"&&v.length===1)for(const w of v)w.nodeType===d.TEXT_NODE&&!s.hasNode(w)&&(g.textContent=w.textContent,d.removeChild(w))}else if((S==null?void 0:S.type)===Oe.Document){const v=d;c.node.type===Oe.DocumentType&&((u=v.childNodes[0])==null?void 0:u.nodeType)===Node.DOCUMENT_TYPE_NODE&&v.removeChild(v.childNodes[0]),g.nodeName==="HTML"&&v.documentElement&&v.removeChild(v.documentElement)}if(f&&f.nextSibling&&f.nextSibling.parentNode?d.insertBefore(g,f.nextSibling):m&&m.parentNode?d.contains(m)?d.insertBefore(g,m):d.insertBefore(g,null):d.appendChild(g),p(g,c.node.id),this.usingVirtualDom&&g.nodeName==="#text"&&d.nodeName==="STYLE"&&((h=d.rules)==null?void 0:h.length)>0&&(d.rules=[]),ct(g,this.mirror)){const v=this.mirror.getId(g),w=this.newDocumentQueue.find(C=>C.parentId===v);w&&(this.attachDocumentToIframe(w,g),this.newDocumentQueue=this.newDocumentQueue.filter(C=>C!==w))}(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(r,d,g,c)};e.adds.forEach(c=>{l(c)});const a=Date.now();for(;n.length;){const c=jl(n);if(n.length=0,Date.now()-a>500){this.warn("Timeout in the loop, please check the resolve tree data:",c);break}for(const u of c)s.getNode(u.value.parentId)?un(u,d=>{l(d)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(r).length&&Object.assign(this.legacy_missingNodeRetryMap,r),Yl(e.texts).forEach(c=>{var u;const h=s.getNode(c.id);if(!h)return e.removes.find(f=>f.id===c.id)?void 0:this.warnNodeNotFound(e,c.id);const d=h.parentElement;if(c.value&&d&&d.tagName==="STYLE"?h.textContent=ii(c.value,this.cache):h.textContent=c.value,this.usingVirtualDom){const f=h.parentNode;((u=f==null?void 0:f.rules)==null?void 0:u.length)>0&&(f.rules=[])}}),e.attributes.forEach(c=>{var u;const h=s.getNode(c.id);if(!h)return e.removes.find(d=>d.id===c.id)?void 0:this.warnNodeNotFound(e,c.id);for(const d in c.attributes)if(typeof d=="string"){const f=c.attributes[d];if(f===null)h.removeAttribute(d),d==="open"&&Yy(h,c);else if(typeof f=="string")try{if(d==="_cssText"&&(h.nodeName==="LINK"||h.nodeName==="STYLE"))try{const m=s.getMeta(h),y=$t(re(A({},m),{attributes:A(A({},m.attributes),c.attributes)}),{doc:h.ownerDocument,mirror:s,skipChild:!0,hackCss:!0,cache:this.cache});Object.assign(m.attributes,c.attributes);const p=h.nextSibling,g=h.parentNode;if(y&&g){g.removeChild(h),g.insertBefore(y,p),s.replace(c.id,y);break}}catch(m){}if(d==="value"&&h.nodeName==="TEXTAREA"){const m=h;m.childNodes.forEach(p=>m.removeChild(p));const y=(u=h.ownerDocument)==null?void 0:u.createTextNode(f);y&&m.appendChild(y)}else h.setAttribute(d,f);d==="rr_open_mode"&&h.nodeName==="DIALOG"&&Is(h,c)}catch(m){this.warn("An error occurred may due to the checkout feature.",m)}else if(d==="style"){const m=f,y=h;for(const p in m)if(m[p]===!1)y.style.removeProperty(p);else if(m[p]instanceof Array){const g=m[p];y.style.setProperty(p,g[0],g[1])}else{const g=m[p];y.style.setProperty(p,g)}}}})}applyScroll(e,t){var s,r;const n=this.mirror.getNode(e.id);if(!n)return this.debugNodeNotFound(e,e.id);const o=this.mirror.getMeta(n);if(n===this.iframe.contentDocument)(s=this.iframe.contentWindow)==null||s.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else if((o==null?void 0:o.type)===Oe.Document)(r=n.defaultView)==null||r.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else try{n.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"})}catch(l){}}applyInput(e){const t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch(s){}}applySelection(e){try{const t=new Set,s=e.ranges.map(({start:r,startOffset:n,end:o,endOffset:l})=>{const a=this.mirror.getNode(r),c=this.mirror.getNode(o);if(!a||!c)return;const u=new Range;u.setStart(a,n),u.setEnd(c,l);const h=a.ownerDocument,d=h==null?void 0:h.getSelection();return d&&t.add(d),{range:u,selection:d}});t.forEach(r=>r.removeAllRanges()),s.forEach(r=>{var n;return r&&((n=r.selection)==null?void 0:n.addRange(r.range))})}catch(t){}}applyStyleSheetMutation(e){var t;let s=null;e.styleId?s=this.styleMirror.getStyle(e.styleId):e.id&&(s=((t=this.mirror.getNode(e.id))==null?void 0:t.sheet)||null),s&&(e.source===E.StyleSheetRule?this.applyStyleSheetRule(e,s):e.source===E.StyleDeclaration&&this.applyStyleDeclaration(e,s))}applyStyleSheetRule(e,t){var s,r,n,o;if((s=e.adds)==null||s.forEach(({rule:l,index:a})=>{try{if(Array.isArray(a)){const{positions:c,index:u}=Sr(a);ot(t.cssRules,c).insertRule(l,u)}else{const c=a===void 0?void 0:Math.min(a,t.cssRules.length);t==null||t.insertRule(l,c)}}catch(c){}}),(r=e.removes)==null||r.forEach(({index:l})=>{try{if(Array.isArray(l)){const{positions:a,index:c}=Sr(l);ot(t.cssRules,a).deleteRule(c||0)}else t==null||t.deleteRule(l)}catch(a){}}),e.replace)try{(n=t.replace)==null||n.call(t,e.replace)}catch(l){}if(e.replaceSync)try{(o=t.replaceSync)==null||o.call(t,e.replaceSync)}catch(l){}}applyStyleDeclaration(e,t){e.set&&ot(t.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority),e.remove&&ot(t.rules,e.index).style.removeProperty(e.remove.property)}applyAdoptedStyleSheet(e){var t;const s=this.mirror.getNode(e.id);if(!s)return;(t=e.styles)==null||t.forEach(l=>{var a;let c=null,u=null;if(Ue(s)?u=((a=s.ownerDocument)==null?void 0:a.defaultView)||null:s.nodeName==="#document"&&(u=s.defaultView),!!u)try{c=new u.CSSStyleSheet,this.styleMirror.add(c,l.styleId),this.applyStyleSheetRule({source:E.StyleSheetRule,adds:l.rules},c)}catch(h){}});const r=10;let n=0;const o=(l,a)=>{const c=a.map(u=>this.styleMirror.getStyle(u)).filter(u=>u!==null);Ue(l)?l.shadowRoot.adoptedStyleSheets=c:l.nodeName==="#document"&&(l.adoptedStyleSheets=c),c.length!==a.length&&n<r&&(setTimeout(()=>o(l,a),0+100*n),n++)};o(s,e.styleIds)}legacy_resolveMissingNode(e,t,s,r){const{previousId:n,nextId:o}=r,l=n&&e[n],a=o&&e[o];if(l){const{node:c,mutation:u}=l;t.insertBefore(c,s),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}if(a){const{node:c,mutation:u}=a;t.insertBefore(c,s.nextSibling),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}}moveAndHover(e,t,s,r,n){const o=this.mirror.getNode(s);if(!o)return this.debugNodeNotFound(n,s);const l=dn(o,this.iframe),a=e*l.absoluteScale+l.x,c=t*l.absoluteScale+l.y;this.mouse.style.left=`${a}px`,this.mouse.style.top=`${c}px`,r||this.drawMouseTail({x:a,y:c}),this.hoverElements(o)}drawMouseTail(e){if(!this.mouseTail)return;const{lineCap:t,lineWidth:s,strokeStyle:r,duration:n}=this.config.mouseTail===!0?zi:Object.assign({},zi,this.config.mouseTail),o=()=>{if(!this.mouseTail)return;const l=this.mouseTail.getContext("2d");!l||!this.tailPositions.length||(l.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),l.beginPath(),l.lineWidth=s,l.lineCap=t,l.strokeStyle=r,l.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(a=>l.lineTo(a.x,a.y)),l.stroke())};this.tailPositions.push(e),o(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(l=>l!==e),o()},n/this.speedService.state.context.timer.speed)}hoverElements(e){var t;(t=this.lastHoveredRootNode||this.iframe.contentDocument)==null||t.querySelectorAll(".\\:hover").forEach(r=>{r.classList.remove(":hover")}),this.lastHoveredRootNode=e.getRootNode();let s=e;for(;s;)s.classList&&s.classList.add(":hover"),s=s.parentElement}isUserInteraction(e){return e.type!==I.IncrementalSnapshot?!1:e.data.source>E.Mutation&&e.data.source<=E.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(V.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,t){this.warn(`Node with id '${t}' not found. `,e)}warnCanvasMutationFailed(e,t){this.warn("Has error on canvas update",t,"canvas mutation:",e)}debugNodeNotFound(e,t){this.debug(`Node with id '${t}' not found. `,e)}warn(...e){this.config.showWarning&&this.config.logger.warn(sa,...e)}debug(...e){this.config.showDebug&&this.config.logger.log(sa,...e)}}const qy="3.5.0-alpha.1",{getVersion:Ky}=de,{isRecording:Qy}=de,{flushCustomEventQueue:eb}=de,{addCustomEvent:tb}=de,{freezePage:sb}=de,{takeFullSnapshot:ib}=de;exports.EventType=I;exports.IncrementalSource=E;exports.MouseInteractions=H;exports.Replayer=Jy;exports.ReplayerEvents=V;exports.addCustomEvent=tb;exports.canvasMutation=Er;exports.flushCustomEventQueue=eb;exports.freezePage=sb;exports.getVersion=Ky;exports.isRecording=Qy;exports.record=de;exports.takeFullSnapshot=ib;exports.utils=qm;exports.version=qy;
|
|
93
93
|
;if (typeof module.exports == "object" && typeof exports == "object") {
|
|
94
94
|
var __cp = (to, from, except, desc) => {
|
|
95
95
|
if ((from && typeof from === "object") || typeof from === "function") {
|