@extn/segi-js 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
- "use strict";var Segi=(()=>{var as=Object.create;var Tt=Object.defineProperty;var ls=Object.getOwnPropertyDescriptor;var cs=Object.getOwnPropertyNames;var us=Object.getPrototypeOf,ds=Object.prototype.hasOwnProperty;var Mt=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var D=(e,t)=>()=>(e&&(t=e(e=0)),t);var Rt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),et=(e,t)=>{for(var r in t)Tt(e,r,{get:t[r],enumerable:!0})},Nn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of cs(t))!ds.call(e,i)&&i!==r&&Tt(e,i,{get:()=>t[i],enumerable:!(n=ls(t,i))||n.enumerable});return e};var fs=(e,t,r)=>(r=e!=null?as(us(e)):{},Nn(t||!e||!e.__esModule?Tt(r,"default",{value:e,enumerable:!0}):r,e)),hs=e=>Nn(Tt({},"__esModule",{value:!0}),e);var Rn=Rt(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.SEGI_DEFAULT_ADMIN_URL=Se.SEGI_DEFAULT_CDN_URL=Se.SEGI_DEFAULT_PM2_ENDPOINT=Se.SEGI_DEFAULT_INGEST_ENDPOINT=Se.SEGI_DEFAULT_API_BASE=void 0;Se.SEGI_DEFAULT_API_BASE="https://segiapi.extn.ai";Se.SEGI_DEFAULT_INGEST_ENDPOINT="https://segiapi.extn.ai/api/ingest/events";Se.SEGI_DEFAULT_PM2_ENDPOINT="https://segiapi.extn.ai/api/ingest/pm2";Se.SEGI_DEFAULT_CDN_URL="https://cdn.extn.ai/segi/segi.min.js";Se.SEGI_DEFAULT_ADMIN_URL="https://segi.extn.ai"});var Dn=Rt(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.scrubHeaders=kn;ct.scrubObject=Ge;ct.scrubEvent=vs;var ps=new Set(["authorization","cookie","set-cookie","x-api-key","proxy-authorization"]),ms=[/^password$/i,/^passwd$/i,/token/i,/secret/i,/api[-_]?key/i,/^authorization$/i,/card[-_]?number/i,/^rrn$/i,/^residentnumber$/i],xn="[Filtered]";function kn(e){if(!e)return e;let t={};for(let[r,n]of Object.entries(e))ps.has(r.toLowerCase())?t[r]=xn:t[r]=n;return t}function gs(e){return ms.some(t=>t.test(e))}function Ge(e,t=0){if(t>8||e==null)return e;if(Array.isArray(e))return e.map(r=>Ge(r,t+1));if(typeof e=="object"){let r={};for(let[n,i]of Object.entries(e))gs(n)?r[n]=xn:r[n]=Ge(i,t+1);return r}return e}function vs(e){let t=JSON.parse(JSON.stringify(e));return t.request&&(t.request.headers=kn(t.request.headers),t.request.body=Ge(t.request.body),t.request.query=Ge(t.request.query)),t.extra&&(t.extra=Ge(t.extra)),t.tags&&(t.tags=Ge(t.tags)),t}});var On=Rt(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.generateFingerprint=Ss;var ys=Mt("crypto");function ur(e){return e?e.replace(/0x[0-9a-fA-F]+/g,"0xX").replace(/\b\d{4,}\b/g,"N").replace(/[\r\n]+/g," ").trim().slice(0,500):""}function Is(e){if(!e)return"";let t=e.split(`
2
- `).map(n=>n.trim()).filter(Boolean),r=t.find(n=>n.startsWith("at "))??t[1]??"";return ur(r)}function Ss(e){let t=[String(e.projectId),ur(e.errorName??""),ur(e.message??""),Is(e.stack??"")];return(0,ys.createHash)("sha256").update(t.join("|")).digest("hex")}});var _n=Rt(Te=>{"use strict";var Cs=Te&&Te.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),fr=Te&&Te.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Cs(t,e,r)};Object.defineProperty(Te,"__esModule",{value:!0});fr(Rn(),Te);fr(Dn(),Te);fr(On(),Te)});function Bn(e){return e<640?"mobile":e<1024?"tablet":"desktop"}function ws(e,t){let r=e;for(;r;){if(r.classList?.contains(t))return!0;r=r.parentElement}return!1}function Es(e){try{if(e.id)return`#${e.id}`;let t=e.tagName?.toLowerCase();if(!t)return;let r=(e.className&&typeof e.className=="string"?e.className.split(/\s+/).filter(Boolean).slice(0,2):[]).map(n=>`.${n}`);return`${t}${r.join("")}`.slice(0,512)}catch{return}}function Un(e){let t=e.options.mask?.class??"segi-mask",r=!1,n=[],i=-1,o=0,s=(d={})=>{if(n.length===0)return;let f=n.splice(0,n.length);e.sendClicks(f,!!d.useBeacon)},a=setInterval(()=>{r||s()},5e3),l=d=>{if(!r)try{let f=d.target;if(!f||ws(f,t))return;let h=Math.max(document.documentElement.scrollWidth,document.body?.scrollWidth??0,1),p=Math.max(document.documentElement.scrollHeight,document.body?.scrollHeight??0,1),v=d.pageX,I=d.pageY,g=window.innerWidth,m={sessionUid:e.sessionUid,ts:new Date().toISOString(),urlPath:location.pathname.slice(0,255),device:Bn(g),viewportW:g,viewportH:window.innerHeight,x:Math.round(d.clientX),y:Math.round(d.clientY),pageX:Math.round(v),pageY:Math.round(I),relX:Math.max(0,Math.min(1,v/h)),relY:Math.max(0,Math.min(1,I/p)),selector:Es(f),tag:f.tagName?.toLowerCase().slice(0,32),text:(f.textContent??void 0)?.trim().slice(0,128)||void 0};n.push(m),n.length>=50&&s()}catch{}},c=()=>{if(r)return;let d=Date.now();if(!(d-o<1e3))try{let f=Math.max(document.documentElement.scrollHeight,document.body?.scrollHeight??0,1),h=window.innerHeight,p=Math.round(window.scrollY+h),v=Math.max(0,Math.min(100,Math.round(p/f*100)));if(v<=i)return;i=v,o=d;let I=window.innerWidth;e.sendScroll({sessionUid:e.sessionUid,urlPath:location.pathname.slice(0,255),device:Bn(I),viewportH:h,docH:f,maxScrollY:p,maxScrollPct:v},!1)}catch{}},u=()=>{s({useBeacon:!0})};return window.addEventListener("click",l,!0),window.addEventListener("scroll",c,{capture:!0,passive:!0}),window.addEventListener("pagehide",u),{pause(){r=!0},resume(){r=!1},stop(){clearInterval(a),window.removeEventListener("click",l,!0),window.removeEventListener("scroll",c,!0),window.removeEventListener("pagehide",u),s({useBeacon:!0})},flushClicks:s}}var Wn=D(()=>{"use strict"});function xt(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function Hn(){try{if(typeof sessionStorage>"u")return null;let e=sessionStorage.getItem(Gn),t=Number(sessionStorage.getItem(Vn)??"0");return!e||!t?null:{uid:e,at:t}}catch{return null}}function mr(e,t){try{if(typeof sessionStorage>"u")return;sessionStorage.setItem(Gn,e),sessionStorage.setItem(Vn,String(t))}catch{}}function zn(){let e=Date.now(),t=Hn();if(t&&e-t.at<18e5)return mr(t.uid,e),t.uid;let r=xt();return mr(r,e),As=r,r}function Kn(){let e=Hn();e&&mr(e.uid,Date.now())}function gr(){try{if(typeof localStorage>"u")return tt||(tt=xt()),tt;let e=localStorage.getItem(Pn);if(e)return e;let t=xt();return localStorage.setItem(Pn,t),t}catch{return tt||(tt=xt()),tt}}var Gn,Vn,Pn,As,tt,Zn=D(()=>{"use strict";Gn="_bd_session_uid",Vn="_bd_session_at",Pn="_bd_anon",As=null,tt=null});function jn(e){return(e&&e.trim()||Ns).replace(/\/+$/,"").replace(/\/api\/ingest\/events$/,"").replace(/\/api\/ingest$/,"").replace(/\/api$/,"")}async function Me(e,t,r){let n=`${jn(e.endpoint)}/api/trace${t}`;try{return await fetch(n,{method:"POST",headers:{"Content-Type":"application/json","X-Segi-Project-Key":e.projectKey},body:JSON.stringify(r),keepalive:!0})}catch{return null}}function kt(e,t,r){try{if(typeof navigator>"u"||!navigator.sendBeacon)return!1;let n=`${jn(e.endpoint)}/api/trace${t}?pk=${encodeURIComponent(e.projectKey)}`,i=new Blob([JSON.stringify(r)],{type:"application/json"});return navigator.sendBeacon(n,i)}catch{return!1}}var Ns,Yn=D(()=>{"use strict";Ns="https://segiapi.extn.ai"});function ei(e){return e.nodeType===e.ELEMENT_NODE}function Ke(e){var t=e?.host;return t?.shadowRoot===e}function He(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Ts(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),e}function vr(e){try{var t=e.rules||e.cssRules;return t?Ts(Array.from(t).map(Ir).join("")):null}catch{return null}}function Ir(e){var t=e.cssText;if(Ms(e))try{t=vr(e.styleSheet)||t}catch{}return t}function Ms(e){return"styleSheet"in e}function Ot(){return new Sr}function dt(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,i=e.value,o=e.maskInputFn,s=i||"";return(t[r.toLowerCase()]||t[n])&&(o?s=o(s):s="*".repeat(s.length)),s}function Rs(e){var t=e.getContext("2d");if(!t)return!0;for(var r=50,n=0;n<e.width;n+=r)for(var i=0;i<e.height;i+=r){var o=t.getImageData,s=Xn in o?o[Xn]:o,a=new Uint32Array(s.call(t,n,i,Math.min(r,e.width-n),Math.min(r,e.height-i)).data.buffer);if(a.some(function(l){return l!==0}))return!1}return!0}function Cr(){return xs++}function Ds(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return ks.test(t)?"div":t}function Os(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function _s(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}function Dt(e,t){return(e||"").replace(Ls,function(r,n,i,o,s,a){var l=i||s||a,c=n||o||"";if(!l)return r;if(!Fs.test(l)||Bs.test(l))return"url(".concat(c).concat(l).concat(c,")");if(l[0]==="/")return"url(".concat(c).concat(_s(t)+l).concat(c,")");var u=t.split("/"),d=l.split("/");u.pop();for(var f=0,h=d;f<h.length;f++){var p=h[f];p!=="."&&(p===".."?u.pop():u.push(p))}return"url(".concat(c).concat(u.join("/")).concat(c,")")})}function Ps(e,t){if(t.trim()==="")return t;var r=0;function n(c){var u,d=c.exec(t.substring(r));return d?(u=d[0],r+=u.length,u):""}for(var i=[];n(Ws),!(r>=t.length);){var o=n(Us);if(o.slice(-1)===",")o=nt(e,o.substring(0,o.length-1)),i.push(o);else{var s="";o=nt(e,o);for(var a=!1;;){var l=t.charAt(r);if(l===""){i.push((o+s).trim());break}else if(a)l===")"&&(a=!1);else if(l===","){r+=1,i.push((o+s).trim());break}else l==="("&&(a=!0);s+=l,r+=1}}}return i.join(", ")}function nt(e,t){if(!t||t.trim()==="")return t;var r=e.createElement("a");return r.href=t,r.href}function Gs(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function br(){var e=document.createElement("a");return e.href="",e.href}function wr(e,t,r,n){return r==="src"||r==="href"&&n&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n&&n[0]!=="#"||r==="background"&&n&&(t==="table"||t==="td"||t==="th")?nt(e,n):r==="srcset"&&n?Ps(e,n):r==="style"&&n?Dt(n,br()):t==="object"&&r==="data"&&n?nt(e,n):n}function Vs(e,t,r){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var i=e.classList[n];if(t.test(i))return!0}return r?e.matches(r):!1}function ut(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?ut(e.parentNode,t,r):!1;for(var n=e.classList.length;n--;){var i=e.classList[n];if(t.test(i))return!0}return r?ut(e.parentNode,t,r):!1}function Er(e,t,r){var n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(n===null)return!1;if(typeof t=="string"){if(n.classList.contains(t)||n.closest(".".concat(t)))return!0}else if(ut(n,t,!0))return!0;return!!(r&&(n.matches(r)||n.closest(r)))}function Hs(e,t,r){var n=e.contentWindow;if(n){var i=!1,o;try{o=n.document.readyState}catch{return}if(o!=="complete"){var s=setTimeout(function(){i||(t(),i=!0)},r);e.addEventListener("load",function(){clearTimeout(s),i=!0,t()});return}var a="about:blank";if(n.location.href!==a||e.src===a||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function zs(e,t,r){var n=!1,i;try{i=e.sheet}catch{return}if(!i){var o=setTimeout(function(){n||(t(),n=!0)},r);e.addEventListener("load",function(){clearTimeout(o),n=!0,t()})}}function Ks(e,t){var r=t.doc,n=t.mirror,i=t.blockClass,o=t.blockSelector,s=t.maskTextClass,a=t.maskTextSelector,l=t.inlineStylesheet,c=t.maskInputOptions,u=c===void 0?{}:c,d=t.maskTextFn,f=t.maskInputFn,h=t.dataURLOptions,p=h===void 0?{}:h,v=t.inlineImages,I=t.recordCanvas,g=t.keepIframeSrcFn,m=t.newlyAddedElement,y=m===void 0?!1:m,b=Zs(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:B.Document,childNodes:[],compatMode:e.compatMode}:{type:B.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:B.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:b};case e.ELEMENT_NODE:return Ys(e,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:l,maskInputOptions:u,maskInputFn:f,dataURLOptions:p,inlineImages:v,recordCanvas:I,keepIframeSrcFn:g,newlyAddedElement:y,rootId:b});case e.TEXT_NODE:return js(e,{maskTextClass:s,maskTextSelector:a,maskTextFn:d,rootId:b});case e.CDATA_SECTION_NODE:return{type:B.CDATA,textContent:"",rootId:b};case e.COMMENT_NODE:return{type:B.Comment,textContent:e.textContent||"",rootId:b};default:return!1}}function Zs(e,t){if(t.hasNode(e)){var r=t.getId(e);return r===1?void 0:r}}function js(e,t){var r,n=t.maskTextClass,i=t.maskTextSelector,o=t.maskTextFn,s=t.rootId,a=e.parentNode&&e.parentNode.tagName,l=e.textContent,c=a==="STYLE"?!0:void 0,u=a==="SCRIPT"?!0:void 0;if(c&&l){try{e.nextSibling||e.previousSibling||!((r=e.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(l=Os(e.parentNode.sheet))}catch(d){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(d),e)}l=Dt(l,br())}return u&&(l="SCRIPT_PLACEHOLDER"),!c&&!u&&l&&Er(e,n,i)&&(l=o?o(l):l.replace(/[\S]/g,"*")),{type:B.Text,textContent:l||"",isStyle:c,rootId:s}}function Ys(e,t){for(var r=t.doc,n=t.blockClass,i=t.blockSelector,o=t.inlineStylesheet,s=t.maskInputOptions,a=s===void 0?{}:s,l=t.maskInputFn,c=t.dataURLOptions,u=c===void 0?{}:c,d=t.inlineImages,f=t.recordCanvas,h=t.keepIframeSrcFn,p=t.newlyAddedElement,v=p===void 0?!1:p,I=t.rootId,g=Vs(e,n,i),m=Ds(e),y={},b=e.attributes.length,R=0;R<b;R++){var N=e.attributes[R];y[N.name]=wr(r,m,N.name,N.value)}if(m==="link"&&o){var _=Array.from(r.styleSheets).find(function(S){return S.href===e.href}),w=null;_&&(w=vr(_)),w&&(delete y.rel,delete y.href,y._cssText=Dt(w,_.href))}if(m==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var w=vr(e.sheet);w&&(y._cssText=Dt(w,br()))}if(m==="input"||m==="textarea"||m==="select"){var Y=e.value,H=e.checked;y.type!=="radio"&&y.type!=="checkbox"&&y.type!=="submit"&&y.type!=="button"&&Y?y.value=dt({type:y.type,tagName:m,value:Y,maskInputOptions:a,maskInputFn:l}):H&&(y.checked=H)}if(m==="option"&&(e.selected&&!a.select?y.selected=!0:delete y.selected),m==="canvas"&&f){if(e.__context==="2d")Rs(e)||(y.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var q=e.toDataURL(u.type,u.quality),U=document.createElement("canvas");U.width=e.width,U.height=e.height;var K=U.toDataURL(u.type,u.quality);q!==K&&(y.rr_dataURL=q)}}if(m==="img"&&d){rt||(rt=r.createElement("canvas"),Jn=rt.getContext("2d"));var L=e,z=L.crossOrigin;L.crossOrigin="anonymous";var F=function(){try{rt.width=L.naturalWidth,rt.height=L.naturalHeight,Jn.drawImage(L,0,0),y.rr_dataURL=rt.toDataURL(u.type,u.quality)}catch(S){console.warn("Cannot inline img src=".concat(L.currentSrc,"! Error: ").concat(S))}z?y.crossOrigin=z:L.removeAttribute("crossorigin")};L.complete&&L.naturalWidth!==0?F():L.onload=F}if((m==="audio"||m==="video")&&(y.rr_mediaState=e.paused?"paused":"played",y.rr_mediaCurrentTime=e.currentTime),v||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),g){var k=e.getBoundingClientRect(),X=k.width,C=k.height;y={class:y.class,rr_width:"".concat(X,"px"),rr_height:"".concat(C,"px")}}return m==="iframe"&&!h(y.src)&&(e.contentDocument||(y.rr_src=y.src),delete y.src),{type:B.Element,tagName:m,attributes:y,childNodes:[],isSVG:Gs(e)||void 0,needBlock:g,rootId:I}}function J(e){return e===void 0?"":e.toLowerCase()}function Xs(e,t){if(t.comment&&e.type===B.Comment)return!0;if(e.type===B.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(J(e.attributes.name).match(/^msapplication-tile(image|color)$/)||J(e.attributes.name)==="application-name"||J(e.attributes.rel)==="icon"||J(e.attributes.rel)==="apple-touch-icon"||J(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&J(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(J(e.attributes.property).match(/^(og|twitter|fb):/)||J(e.attributes.name).match(/^(og|twitter):/)||J(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(J(e.attributes.name)==="robots"||J(e.attributes.name)==="googlebot"||J(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(J(e.attributes.name)==="author"||J(e.attributes.name)==="generator"||J(e.attributes.name)==="framework"||J(e.attributes.name)==="publisher"||J(e.attributes.name)==="progid"||J(e.attributes.property).match(/^article:/)||J(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(J(e.attributes.name)==="google-site-verification"||J(e.attributes.name)==="yandex-verification"||J(e.attributes.name)==="csrf-token"||J(e.attributes.name)==="p:domain_verify"||J(e.attributes.name)==="verify-v1"||J(e.attributes.name)==="verification"||J(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Ve(e,t){var r=t.doc,n=t.mirror,i=t.blockClass,o=t.blockSelector,s=t.maskTextClass,a=t.maskTextSelector,l=t.skipChild,c=l===void 0?!1:l,u=t.inlineStylesheet,d=u===void 0?!0:u,f=t.maskInputOptions,h=f===void 0?{}:f,p=t.maskTextFn,v=t.maskInputFn,I=t.slimDOMOptions,g=t.dataURLOptions,m=g===void 0?{}:g,y=t.inlineImages,b=y===void 0?!1:y,R=t.recordCanvas,N=R===void 0?!1:R,_=t.onSerialize,w=t.onIframeLoad,Y=t.iframeLoadTimeout,H=Y===void 0?5e3:Y,q=t.onStylesheetLoad,U=t.stylesheetLoadTimeout,K=U===void 0?5e3:U,L=t.keepIframeSrcFn,z=L===void 0?function(){return!1}:L,F=t.newlyAddedElement,k=F===void 0?!1:F,X=t.preserveWhiteSpace,C=X===void 0?!0:X,S=Ks(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,inlineStylesheet:d,maskInputOptions:h,maskTextFn:p,maskInputFn:v,dataURLOptions:m,inlineImages:b,recordCanvas:N,keepIframeSrcFn:z,newlyAddedElement:k});if(!S)return console.warn(e,"not serialized"),null;var T;n.hasNode(e)?T=n.getId(e):Xs(S,I)||!C&&S.type===B.Text&&!S.isStyle&&!S.textContent.replace(/^\s+|\s+$/gm,"").length?T=ze:T=Cr();var M=Object.assign(S,{id:T});if(n.add(e,M),T===ze)return null;_&&_(e);var W=!c;if(M.type===B.Element){W=W&&!M.needBlock,delete M.needBlock;var j=e.shadowRoot;j&&He(j)&&(M.isShadowHost=!0)}if((M.type===B.Document||M.type===B.Element)&&W){I.headWhitespace&&M.type===B.Element&&M.tagName==="head"&&(C=!1);for(var $={doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:c,inlineStylesheet:d,maskInputOptions:h,maskTextFn:p,maskInputFn:v,slimDOMOptions:I,dataURLOptions:m,inlineImages:b,recordCanvas:N,preserveWhiteSpace:C,onSerialize:_,onIframeLoad:w,iframeLoadTimeout:H,onStylesheetLoad:q,stylesheetLoadTimeout:K,keepIframeSrcFn:z},O=0,re=Array.from(e.childNodes);O<re.length;O++){var ne=re[O],Q=Ve(ne,$);Q&&M.childNodes.push(Q)}if(ei(e)&&e.shadowRoot)for(var fe=0,V=Array.from(e.shadowRoot.childNodes);fe<V.length;fe++){var ne=V[fe],Q=Ve(ne,$);Q&&(He(e.shadowRoot)&&(Q.isShadow=!0),M.childNodes.push(Q))}}return e.parentNode&&Ke(e.parentNode)&&He(e.parentNode)&&(M.isShadow=!0),M.type===B.Element&&M.tagName==="iframe"&&Hs(e,function(){var ue=e.contentDocument;if(ue&&w){var lt=Ve(ue,{doc:ue,mirror:n,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:h,maskTextFn:p,maskInputFn:v,slimDOMOptions:I,dataURLOptions:m,inlineImages:b,recordCanvas:N,preserveWhiteSpace:C,onSerialize:_,onIframeLoad:w,iframeLoadTimeout:H,onStylesheetLoad:q,stylesheetLoadTimeout:K,keepIframeSrcFn:z});lt&&w(e,lt)}},H),M.type===B.Element&&M.tagName==="link"&&M.attributes.rel==="stylesheet"&&zs(e,function(){if(q){var ue=Ve(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:h,maskTextFn:p,maskInputFn:v,slimDOMOptions:I,dataURLOptions:m,inlineImages:b,recordCanvas:N,preserveWhiteSpace:C,onSerialize:_,onIframeLoad:w,iframeLoadTimeout:H,onStylesheetLoad:q,stylesheetLoadTimeout:K,keepIframeSrcFn:z});ue&&q(e,ue)}},K),M}function ti(e,t){var r=t||{},n=r.mirror,i=n===void 0?new Sr:n,o=r.blockClass,s=o===void 0?"rr-block":o,a=r.blockSelector,l=a===void 0?null:a,c=r.maskTextClass,u=c===void 0?"rr-mask":c,d=r.maskTextSelector,f=d===void 0?null:d,h=r.inlineStylesheet,p=h===void 0?!0:h,v=r.inlineImages,I=v===void 0?!1:v,g=r.recordCanvas,m=g===void 0?!1:g,y=r.maskAllInputs,b=y===void 0?!1:y,R=r.maskTextFn,N=r.maskInputFn,_=r.slimDOM,w=_===void 0?!1:_,Y=r.dataURLOptions,H=r.preserveWhiteSpace,q=r.onSerialize,U=r.onIframeLoad,K=r.iframeLoadTimeout,L=r.onStylesheetLoad,z=r.stylesheetLoadTimeout,F=r.keepIframeSrcFn,k=F===void 0?function(){return!1}:F,X=b===!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}:b===!1?{password:!0}:b,C=w===!0||w==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:w==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:w===!1?{}:w;return Ve(e,{doc:e,mirror:i,blockClass:s,blockSelector:l,maskTextClass:u,maskTextSelector:f,skipChild:!1,inlineStylesheet:p,maskInputOptions:X,maskTextFn:R,maskInputFn:N,slimDOMOptions:C,dataURLOptions:Y,inlineImages:I,recordCanvas:m,preserveWhiteSpace:H,onSerialize:q,onIframeLoad:U,iframeLoadTimeout:K,onStylesheetLoad:L,stylesheetLoadTimeout:z,keepIframeSrcFn:k,newlyAddedElement:!1})}function Js(e,t){t===void 0&&(t={});var r=1,n=1;function i(C){var S=C.match(/\n/g);S&&(r+=S.length);var T=C.lastIndexOf(`
3
- `);n=T===-1?n+C.length:C.length-T}function o(){var C={line:r,column:n};return function(S){return S.position=new s(C),p(),S}}var s=(function(){function C(S){this.start=S,this.end={line:r,column:n},this.source=t.source}return C})();s.prototype.content=e;var a=[];function l(C){var S=new Error("".concat(t.source||"",":").concat(r,":").concat(n,": ").concat(C));if(S.reason=C,S.filename=t.source,S.line=r,S.column=n,S.source=e,t.silent)a.push(S);else throw S}function c(){var C=f();return{type:"stylesheet",stylesheet:{source:t.source,rules:C,parsingErrors:a}}}function u(){return h(/^{\s*/)}function d(){return h(/^}/)}function f(){var C,S=[];for(p(),v(S);e.length&&e.charAt(0)!=="}"&&(C=k()||X());)C!==!1&&(S.push(C),v(S));return S}function h(C){var S=C.exec(e);if(S){var T=S[0];return i(T),e=e.slice(T.length),S}}function p(){h(/^\s*/)}function v(C){C===void 0&&(C=[]);for(var S;S=I();)S!==!1&&C.push(S),S=I();return C}function I(){var C=o();if(!(e.charAt(0)!=="/"||e.charAt(1)!=="*")){for(var S=2;e.charAt(S)!==""&&(e.charAt(S)!=="*"||e.charAt(S+1)!=="/");)++S;if(S+=2,e.charAt(S-1)==="")return l("End of comment missing");var T=e.slice(2,S-2);return n+=2,i(T),e=e.slice(S),n+=2,C({type:"comment",comment:T})}}function g(){var C=h(/^([^{]+)/);if(C)return Re(C[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(S){return S.replace(/,/g,"\u200C")}).split(/\s*(?![^(]*\)),\s*/).map(function(S){return S.replace(/\u200C/g,",")})}function m(){var C=o(),S=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(S){var T=Re(S[0]);if(!h(/^:\s*/))return l("property missing ':'");var M=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),W=C({type:"declaration",property:T.replace(Qn,""),value:M?Re(M[0]).replace(Qn,""):""});return h(/^[;\s]*/),W}}function y(){var C=[];if(!u())return l("missing '{'");v(C);for(var S;S=m();)S!==!1&&(C.push(S),v(C)),S=m();return d()?C:l("missing '}'")}function b(){for(var C,S=[],T=o();C=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)S.push(C[1]),h(/^,\s*/);if(S.length)return T({type:"keyframe",values:S,declarations:y()})}function R(){var C=o(),S=h(/^@([-\w]+)?keyframes\s*/);if(S){var T=S[1];if(S=h(/^([-\w]+)\s*/),!S)return l("@keyframes missing name");var M=S[1];if(!u())return l("@keyframes missing '{'");for(var W,j=v();W=b();)j.push(W),j=j.concat(v());return d()?C({type:"keyframes",name:M,vendor:T,keyframes:j}):l("@keyframes missing '}'")}}function N(){var C=o(),S=h(/^@supports *([^{]+)/);if(S){var T=Re(S[1]);if(!u())return l("@supports missing '{'");var M=v().concat(f());return d()?C({type:"supports",supports:T,rules:M}):l("@supports missing '}'")}}function _(){var C=o(),S=h(/^@host\s*/);if(S){if(!u())return l("@host missing '{'");var T=v().concat(f());return d()?C({type:"host",rules:T}):l("@host missing '}'")}}function w(){var C=o(),S=h(/^@media *([^{]+)/);if(S){var T=Re(S[1]);if(!u())return l("@media missing '{'");var M=v().concat(f());return d()?C({type:"media",media:T,rules:M}):l("@media missing '}'")}}function Y(){var C=o(),S=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(S)return C({type:"custom-media",name:Re(S[1]),media:Re(S[2])})}function H(){var C=o(),S=h(/^@page */);if(S){var T=g()||[];if(!u())return l("@page missing '{'");for(var M=v(),W;W=m();)M.push(W),M=M.concat(v());return d()?C({type:"page",selectors:T,declarations:M}):l("@page missing '}'")}}function q(){var C=o(),S=h(/^@([-\w]+)?document *([^{]+)/);if(S){var T=Re(S[1]),M=Re(S[2]);if(!u())return l("@document missing '{'");var W=v().concat(f());return d()?C({type:"document",document:M,vendor:T,rules:W}):l("@document missing '}'")}}function U(){var C=o(),S=h(/^@font-face\s*/);if(S){if(!u())return l("@font-face missing '{'");for(var T=v(),M;M=m();)T.push(M),T=T.concat(v());return d()?C({type:"font-face",declarations:T}):l("@font-face missing '}'")}}var K=F("import"),L=F("charset"),z=F("namespace");function F(C){var S=new RegExp("^@"+C+"\\s*([^;]+);");return function(){var T=o(),M=h(S);if(M){var W={type:C};return W[C]=M[1].trim(),T(W)}}}function k(){if(e[0]==="@")return R()||w()||Y()||N()||K()||L()||z()||q()||H()||_()||U()}function X(){var C=o(),S=g();return S?(v(),C({type:"rule",selectors:S,declarations:y()})):l("selector missing")}return yr(c())}function Re(e){return e?e.replace(/^\s+|\s+$/g,""):""}function yr(e,t){for(var r=e&&typeof e.type=="string",n=r?e:t,i=0,o=Object.keys(e);i<o.length;i++){var s=o[i],a=e[s];Array.isArray(a)?a.forEach(function(l){yr(l,n)}):a&&typeof a=="object"&&yr(a,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}function Qs(e){var t=qn[e.tagName]?qn[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function qs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function $n(e,t){var r=t?.stylesWithHoverClass.get(e);if(r)return r;var n=Js(e,{silent:!0});if(!n.stylesheet)return e;var i=[];if(n.stylesheet.rules.forEach(function(a){"selectors"in a&&(a.selectors||[]).forEach(function(l){ri.test(l)&&i.push(l)})}),i.length===0)return e;var o=new RegExp(i.filter(function(a,l){return i.indexOf(a)===l}).sort(function(a,l){return l.length-a.length}).map(function(a){return qs(a)}).join("|"),"g"),s=e.replace(o,function(a){var l=a.replace($s,"$1.\\:hover");return"".concat(a,", ").concat(l)});return t?.stylesWithHoverClass.set(e,s),s}function Ar(){var e=new Map;return{stylesWithHoverClass:e}}function ea(e,t){var r=t.doc,n=t.hackCss,i=t.cache;switch(e.type){case B.Document:return r.implementation.createDocument(null,"",null);case B.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case B.Element:{var o=Qs(e),s;e.isSVG?s=r.createElementNS("http://www.w3.org/2000/svg",o):s=r.createElement(o);var a={};for(var l in e.attributes)if(Object.prototype.hasOwnProperty.call(e.attributes,l)){var c=e.attributes[l];if(!(o==="option"&&l==="selected"&&c===!1)){if(c===!0&&(c=""),l.startsWith("rr_")){a[l]=c;continue}var u=o==="textarea"&&l==="value",d=o==="style"&&l==="_cssText";if(d&&n&&typeof c=="string"&&(c=$n(c,i)),(u||d)&&typeof c=="string"){for(var f=r.createTextNode(c),h=0,p=Array.from(s.childNodes);h<p.length;h++){var v=p[h];v.nodeType===s.TEXT_NODE&&s.removeChild(v)}s.appendChild(f);continue}try{if(e.isSVG&&l==="xlink:href")s.setAttributeNS("http://www.w3.org/1999/xlink",l,c.toString());else if(l==="onload"||l==="onclick"||l.substring(0,7)==="onmouse")s.setAttribute("_"+l,c.toString());else if(o==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&l==="content"){s.setAttribute("csp-content",c.toString());continue}else o==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||o==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")||(o==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?s.setAttribute("rrweb-original-srcset",e.attributes.srcset):s.setAttribute(l,c.toString()))}catch{}}}var I=function(m){var y=a[m];if(o==="canvas"&&m==="rr_dataURL"){var b=document.createElement("img");b.onload=function(){var N=s.getContext("2d");N&&N.drawImage(b,0,0,b.width,b.height)},b.src=y.toString(),s.RRNodeType&&(s.rr_dataURL=y.toString())}else if(o==="img"&&m==="rr_dataURL"){var R=s;R.currentSrc.startsWith("data:")||(R.setAttribute("rrweb-original-src",e.attributes.src),R.src=y.toString())}if(m==="rr_width")s.style.width=y.toString();else if(m==="rr_height")s.style.height=y.toString();else if(m==="rr_mediaCurrentTime"&&typeof y=="number")s.currentTime=y;else if(m==="rr_mediaState")switch(y){case"played":s.play().catch(function(N){return console.warn("media playback error",N)});break;case"paused":s.pause();break}};for(var g in a)I(g);if(e.isShadowHost)if(!s.shadowRoot)s.attachShadow({mode:"open"});else for(;s.shadowRoot.firstChild;)s.shadowRoot.removeChild(s.shadowRoot.firstChild);return s}case B.Text:return r.createTextNode(e.isStyle&&n?$n(e.textContent,i):e.textContent);case B.CDATA:return r.createCDATASection(e.textContent);case B.Comment:return r.createComment(e.textContent);default:return null}}function it(e,t){var r=t.doc,n=t.mirror,i=t.skipChild,o=i===void 0?!1:i,s=t.hackCss,a=s===void 0?!0:s,l=t.afterAppend,c=t.cache,u=ea(e,{doc:r,hackCss:a,cache:c});if(!u)return null;if(e.rootId&&n.getNode(e.rootId)!==r&&n.replace(e.rootId,r),e.type===B.Document&&(r.close(),r.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==B.DocumentType&&(e.childNodes[0].type===B.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),u=r),n.add(u,e),(e.type===B.Document||e.type===B.Element)&&!o)for(var d=0,f=e.childNodes;d<f.length;d++){var h=f[d],p=it(h,{doc:r,mirror:n,skipChild:!1,hackCss:a,afterAppend:l,cache:c});if(!p){console.warn("Failed to rebuild",h);continue}h.isShadow&&ei(u)&&u.shadowRoot?u.shadowRoot.appendChild(p):u.appendChild(p),l&&l(p,h.id)}return u}function ta(e,t){function r(s){t(s)}for(var n=0,i=e.getIds();n<i.length;n++){var o=i[n];e.has(o)&&r(e.getNode(o))}}function ra(e,t){var r=t.getMeta(e);if(r?.type===B.Element){var n=e;for(var i in r.attributes)if(Object.prototype.hasOwnProperty.call(r.attributes,i)&&i.startsWith("rr_")){var o=r.attributes[i];i==="rr_scrollLeft"&&(n.scrollLeft=o),i==="rr_scrollTop"&&(n.scrollTop=o)}}}function ni(e,t){var r=t.doc,n=t.onVisit,i=t.hackCss,o=i===void 0?!0:i,s=t.afterAppend,a=t.cache,l=t.mirror,c=l===void 0?new Sr:l,u=it(e,{doc:r,mirror:c,skipChild:!1,hackCss:o,afterAppend:s,cache:a});return ta(c,function(d){n&&n(d),ra(d,c)}),u}var B,Sr,Xn,xs,ks,ze,rt,Jn,Ls,Fs,Bs,Us,Ws,Qn,qn,ri,$s,xe=D(()=>{"use strict";(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(B||(B={}));Sr=(function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var r;if(!t)return-1;var n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var r=this,n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(function(i){return r.removeNodeFromMap(i)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){var n=this.getNode(t);if(n){var i=this.nodeMetaMap.get(n);i&&this.nodeMetaMap.set(r,i)}this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e})();Xn="__rrweb_original__";xs=1,ks=new RegExp("[^a-z0-9-_:]"),ze=-2;Ls=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Fs=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,Bs=/^(data:)([^,]*),(.*)/i;Us=/^[^ \t\n\r\u000c]+/,Ws=/^[, \t\n\r\u000c]+/;Qn=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;qn={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};ri=/([^\\]):hover/,$s=new RegExp(ri.source,"g")});var Rr={};et(Rr,{StyleSheetMirror:()=>Ze,_mirror:()=>ft,getBaseDimension:()=>Bt,getNestedRule:()=>Ye,getPositionsAndIndex:()=>Ut,getWindowHeight:()=>ht,getWindowWidth:()=>pt,hasShadowRoot:()=>Ae,hookSetter:()=>Fe,isAncestorRemoved:()=>_t,isBlocked:()=>ee,isIgnored:()=>mt,isSerialized:()=>Nr,isSerializedIframe:()=>ke,isSerializedStylesheet:()=>vt,isTouchEvent:()=>Lt,iterateResolveTree:()=>Ft,on:()=>ce,patch:()=>pe,polyfill:()=>gt,queueToResolveTrees:()=>Tr,throttle:()=>je,uniqueTextMutations:()=>Mr});function ce(e,t,r=document){let n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}function je(e,t,r={}){let n=null,i=0;return function(...o){let s=Date.now();!i&&r.leading===!1&&(i=s);let a=t-(s-i),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),i=s,e.apply(l,o)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{i=r.leading===!1?0:Date.now(),n=null,e.apply(l,o)},a))}}function Fe(e,t,r,n,i=window){let o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(s){setTimeout(()=>{r.set.call(this,s)},0),o&&o.set&&o.set.call(this,s)}}),()=>Fe(e,t,o||{},!0)}function pe(e,t,r){try{if(!(t in e))return()=>{};let n=e[t],i=r(n);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch{return()=>{}}}function ht(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function pt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ee(e,t,r,n){if(!e)return!1;let i=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!i)return!1;if(typeof t=="string"){if(i.classList.contains(t)||n&&i.closest("."+t)!==null)return!0}else if(ut(i,t,n))return!0;return!!(r&&(e.matches(r)||n&&i.closest(r)!==null))}function Nr(e,t){return t.getId(e)!==-1}function mt(e,t){return t.getId(e)===ze}function _t(e,t){if(Ke(e))return!1;let r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?_t(e.parentNode,t):!0:!0}function Lt(e){return!!e.changedTouches}function gt(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let r=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===r)return!0;while(r=r&&r.parentNode);return!1})}function Tr(e){let t={},r=(i,o)=>{let s={value:i,parent:o,children:[]};return t[i.node.id]=s,s},n=[];for(let i of e){let{nextId:o,parentId:s}=i;if(o&&o in t){let a=t[o];if(a.parent){let l=a.parent.children.indexOf(a);a.parent.children.splice(l,0,r(i,a.parent))}else{let l=n.indexOf(a);n.splice(l,0,r(i,null))}continue}if(s in t){let a=t[s];a.children.push(r(i,a));continue}n.push(r(i,null))}return n}function Ft(e,t){t(e.value);for(let r=e.children.length-1;r>=0;r--)Ft(e.children[r],t)}function ke(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function vt(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Bt(e,t){var r,n;let i=(n=(r=e.ownerDocument)===null||r===void 0?void 0:r.defaultView)===null||n===void 0?void 0:n.frameElement;if(!i||i===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};let o=i.getBoundingClientRect(),s=Bt(i,t),a=o.height/i.clientHeight;return{x:o.x*s.relativeScale+s.x,y:o.y*s.relativeScale+s.y,relativeScale:a,absoluteScale:s.absoluteScale*a}}function Ae(e){return!!e?.shadowRoot}function Ye(e,t){let r=e[t[0]];return t.length===1?r:Ye(r.cssRules[t[1]].cssRules,t.slice(2))}function Ut(e){let t=[...e],r=t.pop();return{positions:t,index:r}}function Mr(e){let t=new Set,r=[];for(let n=e.length;n--;){let i=e[n];t.has(i.id)||(r.push(i),t.add(i.id))}return r}var ot,ft,Ze,me=D(()=>{"use strict";xe();ot=`Please stop import mirror directly. Instead of that,\r
1
+ "use strict";var Segi=(()=>{var as=Object.create;var Tt=Object.defineProperty;var ls=Object.getOwnPropertyDescriptor;var cs=Object.getOwnPropertyNames;var us=Object.getPrototypeOf,ds=Object.prototype.hasOwnProperty;var Rt=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var D=(e,t)=>()=>(e&&(t=e(e=0)),t);var Mt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),et=(e,t)=>{for(var r in t)Tt(e,r,{get:t[r],enumerable:!0})},Nn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of cs(t))!ds.call(e,i)&&i!==r&&Tt(e,i,{get:()=>t[i],enumerable:!(n=ls(t,i))||n.enumerable});return e};var fs=(e,t,r)=>(r=e!=null?as(us(e)):{},Nn(t||!e||!e.__esModule?Tt(r,"default",{value:e,enumerable:!0}):r,e)),hs=e=>Nn(Tt({},"__esModule",{value:!0}),e);var Mn=Mt(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.SEGI_DEFAULT_ADMIN_URL=Se.SEGI_DEFAULT_CDN_URL=Se.SEGI_DEFAULT_PM2_ENDPOINT=Se.SEGI_DEFAULT_INGEST_ENDPOINT=Se.SEGI_DEFAULT_API_BASE=void 0;Se.SEGI_DEFAULT_API_BASE="https://segiapi.extn.ai";Se.SEGI_DEFAULT_INGEST_ENDPOINT="https://segiapi.extn.ai/api/ingest/events";Se.SEGI_DEFAULT_PM2_ENDPOINT="https://segiapi.extn.ai/api/ingest/pm2";Se.SEGI_DEFAULT_CDN_URL="https://cdn.extn.ai/segi/segi.min.js";Se.SEGI_DEFAULT_ADMIN_URL="https://segi.extn.ai"});var Dn=Mt(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.scrubHeaders=kn;ct.scrubObject=Ge;ct.scrubEvent=vs;var ps=new Set(["authorization","cookie","set-cookie","x-api-key","proxy-authorization"]),ms=[/^password$/i,/^passwd$/i,/token/i,/secret/i,/api[-_]?key/i,/^authorization$/i,/card[-_]?number/i,/^rrn$/i,/^residentnumber$/i],xn="[Filtered]";function kn(e){if(!e)return e;let t={};for(let[r,n]of Object.entries(e))ps.has(r.toLowerCase())?t[r]=xn:t[r]=n;return t}function gs(e){return ms.some(t=>t.test(e))}function Ge(e,t=0){if(t>8||e==null)return e;if(Array.isArray(e))return e.map(r=>Ge(r,t+1));if(typeof e=="object"){let r={};for(let[n,i]of Object.entries(e))gs(n)?r[n]=xn:r[n]=Ge(i,t+1);return r}return e}function vs(e){let t=JSON.parse(JSON.stringify(e));return t.request&&(t.request.headers=kn(t.request.headers),t.request.body=Ge(t.request.body),t.request.query=Ge(t.request.query)),t.extra&&(t.extra=Ge(t.extra)),t.tags&&(t.tags=Ge(t.tags)),t}});var On=Mt(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.generateFingerprint=Ss;var ys=Rt("crypto");function ur(e){return e?e.replace(/0x[0-9a-fA-F]+/g,"0xX").replace(/\b\d{4,}\b/g,"N").replace(/[\r\n]+/g," ").trim().slice(0,500):""}function Is(e){if(!e)return"";let t=e.split(`
2
+ `).map(n=>n.trim()).filter(Boolean),r=t.find(n=>n.startsWith("at "))??t[1]??"";return ur(r)}function Ss(e){let t=[String(e.projectId),ur(e.errorName??""),ur(e.message??""),Is(e.stack??"")];return(0,ys.createHash)("sha256").update(t.join("|")).digest("hex")}});var _n=Mt(Te=>{"use strict";var Cs=Te&&Te.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),fr=Te&&Te.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Cs(t,e,r)};Object.defineProperty(Te,"__esModule",{value:!0});fr(Mn(),Te);fr(Dn(),Te);fr(On(),Te)});function Bn(e){return e<640?"mobile":e<1024?"tablet":"desktop"}function ws(e,t){let r=e;for(;r;){if(r.classList?.contains(t))return!0;r=r.parentElement}return!1}function Es(e){try{if(e.id)return`#${e.id}`;let t=e.tagName?.toLowerCase();if(!t)return;let r=(e.className&&typeof e.className=="string"?e.className.split(/\s+/).filter(Boolean).slice(0,2):[]).map(n=>`.${n}`);return`${t}${r.join("")}`.slice(0,512)}catch{return}}function Un(e){let t=e.options.mask?.class??"segi-mask",r=!1,n=[],i=-1,o=0,s=(d={})=>{if(n.length===0)return;let f=n.splice(0,n.length);e.sendClicks(f,!!d.useBeacon)},a=setInterval(()=>{r||s()},5e3),l=d=>{if(!r)try{let f=d.target;if(!f||ws(f,t))return;let h=Math.max(document.documentElement.scrollWidth,document.body?.scrollWidth??0,1),p=Math.max(document.documentElement.scrollHeight,document.body?.scrollHeight??0,1),v=d.pageX,I=d.pageY,m=window.innerWidth,g={sessionUid:e.sessionUid,ts:new Date().toISOString(),urlPath:location.pathname.slice(0,255),device:Bn(m),viewportW:m,viewportH:window.innerHeight,x:Math.round(d.clientX),y:Math.round(d.clientY),pageX:Math.round(v),pageY:Math.round(I),relX:Math.max(0,Math.min(1,v/h)),relY:Math.max(0,Math.min(1,I/p)),selector:Es(f),tag:f.tagName?.toLowerCase().slice(0,32),text:(f.textContent??void 0)?.trim().slice(0,128)||void 0};n.push(g),n.length>=50&&s()}catch{}},c=()=>{if(r)return;let d=Date.now();if(!(d-o<1e3))try{let f=Math.max(document.documentElement.scrollHeight,document.body?.scrollHeight??0,1),h=window.innerHeight,p=Math.round(window.scrollY+h),v=Math.max(0,Math.min(100,Math.round(p/f*100)));if(v<=i)return;i=v,o=d;let I=window.innerWidth;e.sendScroll({sessionUid:e.sessionUid,urlPath:location.pathname.slice(0,255),device:Bn(I),viewportH:h,docH:f,maxScrollY:p,maxScrollPct:v},!1)}catch{}},u=()=>{s({useBeacon:!0})};return window.addEventListener("click",l,!0),window.addEventListener("scroll",c,{capture:!0,passive:!0}),window.addEventListener("pagehide",u),{pause(){r=!0},resume(){r=!1},stop(){clearInterval(a),window.removeEventListener("click",l,!0),window.removeEventListener("scroll",c,!0),window.removeEventListener("pagehide",u),s({useBeacon:!0})},flushClicks:s}}var Wn=D(()=>{"use strict"});function xt(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function Hn(){try{if(typeof sessionStorage>"u")return null;let e=sessionStorage.getItem(Gn),t=Number(sessionStorage.getItem(Vn)??"0");return!e||!t?null:{uid:e,at:t}}catch{return null}}function mr(e,t){try{if(typeof sessionStorage>"u")return;sessionStorage.setItem(Gn,e),sessionStorage.setItem(Vn,String(t))}catch{}}function zn(){let e=Date.now(),t=Hn();if(t&&e-t.at<18e5)return mr(t.uid,e),t.uid;let r=xt();return mr(r,e),As=r,r}function Kn(){let e=Hn();e&&mr(e.uid,Date.now())}function gr(){try{if(typeof localStorage>"u")return tt||(tt=xt()),tt;let e=localStorage.getItem(Pn);if(e)return e;let t=xt();return localStorage.setItem(Pn,t),t}catch{return tt||(tt=xt()),tt}}var Gn,Vn,Pn,As,tt,Zn=D(()=>{"use strict";Gn="_bd_session_uid",Vn="_bd_session_at",Pn="_bd_anon",As=null,tt=null});function jn(e){return(e&&e.trim()||Ns).replace(/\/+$/,"").replace(/\/api\/ingest\/events$/,"").replace(/\/api\/ingest$/,"").replace(/\/api$/,"")}async function Re(e,t,r){let n=`${jn(e.endpoint)}/api/trace${t}`;try{return await fetch(n,{method:"POST",headers:{"Content-Type":"application/json","X-Segi-Project-Key":e.projectKey},body:JSON.stringify(r),keepalive:!0})}catch{return null}}function kt(e,t,r){try{if(typeof navigator>"u"||!navigator.sendBeacon)return!1;let n=`${jn(e.endpoint)}/api/trace${t}?pk=${encodeURIComponent(e.projectKey)}`,i=new Blob([JSON.stringify(r)],{type:"application/json"});return navigator.sendBeacon(n,i)}catch{return!1}}var Ns,Yn=D(()=>{"use strict";Ns="https://segiapi.extn.ai"});function ei(e){return e.nodeType===e.ELEMENT_NODE}function Ke(e){var t=e?.host;return t?.shadowRoot===e}function He(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Ts(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),e}function vr(e){try{var t=e.rules||e.cssRules;return t?Ts(Array.from(t).map(Ir).join("")):null}catch{return null}}function Ir(e){var t=e.cssText;if(Rs(e))try{t=vr(e.styleSheet)||t}catch{}return t}function Rs(e){return"styleSheet"in e}function Ot(){return new Sr}function dt(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,i=e.value,o=e.maskInputFn,s=i||"";return(t[r.toLowerCase()]||t[n])&&(o?s=o(s):s="*".repeat(s.length)),s}function Ms(e){var t=e.getContext("2d");if(!t)return!0;for(var r=50,n=0;n<e.width;n+=r)for(var i=0;i<e.height;i+=r){var o=t.getImageData,s=Xn in o?o[Xn]:o,a=new Uint32Array(s.call(t,n,i,Math.min(r,e.width-n),Math.min(r,e.height-i)).data.buffer);if(a.some(function(l){return l!==0}))return!1}return!0}function Cr(){return xs++}function Ds(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return ks.test(t)?"div":t}function Os(e){return e.cssRules?Array.from(e.cssRules).map(function(t){return t.cssText||""}).join(""):""}function _s(e){var t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}function Dt(e,t){return(e||"").replace(Ls,function(r,n,i,o,s,a){var l=i||s||a,c=n||o||"";if(!l)return r;if(!Fs.test(l)||Bs.test(l))return"url(".concat(c).concat(l).concat(c,")");if(l[0]==="/")return"url(".concat(c).concat(_s(t)+l).concat(c,")");var u=t.split("/"),d=l.split("/");u.pop();for(var f=0,h=d;f<h.length;f++){var p=h[f];p!=="."&&(p===".."?u.pop():u.push(p))}return"url(".concat(c).concat(u.join("/")).concat(c,")")})}function Ps(e,t){if(t.trim()==="")return t;var r=0;function n(c){var u,d=c.exec(t.substring(r));return d?(u=d[0],r+=u.length,u):""}for(var i=[];n(Ws),!(r>=t.length);){var o=n(Us);if(o.slice(-1)===",")o=nt(e,o.substring(0,o.length-1)),i.push(o);else{var s="";o=nt(e,o);for(var a=!1;;){var l=t.charAt(r);if(l===""){i.push((o+s).trim());break}else if(a)l===")"&&(a=!1);else if(l===","){r+=1,i.push((o+s).trim());break}else l==="("&&(a=!0);s+=l,r+=1}}}return i.join(", ")}function nt(e,t){if(!t||t.trim()==="")return t;var r=e.createElement("a");return r.href=t,r.href}function Gs(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function br(){var e=document.createElement("a");return e.href="",e.href}function wr(e,t,r,n){return r==="src"||r==="href"&&n&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n&&n[0]!=="#"||r==="background"&&n&&(t==="table"||t==="td"||t==="th")?nt(e,n):r==="srcset"&&n?Ps(e,n):r==="style"&&n?Dt(n,br()):t==="object"&&r==="data"&&n?nt(e,n):n}function Vs(e,t,r){if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var i=e.classList[n];if(t.test(i))return!0}return r?e.matches(r):!1}function ut(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?ut(e.parentNode,t,r):!1;for(var n=e.classList.length;n--;){var i=e.classList[n];if(t.test(i))return!0}return r?ut(e.parentNode,t,r):!1}function Er(e,t,r){var n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(n===null)return!1;if(typeof t=="string"){if(n.classList.contains(t)||n.closest(".".concat(t)))return!0}else if(ut(n,t,!0))return!0;return!!(r&&(n.matches(r)||n.closest(r)))}function Hs(e,t,r){var n=e.contentWindow;if(n){var i=!1,o;try{o=n.document.readyState}catch{return}if(o!=="complete"){var s=setTimeout(function(){i||(t(),i=!0)},r);e.addEventListener("load",function(){clearTimeout(s),i=!0,t()});return}var a="about:blank";if(n.location.href!==a||e.src===a||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}}function zs(e,t,r){var n=!1,i;try{i=e.sheet}catch{return}if(!i){var o=setTimeout(function(){n||(t(),n=!0)},r);e.addEventListener("load",function(){clearTimeout(o),n=!0,t()})}}function Ks(e,t){var r=t.doc,n=t.mirror,i=t.blockClass,o=t.blockSelector,s=t.maskTextClass,a=t.maskTextSelector,l=t.inlineStylesheet,c=t.maskInputOptions,u=c===void 0?{}:c,d=t.maskTextFn,f=t.maskInputFn,h=t.dataURLOptions,p=h===void 0?{}:h,v=t.inlineImages,I=t.recordCanvas,m=t.keepIframeSrcFn,g=t.newlyAddedElement,y=g===void 0?!1:g,b=Zs(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:B.Document,childNodes:[],compatMode:e.compatMode}:{type:B.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:B.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:b};case e.ELEMENT_NODE:return Ys(e,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:l,maskInputOptions:u,maskInputFn:f,dataURLOptions:p,inlineImages:v,recordCanvas:I,keepIframeSrcFn:m,newlyAddedElement:y,rootId:b});case e.TEXT_NODE:return js(e,{maskTextClass:s,maskTextSelector:a,maskTextFn:d,rootId:b});case e.CDATA_SECTION_NODE:return{type:B.CDATA,textContent:"",rootId:b};case e.COMMENT_NODE:return{type:B.Comment,textContent:e.textContent||"",rootId:b};default:return!1}}function Zs(e,t){if(t.hasNode(e)){var r=t.getId(e);return r===1?void 0:r}}function js(e,t){var r,n=t.maskTextClass,i=t.maskTextSelector,o=t.maskTextFn,s=t.rootId,a=e.parentNode&&e.parentNode.tagName,l=e.textContent,c=a==="STYLE"?!0:void 0,u=a==="SCRIPT"?!0:void 0;if(c&&l){try{e.nextSibling||e.previousSibling||!((r=e.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(l=Os(e.parentNode.sheet))}catch(d){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(d),e)}l=Dt(l,br())}return u&&(l="SCRIPT_PLACEHOLDER"),!c&&!u&&l&&Er(e,n,i)&&(l=o?o(l):l.replace(/[\S]/g,"*")),{type:B.Text,textContent:l||"",isStyle:c,rootId:s}}function Ys(e,t){for(var r=t.doc,n=t.blockClass,i=t.blockSelector,o=t.inlineStylesheet,s=t.maskInputOptions,a=s===void 0?{}:s,l=t.maskInputFn,c=t.dataURLOptions,u=c===void 0?{}:c,d=t.inlineImages,f=t.recordCanvas,h=t.keepIframeSrcFn,p=t.newlyAddedElement,v=p===void 0?!1:p,I=t.rootId,m=Vs(e,n,i),g=Ds(e),y={},b=e.attributes.length,M=0;M<b;M++){var N=e.attributes[M];y[N.name]=wr(r,g,N.name,N.value)}if(g==="link"&&o){var _=Array.from(r.styleSheets).find(function(S){return S.href===e.href}),w=null;_&&(w=vr(_)),w&&(delete y.rel,delete y.href,y._cssText=Dt(w,_.href))}if(g==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var w=vr(e.sheet);w&&(y._cssText=Dt(w,br()))}if(g==="input"||g==="textarea"||g==="select"){var Y=e.value,H=e.checked;y.type!=="radio"&&y.type!=="checkbox"&&y.type!=="submit"&&y.type!=="button"&&Y?y.value=dt({type:y.type,tagName:g,value:Y,maskInputOptions:a,maskInputFn:l}):H&&(y.checked=H)}if(g==="option"&&(e.selected&&!a.select?y.selected=!0:delete y.selected),g==="canvas"&&f){if(e.__context==="2d")Ms(e)||(y.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var q=e.toDataURL(u.type,u.quality),U=document.createElement("canvas");U.width=e.width,U.height=e.height;var K=U.toDataURL(u.type,u.quality);q!==K&&(y.rr_dataURL=q)}}if(g==="img"&&d){rt||(rt=r.createElement("canvas"),Jn=rt.getContext("2d"));var L=e,z=L.crossOrigin;L.crossOrigin="anonymous";var F=function(){try{rt.width=L.naturalWidth,rt.height=L.naturalHeight,Jn.drawImage(L,0,0),y.rr_dataURL=rt.toDataURL(u.type,u.quality)}catch(S){console.warn("Cannot inline img src=".concat(L.currentSrc,"! Error: ").concat(S))}z?y.crossOrigin=z:L.removeAttribute("crossorigin")};L.complete&&L.naturalWidth!==0?F():L.onload=F}if((g==="audio"||g==="video")&&(y.rr_mediaState=e.paused?"paused":"played",y.rr_mediaCurrentTime=e.currentTime),v||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),m){var k=e.getBoundingClientRect(),X=k.width,C=k.height;y={class:y.class,rr_width:"".concat(X,"px"),rr_height:"".concat(C,"px")}}return g==="iframe"&&!h(y.src)&&(e.contentDocument||(y.rr_src=y.src),delete y.src),{type:B.Element,tagName:g,attributes:y,childNodes:[],isSVG:Gs(e)||void 0,needBlock:m,rootId:I}}function J(e){return e===void 0?"":e.toLowerCase()}function Xs(e,t){if(t.comment&&e.type===B.Comment)return!0;if(e.type===B.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(J(e.attributes.name).match(/^msapplication-tile(image|color)$/)||J(e.attributes.name)==="application-name"||J(e.attributes.rel)==="icon"||J(e.attributes.rel)==="apple-touch-icon"||J(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&J(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(J(e.attributes.property).match(/^(og|twitter|fb):/)||J(e.attributes.name).match(/^(og|twitter):/)||J(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(J(e.attributes.name)==="robots"||J(e.attributes.name)==="googlebot"||J(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(J(e.attributes.name)==="author"||J(e.attributes.name)==="generator"||J(e.attributes.name)==="framework"||J(e.attributes.name)==="publisher"||J(e.attributes.name)==="progid"||J(e.attributes.property).match(/^article:/)||J(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(J(e.attributes.name)==="google-site-verification"||J(e.attributes.name)==="yandex-verification"||J(e.attributes.name)==="csrf-token"||J(e.attributes.name)==="p:domain_verify"||J(e.attributes.name)==="verify-v1"||J(e.attributes.name)==="verification"||J(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Ve(e,t){var r=t.doc,n=t.mirror,i=t.blockClass,o=t.blockSelector,s=t.maskTextClass,a=t.maskTextSelector,l=t.skipChild,c=l===void 0?!1:l,u=t.inlineStylesheet,d=u===void 0?!0:u,f=t.maskInputOptions,h=f===void 0?{}:f,p=t.maskTextFn,v=t.maskInputFn,I=t.slimDOMOptions,m=t.dataURLOptions,g=m===void 0?{}:m,y=t.inlineImages,b=y===void 0?!1:y,M=t.recordCanvas,N=M===void 0?!1:M,_=t.onSerialize,w=t.onIframeLoad,Y=t.iframeLoadTimeout,H=Y===void 0?5e3:Y,q=t.onStylesheetLoad,U=t.stylesheetLoadTimeout,K=U===void 0?5e3:U,L=t.keepIframeSrcFn,z=L===void 0?function(){return!1}:L,F=t.newlyAddedElement,k=F===void 0?!1:F,X=t.preserveWhiteSpace,C=X===void 0?!0:X,S=Ks(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,inlineStylesheet:d,maskInputOptions:h,maskTextFn:p,maskInputFn:v,dataURLOptions:g,inlineImages:b,recordCanvas:N,keepIframeSrcFn:z,newlyAddedElement:k});if(!S)return console.warn(e,"not serialized"),null;var T;n.hasNode(e)?T=n.getId(e):Xs(S,I)||!C&&S.type===B.Text&&!S.isStyle&&!S.textContent.replace(/^\s+|\s+$/gm,"").length?T=ze:T=Cr();var R=Object.assign(S,{id:T});if(n.add(e,R),T===ze)return null;_&&_(e);var W=!c;if(R.type===B.Element){W=W&&!R.needBlock,delete R.needBlock;var j=e.shadowRoot;j&&He(j)&&(R.isShadowHost=!0)}if((R.type===B.Document||R.type===B.Element)&&W){I.headWhitespace&&R.type===B.Element&&R.tagName==="head"&&(C=!1);for(var $={doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:c,inlineStylesheet:d,maskInputOptions:h,maskTextFn:p,maskInputFn:v,slimDOMOptions:I,dataURLOptions:g,inlineImages:b,recordCanvas:N,preserveWhiteSpace:C,onSerialize:_,onIframeLoad:w,iframeLoadTimeout:H,onStylesheetLoad:q,stylesheetLoadTimeout:K,keepIframeSrcFn:z},O=0,re=Array.from(e.childNodes);O<re.length;O++){var ne=re[O],Q=Ve(ne,$);Q&&R.childNodes.push(Q)}if(ei(e)&&e.shadowRoot)for(var fe=0,V=Array.from(e.shadowRoot.childNodes);fe<V.length;fe++){var ne=V[fe],Q=Ve(ne,$);Q&&(He(e.shadowRoot)&&(Q.isShadow=!0),R.childNodes.push(Q))}}return e.parentNode&&Ke(e.parentNode)&&He(e.parentNode)&&(R.isShadow=!0),R.type===B.Element&&R.tagName==="iframe"&&Hs(e,function(){var ue=e.contentDocument;if(ue&&w){var lt=Ve(ue,{doc:ue,mirror:n,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:h,maskTextFn:p,maskInputFn:v,slimDOMOptions:I,dataURLOptions:g,inlineImages:b,recordCanvas:N,preserveWhiteSpace:C,onSerialize:_,onIframeLoad:w,iframeLoadTimeout:H,onStylesheetLoad:q,stylesheetLoadTimeout:K,keepIframeSrcFn:z});lt&&w(e,lt)}},H),R.type===B.Element&&R.tagName==="link"&&R.attributes.rel==="stylesheet"&&zs(e,function(){if(q){var ue=Ve(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:h,maskTextFn:p,maskInputFn:v,slimDOMOptions:I,dataURLOptions:g,inlineImages:b,recordCanvas:N,preserveWhiteSpace:C,onSerialize:_,onIframeLoad:w,iframeLoadTimeout:H,onStylesheetLoad:q,stylesheetLoadTimeout:K,keepIframeSrcFn:z});ue&&q(e,ue)}},K),R}function ti(e,t){var r=t||{},n=r.mirror,i=n===void 0?new Sr:n,o=r.blockClass,s=o===void 0?"rr-block":o,a=r.blockSelector,l=a===void 0?null:a,c=r.maskTextClass,u=c===void 0?"rr-mask":c,d=r.maskTextSelector,f=d===void 0?null:d,h=r.inlineStylesheet,p=h===void 0?!0:h,v=r.inlineImages,I=v===void 0?!1:v,m=r.recordCanvas,g=m===void 0?!1:m,y=r.maskAllInputs,b=y===void 0?!1:y,M=r.maskTextFn,N=r.maskInputFn,_=r.slimDOM,w=_===void 0?!1:_,Y=r.dataURLOptions,H=r.preserveWhiteSpace,q=r.onSerialize,U=r.onIframeLoad,K=r.iframeLoadTimeout,L=r.onStylesheetLoad,z=r.stylesheetLoadTimeout,F=r.keepIframeSrcFn,k=F===void 0?function(){return!1}:F,X=b===!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}:b===!1?{password:!0}:b,C=w===!0||w==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:w==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:w===!1?{}:w;return Ve(e,{doc:e,mirror:i,blockClass:s,blockSelector:l,maskTextClass:u,maskTextSelector:f,skipChild:!1,inlineStylesheet:p,maskInputOptions:X,maskTextFn:M,maskInputFn:N,slimDOMOptions:C,dataURLOptions:Y,inlineImages:I,recordCanvas:g,preserveWhiteSpace:H,onSerialize:q,onIframeLoad:U,iframeLoadTimeout:K,onStylesheetLoad:L,stylesheetLoadTimeout:z,keepIframeSrcFn:k,newlyAddedElement:!1})}function Js(e,t){t===void 0&&(t={});var r=1,n=1;function i(C){var S=C.match(/\n/g);S&&(r+=S.length);var T=C.lastIndexOf(`
3
+ `);n=T===-1?n+C.length:C.length-T}function o(){var C={line:r,column:n};return function(S){return S.position=new s(C),p(),S}}var s=(function(){function C(S){this.start=S,this.end={line:r,column:n},this.source=t.source}return C})();s.prototype.content=e;var a=[];function l(C){var S=new Error("".concat(t.source||"",":").concat(r,":").concat(n,": ").concat(C));if(S.reason=C,S.filename=t.source,S.line=r,S.column=n,S.source=e,t.silent)a.push(S);else throw S}function c(){var C=f();return{type:"stylesheet",stylesheet:{source:t.source,rules:C,parsingErrors:a}}}function u(){return h(/^{\s*/)}function d(){return h(/^}/)}function f(){var C,S=[];for(p(),v(S);e.length&&e.charAt(0)!=="}"&&(C=k()||X());)C!==!1&&(S.push(C),v(S));return S}function h(C){var S=C.exec(e);if(S){var T=S[0];return i(T),e=e.slice(T.length),S}}function p(){h(/^\s*/)}function v(C){C===void 0&&(C=[]);for(var S;S=I();)S!==!1&&C.push(S),S=I();return C}function I(){var C=o();if(!(e.charAt(0)!=="/"||e.charAt(1)!=="*")){for(var S=2;e.charAt(S)!==""&&(e.charAt(S)!=="*"||e.charAt(S+1)!=="/");)++S;if(S+=2,e.charAt(S-1)==="")return l("End of comment missing");var T=e.slice(2,S-2);return n+=2,i(T),e=e.slice(S),n+=2,C({type:"comment",comment:T})}}function m(){var C=h(/^([^{]+)/);if(C)return Me(C[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(S){return S.replace(/,/g,"\u200C")}).split(/\s*(?![^(]*\)),\s*/).map(function(S){return S.replace(/\u200C/g,",")})}function g(){var C=o(),S=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(S){var T=Me(S[0]);if(!h(/^:\s*/))return l("property missing ':'");var R=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),W=C({type:"declaration",property:T.replace(Qn,""),value:R?Me(R[0]).replace(Qn,""):""});return h(/^[;\s]*/),W}}function y(){var C=[];if(!u())return l("missing '{'");v(C);for(var S;S=g();)S!==!1&&(C.push(S),v(C)),S=g();return d()?C:l("missing '}'")}function b(){for(var C,S=[],T=o();C=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)S.push(C[1]),h(/^,\s*/);if(S.length)return T({type:"keyframe",values:S,declarations:y()})}function M(){var C=o(),S=h(/^@([-\w]+)?keyframes\s*/);if(S){var T=S[1];if(S=h(/^([-\w]+)\s*/),!S)return l("@keyframes missing name");var R=S[1];if(!u())return l("@keyframes missing '{'");for(var W,j=v();W=b();)j.push(W),j=j.concat(v());return d()?C({type:"keyframes",name:R,vendor:T,keyframes:j}):l("@keyframes missing '}'")}}function N(){var C=o(),S=h(/^@supports *([^{]+)/);if(S){var T=Me(S[1]);if(!u())return l("@supports missing '{'");var R=v().concat(f());return d()?C({type:"supports",supports:T,rules:R}):l("@supports missing '}'")}}function _(){var C=o(),S=h(/^@host\s*/);if(S){if(!u())return l("@host missing '{'");var T=v().concat(f());return d()?C({type:"host",rules:T}):l("@host missing '}'")}}function w(){var C=o(),S=h(/^@media *([^{]+)/);if(S){var T=Me(S[1]);if(!u())return l("@media missing '{'");var R=v().concat(f());return d()?C({type:"media",media:T,rules:R}):l("@media missing '}'")}}function Y(){var C=o(),S=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(S)return C({type:"custom-media",name:Me(S[1]),media:Me(S[2])})}function H(){var C=o(),S=h(/^@page */);if(S){var T=m()||[];if(!u())return l("@page missing '{'");for(var R=v(),W;W=g();)R.push(W),R=R.concat(v());return d()?C({type:"page",selectors:T,declarations:R}):l("@page missing '}'")}}function q(){var C=o(),S=h(/^@([-\w]+)?document *([^{]+)/);if(S){var T=Me(S[1]),R=Me(S[2]);if(!u())return l("@document missing '{'");var W=v().concat(f());return d()?C({type:"document",document:R,vendor:T,rules:W}):l("@document missing '}'")}}function U(){var C=o(),S=h(/^@font-face\s*/);if(S){if(!u())return l("@font-face missing '{'");for(var T=v(),R;R=g();)T.push(R),T=T.concat(v());return d()?C({type:"font-face",declarations:T}):l("@font-face missing '}'")}}var K=F("import"),L=F("charset"),z=F("namespace");function F(C){var S=new RegExp("^@"+C+"\\s*([^;]+);");return function(){var T=o(),R=h(S);if(R){var W={type:C};return W[C]=R[1].trim(),T(W)}}}function k(){if(e[0]==="@")return M()||w()||Y()||N()||K()||L()||z()||q()||H()||_()||U()}function X(){var C=o(),S=m();return S?(v(),C({type:"rule",selectors:S,declarations:y()})):l("selector missing")}return yr(c())}function Me(e){return e?e.replace(/^\s+|\s+$/g,""):""}function yr(e,t){for(var r=e&&typeof e.type=="string",n=r?e:t,i=0,o=Object.keys(e);i<o.length;i++){var s=o[i],a=e[s];Array.isArray(a)?a.forEach(function(l){yr(l,n)}):a&&typeof a=="object"&&yr(a,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}function Qs(e){var t=qn[e.tagName]?qn[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function qs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function $n(e,t){var r=t?.stylesWithHoverClass.get(e);if(r)return r;var n=Js(e,{silent:!0});if(!n.stylesheet)return e;var i=[];if(n.stylesheet.rules.forEach(function(a){"selectors"in a&&(a.selectors||[]).forEach(function(l){ri.test(l)&&i.push(l)})}),i.length===0)return e;var o=new RegExp(i.filter(function(a,l){return i.indexOf(a)===l}).sort(function(a,l){return l.length-a.length}).map(function(a){return qs(a)}).join("|"),"g"),s=e.replace(o,function(a){var l=a.replace($s,"$1.\\:hover");return"".concat(a,", ").concat(l)});return t?.stylesWithHoverClass.set(e,s),s}function Ar(){var e=new Map;return{stylesWithHoverClass:e}}function ea(e,t){var r=t.doc,n=t.hackCss,i=t.cache;switch(e.type){case B.Document:return r.implementation.createDocument(null,"",null);case B.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case B.Element:{var o=Qs(e),s;e.isSVG?s=r.createElementNS("http://www.w3.org/2000/svg",o):s=r.createElement(o);var a={};for(var l in e.attributes)if(Object.prototype.hasOwnProperty.call(e.attributes,l)){var c=e.attributes[l];if(!(o==="option"&&l==="selected"&&c===!1)){if(c===!0&&(c=""),l.startsWith("rr_")){a[l]=c;continue}var u=o==="textarea"&&l==="value",d=o==="style"&&l==="_cssText";if(d&&n&&typeof c=="string"&&(c=$n(c,i)),(u||d)&&typeof c=="string"){for(var f=r.createTextNode(c),h=0,p=Array.from(s.childNodes);h<p.length;h++){var v=p[h];v.nodeType===s.TEXT_NODE&&s.removeChild(v)}s.appendChild(f);continue}try{if(e.isSVG&&l==="xlink:href")s.setAttributeNS("http://www.w3.org/1999/xlink",l,c.toString());else if(l==="onload"||l==="onclick"||l.substring(0,7)==="onmouse")s.setAttribute("_"+l,c.toString());else if(o==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&l==="content"){s.setAttribute("csp-content",c.toString());continue}else o==="link"&&e.attributes.rel==="preload"&&e.attributes.as==="script"||o==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&e.attributes.href.endsWith(".js")||(o==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?s.setAttribute("rrweb-original-srcset",e.attributes.srcset):s.setAttribute(l,c.toString()))}catch{}}}var I=function(g){var y=a[g];if(o==="canvas"&&g==="rr_dataURL"){var b=document.createElement("img");b.onload=function(){var N=s.getContext("2d");N&&N.drawImage(b,0,0,b.width,b.height)},b.src=y.toString(),s.RRNodeType&&(s.rr_dataURL=y.toString())}else if(o==="img"&&g==="rr_dataURL"){var M=s;M.currentSrc.startsWith("data:")||(M.setAttribute("rrweb-original-src",e.attributes.src),M.src=y.toString())}if(g==="rr_width")s.style.width=y.toString();else if(g==="rr_height")s.style.height=y.toString();else if(g==="rr_mediaCurrentTime"&&typeof y=="number")s.currentTime=y;else if(g==="rr_mediaState")switch(y){case"played":s.play().catch(function(N){return console.warn("media playback error",N)});break;case"paused":s.pause();break}};for(var m in a)I(m);if(e.isShadowHost)if(!s.shadowRoot)s.attachShadow({mode:"open"});else for(;s.shadowRoot.firstChild;)s.shadowRoot.removeChild(s.shadowRoot.firstChild);return s}case B.Text:return r.createTextNode(e.isStyle&&n?$n(e.textContent,i):e.textContent);case B.CDATA:return r.createCDATASection(e.textContent);case B.Comment:return r.createComment(e.textContent);default:return null}}function it(e,t){var r=t.doc,n=t.mirror,i=t.skipChild,o=i===void 0?!1:i,s=t.hackCss,a=s===void 0?!0:s,l=t.afterAppend,c=t.cache,u=ea(e,{doc:r,hackCss:a,cache:c});if(!u)return null;if(e.rootId&&n.getNode(e.rootId)!==r&&n.replace(e.rootId,r),e.type===B.Document&&(r.close(),r.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==B.DocumentType&&(e.childNodes[0].type===B.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),u=r),n.add(u,e),(e.type===B.Document||e.type===B.Element)&&!o)for(var d=0,f=e.childNodes;d<f.length;d++){var h=f[d],p=it(h,{doc:r,mirror:n,skipChild:!1,hackCss:a,afterAppend:l,cache:c});if(!p){console.warn("Failed to rebuild",h);continue}h.isShadow&&ei(u)&&u.shadowRoot?u.shadowRoot.appendChild(p):u.appendChild(p),l&&l(p,h.id)}return u}function ta(e,t){function r(s){t(s)}for(var n=0,i=e.getIds();n<i.length;n++){var o=i[n];e.has(o)&&r(e.getNode(o))}}function ra(e,t){var r=t.getMeta(e);if(r?.type===B.Element){var n=e;for(var i in r.attributes)if(Object.prototype.hasOwnProperty.call(r.attributes,i)&&i.startsWith("rr_")){var o=r.attributes[i];i==="rr_scrollLeft"&&(n.scrollLeft=o),i==="rr_scrollTop"&&(n.scrollTop=o)}}}function ni(e,t){var r=t.doc,n=t.onVisit,i=t.hackCss,o=i===void 0?!0:i,s=t.afterAppend,a=t.cache,l=t.mirror,c=l===void 0?new Sr:l,u=it(e,{doc:r,mirror:c,skipChild:!1,hackCss:o,afterAppend:s,cache:a});return ta(c,function(d){n&&n(d),ra(d,c)}),u}var B,Sr,Xn,xs,ks,ze,rt,Jn,Ls,Fs,Bs,Us,Ws,Qn,qn,ri,$s,xe=D(()=>{"use strict";(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(B||(B={}));Sr=(function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var r;if(!t)return-1;var n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var r=this,n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(function(i){return r.removeNodeFromMap(i)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){var n=this.getNode(t);if(n){var i=this.nodeMetaMap.get(n);i&&this.nodeMetaMap.set(r,i)}this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e})();Xn="__rrweb_original__";xs=1,ks=new RegExp("[^a-z0-9-_:]"),ze=-2;Ls=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Fs=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,Bs=/^(data:)([^,]*),(.*)/i;Us=/^[^ \t\n\r\u000c]+/,Ws=/^[, \t\n\r\u000c]+/;Qn=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;qn={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};ri=/([^\\]):hover/,$s=new RegExp(ri.source,"g")});var Mr={};et(Mr,{StyleSheetMirror:()=>Ze,_mirror:()=>ft,getBaseDimension:()=>Bt,getNestedRule:()=>Ye,getPositionsAndIndex:()=>Ut,getWindowHeight:()=>ht,getWindowWidth:()=>pt,hasShadowRoot:()=>Ae,hookSetter:()=>Fe,isAncestorRemoved:()=>_t,isBlocked:()=>ee,isIgnored:()=>mt,isSerialized:()=>Nr,isSerializedIframe:()=>ke,isSerializedStylesheet:()=>vt,isTouchEvent:()=>Lt,iterateResolveTree:()=>Ft,on:()=>ce,patch:()=>pe,polyfill:()=>gt,queueToResolveTrees:()=>Tr,throttle:()=>je,uniqueTextMutations:()=>Rr});function ce(e,t,r=document){let n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}function je(e,t,r={}){let n=null,i=0;return function(...o){let s=Date.now();!i&&r.leading===!1&&(i=s);let a=t-(s-i),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),i=s,e.apply(l,o)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{i=r.leading===!1?0:Date.now(),n=null,e.apply(l,o)},a))}}function Fe(e,t,r,n,i=window){let o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(s){setTimeout(()=>{r.set.call(this,s)},0),o&&o.set&&o.set.call(this,s)}}),()=>Fe(e,t,o||{},!0)}function pe(e,t,r){try{if(!(t in e))return()=>{};let n=e[t],i=r(n);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch{return()=>{}}}function ht(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function pt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ee(e,t,r,n){if(!e)return!1;let i=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!i)return!1;if(typeof t=="string"){if(i.classList.contains(t)||n&&i.closest("."+t)!==null)return!0}else if(ut(i,t,n))return!0;return!!(r&&(e.matches(r)||n&&i.closest(r)!==null))}function Nr(e,t){return t.getId(e)!==-1}function mt(e,t){return t.getId(e)===ze}function _t(e,t){if(Ke(e))return!1;let r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?_t(e.parentNode,t):!0:!0}function Lt(e){return!!e.changedTouches}function gt(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let r=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===r)return!0;while(r=r&&r.parentNode);return!1})}function Tr(e){let t={},r=(i,o)=>{let s={value:i,parent:o,children:[]};return t[i.node.id]=s,s},n=[];for(let i of e){let{nextId:o,parentId:s}=i;if(o&&o in t){let a=t[o];if(a.parent){let l=a.parent.children.indexOf(a);a.parent.children.splice(l,0,r(i,a.parent))}else{let l=n.indexOf(a);n.splice(l,0,r(i,null))}continue}if(s in t){let a=t[s];a.children.push(r(i,a));continue}n.push(r(i,null))}return n}function Ft(e,t){t(e.value);for(let r=e.children.length-1;r>=0;r--)Ft(e.children[r],t)}function ke(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function vt(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Bt(e,t){var r,n;let i=(n=(r=e.ownerDocument)===null||r===void 0?void 0:r.defaultView)===null||n===void 0?void 0:n.frameElement;if(!i||i===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};let o=i.getBoundingClientRect(),s=Bt(i,t),a=o.height/i.clientHeight;return{x:o.x*s.relativeScale+s.x,y:o.y*s.relativeScale+s.y,relativeScale:a,absoluteScale:s.absoluteScale*a}}function Ae(e){return!!e?.shadowRoot}function Ye(e,t){let r=e[t[0]];return t.length===1?r:Ye(r.cssRules[t[1]].cssRules,t.slice(2))}function Ut(e){let t=[...e],r=t.pop();return{positions:t,index:r}}function Rr(e){let t=new Set,r=[];for(let n=e.length;n--;){let i=e[n];t.has(i.id)||(r.push(i),t.add(i.id))}return r}var ot,ft,Ze,me=D(()=>{"use strict";xe();ot=`Please stop import mirror directly. Instead of that,\r
4
4
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
5
- or you can use record.mirror to access the mirror instance during recording.`,ft={map:{},getId(){return console.error(ot),-1},getNode(){return console.error(ot),null},removeNodeFromMap(){console.error(ot)},has(){return console.error(ot),!1},reset(){console.error(ot)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(ft=new Proxy(ft,{get(e,t,r){return t==="map"&&console.error(ot),Reflect.get(e,t,r)}}));Ze=class{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){var r;return(r=this.styleIDMap.get(t))!==null&&r!==void 0?r:-1}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let n;return r===void 0?n=this.id++:n=r,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}});var A,E,ie,ge,G,ve=D(()=>{"use strict";A=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(A||{}),E=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e))(E||{}),ie=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(ie||{}),ge=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ge||{}),G=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e.Destroy="destroy",e))(G||{})});function ii(e){return"__ln"in e}function kr(e,t){e.delete(t),t.childNodes.forEach(r=>kr(e,r))}function si(e,t,r){return e.length===0?!1:li(e,t,r)}function li(e,t,r){let{parentNode:n}=t;if(!n)return!1;let i=r.getId(n);return e.some(o=>o.id===i)?!0:li(e,n,r)}function ai(e,t){return e.size===0?!1:ci(e,t)}function ci(e,t){let{parentNode:r}=t;return r?e.has(r)?!0:ci(e,r):!1}var xr,oi,Wt,ui=D(()=>{"use strict";xe();me();xr=class{constructor(){this.length=0,this.head=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=r?.next||null;return r}addNode(t){let r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&ii(t.previousSibling)){let n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&ii(t.nextSibling)&&t.nextSibling.__ln.previous){let n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;this.length++}removeNode(t){let r=t.__ln;this.head&&(r.previous?(r.previous.next=r.next,r.next&&(r.next.previous=r.previous)):(this.head=r.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}},oi=(e,t)=>`${e}@${t}`,Wt=class{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;let t=[],r=new xr,n=a=>{let l=a,c=ze;for(;c===ze;)l=l&&l.nextSibling,c=l&&this.mirror.getId(l);return c},i=a=>{var l,c,u,d;let f=null;((c=(l=a.getRootNode)===null||l===void 0?void 0:l.call(a))===null||c===void 0?void 0:c.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&a.getRootNode().host&&(f=a.getRootNode().host);let h=f;for(;((d=(u=h?.getRootNode)===null||u===void 0?void 0:u.call(h))===null||d===void 0?void 0:d.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&h.getRootNode().host;)h=h.getRootNode().host;let p=!this.doc.contains(a)&&(!h||!this.doc.contains(h));if(!a.parentNode||p)return;let v=Ke(a.parentNode)?this.mirror.getId(f):this.mirror.getId(a.parentNode),I=n(a);if(v===-1||I===-1)return r.addNode(a);let g=Ve(a,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:m=>{ke(m,this.mirror)&&this.iframeManager.addIframe(m),vt(m,this.mirror)&&this.stylesheetManager.trackLinkElement(m),Ae(a)&&this.shadowDomManager.addShadowRoot(a.shadowRoot,this.doc)},onIframeLoad:(m,y)=>{this.iframeManager.attachIframe(m,y),this.shadowDomManager.observeAttachShadow(m)},onStylesheetLoad:(m,y)=>{this.stylesheetManager.attachLinkElement(m,y)}});g&&t.push({parentId:v,nextId:I,node:g})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let a of Array.from(this.movedSet.values()))si(this.removes,a,this.mirror)&&!this.movedSet.has(a.parentNode)||i(a);for(let a of Array.from(this.addedSet.values()))!ai(this.droppedSet,a)&&!si(this.removes,a,this.mirror)||ai(this.movedSet,a)?i(a):this.droppedSet.add(a);let o=null;for(;r.length;){let a=null;if(o){let l=this.mirror.getId(o.value.parentNode),c=n(o.value);l!==-1&&c!==-1&&(a=o)}if(!a)for(let l=r.length-1;l>=0;l--){let c=r.get(l);if(c){let u=this.mirror.getId(c.value.parentNode);if(n(c.value)===-1)continue;if(u!==-1){a=c;break}else{let f=c.value;if(f.parentNode&&f.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let h=f.parentNode.host;if(this.mirror.getId(h)!==-1){a=c;break}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}o=a.previous,r.removeNode(a.value),i(a.value)}let s={texts:this.texts.map(a=>({id:this.mirror.getId(a.node),value:a.value})).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>({id:this.mirror.getId(a.node),attributes:a.attributes})).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:t};!s.texts.length&&!s.attributes.length&&!s.removes.length&&!s.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(s))},this.processMutation=t=>{if(!mt(t.target,this.mirror))switch(t.type){case"characterData":{let r=t.target.textContent;!ee(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:Er(t.target,this.maskTextClass,this.maskTextSelector)&&r?this.maskTextFn?this.maskTextFn(r):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{let r=t.target,n=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(n=dt({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),ee(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;let i=this.attributes.find(o=>o.node===t.target);if(r.tagName==="IFRAME"&&t.attributeName==="src"&&!this.keepIframeSrcFn(n))if(!r.contentDocument)t.attributeName="rr_src";else return;if(i||(i={node:t.target,attributes:{}},this.attributes.push(i)),t.attributeName==="style"){let o=this.doc.createElement("span");t.oldValue&&o.setAttribute("style",t.oldValue),(i.attributes.style===void 0||i.attributes.style===null)&&(i.attributes.style={});let s=i.attributes.style;for(let a of Array.from(r.style)){let l=r.style.getPropertyValue(a),c=r.style.getPropertyPriority(a);(l!==o.style.getPropertyValue(a)||c!==o.style.getPropertyPriority(a))&&(c===""?s[a]=l:s[a]=[l,c])}for(let a of Array.from(o.style))r.style.getPropertyValue(a)===""&&(s[a]=!1)}else i.attributes[t.attributeName]=wr(this.doc,r.tagName,t.attributeName,n);break}case"childList":{if(ee(t.target,this.blockClass,this.blockSelector,!0))return;t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{let n=this.mirror.getId(r),i=Ke(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);ee(t.target,this.blockClass,this.blockSelector,!1)||mt(r,this.mirror)||!Nr(r,this.mirror)||(this.addedSet.has(r)?(kr(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||_t(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[oi(n,i)]?kr(this.movedSet,r):this.removes.push({parentId:i,id:n,isShadow:Ke(t.target)&&He(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,r)=>{if(this.mirror.hasNode(t)){if(mt(t,this.mirror))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[oi(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);ee(t,this.blockClass,this.blockSelector,!1)||t.childNodes.forEach(n=>this.genAdds(n))}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].forEach(r=>{this[r]=t[r]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}});function yt(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch{return e.target}}function Dr(e,t){var r,n;let i=new Wt;Ue.push(i),i.init(e);let o=window.MutationObserver||window.__rrMutationObserver,s=(n=(r=window?.Zone)===null||r===void 0?void 0:r.__symbol__)===null||n===void 0?void 0:n.call(r,"MutationObserver");s&&window[s]&&(o=window[s]);let a=new o(i.processMutations.bind(i));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function na({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};let i=typeof t.mousemove=="number"?t.mousemove:50,o=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,s=[],a,l=je(d=>{let f=Date.now()-a;e(s.map(h=>(h.timeOffset-=f,h)),d),s=[],a=null},o),c=je(d=>{let f=yt(d),{clientX:h,clientY:p}=Lt(d)?d.changedTouches[0]:d;a||(a=Date.now()),s.push({x:h,y:p,id:n.getId(f),timeOffset:Date.now()-a}),l(typeof DragEvent<"u"&&d instanceof DragEvent?E.Drag:d instanceof MouseEvent?E.MouseMove:E.TouchMove)},i,{trailing:!1}),u=[ce("mousemove",c,r),ce("touchmove",c,r),ce("drag",c,r)];return()=>{u.forEach(d=>d())}}function ia({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{};let s=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[],l=c=>u=>{let d=yt(u);if(ee(d,n,i,!0))return;let f=Lt(u)?u.changedTouches[0]:u;if(!f)return;let h=r.getId(d),{clientX:p,clientY:v}=f;e({type:ie[c],id:h,x:p,y:v})};return Object.keys(ie).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&s[c]!==!1).forEach(c=>{let u=c.toLowerCase(),d=l(c);a.push(ce(u,d,t))}),()=>{a.forEach(c=>c())}}function Or({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){let s=je(a=>{let l=yt(a);if(!l||ee(l,n,i,!0))return;let c=r.getId(l);if(l===t){let u=t.scrollingElement||t.documentElement;e({id:c,x:u.scrollLeft,y:u.scrollTop})}else e({id:c,x:l.scrollLeft,y:l.scrollTop})},o.scroll||100);return ce("scroll",s,t)}function oa({viewportResizeCb:e}){let t=-1,r=-1,n=je(()=>{let i=ht(),o=pt();(t!==i||r!==o)&&(e({width:Number(o),height:Number(i)}),t=i,r=o)},200);return ce("resize",n,window)}function di(e,t){let r=Object.assign({},e);return t||delete r.userTriggered,r}function aa({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,ignoreClass:o,maskInputOptions:s,maskInputFn:a,sampling:l,userTriggeredOnInput:c}){function u(g){let m=yt(g),y=g.isTrusted;if(m&&m.tagName==="OPTION"&&(m=m.parentElement),!m||!m.tagName||sa.indexOf(m.tagName)<0||ee(m,n,i,!0))return;let b=m.type;if(m.classList.contains(o))return;let R=m.value,N=!1;b==="radio"||b==="checkbox"?N=m.checked:(s[m.tagName.toLowerCase()]||s[b])&&(R=dt({maskInputOptions:s,tagName:m.tagName,type:b,value:R,maskInputFn:a})),d(m,di({text:R,isChecked:N,userTriggered:y},c));let _=m.name;b==="radio"&&_&&N&&t.querySelectorAll(`input[type="radio"][name="${_}"]`).forEach(w=>{w!==m&&d(w,di({text:w.value,isChecked:!N,userTriggered:!1},c))})}function d(g,m){let y=fi.get(g);if(!y||y.text!==m.text||y.isChecked!==m.isChecked){fi.set(g,m);let b=r.getId(g);e(Object.assign(Object.assign({},m),{id:b}))}}let h=(l.input==="last"?["change"]:["input","change"]).map(g=>ce(g,u,t)),p=t.defaultView;if(!p)return()=>{h.forEach(g=>g())};let v=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value"),I=[[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 v&&v.set&&h.push(...I.map(g=>Fe(g[0],g[1],{set(){u({target:this})}},!1,p))),()=>{h.forEach(g=>g())}}function Pt(e){let t=[];function r(n,i){if(hi&&n.parentRule instanceof CSSGroupingRule||pi&&n.parentRule instanceof CSSMediaRule||mi&&n.parentRule instanceof CSSSupportsRule||gi&&n.parentRule instanceof CSSConditionRule){let s=Array.from(n.parentRule.cssRules).indexOf(n);i.unshift(s)}else if(n.parentStyleSheet){let s=Array.from(n.parentStyleSheet.cssRules).indexOf(n);i.unshift(s)}return i}return r(e,t)}function Be(e,t,r){let n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function la({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){let i=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=function(u,d){let{id:f,styleId:h}=Be(this,t,r.styleMirror);return(f&&f!==-1||h&&h!==-1)&&e({id:f,styleId:h,adds:[{rule:u,index:d}]}),i.apply(this,[u,d])};let o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=function(u){let{id:d,styleId:f}=Be(this,t,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,removes:[{index:u}]}),o.apply(this,[u])};let s;n.CSSStyleSheet.prototype.replace&&(s=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=function(u){let{id:d,styleId:f}=Be(this,t,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,replace:u}),s.apply(this,[u])});let a;n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=function(u){let{id:d,styleId:f}=Be(this,t,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,replaceSync:u}),a.apply(this,[u])});let l={};hi?l.CSSGroupingRule=n.CSSGroupingRule:(pi&&(l.CSSMediaRule=n.CSSMediaRule),gi&&(l.CSSConditionRule=n.CSSConditionRule),mi&&(l.CSSSupportsRule=n.CSSSupportsRule));let c={};return Object.entries(l).forEach(([u,d])=>{c[u]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=function(f,h){let{id:p,styleId:v}=Be(this.parentStyleSheet,t,r.styleMirror);return(p&&p!==-1||v&&v!==-1)&&e({id:p,styleId:v,adds:[{rule:f,index:[...Pt(this),h||0]}]}),c[u].insertRule.apply(this,[f,h])},d.prototype.deleteRule=function(f){let{id:h,styleId:p}=Be(this.parentStyleSheet,t,r.styleMirror);return(h&&h!==-1||p&&p!==-1)&&e({id:h,styleId:p,removes:[{index:[...Pt(this),f]}]}),c[u].deleteRule.apply(this,[f])}}),()=>{n.CSSStyleSheet.prototype.insertRule=i,n.CSSStyleSheet.prototype.deleteRule=o,s&&(n.CSSStyleSheet.prototype.replace=s),a&&(n.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([u,d])=>{d.prototype.insertRule=c[u].insertRule,d.prototype.deleteRule=c[u].deleteRule})}}function _r({mirror:e,stylesheetManager:t},r){var n,i,o;let s=null;r.nodeName==="#document"?s=e.getId(r):s=e.getId(r.host);let a=r.nodeName==="#document"?(n=r.defaultView)===null||n===void 0?void 0:n.Document:(o=(i=r.ownerDocument)===null||i===void 0?void 0:i.defaultView)===null||o===void 0?void 0:o.ShadowRoot,l=Object.getOwnPropertyDescriptor(a?.prototype,"adoptedStyleSheets");return s===null||s===-1||!a||!l?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var c;return(c=l.get)===null||c===void 0?void 0:c.call(this)},set(c){var u;let d=(u=l.set)===null||u===void 0?void 0:u.call(this,c);if(s!==null&&s!==-1)try{t.adoptStyleSheets(c,s)}catch{}return d}}),()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})}function ca({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:i}){let o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=function(a,l,c){var u;if(r.has(a))return o.apply(this,[a,l,c]);let{id:d,styleId:f}=Be((u=this.parentRule)===null||u===void 0?void 0:u.parentStyleSheet,t,n.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,set:{property:a,value:l,priority:c},index:Pt(this.parentRule)}),o.apply(this,[a,l,c])};let s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=function(a){var l;if(r.has(a))return s.apply(this,[a]);let{id:c,styleId:u}=Be((l=this.parentRule)===null||l===void 0?void 0:l.parentStyleSheet,t,n.styleMirror);return(c&&c!==-1||u&&u!==-1)&&e({id:c,styleId:u,remove:{property:a},index:Pt(this.parentRule)}),s.apply(this,[a])},()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=s}}function ua({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:i}){let o=a=>je(l=>{let c=yt(l);if(!c||ee(c,t,r,!0))return;let{currentTime:u,volume:d,muted:f,playbackRate:h}=c;e({type:a,id:n.getId(c),currentTime:u,volume:d,muted:f,playbackRate:h})},i.media||500),s=[ce("play",o(0)),ce("pause",o(1)),ce("seeked",o(2)),ce("volumechange",o(3)),ce("ratechange",o(4))];return()=>{s.forEach(a=>a())}}function da({fontCb:e,doc:t}){let r=t.defaultView;if(!r)return()=>{};let n=[],i=new WeakMap,o=r.FontFace;r.FontFace=function(l,c,u){let d=new o(l,c,u);return i.set(d,{family:l,buffer:typeof c!="string",descriptors:u,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),d};let s=pe(t.fonts,"add",function(a){return function(l){return setTimeout(()=>{let c=i.get(l);c&&(e(c),i.delete(l))},0),a.apply(this,[l])}});return n.push(()=>{r.FontFace=o}),n.push(s),()=>{n.forEach(a=>a())}}function fa(e){let{doc:t,mirror:r,blockClass:n,blockSelector:i,selectionCb:o}=e,s=!0,a=()=>{let l=t.getSelection();if(!l||s&&l?.isCollapsed)return;s=l.isCollapsed||!1;let c=[],u=l.rangeCount||0;for(let d=0;d<u;d++){let f=l.getRangeAt(d),{startContainer:h,startOffset:p,endContainer:v,endOffset:I}=f;ee(h,n,i,!0)||ee(v,n,i,!0)||c.push({start:r.getId(h),startOffset:p,end:r.getId(v),endOffset:I})}o({ranges:c})};return a(),ce("selectionchange",a)}function ha(e,t){let{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:d,fontCb:f,selectionCb:h}=e;e.mutationCb=(...p)=>{t.mutation&&t.mutation(...p),r(...p)},e.mousemoveCb=(...p)=>{t.mousemove&&t.mousemove(...p),n(...p)},e.mouseInteractionCb=(...p)=>{t.mouseInteraction&&t.mouseInteraction(...p),i(...p)},e.scrollCb=(...p)=>{t.scroll&&t.scroll(...p),o(...p)},e.viewportResizeCb=(...p)=>{t.viewportResize&&t.viewportResize(...p),s(...p)},e.inputCb=(...p)=>{t.input&&t.input(...p),a(...p)},e.mediaInteractionCb=(...p)=>{t.mediaInteaction&&t.mediaInteaction(...p),l(...p)},e.styleSheetRuleCb=(...p)=>{t.styleSheetRule&&t.styleSheetRule(...p),c(...p)},e.styleDeclarationCb=(...p)=>{t.styleDeclaration&&t.styleDeclaration(...p),u(...p)},e.canvasMutationCb=(...p)=>{t.canvasMutation&&t.canvasMutation(...p),d(...p)},e.fontCb=(...p)=>{t.font&&t.font(...p),f(...p)},e.selectionCb=(...p)=>{t.selection&&t.selection(...p),h(...p)}}function vi(e,t={}){let r=e.doc.defaultView;if(!r)return()=>{};ha(e,t);let n=Dr(e,e.doc),i=na(e),o=ia(e),s=Or(e),a=oa(e),l=aa(e),c=ua(e),u=la(e,{win:r}),d=_r(e,e.doc),f=ca(e,{win:r}),h=e.collectFonts?da(e):()=>{},p=fa(e),v=[];for(let I of e.plugins)v.push(I.observer(I.callback,r,I.options));return()=>{Ue.forEach(I=>I.reset()),n.disconnect(),i(),o(),s(),a(),l(),c(),u(),d(),f(),h(),p(),v.forEach(I=>I())}}var Ue,hi,pi,mi,gi,sa,fi,Lr=D(()=>{"use strict";xe();me();ve();ui();Ue=[],hi=typeof CSSGroupingRule<"u",pi=typeof CSSMediaRule<"u",mi=typeof CSSSupportsRule<"u",gi=typeof CSSConditionRule<"u";sa=["INPUT","TEXTAREA","SELECT"],fi=new WeakMap});var It,yi=D(()=>{"use strict";It=class{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,r,n,i){let o=n||this.getIdToRemoteIdMap(t),s=i||this.getRemoteIdToIdMap(t),a=o.get(r);return a||(a=this.generateIdFn(),o.set(r,a),s.set(a,r)),a}getIds(t,r){let n=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return r.map(o=>this.getId(t,o,n,i))}getRemoteId(t,r,n){let i=n||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;let o=i.get(r);return o||-1}getRemoteIds(t,r){let n=this.getRemoteIdToIdMap(t);return r.map(i=>this.getRemoteId(t,i,n))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}}});var Gt,Ii=D(()=>{"use strict";xe();yi();ve();Gt=class{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new It(Cr),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new It(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,r){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(n=this.loadListener)===null||n===void 0||n.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){if(t.data.type==="rrweb"){if(!t.source)return;let n=this.crossOriginIframeMap.get(t.source);if(!n)return;let i=this.transformCrossOriginEvent(n,t.data.event);i&&this.wrappedEmit(i,t.data.isCheckout)}}transformCrossOriginEvent(t,r){var n;switch(r.type){case A.FullSnapshot:return this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t),{timestamp:r.timestamp,type:A.IncrementalSnapshot,data:{source:E.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case A.Meta:case A.Load:case A.DomContentLoaded:return!1;case A.Plugin:return r;case A.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case A.IncrementalSnapshot:switch(r.data.source){case E.Mutation:return r.data.adds.forEach(i=>{this.replaceIds(i,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,t)}),r.data.removes.forEach(i=>{this.replaceIds(i,t,["parentId","id"])}),r.data.attributes.forEach(i=>{this.replaceIds(i,t,["id"])}),r.data.texts.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case E.Drag:case E.TouchMove:case E.MouseMove:return r.data.positions.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case E.ViewportResize:return!1;case E.MediaInteraction:case E.MouseInteraction:case E.Scroll:case E.CanvasMutation:case E.Input:return this.replaceIds(r.data,t,["id"]),r;case E.StyleSheetRule:case E.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case E.Font:return r;case E.Selection:return r.data.ranges.forEach(i=>{this.replaceIds(i,t,["start","end"])}),r;case E.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)===null||n===void 0||n.forEach(i=>{this.replaceStyleIds(i,t,["styleId"])}),r}}}replace(t,r,n,i){for(let o of i)!Array.isArray(r[o])&&typeof r[o]!="number"||(Array.isArray(r[o])?r[o]=t.getIds(n,r[o]):r[o]=t.getId(n,r[o]));return r}replaceIds(t,r,n){return this.replace(this.crossOriginIframeMirror,t,r,n)}replaceStyleIds(t,r,n){return this.replace(this.crossOriginIframeStyleMirror,t,r,n)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r)})}}});var Vt,Si=D(()=>{"use strict";Lr();me();xe();Vt=class{constructor(t){this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;let r=this;this.restorePatches.push(pe(Element.prototype,"attachShadow",function(n){return function(i){let o=n.call(this,i);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,this.ownerDocument),o}}))}addShadowRoot(t,r){He(t)&&(this.shadowDoms.has(t)||(this.shadowDoms.add(t),Dr(Object.assign(Object.assign({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),Or(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),_r({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)},0)))}observeAttachShadow(t){if(t.contentWindow){let r=this;this.restorePatches.push(pe(t.contentWindow.HTMLElement.prototype,"attachShadow",function(n){return function(i){let o=n.call(this,i);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,t.contentDocument),o}}))}}reset(){this.restorePatches.forEach(t=>t()),this.shadowDoms=new WeakSet}}});function Ci(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function ye(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):i(u.value).then(a,l)}c((n=n.apply(e,t||[])).next())})}var Xe=D(()=>{"use strict";});var st,Ct,St,bi,wi,Fr=D(()=>{"use strict";st="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ct=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(St=0;St<st.length;St++)Ct[st.charCodeAt(St)]=St;bi=function(e){var t=new Uint8Array(e),r,n=t.length,i="";for(r=0;r<n;r+=3)i+=st[t[r]>>2],i+=st[(t[r]&3)<<4|t[r+1]>>4],i+=st[(t[r+1]&15)<<2|t[r+2]>>6],i+=st[t[r+2]&63];return n%3===2?i=i.substring(0,i.length-1)+"=":n%3===1&&(i=i.substring(0,i.length-2)+"=="),i},wi=function(e){var t=e.length*.75,r=e.length,n,i=0,o,s,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var c=new ArrayBuffer(t),u=new Uint8Array(c);for(n=0;n<r;n+=4)o=Ct[e.charCodeAt(n)],s=Ct[e.charCodeAt(n+1)],a=Ct[e.charCodeAt(n+2)],l=Ct[e.charCodeAt(n+3)],u[i++]=o<<2|s>>4,u[i++]=(s&15)<<4|a>>2,u[i++]=(a&3)<<6|l&63;return c}});function pa(e,t){let r=Ei.get(e);return r||(r=new Map,Ei.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}function Ht(e,t,r){if(e instanceof Array)return e.map(n=>Ht(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){let n=e.constructor.name,i=bi(e);return{rr_type:n,base64:i}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Ht(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let n=e.constructor.name,{src:i}=e;return{rr_type:n,src:i}}else if(e instanceof HTMLCanvasElement){let n="HTMLImageElement",i=e.toDataURL();return{rr_type:n,src:i}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Ht(e.data,t,r),e.width,e.height]};if(Ai(e,t)||typeof e=="object"){let n=e.constructor.name,i=Br(e,t,r);return{rr_type:n,index:i}}}}return e}var Ei,Br,zt,Ai,Ur=D(()=>{"use strict";Fr();Ei=new Map;Br=(e,t,r)=>{if(!e||!(Ai(e,t)||typeof e=="object"))return;let n=e.constructor.name,i=pa(r,n),o=i.indexOf(e);return o===-1&&(o=i.length,i.push(e)),o};zt=(e,t,r)=>[...e].map(n=>Ht(n,t,r)),Ai=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof t[i]=="function").find(i=>e instanceof t[i])});function Ni(e,t,r,n){let i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let s of o)try{if(typeof t.CanvasRenderingContext2D.prototype[s]!="function")continue;let a=pe(t.CanvasRenderingContext2D.prototype,s,function(l){return function(...c){return ee(this.canvas,r,n,!0)||setTimeout(()=>{let u=zt([...c],t,this);e(this.canvas,{type:ge["2D"],property:s,args:u})},0),l.apply(this,c)}});i.push(a)}catch{let l=Fe(t.CanvasRenderingContext2D.prototype,s,{set(c){e(this.canvas,{type:ge["2D"],property:s,args:[c],setter:!0})}});i.push(l)}return()=>{i.forEach(s=>s())}}var Ti=D(()=>{"use strict";ve();me();Ur()});function Wr(e,t,r){let n=[];try{let i=pe(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(s,...a){return ee(this,t,r,!0)||"__context"in this||(this.__context=s),o.apply(this,[s,...a])}});n.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(i=>i())}}var Mi=D(()=>{"use strict";me()});function Ri(e,t,r,n,i,o,s){let a=[],l=Object.getOwnPropertyNames(e);for(let c of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(c))try{if(typeof e[c]!="function")continue;let u=pe(e,c,function(d){return function(...f){let h=d.apply(this,f);if(Br(h,s,this),!ee(this.canvas,n,i,!0)){let p=zt([...f],s,this),v={type:t,property:c,args:p};r(this.canvas,v)}return h}});a.push(u)}catch{let d=Fe(e,c,{set(f){r(this.canvas,{type:t,property:c,args:[f],setter:!0})}});a.push(d)}return a}function xi(e,t,r,n,i){let o=[];return o.push(...Ri(t.WebGLRenderingContext.prototype,ge.WebGL,e,r,n,i,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...Ri(t.WebGL2RenderingContext.prototype,ge.WebGL2,e,r,n,i,t)),()=>{o.forEach(s=>s())}}var ki=D(()=>{"use strict";ve();me();Ur()});var Pr,Di,Oi=D(()=>{"use strict";Pr=null;try{Di=typeof module<"u"&&typeof module.require=="function"&&module.require("worker_threads")||typeof __non_webpack_require__=="function"&&__non_webpack_require__("worker_threads")||typeof Mt=="function"&&Mt("worker_threads"),Pr=Di.Worker}catch{}});function ma(e,t){return Buffer.from(e,"base64").toString(t?"utf16":"utf8")}function _i(e,t,r){var n=t===void 0?null:t,i=r===void 0?!1:r,o=ma(e,i),s=o.indexOf(`
5
+ or you can use record.mirror to access the mirror instance during recording.`,ft={map:{},getId(){return console.error(ot),-1},getNode(){return console.error(ot),null},removeNodeFromMap(){console.error(ot)},has(){return console.error(ot),!1},reset(){console.error(ot)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(ft=new Proxy(ft,{get(e,t,r){return t==="map"&&console.error(ot),Reflect.get(e,t,r)}}));Ze=class{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){var r;return(r=this.styleIDMap.get(t))!==null&&r!==void 0?r:-1}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let n;return r===void 0?n=this.id++:n=r,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}});var A,E,ie,ge,G,ve=D(()=>{"use strict";A=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(A||{}),E=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e))(E||{}),ie=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(ie||{}),ge=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ge||{}),G=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e.Destroy="destroy",e))(G||{})});function ii(e){return"__ln"in e}function kr(e,t){e.delete(t),t.childNodes.forEach(r=>kr(e,r))}function si(e,t,r){return e.length===0?!1:li(e,t,r)}function li(e,t,r){let{parentNode:n}=t;if(!n)return!1;let i=r.getId(n);return e.some(o=>o.id===i)?!0:li(e,n,r)}function ai(e,t){return e.size===0?!1:ci(e,t)}function ci(e,t){let{parentNode:r}=t;return r?e.has(r)?!0:ci(e,r):!1}var xr,oi,Wt,ui=D(()=>{"use strict";xe();me();xr=class{constructor(){this.length=0,this.head=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=r?.next||null;return r}addNode(t){let r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&ii(t.previousSibling)){let n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&ii(t.nextSibling)&&t.nextSibling.__ln.previous){let n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;this.length++}removeNode(t){let r=t.__ln;this.head&&(r.previous?(r.previous.next=r.next,r.next&&(r.next.previous=r.previous)):(this.head=r.next,this.head&&(this.head.previous=null)),t.__ln&&delete t.__ln,this.length--)}},oi=(e,t)=>`${e}@${t}`,Wt=class{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;let t=[],r=new xr,n=a=>{let l=a,c=ze;for(;c===ze;)l=l&&l.nextSibling,c=l&&this.mirror.getId(l);return c},i=a=>{var l,c,u,d;let f=null;((c=(l=a.getRootNode)===null||l===void 0?void 0:l.call(a))===null||c===void 0?void 0:c.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&a.getRootNode().host&&(f=a.getRootNode().host);let h=f;for(;((d=(u=h?.getRootNode)===null||u===void 0?void 0:u.call(h))===null||d===void 0?void 0:d.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&h.getRootNode().host;)h=h.getRootNode().host;let p=!this.doc.contains(a)&&(!h||!this.doc.contains(h));if(!a.parentNode||p)return;let v=Ke(a.parentNode)?this.mirror.getId(f):this.mirror.getId(a.parentNode),I=n(a);if(v===-1||I===-1)return r.addNode(a);let m=Ve(a,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:g=>{ke(g,this.mirror)&&this.iframeManager.addIframe(g),vt(g,this.mirror)&&this.stylesheetManager.trackLinkElement(g),Ae(a)&&this.shadowDomManager.addShadowRoot(a.shadowRoot,this.doc)},onIframeLoad:(g,y)=>{this.iframeManager.attachIframe(g,y),this.shadowDomManager.observeAttachShadow(g)},onStylesheetLoad:(g,y)=>{this.stylesheetManager.attachLinkElement(g,y)}});m&&t.push({parentId:v,nextId:I,node:m})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let a of Array.from(this.movedSet.values()))si(this.removes,a,this.mirror)&&!this.movedSet.has(a.parentNode)||i(a);for(let a of Array.from(this.addedSet.values()))!ai(this.droppedSet,a)&&!si(this.removes,a,this.mirror)||ai(this.movedSet,a)?i(a):this.droppedSet.add(a);let o=null;for(;r.length;){let a=null;if(o){let l=this.mirror.getId(o.value.parentNode),c=n(o.value);l!==-1&&c!==-1&&(a=o)}if(!a)for(let l=r.length-1;l>=0;l--){let c=r.get(l);if(c){let u=this.mirror.getId(c.value.parentNode);if(n(c.value)===-1)continue;if(u!==-1){a=c;break}else{let f=c.value;if(f.parentNode&&f.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let h=f.parentNode.host;if(this.mirror.getId(h)!==-1){a=c;break}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}o=a.previous,r.removeNode(a.value),i(a.value)}let s={texts:this.texts.map(a=>({id:this.mirror.getId(a.node),value:a.value})).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>({id:this.mirror.getId(a.node),attributes:a.attributes})).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:t};!s.texts.length&&!s.attributes.length&&!s.removes.length&&!s.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(s))},this.processMutation=t=>{if(!mt(t.target,this.mirror))switch(t.type){case"characterData":{let r=t.target.textContent;!ee(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:Er(t.target,this.maskTextClass,this.maskTextSelector)&&r?this.maskTextFn?this.maskTextFn(r):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{let r=t.target,n=t.target.getAttribute(t.attributeName);if(t.attributeName==="value"&&(n=dt({maskInputOptions:this.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),ee(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;let i=this.attributes.find(o=>o.node===t.target);if(r.tagName==="IFRAME"&&t.attributeName==="src"&&!this.keepIframeSrcFn(n))if(!r.contentDocument)t.attributeName="rr_src";else return;if(i||(i={node:t.target,attributes:{}},this.attributes.push(i)),t.attributeName==="style"){let o=this.doc.createElement("span");t.oldValue&&o.setAttribute("style",t.oldValue),(i.attributes.style===void 0||i.attributes.style===null)&&(i.attributes.style={});let s=i.attributes.style;for(let a of Array.from(r.style)){let l=r.style.getPropertyValue(a),c=r.style.getPropertyPriority(a);(l!==o.style.getPropertyValue(a)||c!==o.style.getPropertyPriority(a))&&(c===""?s[a]=l:s[a]=[l,c])}for(let a of Array.from(o.style))r.style.getPropertyValue(a)===""&&(s[a]=!1)}else i.attributes[t.attributeName]=wr(this.doc,r.tagName,t.attributeName,n);break}case"childList":{if(ee(t.target,this.blockClass,this.blockSelector,!0))return;t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{let n=this.mirror.getId(r),i=Ke(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);ee(t.target,this.blockClass,this.blockSelector,!1)||mt(r,this.mirror)||!Nr(r,this.mirror)||(this.addedSet.has(r)?(kr(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||_t(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[oi(n,i)]?kr(this.movedSet,r):this.removes.push({parentId:i,id:n,isShadow:Ke(t.target)&&He(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,r)=>{if(this.mirror.hasNode(t)){if(mt(t,this.mirror))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[oi(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);ee(t,this.blockClass,this.blockSelector,!1)||t.childNodes.forEach(n=>this.genAdds(n))}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].forEach(r=>{this[r]=t[r]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}});function yt(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch{return e.target}}function Dr(e,t){var r,n;let i=new Wt;Ue.push(i),i.init(e);let o=window.MutationObserver||window.__rrMutationObserver,s=(n=(r=window?.Zone)===null||r===void 0?void 0:r.__symbol__)===null||n===void 0?void 0:n.call(r,"MutationObserver");s&&window[s]&&(o=window[s]);let a=new o(i.processMutations.bind(i));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function na({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};let i=typeof t.mousemove=="number"?t.mousemove:50,o=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,s=[],a,l=je(d=>{let f=Date.now()-a;e(s.map(h=>(h.timeOffset-=f,h)),d),s=[],a=null},o),c=je(d=>{let f=yt(d),{clientX:h,clientY:p}=Lt(d)?d.changedTouches[0]:d;a||(a=Date.now()),s.push({x:h,y:p,id:n.getId(f),timeOffset:Date.now()-a}),l(typeof DragEvent<"u"&&d instanceof DragEvent?E.Drag:d instanceof MouseEvent?E.MouseMove:E.TouchMove)},i,{trailing:!1}),u=[ce("mousemove",c,r),ce("touchmove",c,r),ce("drag",c,r)];return()=>{u.forEach(d=>d())}}function ia({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{};let s=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[],l=c=>u=>{let d=yt(u);if(ee(d,n,i,!0))return;let f=Lt(u)?u.changedTouches[0]:u;if(!f)return;let h=r.getId(d),{clientX:p,clientY:v}=f;e({type:ie[c],id:h,x:p,y:v})};return Object.keys(ie).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&s[c]!==!1).forEach(c=>{let u=c.toLowerCase(),d=l(c);a.push(ce(u,d,t))}),()=>{a.forEach(c=>c())}}function Or({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:o}){let s=je(a=>{let l=yt(a);if(!l||ee(l,n,i,!0))return;let c=r.getId(l);if(l===t){let u=t.scrollingElement||t.documentElement;e({id:c,x:u.scrollLeft,y:u.scrollTop})}else e({id:c,x:l.scrollLeft,y:l.scrollTop})},o.scroll||100);return ce("scroll",s,t)}function oa({viewportResizeCb:e}){let t=-1,r=-1,n=je(()=>{let i=ht(),o=pt();(t!==i||r!==o)&&(e({width:Number(o),height:Number(i)}),t=i,r=o)},200);return ce("resize",n,window)}function di(e,t){let r=Object.assign({},e);return t||delete r.userTriggered,r}function aa({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,ignoreClass:o,maskInputOptions:s,maskInputFn:a,sampling:l,userTriggeredOnInput:c}){function u(m){let g=yt(m),y=m.isTrusted;if(g&&g.tagName==="OPTION"&&(g=g.parentElement),!g||!g.tagName||sa.indexOf(g.tagName)<0||ee(g,n,i,!0))return;let b=g.type;if(g.classList.contains(o))return;let M=g.value,N=!1;b==="radio"||b==="checkbox"?N=g.checked:(s[g.tagName.toLowerCase()]||s[b])&&(M=dt({maskInputOptions:s,tagName:g.tagName,type:b,value:M,maskInputFn:a})),d(g,di({text:M,isChecked:N,userTriggered:y},c));let _=g.name;b==="radio"&&_&&N&&t.querySelectorAll(`input[type="radio"][name="${_}"]`).forEach(w=>{w!==g&&d(w,di({text:w.value,isChecked:!N,userTriggered:!1},c))})}function d(m,g){let y=fi.get(m);if(!y||y.text!==g.text||y.isChecked!==g.isChecked){fi.set(m,g);let b=r.getId(m);e(Object.assign(Object.assign({},g),{id:b}))}}let h=(l.input==="last"?["change"]:["input","change"]).map(m=>ce(m,u,t)),p=t.defaultView;if(!p)return()=>{h.forEach(m=>m())};let v=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value"),I=[[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 v&&v.set&&h.push(...I.map(m=>Fe(m[0],m[1],{set(){u({target:this})}},!1,p))),()=>{h.forEach(m=>m())}}function Pt(e){let t=[];function r(n,i){if(hi&&n.parentRule instanceof CSSGroupingRule||pi&&n.parentRule instanceof CSSMediaRule||mi&&n.parentRule instanceof CSSSupportsRule||gi&&n.parentRule instanceof CSSConditionRule){let s=Array.from(n.parentRule.cssRules).indexOf(n);i.unshift(s)}else if(n.parentStyleSheet){let s=Array.from(n.parentStyleSheet.cssRules).indexOf(n);i.unshift(s)}return i}return r(e,t)}function Be(e,t,r){let n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function la({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){let i=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=function(u,d){let{id:f,styleId:h}=Be(this,t,r.styleMirror);return(f&&f!==-1||h&&h!==-1)&&e({id:f,styleId:h,adds:[{rule:u,index:d}]}),i.apply(this,[u,d])};let o=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=function(u){let{id:d,styleId:f}=Be(this,t,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,removes:[{index:u}]}),o.apply(this,[u])};let s;n.CSSStyleSheet.prototype.replace&&(s=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=function(u){let{id:d,styleId:f}=Be(this,t,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,replace:u}),s.apply(this,[u])});let a;n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=function(u){let{id:d,styleId:f}=Be(this,t,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,replaceSync:u}),a.apply(this,[u])});let l={};hi?l.CSSGroupingRule=n.CSSGroupingRule:(pi&&(l.CSSMediaRule=n.CSSMediaRule),gi&&(l.CSSConditionRule=n.CSSConditionRule),mi&&(l.CSSSupportsRule=n.CSSSupportsRule));let c={};return Object.entries(l).forEach(([u,d])=>{c[u]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=function(f,h){let{id:p,styleId:v}=Be(this.parentStyleSheet,t,r.styleMirror);return(p&&p!==-1||v&&v!==-1)&&e({id:p,styleId:v,adds:[{rule:f,index:[...Pt(this),h||0]}]}),c[u].insertRule.apply(this,[f,h])},d.prototype.deleteRule=function(f){let{id:h,styleId:p}=Be(this.parentStyleSheet,t,r.styleMirror);return(h&&h!==-1||p&&p!==-1)&&e({id:h,styleId:p,removes:[{index:[...Pt(this),f]}]}),c[u].deleteRule.apply(this,[f])}}),()=>{n.CSSStyleSheet.prototype.insertRule=i,n.CSSStyleSheet.prototype.deleteRule=o,s&&(n.CSSStyleSheet.prototype.replace=s),a&&(n.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([u,d])=>{d.prototype.insertRule=c[u].insertRule,d.prototype.deleteRule=c[u].deleteRule})}}function _r({mirror:e,stylesheetManager:t},r){var n,i,o;let s=null;r.nodeName==="#document"?s=e.getId(r):s=e.getId(r.host);let a=r.nodeName==="#document"?(n=r.defaultView)===null||n===void 0?void 0:n.Document:(o=(i=r.ownerDocument)===null||i===void 0?void 0:i.defaultView)===null||o===void 0?void 0:o.ShadowRoot,l=Object.getOwnPropertyDescriptor(a?.prototype,"adoptedStyleSheets");return s===null||s===-1||!a||!l?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var c;return(c=l.get)===null||c===void 0?void 0:c.call(this)},set(c){var u;let d=(u=l.set)===null||u===void 0?void 0:u.call(this,c);if(s!==null&&s!==-1)try{t.adoptStyleSheets(c,s)}catch{}return d}}),()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})}function ca({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:i}){let o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=function(a,l,c){var u;if(r.has(a))return o.apply(this,[a,l,c]);let{id:d,styleId:f}=Be((u=this.parentRule)===null||u===void 0?void 0:u.parentStyleSheet,t,n.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,set:{property:a,value:l,priority:c},index:Pt(this.parentRule)}),o.apply(this,[a,l,c])};let s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=function(a){var l;if(r.has(a))return s.apply(this,[a]);let{id:c,styleId:u}=Be((l=this.parentRule)===null||l===void 0?void 0:l.parentStyleSheet,t,n.styleMirror);return(c&&c!==-1||u&&u!==-1)&&e({id:c,styleId:u,remove:{property:a},index:Pt(this.parentRule)}),s.apply(this,[a])},()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=s}}function ua({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:i}){let o=a=>je(l=>{let c=yt(l);if(!c||ee(c,t,r,!0))return;let{currentTime:u,volume:d,muted:f,playbackRate:h}=c;e({type:a,id:n.getId(c),currentTime:u,volume:d,muted:f,playbackRate:h})},i.media||500),s=[ce("play",o(0)),ce("pause",o(1)),ce("seeked",o(2)),ce("volumechange",o(3)),ce("ratechange",o(4))];return()=>{s.forEach(a=>a())}}function da({fontCb:e,doc:t}){let r=t.defaultView;if(!r)return()=>{};let n=[],i=new WeakMap,o=r.FontFace;r.FontFace=function(l,c,u){let d=new o(l,c,u);return i.set(d,{family:l,buffer:typeof c!="string",descriptors:u,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),d};let s=pe(t.fonts,"add",function(a){return function(l){return setTimeout(()=>{let c=i.get(l);c&&(e(c),i.delete(l))},0),a.apply(this,[l])}});return n.push(()=>{r.FontFace=o}),n.push(s),()=>{n.forEach(a=>a())}}function fa(e){let{doc:t,mirror:r,blockClass:n,blockSelector:i,selectionCb:o}=e,s=!0,a=()=>{let l=t.getSelection();if(!l||s&&l?.isCollapsed)return;s=l.isCollapsed||!1;let c=[],u=l.rangeCount||0;for(let d=0;d<u;d++){let f=l.getRangeAt(d),{startContainer:h,startOffset:p,endContainer:v,endOffset:I}=f;ee(h,n,i,!0)||ee(v,n,i,!0)||c.push({start:r.getId(h),startOffset:p,end:r.getId(v),endOffset:I})}o({ranges:c})};return a(),ce("selectionchange",a)}function ha(e,t){let{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:d,fontCb:f,selectionCb:h}=e;e.mutationCb=(...p)=>{t.mutation&&t.mutation(...p),r(...p)},e.mousemoveCb=(...p)=>{t.mousemove&&t.mousemove(...p),n(...p)},e.mouseInteractionCb=(...p)=>{t.mouseInteraction&&t.mouseInteraction(...p),i(...p)},e.scrollCb=(...p)=>{t.scroll&&t.scroll(...p),o(...p)},e.viewportResizeCb=(...p)=>{t.viewportResize&&t.viewportResize(...p),s(...p)},e.inputCb=(...p)=>{t.input&&t.input(...p),a(...p)},e.mediaInteractionCb=(...p)=>{t.mediaInteaction&&t.mediaInteaction(...p),l(...p)},e.styleSheetRuleCb=(...p)=>{t.styleSheetRule&&t.styleSheetRule(...p),c(...p)},e.styleDeclarationCb=(...p)=>{t.styleDeclaration&&t.styleDeclaration(...p),u(...p)},e.canvasMutationCb=(...p)=>{t.canvasMutation&&t.canvasMutation(...p),d(...p)},e.fontCb=(...p)=>{t.font&&t.font(...p),f(...p)},e.selectionCb=(...p)=>{t.selection&&t.selection(...p),h(...p)}}function vi(e,t={}){let r=e.doc.defaultView;if(!r)return()=>{};ha(e,t);let n=Dr(e,e.doc),i=na(e),o=ia(e),s=Or(e),a=oa(e),l=aa(e),c=ua(e),u=la(e,{win:r}),d=_r(e,e.doc),f=ca(e,{win:r}),h=e.collectFonts?da(e):()=>{},p=fa(e),v=[];for(let I of e.plugins)v.push(I.observer(I.callback,r,I.options));return()=>{Ue.forEach(I=>I.reset()),n.disconnect(),i(),o(),s(),a(),l(),c(),u(),d(),f(),h(),p(),v.forEach(I=>I())}}var Ue,hi,pi,mi,gi,sa,fi,Lr=D(()=>{"use strict";xe();me();ve();ui();Ue=[],hi=typeof CSSGroupingRule<"u",pi=typeof CSSMediaRule<"u",mi=typeof CSSSupportsRule<"u",gi=typeof CSSConditionRule<"u";sa=["INPUT","TEXTAREA","SELECT"],fi=new WeakMap});var It,yi=D(()=>{"use strict";It=class{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,r,n,i){let o=n||this.getIdToRemoteIdMap(t),s=i||this.getRemoteIdToIdMap(t),a=o.get(r);return a||(a=this.generateIdFn(),o.set(r,a),s.set(a,r)),a}getIds(t,r){let n=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return r.map(o=>this.getId(t,o,n,i))}getRemoteId(t,r,n){let i=n||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;let o=i.get(r);return o||-1}getRemoteIds(t,r){let n=this.getRemoteIdToIdMap(t);return r.map(i=>this.getRemoteId(t,i,n))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}}});var Gt,Ii=D(()=>{"use strict";xe();yi();ve();Gt=class{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new It(Cr),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new It(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,r){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(n=this.loadListener)===null||n===void 0||n.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){if(t.data.type==="rrweb"){if(!t.source)return;let n=this.crossOriginIframeMap.get(t.source);if(!n)return;let i=this.transformCrossOriginEvent(n,t.data.event);i&&this.wrappedEmit(i,t.data.isCheckout)}}transformCrossOriginEvent(t,r){var n;switch(r.type){case A.FullSnapshot:return this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t),{timestamp:r.timestamp,type:A.IncrementalSnapshot,data:{source:E.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case A.Meta:case A.Load:case A.DomContentLoaded:return!1;case A.Plugin:return r;case A.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case A.IncrementalSnapshot:switch(r.data.source){case E.Mutation:return r.data.adds.forEach(i=>{this.replaceIds(i,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,t)}),r.data.removes.forEach(i=>{this.replaceIds(i,t,["parentId","id"])}),r.data.attributes.forEach(i=>{this.replaceIds(i,t,["id"])}),r.data.texts.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case E.Drag:case E.TouchMove:case E.MouseMove:return r.data.positions.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case E.ViewportResize:return!1;case E.MediaInteraction:case E.MouseInteraction:case E.Scroll:case E.CanvasMutation:case E.Input:return this.replaceIds(r.data,t,["id"]),r;case E.StyleSheetRule:case E.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case E.Font:return r;case E.Selection:return r.data.ranges.forEach(i=>{this.replaceIds(i,t,["start","end"])}),r;case E.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)===null||n===void 0||n.forEach(i=>{this.replaceStyleIds(i,t,["styleId"])}),r}}}replace(t,r,n,i){for(let o of i)!Array.isArray(r[o])&&typeof r[o]!="number"||(Array.isArray(r[o])?r[o]=t.getIds(n,r[o]):r[o]=t.getId(n,r[o]));return r}replaceIds(t,r,n){return this.replace(this.crossOriginIframeMirror,t,r,n)}replaceStyleIds(t,r,n){return this.replace(this.crossOriginIframeStyleMirror,t,r,n)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r)})}}});var Vt,Si=D(()=>{"use strict";Lr();me();xe();Vt=class{constructor(t){this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;let r=this;this.restorePatches.push(pe(Element.prototype,"attachShadow",function(n){return function(i){let o=n.call(this,i);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,this.ownerDocument),o}}))}addShadowRoot(t,r){He(t)&&(this.shadowDoms.has(t)||(this.shadowDoms.add(t),Dr(Object.assign(Object.assign({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),Or(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),_r({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)},0)))}observeAttachShadow(t){if(t.contentWindow){let r=this;this.restorePatches.push(pe(t.contentWindow.HTMLElement.prototype,"attachShadow",function(n){return function(i){let o=n.call(this,i);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,t.contentDocument),o}}))}}reset(){this.restorePatches.forEach(t=>t()),this.shadowDoms=new WeakSet}}});function Ci(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function ye(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function l(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):i(u.value).then(a,l)}c((n=n.apply(e,t||[])).next())})}var Xe=D(()=>{"use strict";});var st,Ct,St,bi,wi,Fr=D(()=>{"use strict";st="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ct=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(St=0;St<st.length;St++)Ct[st.charCodeAt(St)]=St;bi=function(e){var t=new Uint8Array(e),r,n=t.length,i="";for(r=0;r<n;r+=3)i+=st[t[r]>>2],i+=st[(t[r]&3)<<4|t[r+1]>>4],i+=st[(t[r+1]&15)<<2|t[r+2]>>6],i+=st[t[r+2]&63];return n%3===2?i=i.substring(0,i.length-1)+"=":n%3===1&&(i=i.substring(0,i.length-2)+"=="),i},wi=function(e){var t=e.length*.75,r=e.length,n,i=0,o,s,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var c=new ArrayBuffer(t),u=new Uint8Array(c);for(n=0;n<r;n+=4)o=Ct[e.charCodeAt(n)],s=Ct[e.charCodeAt(n+1)],a=Ct[e.charCodeAt(n+2)],l=Ct[e.charCodeAt(n+3)],u[i++]=o<<2|s>>4,u[i++]=(s&15)<<4|a>>2,u[i++]=(a&3)<<6|l&63;return c}});function pa(e,t){let r=Ei.get(e);return r||(r=new Map,Ei.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}function Ht(e,t,r){if(e instanceof Array)return e.map(n=>Ht(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){let n=e.constructor.name,i=bi(e);return{rr_type:n,base64:i}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Ht(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let n=e.constructor.name,{src:i}=e;return{rr_type:n,src:i}}else if(e instanceof HTMLCanvasElement){let n="HTMLImageElement",i=e.toDataURL();return{rr_type:n,src:i}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Ht(e.data,t,r),e.width,e.height]};if(Ai(e,t)||typeof e=="object"){let n=e.constructor.name,i=Br(e,t,r);return{rr_type:n,index:i}}}}return e}var Ei,Br,zt,Ai,Ur=D(()=>{"use strict";Fr();Ei=new Map;Br=(e,t,r)=>{if(!e||!(Ai(e,t)||typeof e=="object"))return;let n=e.constructor.name,i=pa(r,n),o=i.indexOf(e);return o===-1&&(o=i.length,i.push(e)),o};zt=(e,t,r)=>[...e].map(n=>Ht(n,t,r)),Ai=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof t[i]=="function").find(i=>e instanceof t[i])});function Ni(e,t,r,n){let i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let s of o)try{if(typeof t.CanvasRenderingContext2D.prototype[s]!="function")continue;let a=pe(t.CanvasRenderingContext2D.prototype,s,function(l){return function(...c){return ee(this.canvas,r,n,!0)||setTimeout(()=>{let u=zt([...c],t,this);e(this.canvas,{type:ge["2D"],property:s,args:u})},0),l.apply(this,c)}});i.push(a)}catch{let l=Fe(t.CanvasRenderingContext2D.prototype,s,{set(c){e(this.canvas,{type:ge["2D"],property:s,args:[c],setter:!0})}});i.push(l)}return()=>{i.forEach(s=>s())}}var Ti=D(()=>{"use strict";ve();me();Ur()});function Wr(e,t,r){let n=[];try{let i=pe(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(s,...a){return ee(this,t,r,!0)||"__context"in this||(this.__context=s),o.apply(this,[s,...a])}});n.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(i=>i())}}var Ri=D(()=>{"use strict";me()});function Mi(e,t,r,n,i,o,s){let a=[],l=Object.getOwnPropertyNames(e);for(let c of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(c))try{if(typeof e[c]!="function")continue;let u=pe(e,c,function(d){return function(...f){let h=d.apply(this,f);if(Br(h,s,this),!ee(this.canvas,n,i,!0)){let p=zt([...f],s,this),v={type:t,property:c,args:p};r(this.canvas,v)}return h}});a.push(u)}catch{let d=Fe(e,c,{set(f){r(this.canvas,{type:t,property:c,args:[f],setter:!0})}});a.push(d)}return a}function xi(e,t,r,n,i){let o=[];return o.push(...Mi(t.WebGLRenderingContext.prototype,ge.WebGL,e,r,n,i,t)),typeof t.WebGL2RenderingContext<"u"&&o.push(...Mi(t.WebGL2RenderingContext.prototype,ge.WebGL2,e,r,n,i,t)),()=>{o.forEach(s=>s())}}var ki=D(()=>{"use strict";ve();me();Ur()});var Pr,Di,Oi=D(()=>{"use strict";Pr=null;try{Di=typeof module<"u"&&typeof module.require=="function"&&module.require("worker_threads")||typeof __non_webpack_require__=="function"&&__non_webpack_require__("worker_threads")||typeof Rt=="function"&&Rt("worker_threads"),Pr=Di.Worker}catch{}});function ma(e,t){return Buffer.from(e,"base64").toString(t?"utf16":"utf8")}function _i(e,t,r){var n=t===void 0?null:t,i=r===void 0?!1:r,o=ma(e,i),s=o.indexOf(`
6
6
  `,10)+1,a=o.substring(s)+(n?"//# sourceMappingURL="+n:"");return function(c){return new Pr(a,Object.assign({},c,{eval:!0}))}}var Li=D(()=>{"use strict";Oi()});function ga(e,t){var r=atob(e);if(t){for(var n=new Uint8Array(r.length),i=0,o=r.length;i<o;++i)n[i]=r.charCodeAt(i);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}function va(e,t,r){var n=t===void 0?null:t,i=r===void 0?!1:r,o=ga(e,i),s=o.indexOf(`
7
- `,10)+1,a=o.substring(s)+(n?"//# sourceMappingURL="+n:""),l=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(l)}function Fi(e,t,r){var n;return function(o){return n=n||va(e,t,r),new Worker(n,o)}}var Bi=D(()=>{"use strict"});function Ui(){return ya}var ya,Wi=D(()=>{"use strict";ya=Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"});function Pi(e,t,r){return Ui()?_i(e,t,r):Fi(e,t,r)}var Gi=D(()=>{"use strict";Li();Bi();Wi()});var Vi,Hi=D(()=>{"use strict";Gi();Vi=Pi("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",null,!1)});var Kt,zi=D(()=>{"use strict";Xe();me();ve();Ti();Mi();ki();Hi();Kt=class{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(l,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(c)};let{sampling:r="all",win:n,blockClass:i,blockSelector:o,recordCanvas:s,dataURLOptions:a}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&r==="all"&&this.initCanvasMutationObserver(n,i,o),s&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,i,o,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,n,i,o){let s=Wr(r,n,i),a=new Map,l=new Vi;l.onmessage=p=>{let{id:v}=p.data;if(a.set(v,!1),!("base64"in p.data))return;let{base64:I,type:g,width:m,height:y}=p.data;this.mutationCb({id:v,type:ge["2D"],commands:[{property:"clearRect",args:[0,0,m,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:I}],type:g}]},0,0]}]})};let c=1e3/t,u=0,d,f=()=>{let p=[];return r.document.querySelectorAll("canvas").forEach(v=>{ee(v,n,i,!0)||p.push(v)}),p},h=p=>{if(u&&p-u<c){d=requestAnimationFrame(h);return}u=p,f().forEach(v=>ye(this,void 0,void 0,function*(){var I;let g=this.mirror.getId(v);if(a.get(g))return;if(a.set(g,!0),["webgl","webgl2"].includes(v.__context)){let y=v.getContext(v.__context);((I=y?.getContextAttributes())===null||I===void 0?void 0:I.preserveDrawingBuffer)===!1&&y?.clear(y.COLOR_BUFFER_BIT)}let m=yield createImageBitmap(v);l.postMessage({id:g,bitmap:m,width:v.width,height:v.height,dataURLOptions:o.dataURLOptions},[m])})),d=requestAnimationFrame(h)};d=requestAnimationFrame(h),this.resetObservers=()=>{s(),cancelAnimationFrame(d)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let i=Wr(t,r,n),o=Ni(this.processMutation.bind(this),t,r,n),s=xi(this.processMutation.bind(this),t,r,n,this.mirror);this.resetObservers=()=>{i(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{let n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;let i=n.map(s=>Ci(s,["type"])),{type:o}=n[0];this.mutationCb({id:r,type:o,commands:i}),this.pendingCanvasMutations.delete(t)}}});var Zt,Ki=D(()=>{"use strict";xe();me();Zt=class{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new Ze,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;let n={id:r,styleIds:[]},i=[];for(let o of t){let s;if(this.styleMirror.has(o))s=this.styleMirror.getId(o);else{s=this.styleMirror.add(o);let a=Array.from(o.rules||CSSRule);i.push({styleId:s,rules:a.map((l,c)=>({rule:Ir(l),index:c}))})}n.styleIds.push(s)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}});function le(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}function De(e={}){let{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:s="rr-ignore",maskTextClass:a="rr-mask",maskTextSelector:l=null,inlineStylesheet:c=!0,maskAllInputs:u,maskInputOptions:d,slimDOMOptions:f,maskInputFn:h,maskTextFn:p,hooks:v,packFn:I,sampling:g={},dataURLOptions:m={},mousemoveWait:y,recordCanvas:b=!1,recordCrossOriginIframes:R=!1,userTriggeredOnInput:N=!1,collectFonts:_=!1,inlineImages:w=!1,plugins:Y,keepIframeSrcFn:H=()=>!1,ignoreCSSAttributes:q=new Set([])}=e,U=R?window.parent===window:!0,K=!1;if(!U)try{window.parent.document,K=!1}catch{K=!0}if(U&&!t)throw new Error("emit function is required");y!==void 0&&g.mousemove===void 0&&(g.mousemove=y),Ce.reset();let L=u===!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}:d!==void 0?d:{password:!0},z=f===!0||f==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:f==="all",headMetaDescKeywords:f==="all"}:f||{};gt();let F,k=0,X=O=>{for(let re of Y||[])re.eventProcessor&&(O=re.eventProcessor(O));return I&&(O=I(O)),O};oe=(O,re)=>{var ne;if(!((ne=Ue[0])===null||ne===void 0)&&ne.isFrozen()&&O.type!==A.FullSnapshot&&!(O.type===A.IncrementalSnapshot&&O.data.source===E.Mutation)&&Ue.forEach(Q=>Q.unfreeze()),U)t?.(X(O),re);else if(K){let Q={type:"rrweb",event:X(O),isCheckout:re};window.parent.postMessage(Q,"*")}if(O.type===A.FullSnapshot)F=O,k=0;else if(O.type===A.IncrementalSnapshot){if(O.data.source===E.Mutation&&O.data.isAttachIframe)return;k++;let Q=n&&k>=n,fe=r&&O.timestamp-F.timestamp>r;(Q||fe)&&jt(!0)}};let C=O=>{oe(le({type:A.IncrementalSnapshot,data:Object.assign({source:E.Mutation},O)}))},S=O=>oe(le({type:A.IncrementalSnapshot,data:Object.assign({source:E.Scroll},O)})),T=O=>oe(le({type:A.IncrementalSnapshot,data:Object.assign({source:E.CanvasMutation},O)})),M=O=>oe(le({type:A.IncrementalSnapshot,data:Object.assign({source:E.AdoptedStyleSheet},O)})),W=new Zt({mutationCb:C,adoptedStyleSheetCb:M}),j=new Gt({mirror:Ce,mutationCb:C,stylesheetManager:W,recordCrossOriginIframes:R,wrappedEmit:oe});for(let O of Y||[])O.getMirror&&O.getMirror({nodeMirror:Ce,crossOriginIframeMirror:j.crossOriginIframeMirror,crossOriginIframeStyleMirror:j.crossOriginIframeStyleMirror});Gr=new Kt({recordCanvas:b,mutationCb:T,win:window,blockClass:i,blockSelector:o,mirror:Ce,sampling:g.canvas,dataURLOptions:m});let $=new Vt({mutationCb:C,scrollCb:S,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:l,inlineStylesheet:c,maskInputOptions:L,dataURLOptions:m,maskTextFn:p,maskInputFn:h,recordCanvas:b,inlineImages:w,sampling:g,slimDOMOptions:z,iframeManager:j,stylesheetManager:W,canvasManager:Gr,keepIframeSrcFn:H},mirror:Ce});jt=(O=!1)=>{var re,ne,Q,fe,V,ue;oe(le({type:A.Meta,data:{href:window.location.href,width:pt(),height:ht()}}),O),W.reset(),Ue.forEach(ae=>ae.lock());let lt=ti(document,{mirror:Ce,blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:l,inlineStylesheet:c,maskAllInputs:L,maskTextFn:p,slimDOM:z,dataURLOptions:m,recordCanvas:b,inlineImages:w,onSerialize:ae=>{ke(ae,Ce)&&j.addIframe(ae),vt(ae,Ce)&&W.trackLinkElement(ae),Ae(ae)&&$.addShadowRoot(ae.shadowRoot,document)},onIframeLoad:(ae,lr)=>{j.attachIframe(ae,lr),$.observeAttachShadow(ae)},onStylesheetLoad:(ae,lr)=>{W.attachLinkElement(ae,lr)},keepIframeSrcFn:H});if(!lt)return console.warn("Failed to snapshot the document");oe(le({type:A.FullSnapshot,data:{node:lt,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((ne=(re=document?.body)===null||re===void 0?void 0:re.parentElement)===null||ne===void 0?void 0:ne.scrollLeft)||((Q=document?.body)===null||Q===void 0?void 0:Q.scrollLeft)||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((V=(fe=document?.body)===null||fe===void 0?void 0:fe.parentElement)===null||V===void 0?void 0:V.scrollTop)||((ue=document?.body)===null||ue===void 0?void 0:ue.scrollTop)||0}}})),Ue.forEach(ae=>ae.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&W.adoptStyleSheets(document.adoptedStyleSheets,Ce.getId(document))};try{let O=[];O.push(ce("DOMContentLoaded",()=>{oe(le({type:A.DomContentLoaded,data:{}}))}));let re=Q=>{var fe;return vi({mutationCb:C,mousemoveCb:(V,ue)=>oe(le({type:A.IncrementalSnapshot,data:{source:ue,positions:V}})),mouseInteractionCb:V=>oe(le({type:A.IncrementalSnapshot,data:Object.assign({source:E.MouseInteraction},V)})),scrollCb:S,viewportResizeCb:V=>oe(le({type:A.IncrementalSnapshot,data:Object.assign({source:E.ViewportResize},V)})),inputCb:V=>oe(le({type:A.IncrementalSnapshot,data:Object.assign({source:E.Input},V)})),mediaInteractionCb:V=>oe(le({type:A.IncrementalSnapshot,data:Object.assign({source:E.MediaInteraction},V)})),styleSheetRuleCb:V=>oe(le({type:A.IncrementalSnapshot,data:Object.assign({source:E.StyleSheetRule},V)})),styleDeclarationCb:V=>oe(le({type:A.IncrementalSnapshot,data:Object.assign({source:E.StyleDeclaration},V)})),canvasMutationCb:T,fontCb:V=>oe(le({type:A.IncrementalSnapshot,data:Object.assign({source:E.Font},V)})),selectionCb:V=>{oe(le({type:A.IncrementalSnapshot,data:Object.assign({source:E.Selection},V)}))},blockClass:i,ignoreClass:s,maskTextClass:a,maskTextSelector:l,maskInputOptions:L,inlineStylesheet:c,sampling:g,recordCanvas:b,inlineImages:w,userTriggeredOnInput:N,collectFonts:_,doc:Q,maskInputFn:h,maskTextFn:p,keepIframeSrcFn:H,blockSelector:o,slimDOMOptions:z,dataURLOptions:m,mirror:Ce,iframeManager:j,stylesheetManager:W,shadowDomManager:$,canvasManager:Gr,ignoreCSSAttributes:q,plugins:((fe=Y?.filter(V=>V.observer))===null||fe===void 0?void 0:fe.map(V=>({observer:V.observer,options:V.options,callback:ue=>oe(le({type:A.Plugin,data:{plugin:V.name,payload:ue}}))})))||[]},v)};j.addLoadListener(Q=>{O.push(re(Q.contentDocument))});let ne=()=>{jt(),O.push(re(document)),Yt=!0};return document.readyState==="interactive"||document.readyState==="complete"?ne():O.push(ce("load",()=>{oe(le({type:A.Load,data:{}})),ne()},window)),()=>{O.forEach(Q=>Q()),Yt=!1}}catch(O){console.warn(O)}}var oe,jt,Gr,Yt,Ce,Vr=D(()=>{"use strict";xe();Lr();me();ve();Ii();Si();zi();Ki();Yt=!1,Ce=Ot();De.addCustomEvent=(e,t)=>{if(!Yt)throw new Error("please add custom event after start recording");oe(le({type:A.Custom,data:{tag:e,payload:t}}))};De.freezePage=()=>{Ue.forEach(e=>e.freeze())};De.takeFullSnapshot=e=>{if(!Yt)throw new Error("please take full snapshot after start recording");jt(e)};De.mirror=Ce});function Sa(){return new Ia}function Ca(e){let t={},r=/;(?![^(]*\))/g,n=/:(.+)/,i=/\/\*.*?\*\//g;return e.replace(i,"").split(r).forEach(function(o){if(o){let s=o.split(n);s.length>1&&(t[Hr(s[0].trim())]=s[1].trim())}}),t}function Zi(e){let t=[];for(let r in e){let n=e[r];if(typeof n!="string")continue;let i=Aa(r);t.push(`${i}: ${n};`)}return t.join(" ")}function Na(e){return class Yi extends e{constructor(){super(...arguments),this.nodeType=te.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=P.Document,this.textContent=null}get documentElement(){return this.childNodes.find(r=>r.RRNodeType===P.Element&&r.tagName==="HTML")||null}get body(){var r;return((r=this.documentElement)===null||r===void 0?void 0:r.childNodes.find(n=>n.RRNodeType===P.Element&&n.tagName==="BODY"))||null}get head(){var r;return((r=this.documentElement)===null||r===void 0?void 0:r.childNodes.find(n=>n.RRNodeType===P.Element&&n.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(r){let n=r.RRNodeType;if((n===P.Element||n===P.DocumentType)&&this.childNodes.some(i=>i.RRNodeType===n))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${n===P.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);return r.parentElement=null,r.parentNode=this,this.childNodes.push(r),r}insertBefore(r,n){let i=r.RRNodeType;if((i===P.Element||i===P.DocumentType)&&this.childNodes.some(s=>s.RRNodeType===i))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${i===P.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);if(n===null)return this.appendChild(r);let o=this.childNodes.indexOf(n);if(o==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(o,0,r),r.parentElement=null,r.parentNode=this,r}removeChild(r){let n=this.childNodes.indexOf(r);if(n===-1)throw new Error("Failed to execute 'removeChild' on 'RRDocument': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(n,1),r.parentElement=null,r.parentNode=null,r}open(){this.childNodes=[]}close(){}write(r){let n;if(r==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?n="-//W3C//DTD XHTML 1.0 Transitional//EN":r==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(n="-//W3C//DTD HTML 4.0 Transitional//EN"),n){let i=this.createDocumentType("html",n,"");this.open(),this.appendChild(i)}}createDocument(r,n,i){return new Yi}createDocumentType(r,n,i){let o=new(Xi(Ie))(r,n,i);return o.ownerDocument=this,o}createElement(r){let n=new(Ji(Ie))(r);return n.ownerDocument=this,n}createElementNS(r,n){return this.createElement(n)}createTextNode(r){let n=new(Qi(Ie))(r);return n.ownerDocument=this,n}createComment(r){let n=new(qi(Ie))(r);return n.ownerDocument=this,n}createCDATASection(r){let n=new($i(Ie))(r);return n.ownerDocument=this,n}toString(){return"RRDocument"}}}function Xi(e){return class extends e{constructor(r,n,i){super(),this.nodeType=te.DOCUMENT_TYPE_NODE,this.RRNodeType=P.DocumentType,this.textContent=null,this.name=r,this.publicId=n,this.systemId=i,this.nodeName=r}toString(){return"RRDocumentType"}}}function Ji(e){return class extends e{constructor(r){super(),this.nodeType=te.ELEMENT_NODE,this.RRNodeType=P.Element,this.attributes={},this.shadowRoot=null,this.tagName=r.toUpperCase(),this.nodeName=r.toUpperCase()}get textContent(){let r="";return this.childNodes.forEach(n=>r+=n.textContent),r}set textContent(r){this.childNodes=[this.ownerDocument.createTextNode(r)]}get classList(){return new zr(this.attributes.class,r=>{this.attributes.class=r})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){let r=this.attributes.style?Ca(this.attributes.style):{},n=/\B([A-Z])/g;return r.setProperty=(i,o,s)=>{if(n.test(i))return;let a=Hr(i);o?r[a]=o:delete r[a],s==="important"&&(r[a]+=" !important"),this.attributes.style=Zi(r)},r.removeProperty=i=>{if(n.test(i))return"";let o=Hr(i),s=r[o]||"";return delete r[o],this.attributes.style=Zi(r),s},r}getAttribute(r){return this.attributes[r]||null}setAttribute(r,n){this.attributes[r]=n}setAttributeNS(r,n,i){this.setAttribute(n,i)}removeAttribute(r){delete this.attributes[r]}appendChild(r){return this.childNodes.push(r),r.parentNode=this,r.parentElement=this,r}insertBefore(r,n){if(n===null)return this.appendChild(r);let i=this.childNodes.indexOf(n);if(i==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(i,0,r),r.parentElement=this,r.parentNode=this,r}removeChild(r){let n=this.childNodes.indexOf(r);if(n===-1)throw new Error("Failed to execute 'removeChild' on 'RRElement': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(n,1),r.parentElement=null,r.parentNode=null,r}attachShadow(r){let n=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=n,n}dispatchEvent(r){return!0}toString(){let r="";for(let n in this.attributes)r+=`${n}="${this.attributes[n]}" `;return`${this.tagName} ${r}`}}}function Ta(e){return class extends e{attachShadow(r){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}}function Qi(e){return class extends e{constructor(r){super(),this.nodeType=te.TEXT_NODE,this.nodeName="#text",this.RRNodeType=P.Text,this.data=r}get textContent(){return this.data}set textContent(r){this.data=r}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function qi(e){return class extends e{constructor(r){super(),this.nodeType=te.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=P.Comment,this.data=r}get textContent(){return this.data}set textContent(r){this.data=r}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function $i(e){return class extends e{constructor(r){super(),this.nodeName="#cdata-section",this.nodeType=te.CDATA_SECTION_NODE,this.RRNodeType=P.CDATA,this.data=r}get textContent(){return this.data}set textContent(r){this.data=r}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}function be(e,t,r,n){let i=e.childNodes,o=t.childNodes;n=n||t.mirror||t.ownerDocument.mirror,(i.length>0||o.length>0)&&ji(Array.from(i),o,e,r,n);let s=null,a=null;switch(t.RRNodeType){case P.Document:{a=t.scrollData;break}case P.Element:{let l=e,c=t;switch(Ra(l,c,n),a=c.scrollData,s=c.inputData,c.tagName){case"AUDIO":case"VIDEO":{let u=e,d=c;d.paused!==void 0&&(d.paused?u.pause():u.play()),d.muted!==void 0&&(u.muted=d.muted),d.volume!==void 0&&(u.volume=d.volume),d.currentTime!==void 0&&(u.currentTime=d.currentTime),d.playbackRate!==void 0&&(u.playbackRate=d.playbackRate);break}case"CANVAS":{let u=t;if(u.rr_dataURL!==null){let d=document.createElement("img");d.onload=()=>{let f=l.getContext("2d");f&&f.drawImage(d,0,0,d.width,d.height)},d.src=u.rr_dataURL}u.canvasMutations.forEach(d=>r.applyCanvas(d.event,d.mutation,e))}break;case"STYLE":{let u=l.sheet;u&&t.rules.forEach(d=>r.applyStyleSheetMutation(d,u))}break}if(c.shadowRoot){l.shadowRoot||l.attachShadow({mode:"open"});let u=l.shadowRoot.childNodes,d=c.shadowRoot.childNodes;(u.length>0||d.length>0)&&ji(Array.from(u),d,l.shadowRoot,r,n)}break}case P.Text:case P.Comment:case P.CDATA:e.textContent!==t.data&&(e.textContent=t.data);break}if(a&&r.applyScroll(a,!0),s&&r.applyInput(s),t.nodeName==="IFRAME"){let l=e.contentDocument,c=t;if(l){let u=n.getMeta(c.contentDocument);u&&r.mirror.add(l,Object.assign({},u)),be(l,c.contentDocument,r,n)}}}function Ra(e,t,r){let n=e.attributes,i=t.attributes;for(let o in i){let s=i[o],a=r.getMeta(t);if(a&&"isSVG"in a&&a.isSVG&&Kr[o])e.setAttributeNS(Kr[o],o,s);else if(t.tagName==="CANVAS"&&o==="rr_dataURL"){let l=document.createElement("img");l.src=s,l.onload=()=>{let c=e.getContext("2d");c&&c.drawImage(l,0,0,l.width,l.height)}}else e.setAttribute(o,s)}for(let{name:o}of Array.from(n))o in i||e.removeAttribute(o);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function ji(e,t,r,n,i){var o;let s=0,a=e.length-1,l=0,c=t.length-1,u=e[s],d=e[a],f=t[l],h=t[c],p,v;for(;s<=a&&l<=c;){let I=n.mirror.getId(u),g=n.mirror.getId(d),m=i.getId(f),y=i.getId(h);if(u===void 0)u=e[++s];else if(d===void 0)d=e[--a];else if(I!==-1&&I===m)be(u,f,n,i),u=e[++s],f=t[++l];else if(g!==-1&&g===y)be(d,h,n,i),d=e[--a],h=t[--c];else if(I!==-1&&I===y)r.insertBefore(u,d.nextSibling),be(u,h,n,i),u=e[++s],h=t[--c];else if(g!==-1&&g===m)r.insertBefore(d,u),be(d,f,n,i),d=e[--a],f=t[++l];else{if(!p){p={};for(let b=s;b<=a;b++){let R=e[b];R&&n.mirror.hasNode(R)&&(p[n.mirror.getId(R)]=b)}}if(v=p[i.getId(f)],v){let b=e[v];r.insertBefore(b,u),be(b,f,n,i),e[v]=void 0}else{let b=Xt(f,n.mirror,i);r.nodeName==="#document"&&((o=n.mirror.getMeta(b))===null||o===void 0?void 0:o.type)===P.Element&&r.documentElement&&(r.removeChild(r.documentElement),e[s]=void 0,u=void 0),r.insertBefore(b,u||null),be(b,f,n,i)}f=t[++l]}}if(s>a){let I=t[c+1],g=null;for(I&&r.childNodes.forEach(m=>{n.mirror.getId(m)===i.getId(I)&&(g=m)});l<=c;++l){let m=Xt(t[l],n.mirror,i);r.insertBefore(m,g),be(m,t[l],n,i)}}else if(l>c)for(;s<=a;s++){let I=e[s];I&&(r.removeChild(I),n.mirror.removeNodeFromMap(I))}}function Xt(e,t,r){let n=r.getId(e),i=r.getMeta(e),o=null;if(n>-1&&(o=t.getNode(n)),o!==null)return o;switch(e.RRNodeType){case P.Document:o=new Document;break;case P.DocumentType:o=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case P.Element:{let s=e.tagName.toLowerCase();s=Ma[s]||s,i&&"isSVG"in i&&i?.isSVG?o=document.createElementNS(Kr.svg,s):o=document.createElement(e.tagName);break}case P.Text:o=document.createTextNode(e.data);break;case P.Comment:o=document.createComment(e.data);break;case P.CDATA:o=document.createCDATASection(e.data);break}return i&&t.add(o,Object.assign({},i)),o}function _a(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function Qr(e,t,r,n){let i;switch(e.nodeType){case te.DOCUMENT_NODE:n&&n.nodeName==="IFRAME"?i=n.contentDocument:(i=t,i.compatMode=e.compatMode);break;case te.DOCUMENT_TYPE_NODE:{let s=e;i=t.createDocumentType(s.name,s.publicId,s.systemId);break}case te.ELEMENT_NODE:{let s=e,a=_a(s);i=t.createElement(a);let l=i;for(let{name:c,value:u}of Array.from(s.attributes))l.attributes[c]=u;s.scrollLeft&&(l.scrollLeft=s.scrollLeft),s.scrollTop&&(l.scrollTop=s.scrollTop);break}case te.TEXT_NODE:i=t.createTextNode(e.textContent||"");break;case te.CDATA_SECTION_NODE:i=t.createCDATASection(e.data);break;case te.COMMENT_NODE:i=t.createComment(e.textContent||"");break;case te.DOCUMENT_FRAGMENT_NODE:i=n.attachShadow({mode:"open"});break;default:return null}let o=r.getMeta(e);return t instanceof Je&&(o||(o=qr(i,t.unserializedId),r.add(e,o)),t.mirror.add(i,Object.assign({},o))),i}function eo(e,t=Sa(),r=new Je){function n(i,o){let s=Qr(i,r,t,o);if(s!==null)if(o?.nodeName!=="IFRAME"&&i.nodeType!==te.DOCUMENT_FRAGMENT_NODE&&(o?.appendChild(s),s.parentNode=o,s.parentElement=o),i.nodeName==="IFRAME"){let a=i.contentDocument;a&&n(a,s)}else(i.nodeType===te.DOCUMENT_NODE||i.nodeType===te.ELEMENT_NODE||i.nodeType===te.DOCUMENT_FRAGMENT_NODE)&&(i.nodeType===te.ELEMENT_NODE&&i.shadowRoot&&n(i.shadowRoot,s),i.childNodes.forEach(a=>n(a,s)))}return n(e,null),r}function La(){return new Jr}function qr(e,t){switch(e.RRNodeType){case P.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case P.DocumentType:{let r=e;return{id:t,type:e.RRNodeType,name:r.name,publicId:r.publicId,systemId:r.systemId}}case P.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case P.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case P.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case P.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}var P,Ia,ba,wa,Hr,Ea,Aa,Ie,zr,te,Kr,Ma,Je,xa,Qe,Zr,jr,Yr,Xr,ka,Da,Oa,Jr,to=D(()=>{"use strict";(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(P||(P={}));Ia=(function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var r;if(!t)return-1;var n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var r=this,n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(function(i){return r.removeNodeFromMap(i)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){var n=this.getNode(t);if(n){var i=this.nodeMetaMap.get(n);i&&this.nodeMetaMap.set(r,i)}this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e})();ba=/-([a-z])/g,wa=/^--[a-zA-Z0-9-]+$/,Hr=e=>wa.test(e)?e:e.replace(ba,(t,r)=>r?r.toUpperCase():""),Ea=/\B([A-Z])/g,Aa=e=>e.replace(Ea,"-$1").toLowerCase(),Ie=class{constructor(...t){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=te.ELEMENT_NODE,this.TEXT_NODE=te.TEXT_NODE}get firstChild(){return this.childNodes[0]||null}get lastChild(){return this.childNodes[this.childNodes.length-1]||null}get nextSibling(){let t=this.parentNode;if(!t)return null;let r=t.childNodes,n=r.indexOf(this);return r[n+1]||null}contains(t){if(t===this)return!0;for(let r of this.childNodes)if(r.contains(t))return!0;return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,r){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};zr=class{constructor(t,r){if(this.classes=[],this.add=(...n)=>{for(let i of n){let o=String(i);this.classes.indexOf(o)>=0||this.classes.push(o)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...n)=>{this.classes=this.classes.filter(i=>n.indexOf(i)===-1),this.onChange&&this.onChange(this.classes.join(" "))},t){let n=t.trim().split(/\s+/);this.classes.push(...n)}this.onChange=r}};(function(e){e[e.PLACEHOLDER=0]="PLACEHOLDER",e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"})(te||(te={}));Kr={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},Ma={altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};Je=class e extends Na(Ie){constructor(t){super(),this.UNSERIALIZED_STARTING_ID=-2,this._unserializedId=this.UNSERIALIZED_STARTING_ID,this.mirror=La(),this.scrollData=null,t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,r,n){return new e}createDocumentType(t,r,n){let i=new xa(t,r,n);return i.ownerDocument=this,i}createElement(t){let r=t.toUpperCase(),n;switch(r){case"AUDIO":case"VIDEO":n=new Zr(r);break;case"IFRAME":n=new Xr(r,this.mirror);break;case"CANVAS":n=new jr(r);break;case"STYLE":n=new Yr(r);break;default:n=new Qe(r);break}return n.ownerDocument=this,n}createComment(t){let r=new Da(t);return r.ownerDocument=this,r}createCDATASection(t){let r=new Oa(t);return r.ownerDocument=this,r}createTextNode(t){let r=new ka(t);return r.ownerDocument=this,r}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}},xa=Xi(Ie),Qe=class extends Ji(Ie){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}},Zr=class extends Ta(Qe){},jr=class extends Qe{constructor(){super(...arguments),this.rr_dataURL=null,this.canvasMutations=[]}getContext(){return null}},Yr=class extends Qe{constructor(){super(...arguments),this.rules=[]}},Xr=class extends Qe{constructor(t,r){super(t),this.contentDocument=new Je,this.contentDocument.mirror=r}},ka=Qi(Ie),Da=qi(Ie),Oa=$i(Ie);Jr=class{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){var r;if(!t)return-1;let n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){let r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){let n=this.getNode(t);if(n){let i=this.nodeMetaMap.get(n);i&&this.nodeMetaMap.set(r,i)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}});var ro,no,io=D(()=>{"use strict";Vr();({addCustomEvent:ro}=De),{freezePage:no}=De});function ho(e,t){t===void 0&&(t={});var r=Ka();r.p(e);var n=Za(e,t,2,4);return Ya(n,t),ja(n,n.length-4,r.d()),n}function po(e,t){return Ga((Xa(e),e.subarray(2,-4)),t)}function $t(e,t){var r=e.length;if(!t&&typeof TextEncoder<"u")return new TextEncoder().encode(e);for(var n=new de(e.length+(e.length>>>1)),i=0,o=function(c){n[i++]=c},s=0;s<r;++s){if(i+5>n.length){var a=new de(i+8+(r-s<<1));a.set(n),n=a}var l=e.charCodeAt(s);l<128||t?o(l):l<2048?(o(192|l>>>6),o(128|l&63)):l>55295&&l<57344?(l=65536+(l&1047552)|e.charCodeAt(++s)&1023,o(240|l>>>18),o(128|l>>>12&63),o(128|l>>>6&63),o(128|l&63)):(o(224|l>>>12),o(128|l>>>6&63),o(128|l&63))}return ln(n,0,i)}function er(e,t){var r="";if(!t&&typeof TextDecoder<"u")return new TextDecoder().decode(e);for(var n=0;n<e.length;){var i=e[n++];i<128||t?r+=String.fromCharCode(i):i<224?r+=String.fromCharCode((i&31)<<6|e[n++]&63):i<240?r+=String.fromCharCode((i&15)<<12|(e[n++]&63)<<6|e[n++]&63):(i=((i&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,r+=String.fromCharCode(55296|i>>10,56320|i&1023))}return r}var de,he,Et,Qt,qt,rn,lo,co,uo,nn,fo,Fa,oo,on,Oe,Z,Ne,We,Z,Z,Z,Z,At,Z,Ba,Ua,Wa,Pa,$r,we,en,an,ln,Ga,_e,bt,tn,sn,so,wt,Jt,ao,Va,Ha,za,Ka,Za,ja,Ya,Xa,cn=D(()=>{"use strict";de=Uint8Array,he=Uint16Array,Et=Uint32Array,Qt=new de([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),qt=new de([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),rn=new de([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),lo=function(e,t){for(var r=new he(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var i=new Et(r[30]),n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)i[o]=o-r[n]<<5|n;return[r,i]},co=lo(Qt,2),uo=co[0],nn=co[1];uo[28]=258,nn[258]=28;fo=lo(qt,0),Fa=fo[0],oo=fo[1],on=new he(32768);for(Z=0;Z<32768;++Z)Oe=(Z&43690)>>>1|(Z&21845)<<1,Oe=(Oe&52428)>>>2|(Oe&13107)<<2,Oe=(Oe&61680)>>>4|(Oe&3855)<<4,on[Z]=((Oe&65280)>>>8|(Oe&255)<<8)>>>1;Ne=(function(e,t,r){for(var n=e.length,i=0,o=new he(t);i<n;++i)++o[e[i]-1];var s=new he(t);for(i=0;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(r){a=new he(1<<t);var l=15-t;for(i=0;i<n;++i)if(e[i])for(var c=i<<4|e[i],u=t-e[i],d=s[e[i]-1]++<<u,f=d|(1<<u)-1;d<=f;++d)a[on[d]>>>l]=c}else for(a=new he(n),i=0;i<n;++i)a[i]=on[s[e[i]-1]++]>>>15-e[i];return a}),We=new de(288);for(Z=0;Z<144;++Z)We[Z]=8;for(Z=144;Z<256;++Z)We[Z]=9;for(Z=256;Z<280;++Z)We[Z]=7;for(Z=280;Z<288;++Z)We[Z]=8;At=new de(32);for(Z=0;Z<32;++Z)At[Z]=5;Ba=Ne(We,9,0),Ua=Ne(We,9,1),Wa=Ne(At,5,0),Pa=Ne(At,5,1),$r=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},we=function(e,t,r){var n=t/8>>0;return(e[n]|e[n+1]<<8)>>>(t&7)&r},en=function(e,t){var r=t/8>>0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>>(t&7)},an=function(e){return(e/8>>0)+(e&7&&1)},ln=function(e,t,r){(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length);var n=new(e instanceof he?he:e instanceof Et?Et:de)(r-t);return n.set(e.subarray(t,r)),n},Ga=function(e,t,r){var n=e.length,i=!t||r,o=!r||r.i;r||(r={}),t||(t=new de(n*3));var s=function(O){var re=t.length;if(O>re){var ne=new de(Math.max(re*2,O));ne.set(t),t=ne}},a=r.f||0,l=r.p||0,c=r.b||0,u=r.l,d=r.d,f=r.m,h=r.n,p=n*8;do{if(!u){r.f=a=we(e,l,1);var v=we(e,l+1,3);if(l+=3,v)if(v==1)u=Ua,d=Pa,f=9,h=5;else if(v==2){var y=we(e,l,31)+257,b=we(e,l+10,15)+4,R=y+we(e,l+5,31)+1;l+=14;for(var N=new de(R),_=new de(19),w=0;w<b;++w)_[rn[w]]=we(e,l+w*3,7);l+=b*3;var Y=$r(_),H=(1<<Y)-1;if(!o&&l+R*(Y+7)>p)break;for(var q=Ne(_,Y,1),w=0;w<R;){var U=q[we(e,l,H)];l+=U&15;var I=U>>>4;if(I<16)N[w++]=I;else{var K=0,L=0;for(I==16?(L=3+we(e,l,3),l+=2,K=N[w-1]):I==17?(L=3+we(e,l,7),l+=3):I==18&&(L=11+we(e,l,127),l+=7);L--;)N[w++]=K}}var z=N.subarray(0,y),F=N.subarray(y);f=$r(z),h=$r(F),u=Ne(z,f,1),d=Ne(F,h,1)}else throw"invalid block type";else{var I=an(l)+4,g=e[I-4]|e[I-3]<<8,m=I+g;if(m>n){if(o)throw"unexpected EOF";break}i&&s(c+g),t.set(e.subarray(I,m),c),r.b=c+=g,r.p=l=m*8;continue}if(l>p)throw"unexpected EOF"}i&&s(c+131072);for(var k=(1<<f)-1,X=(1<<h)-1,C=f+h+18;o||l+C<p;){var K=u[en(e,l)&k],S=K>>>4;if(l+=K&15,l>p)throw"unexpected EOF";if(!K)throw"invalid length/literal";if(S<256)t[c++]=S;else if(S==256){u=null;break}else{var T=S-254;if(S>264){var w=S-257,M=Qt[w];T=we(e,l,(1<<M)-1)+uo[w],l+=M}var W=d[en(e,l)&X],j=W>>>4;if(!W)throw"invalid distance";l+=W&15;var F=Fa[j];if(j>3){var M=qt[j];F+=en(e,l)&(1<<M)-1,l+=M}if(l>p)throw"unexpected EOF";i&&s(c+131072);for(var $=c+T;c<$;c+=4)t[c]=t[c-F],t[c+1]=t[c+1-F],t[c+2]=t[c+2-F],t[c+3]=t[c+3-F];c=$}}r.l=u,r.p=l,r.b=c,u&&(a=1,r.m=f,r.d=d,r.n=h)}while(!a);return c==t.length?t:ln(t,0,c)},_e=function(e,t,r){r<<=t&7;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8},bt=function(e,t,r){r<<=t&7;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},tn=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var i=r.length,o=r.slice();if(!i)return[new de(0),0];if(i==1){var s=new de(r[0].s+1);return s[r[0].s]=1,[s,1]}r.sort(function(R,N){return R.f-N.f}),r.push({s:-1,f:25001});var a=r[0],l=r[1],c=0,u=1,d=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=i-1;)a=r[r[c].f<r[d].f?c++:d++],l=r[c!=u&&r[c].f<r[d].f?c++:d++],r[u++]={s:-1,f:a.f+l.f,l:a,r:l};for(var f=o[0].s,n=1;n<i;++n)o[n].s>f&&(f=o[n].s);var h=new he(f+1),p=sn(r[u-1],h,0);if(p>t){var n=0,v=0,I=p-t,g=1<<I;for(o.sort(function(N,_){return h[_.s]-h[N.s]||N.f-_.f});n<i;++n){var m=o[n].s;if(h[m]>t)v+=g-(1<<p-h[m]),h[m]=t;else break}for(v>>>=I;v>0;){var y=o[n].s;h[y]<t?v-=1<<t-h[y]++-1:++n}for(;n>=0&&v;--n){var b=o[n].s;h[b]==t&&(--h[b],++v)}p=t}return[new de(h),p]},sn=function(e,t,r){return e.s==-1?Math.max(sn(e.l,t,r+1),sn(e.r,t,r+1)):t[e.s]=r},so=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new he(++t),n=0,i=e[0],o=1,s=function(l){r[n++]=l},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return[r.subarray(0,n),t]},wt=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},Jt=function(e,t,r){var n=r.length,i=an(t+2);e[i]=n&255,e[i+1]=n>>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var o=0;o<n;++o)e[i+o+4]=r[o];return(i+4+n)*8},ao=function(e,t,r,n,i,o,s,a,l,c,u){_e(t,u++,r),++i[256];for(var d=tn(i,15),f=d[0],h=d[1],p=tn(o,15),v=p[0],I=p[1],g=so(f),m=g[0],y=g[1],b=so(v),R=b[0],N=b[1],_=new he(19),w=0;w<m.length;++w)_[m[w]&31]++;for(var w=0;w<R.length;++w)_[R[w]&31]++;for(var Y=tn(_,7),H=Y[0],q=Y[1],U=19;U>4&&!H[rn[U-1]];--U);var K=c+5<<3,L=wt(i,We)+wt(o,At)+s,z=wt(i,f)+wt(o,v)+s+14+3*U+wt(_,H)+(2*_[16]+3*_[17]+7*_[18]);if(K<=L&&K<=z)return Jt(t,u,e.subarray(l,l+c));var F,k,X,C;if(_e(t,u,1+(z<L)),u+=2,z<L){F=Ne(f,h,0),k=f,X=Ne(v,I,0),C=v;var S=Ne(H,q,0);_e(t,u,y-257),_e(t,u+5,N-1),_e(t,u+10,U-4),u+=14;for(var w=0;w<U;++w)_e(t,u+3*w,H[rn[w]]);u+=3*U;for(var T=[m,R],M=0;M<2;++M)for(var W=T[M],w=0;w<W.length;++w){var j=W[w]&31;_e(t,u,S[j]),u+=H[j],j>15&&(_e(t,u,W[w]>>>5&127),u+=W[w]>>>12)}}else F=Ba,k=We,X=Wa,C=At;for(var w=0;w<a;++w)if(n[w]>255){var j=n[w]>>>18&31;bt(t,u,F[j+257]),u+=k[j+257],j>7&&(_e(t,u,n[w]>>>23&31),u+=Qt[j]);var $=n[w]&31;bt(t,u,X[$]),u+=C[$],$>3&&(bt(t,u,n[w]>>>5&8191),u+=qt[$])}else bt(t,u,F[n[w]]),u+=k[n[w]];return bt(t,u,F[256]),u+k[256]},Va=new Et([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ha=new de(0),za=function(e,t,r,n,i,o){var s=e.length,a=new de(n+s+5*(1+Math.floor(s/7e3))+i),l=a.subarray(n,a.length-i),c=0;if(!t||s<8)for(var u=0;u<=s;u+=65535){var d=u+65535;d<s?c=Jt(l,c,e.subarray(u,d)):(l[u]=o,c=Jt(l,c,e.subarray(u,s)))}else{for(var f=Va[t-1],h=f>>>13,p=f&8191,v=(1<<r)-1,I=new he(32768),g=new he(v+1),m=Math.ceil(r/3),y=2*m,b=function(ae){return(e[ae]^e[ae+1]<<m^e[ae+2]<<y)&v},R=new Et(25e3),N=new he(288),_=new he(32),w=0,Y=0,u=0,H=0,q=0,U=0;u<s;++u){var K=b(u),L=u&32767,z=g[K];if(I[L]=z,g[K]=L,q<=u){var F=s-u;if((w>7e3||H>24576)&&F>423){c=ao(e,l,0,R,N,_,Y,H,U,u-U,c),H=w=Y=0,U=u;for(var k=0;k<286;++k)N[k]=0;for(var k=0;k<30;++k)_[k]=0}var X=2,C=0,S=p,T=L-z&32767;if(F>2&&K==b(u-T))for(var M=Math.min(h,F)-1,W=Math.min(32767,u),j=Math.min(258,F);T<=W&&--S&&L!=z;){if(e[u+X]==e[u+X-T]){for(var $=0;$<j&&e[u+$]==e[u+$-T];++$);if($>X){if(X=$,C=T,$>M)break;for(var O=Math.min(T,$-2),re=0,k=0;k<O;++k){var ne=u-T+k+32768&32767,Q=I[ne],fe=ne-Q+32768&32767;fe>re&&(re=fe,z=ne)}}}L=z,z=I[L],T+=L-z+32768&32767}if(C){R[H++]=268435456|nn[X]<<18|oo[C];var V=nn[X]&31,ue=oo[C]&31;Y+=Qt[V]+qt[ue],++N[257+V],++_[ue],q=u+X,++w}else R[H++]=e[u],++N[e[u]]}}c=ao(e,l,o,R,N,_,Y,H,U,u-U,c),o||(c=Jt(l,c,Ha))}return ln(a,0,n+an(c)+i)},Ka=function(){var e=1,t=0;return{p:function(r){for(var n=e,i=t,o=r.length,s=0;s!=o;){for(var a=Math.min(s+5552,o);s<a;++s)n+=r[s],i+=n;n%=65521,i%=65521}e=n,t=i},d:function(){return(e>>>8<<16|(t&255)<<8|t>>>8)+((e&255)<<23)*2}}},Za=function(e,t,r,n,i){return za(e,t.level==null?6:t.level,t.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):12+t.mem,r,n,!i)},ja=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},Ya=function(e,t){var r=t.level,n=r==0?0:r<6?1:r==9?3:2;e[0]=120,e[1]=n<<6|(n?32-2*n:1)},Xa=function(e){if((e[0]&15)!=8||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(e[1]&32)throw"invalid zlib data: preset dictionaries not supported"}});var go,vo=D(()=>{"use strict";cn();go=e=>{let t=Object.assign(Object.assign({},e),{v:"v1"});return er(ho($t(JSON.stringify(t))),!0)}});var yo,Io=D(()=>{"use strict";cn();yo=e=>{if(typeof e!="string")return e;try{let t=JSON.parse(e);if(t.timestamp)return t}catch{}try{let t=JSON.parse(er(po($t(e,!0))));if(t.v==="v1")return t;throw new Error(`These events were packed with packer ${t.v} which is incompatible with current packer ${"v1"}.`)}catch(t){throw console.error(t),new Error("Unknown data format.")}}});var Pe,Ja,So,Qa,un,Co=D(()=>{"use strict";Pe=class{constructor(t){this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){let t=this.lineNumber||"",r=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${t}:${r})`:`${this.fileName}:${t}:${r}`}},Ja=/(^|@)\S+:\d+/,So=/^\s*at .*(\S+:\d+|\(native\))/m,Qa=/^(eval@)?(\[native code])?$/,un={parse:function(e){if(!e)return[];if(typeof e.stacktrace<"u"||typeof e["opera#sourceloc"]<"u")return this.parseOpera(e);if(e.stack&&e.stack.match(So))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(e.indexOf(":")===-1)return[e];let r=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!r)throw new Error(`Cannot parse given url: ${e}`);return[r[1],r[2]||void 0,r[3]||void 0]},parseV8OrIE:function(e){return e.stack.split(`
7
+ `,10)+1,a=o.substring(s)+(n?"//# sourceMappingURL="+n:""),l=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(l)}function Fi(e,t,r){var n;return function(o){return n=n||va(e,t,r),new Worker(n,o)}}var Bi=D(()=>{"use strict"});function Ui(){return ya}var ya,Wi=D(()=>{"use strict";ya=Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"});function Pi(e,t,r){return Ui()?_i(e,t,r):Fi(e,t,r)}var Gi=D(()=>{"use strict";Li();Bi();Wi()});var Vi,Hi=D(()=>{"use strict";Gi();Vi=Pi("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",null,!1)});var Kt,zi=D(()=>{"use strict";Xe();me();ve();Ti();Ri();ki();Hi();Kt=class{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(l,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(c)};let{sampling:r="all",win:n,blockClass:i,blockSelector:o,recordCanvas:s,dataURLOptions:a}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&r==="all"&&this.initCanvasMutationObserver(n,i,o),s&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,i,o,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,n,i,o){let s=Wr(r,n,i),a=new Map,l=new Vi;l.onmessage=p=>{let{id:v}=p.data;if(a.set(v,!1),!("base64"in p.data))return;let{base64:I,type:m,width:g,height:y}=p.data;this.mutationCb({id:v,type:ge["2D"],commands:[{property:"clearRect",args:[0,0,g,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:I}],type:m}]},0,0]}]})};let c=1e3/t,u=0,d,f=()=>{let p=[];return r.document.querySelectorAll("canvas").forEach(v=>{ee(v,n,i,!0)||p.push(v)}),p},h=p=>{if(u&&p-u<c){d=requestAnimationFrame(h);return}u=p,f().forEach(v=>ye(this,void 0,void 0,function*(){var I;let m=this.mirror.getId(v);if(a.get(m))return;if(a.set(m,!0),["webgl","webgl2"].includes(v.__context)){let y=v.getContext(v.__context);((I=y?.getContextAttributes())===null||I===void 0?void 0:I.preserveDrawingBuffer)===!1&&y?.clear(y.COLOR_BUFFER_BIT)}let g=yield createImageBitmap(v);l.postMessage({id:m,bitmap:g,width:v.width,height:v.height,dataURLOptions:o.dataURLOptions},[g])})),d=requestAnimationFrame(h)};d=requestAnimationFrame(h),this.resetObservers=()=>{s(),cancelAnimationFrame(d)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let i=Wr(t,r,n),o=Ni(this.processMutation.bind(this),t,r,n),s=xi(this.processMutation.bind(this),t,r,n,this.mirror);this.resetObservers=()=>{i(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{let n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;let i=n.map(s=>Ci(s,["type"])),{type:o}=n[0];this.mutationCb({id:r,type:o,commands:i}),this.pendingCanvasMutations.delete(t)}}});var Zt,Ki=D(()=>{"use strict";xe();me();Zt=class{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new Ze,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;let n={id:r,styleIds:[]},i=[];for(let o of t){let s;if(this.styleMirror.has(o))s=this.styleMirror.getId(o);else{s=this.styleMirror.add(o);let a=Array.from(o.rules||CSSRule);i.push({styleId:s,rules:a.map((l,c)=>({rule:Ir(l),index:c}))})}n.styleIds.push(s)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}});function le(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}function De(e={}){let{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:s="rr-ignore",maskTextClass:a="rr-mask",maskTextSelector:l=null,inlineStylesheet:c=!0,maskAllInputs:u,maskInputOptions:d,slimDOMOptions:f,maskInputFn:h,maskTextFn:p,hooks:v,packFn:I,sampling:m={},dataURLOptions:g={},mousemoveWait:y,recordCanvas:b=!1,recordCrossOriginIframes:M=!1,userTriggeredOnInput:N=!1,collectFonts:_=!1,inlineImages:w=!1,plugins:Y,keepIframeSrcFn:H=()=>!1,ignoreCSSAttributes:q=new Set([])}=e,U=M?window.parent===window:!0,K=!1;if(!U)try{window.parent.document,K=!1}catch{K=!0}if(U&&!t)throw new Error("emit function is required");y!==void 0&&m.mousemove===void 0&&(m.mousemove=y),Ce.reset();let L=u===!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}:d!==void 0?d:{password:!0},z=f===!0||f==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:f==="all",headMetaDescKeywords:f==="all"}:f||{};gt();let F,k=0,X=O=>{for(let re of Y||[])re.eventProcessor&&(O=re.eventProcessor(O));return I&&(O=I(O)),O};oe=(O,re)=>{var ne;if(!((ne=Ue[0])===null||ne===void 0)&&ne.isFrozen()&&O.type!==A.FullSnapshot&&!(O.type===A.IncrementalSnapshot&&O.data.source===E.Mutation)&&Ue.forEach(Q=>Q.unfreeze()),U)t?.(X(O),re);else if(K){let Q={type:"rrweb",event:X(O),isCheckout:re};window.parent.postMessage(Q,"*")}if(O.type===A.FullSnapshot)F=O,k=0;else if(O.type===A.IncrementalSnapshot){if(O.data.source===E.Mutation&&O.data.isAttachIframe)return;k++;let Q=n&&k>=n,fe=r&&O.timestamp-F.timestamp>r;(Q||fe)&&jt(!0)}};let C=O=>{oe(le({type:A.IncrementalSnapshot,data:Object.assign({source:E.Mutation},O)}))},S=O=>oe(le({type:A.IncrementalSnapshot,data:Object.assign({source:E.Scroll},O)})),T=O=>oe(le({type:A.IncrementalSnapshot,data:Object.assign({source:E.CanvasMutation},O)})),R=O=>oe(le({type:A.IncrementalSnapshot,data:Object.assign({source:E.AdoptedStyleSheet},O)})),W=new Zt({mutationCb:C,adoptedStyleSheetCb:R}),j=new Gt({mirror:Ce,mutationCb:C,stylesheetManager:W,recordCrossOriginIframes:M,wrappedEmit:oe});for(let O of Y||[])O.getMirror&&O.getMirror({nodeMirror:Ce,crossOriginIframeMirror:j.crossOriginIframeMirror,crossOriginIframeStyleMirror:j.crossOriginIframeStyleMirror});Gr=new Kt({recordCanvas:b,mutationCb:T,win:window,blockClass:i,blockSelector:o,mirror:Ce,sampling:m.canvas,dataURLOptions:g});let $=new Vt({mutationCb:C,scrollCb:S,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:l,inlineStylesheet:c,maskInputOptions:L,dataURLOptions:g,maskTextFn:p,maskInputFn:h,recordCanvas:b,inlineImages:w,sampling:m,slimDOMOptions:z,iframeManager:j,stylesheetManager:W,canvasManager:Gr,keepIframeSrcFn:H},mirror:Ce});jt=(O=!1)=>{var re,ne,Q,fe,V,ue;oe(le({type:A.Meta,data:{href:window.location.href,width:pt(),height:ht()}}),O),W.reset(),Ue.forEach(ae=>ae.lock());let lt=ti(document,{mirror:Ce,blockClass:i,blockSelector:o,maskTextClass:a,maskTextSelector:l,inlineStylesheet:c,maskAllInputs:L,maskTextFn:p,slimDOM:z,dataURLOptions:g,recordCanvas:b,inlineImages:w,onSerialize:ae=>{ke(ae,Ce)&&j.addIframe(ae),vt(ae,Ce)&&W.trackLinkElement(ae),Ae(ae)&&$.addShadowRoot(ae.shadowRoot,document)},onIframeLoad:(ae,lr)=>{j.attachIframe(ae,lr),$.observeAttachShadow(ae)},onStylesheetLoad:(ae,lr)=>{W.attachLinkElement(ae,lr)},keepIframeSrcFn:H});if(!lt)return console.warn("Failed to snapshot the document");oe(le({type:A.FullSnapshot,data:{node:lt,initialOffset:{left:window.pageXOffset!==void 0?window.pageXOffset:document?.documentElement.scrollLeft||((ne=(re=document?.body)===null||re===void 0?void 0:re.parentElement)===null||ne===void 0?void 0:ne.scrollLeft)||((Q=document?.body)===null||Q===void 0?void 0:Q.scrollLeft)||0,top:window.pageYOffset!==void 0?window.pageYOffset:document?.documentElement.scrollTop||((V=(fe=document?.body)===null||fe===void 0?void 0:fe.parentElement)===null||V===void 0?void 0:V.scrollTop)||((ue=document?.body)===null||ue===void 0?void 0:ue.scrollTop)||0}}})),Ue.forEach(ae=>ae.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&W.adoptStyleSheets(document.adoptedStyleSheets,Ce.getId(document))};try{let O=[];O.push(ce("DOMContentLoaded",()=>{oe(le({type:A.DomContentLoaded,data:{}}))}));let re=Q=>{var fe;return vi({mutationCb:C,mousemoveCb:(V,ue)=>oe(le({type:A.IncrementalSnapshot,data:{source:ue,positions:V}})),mouseInteractionCb:V=>oe(le({type:A.IncrementalSnapshot,data:Object.assign({source:E.MouseInteraction},V)})),scrollCb:S,viewportResizeCb:V=>oe(le({type:A.IncrementalSnapshot,data:Object.assign({source:E.ViewportResize},V)})),inputCb:V=>oe(le({type:A.IncrementalSnapshot,data:Object.assign({source:E.Input},V)})),mediaInteractionCb:V=>oe(le({type:A.IncrementalSnapshot,data:Object.assign({source:E.MediaInteraction},V)})),styleSheetRuleCb:V=>oe(le({type:A.IncrementalSnapshot,data:Object.assign({source:E.StyleSheetRule},V)})),styleDeclarationCb:V=>oe(le({type:A.IncrementalSnapshot,data:Object.assign({source:E.StyleDeclaration},V)})),canvasMutationCb:T,fontCb:V=>oe(le({type:A.IncrementalSnapshot,data:Object.assign({source:E.Font},V)})),selectionCb:V=>{oe(le({type:A.IncrementalSnapshot,data:Object.assign({source:E.Selection},V)}))},blockClass:i,ignoreClass:s,maskTextClass:a,maskTextSelector:l,maskInputOptions:L,inlineStylesheet:c,sampling:m,recordCanvas:b,inlineImages:w,userTriggeredOnInput:N,collectFonts:_,doc:Q,maskInputFn:h,maskTextFn:p,keepIframeSrcFn:H,blockSelector:o,slimDOMOptions:z,dataURLOptions:g,mirror:Ce,iframeManager:j,stylesheetManager:W,shadowDomManager:$,canvasManager:Gr,ignoreCSSAttributes:q,plugins:((fe=Y?.filter(V=>V.observer))===null||fe===void 0?void 0:fe.map(V=>({observer:V.observer,options:V.options,callback:ue=>oe(le({type:A.Plugin,data:{plugin:V.name,payload:ue}}))})))||[]},v)};j.addLoadListener(Q=>{O.push(re(Q.contentDocument))});let ne=()=>{jt(),O.push(re(document)),Yt=!0};return document.readyState==="interactive"||document.readyState==="complete"?ne():O.push(ce("load",()=>{oe(le({type:A.Load,data:{}})),ne()},window)),()=>{O.forEach(Q=>Q()),Yt=!1}}catch(O){console.warn(O)}}var oe,jt,Gr,Yt,Ce,Vr=D(()=>{"use strict";xe();Lr();me();ve();Ii();Si();zi();Ki();Yt=!1,Ce=Ot();De.addCustomEvent=(e,t)=>{if(!Yt)throw new Error("please add custom event after start recording");oe(le({type:A.Custom,data:{tag:e,payload:t}}))};De.freezePage=()=>{Ue.forEach(e=>e.freeze())};De.takeFullSnapshot=e=>{if(!Yt)throw new Error("please take full snapshot after start recording");jt(e)};De.mirror=Ce});function Sa(){return new Ia}function Ca(e){let t={},r=/;(?![^(]*\))/g,n=/:(.+)/,i=/\/\*.*?\*\//g;return e.replace(i,"").split(r).forEach(function(o){if(o){let s=o.split(n);s.length>1&&(t[Hr(s[0].trim())]=s[1].trim())}}),t}function Zi(e){let t=[];for(let r in e){let n=e[r];if(typeof n!="string")continue;let i=Aa(r);t.push(`${i}: ${n};`)}return t.join(" ")}function Na(e){return class Yi extends e{constructor(){super(...arguments),this.nodeType=te.DOCUMENT_NODE,this.nodeName="#document",this.compatMode="CSS1Compat",this.RRNodeType=P.Document,this.textContent=null}get documentElement(){return this.childNodes.find(r=>r.RRNodeType===P.Element&&r.tagName==="HTML")||null}get body(){var r;return((r=this.documentElement)===null||r===void 0?void 0:r.childNodes.find(n=>n.RRNodeType===P.Element&&n.tagName==="BODY"))||null}get head(){var r;return((r=this.documentElement)===null||r===void 0?void 0:r.childNodes.find(n=>n.RRNodeType===P.Element&&n.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(r){let n=r.RRNodeType;if((n===P.Element||n===P.DocumentType)&&this.childNodes.some(i=>i.RRNodeType===n))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${n===P.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);return r.parentElement=null,r.parentNode=this,this.childNodes.push(r),r}insertBefore(r,n){let i=r.RRNodeType;if((i===P.Element||i===P.DocumentType)&&this.childNodes.some(s=>s.RRNodeType===i))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${i===P.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);if(n===null)return this.appendChild(r);let o=this.childNodes.indexOf(n);if(o==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(o,0,r),r.parentElement=null,r.parentNode=this,r}removeChild(r){let n=this.childNodes.indexOf(r);if(n===-1)throw new Error("Failed to execute 'removeChild' on 'RRDocument': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(n,1),r.parentElement=null,r.parentNode=null,r}open(){this.childNodes=[]}close(){}write(r){let n;if(r==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?n="-//W3C//DTD XHTML 1.0 Transitional//EN":r==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(n="-//W3C//DTD HTML 4.0 Transitional//EN"),n){let i=this.createDocumentType("html",n,"");this.open(),this.appendChild(i)}}createDocument(r,n,i){return new Yi}createDocumentType(r,n,i){let o=new(Xi(Ie))(r,n,i);return o.ownerDocument=this,o}createElement(r){let n=new(Ji(Ie))(r);return n.ownerDocument=this,n}createElementNS(r,n){return this.createElement(n)}createTextNode(r){let n=new(Qi(Ie))(r);return n.ownerDocument=this,n}createComment(r){let n=new(qi(Ie))(r);return n.ownerDocument=this,n}createCDATASection(r){let n=new($i(Ie))(r);return n.ownerDocument=this,n}toString(){return"RRDocument"}}}function Xi(e){return class extends e{constructor(r,n,i){super(),this.nodeType=te.DOCUMENT_TYPE_NODE,this.RRNodeType=P.DocumentType,this.textContent=null,this.name=r,this.publicId=n,this.systemId=i,this.nodeName=r}toString(){return"RRDocumentType"}}}function Ji(e){return class extends e{constructor(r){super(),this.nodeType=te.ELEMENT_NODE,this.RRNodeType=P.Element,this.attributes={},this.shadowRoot=null,this.tagName=r.toUpperCase(),this.nodeName=r.toUpperCase()}get textContent(){let r="";return this.childNodes.forEach(n=>r+=n.textContent),r}set textContent(r){this.childNodes=[this.ownerDocument.createTextNode(r)]}get classList(){return new zr(this.attributes.class,r=>{this.attributes.class=r})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){let r=this.attributes.style?Ca(this.attributes.style):{},n=/\B([A-Z])/g;return r.setProperty=(i,o,s)=>{if(n.test(i))return;let a=Hr(i);o?r[a]=o:delete r[a],s==="important"&&(r[a]+=" !important"),this.attributes.style=Zi(r)},r.removeProperty=i=>{if(n.test(i))return"";let o=Hr(i),s=r[o]||"";return delete r[o],this.attributes.style=Zi(r),s},r}getAttribute(r){return this.attributes[r]||null}setAttribute(r,n){this.attributes[r]=n}setAttributeNS(r,n,i){this.setAttribute(n,i)}removeAttribute(r){delete this.attributes[r]}appendChild(r){return this.childNodes.push(r),r.parentNode=this,r.parentElement=this,r}insertBefore(r,n){if(n===null)return this.appendChild(r);let i=this.childNodes.indexOf(n);if(i==-1)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return this.childNodes.splice(i,0,r),r.parentElement=this,r.parentNode=this,r}removeChild(r){let n=this.childNodes.indexOf(r);if(n===-1)throw new Error("Failed to execute 'removeChild' on 'RRElement': The RRNode to be removed is not a child of this RRNode.");return this.childNodes.splice(n,1),r.parentElement=null,r.parentNode=null,r}attachShadow(r){let n=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=n,n}dispatchEvent(r){return!0}toString(){let r="";for(let n in this.attributes)r+=`${n}="${this.attributes[n]}" `;return`${this.tagName} ${r}`}}}function Ta(e){return class extends e{attachShadow(r){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}}function Qi(e){return class extends e{constructor(r){super(),this.nodeType=te.TEXT_NODE,this.nodeName="#text",this.RRNodeType=P.Text,this.data=r}get textContent(){return this.data}set textContent(r){this.data=r}toString(){return`RRText text=${JSON.stringify(this.data)}`}}}function qi(e){return class extends e{constructor(r){super(),this.nodeType=te.COMMENT_NODE,this.nodeName="#comment",this.RRNodeType=P.Comment,this.data=r}get textContent(){return this.data}set textContent(r){this.data=r}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}}function $i(e){return class extends e{constructor(r){super(),this.nodeName="#cdata-section",this.nodeType=te.CDATA_SECTION_NODE,this.RRNodeType=P.CDATA,this.data=r}get textContent(){return this.data}set textContent(r){this.data=r}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}}function be(e,t,r,n){let i=e.childNodes,o=t.childNodes;n=n||t.mirror||t.ownerDocument.mirror,(i.length>0||o.length>0)&&ji(Array.from(i),o,e,r,n);let s=null,a=null;switch(t.RRNodeType){case P.Document:{a=t.scrollData;break}case P.Element:{let l=e,c=t;switch(Ma(l,c,n),a=c.scrollData,s=c.inputData,c.tagName){case"AUDIO":case"VIDEO":{let u=e,d=c;d.paused!==void 0&&(d.paused?u.pause():u.play()),d.muted!==void 0&&(u.muted=d.muted),d.volume!==void 0&&(u.volume=d.volume),d.currentTime!==void 0&&(u.currentTime=d.currentTime),d.playbackRate!==void 0&&(u.playbackRate=d.playbackRate);break}case"CANVAS":{let u=t;if(u.rr_dataURL!==null){let d=document.createElement("img");d.onload=()=>{let f=l.getContext("2d");f&&f.drawImage(d,0,0,d.width,d.height)},d.src=u.rr_dataURL}u.canvasMutations.forEach(d=>r.applyCanvas(d.event,d.mutation,e))}break;case"STYLE":{let u=l.sheet;u&&t.rules.forEach(d=>r.applyStyleSheetMutation(d,u))}break}if(c.shadowRoot){l.shadowRoot||l.attachShadow({mode:"open"});let u=l.shadowRoot.childNodes,d=c.shadowRoot.childNodes;(u.length>0||d.length>0)&&ji(Array.from(u),d,l.shadowRoot,r,n)}break}case P.Text:case P.Comment:case P.CDATA:e.textContent!==t.data&&(e.textContent=t.data);break}if(a&&r.applyScroll(a,!0),s&&r.applyInput(s),t.nodeName==="IFRAME"){let l=e.contentDocument,c=t;if(l){let u=n.getMeta(c.contentDocument);u&&r.mirror.add(l,Object.assign({},u)),be(l,c.contentDocument,r,n)}}}function Ma(e,t,r){let n=e.attributes,i=t.attributes;for(let o in i){let s=i[o],a=r.getMeta(t);if(a&&"isSVG"in a&&a.isSVG&&Kr[o])e.setAttributeNS(Kr[o],o,s);else if(t.tagName==="CANVAS"&&o==="rr_dataURL"){let l=document.createElement("img");l.src=s,l.onload=()=>{let c=e.getContext("2d");c&&c.drawImage(l,0,0,l.width,l.height)}}else e.setAttribute(o,s)}for(let{name:o}of Array.from(n))o in i||e.removeAttribute(o);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function ji(e,t,r,n,i){var o;let s=0,a=e.length-1,l=0,c=t.length-1,u=e[s],d=e[a],f=t[l],h=t[c],p,v;for(;s<=a&&l<=c;){let I=n.mirror.getId(u),m=n.mirror.getId(d),g=i.getId(f),y=i.getId(h);if(u===void 0)u=e[++s];else if(d===void 0)d=e[--a];else if(I!==-1&&I===g)be(u,f,n,i),u=e[++s],f=t[++l];else if(m!==-1&&m===y)be(d,h,n,i),d=e[--a],h=t[--c];else if(I!==-1&&I===y)r.insertBefore(u,d.nextSibling),be(u,h,n,i),u=e[++s],h=t[--c];else if(m!==-1&&m===g)r.insertBefore(d,u),be(d,f,n,i),d=e[--a],f=t[++l];else{if(!p){p={};for(let b=s;b<=a;b++){let M=e[b];M&&n.mirror.hasNode(M)&&(p[n.mirror.getId(M)]=b)}}if(v=p[i.getId(f)],v){let b=e[v];r.insertBefore(b,u),be(b,f,n,i),e[v]=void 0}else{let b=Xt(f,n.mirror,i);r.nodeName==="#document"&&((o=n.mirror.getMeta(b))===null||o===void 0?void 0:o.type)===P.Element&&r.documentElement&&(r.removeChild(r.documentElement),e[s]=void 0,u=void 0),r.insertBefore(b,u||null),be(b,f,n,i)}f=t[++l]}}if(s>a){let I=t[c+1],m=null;for(I&&r.childNodes.forEach(g=>{n.mirror.getId(g)===i.getId(I)&&(m=g)});l<=c;++l){let g=Xt(t[l],n.mirror,i);r.insertBefore(g,m),be(g,t[l],n,i)}}else if(l>c)for(;s<=a;s++){let I=e[s];I&&(r.removeChild(I),n.mirror.removeNodeFromMap(I))}}function Xt(e,t,r){let n=r.getId(e),i=r.getMeta(e),o=null;if(n>-1&&(o=t.getNode(n)),o!==null)return o;switch(e.RRNodeType){case P.Document:o=new Document;break;case P.DocumentType:o=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case P.Element:{let s=e.tagName.toLowerCase();s=Ra[s]||s,i&&"isSVG"in i&&i?.isSVG?o=document.createElementNS(Kr.svg,s):o=document.createElement(e.tagName);break}case P.Text:o=document.createTextNode(e.data);break;case P.Comment:o=document.createComment(e.data);break;case P.CDATA:o=document.createCDATASection(e.data);break}return i&&t.add(o,Object.assign({},i)),o}function _a(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function Qr(e,t,r,n){let i;switch(e.nodeType){case te.DOCUMENT_NODE:n&&n.nodeName==="IFRAME"?i=n.contentDocument:(i=t,i.compatMode=e.compatMode);break;case te.DOCUMENT_TYPE_NODE:{let s=e;i=t.createDocumentType(s.name,s.publicId,s.systemId);break}case te.ELEMENT_NODE:{let s=e,a=_a(s);i=t.createElement(a);let l=i;for(let{name:c,value:u}of Array.from(s.attributes))l.attributes[c]=u;s.scrollLeft&&(l.scrollLeft=s.scrollLeft),s.scrollTop&&(l.scrollTop=s.scrollTop);break}case te.TEXT_NODE:i=t.createTextNode(e.textContent||"");break;case te.CDATA_SECTION_NODE:i=t.createCDATASection(e.data);break;case te.COMMENT_NODE:i=t.createComment(e.textContent||"");break;case te.DOCUMENT_FRAGMENT_NODE:i=n.attachShadow({mode:"open"});break;default:return null}let o=r.getMeta(e);return t instanceof Je&&(o||(o=qr(i,t.unserializedId),r.add(e,o)),t.mirror.add(i,Object.assign({},o))),i}function eo(e,t=Sa(),r=new Je){function n(i,o){let s=Qr(i,r,t,o);if(s!==null)if(o?.nodeName!=="IFRAME"&&i.nodeType!==te.DOCUMENT_FRAGMENT_NODE&&(o?.appendChild(s),s.parentNode=o,s.parentElement=o),i.nodeName==="IFRAME"){let a=i.contentDocument;a&&n(a,s)}else(i.nodeType===te.DOCUMENT_NODE||i.nodeType===te.ELEMENT_NODE||i.nodeType===te.DOCUMENT_FRAGMENT_NODE)&&(i.nodeType===te.ELEMENT_NODE&&i.shadowRoot&&n(i.shadowRoot,s),i.childNodes.forEach(a=>n(a,s)))}return n(e,null),r}function La(){return new Jr}function qr(e,t){switch(e.RRNodeType){case P.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case P.DocumentType:{let r=e;return{id:t,type:e.RRNodeType,name:r.name,publicId:r.publicId,systemId:r.systemId}}case P.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case P.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case P.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case P.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}var P,Ia,ba,wa,Hr,Ea,Aa,Ie,zr,te,Kr,Ra,Je,xa,Qe,Zr,jr,Yr,Xr,ka,Da,Oa,Jr,to=D(()=>{"use strict";(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(P||(P={}));Ia=(function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(t){var r;if(!t)return-1;var n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1},e.prototype.getNode=function(t){return this.idNodeMap.get(t)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(t){return this.nodeMetaMap.get(t)||null},e.prototype.removeNodeFromMap=function(t){var r=this,n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(function(i){return r.removeNodeFromMap(i)})},e.prototype.has=function(t){return this.idNodeMap.has(t)},e.prototype.hasNode=function(t){return this.nodeMetaMap.has(t)},e.prototype.add=function(t,r){var n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)},e.prototype.replace=function(t,r){var n=this.getNode(t);if(n){var i=this.nodeMetaMap.get(n);i&&this.nodeMetaMap.set(r,i)}this.idNodeMap.set(t,r)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e})();ba=/-([a-z])/g,wa=/^--[a-zA-Z0-9-]+$/,Hr=e=>wa.test(e)?e:e.replace(ba,(t,r)=>r?r.toUpperCase():""),Ea=/\B([A-Z])/g,Aa=e=>e.replace(Ea,"-$1").toLowerCase(),Ie=class{constructor(...t){this.childNodes=[],this.parentElement=null,this.parentNode=null,this.ELEMENT_NODE=te.ELEMENT_NODE,this.TEXT_NODE=te.TEXT_NODE}get firstChild(){return this.childNodes[0]||null}get lastChild(){return this.childNodes[this.childNodes.length-1]||null}get nextSibling(){let t=this.parentNode;if(!t)return null;let r=t.childNodes,n=r.indexOf(this);return r[n+1]||null}contains(t){if(t===this)return!0;for(let r of this.childNodes)if(r.contains(t))return!0;return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,r){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};zr=class{constructor(t,r){if(this.classes=[],this.add=(...n)=>{for(let i of n){let o=String(i);this.classes.indexOf(o)>=0||this.classes.push(o)}this.onChange&&this.onChange(this.classes.join(" "))},this.remove=(...n)=>{this.classes=this.classes.filter(i=>n.indexOf(i)===-1),this.onChange&&this.onChange(this.classes.join(" "))},t){let n=t.trim().split(/\s+/);this.classes.push(...n)}this.onChange=r}};(function(e){e[e.PLACEHOLDER=0]="PLACEHOLDER",e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"})(te||(te={}));Kr={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},Ra={altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};Je=class e extends Na(Ie){constructor(t){super(),this.UNSERIALIZED_STARTING_ID=-2,this._unserializedId=this.UNSERIALIZED_STARTING_ID,this.mirror=La(),this.scrollData=null,t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,r,n){return new e}createDocumentType(t,r,n){let i=new xa(t,r,n);return i.ownerDocument=this,i}createElement(t){let r=t.toUpperCase(),n;switch(r){case"AUDIO":case"VIDEO":n=new Zr(r);break;case"IFRAME":n=new Xr(r,this.mirror);break;case"CANVAS":n=new jr(r);break;case"STYLE":n=new Yr(r);break;default:n=new Qe(r);break}return n.ownerDocument=this,n}createComment(t){let r=new Da(t);return r.ownerDocument=this,r}createCDATASection(t){let r=new Oa(t);return r.ownerDocument=this,r}createTextNode(t){let r=new ka(t);return r.ownerDocument=this,r}destroyTree(){this.childNodes=[],this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}},xa=Xi(Ie),Qe=class extends Ji(Ie){constructor(){super(...arguments),this.inputData=null,this.scrollData=null}},Zr=class extends Ta(Qe){},jr=class extends Qe{constructor(){super(...arguments),this.rr_dataURL=null,this.canvasMutations=[]}getContext(){return null}},Yr=class extends Qe{constructor(){super(...arguments),this.rules=[]}},Xr=class extends Qe{constructor(t,r){super(t),this.contentDocument=new Je,this.contentDocument.mirror=r}},ka=Qi(Ie),Da=qi(Ie),Oa=$i(Ie);Jr=class{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){var r;if(!t)return-1;let n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){let r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){let n=this.getNode(t);if(n){let i=this.nodeMetaMap.get(n);i&&this.nodeMetaMap.set(r,i)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}});var ro,no,io=D(()=>{"use strict";Vr();({addCustomEvent:ro}=De),{freezePage:no}=De});function ho(e,t){t===void 0&&(t={});var r=Ka();r.p(e);var n=Za(e,t,2,4);return Ya(n,t),ja(n,n.length-4,r.d()),n}function po(e,t){return Ga((Xa(e),e.subarray(2,-4)),t)}function $t(e,t){var r=e.length;if(!t&&typeof TextEncoder<"u")return new TextEncoder().encode(e);for(var n=new de(e.length+(e.length>>>1)),i=0,o=function(c){n[i++]=c},s=0;s<r;++s){if(i+5>n.length){var a=new de(i+8+(r-s<<1));a.set(n),n=a}var l=e.charCodeAt(s);l<128||t?o(l):l<2048?(o(192|l>>>6),o(128|l&63)):l>55295&&l<57344?(l=65536+(l&1047552)|e.charCodeAt(++s)&1023,o(240|l>>>18),o(128|l>>>12&63),o(128|l>>>6&63),o(128|l&63)):(o(224|l>>>12),o(128|l>>>6&63),o(128|l&63))}return ln(n,0,i)}function er(e,t){var r="";if(!t&&typeof TextDecoder<"u")return new TextDecoder().decode(e);for(var n=0;n<e.length;){var i=e[n++];i<128||t?r+=String.fromCharCode(i):i<224?r+=String.fromCharCode((i&31)<<6|e[n++]&63):i<240?r+=String.fromCharCode((i&15)<<12|(e[n++]&63)<<6|e[n++]&63):(i=((i&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,r+=String.fromCharCode(55296|i>>10,56320|i&1023))}return r}var de,he,Et,Qt,qt,rn,lo,co,uo,nn,fo,Fa,oo,on,Oe,Z,Ne,We,Z,Z,Z,Z,At,Z,Ba,Ua,Wa,Pa,$r,we,en,an,ln,Ga,_e,bt,tn,sn,so,wt,Jt,ao,Va,Ha,za,Ka,Za,ja,Ya,Xa,cn=D(()=>{"use strict";de=Uint8Array,he=Uint16Array,Et=Uint32Array,Qt=new de([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),qt=new de([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),rn=new de([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),lo=function(e,t){for(var r=new he(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var i=new Et(r[30]),n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)i[o]=o-r[n]<<5|n;return[r,i]},co=lo(Qt,2),uo=co[0],nn=co[1];uo[28]=258,nn[258]=28;fo=lo(qt,0),Fa=fo[0],oo=fo[1],on=new he(32768);for(Z=0;Z<32768;++Z)Oe=(Z&43690)>>>1|(Z&21845)<<1,Oe=(Oe&52428)>>>2|(Oe&13107)<<2,Oe=(Oe&61680)>>>4|(Oe&3855)<<4,on[Z]=((Oe&65280)>>>8|(Oe&255)<<8)>>>1;Ne=(function(e,t,r){for(var n=e.length,i=0,o=new he(t);i<n;++i)++o[e[i]-1];var s=new he(t);for(i=0;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(r){a=new he(1<<t);var l=15-t;for(i=0;i<n;++i)if(e[i])for(var c=i<<4|e[i],u=t-e[i],d=s[e[i]-1]++<<u,f=d|(1<<u)-1;d<=f;++d)a[on[d]>>>l]=c}else for(a=new he(n),i=0;i<n;++i)a[i]=on[s[e[i]-1]++]>>>15-e[i];return a}),We=new de(288);for(Z=0;Z<144;++Z)We[Z]=8;for(Z=144;Z<256;++Z)We[Z]=9;for(Z=256;Z<280;++Z)We[Z]=7;for(Z=280;Z<288;++Z)We[Z]=8;At=new de(32);for(Z=0;Z<32;++Z)At[Z]=5;Ba=Ne(We,9,0),Ua=Ne(We,9,1),Wa=Ne(At,5,0),Pa=Ne(At,5,1),$r=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},we=function(e,t,r){var n=t/8>>0;return(e[n]|e[n+1]<<8)>>>(t&7)&r},en=function(e,t){var r=t/8>>0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>>(t&7)},an=function(e){return(e/8>>0)+(e&7&&1)},ln=function(e,t,r){(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length);var n=new(e instanceof he?he:e instanceof Et?Et:de)(r-t);return n.set(e.subarray(t,r)),n},Ga=function(e,t,r){var n=e.length,i=!t||r,o=!r||r.i;r||(r={}),t||(t=new de(n*3));var s=function(O){var re=t.length;if(O>re){var ne=new de(Math.max(re*2,O));ne.set(t),t=ne}},a=r.f||0,l=r.p||0,c=r.b||0,u=r.l,d=r.d,f=r.m,h=r.n,p=n*8;do{if(!u){r.f=a=we(e,l,1);var v=we(e,l+1,3);if(l+=3,v)if(v==1)u=Ua,d=Pa,f=9,h=5;else if(v==2){var y=we(e,l,31)+257,b=we(e,l+10,15)+4,M=y+we(e,l+5,31)+1;l+=14;for(var N=new de(M),_=new de(19),w=0;w<b;++w)_[rn[w]]=we(e,l+w*3,7);l+=b*3;var Y=$r(_),H=(1<<Y)-1;if(!o&&l+M*(Y+7)>p)break;for(var q=Ne(_,Y,1),w=0;w<M;){var U=q[we(e,l,H)];l+=U&15;var I=U>>>4;if(I<16)N[w++]=I;else{var K=0,L=0;for(I==16?(L=3+we(e,l,3),l+=2,K=N[w-1]):I==17?(L=3+we(e,l,7),l+=3):I==18&&(L=11+we(e,l,127),l+=7);L--;)N[w++]=K}}var z=N.subarray(0,y),F=N.subarray(y);f=$r(z),h=$r(F),u=Ne(z,f,1),d=Ne(F,h,1)}else throw"invalid block type";else{var I=an(l)+4,m=e[I-4]|e[I-3]<<8,g=I+m;if(g>n){if(o)throw"unexpected EOF";break}i&&s(c+m),t.set(e.subarray(I,g),c),r.b=c+=m,r.p=l=g*8;continue}if(l>p)throw"unexpected EOF"}i&&s(c+131072);for(var k=(1<<f)-1,X=(1<<h)-1,C=f+h+18;o||l+C<p;){var K=u[en(e,l)&k],S=K>>>4;if(l+=K&15,l>p)throw"unexpected EOF";if(!K)throw"invalid length/literal";if(S<256)t[c++]=S;else if(S==256){u=null;break}else{var T=S-254;if(S>264){var w=S-257,R=Qt[w];T=we(e,l,(1<<R)-1)+uo[w],l+=R}var W=d[en(e,l)&X],j=W>>>4;if(!W)throw"invalid distance";l+=W&15;var F=Fa[j];if(j>3){var R=qt[j];F+=en(e,l)&(1<<R)-1,l+=R}if(l>p)throw"unexpected EOF";i&&s(c+131072);for(var $=c+T;c<$;c+=4)t[c]=t[c-F],t[c+1]=t[c+1-F],t[c+2]=t[c+2-F],t[c+3]=t[c+3-F];c=$}}r.l=u,r.p=l,r.b=c,u&&(a=1,r.m=f,r.d=d,r.n=h)}while(!a);return c==t.length?t:ln(t,0,c)},_e=function(e,t,r){r<<=t&7;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8},bt=function(e,t,r){r<<=t&7;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},tn=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var i=r.length,o=r.slice();if(!i)return[new de(0),0];if(i==1){var s=new de(r[0].s+1);return s[r[0].s]=1,[s,1]}r.sort(function(M,N){return M.f-N.f}),r.push({s:-1,f:25001});var a=r[0],l=r[1],c=0,u=1,d=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=i-1;)a=r[r[c].f<r[d].f?c++:d++],l=r[c!=u&&r[c].f<r[d].f?c++:d++],r[u++]={s:-1,f:a.f+l.f,l:a,r:l};for(var f=o[0].s,n=1;n<i;++n)o[n].s>f&&(f=o[n].s);var h=new he(f+1),p=sn(r[u-1],h,0);if(p>t){var n=0,v=0,I=p-t,m=1<<I;for(o.sort(function(N,_){return h[_.s]-h[N.s]||N.f-_.f});n<i;++n){var g=o[n].s;if(h[g]>t)v+=m-(1<<p-h[g]),h[g]=t;else break}for(v>>>=I;v>0;){var y=o[n].s;h[y]<t?v-=1<<t-h[y]++-1:++n}for(;n>=0&&v;--n){var b=o[n].s;h[b]==t&&(--h[b],++v)}p=t}return[new de(h),p]},sn=function(e,t,r){return e.s==-1?Math.max(sn(e.l,t,r+1),sn(e.r,t,r+1)):t[e.s]=r},so=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new he(++t),n=0,i=e[0],o=1,s=function(l){r[n++]=l},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return[r.subarray(0,n),t]},wt=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},Jt=function(e,t,r){var n=r.length,i=an(t+2);e[i]=n&255,e[i+1]=n>>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var o=0;o<n;++o)e[i+o+4]=r[o];return(i+4+n)*8},ao=function(e,t,r,n,i,o,s,a,l,c,u){_e(t,u++,r),++i[256];for(var d=tn(i,15),f=d[0],h=d[1],p=tn(o,15),v=p[0],I=p[1],m=so(f),g=m[0],y=m[1],b=so(v),M=b[0],N=b[1],_=new he(19),w=0;w<g.length;++w)_[g[w]&31]++;for(var w=0;w<M.length;++w)_[M[w]&31]++;for(var Y=tn(_,7),H=Y[0],q=Y[1],U=19;U>4&&!H[rn[U-1]];--U);var K=c+5<<3,L=wt(i,We)+wt(o,At)+s,z=wt(i,f)+wt(o,v)+s+14+3*U+wt(_,H)+(2*_[16]+3*_[17]+7*_[18]);if(K<=L&&K<=z)return Jt(t,u,e.subarray(l,l+c));var F,k,X,C;if(_e(t,u,1+(z<L)),u+=2,z<L){F=Ne(f,h,0),k=f,X=Ne(v,I,0),C=v;var S=Ne(H,q,0);_e(t,u,y-257),_e(t,u+5,N-1),_e(t,u+10,U-4),u+=14;for(var w=0;w<U;++w)_e(t,u+3*w,H[rn[w]]);u+=3*U;for(var T=[g,M],R=0;R<2;++R)for(var W=T[R],w=0;w<W.length;++w){var j=W[w]&31;_e(t,u,S[j]),u+=H[j],j>15&&(_e(t,u,W[w]>>>5&127),u+=W[w]>>>12)}}else F=Ba,k=We,X=Wa,C=At;for(var w=0;w<a;++w)if(n[w]>255){var j=n[w]>>>18&31;bt(t,u,F[j+257]),u+=k[j+257],j>7&&(_e(t,u,n[w]>>>23&31),u+=Qt[j]);var $=n[w]&31;bt(t,u,X[$]),u+=C[$],$>3&&(bt(t,u,n[w]>>>5&8191),u+=qt[$])}else bt(t,u,F[n[w]]),u+=k[n[w]];return bt(t,u,F[256]),u+k[256]},Va=new Et([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ha=new de(0),za=function(e,t,r,n,i,o){var s=e.length,a=new de(n+s+5*(1+Math.floor(s/7e3))+i),l=a.subarray(n,a.length-i),c=0;if(!t||s<8)for(var u=0;u<=s;u+=65535){var d=u+65535;d<s?c=Jt(l,c,e.subarray(u,d)):(l[u]=o,c=Jt(l,c,e.subarray(u,s)))}else{for(var f=Va[t-1],h=f>>>13,p=f&8191,v=(1<<r)-1,I=new he(32768),m=new he(v+1),g=Math.ceil(r/3),y=2*g,b=function(ae){return(e[ae]^e[ae+1]<<g^e[ae+2]<<y)&v},M=new Et(25e3),N=new he(288),_=new he(32),w=0,Y=0,u=0,H=0,q=0,U=0;u<s;++u){var K=b(u),L=u&32767,z=m[K];if(I[L]=z,m[K]=L,q<=u){var F=s-u;if((w>7e3||H>24576)&&F>423){c=ao(e,l,0,M,N,_,Y,H,U,u-U,c),H=w=Y=0,U=u;for(var k=0;k<286;++k)N[k]=0;for(var k=0;k<30;++k)_[k]=0}var X=2,C=0,S=p,T=L-z&32767;if(F>2&&K==b(u-T))for(var R=Math.min(h,F)-1,W=Math.min(32767,u),j=Math.min(258,F);T<=W&&--S&&L!=z;){if(e[u+X]==e[u+X-T]){for(var $=0;$<j&&e[u+$]==e[u+$-T];++$);if($>X){if(X=$,C=T,$>R)break;for(var O=Math.min(T,$-2),re=0,k=0;k<O;++k){var ne=u-T+k+32768&32767,Q=I[ne],fe=ne-Q+32768&32767;fe>re&&(re=fe,z=ne)}}}L=z,z=I[L],T+=L-z+32768&32767}if(C){M[H++]=268435456|nn[X]<<18|oo[C];var V=nn[X]&31,ue=oo[C]&31;Y+=Qt[V]+qt[ue],++N[257+V],++_[ue],q=u+X,++w}else M[H++]=e[u],++N[e[u]]}}c=ao(e,l,o,M,N,_,Y,H,U,u-U,c),o||(c=Jt(l,c,Ha))}return ln(a,0,n+an(c)+i)},Ka=function(){var e=1,t=0;return{p:function(r){for(var n=e,i=t,o=r.length,s=0;s!=o;){for(var a=Math.min(s+5552,o);s<a;++s)n+=r[s],i+=n;n%=65521,i%=65521}e=n,t=i},d:function(){return(e>>>8<<16|(t&255)<<8|t>>>8)+((e&255)<<23)*2}}},Za=function(e,t,r,n,i){return za(e,t.level==null?6:t.level,t.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):12+t.mem,r,n,!i)},ja=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},Ya=function(e,t){var r=t.level,n=r==0?0:r<6?1:r==9?3:2;e[0]=120,e[1]=n<<6|(n?32-2*n:1)},Xa=function(e){if((e[0]&15)!=8||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(e[1]&32)throw"invalid zlib data: preset dictionaries not supported"}});var go,vo=D(()=>{"use strict";cn();go=e=>{let t=Object.assign(Object.assign({},e),{v:"v1"});return er(ho($t(JSON.stringify(t))),!0)}});var yo,Io=D(()=>{"use strict";cn();yo=e=>{if(typeof e!="string")return e;try{let t=JSON.parse(e);if(t.timestamp)return t}catch{}try{let t=JSON.parse(er(po($t(e,!0))));if(t.v==="v1")return t;throw new Error(`These events were packed with packer ${t.v} which is incompatible with current packer ${"v1"}.`)}catch(t){throw console.error(t),new Error("Unknown data format.")}}});var Pe,Ja,So,Qa,un,Co=D(()=>{"use strict";Pe=class{constructor(t){this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){let t=this.lineNumber||"",r=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${t}:${r})`:`${this.fileName}:${t}:${r}`}},Ja=/(^|@)\S+:\d+/,So=/^\s*at .*(\S+:\d+|\(native\))/m,Qa=/^(eval@)?(\[native code])?$/,un={parse:function(e){if(!e)return[];if(typeof e.stacktrace<"u"||typeof e["opera#sourceloc"]<"u")return this.parseOpera(e);if(e.stack&&e.stack.match(So))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(e.indexOf(":")===-1)return[e];let r=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!r)throw new Error(`Cannot parse given url: ${e}`);return[r[1],r[2]||void 0,r[3]||void 0]},parseV8OrIE:function(e){return e.stack.split(`
8
8
  `).filter(function(r){return!!r.match(So)},this).map(function(r){r.indexOf("(eval ")>-1&&(r=r.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let n=r.replace(/^\s+/,"").replace(/\(eval code/g,"("),i=n.match(/ (\((.+):(\d+):(\d+)\)$)/);n=i?n.replace(i[0],""):n;let o=n.split(/\s+/).slice(1),s=this.extractLocation(i?i[1]:o.pop()),a=o.join(" ")||void 0,l=["eval","<anonymous>"].indexOf(s[0])>-1?void 0:s[0];return new Pe({functionName:a,fileName:l,lineNumber:s[1],columnNumber:s[2]})},this)},parseFFOrSafari:function(e){return e.stack.split(`
9
9
  `).filter(function(r){return!r.match(Qa)},this).map(function(r){if(r.indexOf(" > eval")>-1&&(r=r.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),r.indexOf("@")===-1&&r.indexOf(":")===-1)return new Pe({functionName:r});{let n=/((.*".+"[^@]*)?[^@]*)(?:@)/,i=r.match(n),o=i&&i[1]?i[1]:void 0,s=this.extractLocation(r.replace(n,""));return new Pe({functionName:o,fileName:s[0],lineNumber:s[1],columnNumber:s[2]})}},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf(`
10
10
  `)>-1&&e.message.split(`
@@ -14,7 +14,7 @@ or you can use record.mirror to access the mirror instance during recording.`,ft
14
14
  `),n=[];for(let i=0,o=r.length;i<o;i+=2){let s=t.exec(r[i]);s&&n.push(new Pe({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return n},parseOpera11:function(e){return e.stack.split(`
15
15
  `).filter(function(r){return!!r.match(Ja)&&!r.match(/^Error created at/)},this).map(function(r){let n=r.split("@"),i=this.extractLocation(n.pop()),s=(n.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Pe({functionName:s,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})},this)}}});function qa(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let r=e.localName;if(!r)break;r=r.toLowerCase();let n=e.parentElement,i=[];if(n.children&&n.children.length>0)for(let o=0;o<n.children.length;o++){let s=n.children[o];s.localName&&s.localName.toLowerCase&&s.localName.toLowerCase()===r&&i.push(s)}i.length>1&&(r+=`:eq(${i.indexOf(e)})`),t=r+(t?">"+t:""),e=n}return t}function dn(e){return Object.prototype.toString.call(e)==="[object Object]"}function bo(e,t){if(t===0)return!0;let r=Object.keys(e);for(let n of r)if(dn(e[n])&&bo(e[n],t-1))return!0;return!1}function tr(e,t){let r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);let n=[],i=[];return JSON.stringify(e,function(a,l){if(n.length>0){let c=n.indexOf(this);~c?n.splice(c+1):n.push(this),~c?i.splice(c,1/0,a):i.push(a),~n.indexOf(l)&&(n[0]===l?l="[Circular ~]":l="[Circular ~."+i.slice(0,n.indexOf(l)).join(".")+"]")}else n.push(l);if(l===null)return l;if(l===void 0)return"undefined";if(o(l))return s(l);if(l instanceof Event){let c={};for(let u in l){let d=l[u];Array.isArray(d)?c[u]=qa(d.length?d[0]:null):c[u]=d}return c}else{if(l instanceof Node)return l instanceof HTMLElement?l?l.outerHTML:"":l.nodeName;if(l instanceof Error)return l.stack?l.stack+`
16
16
  End of stack for Error object`:l.name+": "+l.message}return l});function o(a){return!!(dn(a)&&Object.keys(a).length>r.numOfKeysLimit||typeof a=="function"||dn(a)&&bo(a,r.depthOfLimit))}function s(a){let l=a.toString();return r.stringLengthLimit&&l.length>r.stringLengthLimit&&(l=`${l.slice(0,r.stringLengthLimit)}...`),l}}var wo=D(()=>{"use strict"});function $a(e,t,r){let n=r?Object.assign({},Eo,r):Eo,i=n.logger;if(!i)return()=>{};let o;typeof i=="string"?o=t[i]:o=i;let s=0,a=[];if(n.level.includes("error")&&window){let c=u=>{let d=u.message,f=u.error,h=un.parse(f).map(v=>v.toString()),p=[tr(d,n.stringifyOptions)];e({level:"error",trace:h,payload:p})};window.addEventListener("error",c),a.push(()=>{window&&window.removeEventListener("error",c)})}for(let c of n.level)a.push(l(o,c));return()=>{a.forEach(c=>c())};function l(c,u){return c[u]?pe(c,u,d=>(...f)=>{d.apply(this,f);try{let h=un.parse(new Error).map(v=>v.toString()).splice(1),p=f.map(v=>tr(v,n.stringifyOptions));s++,s<n.lengthThreshold?e({level:u,trace:h,payload:p}):s===n.lengthThreshold&&e({level:"warn",trace:[],payload:[tr("The number of log records reached the threshold.")]})}catch(h){d("rrweb logger error:",h,...f)}}):()=>{}}}var Eo,Nt,Ao,fn=D(()=>{"use strict";me();Co();wo();Eo={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};Nt="rrweb/console@1",Ao=e=>({name:Nt,observer:$a,options:e})});var rr,el,hn,No,To=D(()=>{"use strict";fn();ve();rr="__rrweb_original__",el={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],replayLogger:void 0},hn=class{constructor(t){this.config=Object.assign(el,t)}getConsoleLogger(){let t={};for(let r of this.config.level)r==="trace"?t[r]=n=>{(console.log[rr]?console.log[rr]:console.log)(...n.payload.map(o=>JSON.parse(o)),this.formatMessage(n))}:t[r]=n=>{(console[r][rr]?console[r][rr]:console[r])(...n.payload.map(o=>JSON.parse(o)),this.formatMessage(n))};return t}formatMessage(t){if(t.trace.length===0)return"";let r=`
17
- at `,n=r;return n+=t.trace.join(r),n}},No=e=>{let t=e?.replayLogger||new hn(e).getConsoleLogger();return{handler(r,n,i){let o=null;if(r.type===A.IncrementalSnapshot&&r.data.source===E.Log?o=r.data:r.type===A.Plugin&&r.data.plugin===Nt&&(o=r.data.payload),o)try{typeof t[o.level]=="function"&&t[o.level](o)}catch(s){i.replayer.config.showWarning&&console.warn(s)}}}}});var mn={};et(mn,{default:()=>pn});function pn(e){return{all:e=e||new Map,on:function(t,r){var n=e.get(t);n?n.push(r):e.set(t,[r])},off:function(t,r){var n=e.get(t);n&&(r?n.splice(n.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var n=e.get(t);n&&n.slice().map(function(i){i(r)}),(n=e.get("*"))&&n.slice().map(function(i){i(t,r)})}}}var gn=D(()=>{"use strict"});function Mo(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;let r=e.HTMLElement||e.Element,n=468,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||l,scrollIntoView:r.prototype.scrollIntoView},o=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function s(g){let m=["MSIE ","Trident/","Edge/"];return new RegExp(m.join("|")).test(g)}let a=s(e.navigator.userAgent)?1:0;function l(g,m){this.scrollLeft=g,this.scrollTop=m}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 d(g,m){if(m==="Y")return g.clientHeight+a<g.scrollHeight;if(m==="X")return g.clientWidth+a<g.scrollWidth}function f(g,m){let y=e.getComputedStyle(g,null)["overflow"+m];return y==="auto"||y==="scroll"}function h(g){let m=d(g,"Y")&&f(g,"Y"),y=d(g,"X")&&f(g,"X");return m||y}function p(g){for(;g!==t.body&&h(g)===!1;)g=g.parentNode||g.host;return g}function v(g){let m=o(),y,b,R,N=(m-g.startTime)/n;N=N>1?1:N,y=c(N),b=g.startX+(g.x-g.startX)*y,R=g.startY+(g.y-g.startY)*y,g.method.call(g.scrollable,b,R),(b!==g.x||R!==g.y)&&e.requestAnimationFrame(v.bind(e,g))}function I(g,m,y){let b,R,N,_,w=o();g===t.body?(b=e,R=e.scrollX||e.pageXOffset,N=e.scrollY||e.pageYOffset,_=i.scroll):(b=g,R=g.scrollLeft,N=g.scrollTop,_=l),v({scrollable:b,method:_,startTime:w,startX:R,startY:N,x:m,y})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){i.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset);return}I.call(e,t.body,arguments[0].left!==void 0?~~arguments[0].left:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:e.scrollY||e.pageYOffset)}},e.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])){i.scrollBy.call(e,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}I.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset))}},r.prototype.scroll=r.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");i.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}let g=arguments[0].left,m=arguments[0].top;I.call(this,this,typeof g>"u"?this.scrollLeft:~~g,typeof m>"u"?this.scrollTop:~~m)},r.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){i.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})}},r.prototype.scrollIntoView=function(){if(u(arguments[0])===!0){i.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}let g=p(this),m=g.getBoundingClientRect(),y=this.getBoundingClientRect();g!==t.body?(I.call(this,g,g.scrollLeft+y.left-m.left,g.scrollTop+y.top-m.top),e.getComputedStyle(g).position!=="fixed"&&e.scrollBy({left:m.left,top:m.top,behavior:"smooth"})):e.scrollBy({left:y.left,top:y.top,behavior:"smooth"})}}var Ro=D(()=>{"use strict"});function vn(e,t){if(e.type===A.IncrementalSnapshot&&e.data.source===E.MouseMove&&e.data.positions&&e.data.positions.length){let r=e.data.positions[0].timeOffset,n=e.timestamp+r;return e.delay=n-t,n-t}return e.delay=e.timestamp-t,e.delay}var nr,yn=D(()=>{"use strict";ve();nr=class{constructor(t=[],r){this.timeOffset=0,this.raf=null,this.actions=t,this.speed=r.speed,this.liveMode=r.liveMode}addAction(t){if(!this.actions.length||this.actions[this.actions.length-1].delay<=t.delay){this.actions.push(t);return}let r=this.findActionIndex(t);this.actions.splice(r,0,t)}start(){this.timeOffset=0;let t=performance.now(),r=()=>{let n=performance.now();for(this.timeOffset+=(n-t)*this.speed,t=n;this.actions.length;){let i=this.actions[0];if(this.timeOffset>=i.delay)this.actions.shift(),i.doAction();else break}(this.actions.length>0||this.liveMode)&&(this.raf=requestAnimationFrame(r))};this.raf=requestAnimationFrame(r)}clear(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(t){this.speed=t}toggleLiveMode(t){this.liveMode=t}isActive(){return this.raf!==null}findActionIndex(t){let r=0,n=this.actions.length-1;for(;r<=n;){let i=Math.floor((r+n)/2);if(this.actions[i].delay<t.delay)r=i+1;else if(this.actions[i].delay>t.delay)n=i-1;else return i+1}return r}}});function xo(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(t===void 0||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(a){i={error:a}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function In(e){return e===void 0?[]:[].concat(e)}function qe(e){return{type:"xstate.assign",assignment:e}}function ko(e,t){return typeof(e=typeof e=="string"&&t&&t[e]?t[e]:e)=="string"?{type:e}:typeof e=="function"?{type:e.name,exec:e}:e}function ir(e){return function(t){return e===t}}function Fo(e){return typeof e=="string"?{type:e}:e}function Do(e,t){return{value:e,context:t,actions:[],changed:!1,matches:ir(e)}}function Oo(e,t,r){var n=t,i=!1;return[e.filter((function(o){if(o.type==="xstate.assign"){i=!0;var s=Object.assign({},n);return typeof o.assignment=="function"?s=o.assignment(n,r):Object.keys(o.assignment).forEach((function(a){s[a]=typeof o.assignment[a]=="function"?o.assignment[a](n,r):o.assignment[a]})),n=s,!1}return!0})),n,i]}function Sn(e,t){t===void 0&&(t={});var r=xo(Oo(In(e.states[e.initial].entry).map((function(s){return ko(s,t.actions)})),e.context,Lo),2),n=r[0],i=r[1],o={config:e,_options:t,initialState:{value:e.initial,actions:n,context:i,matches:ir(e.initial)},transition:function(s,a){var l,c,u=typeof s=="string"?{value:s,context:e.context}:s,d=u.value,f=u.context,h=Fo(a),p=e.states[d];if(p.on){var v=In(p.on[h.type]);try{for(var I=(function(k){var X=typeof Symbol=="function"&&Symbol.iterator,C=X&&k[X],S=0;if(C)return C.call(k);if(k&&typeof k.length=="number")return{next:function(){return k&&S>=k.length&&(k=void 0),{value:k&&k[S++],done:!k}}};throw new TypeError(X?"Object is not iterable.":"Symbol.iterator is not defined.")})(v),g=I.next();!g.done;g=I.next()){var m=g.value;if(m===void 0)return Do(d,f);var y=typeof m=="string"?{target:m}:m,b=y.target,R=y.actions,N=R===void 0?[]:R,_=y.cond,w=_===void 0?function(){return!0}:_,Y=b===void 0,H=b??d,q=e.states[H];if(w(f,h)){var U=xo(Oo((Y?In(N):[].concat(p.exit,N,q.entry).filter((function(k){return k}))).map((function(k){return ko(k,o._options.actions)})),f,h),3),K=U[0],L=U[1],z=U[2],F=b??d;return{value:F,context:L,actions:K,changed:b!==d||K.length>0||z,matches:ir(F)}}}}catch(k){l={error:k}}finally{try{g&&!g.done&&(c=I.return)&&c.call(I)}finally{if(l)throw l.error}}}return Do(d,f)}};return o}function Cn(e){var t=e.initialState,r=at.NotStarted,n=new Set,i={_machine:e,send:function(o){r===at.Running&&(t=e.transition(t,o),_o(t,Fo(o)),n.forEach((function(s){return s(t)})))},subscribe:function(o){return n.add(o),o(t),{unsubscribe:function(){return n.delete(o)}}},start:function(o){if(o){var s=typeof o=="object"?o:{context:e.config.context,value:o};t={value:s.value,actions:[],context:s.context,matches:ir(s.value)}}return r=at.Running,_o(t,Lo),i},stop:function(){return r=at.Stopped,n.clear(),i},get state(){return t},get status(){return r}};return i}var at,Lo,_o,Bo=D(()=>{"use strict";(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(at||(at={}));Lo={type:"xstate.init"};_o=function(e,t){return e.actions.forEach((function(r){var n=r.exec;return n&&n(e.context,t)}))}});function tl(e,t){for(let r=e.length-1;r>=0;r--){let n=e[r];if(n.type===A.Meta&&n.timestamp<=t)return e.slice(r)}return e}function Uo(e,{getCastFn:t,applyEventsSynchronously:r,emitter:n}){let i=Sn({id:"player",context:e,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:qe({lastPlayedEvent:(o,s)=>s.type==="CAST_EVENT"?s.payload.event:o.lastPlayedEvent}),recordTimeOffset:qe((o,s)=>{let a=o.timeOffset;return"payload"in s&&"timeOffset"in s.payload&&(a=s.payload.timeOffset),Object.assign(Object.assign({},o),{timeOffset:a,baselineTime:o.events[0].timestamp+a})}),play(o){var s;let{timer:a,events:l,baselineTime:c,lastPlayedEvent:u}=o;a.clear();for(let p of l)vn(p,c);let d=tl(l,c),f=u?.timestamp;u?.type===A.IncrementalSnapshot&&u.data.source===E.MouseMove&&(f=u.timestamp+((s=u.data.positions[0])===null||s===void 0?void 0:s.timeOffset)),c<(f||0)&&n.emit(G.PlayBack);let h=new Array;for(let p of d)if(!(f&&f<c&&(p.timestamp<=f||p===u)))if(p.timestamp<c)h.push(p);else{let v=t(p,!1);a.addAction({doAction:()=>{v()},delay:p.delay})}r(h),n.emit(G.Flush),a.start()},pause(o){o.timer.clear()},resetLastPlayedEvent:qe(o=>Object.assign(Object.assign({},o),{lastPlayedEvent:null})),startLive:qe({baselineTime:(o,s)=>(o.timer.toggleLiveMode(!0),o.timer.start(),s.type==="TO_LIVE"&&s.payload.baselineTime?s.payload.baselineTime:Date.now())}),addEvent:qe((o,s)=>{let{baselineTime:a,timer:l,events:c}=o;if(s.type==="ADD_EVENT"){let{event:u}=s.payload;vn(u,a);let d=c.length-1;if(!c[d]||c[d].timestamp<=u.timestamp)c.push(u);else{let p=-1,v=0;for(;v<=d;){let I=Math.floor((v+d)/2);c[I].timestamp<=u.timestamp?v=I+1:d=I-1}p===-1&&(p=v),c.splice(p,0,u)}let f=u.timestamp<a,h=t(u,f);f?h():l.isActive()&&l.addAction({doAction:()=>{h()},delay:u.delay})}return Object.assign(Object.assign({},o),{events:c})})}});return Cn(i)}function Wo(e){let t=Sn({id:"speed",context:e,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:(r,n)=>{"payload"in n&&r.timer.setSpeed(n.payload.speed)},recordSpeed:qe({normalSpeed:r=>r.timer.speed}),restoreSpeed:r=>{r.timer.setSpeed(r.normalSpeed)}}});return Cn(t)}var Po=D(()=>{"use strict";Bo();ve();yn()});var Go,Vo=D(()=>{"use strict";Go=e=>[`.${e} { background: currentColor }`,"noscript { display: none !important; }"]});function bn(e,t){let r=Ho.get(e);return r||(r=new Map,Ho.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}function Ee(e,t,r){return n=>ye(this,void 0,void 0,function*(){if(n&&typeof n=="object"&&"rr_type"in n)if(r&&(r.isUnchanged=!1),n.rr_type==="ImageBitmap"&&"args"in n){let i=yield Ee(e,t,r)(n.args);return yield createImageBitmap.apply(null,i)}else if("index"in n){if(r||t===null)return n;let{rr_type:i,index:o}=n;return bn(t,i)[o]}else if("args"in n){let{rr_type:i,args:o}=n,s=window[i];return new s(...yield Promise.all(o.map(Ee(e,t,r))))}else{if("base64"in n)return wi(n.base64);if("src"in n){let i=e.get(n.src);if(i)return i;{let o=new Image;return o.src=n.src,e.set(n.src,o),o}}else if("data"in n&&n.rr_type==="Blob"){let i=yield Promise.all(n.data.map(Ee(e,t,r)));return new Blob(i,{type:n.type})}}else if(Array.isArray(n))return yield Promise.all(n.map(Ee(e,t,r)));return n})}var Ho,or=D(()=>{"use strict";Xe();Fr();Ho=new Map});function rl(e,t){try{return t===ge.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}function il(e,t){if(!t?.constructor)return;let{name:r}=t.constructor;if(!nl.includes(r))return;let n=bn(e,r);n.includes(t)||n.push(t)}function zo({mutation:e,target:t,type:r,imageMap:n,errorHandler:i}){return ye(this,void 0,void 0,function*(){try{let o=rl(t,r);if(!o)return;if(e.setter){o[e.property]=e.args[0];return}let s=o[e.property],a=yield Promise.all(e.args.map(Ee(n,o))),l=s.apply(o,a);il(o,l);let c=!1}catch(o){i(e,o)}})}var nl,Ko=D(()=>{"use strict";Xe();ve();or();nl=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"]});function Zo({event:e,mutation:t,target:r,imageMap:n,errorHandler:i}){return ye(this,void 0,void 0,function*(){try{let o=r.getContext("2d");if(t.setter){o[t.property]=t.args[0];return}let s=o[t.property];if(t.property==="drawImage"&&typeof t.args[0]=="string")n.get(e),s.apply(o,t.args);else{let a=yield Promise.all(t.args.map(Ee(n,o)));s.apply(o,a)}}catch(o){i(t,o)}})}var jo=D(()=>{"use strict";Xe();or()});function wn({event:e,mutation:t,target:r,imageMap:n,canvasEventMap:i,errorHandler:o}){return ye(this,void 0,void 0,function*(){try{let s=i.get(e)||t,a="commands"in s?s.commands:[s];if([ge.WebGL,ge.WebGL2].includes(t.type)){for(let l=0;l<a.length;l++){let c=a[l];yield zo({mutation:c,type:t.type,target:r,imageMap:n,errorHandler:o})}return}for(let l=0;l<a.length;l++){let c=a[l];yield Zo({event:e,mutation:c,target:r,imageMap:n,errorHandler:o})}}catch(s){o(t,s)}})}var Yo=D(()=>{"use strict";Xe();ve();Ko();jo()});function Xo(e){return e.type==A.IncrementalSnapshot&&(e.data.source==E.TouchMove||e.data.source==E.MouseInteraction&&e.data.type==ie.TouchStart)}var ol,sl,al,En,An,sr,Jo=D(()=>{"use strict";Xe();xe();to();gn();gn();Ro();yn();Po();ve();me();Vo();Yo();or();ol=10*1e3,sl=5*1e3,al=pn||mn,En="[replayer]",An={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};sr=class{constructor(t,r){if(this.usingVirtualDom=!1,this.virtualDom=new Je,this.mouseTail=null,this.tailPositions=[],this.emitter=al(),this.legacy_missingNodeRetryMap={},this.cache=Ar(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=Ot(),this.styleMirror=new Ze,this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,this.lastSelectionData=null,this.constructedStyleMutations=[],this.adoptedStyleSheets=[],this.handleResize=a=>{this.iframe.style.display="inherit";for(let l of[this.mouseTail,this.iframe])l&&(l.setAttribute("width",String(a.width)),l.setAttribute("height",String(a.height)))},this.applyEventsSynchronously=a=>{for(let l of a){switch(l.type){case A.DomContentLoaded:case A.Load:case A.Custom:continue;case A.FullSnapshot:case A.Meta:case A.Plugin:case A.IncrementalSnapshot:break}this.getCastFn(l,!0)()}this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null},this.getCastFn=(a,l=!1)=>{let c;switch(a.type){case A.DomContentLoaded:case A.Load:break;case A.Custom:c=()=>{this.emitter.emit(G.CustomEvent,a)};break;case A.Meta:c=()=>this.emitter.emit(G.Resize,{width:a.data.width,height:a.data.height});break;case A.FullSnapshot:c=()=>{var d;if(this.firstFullSnapshot){if(this.firstFullSnapshot===a){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(a,l),(d=this.iframe.contentWindow)===null||d===void 0||d.scrollTo(a.data.initialOffset),this.styleMirror.reset()};break;case A.IncrementalSnapshot:c=()=>{if(this.applyIncremental(a,l),!l&&(a===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(let d of this.service.state.context.events)if(!(d.timestamp<=a.timestamp)&&this.isUserInteraction(d)){d.delay-a.delay>ol*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=d);break}if(this.nextUserInteractionEvent){let d=this.nextUserInteractionEvent.delay-a.delay,f={speed:Math.min(Math.round(d/sl),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:f}),this.emitter.emit(G.SkipStart,f)}}};break}return()=>{c&&c();for(let f of this.config.plugins||[])f.handler&&f.handler(a,l,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:a}});let d=this.service.state.context.events.length-1;if(a===this.service.state.context.events[d]){let f=()=>{d<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(G.Finish))};a.type===A.IncrementalSnapshot&&a.data.source===E.MouseMove&&a.data.positions.length?setTimeout(()=>{f()},Math.max(0,-a.data.positions[0].timeOffset+50)):f()}this.emitter.emit(G.EventCast,a)}},!r?.liveMode&&t.length<2)throw new Error("Replayer need at least 2 events.");let n={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:An,useVirtualDom:!0};this.config=Object.assign({},n,r),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(G.Resize,this.handleResize),this.setupDom();for(let a of this.config.plugins||[])a.getMirror&&a.getMirror({nodeMirror:this.mirror});this.emitter.on(G.Flush,()=>{if(this.usingVirtualDom){let a={mirror:this.mirror,applyCanvas:(l,c,u)=>{wn({event:l,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:(l,c)=>{l.source===E.StyleSheetRule?this.applyStyleSheetRule(l,c):l.source===E.StyleDeclaration&&this.applyStyleDeclaration(l,c)}};if(this.iframe.contentDocument&&be(this.iframe.contentDocument,this.virtualDom,a,this.virtualDom.mirror),this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(let l in this.legacy_missingNodeRetryMap)try{let c=this.legacy_missingNodeRetryMap[l],u=Xt(c.node,this.mirror,this.virtualDom.mirror);be(u,c.node,a,this.virtualDom.mirror),c.node=u}catch(c){this.config.showWarning&&console.warn(c)}this.constructedStyleMutations.forEach(l=>{this.applyStyleSheetMutation(l)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(l=>{this.applyAdoptedStyleSheet(l)}),this.adoptedStyleSheets=[]}this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(G.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset()});let i=new nr([],{speed:this.config.speed,liveMode:this.config.liveMode});this.service=Uo({events:t.map(a=>r&&r.unpackFn?r.unpackFn(a):a).sort((a,l)=>a.timestamp-l.timestamp),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(a=>{this.emitter.emit(G.StateChange,{player:a})}),this.speedService=Wo({normalSpeed:-1,timer:i}),this.speedService.start(),this.speedService.subscribe(a=>{this.emitter.emit(G.StateChange,{speed:a})});let o=this.service.state.context.events.find(a=>a.type===A.Meta),s=this.service.state.context.events.find(a=>a.type===A.FullSnapshot);if(o){let{width:a,height:l}=o.data;setTimeout(()=>{this.emitter.emit(G.Resize,{width:a,height:l})},0)}s&&setTimeout(()=>{var a;this.firstFullSnapshot||(this.firstFullSnapshot=s,this.rebuildFullSnapshot(s),(a=this.iframe.contentWindow)===null||a===void 0||a.scrollTo(s.data.initialOffset))},1),this.service.state.context.events.find(Xo)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(t,r){return this.emitter.on(t,r),this}off(t,r){return this.emitter.off(t,r),this}setConfig(t){Object.keys(t).forEach(r=>{t[r],this.config[r]=t[r]}),this.config.skipInactive||this.backToNormal(),typeof t.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:t.speed}}),typeof t.mouseTail<"u"&&(t.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(){let t=this.service.state.context.events[0],r=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:t.timestamp,endTime:r.timestamp,totalTime:r.timestamp-t.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){let{baselineTime:t,events:r}=this.service.state.context;return t-r[0].timestamp}getMirror(){return this.mirror}play(t=0){var r,n;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:t}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:t}})),(n=(r=this.iframe.contentDocument)===null||r===void 0?void 0:r.getElementsByTagName("html")[0])===null||n===void 0||n.classList.remove("rrweb-paused"),this.emitter.emit(G.Start)}pause(t){var r,n;t===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof t=="number"&&(this.play(t),this.service.send({type:"PAUSE"})),(n=(r=this.iframe.contentDocument)===null||r===void 0?void 0:r.getElementsByTagName("html")[0])===null||n===void 0||n.classList.add("rrweb-paused"),this.emitter.emit(G.Pause)}resume(t=0){console.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(t),this.emitter.emit(G.Resume)}destroy(){this.pause(),this.config.root.removeChild(this.wrapper),this.emitter.emit(G.Destroy)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){let r=this.config.unpackFn?this.config.unpackFn(t):t;Xo(r)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:r}}))}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=Ar()}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");let t=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&t.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",t.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(Mo(this.iframe.contentWindow,this.iframe.contentDocument),gt(this.iframe.contentWindow))}rebuildFullSnapshot(t,r=!1){if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};let n=[],i=(a,l)=>{this.collectIframeAndAttachDocument(n,a);for(let c of this.config.plugins||[])c.onBuild&&c.onBuild(a,{id:l,replayer:this})};ni(t.data.node,{doc:this.iframe.contentDocument,afterAppend:i,cache:this.cache,mirror:this.mirror}),i(this.iframe.contentDocument,t.data.node.id);for(let{mutationInQueue:a,builtNode:l}of n)this.attachDocumentToIframe(a,l),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==a);let{documentElement:o,head:s}=this.iframe.contentDocument;this.insertStyleRules(o,s),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(G.FullsnapshotRebuilded,t),r||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,r){var n;let i=Go(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){let o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,qr(o,this.virtualDom.unserializedId)),t.insertBefore(o,r),o.rules.push({source:E.StyleSheetRule,adds:i.map((s,a)=>({rule:s,index:a}))})}else{let o=document.createElement("style");t.insertBefore(o,r);for(let s=0;s<i.length;s++)(n=o.sheet)===null||n===void 0||n.insertRule(i[s],s)}}attachDocumentToIframe(t,r){let n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[],o=(s,a)=>{this.collectIframeAndAttachDocument(i,s);let l=n.getMeta(s);if(l?.type===B.Element&&l?.tagName.toUpperCase()==="HTML"){let{documentElement:c,head:u}=r.contentDocument;this.insertStyleRules(c,u)}for(let c of this.config.plugins||[])c.onBuild&&c.onBuild(s,{id:a,replayer:this})};it(t.node,{doc:r.contentDocument,mirror:n,hackCss:!0,skipChild:!1,afterAppend:o,cache:this.cache}),o(r.contentDocument,t.node.id);for(let{mutationInQueue:s,builtNode:a}of i)this.attachDocumentToIframe(s,a),this.newDocumentQueue=this.newDocumentQueue.filter(l=>l!==s)}collectIframeAndAttachDocument(t,r){if(ke(r,this.mirror)){let n=this.newDocumentQueue.find(i=>i.parentId===this.mirror.getId(r));n&&t.push({mutationInQueue:n,builtNode:r})}}waitForStylesheetLoad(){var t;let r=(t=this.iframe.contentDocument)===null||t===void 0?void 0:t.head;if(r){let n=new Set,i,o=this.service.state,s=()=>{o=this.service.state};this.emitter.on(G.Start,s),this.emitter.on(G.Pause,s);let a=()=>{this.emitter.off(G.Start,s),this.emitter.off(G.Pause,s)};r.querySelectorAll('link[rel="stylesheet"]').forEach(l=>{l.sheet||(n.add(l),l.addEventListener("load",()=>{n.delete(l),n.size===0&&i!==-1&&(o.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(G.LoadStylesheetEnd),i&&clearTimeout(i),a())}))}),n.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(G.LoadStylesheetStart),i=setTimeout(()=>{o.matches("playing")&&this.play(this.getCurrentTime()),i=-1,a()},this.config.loadTimeout))}}preloadAllImages(){return ye(this,void 0,void 0,function*(){this.service.state;let t=()=>{this.service.state};this.emitter.on(G.Start,t),this.emitter.on(G.Pause,t);let r=[];for(let n of this.service.state.context.events)n.type===A.IncrementalSnapshot&&n.data.source===E.CanvasMutation&&(r.push(this.deserializeAndPreloadCanvasEvents(n.data,n)),("commands"in n.data?n.data.commands:[n.data]).forEach(o=>{this.preloadImages(o,n)}));return Promise.all(r)})}preloadImages(t,r){if(t.property==="drawImage"&&typeof t.args[0]=="string"&&!this.imageMap.has(r)){let n=document.createElement("canvas"),i=n.getContext("2d"),o=i?.createImageData(n.width,n.height);o?.data,JSON.parse(t.args[0]),i?.putImageData(o,0,0)}}deserializeAndPreloadCanvasEvents(t,r){return ye(this,void 0,void 0,function*(){if(!this.canvasEventMap.has(r)){let n={isUnchanged:!0};if("commands"in t){let i=yield Promise.all(t.commands.map(o=>ye(this,void 0,void 0,function*(){let s=yield Promise.all(o.args.map(Ee(this.imageMap,null,n)));return Object.assign(Object.assign({},o),{args:s})})));n.isUnchanged===!1&&this.canvasEventMap.set(r,Object.assign(Object.assign({},t),{commands:i}))}else{let i=yield Promise.all(t.args.map(Ee(this.imageMap,null,n)));n.isUnchanged===!1&&this.canvasEventMap.set(r,Object.assign(Object.assign({},t),{args:i}))}}})}applyIncremental(t,r){var n,i,o;let{data:s}=t;switch(s.source){case E.Mutation:{try{this.applyMutation(s,r)}catch(a){this.warn(`Exception in mutation ${a.message||a}`,s)}break}case E.Drag:case E.TouchMove:case E.MouseMove:if(r){let a=s.positions[s.positions.length-1];this.mousePos={x:a.x,y:a.y,id:a.id,debugData:s}}else s.positions.forEach(a=>{let l={doAction:()=>{this.moveAndHover(a.x,a.y,a.id,r,s)},delay:a.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(l)}),this.timer.addAction({doAction(){},delay:t.delay-((n=s.positions[0])===null||n===void 0?void 0:n.timeOffset)});break;case E.MouseInteraction:{if(s.id===-1||r)break;let a=new Event(ie[s.type].toLowerCase()),l=this.mirror.getNode(s.id);if(!l)return this.debugNodeNotFound(s,s.id);this.emitter.emit(G.MouseInteraction,{type:s.type,target:l});let{triggerFocus:c}=this.config;switch(s.type){case ie.Blur:"blur"in l&&l.blur();break;case ie.Focus:c&&l.focus&&l.focus({preventScroll:!0});break;case ie.Click:case ie.TouchStart:case ie.TouchEnd:r?(s.type===ie.TouchStart?this.touchActive=!0:s.type===ie.TouchEnd&&(this.touchActive=!1),this.mousePos={x:s.x,y:s.y,id:s.id,debugData:s}):(s.type===ie.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(s.x,s.y,s.id,r,s),s.type===ie.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):s.type===ie.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):s.type===ie.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case ie.TouchCancel:r?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:l.dispatchEvent(a)}break}case E.Scroll:{if(s.id===-1)break;if(this.usingVirtualDom){let a=this.virtualDom.mirror.getNode(s.id);if(!a)return this.debugNodeNotFound(s,s.id);a.scrollData=s;break}this.applyScroll(s,r);break}case E.ViewportResize:this.emitter.emit(G.Resize,{width:s.width,height:s.height});break;case E.Input:{if(s.id===-1)break;if(this.usingVirtualDom){let a=this.virtualDom.mirror.getNode(s.id);if(!a)return this.debugNodeNotFound(s,s.id);a.inputData=s;break}this.applyInput(s);break}case E.MediaInteraction:{let a=this.usingVirtualDom?this.virtualDom.mirror.getNode(s.id):this.mirror.getNode(s.id);if(!a)return this.debugNodeNotFound(s,s.id);let l=a;try{s.currentTime&&(l.currentTime=s.currentTime),s.volume&&(l.volume=s.volume),s.muted&&(l.muted=s.muted),s.type===1&&l.pause(),s.type===0&&l.play(),s.type===4&&(l.playbackRate=s.playbackRate)}catch(c){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${c.message||c}`)}break}case E.StyleSheetRule:case E.StyleDeclaration:{this.usingVirtualDom?s.styleId?this.constructedStyleMutations.push(s):s.id&&((i=this.virtualDom.mirror.getNode(s.id))===null||i===void 0||i.rules.push(s)):this.applyStyleSheetMutation(s);break}case E.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){let a=this.virtualDom.mirror.getNode(s.id);if(!a)return this.debugNodeNotFound(s,s.id);a.canvasMutations.push({event:t,mutation:s})}else{let a=this.mirror.getNode(s.id);if(!a)return this.debugNodeNotFound(s,s.id);wn({event:t,mutation:s,target:a,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case E.Font:{try{let a=new FontFace(s.family,s.buffer?new Uint8Array(JSON.parse(s.fontSource)):s.fontSource,s.descriptors);(o=this.iframe.contentDocument)===null||o===void 0||o.fonts.add(a)}catch(a){this.config.showWarning&&console.warn(a)}break}case E.Selection:{if(r){this.lastSelectionData=s;break}this.applySelection(s);break}case E.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(s):this.applyAdoptedStyleSheet(s);break}}}applyMutation(t,r){if(this.config.useVirtualDom&&!this.usingVirtualDom&&r&&(this.usingVirtualDom=!0,eo(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(let c in this.legacy_missingNodeRetryMap)try{let u=this.legacy_missingNodeRetryMap[c],d=Qr(u.node,this.virtualDom,this.mirror);d&&(u.node=d)}catch(u){this.config.showWarning&&console.warn(u)}let n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;t.removes.forEach(c=>{var u;let d=n.getNode(c.id);if(!d)return t.removes.find(h=>h.id===c.parentId)?void 0:this.warnNodeNotFound(t,c.id);let f=n.getNode(c.parentId);if(!f)return this.warnNodeNotFound(t,c.parentId);if(c.isShadow&&Ae(f)&&(f=f.shadowRoot),n.removeNodeFromMap(d),f)try{f.removeChild(d),this.usingVirtualDom&&d.nodeName==="#text"&&f.nodeName==="STYLE"&&((u=f.rules)===null||u===void 0?void 0:u.length)>0&&(f.rules=[])}catch(h){if(h instanceof DOMException)this.warn("parent could not remove child in mutation",f,d,t);else throw h}});let i=Object.assign({},this.legacy_missingNodeRetryMap),o=[],s=c=>{let u=null;return c.nextId&&(u=n.getNode(c.nextId)),c.nextId!==null&&c.nextId!==void 0&&c.nextId!==-1&&!u},a=c=>{var u;if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");let d=n.getNode(c.parentId);if(!d)return c.node.type===B.Document?this.newDocumentQueue.push(c):o.push(c);c.node.isShadow&&(Ae(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let f=null,h=null;if(c.previousId&&(f=n.getNode(c.previousId)),c.nextId&&(h=n.getNode(c.nextId)),s(c))return o.push(c);if(c.node.rootId&&!n.getNode(c.node.rootId))return;let p=c.node.rootId?n.getNode(c.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(ke(d,n)){this.attachDocumentToIframe(c,d);return}let v=(m,y)=>{for(let b of this.config.plugins||[])b.onBuild&&b.onBuild(m,{id:y,replayer:this})},I=it(c.node,{doc:p,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:v});if(c.previousId===-1||c.nextId===-1){i[c.node.id]={node:I,mutation:c};return}let g=n.getMeta(d);if(g&&g.type===B.Element&&g.tagName==="textarea"&&c.node.type===B.Text){let m=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);for(let y of m)y.nodeType===d.TEXT_NODE&&d.removeChild(y)}if(f&&f.nextSibling&&f.nextSibling.parentNode)d.insertBefore(I,f.nextSibling);else if(h&&h.parentNode)d.contains(h)?d.insertBefore(I,h):d.insertBefore(I,null);else{if(d===p)for(;p.firstChild;)p.removeChild(p.firstChild);d.appendChild(I)}if(v(I,c.node.id),this.usingVirtualDom&&I.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)===null||u===void 0?void 0:u.length)>0&&(d.rules=[]),ke(I,this.mirror)){let m=this.mirror.getId(I),y=this.newDocumentQueue.find(b=>b.parentId===m);y&&(this.attachDocumentToIframe(y,I),this.newDocumentQueue=this.newDocumentQueue.filter(b=>b!==y))}(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(i,d,I,c)};t.adds.forEach(c=>{a(c)});let l=Date.now();for(;o.length;){let c=Tr(o);if(o.length=0,Date.now()-l>500){this.warn("Timeout in the loop, please check the resolve tree data:",c);break}for(let u of c)n.getNode(u.value.parentId)?Ft(u,f=>{a(f)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),Mr(t.texts).forEach(c=>{var u;let d=n.getNode(c.id);if(!d)return t.removes.find(f=>f.id===c.id)?void 0:this.warnNodeNotFound(t,c.id);if(d.textContent=c.value,this.usingVirtualDom){let f=d.parentNode;((u=f?.rules)===null||u===void 0?void 0:u.length)>0&&(f.rules=[])}}),t.attributes.forEach(c=>{let u=n.getNode(c.id);if(!u)return t.removes.find(d=>d.id===c.id)?void 0:this.warnNodeNotFound(t,c.id);for(let d in c.attributes)if(typeof d=="string"){let f=c.attributes[d];if(f===null)u.removeAttribute(d);else if(typeof f=="string")try{if(d==="_cssText"&&(u.nodeName==="LINK"||u.nodeName==="STYLE"))try{let h=n.getMeta(u);Object.assign(h.attributes,c.attributes);let p=it(h,{doc:u.ownerDocument,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache}),v=u.nextSibling,I=u.parentNode;if(p&&I){I.removeChild(u),I.insertBefore(p,v),n.replace(c.id,p);break}}catch{}u.setAttribute(d,f)}catch(h){this.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",h)}else if(d==="style"){let h=f,p=u;for(let v in h)if(h[v]===!1)p.style.removeProperty(v);else if(h[v]instanceof Array){let I=h[v];p.style.setProperty(v,I[0],I[1])}else{let I=h[v];p.style.setProperty(v,I)}}}})}applyScroll(t,r){var n,i;let o=this.mirror.getNode(t.id);if(!o)return this.debugNodeNotFound(t,t.id);let s=this.mirror.getMeta(o);if(o===this.iframe.contentDocument)(n=this.iframe.contentWindow)===null||n===void 0||n.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else if(s?.type===B.Document)(i=o.defaultView)===null||i===void 0||i.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else try{o.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"})}catch{}}applyInput(t){let r=this.mirror.getNode(t.id);if(!r)return this.debugNodeNotFound(t,t.id);try{r.checked=t.isChecked,r.value=t.text}catch{}}applySelection(t){try{let r=new Set,n=t.ranges.map(({start:i,startOffset:o,end:s,endOffset:a})=>{let l=this.mirror.getNode(i),c=this.mirror.getNode(s);if(!l||!c)return;let u=new Range;u.setStart(l,o),u.setEnd(c,a);let d=l.ownerDocument,f=d?.getSelection();return f&&r.add(f),{range:u,selection:f}});r.forEach(i=>i.removeAllRanges()),n.forEach(i=>{var o;return i&&((o=i.selection)===null||o===void 0?void 0:o.addRange(i.range))})}catch{}}applyStyleSheetMutation(t){var r;let n=null;t.styleId?n=this.styleMirror.getStyle(t.styleId):t.id&&(n=((r=this.mirror.getNode(t.id))===null||r===void 0?void 0:r.sheet)||null),n&&(t.source===E.StyleSheetRule?this.applyStyleSheetRule(t,n):t.source===E.StyleDeclaration&&this.applyStyleDeclaration(t,n))}applyStyleSheetRule(t,r){var n,i,o,s;if((n=t.adds)===null||n===void 0||n.forEach(({rule:a,index:l})=>{try{if(Array.isArray(l)){let{positions:c,index:u}=Ut(l);Ye(r.cssRules,c).insertRule(a,u)}else{let c=l===void 0?void 0:Math.min(l,r.cssRules.length);r?.insertRule(a,c)}}catch{}}),(i=t.removes)===null||i===void 0||i.forEach(({index:a})=>{try{if(Array.isArray(a)){let{positions:l,index:c}=Ut(a);Ye(r.cssRules,l).deleteRule(c||0)}else r?.deleteRule(a)}catch{}}),t.replace)try{(o=r.replace)===null||o===void 0||o.call(r,t.replace)}catch{}if(t.replaceSync)try{(s=r.replaceSync)===null||s===void 0||s.call(r,t.replaceSync)}catch{}}applyStyleDeclaration(t,r){t.set&&Ye(r.rules,t.index).style.setProperty(t.set.property,t.set.value,t.set.priority),t.remove&&Ye(r.rules,t.index).style.removeProperty(t.remove.property)}applyAdoptedStyleSheet(t){var r;let n=this.mirror.getNode(t.id);if(!n)return;(r=t.styles)===null||r===void 0||r.forEach(a=>{var l;let c=null,u=null;if(Ae(n)?u=((l=n.ownerDocument)===null||l===void 0?void 0:l.defaultView)||null:n.nodeName==="#document"&&(u=n.defaultView),!!u)try{c=new u.CSSStyleSheet,this.styleMirror.add(c,a.styleId),this.applyStyleSheetRule({source:E.StyleSheetRule,adds:a.rules},c)}catch{}});let i=10,o=0,s=(a,l)=>{let c=l.map(u=>this.styleMirror.getStyle(u)).filter(u=>u!==null);Ae(a)?a.shadowRoot.adoptedStyleSheets=c:a.nodeName==="#document"&&(a.adoptedStyleSheets=c),c.length!==l.length&&o<i&&(setTimeout(()=>s(a,l),0+100*o),o++)};s(n,t.styleIds)}legacy_resolveMissingNode(t,r,n,i){let{previousId:o,nextId:s}=i,a=o&&t[o],l=s&&t[s];if(a){let{node:c,mutation:u}=a;r.insertBefore(c,n),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,r,c,u)}if(l){let{node:c,mutation:u}=l;r.insertBefore(c,n.nextSibling),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,r,c,u)}}moveAndHover(t,r,n,i,o){let s=this.mirror.getNode(n);if(!s)return this.debugNodeNotFound(o,n);let a=Bt(s,this.iframe),l=t*a.absoluteScale+a.x,c=r*a.absoluteScale+a.y;this.mouse.style.left=`${l}px`,this.mouse.style.top=`${c}px`,i||this.drawMouseTail({x:l,y:c}),this.hoverElements(s)}drawMouseTail(t){if(!this.mouseTail)return;let{lineCap:r,lineWidth:n,strokeStyle:i,duration:o}=this.config.mouseTail===!0?An:Object.assign({},An,this.config.mouseTail),s=()=>{if(!this.mouseTail)return;let a=this.mouseTail.getContext("2d");!a||!this.tailPositions.length||(a.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),a.beginPath(),a.lineWidth=n,a.lineCap=r,a.strokeStyle=i,a.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(l=>a.lineTo(l.x,l.y)),a.stroke())};this.tailPositions.push(t),s(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(a=>a!==t),s()},o/this.speedService.state.context.timer.speed)}hoverElements(t){var r;(r=this.iframe.contentDocument)===null||r===void 0||r.querySelectorAll(".\\:hover").forEach(i=>{i.classList.remove(":hover")});let n=t;for(;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement}isUserInteraction(t){return t.type!==A.IncrementalSnapshot?!1:t.data.source>E.Mutation&&t.data.source<=E.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(G.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(t,r){this.warn(`Node with id '${r}' not found. `,t)}warnCanvasMutationFailed(t,r){this.warn("Has error on canvas update",r,"canvas mutation:",t)}debugNodeNotFound(t,r){this.debug(En,`Node with id '${r}' not found. `,t)}warn(...t){this.config.showWarning&&console.warn(En,...t)}debug(...t){this.config.showDebug&&console.log(En,...t)}}});var Qo={};et(Qo,{EventType:()=>A,IncrementalSource:()=>E,MouseInteractions:()=>ie,PLUGIN_NAME:()=>Nt,Replayer:()=>sr,ReplayerEvents:()=>G,addCustomEvent:()=>ro,freezePage:()=>no,getRecordConsolePlugin:()=>Ao,getReplayConsolePlugin:()=>No,mirror:()=>ft,pack:()=>go,record:()=>De,unpack:()=>yo,utils:()=>Rr});var qo=D(()=>{"use strict";io();vo();Io();fn();To();Vr();ve();Jo();me();me()});var es={};et(es,{startRrweb:()=>ll});async function ll(e){if(typeof window>"u")return null;let t;try{t=await Promise.resolve().then(()=>(qo(),Qo))}catch{return null}let r=e.options.mask?.class??"segi-mask",n=e.options.mask?.inputs??"all",i=n==="all"?{password:!0,email:!0,tel:!0,number:!0,text:!0,textarea:!0}:n==="sensitive"?{password:!0,email:!0,tel:!0,number:!0}:{password:!0},o=[],s=0,a=null,l=Date.now(),c=!1,u=!1,d=setInterval(()=>{c||u||v()},1e4),f=setInterval(()=>{c||u||Date.now()-l>=18e4&&p()},15e3);function h(){if(a)return;let m=t.record({emit(y){if(!(c||u)){o.push(y);try{s+=JSON.stringify(y).length}catch{}s>=102400&&v()}},sampling:{mousemove:20,scroll:150},maskAllInputs:n==="all",maskInputOptions:i,blockClass:r,ignoreClass:r,maskTextClass:r,recordCanvas:!1,collectFonts:!1,checkoutEveryNms:3e4});a=typeof m=="function"?m:null}function p(){try{a?.()}finally{a=null}v()}function v(m=!1){if(o.length===0)return;let y=o;o=[],s=0;try{e.sendChunk(y,m)}catch{}}function I(){l=Date.now(),!a&&!c&&!u&&h()}for(let m of $o)window.addEventListener(m,I,{passive:!0});let g=()=>v(!0);return window.addEventListener("pagehide",g),h(),{pause(){c=!0,p()},resume(){c=!1,l=Date.now(),h()},stop(){u=!0,p(),clearInterval(d),clearInterval(f);for(let m of $o)window.removeEventListener(m,I);window.removeEventListener("pagehide",g)},flush:v}}var $o,ts=D(()=>{"use strict";$o=["mousemove","mousedown","keydown","touchstart","scroll","wheel"]});var is={};et(is,{activateReplay:()=>ul,replayApi:()=>dl,withReplay:()=>cl});function cl(e={}){return{__segi_replay:!0,options:e}}function rs(){if(typeof window>"u")return"desktop";let e=window.innerWidth;return e<640?"mobile":e<1024?"tablet":"desktop"}function $e(e){if(!(typeof location>"u"))try{return new URLSearchParams(location.search).get(e)??void 0}catch{return}}function ns(e,t){return(e.blockRoutes??[]).some(n=>t.startsWith(n))}async function ul(e){if(x||typeof window>"u")return;let t=e.config.options;if(t.enabled===!1)return;let r=Math.max(0,Math.min(100,t.sample??100));if(Math.random()*100>=r||ns(t,location.pathname))return;let n=zn(),i=gr(),o={endpoint:t.endpoint??e.endpoint,projectKey:e.projectKey},s={sessionUid:n,anonId:i,startedAt:new Date().toISOString(),device:rs(),viewportW:window.innerWidth,viewportH:window.innerHeight,ua:navigator.userAgent?.slice(0,512),referrer:document.referrer||void 0,landingUrl:location.href.slice(0,512),utmSource:$e("utm_source"),utmMedium:$e("utm_medium"),utmCampaign:$e("utm_campaign"),utmContent:$e("utm_content"),utmTerm:$e("utm_term"),fbclid:$e("fbclid"),gclid:$e("gclid")},a=!0;try{let c=await Me(o,"/session/start",s);c&&c.ok&&(await c.json().catch(()=>({}))).recordingEnabled===!1&&(a=!1)}catch{}if(!a){x={sessionUid:n,config:o,options:t,heatmap:null,rrweb:null,replayBlocked:!1,paused:!0,userId:null,startedAt:s.startedAt,pagesVisited:0,clickCount:0,recordingEnabled:!1};return}let l=Un({sessionUid:n,options:t,sendClicks:(c,u)=>{u?kt(o,"/heatmap/clicks",{clicks:c}):Me(o,"/heatmap/clicks",{clicks:c})},sendScroll:c=>{Me(o,"/heatmap/scroll",c)}});x={sessionUid:n,config:o,options:t,heatmap:l,rrweb:null,replayBlocked:!1,paused:!1,userId:null,startedAt:s.startedAt,pagesVisited:1,clickCount:0,recordingEnabled:!0},Promise.resolve().then(()=>(ts(),es)).then(({startRrweb:c})=>c({sessionUid:n,options:t,sendChunk:async(u,d)=>{if(!x||x.replayBlocked)return;if(d){kt(o,"/replay",{sessionUid:n,chunk:u});return}let f=await Me(o,"/replay",{sessionUid:n,chunk:u});f&&f.status===429&&x&&(x.replayBlocked=!0,x.rrweb?.stop(),x.rrweb=null)}})).then(c=>{c&&x&&(x.rrweb=c)}).catch(()=>{}),Me(o,"/events",{events:[{sessionUid:n,ts:new Date().toISOString(),type:"page_view",url:location.href,title:document.title}]}),window.addEventListener("pagehide",()=>{x&&(x.rrweb?.flush(!0),kt(x.config,"/session/end",{sessionUid:x.sessionUid,endedAt:new Date().toISOString(),durationMs:Date.now()-new Date(x.startedAt).getTime(),pagesVisited:x.pagesVisited,clickCount:x.clickCount}))})}var x,dl,os=D(()=>{"use strict";Wn();Zn();Yn();x=null;dl={pause(){x?.heatmap?.pause(),x?.rrweb?.pause(),x&&(x.paused=!0)},resume(){x?.heatmap?.resume(),x?.rrweb?.resume(),x&&(x.paused=!1),Kn()},setUser(e){x&&(x.userId=e?.id??null,Me(x.config,"/session/start",{sessionUid:x.sessionUid,anonId:gr(),userId:x.userId,startedAt:x.startedAt,device:rs(),viewportW:window.innerWidth,viewportH:window.innerHeight}))},event(e,t){!x||x.paused||Me(x.config,"/events",{events:[{sessionUid:x.sessionUid,ts:new Date().toISOString(),type:"custom",name:e.slice(0,64),url:location.href,meta:t}]})},notifyRouteChange(e,t){if(!(!x||x.paused)){if(ns(x.options,location.pathname)){x.heatmap?.pause(),x.rrweb?.pause(),x.paused=!0;return}x.paused&&(x.heatmap?.resume(),x.rrweb?.resume(),x.paused=!1),x.pagesVisited+=1,Me(x.config,"/events",{events:[{sessionUid:x.sessionUid,ts:new Date().toISOString(),type:"page_view",url:e??location.href,title:t??document.title}]})}},_sessionUid(){return x?.sessionUid??null}}});var gl={};et(gl,{Segi:()=>Le,default:()=>ml});function Tn(){return{options:{projectKey:"",endpoint:""},user:null,tags:{},breadcrumbs:[],initialized:!1}}function Mn(e,t){let r=e.options.maxBreadcrumbs??50;e.breadcrumbs.push(t),e.breadcrumbs.length>r&&e.breadcrumbs.splice(0,e.breadcrumbs.length-r)}function cr(e,t){let r={type:t.type??"error",level:t.level??"error",message:t.message??"",errorName:t.errorName,stack:t.stack,platform:t.platform,runtime:t.runtime,environment:t.environment??e.options.environment,release:t.release??e.options.release,transaction:t.transaction,url:t.url,userAgent:t.userAgent,user:t.user??e.user??void 0,tags:{...e.tags,...t.tags??{}},extra:t.extra,breadcrumbs:e.breadcrumbs.slice(),request:t.request,timestamp:t.timestamp??new Date().toISOString()};if(e.options.beforeSend)try{let n=e.options.beforeSend(r);return n||{...r,_drop:!0}}catch{return r}return r}var Fn=fs(_n()),Ln=new Set;function hr(e,t){Ln.has(e)||(Ln.add(e),typeof console<"u"&&typeof console.warn=="function"&&console.warn(`[segi] ${t}`))}function bs(e){return e===401||e===403?"ingest rejected the project key (check projectKey + endpoint region)":e===404?"ingest endpoint not found (check endpoint URL)":e===413?"event payload too large; dropped by ingest":e===429?"ingest rate-limited (over plan quota or burst)":e>=500?"ingest is returning 5xx \u2014 events may be lost":"ingest returned a non-2xx response"}function pr(e,t,r){let n=e||Fn.SEGI_DEFAULT_INGEST_ENDPOINT;if(!n||!t){hr("missing-config",t?"init() called without a valid endpoint \u2014 events will not be sent":"init() called without a projectKey \u2014 events will not be sent");return}if(!r._drop)try{let i=JSON.stringify(r),o={"Content-Type":"application/json","X-Segi-Project-Key":t};if(typeof fetch=="function"){fetch(n,{method:"POST",headers:o,body:i,keepalive:!0,mode:"cors",credentials:"omit"}).then(s=>{s.ok||hr(`status-${s.status}`,`${bs(s.status)} (HTTP ${s.status} from ${n})`)}).catch(s=>{hr("network-error",`network error reaching ${n} \u2014 events not delivered (${s instanceof Error?s.message:String(s)})`)});return}if(typeof navigator<"u"&&typeof navigator.sendBeacon=="function"){let s=`${n}${n.includes("?")?"&":"?"}pk=${encodeURIComponent(t)}`,a=new Blob([i],{type:"application/json"});navigator.sendBeacon(s,a)}}catch{}}var se=Tn();function fl(e){try{if(e&&typeof e=="object"&&"stack"in e)return String(e.stack??"")}catch{}}function ar(e){if(se.initialized)try{if(e instanceof ErrorEvent){let t=e.error,r=t?.message??e.message??"Error";Le.captureException(t??new Error(r),{message:r,url:typeof location<"u"?location.href:void 0})}else if("reason"in e){let t=e.reason,r=t instanceof Error?t.message:typeof t=="string"?t:"Unhandled promise rejection";Le.captureException(t,{message:r,url:typeof location<"u"?location.href:void 0})}}catch{}}function hl(){typeof window>"u"||(window.addEventListener("error",ar,!0),window.addEventListener("unhandledrejection",ar,!0))}function ss(){typeof window>"u"||(window.removeEventListener("error",ar,!0),window.removeEventListener("unhandledrejection",ar,!0))}var pl={pause(){},resume(){},setUser(){},event(){},notifyRouteChange(){}},Le={replay:pl,init(e,t={}){try{let r=typeof window<"u"?window:null;if((se.initialized||r?.__segiInitialized===!0)&&!t.force){!t.silent&&typeof console<"u"&&console.warn("[segi] init() called more than once; ignoring. Pass { force: true } to override.");return}se.initialized&&ss();let{replay:i,...o}=e;se.options={...o},se.initialized=!0,r&&(r.__segiInitialized=!0),hl(),i?.__segi_replay&&Promise.resolve().then(()=>(os(),is)).then(s=>(Le.replay=s.replayApi,s.activateReplay({projectKey:o.projectKey,endpoint:o.endpoint,config:i}))).catch(()=>{})}catch{}},isInitialized(){return se.initialized},close(){try{if(ss(),se.initialized=!1,se.user=null,se.tags={},se.breadcrumbs=[],typeof window<"u"){let e=window;e.__segiInitialized=!1}}catch{}},captureException(e,t={}){try{if(!se.initialized)return;let r=e instanceof Error?e:new Error(typeof e=="string"?e:JSON.stringify(e)),n=cr(se,{type:"error",level:"error",message:r.message,errorName:r.name,stack:fl(r),platform:"javascript",runtime:"browser",url:t.url??(typeof location<"u"?location.href:void 0),userAgent:t.userAgent??(typeof navigator<"u"?navigator.userAgent:void 0),...t});pr(se.options.endpoint,se.options.projectKey,n)}catch{}},captureMessage(e,t={}){try{if(!se.initialized)return;let r=cr(se,{type:"message",level:t.level??"info",message:e,platform:"javascript",runtime:"browser",url:typeof location<"u"?location.href:void 0,userAgent:typeof navigator<"u"?navigator.userAgent:void 0,...t});pr(se.options.endpoint,se.options.projectKey,r)}catch{}},setUser(e){try{se.user=e}catch{}},setTag(e,t){try{se.tags[e]=t}catch{}},addBreadcrumb(e){try{Mn(se,{...e,timestamp:e.timestamp??new Date().toISOString()})}catch{}}};(function(){try{let t=window;if(t.__segiBundleLoaded){typeof console<"u"&&console.warn("[segi] segi.min.js loaded more than once; ignoring this load.");return}t.__segiBundleLoaded=!0;let r=t.SegiConfig??{},n={},i=document.getElementsByTagName("script");for(let a=i.length-1;a>=0;a--){let l=i[a];if(l.src&&/segi(\.min)?\.js/.test(l.src)){n={projectKey:l.dataset.projectKey,endpoint:l.dataset.endpoint,environment:l.dataset.environment,release:l.dataset.release};break}}let o=r.projectKey??n.projectKey,s=r.endpoint??n.endpoint;if(!o){t.Segi=Le;return}Le.init({projectKey:o,endpoint:s,environment:r.environment??n.environment,release:r.release??n.release}),t.Segi=Le}catch{}})();var ml=Le;return hs(gl);})();
17
+ at `,n=r;return n+=t.trace.join(r),n}},No=e=>{let t=e?.replayLogger||new hn(e).getConsoleLogger();return{handler(r,n,i){let o=null;if(r.type===A.IncrementalSnapshot&&r.data.source===E.Log?o=r.data:r.type===A.Plugin&&r.data.plugin===Nt&&(o=r.data.payload),o)try{typeof t[o.level]=="function"&&t[o.level](o)}catch(s){i.replayer.config.showWarning&&console.warn(s)}}}}});var mn={};et(mn,{default:()=>pn});function pn(e){return{all:e=e||new Map,on:function(t,r){var n=e.get(t);n?n.push(r):e.set(t,[r])},off:function(t,r){var n=e.get(t);n&&(r?n.splice(n.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var n=e.get(t);n&&n.slice().map(function(i){i(r)}),(n=e.get("*"))&&n.slice().map(function(i){i(t,r)})}}}var gn=D(()=>{"use strict"});function Ro(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;let r=e.HTMLElement||e.Element,n=468,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||l,scrollIntoView:r.prototype.scrollIntoView},o=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function s(m){let g=["MSIE ","Trident/","Edge/"];return new RegExp(g.join("|")).test(m)}let a=s(e.navigator.userAgent)?1:0;function l(m,g){this.scrollLeft=m,this.scrollTop=g}function c(m){return .5*(1-Math.cos(Math.PI*m))}function u(m){if(m===null||typeof m!="object"||m.behavior===void 0||m.behavior==="auto"||m.behavior==="instant")return!0;if(typeof m=="object"&&m.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+m.behavior+" is not a valid value for enumeration ScrollBehavior.")}function d(m,g){if(g==="Y")return m.clientHeight+a<m.scrollHeight;if(g==="X")return m.clientWidth+a<m.scrollWidth}function f(m,g){let y=e.getComputedStyle(m,null)["overflow"+g];return y==="auto"||y==="scroll"}function h(m){let g=d(m,"Y")&&f(m,"Y"),y=d(m,"X")&&f(m,"X");return g||y}function p(m){for(;m!==t.body&&h(m)===!1;)m=m.parentNode||m.host;return m}function v(m){let g=o(),y,b,M,N=(g-m.startTime)/n;N=N>1?1:N,y=c(N),b=m.startX+(m.x-m.startX)*y,M=m.startY+(m.y-m.startY)*y,m.method.call(m.scrollable,b,M),(b!==m.x||M!==m.y)&&e.requestAnimationFrame(v.bind(e,m))}function I(m,g,y){let b,M,N,_,w=o();m===t.body?(b=e,M=e.scrollX||e.pageXOffset,N=e.scrollY||e.pageYOffset,_=i.scroll):(b=m,M=m.scrollLeft,N=m.scrollTop,_=l),v({scrollable:b,method:_,startTime:w,startX:M,startY:N,x:g,y})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){i.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset);return}I.call(e,t.body,arguments[0].left!==void 0?~~arguments[0].left:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:e.scrollY||e.pageYOffset)}},e.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])){i.scrollBy.call(e,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}I.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset))}},r.prototype.scroll=r.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");i.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}let m=arguments[0].left,g=arguments[0].top;I.call(this,this,typeof m>"u"?this.scrollLeft:~~m,typeof g>"u"?this.scrollTop:~~g)},r.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){i.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})}},r.prototype.scrollIntoView=function(){if(u(arguments[0])===!0){i.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}let m=p(this),g=m.getBoundingClientRect(),y=this.getBoundingClientRect();m!==t.body?(I.call(this,m,m.scrollLeft+y.left-g.left,m.scrollTop+y.top-g.top),e.getComputedStyle(m).position!=="fixed"&&e.scrollBy({left:g.left,top:g.top,behavior:"smooth"})):e.scrollBy({left:y.left,top:y.top,behavior:"smooth"})}}var Mo=D(()=>{"use strict"});function vn(e,t){if(e.type===A.IncrementalSnapshot&&e.data.source===E.MouseMove&&e.data.positions&&e.data.positions.length){let r=e.data.positions[0].timeOffset,n=e.timestamp+r;return e.delay=n-t,n-t}return e.delay=e.timestamp-t,e.delay}var nr,yn=D(()=>{"use strict";ve();nr=class{constructor(t=[],r){this.timeOffset=0,this.raf=null,this.actions=t,this.speed=r.speed,this.liveMode=r.liveMode}addAction(t){if(!this.actions.length||this.actions[this.actions.length-1].delay<=t.delay){this.actions.push(t);return}let r=this.findActionIndex(t);this.actions.splice(r,0,t)}start(){this.timeOffset=0;let t=performance.now(),r=()=>{let n=performance.now();for(this.timeOffset+=(n-t)*this.speed,t=n;this.actions.length;){let i=this.actions[0];if(this.timeOffset>=i.delay)this.actions.shift(),i.doAction();else break}(this.actions.length>0||this.liveMode)&&(this.raf=requestAnimationFrame(r))};this.raf=requestAnimationFrame(r)}clear(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(t){this.speed=t}toggleLiveMode(t){this.liveMode=t}isActive(){return this.raf!==null}findActionIndex(t){let r=0,n=this.actions.length-1;for(;r<=n;){let i=Math.floor((r+n)/2);if(this.actions[i].delay<t.delay)r=i+1;else if(this.actions[i].delay>t.delay)n=i-1;else return i+1}return r}}});function xo(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(t===void 0||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(a){i={error:a}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function In(e){return e===void 0?[]:[].concat(e)}function qe(e){return{type:"xstate.assign",assignment:e}}function ko(e,t){return typeof(e=typeof e=="string"&&t&&t[e]?t[e]:e)=="string"?{type:e}:typeof e=="function"?{type:e.name,exec:e}:e}function ir(e){return function(t){return e===t}}function Fo(e){return typeof e=="string"?{type:e}:e}function Do(e,t){return{value:e,context:t,actions:[],changed:!1,matches:ir(e)}}function Oo(e,t,r){var n=t,i=!1;return[e.filter((function(o){if(o.type==="xstate.assign"){i=!0;var s=Object.assign({},n);return typeof o.assignment=="function"?s=o.assignment(n,r):Object.keys(o.assignment).forEach((function(a){s[a]=typeof o.assignment[a]=="function"?o.assignment[a](n,r):o.assignment[a]})),n=s,!1}return!0})),n,i]}function Sn(e,t){t===void 0&&(t={});var r=xo(Oo(In(e.states[e.initial].entry).map((function(s){return ko(s,t.actions)})),e.context,Lo),2),n=r[0],i=r[1],o={config:e,_options:t,initialState:{value:e.initial,actions:n,context:i,matches:ir(e.initial)},transition:function(s,a){var l,c,u=typeof s=="string"?{value:s,context:e.context}:s,d=u.value,f=u.context,h=Fo(a),p=e.states[d];if(p.on){var v=In(p.on[h.type]);try{for(var I=(function(k){var X=typeof Symbol=="function"&&Symbol.iterator,C=X&&k[X],S=0;if(C)return C.call(k);if(k&&typeof k.length=="number")return{next:function(){return k&&S>=k.length&&(k=void 0),{value:k&&k[S++],done:!k}}};throw new TypeError(X?"Object is not iterable.":"Symbol.iterator is not defined.")})(v),m=I.next();!m.done;m=I.next()){var g=m.value;if(g===void 0)return Do(d,f);var y=typeof g=="string"?{target:g}:g,b=y.target,M=y.actions,N=M===void 0?[]:M,_=y.cond,w=_===void 0?function(){return!0}:_,Y=b===void 0,H=b??d,q=e.states[H];if(w(f,h)){var U=xo(Oo((Y?In(N):[].concat(p.exit,N,q.entry).filter((function(k){return k}))).map((function(k){return ko(k,o._options.actions)})),f,h),3),K=U[0],L=U[1],z=U[2],F=b??d;return{value:F,context:L,actions:K,changed:b!==d||K.length>0||z,matches:ir(F)}}}}catch(k){l={error:k}}finally{try{m&&!m.done&&(c=I.return)&&c.call(I)}finally{if(l)throw l.error}}}return Do(d,f)}};return o}function Cn(e){var t=e.initialState,r=at.NotStarted,n=new Set,i={_machine:e,send:function(o){r===at.Running&&(t=e.transition(t,o),_o(t,Fo(o)),n.forEach((function(s){return s(t)})))},subscribe:function(o){return n.add(o),o(t),{unsubscribe:function(){return n.delete(o)}}},start:function(o){if(o){var s=typeof o=="object"?o:{context:e.config.context,value:o};t={value:s.value,actions:[],context:s.context,matches:ir(s.value)}}return r=at.Running,_o(t,Lo),i},stop:function(){return r=at.Stopped,n.clear(),i},get state(){return t},get status(){return r}};return i}var at,Lo,_o,Bo=D(()=>{"use strict";(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(at||(at={}));Lo={type:"xstate.init"};_o=function(e,t){return e.actions.forEach((function(r){var n=r.exec;return n&&n(e.context,t)}))}});function tl(e,t){for(let r=e.length-1;r>=0;r--){let n=e[r];if(n.type===A.Meta&&n.timestamp<=t)return e.slice(r)}return e}function Uo(e,{getCastFn:t,applyEventsSynchronously:r,emitter:n}){let i=Sn({id:"player",context:e,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:qe({lastPlayedEvent:(o,s)=>s.type==="CAST_EVENT"?s.payload.event:o.lastPlayedEvent}),recordTimeOffset:qe((o,s)=>{let a=o.timeOffset;return"payload"in s&&"timeOffset"in s.payload&&(a=s.payload.timeOffset),Object.assign(Object.assign({},o),{timeOffset:a,baselineTime:o.events[0].timestamp+a})}),play(o){var s;let{timer:a,events:l,baselineTime:c,lastPlayedEvent:u}=o;a.clear();for(let p of l)vn(p,c);let d=tl(l,c),f=u?.timestamp;u?.type===A.IncrementalSnapshot&&u.data.source===E.MouseMove&&(f=u.timestamp+((s=u.data.positions[0])===null||s===void 0?void 0:s.timeOffset)),c<(f||0)&&n.emit(G.PlayBack);let h=new Array;for(let p of d)if(!(f&&f<c&&(p.timestamp<=f||p===u)))if(p.timestamp<c)h.push(p);else{let v=t(p,!1);a.addAction({doAction:()=>{v()},delay:p.delay})}r(h),n.emit(G.Flush),a.start()},pause(o){o.timer.clear()},resetLastPlayedEvent:qe(o=>Object.assign(Object.assign({},o),{lastPlayedEvent:null})),startLive:qe({baselineTime:(o,s)=>(o.timer.toggleLiveMode(!0),o.timer.start(),s.type==="TO_LIVE"&&s.payload.baselineTime?s.payload.baselineTime:Date.now())}),addEvent:qe((o,s)=>{let{baselineTime:a,timer:l,events:c}=o;if(s.type==="ADD_EVENT"){let{event:u}=s.payload;vn(u,a);let d=c.length-1;if(!c[d]||c[d].timestamp<=u.timestamp)c.push(u);else{let p=-1,v=0;for(;v<=d;){let I=Math.floor((v+d)/2);c[I].timestamp<=u.timestamp?v=I+1:d=I-1}p===-1&&(p=v),c.splice(p,0,u)}let f=u.timestamp<a,h=t(u,f);f?h():l.isActive()&&l.addAction({doAction:()=>{h()},delay:u.delay})}return Object.assign(Object.assign({},o),{events:c})})}});return Cn(i)}function Wo(e){let t=Sn({id:"speed",context:e,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:(r,n)=>{"payload"in n&&r.timer.setSpeed(n.payload.speed)},recordSpeed:qe({normalSpeed:r=>r.timer.speed}),restoreSpeed:r=>{r.timer.setSpeed(r.normalSpeed)}}});return Cn(t)}var Po=D(()=>{"use strict";Bo();ve();yn()});var Go,Vo=D(()=>{"use strict";Go=e=>[`.${e} { background: currentColor }`,"noscript { display: none !important; }"]});function bn(e,t){let r=Ho.get(e);return r||(r=new Map,Ho.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}function Ee(e,t,r){return n=>ye(this,void 0,void 0,function*(){if(n&&typeof n=="object"&&"rr_type"in n)if(r&&(r.isUnchanged=!1),n.rr_type==="ImageBitmap"&&"args"in n){let i=yield Ee(e,t,r)(n.args);return yield createImageBitmap.apply(null,i)}else if("index"in n){if(r||t===null)return n;let{rr_type:i,index:o}=n;return bn(t,i)[o]}else if("args"in n){let{rr_type:i,args:o}=n,s=window[i];return new s(...yield Promise.all(o.map(Ee(e,t,r))))}else{if("base64"in n)return wi(n.base64);if("src"in n){let i=e.get(n.src);if(i)return i;{let o=new Image;return o.src=n.src,e.set(n.src,o),o}}else if("data"in n&&n.rr_type==="Blob"){let i=yield Promise.all(n.data.map(Ee(e,t,r)));return new Blob(i,{type:n.type})}}else if(Array.isArray(n))return yield Promise.all(n.map(Ee(e,t,r)));return n})}var Ho,or=D(()=>{"use strict";Xe();Fr();Ho=new Map});function rl(e,t){try{return t===ge.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}function il(e,t){if(!t?.constructor)return;let{name:r}=t.constructor;if(!nl.includes(r))return;let n=bn(e,r);n.includes(t)||n.push(t)}function zo({mutation:e,target:t,type:r,imageMap:n,errorHandler:i}){return ye(this,void 0,void 0,function*(){try{let o=rl(t,r);if(!o)return;if(e.setter){o[e.property]=e.args[0];return}let s=o[e.property],a=yield Promise.all(e.args.map(Ee(n,o))),l=s.apply(o,a);il(o,l);let c=!1}catch(o){i(e,o)}})}var nl,Ko=D(()=>{"use strict";Xe();ve();or();nl=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"]});function Zo({event:e,mutation:t,target:r,imageMap:n,errorHandler:i}){return ye(this,void 0,void 0,function*(){try{let o=r.getContext("2d");if(t.setter){o[t.property]=t.args[0];return}let s=o[t.property];if(t.property==="drawImage"&&typeof t.args[0]=="string")n.get(e),s.apply(o,t.args);else{let a=yield Promise.all(t.args.map(Ee(n,o)));s.apply(o,a)}}catch(o){i(t,o)}})}var jo=D(()=>{"use strict";Xe();or()});function wn({event:e,mutation:t,target:r,imageMap:n,canvasEventMap:i,errorHandler:o}){return ye(this,void 0,void 0,function*(){try{let s=i.get(e)||t,a="commands"in s?s.commands:[s];if([ge.WebGL,ge.WebGL2].includes(t.type)){for(let l=0;l<a.length;l++){let c=a[l];yield zo({mutation:c,type:t.type,target:r,imageMap:n,errorHandler:o})}return}for(let l=0;l<a.length;l++){let c=a[l];yield Zo({event:e,mutation:c,target:r,imageMap:n,errorHandler:o})}}catch(s){o(t,s)}})}var Yo=D(()=>{"use strict";Xe();ve();Ko();jo()});function Xo(e){return e.type==A.IncrementalSnapshot&&(e.data.source==E.TouchMove||e.data.source==E.MouseInteraction&&e.data.type==ie.TouchStart)}var ol,sl,al,En,An,sr,Jo=D(()=>{"use strict";Xe();xe();to();gn();gn();Mo();yn();Po();ve();me();Vo();Yo();or();ol=10*1e3,sl=5*1e3,al=pn||mn,En="[replayer]",An={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};sr=class{constructor(t,r){if(this.usingVirtualDom=!1,this.virtualDom=new Je,this.mouseTail=null,this.tailPositions=[],this.emitter=al(),this.legacy_missingNodeRetryMap={},this.cache=Ar(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=Ot(),this.styleMirror=new Ze,this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,this.lastSelectionData=null,this.constructedStyleMutations=[],this.adoptedStyleSheets=[],this.handleResize=a=>{this.iframe.style.display="inherit";for(let l of[this.mouseTail,this.iframe])l&&(l.setAttribute("width",String(a.width)),l.setAttribute("height",String(a.height)))},this.applyEventsSynchronously=a=>{for(let l of a){switch(l.type){case A.DomContentLoaded:case A.Load:case A.Custom:continue;case A.FullSnapshot:case A.Meta:case A.Plugin:case A.IncrementalSnapshot:break}this.getCastFn(l,!0)()}this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null},this.getCastFn=(a,l=!1)=>{let c;switch(a.type){case A.DomContentLoaded:case A.Load:break;case A.Custom:c=()=>{this.emitter.emit(G.CustomEvent,a)};break;case A.Meta:c=()=>this.emitter.emit(G.Resize,{width:a.data.width,height:a.data.height});break;case A.FullSnapshot:c=()=>{var d;if(this.firstFullSnapshot){if(this.firstFullSnapshot===a){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(a,l),(d=this.iframe.contentWindow)===null||d===void 0||d.scrollTo(a.data.initialOffset),this.styleMirror.reset()};break;case A.IncrementalSnapshot:c=()=>{if(this.applyIncremental(a,l),!l&&(a===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(let d of this.service.state.context.events)if(!(d.timestamp<=a.timestamp)&&this.isUserInteraction(d)){d.delay-a.delay>ol*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=d);break}if(this.nextUserInteractionEvent){let d=this.nextUserInteractionEvent.delay-a.delay,f={speed:Math.min(Math.round(d/sl),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:f}),this.emitter.emit(G.SkipStart,f)}}};break}return()=>{c&&c();for(let f of this.config.plugins||[])f.handler&&f.handler(a,l,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:a}});let d=this.service.state.context.events.length-1;if(a===this.service.state.context.events[d]){let f=()=>{d<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(G.Finish))};a.type===A.IncrementalSnapshot&&a.data.source===E.MouseMove&&a.data.positions.length?setTimeout(()=>{f()},Math.max(0,-a.data.positions[0].timeOffset+50)):f()}this.emitter.emit(G.EventCast,a)}},!r?.liveMode&&t.length<2)throw new Error("Replayer need at least 2 events.");let n={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:An,useVirtualDom:!0};this.config=Object.assign({},n,r),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(G.Resize,this.handleResize),this.setupDom();for(let a of this.config.plugins||[])a.getMirror&&a.getMirror({nodeMirror:this.mirror});this.emitter.on(G.Flush,()=>{if(this.usingVirtualDom){let a={mirror:this.mirror,applyCanvas:(l,c,u)=>{wn({event:l,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:(l,c)=>{l.source===E.StyleSheetRule?this.applyStyleSheetRule(l,c):l.source===E.StyleDeclaration&&this.applyStyleDeclaration(l,c)}};if(this.iframe.contentDocument&&be(this.iframe.contentDocument,this.virtualDom,a,this.virtualDom.mirror),this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(let l in this.legacy_missingNodeRetryMap)try{let c=this.legacy_missingNodeRetryMap[l],u=Xt(c.node,this.mirror,this.virtualDom.mirror);be(u,c.node,a,this.virtualDom.mirror),c.node=u}catch(c){this.config.showWarning&&console.warn(c)}this.constructedStyleMutations.forEach(l=>{this.applyStyleSheetMutation(l)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(l=>{this.applyAdoptedStyleSheet(l)}),this.adoptedStyleSheets=[]}this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(G.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset()});let i=new nr([],{speed:this.config.speed,liveMode:this.config.liveMode});this.service=Uo({events:t.map(a=>r&&r.unpackFn?r.unpackFn(a):a).sort((a,l)=>a.timestamp-l.timestamp),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(a=>{this.emitter.emit(G.StateChange,{player:a})}),this.speedService=Wo({normalSpeed:-1,timer:i}),this.speedService.start(),this.speedService.subscribe(a=>{this.emitter.emit(G.StateChange,{speed:a})});let o=this.service.state.context.events.find(a=>a.type===A.Meta),s=this.service.state.context.events.find(a=>a.type===A.FullSnapshot);if(o){let{width:a,height:l}=o.data;setTimeout(()=>{this.emitter.emit(G.Resize,{width:a,height:l})},0)}s&&setTimeout(()=>{var a;this.firstFullSnapshot||(this.firstFullSnapshot=s,this.rebuildFullSnapshot(s),(a=this.iframe.contentWindow)===null||a===void 0||a.scrollTo(s.data.initialOffset))},1),this.service.state.context.events.find(Xo)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(t,r){return this.emitter.on(t,r),this}off(t,r){return this.emitter.off(t,r),this}setConfig(t){Object.keys(t).forEach(r=>{t[r],this.config[r]=t[r]}),this.config.skipInactive||this.backToNormal(),typeof t.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:t.speed}}),typeof t.mouseTail<"u"&&(t.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(){let t=this.service.state.context.events[0],r=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:t.timestamp,endTime:r.timestamp,totalTime:r.timestamp-t.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){let{baselineTime:t,events:r}=this.service.state.context;return t-r[0].timestamp}getMirror(){return this.mirror}play(t=0){var r,n;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:t}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:t}})),(n=(r=this.iframe.contentDocument)===null||r===void 0?void 0:r.getElementsByTagName("html")[0])===null||n===void 0||n.classList.remove("rrweb-paused"),this.emitter.emit(G.Start)}pause(t){var r,n;t===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof t=="number"&&(this.play(t),this.service.send({type:"PAUSE"})),(n=(r=this.iframe.contentDocument)===null||r===void 0?void 0:r.getElementsByTagName("html")[0])===null||n===void 0||n.classList.add("rrweb-paused"),this.emitter.emit(G.Pause)}resume(t=0){console.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(t),this.emitter.emit(G.Resume)}destroy(){this.pause(),this.config.root.removeChild(this.wrapper),this.emitter.emit(G.Destroy)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){let r=this.config.unpackFn?this.config.unpackFn(t):t;Xo(r)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:r}}))}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=Ar()}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");let t=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&t.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",t.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(Ro(this.iframe.contentWindow,this.iframe.contentDocument),gt(this.iframe.contentWindow))}rebuildFullSnapshot(t,r=!1){if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};let n=[],i=(a,l)=>{this.collectIframeAndAttachDocument(n,a);for(let c of this.config.plugins||[])c.onBuild&&c.onBuild(a,{id:l,replayer:this})};ni(t.data.node,{doc:this.iframe.contentDocument,afterAppend:i,cache:this.cache,mirror:this.mirror}),i(this.iframe.contentDocument,t.data.node.id);for(let{mutationInQueue:a,builtNode:l}of n)this.attachDocumentToIframe(a,l),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==a);let{documentElement:o,head:s}=this.iframe.contentDocument;this.insertStyleRules(o,s),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(G.FullsnapshotRebuilded,t),r||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,r){var n;let i=Go(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){let o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,qr(o,this.virtualDom.unserializedId)),t.insertBefore(o,r),o.rules.push({source:E.StyleSheetRule,adds:i.map((s,a)=>({rule:s,index:a}))})}else{let o=document.createElement("style");t.insertBefore(o,r);for(let s=0;s<i.length;s++)(n=o.sheet)===null||n===void 0||n.insertRule(i[s],s)}}attachDocumentToIframe(t,r){let n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[],o=(s,a)=>{this.collectIframeAndAttachDocument(i,s);let l=n.getMeta(s);if(l?.type===B.Element&&l?.tagName.toUpperCase()==="HTML"){let{documentElement:c,head:u}=r.contentDocument;this.insertStyleRules(c,u)}for(let c of this.config.plugins||[])c.onBuild&&c.onBuild(s,{id:a,replayer:this})};it(t.node,{doc:r.contentDocument,mirror:n,hackCss:!0,skipChild:!1,afterAppend:o,cache:this.cache}),o(r.contentDocument,t.node.id);for(let{mutationInQueue:s,builtNode:a}of i)this.attachDocumentToIframe(s,a),this.newDocumentQueue=this.newDocumentQueue.filter(l=>l!==s)}collectIframeAndAttachDocument(t,r){if(ke(r,this.mirror)){let n=this.newDocumentQueue.find(i=>i.parentId===this.mirror.getId(r));n&&t.push({mutationInQueue:n,builtNode:r})}}waitForStylesheetLoad(){var t;let r=(t=this.iframe.contentDocument)===null||t===void 0?void 0:t.head;if(r){let n=new Set,i,o=this.service.state,s=()=>{o=this.service.state};this.emitter.on(G.Start,s),this.emitter.on(G.Pause,s);let a=()=>{this.emitter.off(G.Start,s),this.emitter.off(G.Pause,s)};r.querySelectorAll('link[rel="stylesheet"]').forEach(l=>{l.sheet||(n.add(l),l.addEventListener("load",()=>{n.delete(l),n.size===0&&i!==-1&&(o.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(G.LoadStylesheetEnd),i&&clearTimeout(i),a())}))}),n.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(G.LoadStylesheetStart),i=setTimeout(()=>{o.matches("playing")&&this.play(this.getCurrentTime()),i=-1,a()},this.config.loadTimeout))}}preloadAllImages(){return ye(this,void 0,void 0,function*(){this.service.state;let t=()=>{this.service.state};this.emitter.on(G.Start,t),this.emitter.on(G.Pause,t);let r=[];for(let n of this.service.state.context.events)n.type===A.IncrementalSnapshot&&n.data.source===E.CanvasMutation&&(r.push(this.deserializeAndPreloadCanvasEvents(n.data,n)),("commands"in n.data?n.data.commands:[n.data]).forEach(o=>{this.preloadImages(o,n)}));return Promise.all(r)})}preloadImages(t,r){if(t.property==="drawImage"&&typeof t.args[0]=="string"&&!this.imageMap.has(r)){let n=document.createElement("canvas"),i=n.getContext("2d"),o=i?.createImageData(n.width,n.height);o?.data,JSON.parse(t.args[0]),i?.putImageData(o,0,0)}}deserializeAndPreloadCanvasEvents(t,r){return ye(this,void 0,void 0,function*(){if(!this.canvasEventMap.has(r)){let n={isUnchanged:!0};if("commands"in t){let i=yield Promise.all(t.commands.map(o=>ye(this,void 0,void 0,function*(){let s=yield Promise.all(o.args.map(Ee(this.imageMap,null,n)));return Object.assign(Object.assign({},o),{args:s})})));n.isUnchanged===!1&&this.canvasEventMap.set(r,Object.assign(Object.assign({},t),{commands:i}))}else{let i=yield Promise.all(t.args.map(Ee(this.imageMap,null,n)));n.isUnchanged===!1&&this.canvasEventMap.set(r,Object.assign(Object.assign({},t),{args:i}))}}})}applyIncremental(t,r){var n,i,o;let{data:s}=t;switch(s.source){case E.Mutation:{try{this.applyMutation(s,r)}catch(a){this.warn(`Exception in mutation ${a.message||a}`,s)}break}case E.Drag:case E.TouchMove:case E.MouseMove:if(r){let a=s.positions[s.positions.length-1];this.mousePos={x:a.x,y:a.y,id:a.id,debugData:s}}else s.positions.forEach(a=>{let l={doAction:()=>{this.moveAndHover(a.x,a.y,a.id,r,s)},delay:a.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(l)}),this.timer.addAction({doAction(){},delay:t.delay-((n=s.positions[0])===null||n===void 0?void 0:n.timeOffset)});break;case E.MouseInteraction:{if(s.id===-1||r)break;let a=new Event(ie[s.type].toLowerCase()),l=this.mirror.getNode(s.id);if(!l)return this.debugNodeNotFound(s,s.id);this.emitter.emit(G.MouseInteraction,{type:s.type,target:l});let{triggerFocus:c}=this.config;switch(s.type){case ie.Blur:"blur"in l&&l.blur();break;case ie.Focus:c&&l.focus&&l.focus({preventScroll:!0});break;case ie.Click:case ie.TouchStart:case ie.TouchEnd:r?(s.type===ie.TouchStart?this.touchActive=!0:s.type===ie.TouchEnd&&(this.touchActive=!1),this.mousePos={x:s.x,y:s.y,id:s.id,debugData:s}):(s.type===ie.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(s.x,s.y,s.id,r,s),s.type===ie.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):s.type===ie.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):s.type===ie.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case ie.TouchCancel:r?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:l.dispatchEvent(a)}break}case E.Scroll:{if(s.id===-1)break;if(this.usingVirtualDom){let a=this.virtualDom.mirror.getNode(s.id);if(!a)return this.debugNodeNotFound(s,s.id);a.scrollData=s;break}this.applyScroll(s,r);break}case E.ViewportResize:this.emitter.emit(G.Resize,{width:s.width,height:s.height});break;case E.Input:{if(s.id===-1)break;if(this.usingVirtualDom){let a=this.virtualDom.mirror.getNode(s.id);if(!a)return this.debugNodeNotFound(s,s.id);a.inputData=s;break}this.applyInput(s);break}case E.MediaInteraction:{let a=this.usingVirtualDom?this.virtualDom.mirror.getNode(s.id):this.mirror.getNode(s.id);if(!a)return this.debugNodeNotFound(s,s.id);let l=a;try{s.currentTime&&(l.currentTime=s.currentTime),s.volume&&(l.volume=s.volume),s.muted&&(l.muted=s.muted),s.type===1&&l.pause(),s.type===0&&l.play(),s.type===4&&(l.playbackRate=s.playbackRate)}catch(c){this.config.showWarning&&console.warn(`Failed to replay media interactions: ${c.message||c}`)}break}case E.StyleSheetRule:case E.StyleDeclaration:{this.usingVirtualDom?s.styleId?this.constructedStyleMutations.push(s):s.id&&((i=this.virtualDom.mirror.getNode(s.id))===null||i===void 0||i.rules.push(s)):this.applyStyleSheetMutation(s);break}case E.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){let a=this.virtualDom.mirror.getNode(s.id);if(!a)return this.debugNodeNotFound(s,s.id);a.canvasMutations.push({event:t,mutation:s})}else{let a=this.mirror.getNode(s.id);if(!a)return this.debugNodeNotFound(s,s.id);wn({event:t,mutation:s,target:a,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case E.Font:{try{let a=new FontFace(s.family,s.buffer?new Uint8Array(JSON.parse(s.fontSource)):s.fontSource,s.descriptors);(o=this.iframe.contentDocument)===null||o===void 0||o.fonts.add(a)}catch(a){this.config.showWarning&&console.warn(a)}break}case E.Selection:{if(r){this.lastSelectionData=s;break}this.applySelection(s);break}case E.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(s):this.applyAdoptedStyleSheet(s);break}}}applyMutation(t,r){if(this.config.useVirtualDom&&!this.usingVirtualDom&&r&&(this.usingVirtualDom=!0,eo(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(let c in this.legacy_missingNodeRetryMap)try{let u=this.legacy_missingNodeRetryMap[c],d=Qr(u.node,this.virtualDom,this.mirror);d&&(u.node=d)}catch(u){this.config.showWarning&&console.warn(u)}let n=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;t.removes.forEach(c=>{var u;let d=n.getNode(c.id);if(!d)return t.removes.find(h=>h.id===c.parentId)?void 0:this.warnNodeNotFound(t,c.id);let f=n.getNode(c.parentId);if(!f)return this.warnNodeNotFound(t,c.parentId);if(c.isShadow&&Ae(f)&&(f=f.shadowRoot),n.removeNodeFromMap(d),f)try{f.removeChild(d),this.usingVirtualDom&&d.nodeName==="#text"&&f.nodeName==="STYLE"&&((u=f.rules)===null||u===void 0?void 0:u.length)>0&&(f.rules=[])}catch(h){if(h instanceof DOMException)this.warn("parent could not remove child in mutation",f,d,t);else throw h}});let i=Object.assign({},this.legacy_missingNodeRetryMap),o=[],s=c=>{let u=null;return c.nextId&&(u=n.getNode(c.nextId)),c.nextId!==null&&c.nextId!==void 0&&c.nextId!==-1&&!u},a=c=>{var u;if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");let d=n.getNode(c.parentId);if(!d)return c.node.type===B.Document?this.newDocumentQueue.push(c):o.push(c);c.node.isShadow&&(Ae(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let f=null,h=null;if(c.previousId&&(f=n.getNode(c.previousId)),c.nextId&&(h=n.getNode(c.nextId)),s(c))return o.push(c);if(c.node.rootId&&!n.getNode(c.node.rootId))return;let p=c.node.rootId?n.getNode(c.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(ke(d,n)){this.attachDocumentToIframe(c,d);return}let v=(g,y)=>{for(let b of this.config.plugins||[])b.onBuild&&b.onBuild(g,{id:y,replayer:this})},I=it(c.node,{doc:p,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:v});if(c.previousId===-1||c.nextId===-1){i[c.node.id]={node:I,mutation:c};return}let m=n.getMeta(d);if(m&&m.type===B.Element&&m.tagName==="textarea"&&c.node.type===B.Text){let g=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);for(let y of g)y.nodeType===d.TEXT_NODE&&d.removeChild(y)}if(f&&f.nextSibling&&f.nextSibling.parentNode)d.insertBefore(I,f.nextSibling);else if(h&&h.parentNode)d.contains(h)?d.insertBefore(I,h):d.insertBefore(I,null);else{if(d===p)for(;p.firstChild;)p.removeChild(p.firstChild);d.appendChild(I)}if(v(I,c.node.id),this.usingVirtualDom&&I.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)===null||u===void 0?void 0:u.length)>0&&(d.rules=[]),ke(I,this.mirror)){let g=this.mirror.getId(I),y=this.newDocumentQueue.find(b=>b.parentId===g);y&&(this.attachDocumentToIframe(y,I),this.newDocumentQueue=this.newDocumentQueue.filter(b=>b!==y))}(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(i,d,I,c)};t.adds.forEach(c=>{a(c)});let l=Date.now();for(;o.length;){let c=Tr(o);if(o.length=0,Date.now()-l>500){this.warn("Timeout in the loop, please check the resolve tree data:",c);break}for(let u of c)n.getNode(u.value.parentId)?Ft(u,f=>{a(f)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),Rr(t.texts).forEach(c=>{var u;let d=n.getNode(c.id);if(!d)return t.removes.find(f=>f.id===c.id)?void 0:this.warnNodeNotFound(t,c.id);if(d.textContent=c.value,this.usingVirtualDom){let f=d.parentNode;((u=f?.rules)===null||u===void 0?void 0:u.length)>0&&(f.rules=[])}}),t.attributes.forEach(c=>{let u=n.getNode(c.id);if(!u)return t.removes.find(d=>d.id===c.id)?void 0:this.warnNodeNotFound(t,c.id);for(let d in c.attributes)if(typeof d=="string"){let f=c.attributes[d];if(f===null)u.removeAttribute(d);else if(typeof f=="string")try{if(d==="_cssText"&&(u.nodeName==="LINK"||u.nodeName==="STYLE"))try{let h=n.getMeta(u);Object.assign(h.attributes,c.attributes);let p=it(h,{doc:u.ownerDocument,mirror:n,skipChild:!0,hackCss:!0,cache:this.cache}),v=u.nextSibling,I=u.parentNode;if(p&&I){I.removeChild(u),I.insertBefore(p,v),n.replace(c.id,p);break}}catch{}u.setAttribute(d,f)}catch(h){this.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",h)}else if(d==="style"){let h=f,p=u;for(let v in h)if(h[v]===!1)p.style.removeProperty(v);else if(h[v]instanceof Array){let I=h[v];p.style.setProperty(v,I[0],I[1])}else{let I=h[v];p.style.setProperty(v,I)}}}})}applyScroll(t,r){var n,i;let o=this.mirror.getNode(t.id);if(!o)return this.debugNodeNotFound(t,t.id);let s=this.mirror.getMeta(o);if(o===this.iframe.contentDocument)(n=this.iframe.contentWindow)===null||n===void 0||n.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else if(s?.type===B.Document)(i=o.defaultView)===null||i===void 0||i.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else try{o.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"})}catch{}}applyInput(t){let r=this.mirror.getNode(t.id);if(!r)return this.debugNodeNotFound(t,t.id);try{r.checked=t.isChecked,r.value=t.text}catch{}}applySelection(t){try{let r=new Set,n=t.ranges.map(({start:i,startOffset:o,end:s,endOffset:a})=>{let l=this.mirror.getNode(i),c=this.mirror.getNode(s);if(!l||!c)return;let u=new Range;u.setStart(l,o),u.setEnd(c,a);let d=l.ownerDocument,f=d?.getSelection();return f&&r.add(f),{range:u,selection:f}});r.forEach(i=>i.removeAllRanges()),n.forEach(i=>{var o;return i&&((o=i.selection)===null||o===void 0?void 0:o.addRange(i.range))})}catch{}}applyStyleSheetMutation(t){var r;let n=null;t.styleId?n=this.styleMirror.getStyle(t.styleId):t.id&&(n=((r=this.mirror.getNode(t.id))===null||r===void 0?void 0:r.sheet)||null),n&&(t.source===E.StyleSheetRule?this.applyStyleSheetRule(t,n):t.source===E.StyleDeclaration&&this.applyStyleDeclaration(t,n))}applyStyleSheetRule(t,r){var n,i,o,s;if((n=t.adds)===null||n===void 0||n.forEach(({rule:a,index:l})=>{try{if(Array.isArray(l)){let{positions:c,index:u}=Ut(l);Ye(r.cssRules,c).insertRule(a,u)}else{let c=l===void 0?void 0:Math.min(l,r.cssRules.length);r?.insertRule(a,c)}}catch{}}),(i=t.removes)===null||i===void 0||i.forEach(({index:a})=>{try{if(Array.isArray(a)){let{positions:l,index:c}=Ut(a);Ye(r.cssRules,l).deleteRule(c||0)}else r?.deleteRule(a)}catch{}}),t.replace)try{(o=r.replace)===null||o===void 0||o.call(r,t.replace)}catch{}if(t.replaceSync)try{(s=r.replaceSync)===null||s===void 0||s.call(r,t.replaceSync)}catch{}}applyStyleDeclaration(t,r){t.set&&Ye(r.rules,t.index).style.setProperty(t.set.property,t.set.value,t.set.priority),t.remove&&Ye(r.rules,t.index).style.removeProperty(t.remove.property)}applyAdoptedStyleSheet(t){var r;let n=this.mirror.getNode(t.id);if(!n)return;(r=t.styles)===null||r===void 0||r.forEach(a=>{var l;let c=null,u=null;if(Ae(n)?u=((l=n.ownerDocument)===null||l===void 0?void 0:l.defaultView)||null:n.nodeName==="#document"&&(u=n.defaultView),!!u)try{c=new u.CSSStyleSheet,this.styleMirror.add(c,a.styleId),this.applyStyleSheetRule({source:E.StyleSheetRule,adds:a.rules},c)}catch{}});let i=10,o=0,s=(a,l)=>{let c=l.map(u=>this.styleMirror.getStyle(u)).filter(u=>u!==null);Ae(a)?a.shadowRoot.adoptedStyleSheets=c:a.nodeName==="#document"&&(a.adoptedStyleSheets=c),c.length!==l.length&&o<i&&(setTimeout(()=>s(a,l),0+100*o),o++)};s(n,t.styleIds)}legacy_resolveMissingNode(t,r,n,i){let{previousId:o,nextId:s}=i,a=o&&t[o],l=s&&t[s];if(a){let{node:c,mutation:u}=a;r.insertBefore(c,n),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,r,c,u)}if(l){let{node:c,mutation:u}=l;r.insertBefore(c,n.nextSibling),delete t[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(t,r,c,u)}}moveAndHover(t,r,n,i,o){let s=this.mirror.getNode(n);if(!s)return this.debugNodeNotFound(o,n);let a=Bt(s,this.iframe),l=t*a.absoluteScale+a.x,c=r*a.absoluteScale+a.y;this.mouse.style.left=`${l}px`,this.mouse.style.top=`${c}px`,i||this.drawMouseTail({x:l,y:c}),this.hoverElements(s)}drawMouseTail(t){if(!this.mouseTail)return;let{lineCap:r,lineWidth:n,strokeStyle:i,duration:o}=this.config.mouseTail===!0?An:Object.assign({},An,this.config.mouseTail),s=()=>{if(!this.mouseTail)return;let a=this.mouseTail.getContext("2d");!a||!this.tailPositions.length||(a.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),a.beginPath(),a.lineWidth=n,a.lineCap=r,a.strokeStyle=i,a.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(l=>a.lineTo(l.x,l.y)),a.stroke())};this.tailPositions.push(t),s(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(a=>a!==t),s()},o/this.speedService.state.context.timer.speed)}hoverElements(t){var r;(r=this.iframe.contentDocument)===null||r===void 0||r.querySelectorAll(".\\:hover").forEach(i=>{i.classList.remove(":hover")});let n=t;for(;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement}isUserInteraction(t){return t.type!==A.IncrementalSnapshot?!1:t.data.source>E.Mutation&&t.data.source<=E.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(G.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(t,r){this.warn(`Node with id '${r}' not found. `,t)}warnCanvasMutationFailed(t,r){this.warn("Has error on canvas update",r,"canvas mutation:",t)}debugNodeNotFound(t,r){this.debug(En,`Node with id '${r}' not found. `,t)}warn(...t){this.config.showWarning&&console.warn(En,...t)}debug(...t){this.config.showDebug&&console.log(En,...t)}}});var Qo={};et(Qo,{EventType:()=>A,IncrementalSource:()=>E,MouseInteractions:()=>ie,PLUGIN_NAME:()=>Nt,Replayer:()=>sr,ReplayerEvents:()=>G,addCustomEvent:()=>ro,freezePage:()=>no,getRecordConsolePlugin:()=>Ao,getReplayConsolePlugin:()=>No,mirror:()=>ft,pack:()=>go,record:()=>De,unpack:()=>yo,utils:()=>Mr});var qo=D(()=>{"use strict";io();vo();Io();fn();To();Vr();ve();Jo();me();me()});var es={};et(es,{startRrweb:()=>ll});async function ll(e){if(typeof window>"u")return null;let t;try{t=await Promise.resolve().then(()=>(qo(),Qo))}catch{return null}let r=e.options.mask?.class??"segi-mask",n=e.options.mask?.inputs??"all",i=n==="all"?{password:!0,email:!0,tel:!0,number:!0,text:!0,textarea:!0}:n==="sensitive"?{password:!0,email:!0,tel:!0,number:!0}:{password:!0},o=[],s=0,a=null,l=Date.now(),c=!1,u=!1,d=setInterval(()=>{c||u||v()},1e4),f=setInterval(()=>{c||u||Date.now()-l>=18e4&&p()},15e3);function h(){if(a)return;let y=t.record({emit(b){if(!(c||u)){o.push(b);try{s+=JSON.stringify(b).length}catch{}s>=102400&&v()}},sampling:{mousemove:20,scroll:150,input:"last"},maskAllInputs:n==="all",maskInputOptions:i,blockClass:r,ignoreClass:r,maskTextClass:r,recordCanvas:!1,collectFonts:!1,checkoutEveryNms:3e4});a=typeof y=="function"?y:null}function p(){try{a?.()}finally{a=null}v()}function v(y=!1){if(o.length===0)return;let b=o;o=[],s=0;try{e.sendChunk(b,y)}catch{}}function I(){l=Date.now(),!a&&!c&&!u&&h()}for(let y of $o)window.addEventListener(y,I,{passive:!0,capture:!0});let m=()=>v(!0),g=()=>{typeof document<"u"&&document.visibilityState==="hidden"&&v(!0)};return window.addEventListener("pagehide",m),typeof document<"u"&&document.addEventListener("visibilitychange",g),h(),{pause(){c=!0,p()},resume(){c=!1,l=Date.now(),h()},stop(){u=!0,p(),clearInterval(d),clearInterval(f);for(let y of $o)window.removeEventListener(y,I,{capture:!0});window.removeEventListener("pagehide",m),typeof document<"u"&&document.removeEventListener("visibilitychange",g)},flush:v}}var $o,ts=D(()=>{"use strict";$o=["mousemove","mousedown","keydown","touchstart","scroll","wheel"]});var is={};et(is,{activateReplay:()=>ul,replayApi:()=>dl,withReplay:()=>cl});function cl(e={}){return{__segi_replay:!0,options:e}}function rs(){if(typeof window>"u")return"desktop";let e=window.innerWidth;return e<640?"mobile":e<1024?"tablet":"desktop"}function $e(e){if(!(typeof location>"u"))try{return new URLSearchParams(location.search).get(e)??void 0}catch{return}}function ns(e,t){return(e.blockRoutes??[]).some(n=>t.startsWith(n))}async function ul(e){if(x||typeof window>"u")return;let t=e.config.options;if(t.enabled===!1)return;let r=Math.max(0,Math.min(100,t.sample??100));if(Math.random()*100>=r||ns(t,location.pathname))return;let n=zn(),i=gr(),o={endpoint:t.endpoint??e.endpoint,projectKey:e.projectKey},s={sessionUid:n,anonId:i,startedAt:new Date().toISOString(),device:rs(),viewportW:window.innerWidth,viewportH:window.innerHeight,ua:navigator.userAgent?.slice(0,512),referrer:document.referrer||void 0,landingUrl:location.href.slice(0,512),utmSource:$e("utm_source"),utmMedium:$e("utm_medium"),utmCampaign:$e("utm_campaign"),utmContent:$e("utm_content"),utmTerm:$e("utm_term"),fbclid:$e("fbclid"),gclid:$e("gclid")},a=!0;try{let d=await Re(o,"/session/start",s);d&&d.ok&&(await d.json().catch(()=>({}))).recordingEnabled===!1&&(a=!1)}catch{}if(!a){x={sessionUid:n,config:o,options:t,heatmap:null,rrweb:null,replayBlocked:!1,paused:!0,userId:null,startedAt:s.startedAt,pagesVisited:0,clickCount:0,recordingEnabled:!1};return}let l=Un({sessionUid:n,options:t,sendClicks:(d,f)=>{f?kt(o,"/heatmap/clicks",{clicks:d}):Re(o,"/heatmap/clicks",{clicks:d})},sendScroll:d=>{Re(o,"/heatmap/scroll",d)}});x={sessionUid:n,config:o,options:t,heatmap:l,rrweb:null,replayBlocked:!1,paused:!1,userId:null,startedAt:s.startedAt,pagesVisited:1,clickCount:0,recordingEnabled:!0};let c=window,u=d=>{typeof c.requestIdleCallback=="function"?c.requestIdleCallback(d,{timeout:2e3}):setTimeout(d,1e3)};Promise.resolve().then(()=>(ts(),es)).then(({startRrweb:d})=>new Promise(f=>{u(()=>{d({sessionUid:n,options:t,sendChunk:async(h,p)=>{if(!x||x.replayBlocked)return;if(p){kt(o,"/replay",{sessionUid:n,chunk:h});return}let v=await Re(o,"/replay",{sessionUid:n,chunk:h});v&&v.status===429&&x&&(x.replayBlocked=!0,x.rrweb?.stop(),x.rrweb=null)}}).then(f,()=>f(null))})})).then(d=>{d&&x&&(x.rrweb=d)}).catch(()=>{}),Re(o,"/events",{events:[{sessionUid:n,ts:new Date().toISOString(),type:"page_view",url:location.href,title:document.title}]}),window.addEventListener("pagehide",()=>{x&&(x.rrweb?.flush(!0),kt(x.config,"/session/end",{sessionUid:x.sessionUid,endedAt:new Date().toISOString(),durationMs:Date.now()-new Date(x.startedAt).getTime(),pagesVisited:x.pagesVisited,clickCount:x.clickCount}))})}var x,dl,os=D(()=>{"use strict";Wn();Zn();Yn();x=null;dl={pause(){x?.heatmap?.pause(),x?.rrweb?.pause(),x&&(x.paused=!0)},resume(){x?.heatmap?.resume(),x?.rrweb?.resume(),x&&(x.paused=!1),Kn()},setUser(e){x&&(x.userId=e?.id??null,Re(x.config,"/session/start",{sessionUid:x.sessionUid,anonId:gr(),userId:x.userId,startedAt:x.startedAt,device:rs(),viewportW:window.innerWidth,viewportH:window.innerHeight}))},event(e,t){!x||x.paused||Re(x.config,"/events",{events:[{sessionUid:x.sessionUid,ts:new Date().toISOString(),type:"custom",name:e.slice(0,64),url:location.href,meta:t}]})},notifyRouteChange(e,t){if(!(!x||x.paused)){if(ns(x.options,location.pathname)){x.heatmap?.pause(),x.rrweb?.pause(),x.paused=!0;return}x.paused&&(x.heatmap?.resume(),x.rrweb?.resume(),x.paused=!1),x.pagesVisited+=1,Re(x.config,"/events",{events:[{sessionUid:x.sessionUid,ts:new Date().toISOString(),type:"page_view",url:e??location.href,title:t??document.title}]})}},_sessionUid(){return x?.sessionUid??null}}});var gl={};et(gl,{Segi:()=>Le,default:()=>ml});function Tn(){return{options:{projectKey:"",endpoint:""},user:null,tags:{},breadcrumbs:[],initialized:!1}}function Rn(e,t){let r=e.options.maxBreadcrumbs??50;e.breadcrumbs.push(t),e.breadcrumbs.length>r&&e.breadcrumbs.splice(0,e.breadcrumbs.length-r)}function cr(e,t){let r={type:t.type??"error",level:t.level??"error",message:t.message??"",errorName:t.errorName,stack:t.stack,platform:t.platform,runtime:t.runtime,environment:t.environment??e.options.environment,release:t.release??e.options.release,transaction:t.transaction,url:t.url,userAgent:t.userAgent,user:t.user??e.user??void 0,tags:{...e.tags,...t.tags??{}},extra:t.extra,breadcrumbs:e.breadcrumbs.slice(),request:t.request,timestamp:t.timestamp??new Date().toISOString()};if(e.options.beforeSend)try{let n=e.options.beforeSend(r);return n||{...r,_drop:!0}}catch{return r}return r}var Fn=fs(_n()),Ln=new Set;function hr(e,t){Ln.has(e)||(Ln.add(e),typeof console<"u"&&typeof console.warn=="function"&&console.warn(`[segi] ${t}`))}function bs(e){return e===401||e===403?"ingest rejected the project key (check projectKey + endpoint region)":e===404?"ingest endpoint not found (check endpoint URL)":e===413?"event payload too large; dropped by ingest":e===429?"ingest rate-limited (over plan quota or burst)":e>=500?"ingest is returning 5xx \u2014 events may be lost":"ingest returned a non-2xx response"}function pr(e,t,r){let n=e||Fn.SEGI_DEFAULT_INGEST_ENDPOINT;if(!n||!t){hr("missing-config",t?"init() called without a valid endpoint \u2014 events will not be sent":"init() called without a projectKey \u2014 events will not be sent");return}if(!r._drop)try{let i=JSON.stringify(r),o={"Content-Type":"application/json","X-Segi-Project-Key":t};if(typeof fetch=="function"){fetch(n,{method:"POST",headers:o,body:i,keepalive:!0,mode:"cors",credentials:"omit"}).then(s=>{s.ok||hr(`status-${s.status}`,`${bs(s.status)} (HTTP ${s.status} from ${n})`)}).catch(s=>{hr("network-error",`network error reaching ${n} \u2014 events not delivered (${s instanceof Error?s.message:String(s)})`)});return}if(typeof navigator<"u"&&typeof navigator.sendBeacon=="function"){let s=`${n}${n.includes("?")?"&":"?"}pk=${encodeURIComponent(t)}`,a=new Blob([i],{type:"application/json"});navigator.sendBeacon(s,a)}}catch{}}var se=Tn();function fl(e){try{if(e&&typeof e=="object"&&"stack"in e)return String(e.stack??"")}catch{}}function ar(e){if(se.initialized)try{if(e instanceof ErrorEvent){let t=e.error,r=t?.message??e.message??"Error";Le.captureException(t??new Error(r),{message:r,url:typeof location<"u"?location.href:void 0})}else if("reason"in e){let t=e.reason,r=t instanceof Error?t.message:typeof t=="string"?t:"Unhandled promise rejection";Le.captureException(t,{message:r,url:typeof location<"u"?location.href:void 0})}}catch{}}function hl(){typeof window>"u"||(window.addEventListener("error",ar,!0),window.addEventListener("unhandledrejection",ar,!0))}function ss(){typeof window>"u"||(window.removeEventListener("error",ar,!0),window.removeEventListener("unhandledrejection",ar,!0))}var pl={pause(){},resume(){},setUser(){},event(){},notifyRouteChange(){}},Le={replay:pl,init(e,t={}){try{let r=typeof window<"u"?window:null;if((se.initialized||r?.__segiInitialized===!0)&&!t.force){!t.silent&&typeof console<"u"&&console.warn("[segi] init() called more than once; ignoring. Pass { force: true } to override.");return}se.initialized&&ss();let{replay:i,...o}=e;se.options={...o},se.initialized=!0,r&&(r.__segiInitialized=!0),hl(),i?.__segi_replay&&Promise.resolve().then(()=>(os(),is)).then(s=>(Le.replay=s.replayApi,s.activateReplay({projectKey:o.projectKey,endpoint:o.endpoint,config:i}))).catch(()=>{})}catch{}},isInitialized(){return se.initialized},close(){try{if(ss(),se.initialized=!1,se.user=null,se.tags={},se.breadcrumbs=[],typeof window<"u"){let e=window;e.__segiInitialized=!1}}catch{}},captureException(e,t={}){try{if(!se.initialized)return;let r=e instanceof Error?e:new Error(typeof e=="string"?e:JSON.stringify(e)),n=cr(se,{type:"error",level:"error",message:r.message,errorName:r.name,stack:fl(r),platform:"javascript",runtime:"browser",url:t.url??(typeof location<"u"?location.href:void 0),userAgent:t.userAgent??(typeof navigator<"u"?navigator.userAgent:void 0),...t});pr(se.options.endpoint,se.options.projectKey,n)}catch{}},captureMessage(e,t={}){try{if(!se.initialized)return;let r=cr(se,{type:"message",level:t.level??"info",message:e,platform:"javascript",runtime:"browser",url:typeof location<"u"?location.href:void 0,userAgent:typeof navigator<"u"?navigator.userAgent:void 0,...t});pr(se.options.endpoint,se.options.projectKey,r)}catch{}},setUser(e){try{se.user=e}catch{}},setTag(e,t){try{se.tags[e]=t}catch{}},addBreadcrumb(e){try{Rn(se,{...e,timestamp:e.timestamp??new Date().toISOString()})}catch{}}};(function(){try{let t=window;if(t.__segiBundleLoaded){typeof console<"u"&&console.warn("[segi] segi.min.js loaded more than once; ignoring this load.");return}t.__segiBundleLoaded=!0;let r=t.SegiConfig??{},n={},i=document.getElementsByTagName("script");for(let a=i.length-1;a>=0;a--){let l=i[a];if(l.src&&/segi(\.min)?\.js/.test(l.src)){n={projectKey:l.dataset.projectKey,endpoint:l.dataset.endpoint,environment:l.dataset.environment,release:l.dataset.release};break}}let o=r.projectKey??n.projectKey,s=r.endpoint??n.endpoint;if(!o){t.Segi=Le;return}Le.init({projectKey:o,endpoint:s,environment:r.environment??n.environment,release:r.release??n.release}),t.Segi=Le}catch{}})();var ml=Le;return hs(gl);})();
18
18
  /*! Bundled license information:
19
19
 
20
20
  rrweb/es/rrweb/ext/tslib/tslib.es6.js:
@@ -348,28 +348,40 @@ async function activateReplay(args) {
348
348
  clickCount: 0,
349
349
  recordingEnabled: true
350
350
  };
351
- void Promise.resolve().then(() => _interopRequireWildcard(require("../rrweb-H4UUMFZ5.js"))).then(
352
- ({ startRrweb }) => startRrweb({
353
- sessionUid,
354
- options,
355
- sendChunk: async (chunk, useBeacon) => {
356
- if (!active || active.replayBlocked) return;
357
- if (useBeacon) {
358
- beaconTrace(transportCfg, "/replay", { sessionUid, chunk });
359
- return;
360
- }
361
- const res = await postTrace(transportCfg, "/replay", {
351
+ const w = window;
352
+ const scheduleRrwebStart = (run) => {
353
+ if (typeof w.requestIdleCallback === "function") {
354
+ w.requestIdleCallback(run, { timeout: 2e3 });
355
+ } else {
356
+ setTimeout(run, 1e3);
357
+ }
358
+ };
359
+ void Promise.resolve().then(() => _interopRequireWildcard(require("../rrweb-3KMD3KRA.js"))).then(
360
+ ({ startRrweb }) => new Promise((resolve) => {
361
+ scheduleRrwebStart(() => {
362
+ startRrweb({
362
363
  sessionUid,
363
- chunk
364
- });
365
- if (res && res.status === 429) {
366
- if (active) {
367
- active.replayBlocked = true;
368
- _optionalChain([active, 'access', _28 => _28.rrweb, 'optionalAccess', _29 => _29.stop, 'call', _30 => _30()]);
369
- active.rrweb = null;
364
+ options,
365
+ sendChunk: async (chunk, useBeacon) => {
366
+ if (!active || active.replayBlocked) return;
367
+ if (useBeacon) {
368
+ beaconTrace(transportCfg, "/replay", { sessionUid, chunk });
369
+ return;
370
+ }
371
+ const res = await postTrace(transportCfg, "/replay", {
372
+ sessionUid,
373
+ chunk
374
+ });
375
+ if (res && res.status === 429) {
376
+ if (active) {
377
+ active.replayBlocked = true;
378
+ _optionalChain([active, 'access', _28 => _28.rrweb, 'optionalAccess', _29 => _29.stop, 'call', _30 => _30()]);
379
+ active.rrweb = null;
380
+ }
381
+ }
370
382
  }
371
- }
372
- }
383
+ }).then(resolve, () => resolve(null));
384
+ });
373
385
  })
374
386
  ).then((handles) => {
375
387
  if (handles && active) active.rrweb = handles;
@@ -348,28 +348,40 @@ async function activateReplay(args) {
348
348
  clickCount: 0,
349
349
  recordingEnabled: true
350
350
  };
351
- void import("../rrweb-JCHV7B75.mjs").then(
352
- ({ startRrweb }) => startRrweb({
353
- sessionUid,
354
- options,
355
- sendChunk: async (chunk, useBeacon) => {
356
- if (!active || active.replayBlocked) return;
357
- if (useBeacon) {
358
- beaconTrace(transportCfg, "/replay", { sessionUid, chunk });
359
- return;
360
- }
361
- const res = await postTrace(transportCfg, "/replay", {
351
+ const w = window;
352
+ const scheduleRrwebStart = (run) => {
353
+ if (typeof w.requestIdleCallback === "function") {
354
+ w.requestIdleCallback(run, { timeout: 2e3 });
355
+ } else {
356
+ setTimeout(run, 1e3);
357
+ }
358
+ };
359
+ void import("../rrweb-VLNL5J73.mjs").then(
360
+ ({ startRrweb }) => new Promise((resolve) => {
361
+ scheduleRrwebStart(() => {
362
+ startRrweb({
362
363
  sessionUid,
363
- chunk
364
- });
365
- if (res && res.status === 429) {
366
- if (active) {
367
- active.replayBlocked = true;
368
- active.rrweb?.stop();
369
- active.rrweb = null;
364
+ options,
365
+ sendChunk: async (chunk, useBeacon) => {
366
+ if (!active || active.replayBlocked) return;
367
+ if (useBeacon) {
368
+ beaconTrace(transportCfg, "/replay", { sessionUid, chunk });
369
+ return;
370
+ }
371
+ const res = await postTrace(transportCfg, "/replay", {
372
+ sessionUid,
373
+ chunk
374
+ });
375
+ if (res && res.status === 429) {
376
+ if (active) {
377
+ active.replayBlocked = true;
378
+ active.rrweb?.stop();
379
+ active.rrweb = null;
380
+ }
381
+ }
370
382
  }
371
- }
372
- }
383
+ }).then(resolve, () => resolve(null));
384
+ });
373
385
  })
374
386
  ).then((handles) => {
375
387
  if (handles && active) active.rrweb = handles;
@@ -58,7 +58,10 @@ async function startRrweb(args) {
58
58
  }
59
59
  if (bufferBytes >= FLUSH_BYTES) flush();
60
60
  },
61
- sampling: { mousemove: 20, scroll: 150 },
61
+ // `input: "last"` emits only the final value of each keystroke
62
+ // run, not one event per character. Smaller payloads, less PII risk
63
+ // for non-masked inputs.
64
+ sampling: { mousemove: 20, scroll: 150, input: "last" },
62
65
  maskAllInputs: inputMode === "all",
63
66
  maskInputOptions,
64
67
  blockClass: maskClass,
@@ -93,10 +96,18 @@ async function startRrweb(args) {
93
96
  if (!stopFn && !paused && !stopped) startRecorder();
94
97
  }
95
98
  for (const ev of ACTIVITY_EVENTS) {
96
- window.addEventListener(ev, onActivity, { passive: true });
99
+ window.addEventListener(ev, onActivity, { passive: true, capture: true });
97
100
  }
98
101
  const onPageHide = () => flush(true);
102
+ const onVisibilityChange = () => {
103
+ if (typeof document !== "undefined" && document.visibilityState === "hidden") {
104
+ flush(true);
105
+ }
106
+ };
99
107
  window.addEventListener("pagehide", onPageHide);
108
+ if (typeof document !== "undefined") {
109
+ document.addEventListener("visibilitychange", onVisibilityChange);
110
+ }
100
111
  startRecorder();
101
112
  return {
102
113
  pause() {
@@ -114,9 +125,12 @@ async function startRrweb(args) {
114
125
  clearInterval(flushTimer);
115
126
  clearInterval(idleTimer);
116
127
  for (const ev of ACTIVITY_EVENTS) {
117
- window.removeEventListener(ev, onActivity);
128
+ window.removeEventListener(ev, onActivity, { capture: true });
118
129
  }
119
130
  window.removeEventListener("pagehide", onPageHide);
131
+ if (typeof document !== "undefined") {
132
+ document.removeEventListener("visibilitychange", onVisibilityChange);
133
+ }
120
134
  },
121
135
  flush
122
136
  };
@@ -58,7 +58,10 @@ async function startRrweb(args) {
58
58
  }
59
59
  if (bufferBytes >= FLUSH_BYTES) flush();
60
60
  },
61
- sampling: { mousemove: 20, scroll: 150 },
61
+ // `input: "last"` emits only the final value of each keystroke
62
+ // run, not one event per character. Smaller payloads, less PII risk
63
+ // for non-masked inputs.
64
+ sampling: { mousemove: 20, scroll: 150, input: "last" },
62
65
  maskAllInputs: inputMode === "all",
63
66
  maskInputOptions,
64
67
  blockClass: maskClass,
@@ -93,10 +96,18 @@ async function startRrweb(args) {
93
96
  if (!stopFn && !paused && !stopped) startRecorder();
94
97
  }
95
98
  for (const ev of ACTIVITY_EVENTS) {
96
- window.addEventListener(ev, onActivity, { passive: true });
99
+ window.addEventListener(ev, onActivity, { passive: true, capture: true });
97
100
  }
98
101
  const onPageHide = () => flush(true);
102
+ const onVisibilityChange = () => {
103
+ if (typeof document !== "undefined" && document.visibilityState === "hidden") {
104
+ flush(true);
105
+ }
106
+ };
99
107
  window.addEventListener("pagehide", onPageHide);
108
+ if (typeof document !== "undefined") {
109
+ document.addEventListener("visibilitychange", onVisibilityChange);
110
+ }
100
111
  startRecorder();
101
112
  return {
102
113
  pause() {
@@ -114,9 +125,12 @@ async function startRrweb(args) {
114
125
  clearInterval(flushTimer);
115
126
  clearInterval(idleTimer);
116
127
  for (const ev of ACTIVITY_EVENTS) {
117
- window.removeEventListener(ev, onActivity);
128
+ window.removeEventListener(ev, onActivity, { capture: true });
118
129
  }
119
130
  window.removeEventListener("pagehide", onPageHide);
131
+ if (typeof document !== "undefined") {
132
+ document.removeEventListener("visibilitychange", onVisibilityChange);
133
+ }
120
134
  },
121
135
  flush
122
136
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@extn/segi-js",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Browser JavaScript SDK for the segi error monitoring service",
5
5
  "license": "UNLICENSED",
6
6
  "main": "./dist/index.js",