PageSourceSearch

https://whisperai.com/assets/index-BjrJqrju.js

js whisperai.com collected 2026-10-01 11:42:16 UTC 127,730 bytes, 4 lines download raw bytes

1import{aL as wn,aM as En,aN as Jt,aO as kn,aP as Ot,aQ as Qt,aR as In,aS as ae,aT as At,aU as Cn,aV as Zt,aW as Mn,aX as Pe,aY as Dt,aZ as Tr,a_ as Rn,a$ as Tn,b0 as xn,b1 as On,b2 as An,b3 as Dn,b4 as Nn,b5 as Ln,b6 as xr,b7 as gt,b8 as Or,b9 as Pn,ba as Bn,bb as Fn,bc as Un,bd as Wn,be as zn,bf as Hn,bg as $n,bh as qn,bi as jn,bj as Ar,bk as Vn,bl as Kn,bm as Yn,bn as Gn,bo as Dr,bp as Xn,aD as Jn,bq as Qn,br as Zn}from"./index-gcDjpmFZ.js";import"./react-vendor-jUbs3Udp.js";import"./query-vendor-DSnlNft5.js";import"./ui-vendor-DDR7ojRs.js";import"./icons-Cjebwm3l.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"2156d85cf031d709fa1b379f59bedaa6c159aa65"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="979e12d3-5fc4-40b1-884b-b33922b52fb8",e._sentryDebugIdIdentifier="sentry-dbid-979e12d3-5fc4-40b1-884b-b33922b52fb8")}catch{}})();function es(e,t){const r=t?.getDsn(),n=t?.getOptions().tunnel;return rs(e,r)||ts(e,n)}function ts(e,t){return t?er(e)===er(t):!1}function rs(e,t){const r=wn(e);return!r||En(r)||!t?!1:ns(r.hostname,t.host)&&/(^|&|\?)sentry_key=/.test(r.search)}function ns(e,t){return e===t||t.length>0&&e.endsWith(`.${t}`)}function er(e){return e[e.length-1]==="/"?e.slice(0,-1):e}function ss(e,t,r){let n,s,i;const o=r?.maxWait?Math.max(r.maxWait,t):0,c=r?.setTimeoutImpl||setTimeout;function a(){return l(),n=e(),n}function l(){s!==void 0&&clearTimeout(s),i!==void 0&&clearTimeout(i),s=i=void 0}function d(){return s!==void 0||i!==void 0?a():n}function u(){return s&&clearTimeout(s),s=c(a,t),o&&i===void 0&&(i=c(a,o)),n}return u.cancel=l,u.flush=d,u}const B=Ot,Nt="sentryReplaySession",is="replay_event",Lt="Unable to send Replay",os=3e5,as=9e5,cs=5e3,ls=5500,us=6e4,ds=5e3,hs=3,tr=15e4,We=5e3,fs=3e3,ps=300,Pt=2e7,ms=4999,gs=5e4,rr=36e5;var ys=Object.defineProperty,Ss=(e,t,r)=>t in e?ys(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,nr=(e,t,r)=>Ss(e,typeof t!="symbol"?t+"":t,r),$=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))($||{});function _s(e){return e.nodeType===e.ELEMENT_NODE}function Re(e){return e?.host?.shadowRoot===e}function Te(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function vs(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function bs(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const r=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function Ve(e){try{const t=e.rules||e.cssRules;return t?vs(Array.from(t,Nr).join("")):null}catch{return null}}function ws(e){let t="";for(let r=0;r<e.style.length;r++){const n=e.style,s=n[r],i=n.getPropertyPriority(s);t+=`${s}:${n.getPropertyValue(s)}${i?" !important":""};`}return`${e.selectorText} { ${t} }`}function Nr(e){let t;if(ks(e))try{t=Ve(e.styleSheet)||bs(e)}catch{}else if(Is(e)){let r=e.cssText;const n=e.selectorText.includes(":"),s=typeof e.style.all=="string"&&e.style.all;if(s&&(r=ws(e)),n&&(r=Es(r)),n||s)return r}return t||e.cssText}function Es(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function ks(e){return"styleSheet"in e}function Is(e){return"selectorText"in e}class Lr{constructor(){nr(this,"idNodeMap",new Map),nr(this,"nodeMetaMap",new WeakMap)}getId(t){return t?this.getMeta(t)?.id??-1:-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){const 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){const n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){const n=this.getNode(t);if(n){const s=this.nodeMetaMap.get(n);s&&this.nodeMetaMap.set(r,s)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Cs(){return new Lr}function rt({maskInputOptions:e,tagName:t,type:r}
1){return t==="OPTION"&&(t="SELECT"),!!(e[t.toLowerCase()]||r&&e[r]||r==="password"||t==="INPUT"&&!r&&e.text)}function Oe({isMasked:e,element:t,value:r,maskInputFn:n}){let s=r||"";return e?(n&&(s=n(s,t)),"*".repeat(s.length)):s}function be(e){return e.toLowerCase()}function wt(e){return e.toUpperCase()}const sr="__rrweb_original__";function Ms(e){const t=e.getContext("2d");if(!t)return!0;const r=50;for(let n=0;n<e.width;n+=r)for(let s=0;s<e.height;s+=r){const i=t.getImageData,o=sr in i?i[sr]:i;if(new Uint32Array(o.call(t,n,s,Math.min(r,e.width-n),Math.min(r,e.height-s)).data.buffer).some(a=>a!==0))return!1}return!0}function Bt(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?be(t):null}function Ke(e,t,r){return t==="INPUT"&&(r==="radio"||r==="checkbox")?e.getAttribute("value")||"":e.value}function Pr(e,t){let r;try{r=new URL(e,t??window.location.href)}catch{return null}const n=/\.([0-9a-z]+)(?:$)/i;return r.pathname.match(n)?.[1]??null}const ir={};function Br(e){const t=ir[e];if(t)return t;const r=window.document;let n=window[e];if(r&&typeof r.createElement=="function")try{const s=r.createElement("iframe");s.hidden=!0,r.head.appendChild(s);const i=s.contentWindow;i&&i[e]&&(n=i[e]),r.head.removeChild(s)}catch{}return ir[e]=n.bind(window)}function Et(...e){return Br("setTimeout")(...e)}function Fr(...e){return Br("clearTimeout")(...e)}function Ur(e){try{return e.contentDocument}catch{}}function Rs(e){try{return e.contentWindow}catch{}}let Ts=1;const xs=new RegExp("[^a-z0-9-_:]"),Ae=-2;function Ft(){return Ts++}function Os(e){if(e instanceof HTMLFormElement)return"form";const t=be(e.tagName);return xs.test(t)?"div":t}function As(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}let pe,or;const Ds=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ns=/^(?:[a-z+]+:)?\/\//i,Ls=/^www\..*/i,Ps=/^(data:)([^,]*),(.*)/i;function Bs(e,t){if(!e||t.size===0)return e;try{const r=e.split(";"),n=[];for(let s of r){if(s=s.trim(),!s)continue;const i=s.indexOf(":");if(i===-1){n.push(s);continue}const o=s.slice(0,i).trim();t.has(o)||n.push(s)}return n.join("; ")+(n.length>0&&e.endsWith(";")?";":"")}catch(r){return console.warn("Error filtering CSS properties:",r),e}}function Ye(e,t){return(e||"").replace(Ds,(r,n,s,i,o,c)=>{const a=s||o||c,l=n||i||"";if(!a)return r;if(Ns.test(a)||Ls.test(a))return`url(${l}${a}${l})`;if(Ps.test(a))return`url(${l}${a}${l})`;if(a[0]==="/")return`url(${l}${As(t)+a}${l})`;const d=t.split("/"),u=a.split("/");d.pop();for(const h of u)h!=="."&&(h===".."?d.pop():d.push(h));return`url(${l}${d.join("/")}${l})`})}const Fs=/^[^ \t\n\r\u000c]+/,Us=/^[, \t\n\r\u000c]+/;function Ws(e,t){if(t.trim()==="")return t;let r=0;function n(i){let o;const c=i.exec(t.substring(r));return c?(o=c[0],r+=o.length,o):""}const s=[];for(;n(Us),!(r>=t.length);){let i=n(Fs);if(i.slice(-1)===",")i=ye(e,i.substring(0,i.length-1)),s.push(i);else{let o="";i=ye(e,i);let c=!1;for(;;){const a=t.charAt(r);if(a===""){s.push((i+o).trim());break}else if(c)a===")"&&(c=!1);else if(a===","){r+=1,s.push((i+o).trim());break}else a==="("&&(c=!0);o+=a,r+=1}}}return s.join(", ")}const ar=new WeakMap;function ye(e,t){return!t||t.trim()===""?t:nt(e,t)}function zs(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function nt(e,t){let r=ar.get(e);if(r||(r=e.createElement("a"),ar.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function Wr(e,t,r,n,s,i,o){if(!n)return n;if(r==="src"||r==="href"&&!(t==="use"&&n[0]==="#"))return ye(e,n);if(r==="xlink:href"&&n[0]!=="#")return ye(e,n);if(r==="background"&&(t==="table"||t==="td"||t==="th"))return ye(e,n);if(r==="srcset")return Ws(e,n);if(r==="style"){let c=Ye(n,nt(e));return o&&o.size>0&&(c=Bs(c,o)),c}else if(t==="object"&&r==="data")return ye(e,n);return typeof i=="function"?i(r,n,s):n}function zr(e,t,r){return(e==="video"||e==="audio")&&t==="autoplay"}function Hs(e,t,r,n){try{if(n&&e.matches(n))return!1;if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let s=e.classList.length;s--;){const i=e.classList[s];if(t.test(i))return!0}if(r)return e.matches(r)}catch{}return!1}function $s(e,t){for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!1}function fe(e,t,r=1/0,n=0){return!e||e.nodeType!==e.ELEMENT_NODE||n>r?-1:t(e)?n:fe(e.parentNode,t,r,n+1)}function Se(e,t){return r=>{const n=r;if(n===null)return!1;try{if(e){if(typeof e=="string"){if(n.matches(`.${e}`))return!0}else if($s(n,e))return!0}return!!(t&&n.matches(t))}catch{return!1}}}function we(e,t,r,n,s,i){try{const o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(o===null)return!1;if(o.tagName==="INPUT"){const l=o.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(l))return!0}let c=-1,a=-1;if(i){if(a=fe(o,Se(n,s)),a<0)return!0;c=fe(o,Se(t,r),a>=0?a:1/0)}else{if(c=fe(o,Se(t,r)),c<0)return!1;a=fe(o,Se(n,s),c>=0?c:1/0)}return c>=0?a>=0?c<=a:!0:a>=0?!1:!!i}catch{}return!!i}function qs(e,t,r){const n=Rs(e);if(!n)return;let s=!1,i;try{i=n.document.readyState}catch{return}if(i!=="complete"){const c=Et(()=>{s||(t(),s=!0)},r);e.addEventListener("load",()=>{Fr(c),s=!0,t()});return}const o="about:blank";if(n.location.href!==o||e.src===o||e.src==="")return Et(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function js(e,t,r){let n=!1,s;try{s=e.sheet}catch{s=null}if(s)return;const i=Et(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{Fr(i),n=!0,t()})}function Vs(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskAttributeFn:a,maskTextClass:l,unmaskTextClass:d,maskTextSelector:u,unmaskTextSelector:h,inlineStylesheet:p,maskInputOptions:f={},maskTextFn:y,maskInputFn:b,dataURLOptions:S={}
1,inlineImages:I,recordCanvas:N,keepIframeSrcFn:A,newlyAddedElement:F=!1,ignoreCSSAttributes:M}=t,m=Ks(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:$.Document,childNodes:[],compatMode:e.compatMode}:{type:$.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:$.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:m};case e.ELEMENT_NODE:return Gs(e,{doc:r,blockClass:s,blockSelector:i,unblockSelector:o,inlineStylesheet:p,maskAttributeFn:a,maskInputOptions:f,maskInputFn:b,dataURLOptions:S,inlineImages:I,recordCanvas:N,keepIframeSrcFn:A,newlyAddedElement:F,rootId:m,maskTextClass:l,unmaskTextClass:d,maskTextSelector:u,unmaskTextSelector:h,ignoreCSSAttributes:M});case e.TEXT_NODE:return Ys(e,{doc:r,maskAllText:c,maskTextClass:l,unmaskTextClass:d,maskTextSelector:u,unmaskTextSelector:h,maskTextFn:y,maskInputOptions:f,maskInputFn:b,rootId:m});case e.CDATA_SECTION_NODE:return{type:$.CDATA,textContent:"",rootId:m};case e.COMMENT_NODE:return{type:$.Comment,textContent:e.textContent||"",rootId:m};default:return!1}}function Ks(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return r===1?void 0:r}function Ys(e,t){const{maskAllText:r,maskTextClass:n,unmaskTextClass:s,maskTextSelector:i,unmaskTextSelector:o,maskTextFn:c,maskInputOptions:a,maskInputFn:l,rootId:d}=t,u=e.parentNode&&e.parentNode.tagName;let h=e.textContent;const p=u==="STYLE"?!0:void 0,f=u==="SCRIPT"?!0:void 0,y=u==="TEXTAREA"?!0:void 0;if(p&&h){try{e.nextSibling||e.previousSibling||e.parentNode.sheet?.cssRules&&(h=Ve(e.parentNode.sheet))}catch(S){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${S}`,e)}h=Ye(h,nt(t.doc))}f&&(h="SCRIPT_PLACEHOLDER");const b=we(e,n,i,s,o,r);if(!p&&!f&&!y&&h&&b&&(h=c?c(h,e.parentElement):h.replace(/[\S]/g,"*")),y&&h&&(a.textarea||b)&&(h=l?l(h,e.parentNode):h.replace(/[\S]/g,"*")),u==="OPTION"&&h){const S=rt({type:null,tagName:u,maskInputOptions:a});h=Oe({isMasked:we(e,n,i,s,o,S),element:e,value:h,maskInputFn:l})}return{type:$.Text,textContent:h||"",isStyle:p,rootId:d}}function Gs(e,t){const{doc:r,blockClass:n,blockSelector:s,unblockSelector:i,inlineStylesheet:o,maskInputOptions:c={},maskAttributeFn:a,maskInputFn:l,dataURLOptions:d={},inlineImages:u,recordCanvas:h,keepIframeSrcFn:p,newlyAddedElement:f=!1,rootId:y,maskTextClass:b,unmaskTextClass:S,maskTextSelector:I,unmaskTextSelector:N,ignoreCSSAttributes:A}=t,F=Hs(e,n,s,i),M=Os(e);let m={};const R=e.attributes.length;for(let g=0;g<R;g++){const E=e.attributes[g];E.name&&!zr(M,E.name,E.value)&&(m[E.name]=Wr(r,M,be(E.name),E.value,e,a,A))}if(M==="link"&&o){const g=Array.from(r.styleSheets).find(L=>L.href===e.href);let E=null;g&&(E=Ve(g)),E&&(m.rel=null,m.href=null,m.crossorigin=null,m._cssText=Ye(E,g.href))}if(M==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const g=Ve(e.sheet);g&&(m._cssText=Ye(g,nt(r)))}if(M==="input"||M==="textarea"||M==="select"||M==="option"){const g=e,E=Bt(g),L=Ke(g,wt(M),E),z=g.checked;if(E!=="submit"&&E!=="button"&&L){const H=we(g,b,I,S,N,rt({type:E,tagName:wt(M),maskInputOptions:c}));m.value=Oe({isMasked:H,element:g,value:L,maskInputFn:l})}z&&(m.checked=z)}if(M==="option"&&(e.selected&&!c.select?m.selected=!0:delete m.selected),M==="canvas"&&h){if(e.__context==="2d")Ms(e)||(m.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){const g=e.toDataURL(d.type,d.quality),E=r.createElement("canvas");E.width=e.width,E.height=e.height;const L=E.toDataURL(d.type,d.quality);g!==L&&(m.rr_dataURL=g)}}if(M==="img"&&u){pe||(pe=r.createElement("canvas"),or=pe.getContext("2d"));const g=e,E=g.currentSrc||g.getAttribute("src")||"<unknown-src>",L=g.crossOrigin,z=()=>{g.removeEventListener("load",z);try{pe.width=g.naturalWidth,pe.height=g.naturalHeight,or.drawImage(g,0,0),m.rr_dataURL=pe.toDataURL(d.type,d.quality)}catch(H){if(g.crossOrigin!=="anonymous"){g.crossOrigin="anonymous",g.complete&&g.naturalWidth!==0?z():g.addEventListener("load",z);return}else console.warn(`Cannot inline img src=${E}! Error: ${H}`)}g.crossOrigin==="anonymous"&&(L?m.crossOrigin=L:g.removeAttribute("crossorigin"))};
1g.complete&&g.naturalWidth!==0?z():g.addEventListener("load",z)}if((M==="audio"||M==="video")&&(m.rr_mediaState=e.paused?"paused":"played",m.rr_mediaCurrentTime=e.currentTime),f||(e.scrollLeft&&(m.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(m.rr_scrollTop=e.scrollTop)),F){const{width:g,height:E}=e.getBoundingClientRect();m={class:m.class,rr_width:`${g}px`,rr_height:`${E}px`}}M==="iframe"&&!p(m.src)&&(!F&&!Ur(e)&&(m.rr_src=m.src),delete m.src);let q;try{customElements.get(M)&&(q=!0)}catch{}return{type:$.Element,tagName:M,attributes:m,childNodes:[],isSVG:zs(e)||void 0,needBlock:F,rootId:y,isCustom:q}}function P(e){return e==null?"":e.toLowerCase()}function Xs(e,t){if(t.comment&&e.type===$.Comment)return!0;if(e.type===$.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Pr(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(P(e.attributes.name).match(/^msapplication-tile(image|color)$/)||P(e.attributes.name)==="application-name"||P(e.attributes.rel)==="icon"||P(e.attributes.rel)==="apple-touch-icon"||P(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&P(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(P(e.attributes.property).match(/^(og|twitter|fb):/)||P(e.attributes.name).match(/^(og|twitter):/)||P(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(P(e.attributes.name)==="robots"||P(e.attributes.name)==="googlebot"||P(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(P(e.attributes.name)==="author"||P(e.attributes.name)==="generator"||P(e.attributes.name)==="framework"||P(e.attributes.name)==="publisher"||P(e.attributes.name)==="progid"||P(e.attributes.property).match(/^article:/)||P(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(P(e.attributes.name)==="google-site-verification"||P(e.attributes.name)==="yandex-verification"||P(e.attributes.name)==="csrf-token"||P(e.attributes.name)==="p:domain_verify"||P(e.attributes.name)==="verify-v1"||P(e.attributes.name)==="verification"||P(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function _e(e,t){const{doc:r,mirror:n,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:u,skipChild:h=!1,inlineStylesheet:p=!0,maskInputOptions:f={},maskAttributeFn:y,maskTextFn:b,maskInputFn:S,slimDOMOptions:I,dataURLOptions:N={},inlineImages:A=!1,recordCanvas:F=!1,onSerialize:M,onIframeLoad:m,iframeLoadTimeout:R=5e3,onBlockedImageLoad:q,onStylesheetLoad:g,stylesheetLoadTimeout:E=5e3,keepIframeSrcFn:L=()=>!1,newlyAddedElement:z=!1,ignoreCSSAttributes:H}=t;let{preserveWhiteSpace:Q=!0}=t;const V=Vs(e,{doc:r,mirror:n,blockClass:s,blockSelector:i,maskAllText:c,unblockSelector:o,maskTextClass:a,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:u,inlineStylesheet:p,maskInputOptions:f,maskAttributeFn:y,maskTextFn:b,maskInputFn:S,dataURLOptions:N,inlineImages:A,recordCanvas:F,keepIframeSrcFn:L,newlyAddedElement:z,ignoreCSSAttributes:H});if(!V)return console.warn(e,"not serialized"),null;let K;n.hasNode(e)?K=n.getId(e):Xs(V,I)||!Q&&V.type===$.Text&&!V.isStyle&&!V.textContent.trim().length?K=Ae:K=Ft();const C=Object.assign(V,{id:K});if(n.add(e,C),K===Ae)return null;M&&M(e);let J=!h;if(C.type===$.Element){J=J&&!C.needBlock;const U=e.shadowRoot;U&&Te(U)&&(C.isShadowHost=!0)}if((C.type===$.Document||C.type===$.Element)&&J){I.headWhitespace&&C.type===$.Element&&C.tagName==="head"&&(Q=!1);const U={doc:r,mirror:n,blockClass:s,blockSelector:i,maskAllText:c,unblockSelector:o,maskTextClass:a,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:u,skipChild:h,inlineStylesheet:p,maskInputOptions:f,maskAttributeFn:y,maskTextFn:b,maskInputFn:S,slimDOMOptions:I,dataURLOptions:N,inlineImages:A,recordCanvas:F,preserveWhiteSpace:Q,onSerialize:M,onIframeLoad:m,iframeLoadTimeout:R,onBlockedImageLoad:q,onStylesheetLoad:g,stylesheetLoadTimeout:E,keepIframeSrcFn:L,ignoreCSSAttributes:H},ne=e.childNodes?Array.from(e.childNodes):[];for(const se of ne){const Z=_e(se,U);Z&&C.childNodes.push(Z)}if(_s(e)&&e.shadowRoot)for(const se of Array.from(e.shadowRoot.childNodes)){const Z=_e(se,U);Z&&(Te(e.shadowRoot)&&(Z.isShadow=!0),C.childNodes.push(Z))}}if(e.parentNode&&Re(e.parentNode)&&Te(e.parentNode)&&(C.isShadow=!0),C.type===$.Element&&C.tagName==="iframe"&&!C.needBlock&&qs(e,()=>{const U=Ur(e);
1if(U&&m){const ne=_e(U,{doc:U,mirror:n,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:p,maskInputOptions:f,maskAttributeFn:y,maskTextFn:b,maskInputFn:S,slimDOMOptions:I,dataURLOptions:N,inlineImages:A,recordCanvas:F,preserveWhiteSpace:Q,onSerialize:M,onIframeLoad:m,iframeLoadTimeout:R,onStylesheetLoad:g,stylesheetLoadTimeout:E,keepIframeSrcFn:L,ignoreCSSAttributes:H});ne&&m(e,ne)}},R),C.type===$.Element&&C.tagName==="img"&&!e.complete&&C.needBlock){const U=e,ne=()=>{if(U.isConnected&&!U.complete&&q)try{const se=U.getBoundingClientRect();se.width>0&&se.height>0&&q(U,C,se)}catch{}U.removeEventListener("load",ne)};U.isConnected&&U.addEventListener("load",ne)}return C.type===$.Element&&C.tagName==="link"&&typeof C.attributes.rel=="string"&&(C.attributes.rel==="stylesheet"||C.attributes.rel==="preload"&&typeof C.attributes.href=="string"&&Pr(C.attributes.href)==="css")&&js(e,()=>{if(g){const U=_e(e,{doc:r,mirror:n,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:p,maskInputOptions:f,maskAttributeFn:y,maskTextFn:b,maskInputFn:S,slimDOMOptions:I,dataURLOptions:N,inlineImages:A,recordCanvas:F,preserveWhiteSpace:Q,onSerialize:M,onIframeLoad:m,iframeLoadTimeout:R,onStylesheetLoad:g,stylesheetLoadTimeout:E,keepIframeSrcFn:L,ignoreCSSAttributes:H});U&&g(e,U)}},E),C.type===$.Element&&delete C.needBlock,C}function Js(e,t){const{mirror:r=new Lr,blockClass:n="rr-block",blockSelector:s=null,unblockSelector:i=null,maskAllText:o=!1,maskTextClass:c="rr-mask",unmaskTextClass:a=null,maskTextSelector:l=null,unmaskTextSelector:d=null,inlineStylesheet:u=!0,inlineImages:h=!1,recordCanvas:p=!1,maskAllInputs:f=!1,maskAttributeFn:y,maskTextFn:b,maskInputFn:S,slimDOM:I=!1,dataURLOptions:N,preserveWhiteSpace:A,onSerialize:F,onIframeLoad:M,iframeLoadTimeout:m,onBlockedImageLoad:R,onStylesheetLoad:q,stylesheetLoadTimeout:g,keepIframeSrcFn:E=()=>!1,ignoreCSSAttributes:L=new Set([])}=t||{};return _e(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,unblockSelector:i,maskAllText:o,maskTextClass:c,unmaskTextClass:a,maskTextSelector:l,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:u,maskInputOptions:f===!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}:f===!1?{}:f,maskAttributeFn:y,maskTextFn:b,maskInputFn:S,slimDOMOptions:I===!0||I==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:I==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:I===!1?{}:I,dataURLOptions:N,inlineImages:h,recordCanvas:p,preserveWhiteSpace:A,onSerialize:F,onIframeLoad:M,iframeLoadTimeout:m,onBlockedImageLoad:R,onStylesheetLoad:q,stylesheetLoadTimeout:g,keepIframeSrcFn:E,newlyAddedElement:!1,ignoreCSSAttributes:L})}function G(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const me=`Please stop import mirror directly. Instead of that,\r
2now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
3or you can use record.mirror to access the mirror instance during recording.`;let cr={map:{},getId(){return console.error(me),-1},getNode(){return console.error(me),null},removeNodeFromMap(){console.error(me)},has(){return console.error(me),!1},reset(){console.error(me)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(cr=new Proxy(cr,{get(e,t,r){return t==="map"&&console.error(me),Reflect.get(e,t,r)}}));function De(e,t,r={}){let n=null,s=0;return function(...i){const o=Date.now();!s&&r.leading===!1&&(s=o);const c=t-(o-s),a=this;c<=0||c>t?(n&&(si(n),n=null),s=o,e.apply(a,i)):!n&&r.trailing!==!1&&(n=st(()=>{s=r.leading===!1?0:Date.now(),n=null,e.apply(a,i)},c))}}function Hr(e,t,r,n,s=window){const i=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,n?r:{set(o){st(()=>{r.set.call(this,o)},0),i&&i.set&&i.set.call(this,o)}}),()=>Hr(e,t,i||{},!0)}function Ut(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],s=r(n);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=s,()=>{e[t]=n}}catch{return()=>{}}}let Ge=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Ge=()=>new Date().getTime());function $r(e){const t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:t?.documentElement.scrollLeft||t?.body?.parentElement?.scrollLeft||t?.body?.scrollLeft||0,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:t?.documentElement.scrollTop||t?.body?.parentElement?.scrollTop||t?.body?.scrollTop||0}}function qr(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function jr(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Vr(e){if(!e)return null;
3try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function X(e,t,r,n,s){if(!e)return!1;const i=Vr(e);if(!i)return!1;const o=Se(t,r);if(!s){const l=n&&i.matches(n);return o(i)&&!l}const c=fe(i,o);let a=-1;return c<0?!1:(n&&(a=fe(i,Se(null,n))),c>-1&&a<0?!0:c<a)}function Qs(e,t){return t.getId(e)!==-1}function yt(e,t){return t.getId(e)===Ae}function Kr(e,t){if(Re(e))return!1;const r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?Kr(e.parentNode,t):!0:!0}function kt(e){return!!e.changedTouches}function Zs(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 Yr(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Gr(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function It(e){return!!e?.shadowRoot}class ei{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){return this.styleIDMap.get(t)??-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++}}function Xr(e){let t=null;return e.getRootNode?.()?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function ti(e){let t=e,r;for(;r=Xr(t);)t=r;return t}function ri(e){const t=e.ownerDocument;if(!t)return!1;const r=ti(e);return t.contains(r)}function Jr(e){const t=e.ownerDocument;return t?t.contains(e)||ri(e):!1}const lr={};function Wt(e){const t=lr[e];if(t)return t;const r=window.document;let n=window[e];if(r&&typeof r.createElement=="function")try{const s=r.createElement("iframe");s.hidden=!0,r.head.appendChild(s);const i=s.contentWindow;i&&i[e]&&(n=i[e]),r.head.removeChild(s)}catch{}return lr[e]=n.bind(window)}function ni(...e){return Wt("requestAnimationFrame")(...e)}function st(...e){return Wt("setTimeout")(...e)}function si(...e){return Wt("clearTimeout")(...e)}var k=(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))(k||{}),w=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(w||{}),Y=(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))(Y||{}),oe=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(oe||{}),ge=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(ge||{});let xe;function ii(e){xe=e}function oi(){xe=void 0}const O=e=>xe?(...r)=>{try{return e(...r)}catch(n){if(xe&&xe(n)===!0)return()=>{};throw n}}:e;var ur="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ai=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var ze=0;ze<ur.length;ze++)ai[ur.charCodeAt(ze)]=ze;class dr{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}}function zt(e){try{return e.contentDocument}catch{}}function Ne(e){try{return e.contentWindow}catch{}}class ci{constructor(t){this.doc=t,this.unattachedDoc=null}parse(t){return this.parseWithConstructableStylesheet(t)||this.parseWithDetachedElement(t)}parseWithConstructableStylesheet(t){if(typeof CSSStyleSheet>"u"||typeof CSSStyleSheet.prototype.replaceSync!="function")return null;try{const r=new CSSStyleSheet;r.replaceSync(`x { ${t} }`);const n=r.cssRules[0];
3return!n||n.type!==CSSRule.STYLE_RULE?null:n.style}catch{return null}}parseWithDetachedElement(t){const r=this.getUnattachedDoc().createElement("span");return r.setAttribute("style",t),r.style}getUnattachedDoc(){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}return this.unattachedDoc}}function hr(e){return"__ln"in e}class li{constructor(){this.length=0,this.head=null,this.tail=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){const r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&hr(t.previousSibling)){const 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&&hr(t.nextSibling)&&t.nextSibling.__ln.previous){const 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;r.next===null&&(this.tail=r),this.length++}removeNode(t){const r=t.__ln;this.head&&(r.previous?(r.previous.next=r.next,r.next?r.next.previous=r.previous:this.tail=r.previous):(this.head=r.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}const fr=(e,t)=>`${e}@${t}`;class ui{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,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;const t=[],r=new Set,n=new li,s=a=>{let l=a,d=Ae;for(;d===Ae;)l=l&&l.nextSibling,d=l&&this.mirror.getId(l);return d},i=a=>{if(!a.parentNode||!Jr(a))return;const l=Re(a.parentNode)?this.mirror.getId(Xr(a)):this.mirror.getId(a.parentNode),d=s(a);if(l===-1||d===-1)return n.addNode(a);const u=_e(a,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:h=>{Yr(h,this.mirror)&&!X(h,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(h),Gr(h,this.mirror)&&this.stylesheetManager.trackLinkElement(h),It(a)&&this.shadowDomManager.addShadowRoot(a.shadowRoot,this.doc)},onIframeLoad:(h,p)=>{if(X(h,this.blockClass,this.blockSelector,this.unblockSelector,!1))return;this.iframeManager.attachIframe(h,p);const f=Ne(h);f&&this.canvasManager.addWindow(f),this.shadowDomManager.observeAttachShadow(h)},onStylesheetLoad:(h,p)=>{this.stylesheetManager.attachLinkElement(h,p)},onBlockedImageLoad:(h,p,{width:f,height:y})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:p.id,attributes:{style:{width:`${f}px`,height:`${y}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});u&&(t.push({parentId:l,nextId:d,node:u}),r.add(u.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());
3for(const a of this.movedSet)pr(this.removes,a,this.mirror)&&!this.movedSet.has(a.parentNode)||i(a);for(const a of this.addedSet)!mr(this.droppedSet,a)&&!pr(this.removes,a,this.mirror)||mr(this.movedSet,a)?i(a):this.droppedSet.add(a);let o=null;for(;n.length;){let a=null;if(o){const l=this.mirror.getId(o.value.parentNode),d=s(o.value);l!==-1&&d!==-1&&(a=o)}if(!a){let l=n.tail;for(;l;){const d=l;if(l=l.previous,d){const u=this.mirror.getId(d.value.parentNode);if(s(d.value)===-1)continue;if(u!==-1){a=d;break}else{const p=d.value;if(p.parentNode&&p.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const f=p.parentNode.host;if(this.mirror.getId(f)!==-1){a=d;break}}}}}}if(!a){for(;n.head;)n.removeNode(n.head.value);break}o=a.previous,n.removeNode(a.value),i(a.value)}const c={texts:this.texts.map(a=>({id:this.mirror.getId(a.node),value:a.value})).filter(a=>!r.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{const{attributes:l}=a;if(typeof l.style=="string"){const d=JSON.stringify(a.styleDiff),u=JSON.stringify(a._unchangedStyles);d.length<l.style.length&&(d+u).split("var(").length===l.style.split("var(").length&&(l.style=a.styleDiff)}return{id:this.mirror.getId(a.node),attributes:l}}).filter(a=>!r.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:t};!c.texts.length&&!c.attributes.length&&!c.removes.length&&!c.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(c))},this.processMutation=t=>{if(!yt(t.target,this.mirror))switch(t.type){case"characterData":{const r=t.target.textContent;!X(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:we(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&r?this.maskTextFn?this.maskTextFn(r,Vr(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let n=t.attributeName,s=t.target.getAttribute(n);if(n==="value"){const o=Bt(r),c=r.tagName;s=Ke(r,c,o);const a=rt({maskInputOptions:this.maskInputOptions,tagName:c,type:o}),l=we(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,a);s=Oe({isMasked:l,element:r,value:s,maskInputFn:this.maskInputFn})}if(X(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||s===t.oldValue)return;let i=this.attributeMap.get(t.target);if(r.tagName==="IFRAME"&&n==="src"&&!this.keepIframeSrcFn(s))if(!zt(r))n="rr_src";else return;if(i||(i={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(t.target,i)),n==="type"&&r.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!zr(r.tagName,n)&&(i.attributes[n]=Wr(this.doc,be(r.tagName),be(n),s,r,this.maskAttributeFn),n==="style")){const o=t.oldValue?this.styleDeclarationParser.parse(t.oldValue):null;for(const c of Array.from(r.style)){const a=r.style.getPropertyValue(c),l=r.style.getPropertyPriority(c);a!==(o?.getPropertyValue(c)||"")||l!==(o?.getPropertyPriority(c)||"")?l===""?i.styleDiff[c]=a:i.styleDiff[c]=[a,l]:i._unchangedStyles[c]=[a,l]}if(o)for(const c of Array.from(o))r.style.getPropertyValue(c)===""&&(i.styleDiff[c]=!1)}break}case"childList":{if(X(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{const n=this.mirror.getId(r),s=Re(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);X(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||yt(r,this.mirror)||!Qs(r,this.mirror)||(this.addedSet.has(r)?(Ct(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||Kr(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[fr(n,s)]?Ct(this.movedSet,r):this.removes.push({parentId:s,id:n,isShadow:Re(t.target)&&Te(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(yt(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[fr(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);X(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes&&t.childNodes.forEac
3h(n=>this.genAdds(n)),It(t)&&t.shadowRoot.childNodes.forEach(n=>{this.processedNodeManager.add(n,this),this.genAdds(n,t)}))}}}init(t){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager","ignoreCSSAttributes"].forEach(r=>{this[r]=t[r]}),this.styleDeclarationParser=new ci(this.doc)}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 Ct(e,t){e.delete(t),t.childNodes?.forEach(r=>Ct(e,r))}function pr(e,t,r){return e.length===0?!1:di(e,t,r)}function di(e,t,r){let n=t.parentNode;for(;n;){const s=r.getId(n);if(e.some(i=>i.id===s))return!0;n=n.parentNode}return!1}function mr(e,t){return e.size===0?!1:Qr(e,t)}function Qr(e,t){const{parentNode:r}=t;return r?e.has(r)?!0:Qr(e,r):!1}const ve=[];function Be(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Zr(e,t){const r=new ui;ve.push(r),r.init(e);let n=window.MutationObserver||window.__rrMutationObserver;const s=window?.Zone?.__symbol__?.("MutationObserver");s&&window[s]&&(n=window[s]);const i=new n(O(o=>{e.onMutation&&e.onMutation(o)===!1||r.processMutations.bind(r)(o)}));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function hi({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};const s=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let o=[],c;const a=De(O(u=>{const h=Date.now()-c;e(o.map(p=>(p.timeOffset-=h,p)),u),o=[],c=null}),i),l=O(De(O(u=>{const h=Be(u),{clientX:p,clientY:f}=kt(u)?u.changedTouches[0]:u;c||(c=Ge()),o.push({x:p,y:f,id:n.getId(h),timeOffset:Ge()-c}),a(typeof DragEvent<"u"&&u instanceof DragEvent?w.Drag:u instanceof MouseEvent?w.MouseMove:w.TouchMove)}),s,{trailing:!1})),d=[G("mousemove",l,r),G("touchmove",l,r),G("drag",l,r)];return O(()=>{d.forEach(u=>u())})}function fi({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,unblockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const c=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[];let l=null;const d=u=>h=>{const p=Be(h);if(X(p,n,s,i,!0))return;let f=null,y=u;if("pointerType"in h){switch(h.pointerType){case"mouse":f=oe.Mouse;break;case"touch":f=oe.Touch;break;case"pen":f=oe.Pen;break}f===oe.Touch?Y[u]===Y.MouseDown?y="TouchStart":Y[u]===Y.MouseUp&&(y="TouchEnd"):oe.Pen}else kt(h)&&(f=oe.Touch);f!==null?(l=f,(y.startsWith("Touch")&&f===oe.Touch||y.startsWith("Mouse")&&f===oe.Mouse)&&(f=null)):Y[u]===Y.Click&&(f=l,l=null);const b=kt(h)?h.changedTouches[0]:h;if(!b)return;const S=r.getId(p),{clientX:I,clientY:N}=b;O(e)({type:Y[y],id:S,x:I,y:N,...f!==null&&{pointerType:f}})};return Object.keys(Y).filter(u=>Number.isNaN(Number(u))&&!u.endsWith("_Departed")&&c[u]!==!1).forEach(u=>{let h=be(u);const p=d(u);if(window.PointerEvent)switch(Y[u]){case Y.MouseDown:case Y.MouseUp:h=h.replace("mouse","pointer");break;case Y.TouchStart:case Y.TouchEnd:return}a.push(G(h,p,t))}),O(()=>{a.forEach(u=>u())})}function en({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,unblockSelector:i,sampling:o}){const c=O(De(O(a=>{const l=Be(a);if(!l||X(l,n,s,i,!0))return;const d=r.getId(l);if(l===t&&t.defaultView){const u=$r(t.defaultView);e({id:d,x:u.left,y:u.top})}else e({id:d,x:l.scrollLeft,y:l.scrollTop})}),o.scroll||100));return G("scroll",c,t)}function pi({viewportResizeCb:e},{win:t}){let r=-1,n=-1;const s=O(De(O(()=>{const i=qr(),o=jr();(r!==i||n!==o)&&(e({width:Number(o),height:Number(i)}),r=i,n=o)}),200));return G("resize",s,t)}const mi=["INPUT","TEXTAREA","SELECT"],gr=new WeakMap;function gi({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,unblockSelector:i,ignoreClass:o,ignoreSelector:c,maskInputOptions:a,maskInputFn:l,sampling:d,userTr
3iggeredOnInput:u,maskTextClass:h,unmaskTextClass:p,maskTextSelector:f,unmaskTextSelector:y}){function b(m){let R=Be(m);const q=m.isTrusted,g=R&&wt(R.tagName);if(g==="OPTION"&&(R=R.parentElement),!R||!g||mi.indexOf(g)<0||X(R,n,s,i,!0))return;const E=R;if(E.classList.contains(o)||c&&E.matches(c))return;const L=Bt(R);let z=Ke(E,g,L),H=!1;const Q=rt({maskInputOptions:a,tagName:g,type:L}),V=we(R,h,f,p,y,Q);(L==="radio"||L==="checkbox")&&(H=R.checked),z=Oe({isMasked:V,element:R,value:z,maskInputFn:l}),S(R,u?{text:z,isChecked:H,userTriggered:q}:{text:z,isChecked:H});const K=R.name;L==="radio"&&K&&H&&t.querySelectorAll(`input[type="radio"][name="${K}"]`).forEach(C=>{if(C!==R){const J=Oe({isMasked:V,element:C,value:Ke(C,g,L),maskInputFn:l});S(C,u?{text:J,isChecked:!H,userTriggered:!1}:{text:J,isChecked:!H})}})}function S(m,R){const q=gr.get(m);if(!q||q.text!==R.text||q.isChecked!==R.isChecked){gr.set(m,R);const g=r.getId(m);O(e)({...R,id:g})}}const N=(d.input==="last"?["change"]:["input","change"]).map(m=>G(m,O(b),t)),A=t.defaultView;if(!A)return()=>{N.forEach(m=>m())};const F=A.Object.getOwnPropertyDescriptor(A.HTMLInputElement.prototype,"value"),M=[[A.HTMLInputElement.prototype,"value"],[A.HTMLInputElement.prototype,"checked"],[A.HTMLSelectElement.prototype,"value"],[A.HTMLTextAreaElement.prototype,"value"],[A.HTMLSelectElement.prototype,"selectedIndex"],[A.HTMLOptionElement.prototype,"selected"]];return F&&F.set&&N.push(...M.map(m=>Hr(m[0],m[1],{set(){O(b)({target:this,isTrusted:!1})}},!1,A))),O(()=>{N.forEach(m=>m())})}function Xe(e){const t=[];function r(n,s){if(He("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||He("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||He("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||He("CSSConditionRule")&&n.parentRule instanceof CSSConditionRule){const o=Array.from(n.parentRule.cssRules).indexOf(n);s.unshift(o)}else if(n.parentStyleSheet){const o=Array.from(n.parentStyleSheet.cssRules).indexOf(n);s.unshift(o)}return s}return r(e,t)}function ce(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function yi({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};const s=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:O((d,u,h)=>{const[p,f]=h,{id:y,styleId:b}=ce(u,t,r.styleMirror);return(y&&y!==-1||b&&b!==-1)&&e({id:y,styleId:b,adds:[{rule:p,index:f}]}),d.apply(u,h)})});const i=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:O((d,u,h)=>{const[p]=h,{id:f,styleId:y}=ce(u,t,r.styleMirror);return(f&&f!==-1||y&&y!==-1)&&e({id:f,styleId:y,removes:[{index:p}]}),d.apply(u,h)})});let o;n.CSSStyleSheet.prototype.replace&&(o=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:O((d,u,h)=>{const[p]=h,{id:f,styleId:y}=ce(u,t,r.styleMirror);return(f&&f!==-1||y&&y!==-1)&&e({id:f,styleId:y,replace:p}),d.apply(u,h)})}));let c;n.CSSStyleSheet.prototype.replaceSync&&(c=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:O((d,u,h)=>{const[p]=h,{id:f,styleId:y}=ce(u,t,r.styleMirror);return(f&&f!==-1||y&&y!==-1)&&e({id:f,styleId:y,replaceSync:p}),d.apply(u,h)})}));const a={};$e("CSSGroupingRule")?a.CSSGroupingRule=n.CSSGroupingRule:($e("CSSMediaRule")&&(a.CSSMediaRule=n.CSSMediaRule),$e("CSSConditionRule")&&(a.CSSConditionRule=n.CSSConditionRule),$e("CSSSupportsRule")&&(a.CSSSupportsRule=n.CSSSupportsRule));const l={};return Object.entries(a).forEach(([d,u])=>{l[d]={insertRule:u.prototype.insertRule,deleteRule:u.prototype.deleteRule},u.prototype.insertRule=new Proxy(l[d].insertRule,{apply:O((h,p,f)=>{const[y,b]=f,{id:S,styleId:I}=ce(p.parentStyleSheet,t,r.styleMirror);return(S&&S!==-1||I&&I!==-1)&&e({id:S,styleId:I,adds:[{rule:y,index:[...Xe(p),b||0]}]}),h.apply(p,f)})}),u.prototype.deleteRule=new Proxy(l[d].deleteRule,{apply:O((h,p,f)=>{const[y]=f,{id:b,styleId:S}=ce(p.parentStyleSheet,t,r.styleMirror);return(b&&b!==-1||S&&S!==-1)&&e({id:b,styleId:S,removes:[{index:[...Xe(p),y]}]}),h.apply(p,f)})})}),O(()=>{n.CSSStyleSheet.prototype.insertRule=s,n.CSSStyleSheet.prototype.deleteRule=i,o&&(n.CSSStyleSheet.prototype.replace=o),c&&(n.CSSStyleSheet.prototype.replaceSync=c),Object.entries(a).forEac
3h(([d,u])=>{u.prototype.insertRule=l[d].insertRule,u.prototype.deleteRule=l[d].deleteRule})})}function tn({mirror:e,stylesheetManager:t},r){let n=null;r.nodeName==="#document"?n=e.getId(r):n=e.getId(r.host);const s=r.nodeName==="#document"?r.defaultView?.Document:r.ownerDocument?.defaultView?.ShadowRoot,i=s?.prototype?Object.getOwnPropertyDescriptor(s?.prototype,"adoptedStyleSheets"):void 0;return n===null||n===-1||!s||!i?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){return i.get?.call(this)},set(o){const c=i.set?.call(this,o);if(n!==null&&n!==-1)try{t.adoptStyleSheets(o,n)}catch{}return c}}),O(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))}function Si({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:s}){const i=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:O((c,a,l)=>{const[d,u,h]=l;if(r.has(d))return i.apply(a,[d,u,h]);const{id:p,styleId:f}=ce(a.parentRule?.parentStyleSheet,t,n.styleMirror);return(p&&p!==-1||f&&f!==-1)&&e({id:p,styleId:f,set:{property:d,value:u,priority:h},index:Xe(a.parentRule)}),c.apply(a,l)})});const o=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:O((c,a,l)=>{const[d]=l;if(r.has(d))return o.apply(a,[d]);const{id:u,styleId:h}=ce(a.parentRule?.parentStyleSheet,t,n.styleMirror);return(u&&u!==-1||h&&h!==-1)&&e({id:u,styleId:h,remove:{property:d},index:Xe(a.parentRule)}),c.apply(a,l)})}),O(()=>{s.CSSStyleDeclaration.prototype.setProperty=i,s.CSSStyleDeclaration.prototype.removeProperty=o})}function _i({mediaInteractionCb:e,blockClass:t,blockSelector:r,unblockSelector:n,mirror:s,sampling:i,doc:o}){const c=O(l=>De(O(d=>{const u=Be(d);if(!u||X(u,t,r,n,!0))return;const{currentTime:h,volume:p,muted:f,playbackRate:y}=u;e({type:l,id:s.getId(u),currentTime:h,volume:p,muted:f,playbackRate:y})}),i.media||500)),a=[G("play",c(ge.Play),o),G("pause",c(ge.Pause),o),G("seeked",c(ge.Seeked),o),G("volumechange",c(ge.VolumeChange),o),G("ratechange",c(ge.RateChange),o)];return O(()=>{a.forEach(l=>l())})}function vi({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],s=new WeakMap,i=r.FontFace;r.FontFace=function(a,l,d){const u=new i(a,l,d);return s.set(u,{family:a,buffer:typeof l!="string",descriptors:d,fontSource:typeof l=="string"?l:JSON.stringify(Array.from(new Uint8Array(l)))}),u};const o=Ut(t.fonts,"add",function(c){return function(a){return st(O(()=>{const l=s.get(a);l&&(e(l),s.delete(a))}),0),c.apply(this,[a])}});return n.push(()=>{r.FontFace=i}),n.push(o),O(()=>{n.forEach(c=>c())})}function bi(e){const{doc:t,mirror:r,blockClass:n,blockSelector:s,unblockSelector:i,selectionCb:o}=e;let c=!0;const a=O(()=>{const l=t.getSelection();if(!l||c&&l?.isCollapsed)return;c=l.isCollapsed||!1;const d=[],u=l.rangeCount||0;for(let h=0;h<u;h++){const p=l.getRangeAt(h),{startContainer:f,startOffset:y,endContainer:b,endOffset:S}=p;X(f,n,s,i,!0)||X(b,n,s,i,!0)||d.push({start:r.getId(f),startOffset:y,end:r.getId(b),endOffset:S})}o({ranges:d})});return a(),G("selectionchange",a)}function wi({doc:e,customElementCb:t}){const r=e.defaultView;return!r||!r.customElements?()=>{}:Ut(r.customElements,"define",function(s){return function(i,o,c){try{t({define:{name:i}})}catch{}return s.apply(this,[i,o,c])}})}function Ei(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};let n;e.recordDOM&&(n=Zr(e,e.doc));const s=hi(e),i=fi(e),o=en(e),c=pi(e,{win:r}),a=gi(e),l=_i(e);let d=()=>{},u=()=>{},h=()=>{},p=()=>{};e.recordDOM&&(d=yi(e,{win:r}),u=tn(e,e.doc),h=Si(e,{win:r}),e.collectFonts&&(p=vi(e)));const f=bi(e),y=wi(e),b=[];for(const S of e.plugins)b.push(S.observer(S.callback,r,S.options));return O(()=>{ve.forEach(S=>S.reset()),n?.disconnect(),s(),i(),o(),c(),a(),l(),d(),u(),h(),p(),f(),y(),b.forEach(S=>S())})}function He(e){return typeof window[e]<"u"}function $e(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Mt{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,r,n,s){const i=n||this.getIdToRemoteIdMap(t),o=s||this.getRemoteIdToIdMap(t);let c=i.get(r);return c||(c=this.generateIdFn(),i.set(r,c),o.set(c,r)),c}getIds(t,r){const n=this.getIdToRemoteIdMap(t),s=this.getRemoteIdToIdMap(t);return r.map(i=>this.getId(t,i,n,s))}getRemoteId(t,r,n){const s=n||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;const i=s.get(r);return i||-1}getRemoteIds(t,r){const n=this.getRemoteIdToIdMap(t);return r.map(s=>this.getRemoteId(t,s,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}}
3class ki{constructor(){this.crossOriginIframeMirror=new Mt(Ft),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class Ii{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Mt(Ft),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Mt(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);const r=Ne(t);r&&this.crossOriginIframeMap.set(r,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,r){this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&Ne(t)?.addEventListener("message",this.handleMessage.bind(this)),this.loadListener?.(t);const n=zt(t);n&&n.adoptedStyleSheets&&n.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(n.adoptedStyleSheets,this.mirror.getId(n))}handleMessage(t){const r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin||!t.source)return;const s=this.crossOriginIframeMap.get(t.source);if(!s)return;const i=this.transformCrossOriginEvent(s,r.data.event);i&&this.wrappedEmit(i,r.data.isCheckout)}transformCrossOriginEvent(t,r){switch(r.type){case k.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);const n=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,n),this.patchRootIdOnNode(r.data.node,n),{timestamp:r.timestamp,type:k.IncrementalSnapshot,data:{source:w.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case k.Meta:case k.Load:case k.DomContentLoaded:return!1;case k.Plugin:return r;case k.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case k.IncrementalSnapshot:switch(r.data.source){case w.Mutation:return r.data.adds.forEach(n=>{this.replaceIds(n,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(n.node,t);const s=this.crossOriginIframeRootIdMap.get(t);s&&this.patchRootIdOnNode(n.node,s)}),r.data.removes.forEach(n=>{this.replaceIds(n,t,["parentId","id"])}),r.data.attributes.forEach(n=>{this.replaceIds(n,t,["id"])}),r.data.texts.forEach(n=>{this.replaceIds(n,t,["id"])}),r;case w.Drag:case w.TouchMove:case w.MouseMove:return r.data.positions.forEach(n=>{this.replaceIds(n,t,["id"])}),r;case w.ViewportResize:return!1;case w.MediaInteraction:case w.MouseInteraction:case w.Scroll:case w.CanvasMutation:case w.Input:return this.replaceIds(r.data,t,["id"]),r;case w.StyleSheetRule:case w.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case w.Font:return r;case w.Selection:return r.data.ranges.forEach(n=>{this.replaceIds(n,t,["start","end"])}),r;case w.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),r.data.styles?.forEach(n=>{this.replaceStyleIds(n,t,["styleId"])}),r}}return!1}replace(t,r,n,s){for(const i of s)!Array.isArray(r[i])&&typeof r[i]!="number"||(Array.isArray(r[i])?r[i]=t.getIds(n,r[i]):r[i]=t.getId(n,r[i]));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","rootId"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r)})}patchRootIdOnNode(t,r){t.type!==$.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r)})}}class Ci{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class Mi{constructor(t){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,r){if(!Te(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t),this.bypassOptions.canvasManager.addShadowRoot(t);const n=Zr({...this.bypassOptions,doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(en({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),st(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(tn({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){const r=zt(t),n=Ne(t);!r||!n||this.patchAttachShadow(n.Element,r)}patchAttachShadow(t,r){const n=this;this.restoreHandlers.push(Ut(t.prototype,"attachShadow",function(s){return function(i){const o=s.call(this,i);return this.shadowRoot&&Jr(this)&&n.addShadowRoot(this.shadowRoot,r),o}}))}
3reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}}class Ri{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new ei,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;const n={id:r,styleIds:[]},s=[];for(const i of t){let o;this.styleMirror.has(i)?o=this.styleMirror.getId(i):(o=this.styleMirror.add(i),s.push({styleId:o,rules:Array.from(i.rules||CSSRule,(c,a)=>({rule:Nr(c),index:a}))})),n.styleIds.push(o)}s.length>0&&(n.styles=s),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Ti{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(t,r){const n=this.nodeMap.get(t);return n&&Array.from(n).some(s=>s!==r)}add(t,r){this.active||(this.active=!0,ni(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}destroy(){}}let W,Je;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const te=Cs();function re(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:i=null,unblockSelector:o=null,ignoreClass:c="rr-ignore",ignoreSelector:a=null,maskAllText:l=!1,maskTextClass:d="rr-mask",unmaskTextClass:u=null,maskTextSelector:h=null,unmaskTextSelector:p=null,inlineStylesheet:f=!0,maskAllInputs:y,maskInputOptions:b,slimDOMOptions:S,maskAttributeFn:I,maskInputFn:N,maskTextFn:A,maxCanvasSize:F=null,packFn:M,sampling:m={},dataURLOptions:R={},mousemoveWait:q,recordDOM:g=!0,recordCanvas:E=!1,recordCrossOriginIframes:L=!1,recordAfter:z=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:H=!1,collectFonts:Q=!1,inlineImages:V=!1,plugins:K,keepIframeSrcFn:C=()=>!1,ignoreCSSAttributes:J=new Set([]),errorHandler:U,onMutation:ne,getCanvasManager:se}=e;ii(U);const Z=L?window.parent===window:!0;let ke=!1;if(!Z)try{window.parent.document&&(ke=!1)}catch{ke=!0}if(Z&&!t)throw new Error("emit function is required");if(!Z&&!ke)return()=>{};q!==void 0&&m.mousemove===void 0&&(m.mousemove=q),te.reset();const lt=y===!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,radio:!0,checkbox:!0}:b!==void 0?b:{},ut=S===!0||S==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:S==="all",headMetaDescKeywords:S==="all"}:S||{};Zs();let dt,ht=0;const Gt=D=>{for(const ee of K||[])ee.eventProcessor&&(D=ee.eventProcessor(D));return M&&!ke&&(D=M(D)),D};W=(D,ee)=>{const T=D;if(T.timestamp=Ge(),ve[0]?.isFrozen()&&T.type!==k.FullSnapshot&&!(T.type===k.IncrementalSnapshot&&T.data.source===w.Mutation)&&ve.forEach(j=>j.unfreeze()),Z)t?.(Gt(T),ee);else if(ke){const j={type:"rrweb",event:Gt(T),origin:window.location.origin,isCheckout:ee};window.parent.postMessage(j,"*")}if(T.type===k.FullSnapshot)dt=T,ht=0;else if(T.type===k.IncrementalSnapshot){if(T.data.source===w.Mutation&&T.data.isAttachIframe)return;ht++;const j=n&&ht>=n,x=r&&dt&&T.timestamp-dt.timestamp>r;(j||x)&&mt(!0)}};const Ie=D=>{W({type:k.IncrementalSnapshot,data:{source:w.Mutation,...D}})},Xt=D=>W({type:k.IncrementalSnapshot,data:{source:w.Scroll,...D}}),vn=D=>W({type:k.IncrementalSnapshot,data:{source:w.CanvasMutation,...D}}),bn=D=>W({type:k.IncrementalSnapshot,data:{source:w.AdoptedStyleSheet,...D}}),de=new Ri({mutationCb:Ie,adoptedStyleSheetCb:bn}),he=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new ki:new Ii({mirror:te,mutationCb:Ie,stylesheetManager:de,recordCrossOriginIframes:L,wrappedEmit:W});for(const D of K||[])D.getMirror&&D.getMirror({nodeMirror:te,crossOriginIframeMirror:he.crossOriginIframeMirror,crossOriginIframeStyleMirror:he.crossOriginIframeStyleMirror});
3const ft=new Ti,pt=Oi(se,{mirror:te,win:window,mutationCb:D=>W({type:k.IncrementalSnapshot,data:{source:w.CanvasMutation,...D}}),recordCanvas:E,blockClass:s,blockSelector:i,unblockSelector:o,maxCanvasSize:F,sampling:m.canvas,dataURLOptions:R,errorHandler:U}),Ue=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new Ci:new Mi({mutationCb:Ie,scrollCb:Xt,bypassOptions:{onMutation:ne,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:l,maskTextClass:d,unmaskTextClass:u,maskTextSelector:h,unmaskTextSelector:p,inlineStylesheet:f,maskInputOptions:lt,dataURLOptions:R,maskAttributeFn:I,maskTextFn:A,maskInputFn:N,recordCanvas:E,inlineImages:V,sampling:m,slimDOMOptions:ut,iframeManager:he,stylesheetManager:de,canvasManager:pt,keepIframeSrcFn:C,processedNodeManager:ft,ignoreCSSAttributes:J},mirror:te}),mt=(D=!1)=>{if(!g)return;W({type:k.Meta,data:{href:window.location.href,width:jr(),height:qr()}},D),de.reset(),Ue.init(),ve.forEach(T=>T.lock());const ee=Js(document,{mirror:te,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:l,maskTextClass:d,unmaskTextClass:u,maskTextSelector:h,unmaskTextSelector:p,inlineStylesheet:f,maskAllInputs:lt,maskAttributeFn:I,maskInputFn:N,maskTextFn:A,slimDOM:ut,dataURLOptions:R,recordCanvas:E,inlineImages:V,onSerialize:T=>{Yr(T,te)&&he.addIframe(T),Gr(T,te)&&de.trackLinkElement(T),It(T)&&Ue.addShadowRoot(T.shadowRoot,document)},onIframeLoad:(T,j)=>{he.attachIframe(T,j);const x=Ne(T);x&&pt.addWindow(x),Ue.observeAttachShadow(T)},onStylesheetLoad:(T,j)=>{de.attachLinkElement(T,j)},onBlockedImageLoad:(T,j,{width:x,height:Ce})=>{Ie({adds:[],removes:[],texts:[],attributes:[{id:j.id,attributes:{style:{width:`${x}px`,height:`${Ce}px`}}}]})},keepIframeSrcFn:C,ignoreCSSAttributes:J});if(!ee)return console.warn("Failed to snapshot the document");W({type:k.FullSnapshot,data:{node:ee,initialOffset:$r(window)}}),ve.forEach(T=>T.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&de.adoptStyleSheets(document.adoptedStyleSheets,te.getId(document))};Je=mt;try{const D=[],ee=j=>O(Ei)({onMutation:ne,mutationCb:Ie,mousemoveCb:(x,Ce)=>W({type:k.IncrementalSnapshot,data:{source:Ce,positions:x}}),mouseInteractionCb:x=>W({type:k.IncrementalSnapshot,data:{source:w.MouseInteraction,...x}}),scrollCb:Xt,viewportResizeCb:x=>W({type:k.IncrementalSnapshot,data:{source:w.ViewportResize,...x}}),inputCb:x=>W({type:k.IncrementalSnapshot,data:{source:w.Input,...x}}),mediaInteractionCb:x=>W({type:k.IncrementalSnapshot,data:{source:w.MediaInteraction,...x}}),styleSheetRuleCb:x=>W({type:k.IncrementalSnapshot,data:{source:w.StyleSheetRule,...x}}),styleDeclarationCb:x=>W({type:k.IncrementalSnapshot,data:{source:w.StyleDeclaration,...x}}),canvasMutationCb:vn,fontCb:x=>W({type:k.IncrementalSnapshot,data:{source:w.Font,...x}}),selectionCb:x=>{W({type:k.IncrementalSnapshot,data:{source:w.Selection,...x}})},customElementCb:x=>{W({type:k.IncrementalSnapshot,data:{source:w.CustomElement,...x}})},blockClass:s,ignoreClass:c,ignoreSelector:a,maskAllText:l,maskTextClass:d,unmaskTextClass:u,maskTextSelector:h,unmaskTextSelector:p,maskInputOptions:lt,inlineStylesheet:f,sampling:m,recordDOM:g,recordCanvas:E,inlineImages:V,userTriggeredOnInput:H,collectFonts:Q,doc:j,maskAttributeFn:I,maskInputFn:N,maskTextFn:A,keepIframeSrcFn:C,blockSelector:i,unblockSelector:o,slimDOMOptions:ut,dataURLOptions:R,mirror:te,iframeManager:he,stylesheetManager:de,shadowDomManager:Ue,processedNodeManager:ft,canvasManager:pt,ignoreCSSAttributes:J,plugins:K?.filter(x=>x.observer)?.map(x=>({observer:x.observer,options:x.options,callback:Ce=>W({type:k.Plugin,data:{plugin:x.name,payload:Ce}})}))||[]},{});he.addLoadListener(j=>{try{D.push(ee(j.contentDocument))}catch(x){console.warn(x)}});const T=()=>{mt(),D.push(ee(document))};return document.readyState==="interactive"||document.readyState==="complete"?T():(D.push(G("DOMContentLoaded",()=>{W({type:k.DomContentLoaded,data:{}}),z==="DOMContentLoaded"&&T()})),D.push(G("load",()=>{W({type:k.Load,data:{}}),z==="load"&&T()},window))),()=>{D.forEach(j=>j()),ft.destroy(),Je=void 0,oi()}}catch(D){console.warn(D)}}function xi(e){if(!Je)throw new Error("please take full snapshot after start recording");Je(e)}re.mirror=te;re.takeFullSnapshot=xi;function Oi(e,t){try{return e?e(t):new dr}catch{return console.warn("Unable to initialize CanvasManager"),new dr}}var yr;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(yr||(yr={}));const Ai=3,Di=5;function Ht(e){return e>9999999999?e:e*1e3}function St(e){return e>9999999999?e/1e3:e}function Fe(e,t){t.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>
3(e.throttledAddEvent({type:k.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:xr(t,10,1e3)}}),t.category==="console")))}const Ni="button,a";function rn(e){return e.closest(Ni)||e}function nn(e){const t=sn(e);return!t||!(t instanceof Element)?t:rn(t)}function sn(e){return Li(e)?e.target:e}function Li(e){return typeof e=="object"&&!!e&&"target"in e}let le;function Pi(e){return le||(le=[],Bi()),le.push(e),()=>{const t=le?le.indexOf(e):-1;t>-1&&le.splice(t,1)}}function Bi(){Fn(B,"open",function(e){return function(...t){if(le)try{le.forEach(r=>r())}catch{}return e.apply(B,t)}})}const Fi=new Set([w.Mutation,w.StyleSheetRule,w.StyleDeclaration,w.AdoptedStyleSheet,w.CanvasMutation,w.Selection,w.MediaInteraction]);function Ui(e,t,r){e.handleClick(t,r)}class Wi{constructor(t,r,n=Fe){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=r.timeout/1e3,this._threshold=r.threshold/1e3,this._scrollTimeout=r.scrollTimeout/1e3,this._replay=t,this._ignoreSelector=r.ignoreSelector,this._addBreadcrumbEvent=n}addListeners(){const t=Pi(()=>{this._lastMutation=Sr()});this._teardown=()=>{t(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(t,r){if(Hi(r,this._ignoreSelector)||!$i(t))return;const n={timestamp:St(t.timestamp),clickBreadcrumb:t,clickCount:0,node:r};this._clicks.some(s=>s.node===n.node&&Math.abs(s.timestamp-n.timestamp)<1)||(this._clicks.push(n),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(t=Date.now()){this._lastMutation=St(t)}registerScroll(t=Date.now()){this._lastScroll=St(t)}registerClick(t){const r=rn(t);this._handleMultiClick(r)}_handleMultiClick(t){this._getClicks(t).forEach(r=>{r.clickCount++})}_getClicks(t){return this._clicks.filter(r=>r.node===t)}_checkClicks(){const t=[],r=Sr();this._clicks.forEach(n=>{!n.mutationAfter&&this._lastMutation&&(n.mutationAfter=n.timestamp<=this._lastMutation?this._lastMutation-n.timestamp:void 0),!n.scrollAfter&&this._lastScroll&&(n.scrollAfter=n.timestamp<=this._lastScroll?this._lastScroll-n.timestamp:void 0),n.timestamp+this._timeout<=r&&t.push(n)});for(const n of t){const s=this._clicks.indexOf(n);s>-1&&(this._generateBreadcrumbs(n),this._clicks.splice(s,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(t){const r=this._replay,n=t.scrollAfter&&t.scrollAfter<=this._scrollTimeout,s=t.mutationAfter&&t.mutationAfter<=this._threshold,i=!n&&!s,{clickCount:o,clickBreadcrumb:c}=t;if(i){const a=Math.min(t.mutationAfter||this._timeout,this._timeout)*1e3,l=a<this._timeout*1e3?"mutation":"timeout",d={type:"default",message:c.message,timestamp:c.timestamp,category:"ui.slowClickDetected",data:{...c.data,url:B.location.href,route:r.getCurrentRoute(),timeAfterClickMs:a,endReason:l,clickCount:o||1}};this._addBreadcrumbEvent(r,d);return}if(o>1){const a={type:"default",message:c.message,timestamp:c.timestamp,category:"ui.multiClick",data:{...c.data,url:B.location.href,route:r.getCurrentRoute(),clickCount:o,metric:!0}};this._addBreadcrumbEvent(r,a)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=Pe(()=>this._checkClicks(),1e3)}}const zi=["A","BUTTON","INPUT"];function Hi(e,t){return!!(!zi.includes(e.tagName)||e.tagName==="INPUT"&&!["submit","button"].includes(e.getAttribute("type")||"")||e.tagName==="A"&&(e.hasAttribute("download")||e.hasAttribute("target")&&e.getAttribute("target")!=="_self")||t&&e.matches(t))}function $i(e){return!!(e.data&&typeof e.data.nodeId=="number"&&e.timestamp)}function Sr(){return Date.now()/1e3}function qi(e,t){try{if(!ji(t))return;const{source:r}=t.data;if(Fi.has(r)&&e.registerMutation(t.timestamp),r===w.Scroll&&e.registerScroll(t.timestamp),Vi(t)){const{type:n,id:s}=t.data,i=re.mirror.getNode(s);i instanceof HTMLElement&&n===Y.Click&&e.registerClick(i)}}catch{}}function ji(e){return e.type===Ai}function Vi(e){return e.data.source===w.MouseInteraction}function ie(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var it=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(it||{});const Ki=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function Yi(e){const t={};!e["data-sentry-component"]&&e["data-sentry-element"]&&(e["data-sentry-component"]=e["data-sentry-element"]);for(const r in e)if(Ki.has(r)){let n=r;
3(r==="data-testid"||r==="data-test-id")&&(n="testId"),t[n]=e[r]}return t}const Gi=e=>t=>{if(!e.isEnabled())return;const r=Xi(t);if(!r)return;const n=t.name==="click",s=n?t.event:void 0;n&&e.clickDetector&&s?.target&&!s.altKey&&!s.metaKey&&!s.ctrlKey&&!s.shiftKey&&Ui(e.clickDetector,r,nn(t.event)),Fe(e,r)};function on(e,t){const r=re.mirror.getId(e),n=r&&re.mirror.getNode(r),s=n&&re.mirror.getMeta(n),i=s&&Qi(s)?s:null;return{message:t,data:i?{nodeId:r,node:{id:r,tagName:i.tagName,textContent:Array.from(i.childNodes).map(o=>o.type===it.Text&&o.textContent).filter(Boolean).map(o=>o.trim()).join(""),attributes:Yi(i.attributes)}}:{}}}function Xi(e){const{target:t,message:r}=Ji(e);return ie({category:`ui.${e.name}`,...on(t,r)})}function Ji(e){const t=e.name==="click";let r,n=null;try{n=t?nn(e.event):sn(e.event),r=Or(n,{maxStringLength:200})||"<unknown>"}catch{r="<unknown>"}return{target:n,message:r}}function Qi(e){return e.type===it.Element}function Zi(e,t){if(!e.isEnabled())return;e.updateUserActivity();const r=eo(t);r&&Fe(e,r)}function eo(e){const{metaKey:t,shiftKey:r,ctrlKey:n,altKey:s,key:i,target:o}=e;if(!o||to(o)||!i)return null;const c=t||n||s,a=i.length===1;if(!c&&a)return null;const l=Or(o,{maxStringLength:200})||"<unknown>",d=on(o,l);return ie({category:"ui.keyDown",message:l,data:{...d.data,metaKey:t,shiftKey:r,ctrlKey:n,altKey:s,key:i}})}function to(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable}const ro={resource:ao,paint:io,navigation:oo};function _t(e,t){return({metric:r})=>void t.replayPerformanceEntries.push(e(r))}function no(e){return e.map(so).filter(Boolean)}function so(e){const t=ro[e.entryType];return t?t(e):null}function Ee(e){return((Vn()||B.performance.timeOrigin)+e)/1e3}function io(e){const{duration:t,entryType:r,name:n,startTime:s}=e,i=Ee(s);return{type:r,name:n,start:i,end:i+t,data:void 0}}function oo(e){const{entryType:t,name:r,decodedBodySize:n,duration:s,domComplete:i,encodedBodySize:o,domContentLoadedEventStart:c,domContentLoadedEventEnd:a,domInteractive:l,loadEventStart:d,loadEventEnd:u,redirectCount:h,startTime:p,transferSize:f,type:y}=e;return s===0?null:{type:`${t}.${y}`,start:Ee(p),end:Ee(i),name:r,data:{size:f,decodedBodySize:n,encodedBodySize:o,duration:s,domInteractive:l,domContentLoadedEventStart:c,domContentLoadedEventEnd:a,loadEventStart:d,loadEventEnd:u,domComplete:i,redirectCount:h}}}function ao(e){const{entryType:t,initiatorType:r,name:n,responseEnd:s,startTime:i,decodedBodySize:o,encodedBodySize:c,responseStatus:a,transferSize:l}=e;return["fetch","xmlhttprequest"].includes(r)?null:{type:`${t}.${r}`,start:Ee(i),end:Ee(s),name:n,data:{size:l,statusCode:a,decodedBodySize:o,encodedBodySize:c}}}function co(e){const t=e.entries[e.entries.length-1],r=t?.element?[t.element]:void 0;return $t(e,"largest-contentful-paint",r)}function lo(e){return e.sources!==void 0}function uo(e){const t=[],r=[];for(const n of e.entries)if(lo(n)){const s=[];for(const i of n.sources)if(i.node){r.push(i.node);const o=re.mirror.getId(i.node);o&&s.push(o)}t.push({value:n.value,nodeIds:s.length?s:void 0})}return $t(e,"cumulative-layout-shift",r,t)}function ho(e){const t=e.entries[e.entries.length-1],r=t?.target?[t.target]:void 0;return $t(e,"interaction-to-next-paint",r)}function $t(e,t,r,n){const s=e.value,i=e.rating,o=Ee(s);return{type:"web-vital",name:t,start:o,end:o,data:{value:s,size:s,rating:i,nodeIds:r?r.map(c=>re.mirror.getId(c)):void 0,attributions:n}}}function fo(e){function t(s){e.performanceEntries.includes(s)||e.performanceEntries.push(s)}function r({entries:s}){s.forEach(t)}const n=[];return["navigation","paint","resource"].forEach(s=>{n.push(On(s,r))}),n.push(An(_t(co,e)),Dn(_t(uo,e)),Nn(_t(ho,e))),()=>{n.forEach(s=>s())}}const _=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,po='
vendor: 10,329 bytes, line 3
3var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([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]),i=new t([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]),s=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=function(t,e){for(var i=new n(31),s=0;s<31;++s)i[s]=e+=1<<t[s-1];var a=new r(i[30]);for(s=1;s<30;++s)for(var o=i[s];o<i[s+1];++o)a[o]=o-i[s]<<5|s;return{b:i,r:a}},o=a(e,2),h=o.b,f=o.r;h[28]=258,f[258]=28;for(var l=a(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,s=0,a=new n(r);s<i;++s)t[s]&&++a[t[s]-1];var o,h=new n(r);for(s=1;s<r;++s)h[s]=h[s-1]+a[s-1]<<1;if(e){o=new n(1<<r);var f=15-r;for(s=0;s<i;++s)if(t[s])for(var l=s<<4|t[s],c=r-t[s],v=h[t[s]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>f]=l}else for(o=new n(i),s=0;s<i;++s)t[s]&&(o[s]=u[h[t[s]-1]++]>>15-t[s]);return o},p=new t(288);for(c=0;c<144;++c)p[c]=8;for(c=144;c<256;++c)p[c]=9;for(c=256;c<280;++c)p[c]=7;for(c=280;c<288;++c)p[c]=8;var g=new t(32);for(c=0;c<32;++c)g[c]=5;var w=d(p,9,0),y=d(g,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},_=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},x=function(r,e){for(var i=[],s=0;s<r.length;++s)r[s]&&i.push({s:s,f:r[s]});var a=i.length,o=i.slice();if(!a)return{t:F,l:0};if(1==a){var h=new t(i[0].s+1);return h[i[0].s]=1,{t:h,l:1}}i.sort(function(t,n){return t.f-n.f}),i.push({s:-1,f:25001});var f=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:f.f+l.f,l:f,r:l};c!=a-1;)f=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:f.f+l.f,l:f,r:l};var d=o[0].s;for(s=1;s<a;++s)o[s].s>d&&(d=o[s].s);var p=new n(d+1),g=A(i[c-1],p,0);if(g>e){s=0;var w=0,y=g-e,m=1<<y;for(o.sort(function(t,n){return p[n.s]-p[t.s]||t.f-n.f});s<a;++s){var b=o[s].s;if(!(p[b]>e))break;w+=m-(1<<g-p[b]),p[b]=e}for(w>>=y;w>0;){var M=o[s].s;p[M]<e?w-=1<<e-p[M]++-1:++s}for(;s>=0&&w;--s){var E=o[s].s;p[E]==e&&(--p[E],++w)}g=e}return{t:new t(p),l:g}},A=function(t,n,r){return-1==t.s?Math.max(A(t.l,n,r+1),A(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,s=t[0],a=1,o=function(t){e[i++]=t},h=1;h<=r;++h)if(t[h]==s&&h!=r)++a;else{if(!s&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(s),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(s);a=1,s=t[h]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var s=0;s<e;++s)t[i+s+4]=r[s];return 8*(i+4+e)},U=function(t,r,a,o,h,f,l,u,c,v,m){z(r,m++,a),++h[256];for(var b=x(h,15),M=b.t,E=b.l,A=x(f,15),U=A.t,C=A.l,F=D(M),I=F.c,S=F.n,L=D(U),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=x(q,7),H=G.t,J=G.l,K=19;K>4&&!H[s[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(h,p)+T(f,g)+l,X=T(h,M)+T(f,U)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(U,C,0),R=U;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[s[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=w,P=p,Q=y,R=g;for(B=0;B<u;++B){var rt=o[B];if(rt>255){_(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;_(r,m,Q[et]),m+=R[et],et>3&&(_(r,m,rt>>5&8191),m+=i[et])}else _(r,m,N[rt]),m+=P[rt]}return _(r,m,N[256]),m+P[256]},C=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,s=0|r.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)i+=e+=r[a];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(s,a,o,h,u){if(!u&&(u={l:1},a.dictionary)){var c=a.dictionary.subarray(-32768),v=new t(c.length+s.length);v.set(c),v.set(s,c.length),s=v,u.w=c.length}return function(s,a,o,h,u,c){var v=c.z||s.length,d=new t(h+v+5*(1+Math.ceil(v/7e3))+u),p=d.subarray(h,d.length-u),g=c.l,w=7&(c.r||0);if(a){w&&(p[0]=c.r>>3);for(var y=C[a-1],M=y>>13,E=8191&y,z=(1<<o)-1,_=c.p||new n(32768),x=c.h||new n(z+1),A=Math.ceil(o/3),D=2*A,T=function(t){return(s[t]^s[t+1]<<A^s[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=x[H];if(_[J]=K,x[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!g)){w=U(s,p,0,F,I,S,O,q,G,j-G,w),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(s[j+Q]==s[j+Q-W]){for(var $=0;$<Z&&s[j+$]==s[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-_[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=_[J])&32767}if(R){F[q++]=268435456|f[Q]<<18|l[R];var it=31&f[Q],st=31&l[R];O+=e[it]+i[st],++I[257+it],++S[st],B=j+Q,++L}else F[q++]=s[j],++I[s[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=s[j],++I[s[j]];w=U(s,p,g,F,I,S,O,q,G,j-G,w),g||(c.r=7&w|p[w/8|0]<<3,w-=7,c.h=x,c.p=_,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+g;j+=65535){var at=j+65535;at>=v&&(p[w/8|0]=g,at=v),w=k(p,w+1,s.subarray(j,at))}c.i=v}return b(d,0,h+m(w)+u)}(s,null==a.level?6:a.level,null==a.mem?u.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):20:12+a.mem,o,h,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},j=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var s=this.b.length-this.s.z;this.b.set(n.subarray(0,s),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(s),32768),this.s.z=n.length-s+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n.prototype.flush=function(){this.ondata||E(5),this.s.l&&E(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,s=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),a=s.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}}(s,n),O(s,a-8,r.d()),O(s,a-4,e),s}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d())}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n)},t.prototype.flush=function(){j.prototype.flush.call(this)},t}(),G="undefined"!=typeof TextEncoder&&new TextEncoder,H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0})}catch(t){}var J=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1)},t}();function K(n,r){if(G)return G.encode(n);for(var e=n.length,i=new t(n.length+(n.length>>1)),s=0,a=function(t){i[s++]=t},o=0;o<e;++o){if(s+5>i.length){var h=new t(s+8+(e-o<<1));h.set(i),i=h}var f=n.charCodeAt(o);f<128||r?a(f):f<2048?(a(192|f>>6),a(128|63&f)):f>55295&&f<57344?(a(240|(f=65536+(1047552&f)|1023&n.charCodeAt(++o))>>18),a(128|f>>12&63),a(128|f>>6&63),a(128|63&f)):(a(224|f>>12),a(128|f>>6&63),a(128|63&f))}return b(i,0,s)}const N=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(const r of t)n+=r.length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new B,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new J((t,n)=>{this.deflate.push(t,n)}),this.stream.push("[")}},P={clear:()=>{N.clear()},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener("message",function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&"function"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}}),postMessage({id:void 0,method:"init",success:!0,response:void 0});
3';function mo(){const e=new Blob([po]);return URL.createObjectURL(e)}const _r=["log","warn","error"],je="[Replay] ";function vt(e,t="info"){Qn({category:"console",data:{logger:"replay"},level:t,message:`${je}${e}`},{level:t})}function go(){let e=!1,t=!1;const r={exception:()=>{},infoTick:()=>{},setConfig:n=>{e=!!n.captureExceptions,t=!!n.traceInternals}};return _?(_r.forEach(n=>{r[n]=(...s)=>{gt[n](je,...s),t&&vt(s.join(""),Zn(n))}}),r.exception=(n,...s)=>{s.length&&r.error&&r.error(...s),gt.error(je,n),e?Jn(n,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):t&&vt(n,"error")},r.infoTick=(...n)=>{gt.log(je,...n),t&&setTimeout(()=>vt(n[0]),0)}):_r.forEach(n=>{r[n]=()=>{}}),r}const v=go();class qt extends Error{constructor(){super(`Event buffer exceeded maximum size of ${Pt}.`)}}class an{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(t){const r=JSON.stringify(t).length;if(this._totalSize+=r,this._totalSize>Pt)throw new qt;this.events.push(t)}finish(){return new Promise(t=>{const r=this.events;this.clear(),t(JSON.stringify(r))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){let t=null;for(const{timestamp:r}of this.events)(t===null||r<t)&&(t=r);return t===null?t:Ht(t)}}class yo{constructor(t){this._onMessage=({data:r})=>{const n=r;if(typeof n.id!="number")return;const s=this._pending.get(n.id);if(!(!s||s.method!==n.method)){if(this._pending.delete(n.id),!n.success){_&&v.error("Error in compression worker: ",n.response),s.reject(new Error("Error in compression worker"));return}s.resolve(n.response)}},this._worker=t,this._id=0,this._pending=new Map,this._worker.addEventListener("message",this._onMessage)}ensureReady(){return this._ensureReadyPromise?this._ensureReadyPromise:(this._ensureReadyPromise=new Promise((t,r)=>{this._worker.addEventListener("message",({data:n})=>{n.success?t():(_&&v.warn("Received worker message with unsuccessful status",n),r(new Error("Received worker message with unsuccessful status")))},{once:!0}),this._worker.addEventListener("error",n=>{_&&v.warn("Failed to load Replay compression worker",n),r(new Error(`Failed to load Replay compression worker: ${n instanceof ErrorEvent&&n.message?n.message:"Unknown error. This can happen due to CSP policy restrictions, network issues, or the worker script failing to load."}`))},{once:!0})}),this._ensureReadyPromise)}destroy(){_&&v.log("Destroying compression worker"),this._worker.removeEventListener("message",this._onMessage),this._pending.forEach(t=>t.reject(new Error("Worker destroyed"))),this._pending.clear(),this._worker.terminate()}postMessage(t,r){const n=this._getAndIncrementId();return new Promise((s,i)=>{this._pending.set(n,{method:t,resolve:s,reject:i});try{this._worker.postMessage({id:n,method:t,arg:r})}catch(o){this._pending.delete(n),i(o)}})}_getAndIncrementId(){return this._id++}}class So{constructor(t){this._worker=new yo(t),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(t){const r=Ht(t.timestamp);(!this._earliestTimestamp||r<this._earliestTimestamp)&&(this._earliestTimestamp=r);const n=JSON.stringify(t);return this._totalSize+=n.length,this._totalSize>Pt?Promise.reject(new qt):this._sendEventToWorker(n)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,t=>{_&&v.exception(t,'Sending "clear" message to worker failed',t)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(t){return this._worker.postMessage("addEvent",t)}async _finishRequest(){const t=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,t}}class _o{constructor(t){this._fallback=new an,this._compression=new So(t),this._used=this._fallback,this._ensureWorkerIsLoadedProm
3ise=this._ensureWorkerIsLoaded()}get waitForCheckout(){return this._used.waitForCheckout}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(t){this._used.hasCheckout=t}set waitForCheckout(t){this._used.waitForCheckout=t}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(t){return this._used.addEvent(t)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(t){_&&v.exception(t,"Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:t,hasCheckout:r,waitForCheckout:n}=this._fallback,s=[];for(const i of t)s.push(this._compression.addEvent(i));this._compression.hasCheckout=r,this._compression.waitForCheckout=n,this._used=this._compression;try{await Promise.all(s),this._fallback.clear()}catch(i){_&&v.exception(i,"Failed to add events when switching buffers.")}}}function vo({useCompression:e,workerUrl:t}){if(e&&window.Worker){const r=bo(t);if(r)return r}return _&&v.log("Using simple buffer"),new an}function bo(e){try{const t=e||wo();if(!t)return;_&&v.log(`Using compression worker${e?` from ${e}`:""}`);const r=new Worker(t);return new _o(r)}catch(t){_&&v.exception(t,"Failed to create compression worker")}}function wo(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?mo():""}function jt(){try{return"sessionStorage"in B&&!!B.sessionStorage}catch{return!1}}function Eo(e){ko(),e.session=void 0}function ko(){if(jt())try{B.sessionStorage.removeItem(Nt)}catch{}}function cn(e){return e===void 0?!1:Math.random()<e}function ot(e){if(jt())try{B.sessionStorage.setItem(Nt,JSON.stringify(e))}catch{}}function ln(e){const t=Date.now(),r=e.id||Un(),n=e.started||t,s=e.lastActivity||t,i=e.segmentId||0,o=e.sampled,c=e.previousSessionId,a=e.dirty||!1;return{id:r,started:n,lastActivity:s,segmentId:i,sampled:o,previousSessionId:c,dirty:a}}function Io(e,t){return cn(e)?"session":t?"buffer":!1}function vr({sessionSampleRate:e,allowBuffering:t,stickySession:r=!1},{previousSessionId:n}={}){const s=Io(e,t),i=ln({sampled:s,previousSessionId:n});return r&&ot(i),i}function Co(){if(!jt())return null;try{const e=B.sessionStorage.getItem(Nt);if(!e)return null;const t=JSON.parse(e);return _&&v.infoTick("Loading existing session"),ln(t)}catch{return null}}function Rt(e,t,r=+new Date){return e===null||t===void 0||t<0?!0:t===0?!1:e+t<=r}function Mo(e,{maxReplayDuration:t,sessionIdleExpire:r,targetTime:n=Date.now()}){return Rt(e.started,t,n)||Rt(e.lastActivity,r,n)}function Qe(e,{sessionIdleExpire:t,maxReplayDuration:r}){return!(!Mo(e,{sessionIdleExpire:t,maxReplayDuration:r})||e.sampled==="buffer"&&e.segmentId===0)}function bt({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:r},n){const s=n.stickySession&&Co();return s?Qe(s,{sessionIdleExpire:e,maxReplayDuration:t})?(_&&v.infoTick("Session in sessionStorage is expired, creating new one..."),vr(n,{previousSessionId:s.id})):s:(_&&v.infoTick("Creating new session"),vr(n,{previousSessionId:r}))}function Ro(e){return e.type===k.Custom}function Vt(e,t,r){return dn(e,t)?(un(e,t,r),!0):!1}function To(e,t,r){return dn(e,t)?un(e,t,r):Promise.resolve(null)}async function un(e,t,r){const{eventBuffer:n}=e;if(!n||n.waitForCheckout&&!r)return null;const s=e.recordingMode==="buffer";try{r&&s&&n.clear(),r&&(n.hasCheckout=!0,n.waitForCheckout=!1);const i=e.getOptions(),o=xo(t,i.beforeAddRecordingEvent);return o?await n.addEvent(o):void 0}catch(i){const o=i&&i instanceof qt,c=o?"eventBufferOverflow":"eventBufferError",a=ae();if(a){const l=o?"buffer_overflow":"internal_sdk_error";a.recordDroppedEvent(l,"replay")}if(o&&s)return n.clear(),n.waitForCheckout=!0,null;e.handleException(i),await e.stop({reason:c})}}
3function dn(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;const r=Ht(t.timestamp);return r+e.timeouts.sessionIdlePause<Date.now()?!1:r>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(_&&v.infoTick(`Skipping event with timestamp ${r} because it is after maxReplayDuration`),!1):!0}function xo(e,t){try{if(typeof t=="function"&&Ro(e))return t(e)}catch(r){return _&&v.exception(r,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}function Kt(e){return!e.type}function Tt(e){return e.type==="transaction"}function Oo(e){return e.type==="replay_event"}function br(e){return e.type==="feedback"}function Ao(e){return(t,r)=>{if(!e.isEnabled()||!Kt(t)&&!Tt(t))return;const n=r.statusCode;if(!(!n||n<200||n>=300)){if(Tt(t)){Do(e,t);return}No(e,t)}}}function Do(e,t){const r=e.getContext();t.contexts?.trace?.trace_id&&r.traceIds.size<100&&r.traceIds.add(t.contexts.trace.trace_id)}function No(e,t){const r=e.getContext();if(t.event_id&&r.errorIds.size<100&&r.errorIds.add(t.event_id),e.recordingMode!=="buffer"||!t.tags?.replayId)return;const{beforeErrorSampling:n}=e.getOptions();typeof n=="function"&&!n(t)||Pe(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(s){e.handleException(s)}})}function Lo(e){return t=>{!e.isEnabled()||!Kt(t)||Po(e,t)}}function Po(e,t){const r=t.exception?.values?.[0]?.value;if(typeof r=="string"&&(r.match(/(reactjs\.org\/docs\/error-decoder\.html\?invariant=|react\.dev\/errors\/)(418|419|422|423|425)/)||r.match(/(does not match server-rendered HTML|Hydration failed because)/i))){const n=ie({category:"replay.hydrate-error",data:{url:Wn()}});Fe(e,n)}}function Bo(e){const t=ae();t&&t.on("beforeAddBreadcrumb",r=>Fo(e,r))}function Fo(e,t){if(!e.isEnabled()||!hn(t))return;const r=Uo(t);r&&Fe(e,r)}function Uo(e){return!hn(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui.")?null:e.category==="console"?Wo(e):ie(e)}function Wo(e){const t=e.data?.arguments;if(!Array.isArray(t)||t.length===0)return ie(e);let r=!1;const n=t.map(s=>{if(!s)return s;if(typeof s=="string")return s.length>We?(r=!0,`${s.slice(0,We)}…`):s;if(typeof s=="object")try{const i=xr(s,7);return JSON.stringify(i).length>We?(r=!0,`${JSON.stringify(i,null,2).slice(0,We)}…`):i}catch{}return s});return ie({...e,data:{...e.data,arguments:n,...r?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function hn(e){return!!e.category}function zo(e,t){return e.type||!e.exception?.values?.length?!1:!!t.originalException?.__rrweb__}function Ze(){const e=Dt().getPropagationContext().dsc;e&&delete e.replay_id;const t=At();if(t){const r=Tr(t);delete r.replay_id}}function wr(e){const t=Dt().getPropagationContext().dsc;t&&(t.replay_id=e);const r=At();if(r){const n=Tr(r);n.replay_id=e}}function Ho(e,t){e.triggerUserActivity(),e.addUpdate(()=>t.timestamp?(e.throttledAddEvent({type:k.Custom,timestamp:t.timestamp*1e3,data:{tag:"breadcrumb",payload:{timestamp:t.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:t.event_id}}}}),!1):!0)}function $o(e,t){return e.recordingMode!=="buffer"||t.message===Lt||!t.exception||t.type?!1:cn(e.getOptions().errorSampleRate)}function qo(e){return Object.assign((t,r)=>{if(e.session&&Qe(e.session,{maxReplayDuration:e.getOptions().maxReplayDuration,sessionIdleExpire:e.timeouts.sessionIdleExpire})&&Ze(),!e.isEnabled()||e.isPaused())return t;if(Oo(t))return delete t.breadcrumbs,t;if(!Kt(t)&&!Tt(t)&&!br(t))return t;if(!e.checkAndHandleExpiredSession())return Ze(),t;if(br(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),Ho(e,t),t;if(zo(t,r)&&!e.getOptions()._experiments.captureExceptions)return _&&v.log("Ignoring error from rrweb internals",t),null;const s=$o(e,t);if((s||e.recordingMode==="session")&&(t.tags={...t.tags,replayId:e.getSessionId()}),s&&e.recordingMode==="buffer"&&e.session?.sampled==="buffer"){const o=e.session;o.dirty=!0,e.getOptions().stickySession&&ot(o)}return t},{id:"Replay"})}function at(e,t){return t.map(({type:r,start:n,end:s,name:i,data:o})=>{const c=e.throttledAddEvent({type:k.Custom,timestamp:n,data:{tag:"performanceSpan",payload:{op:r,description:i,startTimestamp:n,endTimestamp:s,data:o}}});return typeof c=="string"?Promise.resolve(null):c})}function jo(e){const{from:t,to:r}=e,n=Date.now()/1e3;return{type:"navigation.push",start:n,end:n,name:r,data:{previous:t}}}function Vo(e){return t=>{if(!e.isEnabled())return;const r=jo(t);r!==null&&(e.getContext().urls.push(r.name),e.triggerUserActivity(),e.addUpdate(()=>(at(e,[r]),!1)))}}function Ko(e,t){return _&&e.getOptions()._experiments.traceInternals?!1:es(t,ae())}function fn(e,t){e.isEnabled()&&t!==null&&(Ko(e,t.name)||e.addUpdate(()=>(at(e,[t]),!0)))}function ct(e){if(!e)return;const t=new TextEncoder;try{if(typeof e=="string")return t.encode(e).length;if(e instanceof URLSearchParams)return t.encode(e.toString()).length;if(e instanceof FormData){const r=Kn(e);return t.encode(r).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function pn(e){if(!e)return;const t=parseInt(e,10);return isNaN(t)?void 0:t}function et(e,t){if(!e)return{headers:{},size:void 0,_meta:{warnings:[t]}};const r={...e._meta},n=r.warnings||[];return r.warnings=[...n,t],e._meta=r,e}function mn(e,t){if(!t)return null;const{startTimestamp:r,endTimestamp:n,url:s,method:i,statusCode:o,request:c,response:a}=t;return{type:e,start:r/1e3,end:n/1e3,name:s,data:{method:i,statusCode:o,request:c,response:a}}}function Le(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function ue(e,t,r){if(!t&&Object.keys(e).length===0)return;if(!t)return{headers:e};if(!r)return{headers:e,size:t};const n={headers:e,size:t},{body:s,warnings:i}=Yo(r);return n.body=s,i?.length&&(n._meta={warnings:i}),n}function xt(e,t){return Object.entries(e).reduce((r,[n,s])=>{const i=n.toLowerCase();return t.includes(i)&&e[n]&&(r[i]=s),r},{})}function Yo(e){if(!e||typeof e!="string")return{body:e};const t=e.length>tr,r=Go(e);if(t){const n=e.slice(0,tr);return r?{body:n,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${n}…`,warnings:["TEXT_TRUNCATED"]}}if(r)try{return{body:JSON.parse(e)}}catch{}return{body:e}}function Go(e){const t=e[0],r=e[e.length-1];return t==="["&&r==="]"||t==="{"&&r==="}"}function tt(e,t){const r=Xo(e);return Xn(r,t)}function Xo(e,t=B.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(B.location.origin))return e;
3const r=new URL(e,t);if(r.origin!==new URL(t).origin)return e;const n=r.href;return!e.endsWith("/")&&n.endsWith("/")?n.slice(0,-1):n}async function Jo(e,t,r){try{const n=await Zo(e,t,r),s=mn("resource.fetch",n);fn(r.replay,s)}catch(n){_&&v.exception(n,"Failed to capture fetch breadcrumb")}}function Qo(e,t){const{input:r,response:n}=t,s=r?Ar(r):void 0,i=ct(s),o=n?pn(n.headers.get("content-length")):void 0;i!==void 0&&(e.data.request_body_size=i),o!==void 0&&(e.data.response_body_size=o)}async function Zo(e,t,r){const n=Date.now(),{startTimestamp:s=n,endTimestamp:i=n}=t,{url:o,method:c,status_code:a=0,request_body_size:l,response_body_size:d}=e.data,u=tt(o,r.networkDetailAllowUrls)&&!tt(o,r.networkDetailDenyUrls),h=u?ea(r,t.input,l):Le(l),p=await ta(u,r,t.response,d);return{startTimestamp:s,endTimestamp:i,url:o,method:c,statusCode:a,request:h,response:p}}function ea({networkCaptureBodies:e,networkRequestHeaders:t},r,n){const s=r?sa(r,t):{};if(!e)return ue(s,n,void 0);const i=Ar(r),[o,c]=Dr(i,v),a=ue(s,n,o);return c?et(a,c):a}async function ta(e,{networkCaptureBodies:t,networkResponseHeaders:r},n,s){if(!e&&s!==void 0)return Le(s);const i=n?gn(n.headers,r):{};if(!n||!t&&s!==void 0)return ue(i,s,void 0);const[o,c]=await na(n),a=ra(o,{networkCaptureBodies:t,responseBodySize:s,captureDetails:e,headers:i});return c?et(a,c):a}function ra(e,{networkCaptureBodies:t,responseBodySize:r,captureDetails:n,headers:s}){try{const i=e?.length&&r===void 0?ct(e):r;return n?t?ue(s,i,e):ue(s,i,void 0):Le(i)}catch(i){return _&&v.exception(i,"Failed to serialize response body"),ue(s,r,void 0)}}async function na(e){const t=ia(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[await oa(t)]}catch(r){return r instanceof Error&&r.message.indexOf("Timeout")>-1?(_&&v.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(_&&v.exception(r,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}function gn(e,t){const r={};return t.forEach(n=>{e.get(n)&&(r[n]=e.get(n))}),r}function sa(e,t){return e.length===1&&typeof e[0]!="string"?Er(e[0],t):e.length===2?Er(e[1],t):{}}function Er(e,t){if(!e)return{};const r=e.headers;return r?r instanceof Headers?gn(r,t):Array.isArray(r)?{}:xt(r,t):{}}function ia(e){try{return e.clone()}catch(t){_&&v.exception(t,"Failed to clone response body")}}function oa(e){return new Promise((t,r)=>{const n=Pe(()=>r(new Error("Timeout while trying to read response body")),500);aa(e).then(s=>t(s),s=>r(s)).finally(()=>clearTimeout(n))})}async function aa(e){return await e.text()}async function ca(e,t,r){try{const n=ua(e,t,r),s=mn("resource.xhr",n);fn(r.replay,s)}catch(n){_&&v.exception(n,"Failed to capture xhr breadcrumb")}}function la(e,t){const{xhr:r,input:n}=t;if(!r)return;const s=ct(n),i=r.getResponseHeader("content-length")?pn(r.getResponseHeader("content-length")):fa(r.response,r.responseType);s!==void 0&&(e.data.request_body_size=s),i!==void 0&&(e.data.response_body_size=i)}function ua(e,t,r){const n=Date.now(),{startTimestamp:s=n,endTimestamp:i=n,input:o,xhr:c}=t,{url:a,method:l,status_code:d=0,request_body_size:u,response_body_size:h}=e.data;if(!a)return null;if(!c||!tt(a,r.networkDetailAllowUrls)||tt(a,r.networkDetailDenyUrls)){const M=Le(u),m=Le(h);return{startTimestamp:s,endTimestamp:i,url:a,method:l,statusCode:d,request:M,response:m}}const p=c[Yn],f=p?xt(p.request_headers,r.networkRequestHeaders):{},y=xt(Gn(c),r.networkResponseHeaders),[b,S]=r.networkCaptureBodies?Dr(o,v):[void 0],[I,N]=r.networkCaptureBodies?da(c):[void 0],A=ue(f,u,b),F=ue(y,h,I);return{startTimestamp:s,endTimestamp:i,url:a,method:l,statusCode:d,request:S?et(A,S):A,response:N?et(F,N):F}}function da(e){const t=[];try{return[e.responseText]}catch(r){t.push(r)}try{return ha(e.response,e.responseType)}catch(r){t.push(r)}return _&&v.warn("Failed to get xhr response body",...t),[void 0]}function ha(e,t){try{if(typeof e=="string")return[e];if(e instanceof Document)return[e.body.outerHTML];if(t==="json"&&e&&typeof e=="object")return[JSON.stringify(e)];if(!e)return[void 0]}catch(r){return _&&v.exception(r,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return _&&v.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function fa(e,t){try{const r=t==="json"&&e&&typeof e=="object"?JSON.stringify(e):e;return ct(r)}catch{return}}function pa(e){const t=ae();try{const{networkDetailAllowUrls:r,networkDetailDenyUrls:n,networkCaptureBodies:s,networkRequestHeaders:i,networkResponseHeaders:o}=e.getOptions(),c={replay:e,networkDetailAllowUrls:r,networkDetailDenyUrls:n,networkCaptureBodies:s,networkRequestHeaders:i,networkResponseHeaders:o};t&&t.on("beforeAddBreadcrumb",(a,l)=>ma(c,a,l))}catch{}}function ma(e,t,r){if(t.data)try{ga(t)&&Sa(r)&&(la(t,r),ca(t,r,e)),ya(t)&&_a(r)&&(Qo(t,r),Jo(t,r,e))}catch(n){_&&v.exception(n,"Error when enriching network breadcrumb")}}function ga(e){return e.category==="xhr"}function ya(e){return e.category==="fetch"}function Sa(e){return e?.xhr}function _a(e){return e?.input!==void 0}function va(e){const t=ae();Rn(Gi(e)),Tn(Vo(e)),Bo(e),pa(e);const r=qo(e);xn(r),t&&(t.on("beforeSendEvent",Lo(e)),t.on("afterSendEvent",Ao(e)),t.on("createDsc",n=>{const s=e.getSessionId();s&&e.isEnabled()&&e.recordingMode==="session"&&e.checkAndHandleExpiredSession()&&(n.replay_id=s)}),t.on("spanStart",n=>{e.lastActiveSpan=n}),t.on("spanEnd",n=>{e.lastActiveSpan=n}),t.on("beforeSendFeedback",async(n,s)=>{const i=e.getSessionId();s?.includeReplay&&e.isEnabled()&&i&&n.contexts?.feedback&&(n.contexts.feedback.source==="api"&&await e.sendBufferedReplayOrFlush(),n.contexts.feedback.replay_id=i)}),t.on("openFeedbackWidget",async()=>{await e.sendBufferedReplayOrFlush()}))}async function ba(e){try{return Promise.all(at(e,[wa(B.performance.memory)]))}catch{return[]}}function wa(e){const{jsHeapSizeLimit:t,totalJSHeapSize:r,usedJSHeapSize:n}=e,s=Date.now()/1e3;return{type:"memory",name:"memory",start:s,end:s,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:r,usedJSHeapSize:n}}}}function Ea(e,t,r){return ss(e,t,{...r,setTimeoutImpl:Pe})}const qe=Ot.navigator;function ka(){return/iPhone|iPad|iPod/i.test(qe?.userAgent??"")||/Macintosh/i.test(qe?.userAgent??"")&&qe?.maxTouchPoints&&qe?.maxTouchPoints>1?{sampling:{mousemove:!1}}:{}}function Ia(e){let t=!1;return(r,n)=>{if(!e.checkAndHandleExpiredSession()){_&&v.warn("Received replay event after session expired.");return}const s=n||!t;t=!0,Ca(r),e.clickDetector&&qi(e.clickDetector,r),e.addUpdate(()=>{if(e.recordingMode==="buffer"&&s&&e.setInitialState(),!Vt(e,r,s))return!0;
3if(!s)return!1;const i=e.session;if(Ra(e,s),e.recordingMode==="buffer"&&i&&e.eventBuffer&&!i.dirty){const o=e.eventBuffer.getEarliestTimestamp();o&&(_&&v.log(`Updating session start time to earliest event in buffer to ${new Date(o)}`),i.started=o,e.getOptions().stickySession&&ot(i))}return i?.previousSessionId||e.recordingMode==="session"&&e.flush(),!0})}}function Ca(e){const t=e.data;if(!(e.type!==k.IncrementalSnapshot||!t||typeof t!="object"||!("source"in t)||t.source!==w.Mutation||!("attributes"in t)||!Array.isArray(t.attributes)))for(const r of t.attributes){const n=re.mirror.getNode(r.id),s=n&&re.mirror.getMeta(n);if(s?.type===it.Element)for(const[i,o]of Object.entries(r.attributes))o===null?delete s.attributes[i]:s.attributes[i]=o}}function Ma(e){const t=e.getOptions();return{type:k.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:e.isRecordingCanvas(),sessionSampleRate:t.sessionSampleRate,errorSampleRate:t.errorSampleRate,useCompressionOption:t.useCompression,blockAllMedia:t.blockAllMedia,maskAllText:t.maskAllText,maskAllInputs:t.maskAllInputs,useCompression:e.eventBuffer?e.eventBuffer.type==="worker":!1,networkDetailHasUrls:t.networkDetailAllowUrls.length>0,networkCaptureBodies:t.networkCaptureBodies,networkRequestHasHeaders:t.networkRequestHeaders.length>0,networkResponseHasHeaders:t.networkResponseHeaders.length>0}}}}function Ra(e,t){!t||e.session?.segmentId!==0||Vt(e,Ma(e),!1)}function Ta(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function xa(e,t,r,n){return $n(qn(e,jn(e),n,r),[[{type:"replay_event"},e],[{type:"replay_recording",length:typeof t=="string"?new TextEncoder().encode(t).length:t.length},t]])}function Oa({recordingData:e,headers:t}){let r;const n=`${JSON.stringify(t)}
4`;if(typeof e=="string")r=`${n}${e}`;else{const i=new TextEncoder().encode(n);r=new Uint8Array(i.length+e.length),r.set(i),r.set(e,i.length)}return r}async function Aa({client:e,scope:t,replayId:r,event:n}){const s=typeof e._integrations=="object"&&e._integrations!==null&&!Array.isArray(e._integrations)?Object.keys(e._integrations):void 0,i={event_id:r,integrations:s};e.emit("preprocessEvent",n,i);const o=await zn(e.getOptions(),n,i,t,e,Hn());if(!o)return null;e.emit("postprocessEvent",o,i),o.platform=o.platform||"javascript";const c=e.getSdkMetadata(),{name:a,version:l,settings:d}=c?.sdk||{};return o.sdk={...o.sdk,name:a||"sentry.javascript.unknown",version:l||"0.0.0",settings:d},o}async function Da({recordingData:e,replayId:t,segmentId:r,eventContext:n,timestamp:s,session:i}){const o=Oa({recordingData:e,headers:{segment_id:r}}),{urls:c,errorIds:a,traceIds:l,initialTimestamp:d}=n,u=ae(),h=Dt(),p=u?.getTransport(),f=u?.getDsn();if(!u||!p||!f||!i.sampled)return Promise.resolve({});const y={type:is,replay_start_timestamp:d/1e3,timestamp:s/1e3,error_ids:a,trace_ids:l,urls:c,replay_id:t,segment_id:r,replay_type:i.sampled},b=await Aa({scope:h,client:u,replayId:t,event:y});if(!b)return u.recordDroppedEvent("event_processor","replay"),_&&v.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete b.sdkProcessingMetadata;const S=xa(b,o,f,u.getOptions().tunnel);let I;try{I=await p.send(S)}catch(A){const F=new Error(Lt);try{F.cause=A}catch{}throw F}const N=Pn({},I);if(Bn(N,"replay"))throw new Yt(N);if(typeof I.statusCode=="number"&&(I.statusCode<200||I.statusCode>=300))throw new yn(I.statusCode);return I}
4class yn extends Error{constructor(t){super(`Transport returned status code ${t}`)}}class Yt extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}}class kr extends Error{constructor(){super("Session is too long, not sending replay")}}async function Sn(e,t={count:0,interval:ds}){const{recordingData:r,onError:n}=e;if(r.length)try{return await Da(e),!0}catch(s){if(s instanceof yn||s instanceof Yt)throw s;if(Ln("Replays",{_retryCount:t.count}),n&&n(s),t.count>=hs){const i=new Error(`${Lt} - max retries exceeded`);try{i.cause=s}catch{}throw i}return t.interval*=++t.count,new Promise((i,o)=>{Pe(async()=>{try{await Sn(e,t),i(!0)}catch(c){o(c)}},t.interval)})}}const _n="__THROTTLED",Na="__SKIPPED";function La(e,t,r){const n=new Map,s=c=>{const a=c-r;n.forEach((l,d)=>{d<a&&n.delete(d)})},i=()=>[...n.values()].reduce((c,a)=>c+a,0);let o=!1;return(...c)=>{const a=Math.floor(Date.now()/1e3);if(s(a),i()>=t){const d=o;return o=!0,d?Na:_n}o=!1;const l=n.get(a)||0;return n.set(a,l+1),e(...c)}}class Pa{constructor({options:t,recordingOptions:r}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:os,sessionIdleExpire:as},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._requiresManualStart=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=r,this._options=t,this._debouncedFlush=Ea(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=La((o,c)=>To(this,o,c),300,5);const{slowClickTimeout:n,slowClickIgnoreSelectors:s}=this.getOptions(),i=n?{threshold:Math.min(fs,n),timeout:n,scrollTimeout:ps,ignoreSelector:s?s.join(","):""}:void 0;if(i&&(this.clickDetector=new Wi(this,i)),_){const o=t._experiments;v.setConfig({captureExceptions:!!o.captureExceptions,traceInternals:!!o.traceInternals})}this._handleVisibilityChange=()=>{B.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{const o=ie({category:"ui.blur"});this._doChangeToBackgroundTasks(o)},this._handleWindowFocus=()=>{const o=ie({category:"ui.focus"});this._doChangeToForegroundTasks(o)},this._handleKeyboardEvent=o=>{Zi(this,o)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(t){_&&v.exception(t),this._options.onError&&this._options.onError(t)}initializeSampling(t){const{errorSampleRate:r,sessionSampleRate:n}=this._options,s=r<=0&&n<=0;if(this._requiresManualStart=s,!s){if(this._initializeSessionForSampling(t),!this.session){_&&v.exception(new Error("Unable to initialize and create session"));return}this.session.sampled!==!1&&(this.recordingMode=this.session.sampled==="buffer"&&this.session.segmentId===0?"buffer":"session",_&&v.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){_&&v.log("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){_&&v.log("Buffering is in progress, call `flush()` to save the replay");return}_&&v.infoTick("Starting replay in session mode"),this._updateUserActivity();const t=bt({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=t,this.recordingMode="session",this._initializeRecording()}startBuffering(){if(this._isEnabled){_&&v.log("Buffering is in progress, call `flush()` to save the replay");return}_&&v.infoTick("Starting replay in buffer mode");const t=bt({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=t,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{const t=this._canvas;this._stopRecording=re({...this._recordingOptions,...this.recordingMode==="buffer"?{checkoutEveryNms:us}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:Ia(this),...ka(),onMutation:this._onMutationHandler.bind(this),...t?{recordCanvas:t.recordCanvas,getCanvasManager:t.getCanvasManager,sampling:t.sampling,dataURLOptions:t.dataURLOptions}:{}})}catch(t){this.handleException(t)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(t){return this.handleException(t),!1}}async stop({forceFlush:t=!1,reason:r}={}){if(!this._isEnabled)return;this._isEnabled=!1,this.recordingMode="buffer";const n=r??"manual";ae()?.emit("replayEnd",{sessionId:this.session?.id,reason:n});try{_&&v.log(`Stopping Replay triggered by ${n}`),Ze(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),t&&await this._flush({force:!0}),this.eventBuffer?.destroy(),this.eventBuffer=null,Eo(this)}catch(s){this.handleException(s)}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),_&&v.log("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),_&&v.log("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:t=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const r=Date.now();_&&v.log("Converting buffer to session"),await this.flushImmediate();const n=this.stopRecording();!t||!n||this.recordingMode!=="session"&&(this.recordingMode="session",this.session&&(this.session.dirty=!1,this._updateUserActivity(r),this._updateSessionActivity(r),this._maybeSaveSession(),wr(this.session.id)),this.startRecording())}addUpdate(t){const r=t();this.recordingMode==="buffer"||!this._isEnabled||r!==!0&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),!this._stopRecording){if(!this._checkSession())return;this.resume();return}this.checkAndHandleExpiredSession(),this._updateSessionActivity()}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return this.recordingMode==="buffer"?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(t){if(!(t&&this.session?.sampled===!1))return this.session?.id}
4checkAndHandleExpiredSession(){if(this._lastActivity&&Rt(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session?.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const t=`${B.location.pathname}${B.location.hash}${B.location.search}`,r=`${B.location.origin}${t}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=r,this._context.initialTimestamp=Date.now(),this._context.urls.push(r)}throttledAddEvent(t,r){const n=this._throttledAddEvent(t,r);if(n===_n){const s=ie({category:"replay.throttled"});this.addUpdate(()=>!Vt(this,{type:Di,timestamp:s.timestamp||0,data:{tag:"breadcrumb",payload:s,metric:!0}}))}return n}getCurrentRoute(){const t=this.lastActiveSpan||At(),r=t&&Cn(t),s=(r&&Zt(r).data||{})[Mn];if(!(!r||!s||!["route","custom"].includes(s)))return Zt(r).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=vo({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.session&&ae()?.emit("replayStart",{sessionId:this.session.id,recordingMode:this.recordingMode}),this.startRecording(),this.recordingMode==="session"&&this.session&&wr(this.session.id)}_initializeSessionForSampling(t){const r=this._options.errorSampleRate>0,n=bt({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,previousSessionId:t},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:r});this.session=n}_checkSession(){if(!this.session)return!1;const t=this.session;return Qe(t,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(t),!1):!0}async _refreshSession(t){this._isEnabled&&(await this.stop({reason:"sessionExpired"}),this.initializeSampling(t.id))}_addListeners(){try{B.document.addEventListener("visibilitychange",this._handleVisibilityChange),B.addEventListener("blur",this._handleWindowBlur),B.addEventListener("focus",this._handleWindowFocus),B.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(va(this),this._hasInitializedCoreListeners=!0)}catch(t){this.handleException(t)}this._performanceCleanupCallback=fo(this)}_removeListeners(){try{B.document.removeEventListener("visibilitychange",this._handleVisibilityChange),B.removeEventListener("blur",this._handleWindowBlur),B.removeEventListener("focus",this._handleWindowFocus),B.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(t){this.handleException(t)}}_doChangeToBackgroundTasks(t){if(!this.session)return;if(Qe(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})){Ze();return}t&&this._createCustomBreadcrumb(t),this.conditionalFlush()}_doChangeToForegroundTasks(t){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){_&&v.log("Document has become active, but session has expired");return}t&&this._createCustomBreadcrumb(t)}_updateUserActivity(t=Date.now()){this._lastActivity=t}_updateSessionActivity(t=Date.now()){this.session&&(this.session.lastActivity=t,this._maybeSaveSession())}_createCustomBreadcrumb(t){this.addUpdate(()=>{this.throttledAddEvent({type:k.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})})}_addPerformanceEntries(){let t=no(this.performanceEntries).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){const r=this._context.initialTimestamp/1e3;t=t.filter(n=>n.start>=r)}return Promise.all(at(this,t))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:t,eventBuffer:r}=this;if(!t||!r||this._requiresManualStart||t.segmentId)return;const n=r.getEarliestTimestamp();
4n&&n<this._context.initialTimestamp&&(this._context.initialTimestamp=n)}_popEventContext(){const t={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),t}async _runFlush(){const t=this.getSessionId();if(!this.session||!this.eventBuffer||!t){_&&v.error("No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!!this.eventBuffer?.hasEvents&&(await ba(this),!!this.eventBuffer&&t===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();const r=Date.now();if(r-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new kr;const n=this._popEventContext(),s=this.session.segmentId++;this._maybeSaveSession();const i=await this.eventBuffer.finish();await Sn({replayId:t,recordingData:i,segmentId:s,eventContext:n,session:this.session,timestamp:r,onError:o=>this.handleException(o)})}catch(r){this.handleException(r),this.stop({reason:"sendError"});const n=ae();if(n){let s;r instanceof Yt?s="ratelimit_backoff":r instanceof kr?s="invalid":s="send_error",n.recordDroppedEvent(s,"replay")}}}async _flush({force:t=!1}={}){if(!this._isEnabled&&!t)return;if(!this.checkAndHandleExpiredSession()){_&&v.error("Attempting to finish replay event after session expired.");return}if(!this.session)return;const r=this.session.started,s=Date.now()-r;this._debouncedFlush.cancel();const i=s<this._options.minReplayDuration,o=s>this._options.maxReplayDuration+5e3;if(i||o){_&&v.log(`Session duration (${Math.floor(s/1e3)}s) is too ${i?"short":"long"}, not sending replay.`),i&&this._debouncedFlush();return}const c=this.eventBuffer;c&&this.session.segmentId===0&&!c.hasCheckout&&_&&v.log("Flushing initial segment without checkout.");const a=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(l){this.handleException(l)}finally{this._flushLock=void 0,a&&this._debouncedFlush()}}_maybeSaveSession(){this.session&&this._options.stickySession&&ot(this.session)}_onMutationHandler(t){const{ignoreMutations:r}=this._options._experiments;if(r?.length&&t.some(c=>{const a=Ta(c.target),l=r.join(",");return a?.matches(l)}))return!1;const n=t.length,s=this._options.mutationLimit,i=this._options.mutationBreadcrumbLimit,o=s&&n>s;if(n>i||o){const c=ie({category:"replay.mutations",data:{count:n,limit:o}});this._createCustomBreadcrumb(c)}return o?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}}function Me(e,t){return[...e,...t].join(",")}function Ba({mask:e,unmask:t,block:r,unblock:n,ignore:s}){const i=["base","iframe[srcdoc]:not([src])"],o=Me(e,[".sentry-mask","[data-sentry-mask]"]),c=Me(t,[]);return{maskTextSelector:o,unmaskTextSelector:c,blockSelector:Me(r,[".sentry-block","[data-sentry-block]",...i]),unblockSelector:Me(n,[]),ignoreSelector:Me(s,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function Fa({el:e,key:t,maskAttributes:r,maskAllText:n,privacyOptions:s,value:i}){if(s.unmaskTextSelector&&e.matches(s.unmaskTextSelector))return i;const o=r.includes(t),c=n&&t==="value"&&e.tagName==="INPUT"&&["submit","button"].includes(e.getAttribute("type")||"");return o||c?i.replace(/[\S]/g,"*"):i}const Ir='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',Ua=["content-length","content-type","accept"],Wa=Symbol.for("sentry__originalRequestBody");let Cr=!1,Mr=!1;function za(){if(typeof Request>"u"||Mr)return;const e=Request;try{const t=function(r,n){const s=new e(r,n);return n?.body!=null&&(s[Wa]=n.body),s};t.prototype=e.prototype,Ot.Request=t,Mr=!0}catch{}}const Ga=e=>new Ha(e);class Ha{constructor({flushMinDelay:t=cs,flushMaxDelay:r=ls,minReplayDuration:n=ms,maxReplayDuration:s=rr,stickySession:i=!0,useCompression:o=!0,workerUrl:c,_experiments:a={},maskAllText:l=!0,maskAllInputs:d=!0,blockAllMedia:u=!0,mutationBreadcrumbLimit:h=750,mutationLimit:p=1e4,slowClickTimeout:f=7e3,slowClickIgnoreSelectors:y=[],networkDetailAllowUrls:b=[],networkDetailDenyUrls:S=[],networkCaptureBodies:I=!0,networkRequestHeaders:N=[],networkResponseHeaders:A=[],mask:F=[],maskAttributes:M=["title","placeholder","aria-label"],unmask:m=[],block:R=[],unblock:q=[],ignore:g=[],maskFn:E,beforeAddRecordingEvent:L,beforeErrorSampling:z,onError:H,attachRawBodyFromRequest:Q=!1}={}){this.name="Replay";const V=Ba({mask:F,unmask:m,block:R,unblock:q,ignore:g});if(this._recordingOptions={maskAllInputs:d,maskAllText:l,maskInputOptions:{password:!0},maskTextFn:E,maskInputFn:E,maskAttributeFn:(K,C,J)=>Fa({maskAttributes:M,maskAllText:l,privacyOptions:V,key:K,value:C,el:J}),...V,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:K=>{try{K.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!a.recordCrossOriginIframes},this._initialOptions={flushMinDelay:t,flushMaxDelay:r,minReplayDuration:Math.min(n,gs),maxReplayDuration:Math.min(s,rr),stickySession:i,useCompression:o,workerUrl:c,blockAllMedia:u,maskAllInputs:d,maskAllText:l,mutationBreadcrumbLimit:h,mutationLimit:p,slowClickTimeout:f,slowClickIgnoreSelectors:y,networkDetailAllowUrls:b,networkDetailDenyUrls:S,networkCaptureBodies:I,networkRequestHeaders:Rr(N),networkResponseHeaders:Rr(A),beforeAddRecordingEvent:L,beforeErrorSampling:z,onError:H,attachRawBodyFromRequest:Q,_experiments:a},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${Ir}`:Ir,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&Jt())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return Cr}set _isInitialized(t){Cr=t}afterAllSetup(t){!Jt()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&za(),this._setup(t),this._initialize(t))}start(){this._replay&&this._replay.start()}
4startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:this._replay.recordingMode==="session",reason:"manual"}):Promise.resolve()}flush(t){return this._replay?this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(t):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(t){if(this._replay?.isEnabled())return this._replay.getSessionId(t)}getRecordingMode(){if(this._replay?.isEnabled())return this._replay.recordingMode}processSpan(t){const r=this.getReplayId(!0);r&&kn(t,{"sentry.replay_id":r})}_initialize(t){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(t),this._replay.initializeSampling())}_setup(t){const r=$a(this._initialOptions,t);this._replay=new Pa({options:r,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(t){try{const r=t.getIntegrationByName("ReplayCanvas");if(!r)return;this._replay._canvas=r.getOptions()}catch{}}}function $a(e,t){const r=t.getOptions(),n={sessionSampleRate:0,errorSampleRate:0,...e},s=Qt(r.replaysSessionSampleRate),i=Qt(r.replaysOnErrorSampleRate);return s==null&&i==null&&In(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),s!=null&&(n.sessionSampleRate=s),i!=null&&(n.errorSampleRate=i),n}function Rr(e){return[...Ua,...e.map(t=>t.toLowerCase())]}export{Ga as replayIntegration};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.