"];return o.forEach(a=>{const c=a.stacktrace;c?.frames&&(c.frames=c.frames.map(l=>n_(l,i,r,t)))}),e}function n_(e,t,n,r){return e.filename!==n||!e.lineno||!t.length||zl(t,e,r),e}const r_="GraphQLClient",o_=(e=>({name:r_,setup(t){s_(t,e),i_(t,e)}}));function s_(e,t){e.on("beforeOutgoingRequestSpan",(n,r)=>{const s=Re(n).data||{};if(!(s[Te]==="http.client"))return;const c=s[Gl]||s["http.url"]||s.url,l=s[ql]||s["http.method"];if(!ks(c)||!ks(l))return;const{endpoints:d}=t,u=Fo(c,d),f=wc(r);if(u&&f){const p=kc(f);if(p){const h=vc(p);n.updateName(`${l} ${c} (${h})`),Or(p)&&n.setAttribute("graphql.document",p.query),Nr(p)&&(n.setAttribute("graphql.persisted_query.hash.sha256",p.extensions.persistedQuery.sha256Hash),n.setAttribute("graphql.persisted_query.version",p.extensions.persistedQuery.version))}}})}function i_(e,t){e.on("beforeOutgoingRequestBreadcrumb",(n,r)=>{const{category:o,type:s,data:i}=n;if(s==="http"&&(o==="fetch"||o==="xhr")){const d=i?.url,{endpoints:u}=t,f=Fo(d,u),p=wc(r);if(f&&i&&p){const h=kc(p);if(!i.graphql&&h){const m=vc(h);i["graphql.operation"]=m,Or(h)&&(i["graphql.document"]=h.query),Nr(h)&&(i["graphql.persisted_query.hash.sha256"]=h.extensions.persistedQuery.sha256Hash,i["graphql.persisted_query.version"]=h.extensions.persistedQuery.version)}}}})}function vc(e){if(Nr(e))return`persisted ${e.operationName}`;if(Or(e)){const{query:t,operationName:n}=e,{operationName:r=n,operationType:o}=a_(t);return r?`${o} ${r}`:`${o}`}return"unknown"}function wc(e){const t="xhr"in e;let n;if(t){const r=e.xhr[Do];n=r&&tr(r.body)[0]}else{const r=Bo(e.input);n=tr(r)[0]}return n}function a_(e){const t=/^(?:\s*)(query|mutation|subscription)(?:\s*)(\w+)(?:\s*)[{(]/,n=/^(?:\s*)(query|mutation|subscription)(?:\s*)[{(]/,r=e.match(t);if(r)return{operationType:r[1],operationName:r[2]};const o=e.match(n);return o?{operationType:o[1],operationName:void 0}:{operationType:void 0,operationName:void 0}}function Jn(e){return typeof e=="object"&&e!==null}function Or(e){return Jn(e)&&typeof e.query=="string"}function Nr(e){return Jn(e)&&typeof e.operationName=="string"&&Jn(e.extensions)&&Jn(e.extensions.persistedQuery)&&typeof e.extensions.persistedQuery.sha256Hash=="string"&&typeof e.extensions.persistedQuery.version=="number"}function kc(e){try{const t=JSON.parse(e);return Or(t)||Nr(t)?t:void 0}catch{return}}const c_=te(o_),l_=te((e={})=>{const t=["script"];function n(r,o,s=0){if(!r)return;const i="shadowRoot"in r&&r.shadowRoot?r.shadowRoot.children:r.children;for(const a of i){if(!(a instanceof HTMLElement))continue;const c=Vl(a,1)||void 0,l=a.tagName.toLowerCase();if(t.includes(l))continue;const d=e.onElement?.({element:a,componentName:c,tagName:l,depth:s})||{};if(d==="skip")continue;if(d==="children"){n(a,o,s+1);continue}const{x:u,y:f,width:p,height:h}=a.getBoundingClientRect(),m={identifier:a.id||void 0,type:c||l,visible:!0,alpha:1,height:h,width:p,x:u,y:f,...d},g=[];m.children=g,n(a,m.children,s+1),o.push(m)}}return{name:"ViewHierarchy",processEvent:(r,o)=>{if(r.type!==void 0||e.shouldAttach?.(r,o)===!1)return r;const s={rendering_system:"DOM",positioning:"absolute",windows:[]};n(e.rootElement?.()||re.document.body,s.windows);const i={filename:"view-hierarchy.json",attachmentType:"event.view_hierarchy",contentType:"application/json",data:JSON.stringify(s)};return o.attachments=o.attachments||[],o.attachments.push(i),r}}}),Z=ue,ts="sentryReplaySession",u_="replay_event",ns="Unable to send Replay",d_=3e5,f_=9e5,p_=5e3,h_=5500,m_=6e4,g_=5e3,__=3,hi=15e4,Nn=5e3,y_=3e3,b_=300,rs=2e7,S_=4999,E_=5e4,mi=36e5;var v_=Object.defineProperty,w_=(e,t,n)=>t in e?v_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gi=(e,t,n)=>w_(e,typeof t!="symbol"?t+"":t,n),le=(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))(le||{});function k_(e){return e.nodeType===e.ELEMENT_NODE}function ln(e){return e?.host?.shadowRoot===e}function un(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function T_(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 I_(e){const{cssText:t}=e;if(t.split('"').lengththis.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){const r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){const r=this.getNode(t);if(r){const o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(n,o)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function x_(){return new Ic}function Lr({maskInputOptions:e,tagName:t,type:n}){return t==="OPTION"&&(t="SELECT"),!!(e[t.toLowerCase()]||n&&e[n]||n==="password"||t==="INPUT"&&!n&&e.text)}function pn({isMasked:e,element:t,value:n,maskInputFn:r}){let o=n||"";return e?(r&&(o=r(o,t)),"*".repeat(o.length)):o}function Ut(e){return e.toLowerCase()}function yo(e){return e.toUpperCase()}const _i="__rrweb_original__";function O_(e){const t=e.getContext("2d");if(!t)return!0;const n=50;for(let r=0;rc!==0))return!1}return!0}function os(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ut(t):null}function cr(e,t,n){return t==="INPUT"&&(n==="radio"||n==="checkbox")?e.getAttribute("value")||"":e.value}function Cc(e,t){let n;try{n=new URL(e,t??window.location.href)}catch{return null}const r=/\.([0-9a-z]+)(?:$)/i;return n.pathname.match(r)?.[1]??null}const yi={};function Rc(e){const t=yi[e];if(t)return t;const n=window.document;let r=window[e];if(n&&typeof n.createElement=="function")try{const o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);const s=o.contentWindow;s&&s[e]&&(r=s[e]),n.head.removeChild(o)}catch{}return yi[e]=r.bind(window)}function bo(...e){return Rc("setTimeout")(...e)}function Ac(...e){return Rc("clearTimeout")(...e)}function Mc(e){try{return e.contentDocument}catch{}}let N_=1;const L_=new RegExp("[^a-z0-9-_:]"),hn=-2;function ss(){return N_++}function P_(e){if(e instanceof HTMLFormElement)return"form";const t=Ut(e.tagName);return L_.test(t)?"div":t}function D_(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}let wt,bi;const F_=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,B_=/^(?:[a-z+]+:)?\/\//i,U_=/^www\..*/i,$_=/^(data:)([^,]*),(.*)/i;function H_(e,t){if(!e||t.size===0)return e;try{const n=e.split(";"),r=[];for(let o of n){if(o=o.trim(),!o)continue;const s=o.indexOf(":");if(s===-1){r.push(o);continue}const i=o.slice(0,s).trim();t.has(i)||r.push(o)}return r.join("; ")+(r.length>0&&e.endsWith(";")?";":"")}catch(n){return console.warn("Error filtering CSS properties:",n),e}}function lr(e,t){return(e||"").replace(F_,(n,r,o,s,i,a)=>{const c=o||i||a,l=r||s||"";if(!c)return n;if(B_.test(c)||U_.test(c))return`url(${l}${c}${l})`;if($_.test(c))return`url(${l}${c}${l})`;if(c[0]==="/")return`url(${l}${D_(t)+c}${l})`;const d=t.split("/"),u=c.split("/");d.pop();for(const f of u)f!=="."&&(f===".."?d.pop():d.push(f));return`url(${l}${d.join("/")}${l})`})}const W_=/^[^ \t\n\r\u000c]+/,j_=/^[, \t\n\r\u000c]+/;function z_(e,t){if(t.trim()==="")return t;let n=0;function r(s){let i;const a=s.exec(t.substring(n));return a?(i=a[0],n+=i.length,i):""}const o=[];for(;r(j_),!(n>=t.length);){let s=r(W_);if(s.slice(-1)===",")s=Rt(e,s.substring(0,s.length-1)),o.push(s);else{let i="";s=Rt(e,s);let a=!1;for(;;){const c=t.charAt(n);if(c===""){o.push((s+i).trim());break}else if(a)c===")"&&(a=!1);else if(c===","){n+=1,o.push((s+i).trim());break}else c==="("&&(a=!0);i+=c,n+=1}}}return o.join(", ")}const Si=new WeakMap;function Rt(e,t){return!t||t.trim()===""?t:Pr(e,t)}function G_(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Pr(e,t){let n=Si.get(e);if(n||(n=e.createElement("a"),Si.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function xc(e,t,n,r,o,s,i){if(!r)return r;if(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#"))return Rt(e,r);if(n==="xlink:href"&&r[0]!=="#")return Rt(e,r);if(n==="background"&&(t==="table"||t==="td"||t==="th"))return Rt(e,r);if(n==="srcset")return z_(e,r);if(n==="style"){let a=lr(r,Pr(e));return i&&i.size>0&&(a=H_(a,i)),a}else if(t==="object"&&n==="data")return Rt(e,r);return typeof s=="function"?s(n,r,o):r}function Oc(e,t,n){return(e==="video"||e==="audio")&&t==="autoplay"}function q_(e,t,n,r){try{if(r&&e.matches(r))return!1;if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let o=e.classList.length;o--;){const s=e.classList[o];if(t.test(s))return!0}if(n)return e.matches(n)}catch{}return!1}function V_(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}function ct(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:ct(e.parentNode,t,n,r+1)}function At(e,t){return n=>{const r=n;if(r===null)return!1;try{if(e){if(typeof e=="string"){if(r.matches(`.${e}`))return!0}else if(V_(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}function $t(e,t,n,r,o,s){try{const i=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(i===null)return!1;if(i.tagName==="INPUT"){const l=i.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(l))return!0}let a=-1,c=-1;if(s){if(c=ct(i,At(r,o)),c=0?c:1/0)}else{if(a=ct(i,At(t,n)),a=0?a:1/0)}return a>=0?c>=0?a=0?!1:!!s}catch{}return!!s}function J_(e,t,n){const r=e.contentWindow;if(!r)return;let o=!1,s;try{s=r.document.readyState}catch{return}if(s!=="complete"){const a=bo(()=>{o||(t(),o=!0)},n);e.addEventListener("load",()=>{Ac(a),o=!0,t()});return}const i="about:blank";if(r.location.href!==i||e.src===i||e.src==="")return bo(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function Y_(e,t,n){let r=!1,o;try{o=e.sheet}catch{return}if(o)return;const s=bo(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{Ac(s),r=!0,t()})}function K_(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:a,maskAttributeFn:c,maskTextClass:l,unmaskTextClass:d,maskTextSelector:u,unmaskTextSelector:f,inlineStylesheet:p,maskInputOptions:h={},maskTextFn:m,maskInputFn:g,dataURLOptions:_={},inlineImages:y,recordCanvas:E,keepIframeSrcFn:w,newlyAddedElement:L=!1,ignoreCSSAttributes:C}=t,S=X_(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:le.Document,childNodes:[],compatMode:e.compatMode}:{type:le.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:le.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return Z_(e,{doc:n,blockClass:o,blockSelector:s,unblockSelector:i,inlineStylesheet:p,maskAttributeFn:c,maskInputOptions:h,maskInputFn:g,dataURLOptions:_,inlineImages:y,recordCanvas:E,keepIframeSrcFn:w,newlyAddedElement:L,rootId:S,maskTextClass:l,unmaskTextClass:d,maskTextSelector:u,unmaskTextSelector:f,ignoreCSSAttributes:C});case e.TEXT_NODE:return Q_(e,{doc:n,maskAllText:a,maskTextClass:l,unmaskTextClass:d,maskTextSelector:u,unmaskTextSelector:f,maskTextFn:m,maskInputOptions:h,maskInputFn:g,rootId:S});case e.CDATA_SECTION_NODE:return{type:le.CDATA,textContent:"",rootId:S};case e.COMMENT_NODE:return{type:le.Comment,textContent:e.textContent||"",rootId:S};default:return!1}}function X_(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return n===1?void 0:n}function Q_(e,t){const{maskAllText:n,maskTextClass:r,unmaskTextClass:o,maskTextSelector:s,unmaskTextSelector:i,maskTextFn:a,maskInputOptions:c,maskInputFn:l,rootId:d}=t,u=e.parentNode&&e.parentNode.tagName;let f=e.textContent;const p=u==="STYLE"?!0:void 0,h=u==="SCRIPT"?!0:void 0,m=u==="TEXTAREA"?!0:void 0;if(p&&f){try{e.nextSibling||e.previousSibling||e.parentNode.sheet?.cssRules&&(f=ar(e.parentNode.sheet))}catch(_){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${_}`,e)}f=lr(f,Pr(t.doc))}h&&(f="SCRIPT_PLACEHOLDER");const g=$t(e,r,s,o,i,n);if(!p&&!h&&!m&&f&&g&&(f=a?a(f,e.parentElement):f.replace(/[\S]/g,"*")),m&&f&&(c.textarea||g)&&(f=l?l(f,e.parentNode):f.replace(/[\S]/g,"*")),u==="OPTION"&&f){const _=Lr({type:null,tagName:u,maskInputOptions:c});f=pn({isMasked:$t(e,r,s,o,i,_),element:e,value:f,maskInputFn:l})}return{type:le.Text,textContent:f||"",isStyle:p,rootId:d}}function Z_(e,t){const{doc:n,blockClass:r,blockSelector:o,unblockSelector:s,inlineStylesheet:i,maskInputOptions:a={},maskAttributeFn:c,maskInputFn:l,dataURLOptions:d={},inlineImages:u,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:h=!1,rootId:m,maskTextClass:g,unmaskTextClass:_,maskTextSelector:y,unmaskTextSelector:E,ignoreCSSAttributes:w}=t,L=q_(e,r,o,s),C=P_(e);let S={};const R=e.attributes.length;for(let v=0;vT.href===e.href);let M=null;v&&(M=ar(v)),M&&(S.rel=null,S.href=null,S.crossorigin=null,S._cssText=lr(M,v.href))}if(C==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const v=ar(e.sheet);v&&(S._cssText=lr(v,Pr(n)))}if(C==="input"||C==="textarea"||C==="select"||C==="option"){const v=e,M=os(v),T=cr(v,yo(C),M),x=v.checked;if(M!=="submit"&&M!=="button"&&T){const W=$t(v,g,y,_,E,Lr({type:M,tagName:yo(C),maskInputOptions:a}));S.value=pn({isMasked:W,element:v,value:T,maskInputFn:l})}x&&(S.checked=x)}if(C==="option"&&(e.selected&&!a.select?S.selected=!0:delete S.selected),C==="canvas"&&f){if(e.__context==="2d")O_(e)||(S.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){const v=e.toDataURL(d.type,d.quality),M=n.createElement("canvas");M.width=e.width,M.height=e.height;const T=M.toDataURL(d.type,d.quality);v!==T&&(S.rr_dataURL=v)}}if(C==="img"&&u){wt||(wt=n.createElement("canvas"),bi=wt.getContext("2d"));const v=e,M=v.currentSrc||v.getAttribute("src")||"",T=v.crossOrigin,x=()=>{v.removeEventListener("load",x);try{wt.width=v.naturalWidth,wt.height=v.naturalHeight,bi.drawImage(v,0,0),S.rr_dataURL=wt.toDataURL(d.type,d.quality)}catch(W){if(v.crossOrigin!=="anonymous"){v.crossOrigin="anonymous",v.complete&&v.naturalWidth!==0?x():v.addEventListener("load",x);return}else console.warn(`Cannot inline img src=${M}! Error: ${W}`)}v.crossOrigin==="anonymous"&&(T?S.crossOrigin=T:v.removeAttribute("crossorigin"))};v.complete&&v.naturalWidth!==0?x():v.addEventListener("load",x)}if((C==="audio"||C==="video")&&(S.rr_mediaState=e.paused?"paused":"played",S.rr_mediaCurrentTime=e.currentTime),h||(e.scrollLeft&&(S.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(S.rr_scrollTop=e.scrollTop)),L){const{width:v,height:M}=e.getBoundingClientRect();S={class:S.class,rr_width:`${v}px`,rr_height:`${M}px`}}C==="iframe"&&!p(S.src)&&(!L&&!Mc(e)&&(S.rr_src=S.src),delete S.src);let F;try{customElements.get(C)&&(F=!0)}catch{}return{type:le.Element,tagName:C,attributes:S,childNodes:[],isSVG:G_(e)||void 0,needBlock:L,rootId:m,isCustom:F}}function Q(e){return e==null?"":e.toLowerCase()}function ey(e,t){if(t.comment&&e.type===le.Comment)return!0;if(e.type===le.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"&&Cc(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(Q(e.attributes.name).match(/^msapplication-tile(image|color)$/)||Q(e.attributes.name)==="application-name"||Q(e.attributes.rel)==="icon"||Q(e.attributes.rel)==="apple-touch-icon"||Q(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&Q(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Q(e.attributes.property).match(/^(og|twitter|fb):/)||Q(e.attributes.name).match(/^(og|twitter):/)||Q(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(Q(e.attributes.name)==="robots"||Q(e.attributes.name)==="googlebot"||Q(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(Q(e.attributes.name)==="author"||Q(e.attributes.name)==="generator"||Q(e.attributes.name)==="framework"||Q(e.attributes.name)==="publisher"||Q(e.attributes.name)==="progid"||Q(e.attributes.property).match(/^article:/)||Q(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(Q(e.attributes.name)==="google-site-verification"||Q(e.attributes.name)==="yandex-verification"||Q(e.attributes.name)==="csrf-token"||Q(e.attributes.name)==="p:domain_verify"||Q(e.attributes.name)==="verify-v1"||Q(e.attributes.name)==="verification"||Q(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Mt(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:a,maskTextClass:c,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:u,skipChild:f=!1,inlineStylesheet:p=!0,maskInputOptions:h={},maskAttributeFn:m,maskTextFn:g,maskInputFn:_,slimDOMOptions:y,dataURLOptions:E={},inlineImages:w=!1,recordCanvas:L=!1,onSerialize:C,onIframeLoad:S,iframeLoadTimeout:R=5e3,onBlockedImageLoad:F,onStylesheetLoad:v,stylesheetLoadTimeout:M=5e3,keepIframeSrcFn:T=()=>!1,newlyAddedElement:x=!1,ignoreCSSAttributes:W}=t;let{preserveWhiteSpace:K=!0}=t;const ne=K_(e,{doc:n,mirror:r,blockClass:o,blockSelector:s,maskAllText:a,unblockSelector:i,maskTextClass:c,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:u,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:g,maskInputFn:_,dataURLOptions:E,inlineImages:w,recordCanvas:L,keepIframeSrcFn:T,newlyAddedElement:x,ignoreCSSAttributes:W});if(!ne)return console.warn(e,"not serialized"),null;let oe;r.hasNode(e)?oe=r.getId(e):ey(ne,y)||!K&&ne.type===le.Text&&!ne.isStyle&&!ne.textContent.replace(/^\s+|\s+$/gm,"").length?oe=hn:oe=ss();const A=Object.assign(ne,{id:oe});if(r.add(e,A),oe===hn)return null;C&&C(e);let X=!f;if(A.type===le.Element){X=X&&!A.needBlock;const B=e.shadowRoot;B&&un(B)&&(A.isShadowHost=!0)}if((A.type===le.Document||A.type===le.Element)&&X){y.headWhitespace&&A.type===le.Element&&A.tagName==="head"&&(K=!1);const B={doc:n,mirror:r,blockClass:o,blockSelector:s,maskAllText:a,unblockSelector:i,maskTextClass:c,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:u,skipChild:f,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:g,maskInputFn:_,slimDOMOptions:y,dataURLOptions:E,inlineImages:w,recordCanvas:L,preserveWhiteSpace:K,onSerialize:C,onIframeLoad:S,iframeLoadTimeout:R,onBlockedImageLoad:F,onStylesheetLoad:v,stylesheetLoadTimeout:M,keepIframeSrcFn:T,ignoreCSSAttributes:W},se=e.childNodes?Array.from(e.childNodes):[];for(const pe of se){const ce=Mt(pe,B);ce&&A.childNodes.push(ce)}if(k_(e)&&e.shadowRoot)for(const pe of Array.from(e.shadowRoot.childNodes)){const ce=Mt(pe,B);ce&&(un(e.shadowRoot)&&(ce.isShadow=!0),A.childNodes.push(ce))}}if(e.parentNode&&ln(e.parentNode)&&un(e.parentNode)&&(A.isShadow=!0),A.type===le.Element&&A.tagName==="iframe"&&!A.needBlock&&J_(e,()=>{const B=Mc(e);if(B&&S){const se=Mt(B,{doc:B,mirror:r,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:a,maskTextClass:c,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:g,maskInputFn:_,slimDOMOptions:y,dataURLOptions:E,inlineImages:w,recordCanvas:L,preserveWhiteSpace:K,onSerialize:C,onIframeLoad:S,iframeLoadTimeout:R,onStylesheetLoad:v,stylesheetLoadTimeout:M,keepIframeSrcFn:T,ignoreCSSAttributes:W});se&&S(e,se)}},R),A.type===le.Element&&A.tagName==="img"&&!e.complete&&A.needBlock){const B=e,se=()=>{if(B.isConnected&&!B.complete&&F)try{const pe=B.getBoundingClientRect();pe.width>0&&pe.height>0&&F(B,A,pe)}catch{}B.removeEventListener("load",se)};B.isConnected&&B.addEventListener("load",se)}return A.type===le.Element&&A.tagName==="link"&&typeof A.attributes.rel=="string"&&(A.attributes.rel==="stylesheet"||A.attributes.rel==="preload"&&typeof A.attributes.href=="string"&&Cc(A.attributes.href)==="css")&&Y_(e,()=>{if(v){const B=Mt(e,{doc:n,mirror:r,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:a,maskTextClass:c,unmaskTextClass:l,maskTextSelector:d,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:g,maskInputFn:_,slimDOMOptions:y,dataURLOptions:E,inlineImages:w,recordCanvas:L,preserveWhiteSpace:K,onSerialize:C,onIframeLoad:S,iframeLoadTimeout:R,onStylesheetLoad:v,stylesheetLoadTimeout:M,keepIframeSrcFn:T,ignoreCSSAttributes:W});B&&v(e,B)}},M),A.type===le.Element&&delete A.needBlock,A}function ty(e,t){const{mirror:n=new Ic,blockClass:r="rr-block",blockSelector:o=null,unblockSelector:s=null,maskAllText:i=!1,maskTextClass:a="rr-mask",unmaskTextClass:c=null,maskTextSelector:l=null,unmaskTextSelector:d=null,inlineStylesheet:u=!0,inlineImages:f=!1,recordCanvas:p=!1,maskAllInputs:h=!1,maskAttributeFn:m,maskTextFn:g,maskInputFn:_,slimDOM:y=!1,dataURLOptions:E,preserveWhiteSpace:w,onSerialize:L,onIframeLoad:C,iframeLoadTimeout:S,onBlockedImageLoad:R,onStylesheetLoad:F,stylesheetLoadTimeout:v,keepIframeSrcFn:M=()=>!1,ignoreCSSAttributes:T=new Set([])}=t||{};return Mt(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,maskAllText:i,maskTextClass:a,unmaskTextClass:c,maskTextSelector:l,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:u,maskInputOptions:h===!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}:h===!1?{}:h,maskAttributeFn:m,maskTextFn:g,maskInputFn:_,slimDOMOptions:y===!0||y==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:y==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:y===!1?{}:y,dataURLOptions:E,inlineImages:f,recordCanvas:p,preserveWhiteSpace:w,onSerialize:L,onIframeLoad:C,iframeLoadTimeout:S,onBlockedImageLoad:R,onStylesheetLoad:F,stylesheetLoadTimeout:v,keepIframeSrcFn:M,newlyAddedElement:!1,ignoreCSSAttributes:T})}function me(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const kt=`Please stop import mirror directly. Instead of that,\r now you can use replayer.getMirror() to access the mirror instance of a replayer,\r or you can use record.mirror to access the mirror instance during recording.`;let Ei={map:{},getId(){return console.error(kt),-1},getNode(){return console.error(kt),null},removeNodeFromMap(){console.error(kt)},has(){return console.error(kt),!1},reset(){console.error(kt)}};typeof windowt?(r&&(cy(r),r=null),o=i,e.apply(c,s)):!r&&n.trailing!==!1&&(r=Dr(()=>{o=n.leading===!1?0:Date.now(),r=null,e.apply(c,s)},a))}}function Nc(e,t,n,r,o=window){const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(i){Dr(()=>{n.set.call(this,i)},0),s&&s.set&&s.set.call(this,i)}}),()=>Nc(e,t,s||{},!0)}function is(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}let ur=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(ur=()=>new Date().getTime());function Lc(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 Pc(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Dc(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Fc(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function Ee(e,t,n,r,o){if(!e)return!1;const s=Fc(e);if(!s)return!1;const i=At(t,n);if(!o){const l=r&&s.matches(r);return i(s)&&!l}const a=ct(s,i);let c=-1;return a-1&&c{let n=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function Uc(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function $c(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Eo(e){return!!e?.shadowRoot}class oy{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,n){if(this.has(t))return this.getId(t);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r}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 Hc(e){let t=null;return e.getRootNode?.()?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function sy(e){let t=e,n;for(;n=Hc(t);)t=n;return t}function iy(e){const t=e.ownerDocument;if(!t)return!1;const n=sy(e);return t.contains(n)}function Wc(e){const t=e.ownerDocument;return t?t.contains(e)||iy(e):!1}const vi={};function as(e){const t=vi[e];if(t)return t;const n=window.document;let r=window[e];if(n&&typeof n.createElement=="function")try{const o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);const s=o.contentWindow;s&&s[e]&&(r=s[e]),n.head.removeChild(o)}catch{}return vi[e]=r.bind(window)}function ay(...e){return as("requestAnimationFrame")(...e)}function Dr(...e){return as("setTimeout")(...e)}function cy(...e){return as("clearTimeout")(...e)}var $=(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))($||{}),P=(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))(P||{}),he=(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))(he||{}),Be=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Be||{}),Tt=(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))(Tt||{});function cs(e){try{return e.contentDocument}catch{}}function ly(e){try{return e.contentWindow}catch{}}function wi(e){return"__ln"in e}class uy{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 n=this.head;for(let r=0;r`${e}@${t}`;class dy{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=[],n=new Set,r=new uy,o=c=>{let l=c,d=hn;for(;d===hn;)l=l&&l.nextSibling,d=l&&this.mirror.getId(l);return d},s=c=>{if(!c.parentNode||!Wc(c))return;const l=ln(c.parentNode)?this.mirror.getId(Hc(c)):this.mirror.getId(c.parentNode),d=o(c);if(l===-1||d===-1)return r.addNode(c);const u=Mt(c,{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:f=>{Uc(f,this.mirror)&&!Ee(f,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(f),$c(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),Eo(c)&&this.shadowDomManager.addShadowRoot(c.shadowRoot,this.doc)},onIframeLoad:(f,p)=>{Ee(f,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(this.iframeManager.attachIframe(f,p),f.contentWindow&&this.canvasManager.addWindow(f.contentWindow),this.shadowDomManager.observeAttachShadow(f))},onStylesheetLoad:(f,p)=>{this.stylesheetManager.attachLinkElement(f,p)},onBlockedImageLoad:(f,p,{width:h,height:m})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:p.id,attributes:{style:{width:`${h}px`,height:`${m}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});u&&(t.push({parentId:l,nextId:d,node:u}),n.add(u.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const c of this.movedSet)Ti(this.removes,c,this.mirror)&&!this.movedSet.has(c.parentNode)||s(c);for(const c of this.addedSet)!Ii(this.droppedSet,c)&&!Ti(this.removes,c,this.mirror)||Ii(this.movedSet,c)?s(c):this.droppedSet.add(c);let i=null;for(;r.length;){let c=null;if(i){const l=this.mirror.getId(i.value.parentNode),d=o(i.value);l!==-1&&d!==-1&&(c=i)}if(!c){let l=r.tail;for(;l;){const d=l;if(l=l.previous,d){const u=this.mirror.getId(d.value.parentNode);if(o(d.value)===-1)continue;if(u!==-1){c=d;break}else{const p=d.value;if(p.parentNode&&p.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const h=p.parentNode.host;if(this.mirror.getId(h)!==-1){c=d;break}}}}}}if(!c){for(;r.head;)r.removeNode(r.head.value);break}i=c.previous,r.removeNode(c.value),s(c.value)}const a={texts:this.texts.map(c=>({id:this.mirror.getId(c.node),value:c.value})).filter(c=>!n.has(c.id)).filter(c=>this.mirror.has(c.id)),attributes:this.attributes.map(c=>{const{attributes:l}=c;if(typeof l.style=="string"){const d=JSON.stringify(c.styleDiff),u=JSON.stringify(c._unchangedStyles);d.length!n.has(c.id)).filter(c=>this.mirror.has(c.id)),removes:this.removes,adds:t};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.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(a))},this.processMutation=t=>{if(!Xr(t.target,this.mirror))switch(t.type){case"characterData":{const n=t.target.textContent;!Ee(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:$t(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,Fc(t.target)):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{const n=t.target;let r=t.attributeName,o=t.target.getAttribute(r);if(r==="value"){const i=os(n),a=n.tagName;o=cr(n,a,i);const c=Lr({maskInputOptions:this.maskInputOptions,tagName:a,type:i}),l=$t(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,c);o=pn({isMasked:l,element:n,value:o,maskInputFn:this.maskInputFn})}if(Ee(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||o===t.oldValue)return;let s=this.attributeMap.get(t.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(o))if(!cs(n))r="rr_src";else return;if(s||(s={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(t.target,s)),r==="type"&&n.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!Oc(n.tagName,r)&&(s.attributes[r]=xc(this.doc,Ut(n.tagName),Ut(r),o,n,this.maskAttributeFn),r==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const i=this.unattachedDoc.createElement("span");t.oldValue&&i.setAttribute("style",t.oldValue);for(const a of Array.from(n.style)){const c=n.style.getPropertyValue(a),l=n.style.getPropertyPriority(a);c!==i.style.getPropertyValue(a)||l!==i.style.getPropertyPriority(a)?l===""?s.styleDiff[a]=c:s.styleDiff[a]=[c,l]:s._unchangedStyles[a]=[c,l]}for(const a of Array.from(i.style))n.style.getPropertyValue(a)===""&&(s.styleDiff[a]=!1)}break}case"childList":{if(Ee(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{const r=this.mirror.getId(n),o=ln(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);Ee(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||Xr(n,this.mirror)||!ny(n,this.mirror)||(this.addedSet.has(n)?(vo(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||Bc(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[ki(r,o)]?vo(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:ln(t.target)&&un(t.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(t,n)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Xr(t,this.mirror))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[ki(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Ee(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes&&t.childNodes.forEach(r=>this.genAdds(r)),Eo(t)&&t.shadowRoot.childNodes.forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,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(n=>{this[n]=t[n]})}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 vo(e,t){e.delete(t),t.childNodes?.forEach(n=>vo(e,n))}function Ti(e,t,n){return e.length===0?!1:fy(e,t,n)}function fy(e,t,n){let r=t.parentNode;for(;r;){const o=n.getId(r);if(e.some(s=>s.id===o))return!0;r=r.parentNode}return!1}function Ii(e,t){return e.size===0?!1:jc(e,t)}function jc(e,t){const{parentNode:n}=t;return n?e.has(n)?!0:jc(e,n):!1}let dn;function py(e){dn=e}function hy(){dn=void 0}const z=e=>dn?(...n)=>{try{return e(...n)}catch(r){if(dn&&dn(r)===!0)return()=>{};throw r}}:e,xt=[];function Tn(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 zc(e,t){const n=new dy;xt.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver;const o=window?.Zone?.__symbol__?.("MutationObserver");o&&window[o]&&(r=window[o]);const s=new r(z(i=>{e.onMutation&&e.onMutation(i)===!1||n.processMutations.bind(n)(i)}));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function my({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,s=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let i=[],a;const c=mn(z(u=>{const f=Date.now()-a;e(i.map(p=>(p.timeOffset-=f,p)),u),i=[],a=null}),s),l=z(mn(z(u=>{const f=Tn(u),{clientX:p,clientY:h}=So(u)?u.changedTouches[0]:u;a||(a=ur()),i.push({x:p,y:h,id:r.getId(f),timeOffset:ur()-a}),c(typeof DragEvent{d.forEach(u=>u())})}function gy({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,sampling:i}){if(i.mouseInteraction===!1)return()=>{};const a=i.mouseInteraction===!0||i.mouseInteraction===void 0?{}:i.mouseInteraction,c=[];let l=null;const d=u=>f=>{const p=Tn(f);if(Ee(p,r,o,s,!0))return;let h=null,m=u;if("pointerType"in f){switch(f.pointerType){case"mouse":h=Be.Mouse;break;case"touch":h=Be.Touch;break;case"pen":h=Be.Pen;break}h===Be.Touch?he[u]===he.MouseDown?m="TouchStart":he[u]===he.MouseUp&&(m="TouchEnd"):Be.Pen}else So(f)&&(h=Be.Touch);h!==null?(l=h,(m.startsWith("Touch")&&h===Be.Touch||m.startsWith("Mouse")&&h===Be.Mouse)&&(h=null)):he[u]===he.Click&&(h=l,l=null);const g=So(f)?f.changedTouches[0]:f;if(!g)return;const _=n.getId(p),{clientX:y,clientY:E}=g;z(e)({type:he[m],id:_,x:y,y:E,...h!==null&&{pointerType:h}})};return Object.keys(he).filter(u=>Number.isNaN(Number(u))&&!u.endsWith("_Departed")&&a[u]!==!1).forEach(u=>{let f=Ut(u);const p=d(u);if(window.PointerEvent)switch(he[u]){case he.MouseDown:case he.MouseUp:f=f.replace("mouse","pointer");break;case he.TouchStart:case he.TouchEnd:return}c.push(me(f,p,t))}),z(()=>{c.forEach(u=>u())})}function Gc({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,sampling:i}){const a=z(mn(z(c=>{const l=Tn(c);if(!l||Ee(l,r,o,s,!0))return;const d=n.getId(l);if(l===t&&t.defaultView){const u=Lc(t.defaultView);e({id:d,x:u.left,y:u.top})}else e({id:d,x:l.scrollLeft,y:l.scrollTop})}),i.scroll||100));return me("scroll",a,t)}function _y({viewportResizeCb:e},{win:t}){let n=-1,r=-1;const o=z(mn(z(()=>{const s=Pc(),i=Dc();(n!==s||r!==i)&&(e({width:Number(i),height:Number(s)}),n=s,r=i)}),200));return me("resize",o,t)}const yy=["INPUT","TEXTAREA","SELECT"],Ci=new WeakMap;function by({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,ignoreClass:i,ignoreSelector:a,maskInputOptions:c,maskInputFn:l,sampling:d,userTriggeredOnInput:u,maskTextClass:f,unmaskTextClass:p,maskTextSelector:h,unmaskTextSelector:m}){function g(S){let R=Tn(S);const F=S.isTrusted,v=R&&yo(R.tagName);if(v==="OPTION"&&(R=R.parentElement),!R||!v||yy.indexOf(v){if(A!==R){const X=pn({isMasked:ne,element:A,value:cr(A,v,T),maskInputFn:l});_(A,u?{text:X,isChecked:!W,userTriggered:!1}:{text:X,isChecked:!W})}})}function _(S,R){const F=Ci.get(S);if(!F||F.text!==R.text||F.isChecked!==R.isChecked){Ci.set(S,R);const v=n.getId(S);z(e)({...R,id:v})}}const E=(d.input==="last"?["change"]:["input","change"]).map(S=>me(S,z(g),t)),w=t.defaultView;if(!w)return()=>{E.forEach(S=>S())};const L=w.Object.getOwnPropertyDescriptor(w.HTMLInputElement.prototype,"value"),C=[[w.HTMLInputElement.prototype,"value"],[w.HTMLInputElement.prototype,"checked"],[w.HTMLSelectElement.prototype,"value"],[w.HTMLTextAreaElement.prototype,"value"],[w.HTMLSelectElement.prototype,"selectedIndex"],[w.HTMLOptionElement.prototype,"selected"]];return L&&L.set&&E.push(...C.map(S=>Nc(S[0],S[1],{set(){z(g)({target:this,isTrusted:!1})}},!1,w))),z(()=>{E.forEach(S=>S())})}function dr(e){const t=[];function n(r,o){if(Ln("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Ln("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Ln("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Ln("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const i=Array.from(r.parentRule.cssRules).indexOf(r);o.unshift(i)}else if(r.parentStyleSheet){const i=Array.from(r.parentStyleSheet.cssRules).indexOf(r);o.unshift(i)}return o}return n(e,t)}function Ge(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function Sy({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:z((d,u,f)=>{const[p,h]=f,{id:m,styleId:g}=Ge(u,t,n.styleMirror);return(m&&m!==-1||g&&g!==-1)&&e({id:m,styleId:g,adds:[{rule:p,index:h}]}),d.apply(u,f)})});const s=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(s,{apply:z((d,u,f)=>{const[p]=f,{id:h,styleId:m}=Ge(u,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,removes:[{index:p}]}),d.apply(u,f)})});let i;r.CSSStyleSheet.prototype.replace&&(i=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(i,{apply:z((d,u,f)=>{const[p]=f,{id:h,styleId:m}=Ge(u,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,replace:p}),d.apply(u,f)})}));let a;r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:z((d,u,f)=>{const[p]=f,{id:h,styleId:m}=Ge(u,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,replaceSync:p}),d.apply(u,f)})}));const c={};Pn("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(Pn("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),Pn("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),Pn("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(c).forEach(([d,u])=>{l[d]={insertRule:u.prototype.insertRule,deleteRule:u.prototype.deleteRule},u.prototype.insertRule=new Proxy(l[d].insertRule,{apply:z((f,p,h)=>{const[m,g]=h,{id:_,styleId:y}=Ge(p.parentStyleSheet,t,n.styleMirror);return(_&&_!==-1||y&&y!==-1)&&e({id:_,styleId:y,adds:[{rule:m,index:[...dr(p),g||0]}]}),f.apply(p,h)})}),u.prototype.deleteRule=new Proxy(l[d].deleteRule,{apply:z((f,p,h)=>{const[m]=h,{id:g,styleId:_}=Ge(p.parentStyleSheet,t,n.styleMirror);return(g&&g!==-1||_&&_!==-1)&&e({id:g,styleId:_,removes:[{index:[...dr(p),m]}]}),f.apply(p,h)})})}),z(()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=s,i&&(r.CSSStyleSheet.prototype.replace=i),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(c).forEach(([d,u])=>{u.prototype.insertRule=l[d].insertRule,u.prototype.deleteRule=l[d].deleteRule})})}function qc({mirror:e,stylesheetManager:t},n){let r=null;n.nodeName==="#document"?r=e.getId(n):r=e.getId(n.host);const o=n.nodeName==="#document"?n.defaultView?.Document:n.ownerDocument?.defaultView?.ShadowRoot,s=o?.prototype?Object.getOwnPropertyDescriptor(o?.prototype,"adoptedStyleSheets"):void 0;return r===null||r===-1||!o||!s?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get(){return s.get?.call(this)},set(i){const a=s.set?.call(this,i);if(r!==null&&r!==-1)try{t.adoptStyleSheets(i,r)}catch{}return a}}),z(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get:s.get,set:s.set})}))}function Ey({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){const s=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:z((a,c,l)=>{const[d,u,f]=l;if(n.has(d))return s.apply(c,[d,u,f]);const{id:p,styleId:h}=Ge(c.parentRule?.parentStyleSheet,t,r.styleMirror);return(p&&p!==-1||h&&h!==-1)&&e({id:p,styleId:h,set:{property:d,value:u,priority:f},index:dr(c.parentRule)}),a.apply(c,l)})});const i=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:z((a,c,l)=>{const[d]=l;if(n.has(d))return i.apply(c,[d]);const{id:u,styleId:f}=Ge(c.parentRule?.parentStyleSheet,t,r.styleMirror);return(u&&u!==-1||f&&f!==-1)&&e({id:u,styleId:f,remove:{property:d},index:dr(c.parentRule)}),a.apply(c,l)})}),z(()=>{o.CSSStyleDeclaration.prototype.setProperty=s,o.CSSStyleDeclaration.prototype.removeProperty=i})}function vy({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:o,sampling:s,doc:i}){const a=z(l=>mn(z(d=>{const u=Tn(d);if(!u||Ee(u,t,n,r,!0))return;const{currentTime:f,volume:p,muted:h,playbackRate:m}=u;e({type:l,id:o.getId(u),currentTime:f,volume:p,muted:h,playbackRate:m})}),s.media||500)),c=[me("play",a(Tt.Play),i),me("pause",a(Tt.Pause),i),me("seeked",a(Tt.Seeked),i),me("volumechange",a(Tt.VolumeChange),i),me("ratechange",a(Tt.RateChange),i)];return z(()=>{c.forEach(l=>l())})}function wy({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,s=n.FontFace;n.FontFace=function(c,l,d){const u=new s(c,l,d);return o.set(u,{family:c,buffer:typeof l!="string",descriptors:d,fontSource:typeof l=="string"?l:JSON.stringify(Array.from(new Uint8Array(l)))}),u};const i=is(t.fonts,"add",function(a){return function(c){return Dr(z(()=>{const l=o.get(c);l&&(e(l),o.delete(c))}),0),a.apply(this,[c])}});return r.push(()=>{n.FontFace=s}),r.push(i),z(()=>{r.forEach(a=>a())})}function ky(e){const{doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,selectionCb:i}=e;let a=!0;const c=z(()=>{const l=t.getSelection();if(!l||a&&l?.isCollapsed)return;a=l.isCollapsed||!1;const d=[],u=l.rangeCount||0;for(let f=0;f{}:is(n.customElements,"define",function(o){return function(s,i,a){try{t({define:{name:s}})}catch{}return o.apply(this,[s,i,a])}})}function Iy(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};let r;e.recordDOM&&(r=zc(e,e.doc));const o=my(e),s=gy(e),i=Gc(e),a=_y(e,{win:n}),c=by(e),l=vy(e);let d=()=>{},u=()=>{},f=()=>{},p=()=>{};e.recordDOM&&(d=Sy(e,{win:n}),u=qc(e,e.doc),f=Ey(e,{win:n}),e.collectFonts&&(p=wy(e)));const h=ky(e),m=Ty(e),g=[];for(const _ of e.plugins)g.push(_.observer(_.callback,n,_.options));return z(()=>{xt.forEach(_=>_.reset()),r?.disconnect(),o(),s(),i(),a(),c(),l(),d(),u(),f(),p(),h(),m(),g.forEach(_=>_())})}function Ln(e){return typeof window[e]this.getId(t,s,r,o))}getRemoteId(t,n,r){const o=r||this.getRemoteIdToIdMap(t);if(typeof n!="number")return n;const s=o.get(n);return s||-1}getRemoteIds(t,n){const r=this.getRemoteIdToIdMap(t);return n.map(o=>this.getRemoteId(t,o,r))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let n=this.iframeIdToRemoteIdMap.get(t);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(t,n)),n}getRemoteIdToIdMap(t){let n=this.iframeRemoteIdToIdMap.get(t);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(t,n)),n}}class Cy{constructor(){this.crossOriginIframeMirror=new wo(ss),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class Ry{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new wo(ss),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new wo(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,n){this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&t.contentWindow?.addEventListener("message",this.handleMessage.bind(this)),this.loadListener?.(t);const r=cs(t);r&&r.adoptedStyleSheets&&r.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(r.adoptedStyleSheets,this.mirror.getId(r))}handleMessage(t){const n=t;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!t.source)return;const o=this.crossOriginIframeMap.get(t.source);if(!o)return;const s=this.transformCrossOriginEvent(o,n.data.event);s&&this.wrappedEmit(s,n.data.isCheckout)}transformCrossOriginEvent(t,n){switch(n.type){case $.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(n.data.node,t);const r=n.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(n.data.node,r),{timestamp:n.timestamp,type:$.IncrementalSnapshot,data:{source:P.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case $.Meta:case $.Load:case $.DomContentLoaded:return!1;case $.Plugin:return n;case $.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case $.IncrementalSnapshot:switch(n.data.source){case P.Mutation:return n.data.adds.forEach(r=>{this.replaceIds(r,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,t);const o=this.crossOriginIframeRootIdMap.get(t);o&&this.patchRootIdOnNode(r.node,o)}),n.data.removes.forEach(r=>{this.replaceIds(r,t,["parentId","id"])}),n.data.attributes.forEach(r=>{this.replaceIds(r,t,["id"])}),n.data.texts.forEach(r=>{this.replaceIds(r,t,["id"])}),n;case P.Drag:case P.TouchMove:case P.MouseMove:return n.data.positions.forEach(r=>{this.replaceIds(r,t,["id"])}),n;case P.ViewportResize:return!1;case P.MediaInteraction:case P.MouseInteraction:case P.Scroll:case P.CanvasMutation:case P.Input:return this.replaceIds(n.data,t,["id"]),n;case P.StyleSheetRule:case P.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case P.Font:return n;case P.Selection:return n.data.ranges.forEach(r=>{this.replaceIds(r,t,["start","end"])}),n;case P.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),n.data.styles?.forEach(r=>{this.replaceStyleIds(r,t,["styleId"])}),n}}return!1}replace(t,n,r,o){for(const s of o)!Array.isArray(n[s])&&typeof n[s]!="number"||(Array.isArray(n[s])?n[s]=t.getIds(r,n[s]):n[s]=t.getId(r,n[s]));return n}replaceIds(t,n,r){return this.replace(this.crossOriginIframeMirror,t,n,r)}replaceStyleIds(t,n,r){return this.replace(this.crossOriginIframeStyleMirror,t,n,r)}replaceIdOnNode(t,n){this.replaceIds(t,n,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(t,n){t.type!==le.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class Ay{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class My{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,n){if(!un(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t),this.bypassOptions.canvasManager.addShadowRoot(t);const r=zc({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Gc({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),Dr(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(qc({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){const n=cs(t),r=ly(t);!n||!r||this.patchAttachShadow(r.Element,n)}patchAttachShadow(t,n){const r=this;this.restoreHandlers.push(is(t.prototype,"attachShadow",function(o){return function(s){const i=o.call(this,s);return this.shadowRoot&&Wc(this)&&r.addShadowRoot(this.shadowRoot,n),i}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}}var Ri="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",xy=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Dn=0;Dn({rule:Tc(a),index:c}))})),r.styleIds.push(i)}o.length>0&&(r.styles=o),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Ny{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(t,n){const r=this.nodeMap.get(t);return r&&Array.from(r).some(o=>o!==n)}add(t,n){this.active||(this.active=!0,ay(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}destroy(){}}let ae,fr;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 Ce=x_();function Oe(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:s=null,unblockSelector:i=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,maskAllText:l=!1,maskTextClass:d="rr-mask",unmaskTextClass:u=null,maskTextSelector:f=null,unmaskTextSelector:p=null,inlineStylesheet:h=!0,maskAllInputs:m,maskInputOptions:g,slimDOMOptions:_,maskAttributeFn:y,maskInputFn:E,maskTextFn:w,maxCanvasSize:L=null,packFn:C,sampling:S={},dataURLOptions:R={},mousemoveWait:F,recordDOM:v=!0,recordCanvas:M=!1,recordCrossOriginIframes:T=!1,recordAfter:x=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:W=!1,collectFonts:K=!1,inlineImages:ne=!1,plugins:oe,keepIframeSrcFn:A=()=>!1,ignoreCSSAttributes:X=new Set([]),errorHandler:B,onMutation:se,getCanvasManager:pe}=e;py(B);const ce=T?window.parent===window:!0;let ge=!1;if(!ce)try{window.parent.document&&(ge=!1)}catch{ge=!0}if(ce&&!t)throw new Error("emit function is required");if(!ce&&!ge)return()=>{};F!==void 0&&S.mousemove===void 0&&(S.mousemove=F),Ce.reset();const je=m===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:g!==void 0?g:{},Kt=_===!0||_==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:_==="all",headMetaDescKeywords:_==="all"}:_||{};ry();let Xt,Qt=0;const Cn=I=>{for(const G of oe||[])G.eventProcessor&&(I=G.eventProcessor(I));return C&&!ge&&(I=C(I)),I};ae=(I,G)=>{const D=I;if(D.timestamp=ur(),xt[0]?.isFrozen()&&D.type!==$.FullSnapshot&&!(D.type===$.IncrementalSnapshot&&D.data.source===P.Mutation)&&xt.forEach(q=>q.unfreeze()),ce)t?.(Cn(D),G);else if(ge){const q={type:"rrweb",event:Cn(D),origin:window.location.origin,isCheckout:G};window.parent.postMessage(q,"*")}if(D.type===$.FullSnapshot)Xt=D,Qt=0;else if(D.type===$.IncrementalSnapshot){if(D.data.source===P.Mutation&&D.data.isAttachIframe)return;Qt++;const q=r&&Qt>=r,U=n&&Xt&&D.timestamp-Xt.timestamp>n;(q||U)&&nt(!0)}};const et=I=>{ae({type:$.IncrementalSnapshot,data:{source:P.Mutation,...I}})},Rn=I=>ae({type:$.IncrementalSnapshot,data:{source:P.Scroll,...I}}),Fe=I=>ae({type:$.IncrementalSnapshot,data:{source:P.CanvasMutation,...I}}),we=I=>ae({type:$.IncrementalSnapshot,data:{source:P.AdoptedStyleSheet,...I}}),_e=new Oy({mutationCb:et,adoptedStyleSheetCb:we}),be=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new Cy:new Ry({mirror:Ce,mutationCb:et,stylesheetManager:_e,recordCrossOriginIframes:T,wrappedEmit:ae});for(const I of oe||[])I.getMirror&&I.getMirror({nodeMirror:Ce,crossOriginIframeMirror:be.crossOriginIframeMirror,crossOriginIframeStyleMirror:be.crossOriginIframeStyleMirror});const bt=new Ny,St=Py(pe,{mirror:Ce,win:window,mutationCb:I=>ae({type:$.IncrementalSnapshot,data:{source:P.CanvasMutation,...I}}),recordCanvas:M,blockClass:o,blockSelector:s,unblockSelector:i,maxCanvasSize:L,sampling:S.canvas,dataURLOptions:R,errorHandler:B}),tt=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new Ay:new My({mutationCb:et,scrollCb:Rn,bypassOptions:{onMutation:se,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:l,maskTextClass:d,unmaskTextClass:u,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskInputOptions:je,dataURLOptions:R,maskAttributeFn:y,maskTextFn:w,maskInputFn:E,recordCanvas:M,inlineImages:ne,sampling:S,slimDOMOptions:Kt,iframeManager:be,stylesheetManager:_e,canvasManager:St,keepIframeSrcFn:A,processedNodeManager:bt,ignoreCSSAttributes:X},mirror:Ce}),nt=(I=!1)=>{if(!v)return;ae({type:$.Meta,data:{href:window.location.href,width:Dc(),height:Pc()}},I),_e.reset(),tt.init(),xt.forEach(D=>D.lock());const G=ty(document,{mirror:Ce,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:l,maskTextClass:d,unmaskTextClass:u,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskAllInputs:je,maskAttributeFn:y,maskInputFn:E,maskTextFn:w,slimDOM:Kt,dataURLOptions:R,recordCanvas:M,inlineImages:ne,onSerialize:D=>{Uc(D,Ce)&&be.addIframe(D),$c(D,Ce)&&_e.trackLinkElement(D),Eo(D)&&tt.addShadowRoot(D.shadowRoot,document)},onIframeLoad:(D,q)=>{be.attachIframe(D,q),D.contentWindow&&St.addWindow(D.contentWindow),tt.observeAttachShadow(D)},onStylesheetLoad:(D,q)=>{_e.attachLinkElement(D,q)},onBlockedImageLoad:(D,q,{width:U,height:Ne})=>{et({adds:[],removes:[],texts:[],attributes:[{id:q.id,attributes:{style:{width:`${U}px`,height:`${Ne}px`}}}]})},keepIframeSrcFn:A,ignoreCSSAttributes:X});if(!G)return console.warn("Failed to snapshot the document");ae({type:$.FullSnapshot,data:{node:G,initialOffset:Lc(window)}}),xt.forEach(D=>D.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&_e.adoptStyleSheets(document.adoptedStyleSheets,Ce.getId(document))};fr=nt;try{const I=[],G=q=>z(Iy)({onMutation:se,mutationCb:et,mousemoveCb:(U,Ne)=>ae({type:$.IncrementalSnapshot,data:{source:Ne,positions:U}}),mouseInteractionCb:U=>ae({type:$.IncrementalSnapshot,data:{source:P.MouseInteraction,...U}}),scrollCb:Rn,viewportResizeCb:U=>ae({type:$.IncrementalSnapshot,data:{source:P.ViewportResize,...U}}),inputCb:U=>ae({type:$.IncrementalSnapshot,data:{source:P.Input,...U}}),mediaInteractionCb:U=>ae({type:$.IncrementalSnapshot,data:{source:P.MediaInteraction,...U}}),styleSheetRuleCb:U=>ae({type:$.IncrementalSnapshot,data:{source:P.StyleSheetRule,...U}}),styleDeclarationCb:U=>ae({type:$.IncrementalSnapshot,data:{source:P.StyleDeclaration,...U}}),canvasMutationCb:Fe,fontCb:U=>ae({type:$.IncrementalSnapshot,data:{source:P.Font,...U}}),selectionCb:U=>{ae({type:$.IncrementalSnapshot,data:{source:P.Selection,...U}})},customElementCb:U=>{ae({type:$.IncrementalSnapshot,data:{source:P.CustomElement,...U}})},blockClass:o,ignoreClass:a,ignoreSelector:c,maskAllText:l,maskTextClass:d,unmaskTextClass:u,maskTextSelector:f,unmaskTextSelector:p,maskInputOptions:je,inlineStylesheet:h,sampling:S,recordDOM:v,recordCanvas:M,inlineImages:ne,userTriggeredOnInput:W,collectFonts:K,doc:q,maskAttributeFn:y,maskInputFn:E,maskTextFn:w,keepIframeSrcFn:A,blockSelector:s,unblockSelector:i,slimDOMOptions:Kt,dataURLOptions:R,mirror:Ce,iframeManager:be,stylesheetManager:_e,shadowDomManager:tt,processedNodeManager:bt,canvasManager:St,ignoreCSSAttributes:X,plugins:oe?.filter(U=>U.observer)?.map(U=>({observer:U.observer,options:U.options,callback:Ne=>ae({type:$.Plugin,data:{plugin:U.name,payload:Ne}})}))||[]},{});be.addLoadListener(q=>{try{I.push(G(q.contentDocument))}catch(U){console.warn(U)}});const D=()=>{nt(),I.push(G(document))};return document.readyState==="interactive"||document.readyState==="complete"?D():(I.push(me("DOMContentLoaded",()=>{ae({type:$.DomContentLoaded,data:{}}),x==="DOMContentLoaded"&&D()})),I.push(me("load",()=>{ae({type:$.Load,data:{}}),x==="load"&&D()},window))),()=>{I.forEach(q=>q()),bt.destroy(),fr=void 0,hy()}}catch(I){console.warn(I)}}function Ly(e){if(!fr)throw new Error("please take full snapshot after start recording");fr(e)}Oe.mirror=Ce;Oe.takeFullSnapshot=Ly;function Py(e,t){try{return e?e(t):new Ai}catch{return console.warn("Unable to initialize CanvasManager"),new Ai}}var Mi;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Mi||(Mi={}));const Dy=3,Fy=5;function ls(e){return e>9999999999?e:e*1e3}function Qr(e){return e>9999999999?e/1e3:e}function In(e,t){t.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:$.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:Je(t,10,1e3)}}),t.category==="console")))}const By="button,a";function Vc(e){return e.closest(By)||e}function Jc(e){const t=Yc(e);return!t||!(t instanceof Element)?t:Vc(t)}function Yc(e){return Uy(e)?e.target:e}function Uy(e){return typeof e=="object"&&!!e&&"target"in e}let qe;function $y(e){return qe||(qe=[],Hy()),qe.push(e),()=>{const t=qe?qe.indexOf(e):-1;t>-1&&qe.splice(t,1)}}function Hy(){Qn(Z,"open",function(e){return function(...t){if(qe)try{qe.forEach(n=>n())}catch{}return e.apply(Z,t)}})}const Wy=new Set([P.Mutation,P.StyleSheetRule,P.StyleDeclaration,P.AdoptedStyleSheet,P.CanvasMutation,P.Selection,P.MediaInteraction]);function jy(e,t,n){e.handleClick(t,n)}class zy{constructor(t,n,r=In){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=n.timeout/1e3,this._threshold=n.threshold/1e3,this._scrollTimeout=n.scrollTimeout/1e3,this._replay=t,this._ignoreSelector=n.ignoreSelector,this._addBreadcrumbEvent=r}addListeners(){const t=$y(()=>{this._lastMutation=xi()});this._teardown=()=>{t(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(t,n){if(qy(n,this._ignoreSelector)||!Vy(t))return;const r={timestamp:Qr(t.timestamp),clickBreadcrumb:t,clickCount:0,node:n};this._clicks.some(o=>o.node===r.node&&Math.abs(o.timestamp-r.timestamp){n.clickCount++})}_getClicks(t){return this._clicks.filter(n=>n.node===t)}_checkClicks(){const t=[],n=xi();this._clicks.forEach(r=>{!r.mutationAfter&&this._lastMutation&&(r.mutationAfter=r.timestamp-1&&(this._generateBreadcrumbs(r),this._clicks.splice(o,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(t){const n=this._replay,r=t.scrollAfter&&t.scrollAfter1){const c={type:"default",message:a.message,timestamp:a.timestamp,category:"ui.multiClick",data:{...a.data,url:Z.location.href,route:n.getCurrentRoute(),clickCount:i,metric:!0}};this._addBreadcrumbEvent(n,c)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=yn(()=>this._checkClicks(),1e3)}}const Gy=["A","BUTTON","INPUT"];function qy(e,t){return!!(!Gy.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 Vy(e){return!!(e.data&&typeof e.data.nodeId=="number"&&e.timestamp)}function xi(){return Date.now()/1e3}function Jy(e,t){try{if(!Yy(t))return;const{source:n}=t.data;if(Wy.has(n)&&e.registerMutation(t.timestamp),n===P.Scroll&&e.registerScroll(t.timestamp),Ky(t)){const{type:r,id:o}=t.data,s=Oe.mirror.getNode(o);s instanceof HTMLElement&&r===he.Click&&e.registerClick(s)}}catch{}}function Yy(e){return e.type===Dy}function Ky(e){return e.data.source===P.MouseInteraction}function Le(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var Fr=(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))(Fr||{});const Xy=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function Qy(e){const t={};!e["data-sentry-component"]&&e["data-sentry-element"]&&(e["data-sentry-component"]=e["data-sentry-element"]);for(const n in e)if(Xy.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),t[r]=e[n]}return t}const Zy=e=>t=>{if(!e.isEnabled())return;const n=eb(t);if(!n)return;const r=t.name==="click",o=r?t.event:void 0;r&&e.clickDetector&&o?.target&&!o.altKey&&!o.metaKey&&!o.ctrlKey&&!o.shiftKey&&jy(e.clickDetector,n,Jc(t.event)),In(e,n)};function Kc(e,t){const n=Oe.mirror.getId(e),r=n&&Oe.mirror.getNode(n),o=r&&Oe.mirror.getMeta(r),s=o&&nb(o)?o:null;return{message:t,data:s?{nodeId:n,node:{id:n,tagName:s.tagName,textContent:Array.from(s.childNodes).map(i=>i.type===Fr.Text&&i.textContent).filter(Boolean).map(i=>i.trim()).join(""),attributes:Qy(s.attributes)}}:{}}}function eb(e){const{target:t,message:n}=tb(e);return Le({category:`ui.${e.name}`,...Kc(t,n)})}function tb(e){const t=e.name==="click";let n,r=null;try{r=t?Jc(e.event):Yc(e.event),n=ma(r,{maxStringLength:200})||""}catch{n=""}return{target:r,message:n}}function nb(e){return e.type===Fr.Element}function rb(e,t){if(!e.isEnabled())return;e.updateUserActivity();const n=ob(t);n&&In(e,n)}function ob(e){const{metaKey:t,shiftKey:n,ctrlKey:r,altKey:o,key:s,target:i}=e;if(!i||sb(i)||!s)return null;const a=t||r||o,c=s.length===1;if(!a&&c)return null;const l=ma(i,{maxStringLength:200})||"",d=Kc(i,l);return Le({category:"ui.keyDown",message:l,data:{...d.data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:o,key:s}})}function sb(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable}const ib={resource:db,paint:lb,navigation:ub};function Zr(e,t){return({metric:n})=>{t.replayPerformanceEntries.push(e(n))}}function ab(e){return e.map(cb).filter(Boolean)}function cb(e){const t=ib[e.entryType];return t?t(e):null}function Ht(e){return((Sr()||Z.performance.timeOrigin)+e)/1e3}function lb(e){const{duration:t,entryType:n,name:r,startTime:o}=e,s=Ht(o);return{type:n,name:r,start:s,end:s+t,data:void 0}}function ub(e){const{entryType:t,name:n,decodedBodySize:r,duration:o,domComplete:s,encodedBodySize:i,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,domInteractive:l,loadEventStart:d,loadEventEnd:u,redirectCount:f,startTime:p,transferSize:h,type:m}=e;return o===0?null:{type:`${t}.${m}`,start:Ht(p),end:Ht(s),name:n,data:{size:h,decodedBodySize:r,encodedBodySize:i,duration:o,domInteractive:l,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,loadEventStart:d,loadEventEnd:u,domComplete:s,redirectCount:f}}}function db(e){const{entryType:t,initiatorType:n,name:r,responseEnd:o,startTime:s,decodedBodySize:i,encodedBodySize:a,responseStatus:c,transferSize:l}=e;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${t}.${n}`,start:Ht(s),end:Ht(o),name:r,data:{size:l,statusCode:c,decodedBodySize:i,encodedBodySize:a}}}function fb(e){const t=e.entries[e.entries.length-1],n=t?.element?[t.element]:void 0;return us(e,"largest-contentful-paint",n)}function pb(e){return e.sources!==void 0}function hb(e){const t=[],n=[];for(const r of e.entries)if(pb(r)){const o=[];for(const s of r.sources)if(s.node){n.push(s.node);const i=Oe.mirror.getId(s.node);i&&o.push(i)}t.push({value:r.value,nodeIds:o.length?o:void 0})}return us(e,"cumulative-layout-shift",n,t)}function mb(e){const t=e.entries[e.entries.length-1],n=t?.target?[t.target]:void 0;return us(e,"interaction-to-next-paint",n)}function us(e,t,n,r){const o=e.value,s=e.rating,i=Ht(o);return{type:"web-vital",name:t,start:i,end:i,data:{value:o,size:o,rating:s,nodeIds:n?n.map(a=>Oe.mirror.getId(a)):void 0,attributions:r}}}function gb(e){function t(o){e.performanceEntries.includes(o)||e.performanceEntries.push(o)}function n({entries:o}){o.forEach(t)}const r=[];return["navigation","paint","resource"].forEach(o=>{r.push(la(o,n))}),r.push(Xl(Zr(fb,e)),Ql(Zr(hb,e)),Zl(Zr(mb,e))),()=>{r.forEach(o=>o())}}const O=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,_b='var 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>1|(21845&c)>2|(13107&v)>4|(3855&v)>8|(255&v)>1}var d=function(t,r,e){for(var i=t.length,s=0,a=new n(r);s>f]=l}else for(o=new n(i),s=0;s>15-t[s]);return o},p=new t(288);for(c=0;cn.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>8},_=function(t,n,r){r>8,t[e+2]|=r>>16},x=function(r,e){for(var i=[],s=0;sd&&(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=1e))break;w+=m-(1>=y;w>0;){var M=o[s].s;p[M]=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;h2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-113){for(o(s),--a;a>6;a-=6)o(8304);a>2&&(o(a-3>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var s=0;s4&&!H[s[K-1]];--K);var N,P,Q,R,V=v+5=0&&V15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=w,P=p,Q=y,R=g;for(B=0;B255){_(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>>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>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))>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=(17e3||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;P2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);WQ){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;Pnt&&(nt=et,K=rt)}}}W+=(J=K)-(K=_[J])&32767}if(R){F[q++]=268435456|f[Q]=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>>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>1)),s=0,a=function(t){i[s++]=t},o=0;oi.length){var h=new t(s+8+(e-o>6),a(128|63&f)):f>55295&&f>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{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});';function yb(){const e=new Blob([_b]);return URL.createObjectURL(e)}const Oi=["log","warn","error"],Yn="[Replay] ";function eo(e,t="info"){xo({category:"console",data:{logger:"replay"},level:t,message:`${Yn}${e}`},{level:t})}function bb(){let e=!1,t=!1;const n={exception:()=>{},infoTick:()=>{},setConfig:r=>{e=!!r.captureExceptions,t=!!r.traceInternals}};return O?(Oi.forEach(r=>{n[r]=(...o)=>{b[r](Yn,...o),t&&eo(o.join(""),ro(r))}}),n.exception=(r,...o)=>{o.length&&n.error&&n.error(...o),b.error(Yn,r),e?ee(r,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):t&&eo(r,"error")},n.infoTick=(...r)=>{b.log(Yn,...r),t&&setTimeout(()=>eo(r[0]),0)}):Oi.forEach(r=>{n[r]=()=>{}}),n}const N=bb();class ds extends Error{constructor(){super(`Event buffer exceeded maximum size of ${rs}.`)}}class Xc{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 n=JSON.stringify(t).length;if(this._totalSize+=n,this._totalSize>rs)throw new ds;this.events.push(t)}finish(){return new Promise(t=>{const n=this.events;this.clear(),t(JSON.stringify(n))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){let t=null;for(const{timestamp:n}of this.events)(t===null||n{this._worker.addEventListener("message",({data:r})=>{r.success?t():(O&&N.warn("Received worker message with unsuccessful status",r),n(new Error("Received worker message with unsuccessful status")))},{once:!0}),this._worker.addEventListener("error",r=>{O&&N.warn("Failed to load Replay compression worker",r),n(new Error(`Failed to load Replay compression worker: ${r instanceof ErrorEvent&&r.message?r.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(){O&&N.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,n){const r=this._getAndIncrementId();return new Promise((o,s)=>{this._pending.set(r,{method:t,resolve:o,reject:s});try{this._worker.postMessage({id:r,method:t,arg:n})}catch(i){this._pending.delete(r),s(i)}})}__init(){this._onMessage=({data:t})=>{const n=t;if(typeof n.id!="number")return;const r=this._pending.get(n.id);if(!(!r||r.method!==n.method)){if(this._pending.delete(n.id),!n.success){O&&N.error("Error in compression worker: ",n.response),r.reject(new Error("Error in compression worker"));return}r.resolve(n.response)}}}_getAndIncrementId(){return this._id++}}class Sb{constructor(t){this._worker=new fs(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 n=ls(t.timestamp);(!this._earliestTimestamp||nrs?Promise.reject(new ds):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,t=>{O&&N.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 Eb{constructor(t){this._fallback=new Xc,this._compression=new Sb(t),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=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){O&&N.exception(t,"Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:t,hasCheckout:n,waitForCheckout:r}=this._fallback,o=[];for(const s of t)o.push(this._compression.addEvent(s));this._compression.hasCheckout=n,this._compression.waitForCheckout=r,this._used=this._compression;try{await Promise.all(o),this._fallback.clear()}catch(s){O&&N.exception(s,"Failed to add events when switching buffers.")}}}function vb({useCompression:e,workerUrl:t}){if(e&&window.Worker){const n=wb(t);if(n)return n}return O&&N.log("Using simple buffer"),new Xc}function wb(e){try{const t=e||kb();if(!t)return;O&&N.log(`Using compression worker${e?` from ${e}`:""}`);const n=new Worker(t);return new Eb(n)}catch(t){O&&N.exception(t,"Failed to create compression worker")}}function kb(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?yb():""}function ps(){try{return"sessionStorage"in Z&&!!Z.sessionStorage}catch{return!1}}function Tb(e){Ib(),e.session=void 0}function Ib(){if(ps())try{Z.sessionStorage.removeItem(ts)}catch{}}function Qc(e){return e===void 0?!1:Math.random()e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(O&&N.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function Ob(e,t){try{if(typeof t=="function"&&Mb(e))return t(e)}catch(n){return O&&N.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}function ms(e){return!e.type}function To(e){return e.type==="transaction"}function Nb(e){return e.type==="replay_event"}function Li(e){return e.type==="feedback"}function Lb(e){return(t,n)=>{if(!e.isEnabled()||!ms(t)&&!To(t))return;const r=n.statusCode;if(!(!r||r=300)){if(To(t)){Pb(e,t);return}Db(e,t)}}}function Pb(e,t){const n=e.getContext();t.contexts?.trace?.trace_id&&n.traceIds.size{try{await e.sendBufferedReplayOrFlush()}catch(o){e.handleException(o)}})}function Fb(e){return t=>{!e.isEnabled()||!ms(t)||Bb(e,t)}}function Bb(e,t){const n=t.exception?.values?.[0]?.value;if(typeof n=="string"&&(n.match(/(reactjs\.org\/docs\/error-decoder\.html\?invariant=|react\.dev\/errors\/)(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i))){const r=Le({category:"replay.hydrate-error",data:{url:aa()}});In(e,r)}}function Ub(e){const t=j();t&&t.on("beforeAddBreadcrumb",n=>$b(e,n))}function $b(e,t){if(!e.isEnabled()||!nl(t))return;const n=Hb(t);n&&In(e,n)}function Hb(e){return!nl(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui.")?null:e.category==="console"?Wb(e):Le(e)}function Wb(e){const t=e.data?.arguments;if(!Array.isArray(t)||t.length===0)return Le(e);let n=!1;const r=t.map(o=>{if(!o)return o;if(typeof o=="string")return o.length>Nn?(n=!0,`${o.slice(0,Nn)}…`):o;if(typeof o=="object")try{const s=Je(o,7);return JSON.stringify(s).length>Nn?(n=!0,`${JSON.stringify(s,null,2).slice(0,Nn)}…`):s}catch{}return o});return Le({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function nl(e){return!!e.category}function jb(e,t){return e.type||!e.exception?.values?.length?!1:!!t.originalException?.__rrweb__}function hr(){const e=Ie().getPropagationContext().dsc;e&&delete e.replay_id;const t=Qe();if(t){const n=Lo(t);delete n.replay_id}}function zb(e){const t=Ie().getPropagationContext().dsc;t&&(t.replay_id=e);const n=Qe();if(n){const r=Lo(n);r.replay_id=e}}function Gb(e,t){e.triggerUserActivity(),e.addUpdate(()=>t.timestamp?(e.throttledAddEvent({type:$.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 qb(e,t){return e.recordingMode!=="buffer"||t.message===ns||!t.exception||t.type?!1:Qc(e.getOptions().errorSampleRate)}function Vb(e){return Object.assign((t,n)=>{if(e.session&&pr(e.session,{maxReplayDuration:e.getOptions().maxReplayDuration,sessionIdleExpire:e.timeouts.sessionIdleExpire})&&hr(),!e.isEnabled()||e.isPaused())return t;if(Nb(t))return delete t.breadcrumbs,t;if(!ms(t)&&!To(t)&&!Li(t))return t;if(!e.checkAndHandleExpiredSession())return hr(),t;if(Li(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),Gb(e,t),t;if(jb(t,n)&&!e.getOptions()._experiments.captureExceptions)return O&&N.log("Ignoring error from rrweb internals",t),null;const o=qb(e,t);if((o||e.recordingMode==="session")&&(t.tags={...t.tags,replayId:e.getSessionId()}),o&&e.recordingMode==="buffer"&&e.session?.sampled==="buffer"){const i=e.session;i.dirty=!0,e.getOptions().stickySession&&Br(i)}return t},{id:"Replay"})}function Ur(e,t){return t.map(({type:n,start:r,end:o,name:s,data:i})=>{const a=e.throttledAddEvent({type:$.Custom,timestamp:r,data:{tag:"performanceSpan",payload:{op:n,description:s,startTimestamp:r,endTimestamp:o,data:i}}});return typeof a=="string"?Promise.resolve(null):a})}function Jb(e){const{from:t,to:n}=e,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:t}}}function Yb(e){return t=>{if(!e.isEnabled())return;const n=Jb(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(Ur(e,[n]),!1)))}}function Kb(e,t){return O&&e.getOptions()._experiments.traceInternals?!1:Sa(t,j())}function rl(e,t){e.isEnabled()&&t!==null&&(Kb(e,t.name)||e.addUpdate(()=>(Ur(e,[t]),!0)))}function $r(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 n=ou(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function ol(e){if(!e)return;const t=parseInt(e,10);return isNaN(t)?void 0:t}function mr(e,t){if(!e)return{headers:{},size:void 0,_meta:{warnings:[t]}};const n={...e._meta},r=n.warnings||[];return n.warnings=[...r,t],e._meta=n,e}function sl(e,t){if(!t)return null;const{startTimestamp:n,endTimestamp:r,url:o,method:s,statusCode:i,request:a,response:c}=t;return{type:e,start:n/1e3,end:r/1e3,name:o,data:{method:s,statusCode:i,request:a,response:c}}}function gn(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function Ke(e,t,n){if(!t&&Object.keys(e).length===0)return;if(!t)return{headers:e};if(!n)return{headers:e,size:t};const r={headers:e,size:t},{body:o,warnings:s}=Xb(n);return r.body=o,s?.length&&(r._meta={warnings:s}),r}function Io(e,t){return Object.entries(e).reduce((n,[r,o])=>{const s=r.toLowerCase();return t.includes(s)&&e[r]&&(n[s]=o),n},{})}function Xb(e){if(!e||typeof e!="string")return{body:e};const t=e.length>hi,n=Qb(e);if(t){const r=e.slice(0,hi);return n?{body:r,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${r}…`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(e)}}catch{}return{body:e}}function Qb(e){const t=e[0],n=e[e.length-1];return t==="["&&n==="]"||t==="{"&&n==="}"}function gr(e,t){const n=Zb(e);return Fo(n,t)}function Zb(e,t=Z.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(Z.location.origin))return e;const n=new URL(e,t);if(n.origin!==new URL(t).origin)return e;const r=n.href;return!e.endsWith("/")&&r.endsWith("/")?r.slice(0,-1):r}async function eS(e,t,n){try{const r=await nS(e,t,n),o=sl("resource.fetch",r);rl(n.replay,o)}catch(r){O&&N.exception(r,"Failed to capture fetch breadcrumb")}}function tS(e,t){const{input:n,response:r}=t,o=n?Bo(n):void 0,s=$r(o),i=r?ol(r.headers.get("content-length")):void 0;s!==void 0&&(e.data.request_body_size=s),i!==void 0&&(e.data.response_body_size=i)}async function nS(e,t,n){const r=Date.now(),{startTimestamp:o=r,endTimestamp:s=r}=t,{url:i,method:a,status_code:c=0,request_body_size:l,response_body_size:d}=e.data,u=gr(i,n.networkDetailAllowUrls)&&!gr(i,n.networkDetailDenyUrls),f=u?rS(n,t.input,l):gn(l),p=await oS(u,n,t.response,d);return{startTimestamp:o,endTimestamp:s,url:i,method:a,statusCode:c,request:f,response:p}}function rS({networkCaptureBodies:e,networkRequestHeaders:t},n,r){const o=n?aS(n,t):{};if(!e)return Ke(o,r,void 0);const s=Bo(n),[i,a]=tr(s,N),c=Ke(o,r,i);return a?mr(c,a):c}async function oS(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,o){if(!e&&o!==void 0)return gn(o);const s=r?il(r.headers,n):{};if(!r||!t&&o!==void 0)return Ke(s,o,void 0);const[i,a]=await iS(r),c=sS(i,{networkCaptureBodies:t,responseBodySize:o,captureDetails:e,headers:s});return a?mr(c,a):c}function sS(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:o}){try{const s=e?.length&&n===void 0?$r(e):n;return r?t?Ke(o,s,e):Ke(o,s,void 0):gn(s)}catch(s){return O&&N.exception(s,"Failed to serialize response body"),Ke(o,n,void 0)}}async function iS(e){const t=cS(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[await lS(t)]}catch(n){return n instanceof Error&&n.message.indexOf("Timeout")>-1?(O&&N.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(O&&N.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}function il(e,t){const n={};return t.forEach(r=>{e.get(r)&&(n[r]=e.get(r))}),n}function aS(e,t){return e.length===1&&typeof e[0]!="string"?Pi(e[0],t):e.length===2?Pi(e[1],t):{}}function Pi(e,t){if(!e)return{};const n=e.headers;return n?n instanceof Headers?il(n,t):Array.isArray(n)?{}:Io(n,t):{}}function cS(e){try{return e.clone()}catch(t){O&&N.exception(t,"Failed to clone response body")}}function lS(e){return new Promise((t,n)=>{const r=yn(()=>n(new Error("Timeout while trying to read response body")),500);uS(e).then(o=>t(o),o=>n(o)).finally(()=>clearTimeout(r))})}async function uS(e){return await e.text()}async function dS(e,t,n){try{const r=pS(e,t,n),o=sl("resource.xhr",r);rl(n.replay,o)}catch(r){O&&N.exception(r,"Failed to capture xhr breadcrumb")}}function fS(e,t){const{xhr:n,input:r}=t;if(!n)return;const o=$r(r),s=n.getResponseHeader("content-length")?ol(n.getResponseHeader("content-length")):gS(n.response,n.responseType);o!==void 0&&(e.data.request_body_size=o),s!==void 0&&(e.data.response_body_size=s)}function pS(e,t,n){const r=Date.now(),{startTimestamp:o=r,endTimestamp:s=r,input:i,xhr:a}=t,{url:c,method:l,status_code:d=0,request_body_size:u,response_body_size:f}=e.data;if(!c)return null;if(!a||!gr(c,n.networkDetailAllowUrls)||gr(c,n.networkDetailDenyUrls)){const C=gn(u),S=gn(f);return{startTimestamp:o,endTimestamp:s,url:c,method:l,statusCode:d,request:C,response:S}}const p=a[Do],h=p?Io(p.request_headers,n.networkRequestHeaders):{},m=Io(su(a),n.networkResponseHeaders),[g,_]=n.networkCaptureBodies?tr(i,N):[void 0],[y,E]=n.networkCaptureBodies?hS(a):[void 0],w=Ke(h,u,g),L=Ke(m,f,y);return{startTimestamp:o,endTimestamp:s,url:c,method:l,statusCode:d,request:_?mr(w,_):w,response:E?mr(L,E):L}}function hS(e){const t=[];try{return[e.responseText]}catch(n){t.push(n)}try{return mS(e.response,e.responseType)}catch(n){t.push(n)}return O&&N.warn("Failed to get xhr response body",...t),[void 0]}function mS(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(n){return O&&N.exception(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return O&&N.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function gS(e,t){try{const n=t==="json"&&e&&typeof e=="object"?JSON.stringify(e):e;return $r(n)}catch{return}}function _S(e){const t=j();try{const{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:o,networkRequestHeaders:s,networkResponseHeaders:i}=e.getOptions(),a={replay:e,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:o,networkRequestHeaders:s,networkResponseHeaders:i};t&&t.on("beforeAddBreadcrumb",(c,l)=>yS(a,c,l))}catch{}}function yS(e,t,n){if(t.data)try{bS(t)&&ES(n)&&(fS(t,n),dS(t,n,e)),SS(t)&&vS(n)&&(tS(t,n),eS(t,n,e))}catch(r){O&&N.exception(r,"Error when enriching network breadcrumb")}}function bS(e){return e.category==="xhr"}function SS(e){return e.category==="fetch"}function ES(e){return e?.xhr}function vS(e){return e?.response}function wS(e){const t=j();Yl(Zy(e)),Kl(Yb(e)),Ub(e),_S(e);const n=Vb(e);pa(n),t&&(t.on("beforeSendEvent",Fb(e)),t.on("afterSendEvent",Lb(e)),t.on("createDsc",r=>{const o=e.getSessionId();o&&e.isEnabled()&&e.recordingMode==="session"&&e.checkAndHandleExpiredSession()&&(r.replay_id=o)}),t.on("spanStart",r=>{e.lastActiveSpan=r}),t.on("spanEnd",r=>{e.lastActiveSpan=r}),t.on("beforeSendFeedback",async(r,o)=>{const s=e.getSessionId();o?.includeReplay&&e.isEnabled()&&s&&r.contexts?.feedback&&(r.contexts.feedback.source==="api"&&await e.sendBufferedReplayOrFlush(),r.contexts.feedback.replay_id=s)}),t.on("openFeedbackWidget",async()=>{await e.sendBufferedReplayOrFlush()}))}async function kS(e){try{return Promise.all(Ur(e,[TS(Z.performance.memory)]))}catch{return[]}}function TS(e){const{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,o=Date.now()/1e3;return{type:"memory",name:"memory",start:o,end:o,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}function IS(e,t,n){return Fd(e,t,{...n,setTimeoutImpl:yn})}const Fn=ue.navigator;function CS(){return/iPhone|iPad|iPod/i.test(Fn?.userAgent??"")||/Macintosh/i.test(Fn?.userAgent??"")&&Fn?.maxTouchPoints&&Fn?.maxTouchPoints>1?{sampling:{mousemove:!1}}:{}}function RS(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession()){O&&N.warn("Received replay event after session expired.");return}const o=r||!t;t=!0,AS(n),e.clickDetector&&Jy(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode==="buffer"&&o&&e.setInitialState(),!hs(e,n,o))return!0;if(!o)return!1;const s=e.session;if(xS(e,o),e.recordingMode==="buffer"&&s&&e.eventBuffer&&!s.dirty){const i=e.eventBuffer.getEarliestTimestamp();i&&(O&&N.log(`Updating session start time to earliest event in buffer to ${new Date(i)}`),s.started=i,e.getOptions().stickySession&&Br(s))}return s?.previousSessionId||e.recordingMode==="session"&&e.flush(),!0})}}function AS(e){const t=e.data;if(!(e.type!==$.IncrementalSnapshot||!t||typeof t!="object"||!("source"in t)||t.source!==P.Mutation||!("attributes"in t)||!Array.isArray(t.attributes)))for(const n of t.attributes){const r=Oe.mirror.getNode(n.id),o=r&&Oe.mirror.getMeta(r);if(o?.type===Fr.Element)for(const[s,i]of Object.entries(n.attributes))i===null?delete o.attributes[s]:o.attributes[s]=i}}function MS(e){const t=e.getOptions();return{type:$.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 xS(e,t){!t||e.session?.segmentId!==0||hs(e,MS(e),!1)}function OS(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function NS(e,t,n,r){return _n(ru(e,Oo(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:typeof t=="string"?new TextEncoder().encode(t).length:t.length},t]])}function LS({recordingData:e,headers:t}){let n;const r=`${JSON.stringify(t)} `;if(typeof e=="string")n=`${r}${e}`;else{const s=new TextEncoder().encode(r);n=new Uint8Array(s.length+e.length),n.set(s),n.set(e,s.length)}return n}async function PS({client:e,scope:t,replayId:n,event:r}){const o=typeof e._integrations=="object"&&e._integrations!==null&&!Array.isArray(e._integrations)?Object.keys(e._integrations):void 0,s={event_id:n,integrations:o};e.emit("preprocessEvent",r,s);const i=await nu(e.getOptions(),r,s,t,e,Po());if(!i)return null;e.emit("postprocessEvent",i,s),i.platform=i.platform||"javascript";const a=e.getSdkMetadata(),{name:c,version:l,settings:d}=a?.sdk||{};return i.sdk={...i.sdk,name:c||"sentry.javascript.unknown",version:l||"0.0.0",settings:d},i}async function DS({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:o,session:s}){const i=LS({recordingData:e,headers:{segment_id:n}}),{urls:a,errorIds:c,traceIds:l,initialTimestamp:d}=r,u=j(),f=Ie(),p=u?.getTransport(),h=u?.getDsn();if(!u||!p||!h||!s.sampled)return Promise.resolve({});const m={type:u_,replay_start_timestamp:d/1e3,timestamp:o/1e3,error_ids:c,trace_ids:l,urls:a,replay_id:t,segment_id:n,replay_type:s.sampled},g=await PS({scope:f,client:u,replayId:t,event:m});if(!g)return u.recordDroppedEvent("event_processor","replay"),O&&N.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete g.sdkProcessingMetadata;const _=NS(g,i,h,u.getOptions().tunnel);let y;try{y=await p.send(_)}catch(w){const L=new Error(ns);try{L.cause=w}catch{}throw L}const E=eu({},y);if(tu(E,"replay"))throw new gs(E);if(typeof y.statusCode=="number"&&(y.statusCode=300))throw new al(y.statusCode);return y}class al extends Error{constructor(t){super(`Transport returned status code ${t}`)}}class gs extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}}class Di extends Error{constructor(){super("Session is too long, not sending replay")}}async function cl(e,t={count:0,interval:g_}){const{recordingData:n,onError:r}=e;if(n.length)try{return await DS(e),!0}catch(o){if(o instanceof al||o instanceof gs)throw o;if(ha("Replays",{_retryCount:t.count}),r&&r(o),t.count>=__){const s=new Error(`${ns} - max retries exceeded`);try{s.cause=o}catch{}throw s}return t.interval*=++t.count,new Promise((s,i)=>{yn(async()=>{try{await cl(e,t),s(!0)}catch(a){i(a)}},t.interval)})}}const ll="__THROTTLED",FS="__SKIPPED";function BS(e,t,n){const r=new Map,o=a=>{const c=a-n;r.forEach((l,d)=>{d[...r.values()].reduce((a,c)=>a+c,0);let i=!1;return(...a)=>{const c=Math.floor(Date.now()/1e3);if(o(c),s()>=t){const d=i;return i=!0,d?FS:ll}i=!1;const l=r.get(c)||0;return r.set(c,l+1),e(...a)}}class US{constructor({options:t,recordingOptions:n}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:d_,sessionIdleExpire:f_},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=n,this._options=t,this._debouncedFlush=IS(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=BS((i,a)=>xb(this,i,a),300,5);const{slowClickTimeout:r,slowClickIgnoreSelectors:o}=this.getOptions(),s=r?{threshold:Math.min(y_,r),timeout:r,scrollTimeout:b_,ignoreSelector:o?o.join(","):""}:void 0;if(s&&(this.clickDetector=new zy(this,s)),O){const i=t._experiments;N.setConfig({captureExceptions:!!i.captureExceptions,traceInternals:!!i.traceInternals})}this._handleVisibilityChange=()=>{Z.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{const i=Le({category:"ui.blur"});this._doChangeToBackgroundTasks(i)},this._handleWindowFocus=()=>{const i=Le({category:"ui.focus"});this._doChangeToForegroundTasks(i)},this._handleKeyboardEvent=i=>{rb(this,i)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(t){O&&N.exception(t),this._options.onError&&this._options.onError(t)}initializeSampling(t){const{errorSampleRate:n,sessionSampleRate:r}=this._options,o=n!hs(this,{type:Fy,timestamp:o.timestamp||0,data:{tag:"breadcrumb",payload:o,metric:!0}}))}return r}getCurrentRoute(){const t=this.lastActiveSpan||Qe(),n=t&&Nt(t),o=(n&&Re(n).data||{})[fa];if(!(!n||!o||!["route","custom"].includes(o)))return Re(n).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=vb({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.session&&j()?.emit("replayStart",{sessionId:this.session.id,recordingMode:this.recordingMode}),this.startRecording(),this.recordingMode==="session"&&this.session&&zb(this.session.id)}_initializeSessionForSampling(t){const n=this._options.errorSampleRate>0,r=to({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,previousSessionId:t},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:n});this.session=r}_checkSession(){if(!this.session)return!1;const t=this.session;return pr(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{Z.document.addEventListener("visibilitychange",this._handleVisibilityChange),Z.addEventListener("blur",this._handleWindowBlur),Z.addEventListener("focus",this._handleWindowFocus),Z.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(wS(this),this._hasInitializedCoreListeners=!0)}catch(t){this.handleException(t)}this._performanceCleanupCallback=gb(this)}_removeListeners(){try{Z.document.removeEventListener("visibilitychange",this._handleVisibilityChange),Z.removeEventListener("blur",this._handleWindowBlur),Z.removeEventListener("focus",this._handleWindowFocus),Z.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(pr(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})){hr();return}t&&this._createCustomBreadcrumb(t),this.conditionalFlush()}_doChangeToForegroundTasks(t){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){O&&N.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:$.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})})}_addPerformanceEntries(){let t=ab(this.performanceEntries).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){const n=this._context.initialTimestamp/1e3;t=t.filter(r=>r.start>=n)}return Promise.all(Ur(this,t))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:t,eventBuffer:n}=this;if(!t||!n||this._requiresManualStart||t.segmentId)return;const r=n.getEarliestTimestamp();r&&rthis._options.maxReplayDuration+3e4)throw new Di;const r=this._popEventContext(),o=this.session.segmentId++;this._maybeSaveSession();const s=await this.eventBuffer.finish();await cl({replayId:t,recordingData:s,segmentId:o,eventContext:r,session:this.session,timestamp:n,onError:i=>this.handleException(i)})}catch(n){this.handleException(n),this.stop({reason:"sendError"});const r=j();if(r){let o;n instanceof gs?o="ratelimit_backoff":n instanceof Di?o="invalid":o="send_error",r.recordDroppedEvent(o,"replay")}}}async _flush({force:t=!1}={}){if(!this._isEnabled&&!t)return;if(!this.checkAndHandleExpiredSession()){O&&N.error("Attempting to finish replay event after session expired.");return}if(!this.session)return;const n=this.session.started,o=Date.now()-n;this._debouncedFlush.cancel();const s=othis._options.maxReplayDuration+5e3;if(s||i){O&&N.log(`Session duration (${Math.floor(o/1e3)}s) is too ${s?"short":"long"}, not sending replay.`),s&&this._debouncedFlush();return}const a=this.eventBuffer;a&&this.session.segmentId===0&&!a.hasCheckout&&O&&N.log("Flushing initial segment without checkout.");const c=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(l){this.handleException(l)}finally{this._flushLock=void 0,c&&this._debouncedFlush()}}_maybeSaveSession(){this.session&&this._options.stickySession&&Br(this.session)}_onMutationHandler(t){const{ignoreMutations:n}=this._options._experiments;if(n?.length&&t.some(a=>{const c=OS(a.target),l=n.join(",");return c?.matches(l)}))return!1;const r=t.length,o=this._options.mutationLimit,s=this._options.mutationBreadcrumbLimit,i=o&&r>o;if(r>s||i){const a=Le({category:"replay.mutations",data:{count:r,limit:i}});this._createCustomBreadcrumb(a)}return i?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}}function tn(e,t){return[...e,...t].join(",")}function $S({mask:e,unmask:t,block:n,unblock:r,ignore:o}){const s=["base","iframe[srcdoc]:not([src])"],i=tn(e,[".sentry-mask","[data-sentry-mask]"]),a=tn(t,[]);return{maskTextSelector:i,unmaskTextSelector:a,blockSelector:tn(n,[".sentry-block","[data-sentry-block]",...s]),unblockSelector:tn(r,[]),ignoreSelector:tn(o,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function HS({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:o,value:s}){if(o.unmaskTextSelector&&e.matches(o.unmaskTextSelector))return s;const i=n.includes(t),a=r&&t==="value"&&e.tagName==="INPUT"&&["submit","button"].includes(e.getAttribute("type")||"");return i||a?s.replace(/[\S]/g,"*"):s}const Fi='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',WS=["content-length","content-type","accept"],jS=Symbol.for("sentry__originalRequestBody");let Bi=!1,Ui=!1;function zS(){if(typeof Request>"u"||Ui)return;const e=Request;try{const t=function(n,r){const o=new e(n,r);return r?.body!=null&&(o[jS]=r.body),o};t.prototype=e.prototype,ue.Request=t,Ui=!0}catch{}}const GS=(e=>new qS(e));class qS{constructor({flushMinDelay:t=p_,flushMaxDelay:n=h_,minReplayDuration:r=S_,maxReplayDuration:o=mi,stickySession:s=!0,useCompression:i=!0,workerUrl:a,_experiments:c={},maskAllText:l=!0,maskAllInputs:d=!0,blockAllMedia:u=!0,mutationBreadcrumbLimit:f=750,mutationLimit:p=1e4,slowClickTimeout:h=7e3,slowClickIgnoreSelectors:m=[],networkDetailAllowUrls:g=[],networkDetailDenyUrls:_=[],networkCaptureBodies:y=!0,networkRequestHeaders:E=[],networkResponseHeaders:w=[],mask:L=[],maskAttributes:C=["title","placeholder","aria-label"],unmask:S=[],block:R=[],unblock:F=[],ignore:v=[],maskFn:M,beforeAddRecordingEvent:T,beforeErrorSampling:x,onError:W,attachRawBodyFromRequest:K=!1}={}){this.name="Replay";const ne=$S({mask:L,unmask:S,block:R,unblock:F,ignore:v});if(this._recordingOptions={maskAllInputs:d,maskAllText:l,maskInputOptions:{password:!0},maskTextFn:M,maskInputFn:M,maskAttributeFn:(oe,A,X)=>HS({maskAttributes:C,maskAllText:l,privacyOptions:ne,key:oe,value:A,el:X}),...ne,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:oe=>{try{oe.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!c.recordCrossOriginIframes},this._initialOptions={flushMinDelay:t,flushMaxDelay:n,minReplayDuration:Math.min(r,E_),maxReplayDuration:Math.min(o,mi),stickySession:s,useCompression:i,workerUrl:a,blockAllMedia:u,maskAllInputs:d,maskAllText:l,mutationBreadcrumbLimit:f,mutationLimit:p,slowClickTimeout:h,slowClickIgnoreSelectors:m,networkDetailAllowUrls:g,networkDetailDenyUrls:_,networkCaptureBodies:y,networkRequestHeaders:$i(E),networkResponseHeaders:$i(w),beforeAddRecordingEvent:T,beforeErrorSampling:x,onError:W,attachRawBodyFromRequest:K,_experiments:c},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${Fi}`:Fi,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&er())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return Bi}set _isInitialized(t){Bi=t}afterAllSetup(t){!er()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&zS(),this._setup(t),this._initialize(t))}start(){this._replay&&this._replay.start()}startBuffering(){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}_initialize(t){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(t),this._replay.initializeSampling())}_setup(t){const n=VS(this._initialOptions,t);this._replay=new US({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(t){try{const n=t.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}}function VS(e,t){const n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...e},o=Ts(n.replaysSessionSampleRate),s=Ts(n.replaysOnErrorSampleRate);return o==null&&s==null&&Jl(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),o!=null&&(r.sessionSampleRate=o),s!=null&&(r.errorSampleRate=s),r}function $i(e){return[...WS,...e.map(t=>t.toLowerCase())]}function JS(){return j()?.getIntegrationByName("Replay")}var YS=Object.defineProperty,KS=(e,t,n)=>t in e?YS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Hi=(e,t,n)=>KS(e,typeof t!="symbol"?t+"":t,n);class XS{constructor(){Hi(this,"idNodeMap",new Map),Hi(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 n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){const r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){const r=this.getNode(t);if(r){const o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(n,o)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function QS(){return new XS}function ZS(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}function Co(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:Co(e.parentNode,t,n,r+1)}function Wi(e,t){return n=>{const r=n;if(r===null)return!1;try{if(e){if(typeof e=="string"){if(r.matches(`.${e}`))return!0}else if(ZS(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}const It=`Please stop import mirror directly. Instead of that,\r now you can use replayer.getMirror() to access the mirror instance of a replayer,\r or you can use record.mirror to access the mirror instance during recording.`;let ji={map:{},getId(){return console.error(It),-1},getNode(){return console.error(It),null},removeNodeFromMap(){console.error(It)},has(){return console.error(It),!1},reset(){console.error(It)}};typeof window{n.set.call(this,i)},0),s&&s.set&&s.set.call(this,i)}}),()=>_s(e,t,s||{},!0)}function ys(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}Date.now().toString();function eE(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function Hr(e,t,n,r,o){if(!e)return!1;const s=eE(e);if(!s)return!1;const i=Wi(t,n),a=Co(s,i);let c=-1;return a-1&&c(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Wt||{});let Kn;function tE(e){Kn=e}const no=e=>Kn?(...n)=>{try{return e(...n)}catch(r){if(Kn&&Kn(r)===!0)return()=>{};throw r}}:e;var Ot="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",nE=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Bn=0;Bn>2],o+=Ot[(t[n]&3)>4],o+=Ot[(t[n+1]&15)>6],o+=Ot[t[n+2]&63];return r%3===2?o=o.substring(0,o.length-1)+"=":r%3===1&&(o=o.substring(0,o.length-2)+"=="),o};const Gi=new Map;function oE(e,t){let n=Gi.get(e);return n||(n=new Map,Gi.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}const fl=(e,t,n)=>{if(!e||!(hl(e,t)||typeof e=="object"))return;const r=e.constructor.name,o=oE(n,r);let s=o.indexOf(e);return s===-1&&(s=o.length,o.push(e)),s};function Xn(e,t,n){if(e instanceof Array)return e.map(r=>Xn(r,t,n));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){const r=e.constructor.name,o=rE(e);return{rr_type:r,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Xn(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const r=e.constructor.name,{src:o}=e;return{rr_type:r,src:o}}else if(e instanceof HTMLCanvasElement){const r="HTMLImageElement",o=e.toDataURL();return{rr_type:r,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Xn(e.data,t,n),e.width,e.height]};if(hl(e,t)||typeof e=="object"){const r=e.constructor.name,o=fl(e,t,n);return{rr_type:r,index:o}}}}return e}const pl=(e,t,n)=>e.map(r=>Xn(r,t,n)),hl=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(o=>typeof t[o]=="function").find(o=>e instanceof t[o]);function sE(e,t,n,r,o){const s=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of i)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;const c=ys(t.CanvasRenderingContext2D.prototype,a,function(l){return function(...d){return Hr(this.canvas,n,r,o,!0)||dl(()=>{const u=pl(d,t,this);e(this.canvas,{type:Wt["2D"],property:a,args:u})},0),l.apply(this,d)}});s.push(c)}catch{const c=_s(t.CanvasRenderingContext2D.prototype,a,{set(l){e(this.canvas,{type:Wt["2D"],property:a,args:[l],setter:!0})}});s.push(c)}return()=>{s.forEach(a=>a())}}function iE(e){return e==="experimental-webgl"?"webgl":e}function qi(e,t,n,r,o){const s=[];try{const i=ys(e.HTMLCanvasElement.prototype,"getContext",function(a){return function(c,...l){if(!Hr(this,t,n,r,!0)){const d=iE(c);if("__context"in this||(this.__context=d),o&&["webgl","webgl2"].includes(d))if(l[0]&&typeof l[0]=="object"){const u=l[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return a.apply(this,[c,...l])}});s.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(i=>i())}}function Vi(e,t,n,r,o,s,i,a){const c=[],l=Object.getOwnPropertyNames(e);for(const d of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(d))try{if(typeof e[d]!="function")continue;const u=ys(e,d,function(f){return function(...p){const h=f.apply(this,p);if(fl(h,a,this),"tagName"in this.canvas&&!Hr(this.canvas,r,o,s,!0)){const m=pl(p,a,this),g={type:t,property:d,args:m};n(this.canvas,g)}return h}});c.push(u)}catch{const u=_s(e,d,{set(f){n(this.canvas,{type:t,property:d,args:[f],setter:!0})}});c.push(u)}return c}function aE(e,t,n,r,o,s){const i=[];return i.push(...Vi(t.WebGLRenderingContext.prototype,Wt.WebGL,e,n,r,o,s,t)),typeof t.WebGL2RenderingContext{i.forEach(a=>a())}}const cE='for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="undefined"==typeof Uint8Array?[]:new Uint8Array(256),a=0;a>2],s+=e[(3&n[a])>4],s+=e[(15&n[a+1])>6],s+=e[63&n[a+2]];return r%3==2?s=s.substring(0,s.length-1)+"=":r%3==1&&(s=s.substring(0,s.length-2)+"=="),s};const r=new Map,s=new Map;const i=self;i.onmessage=async function(e){if(!("OffscreenCanvas"in globalThis))return i.postMessage({id:e.data.id});{const{id:t,bitmap:a,width:o,height:f,maxCanvasSize:c,dataURLOptions:g}=e.data,u=async function(e,t,a){const r=e+"-"+t;if("OffscreenCanvas"in globalThis){if(s.has(r))return s.get(r);const i=new OffscreenCanvas(e,t);i.getContext("2d");const o=await i.convertToBlob(a),f=await o.arrayBuffer(),c=n(f);return s.set(r,c),c}return""}(o,f,g),[h,d]=function(e,t,a){if(!a)return[e,t];const[n,r]=a;if(en&&(i=Math.floor(n*t/e),s=n),i>r&&(s=Math.floor(r*e/t),i=r),[s,i]}(o,f,c),l=new OffscreenCanvas(h,d),w=l.getContext("bitmaprenderer"),p=h===o&&d===f?a:await createImageBitmap(a,{resizeWidth:h,resizeHeight:d,resizeQuality:"low"});w?.transferFromImageBitmap(p),a.close();const y=await l.convertToBlob(g),v=y.type,b=await y.arrayBuffer(),m=n(b);if(p.close(),!r.has(t)&&await u===m)return r.set(t,m),i.postMessage({id:t});if(r.get(t)===m)return i.postMessage({id:t});i.postMessage({id:t,type:v,base64:m,width:o,height:f}),r.set(t,m)}};';function lE(){const e=new Blob([cE]);return URL.createObjectURL(e)}class uE{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.shadowDoms=new Set,this.windowsSet=new WeakSet,this.windows=[],this.restoreHandlers=[],this.frozen=!1,this.locked=!1,this.snapshotInProgressMap=new Map,this.worker=null,this.lastSnapshotTime=0,this.processMutation=(a,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(c)};const{enableManualSnapshot:n,sampling:r="all",win:o,recordCanvas:s,errorHandler:i}=t;t.sampling=r,this.mutationCb=t.mutationCb,this.mirror=t.mirror,this.options=t,i&&tE(i),(s&&typeof r=="number"||n)&&(this.worker=this.initFPSWorker()),this.addWindow(o),!n&&no(()=>{s&&r==="all"&&(this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher()),s&&typeof r=="number"&&this.initCanvasFPSObserver()})()}reset(){this.pendingCanvasMutations.clear(),this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.windowsSet=new WeakSet,this.windows=[],this.shadowDoms=new Set,this.worker?.terminate(),this.worker=null,this.snapshotInProgressMap=new Map}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}addWindow(t){const{sampling:n="all",blockClass:r,blockSelector:o,unblockSelector:s,recordCanvas:i,enableManualSnapshot:a}=this.options;if(!this.windowsSet.has(t)){if(a){this.windowsSet.add(t),this.windows.push(new WeakRef(t));return}no(()=>{if(i&&n==="all"&&this.initCanvasMutationObserver(t,r,o,s),i&&typeof n=="number"){const c=qi(t,r,o,s,!0);this.restoreHandlers.push(()=>{c()})}})(),this.windowsSet.add(t),this.windows.push(new WeakRef(t))}}addShadowRoot(t){this.shadowDoms.add(new WeakRef(t))}resetShadowRoots(){this.shadowDoms=new Set}snapshot(t,n){if(n?.skipRequestAnimationFrame){this.takeSnapshot(performance.now(),!0,t);return}st(r=>this.takeSnapshot(r,!0,t))}initFPSWorker(){const t=new Worker(lE());return t.onmessage=n=>{const r=n.data,{id:o}=r;if(this.snapshotInProgressMap.set(o,!1),!("base64"in r))return;const{base64:s,type:i,width:a,height:c}=r;this.mutationCb({id:o,type:Wt["2D"],commands:[{property:"clearRect",args:[0,0,a,c]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:s}],type:i}]},0,0,a,c]}]})},t}initCanvasFPSObserver(){let t;if(!this.windows.length&&!this.shadowDoms.size)return;const n=r=>{this.takeSnapshot(r,!1),t=st(n)};t=st(n),this.restoreHandlers.push(()=>{t&&cancelAnimationFrame(t)})}initCanvasMutationObserver(t,n,r,o){const s=qi(t,n,r,o,!1),i=sE(this.processMutation.bind(this),t,n,r,o),a=aE(this.processMutation.bind(this),t,n,r,o,this.mirror);this.restoreHandlers.push(()=>{s(),i(),a()})}getCanvasElements(t,n,r){const o=[],s=i=>{i.querySelectorAll("canvas").forEach(a=>{Hr(a,t,n,r)||o.push(a)})};for(const i of this.windows){const a=i.deref();let c;try{c=a&&a.document}catch{}c&&s(c)}for(const i of this.shadowDoms){const a=i.deref();a&&s(a)}return o}takeSnapshot(t,n,r){const{sampling:o,blockClass:s,blockSelector:i,unblockSelector:a,dataURLOptions:c,maxCanvasSize:l}=this.options,u=1e3/(o==="all"?2:o||2);return this.lastSnapshotTime&&t-this.lastSnapshotTime{const m=this.mirror.getId(h);if(!(!this.mirror.hasNode(h)||!h.width||!h.height||this.snapshotInProgressMap.get(m))){if(this.snapshotInProgressMap.set(m,!0),!n&&["webgl","webgl2"].includes(h.__context)){const g=h.getContext(h.__context);g?.getContextAttributes()?.preserveDrawingBuffer===!1&&g.clear(g.COLOR_BUFFER_BIT)}createImageBitmap(h).then(g=>{this.worker?.postMessage({id:m,bitmap:g,width:h.width,height:h.height,dataURLOptions:c,maxCanvasSize:l},[g])}).catch(g=>{no(()=>{throw this.snapshotInProgressMap.delete(m),g})()})}}),!0)}startPendingCanvasMutationFlusher(){st(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=n=>{this.rafStamps.latestId=n,st(t)};st(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,n)=>{const r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),st(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,n){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(t);if(!r||n===-1)return;const o=r.map(i=>{const{type:a,...c}=i;return c}),{type:s}=r[0];this.mutationCb({id:n,type:s,commands:o}),this.pendingCanvasMutations.delete(t)}}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)}QS();var Ji;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Ji||(Ji={}));const Yi={low:{sampling:{canvas:1},dataURLOptions:{type:"image/webp",quality:.25}},medium:{sampling:{canvas:2},dataURLOptions:{type:"image/webp",quality:.4}},high:{sampling:{canvas:4},dataURLOptions:{type:"image/webp",quality:.5}}},dE="ReplayCanvas",Un=1280,fE=((e={})=>{const[t,n]=e.maxCanvasSize||[],r={quality:e.quality||"medium",enableManualSnapshot:e.enableManualSnapshot,maxCanvasSize:[t?Math.min(t,Un):Un,n?Math.min(n,Un):Un]};let o,s;const i=new Promise(a=>s=a);return{name:dE,getOptions(){const{quality:a,enableManualSnapshot:c,maxCanvasSize:l}=r;return{enableManualSnapshot:c,recordCanvas:!0,getCanvasManager:d=>{const u=new uE({...d,enableManualSnapshot:c,maxCanvasSize:l,errorHandler:f=>{try{typeof f=="object"&&(f.__rrweb__=!0)}catch{}}});return o=u,s(u),u},...Yi[a]||Yi.medium}},async snapshot(a,c){(o||await i).snapshot(a,c)}}}),pE=te(fE);function hE(e=j()){e?.emit("endPageloadSpan")}function mE(e){const t=Qe();if(t===e)return;const n=Ie();e.end=new Proxy(e.end,{apply(r,o,s){return Is(n,t),Reflect.apply(r,o,s)}}),Is(n,e)}const gE=te(()=>({name:"SpanStreaming",beforeSetup(e){const t=e.getOptions();t.traceLifecycle||(k&&b.log('[SpanStreaming] setting `traceLifecycle` to "stream"'),t.traceLifecycle="stream")},setup(e){const t="SpanStreaming integration requires",n="Falling back to static trace lifecycle.",r=e.getOptions();if(!ia(e)){r.traceLifecycle="static",k&&b.warn(`${t} \`traceLifecycle\` to be set to "stream"! ${n}`);return}const o=r.beforeSendSpan;if(o&&!iu(o)){r.traceLifecycle="static",k&&b.warn(`${t} a beforeSendSpan callback using \`withStreamedSpan\`! ${n}`);return}const s=new Xh(e);e.on("afterSpanEnd",i=>{au(i)&&s.add(cu(i,e))}),e.on("afterSegmentSpanEnd",i=>{const a=i.spanContext().traceId;setTimeout(()=>{s.flush(a)},500)})}}));function jt(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function _E(e,t){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);const r=jt(n);return o=>r.then(s=>o(s.transaction(t,"readwrite").objectStore(t)))}function bs(e){return jt(e.getAllKeys())}function yE(e,t,n){return e(r=>bs(r).then(o=>{if(!(o.length>=n))return r.put(t,Math.max(...o,0)+1),jt(r.transaction)}))}function bE(e,t,n){return e(r=>bs(r).then(o=>{if(!(o.length>=n))return r.put(t,Math.min(...o,0)-1),jt(r.transaction)}))}function SE(e){return e(t=>bs(t).then(n=>{const r=n[0];if(r!=null)return jt(t.get(r)).then(o=>(t.delete(r),jt(t.transaction).then(()=>o)))}))}function EE(e){let t;function n(){return t==null&&(t=_E(e.dbName||"sentry-offline",e.storeName||"queue")),t}return{push:async r=>{try{const o=io(r);await yE(n(),o,e.maxQueueSize||30)}catch{}},unshift:async r=>{try{const o=io(r);await bE(n(),o,e.maxQueueSize||30)}catch{}},shift:async()=>{try{const r=await SE(n());if(r)return lu(r)}catch{}}}}function vE(e){return t=>{const n=e({...t,createStore:EE});return re.addEventListener("online",async r=>{await n.flush()}),n}}function wE(e=ga){return vE(Ad(e))}const Ki=1e6,kE="window"in ue&&ue.window===ue&&typeof importScripts>"u",Xe=String(0),_r=kE?"main":"worker",yr=re.navigator;let ml="",gl="",_l="",Ro=yr?.userAgent||"",yl="";const TE=yr?.language||yr?.languages?.[0]||"";function IE(e){return typeof e=="object"&&e!==null&&"getHighEntropyValues"in e}const Xi=yr?.userAgentData;IE(Xi)&&Xi.getHighEntropyValues(["architecture","model","platform","platformVersion","fullVersionList"]).then(e=>{if(ml=e.platform||"",_l=e.architecture||"",yl=e.model||"",gl=e.platformVersion||"",e.fullVersionList?.length){const t=e.fullVersionList[e.fullVersionList.length-1];Ro=`${t.brand} ${t.version}`}}).catch(e=>{});function CE(e){return!("thread_metadata"in e)}function RE(e){return CE(e)?LE(e):e}function AE(e){const t=e.contexts?.trace?.trace_id;return typeof t=="string"&&t.length!==32&&k&&b.log(`[Profiling] Invalid traceId: ${t} on profiled event`),typeof t!="string"?"":t}function ME(e,t,n,r){if(r.type!=="transaction")throw new TypeError("Profiling events may only be attached to transactions, this should never occur.");if(n==null)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${n} instead.`);const o=AE(r),s=RE(n),i=t||(typeof r.start_timestamp=="number"?r.start_timestamp*1e3:ao()*1e3),a=typeof r.timestamp=="number"?r.timestamp*1e3:ao()*1e3;return{event_id:e,timestamp:new Date(i).toISOString(),platform:"javascript",version:"1",release:r.release||"",environment:r.environment||uu,runtime:{name:"javascript",version:re.navigator.userAgent},os:{name:ml,version:gl,build_number:Ro},device:{locale:TE,model:yl,manufacturer:Ro,architecture:_l,is_emulator:!1},debug_meta:{images:Sl(n.resources)},profile:s,transactions:[{name:r.transaction||"",id:r.event_id||dt(),trace_id:o,active_thread_id:Xe,relative_start_ns:"0",relative_end_ns:((a-i)*1e6).toFixed(0)}]}}function xE(e,t,n){if(e==null)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${e} instead.`);const r=NE(e),o=t.getOptions(),s=t.getSdkMetadata?.()?.sdk;return{chunk_id:dt(),client_sdk:{name:s?.name??"sentry.javascript.browser",version:s?.version??"0.0.0"},profiler_id:n||dt(),platform:"javascript",version:"2",release:o.release??"",environment:o.environment??"production",debug_meta:{images:Sl(e.resources)},profile:r}}function OE(e){try{if(!e||typeof e!="object")return{reason:"chunk is not an object"};const t=r=>typeof r=="string"&&/^[a-f0-9]{32}$/.test(r);if(!t(e.profiler_id))return{reason:"missing or invalid profiler_id"};if(!t(e.chunk_id))return{reason:"missing or invalid chunk_id"};if(!e.client_sdk)return{reason:"missing client_sdk metadata"};const n=e.profile;return n?!Array.isArray(n.frames)||!n.frames.length?{reason:"profile has no frames"}:!Array.isArray(n.stacks)||!n.stacks.length?{reason:"profile has no stacks"}:!Array.isArray(n.samples)||!n.samples.length?{reason:"profile has no samples"}:{valid:!0}:{reason:"missing profile data"}}catch(t){return{reason:`unknown validation error: ${t}`}}}function NE(e){const t=[];for(let a=0;a{if(l.stackId===void 0){t===void 0&&(t=n,r.stacks[t]=[],n++),r.samples[d]={elapsed_since_start_ns:((l.timestamp+c-s)*Ki).toFixed(0),stack_id:t,thread_id:Xe};return}let u=e.stacks[l.stackId];const f=[];for(;u;){f.push(u.frameId);const h=e.frames[u.frameId];h&&r.frames[u.frameId]===void 0&&(r.frames[u.frameId]={function:h.name,abs_path:typeof h.resourceId=="number"?e.resources[h.resourceId]:void 0,lineno:h.line,colno:h.column}),u=u.parentId===void 0?void 0:e.stacks[u.parentId]}const p={elapsed_since_start_ns:((l.timestamp+c-s)*Ki).toFixed(0),stack_id:n,thread_id:Xe};r.stacks[n]=f,r.samples[d]=p,n++}),r}function PE(e,t){if(!t.length)return e;for(const n of t)e[1].push([{type:"profile"},n]);return e}function DE(e){const t=[];return br(e,(n,r)=>{if(r==="transaction")for(let o=1;o1?(k&&b.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${e}.`),!1):!0}function FE(e){return e.samples.length30){const n=lt.keys().next().value;n!==void 0&&lt.delete(n)}}function zE(e){return!e?.contexts?.profile||!e.contexts||(e.contexts.trace?.trace_id&&(e.contexts.trace={...e.contexts.trace,data:{...e.contexts.trace.data??{},"thread.id":Xe,"thread.name":_r}}),e.spans?.forEach(t=>{t.data={...t.data||{},"thread.id":Xe,"thread.name":_r}})),e}function Zi(e){let t;bl(e)&&(t=ao()*1e3);const n=wl();if(!n)return;k&&b.log(`[Profiling] started profiling span: ${Re(e).description}`);const r=dt();let o=null;Ie().setContext("profile",{profile_id:r,start_timestamp:t});async function s(){if(e&&n){if(o){k&&b.log("[Profiling] profile for:",Re(e).description,"already exists, returning early");return}return n.stop().then(l=>{if(i&&(re.clearTimeout(i),i=void 0),k&&b.log(`[Profiling] stopped profiling of span: ${Re(e).description}`),!l){k&&b.log(`[Profiling] profiler returned null profile for: ${Re(e).description}`,"this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started");return}o=l,jE(r,l)}).catch(l=>{k&&b.log("[Profiling] error while stopping profiler:",l)})}}let i=re.setTimeout(()=>{k&&b.log("[Profiling] max profile duration elapsed, stopping profiling for:",Re(e).description),s()},vl);const a=e.end.bind(e);function c(){return e?(s().then(()=>{a()},()=>{a()}),e):a()}e.end=c}const GE=6e4,qE=3e5;class VE{constructor(){this._client=void 0,this._profiler=void 0,this._chunkTimer=void 0,this._profilerId=void 0,this._isRunning=!1,this._sessionSampled=!1,this._lifecycleMode=void 0,this._activeRootSpanIds=new Set,this._rootSpanTimeouts=new Map}initialize(t){const n=t.getOptions().profileLifecycle,r=UE(t.getOptions());k&&b.log(`[Profiling] Initializing profiler (lifecycle='${n}').`),r||k&&b.log("[Profiling] Session not sampled. Skipping lifecycle profiler initialization."),this._profilerId=dt(),this._client=t,this._sessionSampled=r,this._lifecycleMode=n,n==="trace"&&this._setupTraceLifecycleListeners(t)}start(){if(this._lifecycleMode==="trace"){k&&b.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.start()` are ignored in trace mode.');return}if(this._isRunning){k&&b.warn("[Profiling] Profile session is already running, `uiProfiler.start()` is a no-op.");return}if(!this._sessionSampled){k&&b.warn("[Profiling] Session is not sampled, `uiProfiler.start()` is a no-op.");return}this._beginProfiling()}stop(){if(this._lifecycleMode==="trace"){k&&b.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.stop()` are ignored in trace mode.');return}if(!this._isRunning){k&&b.warn("[Profiling] Profiler is not running, `uiProfiler.stop()` is a no-op.");return}this._endProfiling()}notifyRootSpanActive(t){if(this._lifecycleMode!=="trace"||!this._sessionSampled)return;const n=t.spanContext().spanId;if(!n||this._activeRootSpanIds.has(n))return;this._registerTraceRootSpan(n);const r=this._activeRootSpanIds.size;r===1&&(k&&b.log("[Profiling] Detected already active root span during setup. Active root spans now:",r),this._beginProfiling())}_beginProfiling(){if(!this._isRunning){if(this._isRunning=!0,k&&b.log("[Profiling] Started profiling with profiler ID:",this._profilerId),sn().setContext("profile",{profiler_id:this._profilerId}),this._startProfilerInstance(),!this._profiler){k&&b.log("[Profiling] Failed to start JS Profiler; stopping."),this._resetProfilerInfo();return}this._startPeriodicChunking()}}_endProfiling(){this._isRunning&&(this._isRunning=!1,this._chunkTimer&&(clearTimeout(this._chunkTimer),this._chunkTimer=void 0),this._clearAllRootSpanTimeouts(),this._collectCurrentChunk().catch(t=>{k&&b.error("[Profiling] Failed to collect current profile chunk on `stop()`:",t)}),this._lifecycleMode==="manual"&&sn().setContext("profile",{}))}_setupTraceLifecycleListeners(t){t.on("spanStart",n=>{if(!this._sessionSampled){k&&b.log("[Profiling] Span not profiled because of negative sampling decision for user session.");return}if(n!==Nt(n))return;if(!n.isRecording()){k&&b.log("[Profiling] Discarding profile because root span was not sampled.");return}const r=n.spanContext().spanId;if(!r||this._activeRootSpanIds.has(r))return;this._registerTraceRootSpan(r);const o=this._activeRootSpanIds.size;o===1&&(k&&b.log(`[Profiling] Root span ${r} started. Profiling active while there are active root spans (count=${o}).`),this._beginProfiling())}),t.on("spanEnd",n=>{if(!this._sessionSampled)return;const r=n.spanContext().spanId;if(!r||!this._activeRootSpanIds.has(r))return;this._activeRootSpanIds.delete(r);const o=this._activeRootSpanIds.size;k&&b.log(`[Profiling] Root span with ID ${r} ended. Will continue profiling for as long as there are active root spans (currently: ${o}).`),o===0&&(this._collectCurrentChunk().catch(s=>{k&&b.error("[Profiling] Failed to collect current profile chunk on last `spanEnd`:",s)}),this._endProfiling())})}_resetProfilerInfo(){this._isRunning=!1,sn().setContext("profile",{})}_clearAllRootSpanTimeouts(){this._rootSpanTimeouts.forEach(t=>clearTimeout(t)),this._rootSpanTimeouts.clear()}_registerTraceRootSpan(t){this._activeRootSpanIds.add(t);const n=setTimeout(()=>this._onRootSpanTimeout(t),qE);this._rootSpanTimeouts.set(t,n)}_startProfilerInstance(){if(this._profiler?.stopped===!1)return;const t=wl();if(!t){k&&b.log("[Profiling] Failed to start JS Profiler.");return}this._profiler=t}_startPeriodicChunking(){this._isRunning&&(this._chunkTimer=setTimeout(()=>{if(this._collectCurrentChunk().catch(t=>{k&&b.error("[Profiling] Failed to collect current profile chunk during periodic chunking:",t)}),this._isRunning){if(this._startProfilerInstance(),!this._profiler){this._resetProfilerInfo();return}this._startPeriodicChunking()}},GE))}_onRootSpanTimeout(t){this._rootSpanTimeouts.has(t)&&(this._rootSpanTimeouts.delete(t),this._activeRootSpanIds.has(t)&&(k&&b.log(`[Profiling] Reached 5-minute timeout for root span ${t}. You likely started a manual root span that never called \`.end()\`.`),this._activeRootSpanIds.delete(t),this._activeRootSpanIds.size===0&&this._endProfiling()))}async _collectCurrentChunk(){const t=this._profiler;if(this._profiler=void 0,!!t)try{const n=await t.stop(),r=xE(n,this._client,this._profilerId),o=OE(r);if("reason"in o){k&&b.log("[Profiling] Discarding invalid profile chunk (this is probably a bug in the SDK):",o.reason);return}this._sendProfileChunk(r),k&&b.log("[Profiling] Collected browser profile chunk.")}catch(n){k&&b.log("[Profiling] Error while stopping JS Profiler for chunk:",n)}}_sendProfileChunk(t){const n=this._client,r=Oo(n.getSdkMetadata?.()),o=n.getDsn(),s=n.getOptions().tunnel,i=_n({event_id:dt(),sent_at:new Date().toISOString(),...r&&{sdk:r},...!!s&&o&&{dsn:No(o)}},[[{type:"profile_chunk",platform:"javascript"},t]]);n.sendEnvelope(i).then(null,a=>{k&&b.error("Error while sending profile chunk envelope:",a)})}}const JE="BrowserProfiling",YE=(()=>({name:JE,setup(e){const t=e.getOptions(),n=new VE;if(!$n(t)&&!t.profileLifecycle&&(t.profileLifecycle="manual"),$n(t)&&!t.profilesSampleRate){k&&b.log("[Profiling] Profiling disabled, no profiling options found.");return}const r=Qe(),o=r&&Nt(r);if($n(t)&&t.profileSessionSampleRate!==void 0&&k&&b.warn("[Profiling] Both legacy profiling (`profilesSampleRate`) and UI profiling settings are defined. `profileSessionSampleRate` has no effect when legacy profiling is enabled."),$n(t))o&&bl(o)&&Qi(o)&&Zi(o),e.on("spanStart",s=>{s===Nt(s)&&Qi(s)&&Zi(s)}),e.on("beforeEnvelope",s=>{if(!HE())return;const i=DE(s);if(!i.length)return;const a=[];for(const c of i){const l=c?.contexts,d=l?.profile?.profile_id,u=l?.profile?.start_timestamp;if(typeof d!="string"){k&&b.log("[Profiling] cannot find profile for a span without a profile context");continue}if(!d){k&&b.log("[Profiling] cannot find profile for a span without a profile context");continue}l?.profile&&delete l.profile;const f=WE(d);if(!f){k&&b.log(`[Profiling] Could not retrieve profile for span: ${d}`);continue}const p=$E(d,u,f,c);p&&a.push(p)}PE(s,a)});else{const s=t.profileLifecycle;if(e.on("startUIProfiler",()=>n.start()),e.on("stopUIProfiler",()=>n.stop()),s==="manual")n.initialize(e);else if(s==="trace"){if(!fu(t)){k&&b.warn("[Profiling] `profileLifecycle` is 'trace' but tracing is disabled. Set a `tracesSampleRate` or `tracesSampler` to enable span tracing.");return}n.initialize(e),o&&n.notifyRootSpanActive(o),re.setTimeout(()=>{const i=Qe(),a=i&&Nt(i);a&&n.notifyRootSpanActive(a)},0)}}},processEvent(e){return zE(e)}})),KE=te(YE),XE=te(()=>({name:"LaunchDarkly",processEvent(e,t,n){return zt(e)}}));function QE(){return{name:"sentry-flag-auditor",type:"flag-used",synchronous:!0,method:(e,t,n)=>{ft(e,t.value),pt(e,t.value)}}}const ZE=te(()=>({name:"OpenFeature",processEvent(e,t,n){return zt(e)}}));class ev{after(t,n){ft(n.flagKey,n.value),pt(n.flagKey,n.value)}error(t,n,r){ft(t.flagKey,t.defaultValue),pt(t.flagKey,t.defaultValue)}}const tv=te(({featureFlagClientClass:e})=>({name:"Unleash",setupOnce(){const t=e.prototype;Qn(t,"isEnabled",nv)},processEvent(t,n,r){return zt(t)}}));function nv(e){return function(...t){const n=t[0],r=e.apply(this,t);return typeof n=="string"&&typeof r=="boolean"?(ft(n,r),pt(n,r)):k&&b.error(`[Feature Flags] UnleashClient.isEnabled does not match expected signature. arg0: ${n} (${typeof n}), result: ${r} (${typeof r})`),r}}const rv=(({growthbookClass:e})=>Pf({growthbookClass:e})),ov=te(({featureFlagClient:e})=>({name:"Statsig",setup(t){e.on("gate_evaluation",n=>{ft(n.gate.name,n.gate.value),pt(n.gate.name,n.gate.value)})},processEvent(t,n,r){return zt(t)}}));async function sv(){const e=j();if(!e)return"no-client-active";if(!e.getDsn())return"no-dsn-configured";const r=e.getOptions().tunnel||"https://o447951.ingest.sentry.io/api/4509632503087104/envelope/?sentry_version=7&sentry_key=c1dfb07d783ad5325c245c1fd3725390&sentry_client=sentry.javascript.browser%2F1.33.7";try{await _a(()=>fetch(r,{body:"{}",method:"POST",mode:"cors",credentials:"omit"}))}catch{return"sentry-unreachable"}}const iv="WebWorker",av=te(({worker:e})=>({name:iv,setupOnce:()=>{(Array.isArray(e)?e:[e]).forEach(t=>ea(t))},addWorker:t=>ea(t)}));function ea(e){e.addEventListener("message",t=>{if(uv(t.data)){if(t.stopImmediatePropagation(),t.data._sentryDebugIds&&(k&&b.log("Sentry debugId web worker message received",t.data),re._sentryDebugIds={...t.data._sentryDebugIds,...re._sentryDebugIds}),t.data._sentryModuleMetadata&&(k&&b.log("Sentry module metadata web worker message received",t.data),re._sentryModuleMetadata={...t.data._sentryModuleMetadata,...re._sentryModuleMetadata}),t.data._sentryWasmImages){k&&b.log("Sentry WASM images web worker message received",t.data);const n=re._sentryWasmImages||[],r=t.data._sentryWasmImages.filter(o=>Ue(o)&&typeof o.code_file=="string"&&!n.some(s=>s.code_file===o.code_file));re._sentryWasmImages=[...n,...r]}t.data._sentryWorkerError&&(k&&b.log("Sentry worker rejection message received",t.data._sentryWorkerError),cv(t.data._sentryWorkerError))}})}function cv(e){const t=j();if(!t)return;const n=t.getOptions().stackParser,r=t.getOptions().attachStacktrace,o=e.reason,s=sa(o)?hu(o):mu(n,o,void 0,r,!0);s.level="error",e.filename&&(s.contexts={...s.contexts,worker:{filename:e.filename}}),Er(s,{originalException:o,mechanism:{handled:!1,type:"auto.browser.web_worker.onunhandledrejection"}}),k&&b.log("Captured worker unhandled rejection",o)}function lv({self:e}){e.postMessage({_sentryMessage:!0,_sentryDebugIds:e._sentryDebugIds??void 0,_sentryModuleMetadata:e._sentryModuleMetadata??void 0}),e.addEventListener("unhandledrejection",t=>{const r={reason:pu(t),filename:e.location?.href};e.postMessage({_sentryMessage:!0,_sentryWorkerError:r}),k&&b.log("[Sentry Worker] Forwarding unhandled rejection to parent",r)}),k&&b.log("[Sentry Worker] Registered worker with unhandled rejection handling")}function uv(e){if(!Ue(e)||e._sentryMessage!==!0)return!1;const t="_sentryDebugIds"in e,n="_sentryModuleMetadata"in e,r="_sentryWorkerError"in e,o="_sentryWasmImages"in e;return!(!t&&!n&&!r&&!o||t&&!(Ue(e._sentryDebugIds)||e._sentryDebugIds===void 0)||n&&!(Ue(e._sentryModuleMetadata)||e._sentryModuleMetadata===void 0)||r&&!Ue(e._sentryWorkerError)||o&&(!Array.isArray(e._sentryWasmImages)||!e._sentryWasmImages.every(s=>Ue(s)&&typeof s.code_file=="string")))}const dv=Object.freeze(Object.defineProperty({__proto__:null,BrowserClient:gu,MULTIPLEXED_TRANSPORT_EXTRA_KEY:Hn,OpenFeatureIntegrationHook:ev,SDK_VERSION:ca,SEMANTIC_ATTRIBUTE_SENTRY_OP:Te,SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN:ye,SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE:_u,SEMANTIC_ATTRIBUTE_SENTRY_SOURCE:fa,Scope:yu,WINDOW:re,addBreadcrumb:xo,addEventProcessor:pa,addIntegration:so,breadcrumbsIntegration:bu,browserApiErrorsIntegration:Su,browserProfilingIntegration:KE,browserSessionIntegration:Eu,browserTracingIntegration:vu,buildLaunchDarklyFlagUsedHandler:QE,captureConsoleIntegration:jd,captureEvent:Er,captureException:ee,captureFeedback:Aa,captureMessage:da,captureSession:wu,chromeStackLineParser:ku,close:Tu,consoleLoggingIntegration:qf,contextLinesIntegration:e_,continueTrace:Iu,createConsolaReporter:Xf,createLangChainCallbackHandler:Jo,createTransport:Cu,createUserFeedbackEnvelope:Ig,cultureContextIntegration:Ru,dedupeIntegration:Au,defaultRequestInstrumentationOptions:Mu,defaultStackLineParsers:xu,defaultStackParser:Ou,diagnoseSdkConnectivity:sv,elementTimingIntegration:vg,endSession:Nu,eventFiltersIntegration:Lu,eventFromException:Pu,eventFromMessage:Du,exceptionFromError:Fu,extraErrorDataIntegration:Vd,featureFlagsIntegration:Lf,feedbackAsyncIntegration:bg,feedbackIntegration:di,feedbackSyncIntegration:di,flush:Bu,forceLoad:Uu,functionToStringIntegration:$u,geckoStackLineParser:Hu,getActiveSpan:Qe,getClient:j,getCurrentScope:Ie,getDefaultIntegrations:Wu,getFeedback:Rm,getGlobalScope:sn,getIsolationScope:Po,getReplay:JS,getRootSpan:Nt,getSpanDescendants:ju,getSpanStatusFromHttpCode:zu,getTraceData:Gu,globalHandlersIntegration:qu,graphqlClientIntegration:c_,growthbookIntegration:rv,httpClientIntegration:$g,httpContextIntegration:Vu,inboundFiltersIntegration:Ju,init:ya,instrumentAnthropicAiClient:hh,instrumentCreateReactAgent:Gh,instrumentGoogleGenAIClient:Ih,instrumentLangChainEmbeddings:em,instrumentLangGraph:qh,instrumentOpenAiClient:Yp,instrumentOutgoingRequests:Yu,instrumentSupabaseClient:Ra,isBotUserAgent:Ku,isEnabled:Xu,isInitialized:Qu,lastEventId:ua,launchDarklyIntegration:XE,lazyLoadIntegration:_c,linkedErrorsIntegration:Zu,logger:Wf,makeBrowserOfflineTransport:wE,makeFetchTransport:ga,makeMultiplexedTransport:Od,metrics:Yf,moduleMetadataIntegration:$d,onLoad:ed,openFeatureIntegration:ZE,opera10StackLineParser:td,opera11StackLineParser:nd,parameterize:Ea,registerSpanErrorInstrumentation:rd,registerWebWorker:lv,replayCanvasIntegration:pE,replayIntegration:GS,reportPageLoaded:hE,reportingObserverIntegration:Fg,rewriteFramesIntegration:tf,sendFeedback:oc,setActiveSpanInBrowser:mE,setContext:ha,setConversationId:od,setCurrentClient:sd,setExtra:id,setExtras:ad,setHttpStatus:oo,setMeasurement:cd,setTag:ld,setTags:ud,setUser:dd,showReportDialog:Ng,spanStreamingIntegration:gE,spanToBaggageHeader:fd,spanToJSON:Re,spanToTraceHeader:pd,spotlightBrowserIntegration:Og,startBrowserTracingNavigationSpan:hd,startBrowserTracingPageLoadSpan:md,startInactiveSpan:gd,startNewTrace:_d,startSession:yd,startSpan:De,startSpanManual:$e,statsigIntegration:ov,supabaseIntegration:gf,suppressTracing:_a,thirdPartyErrorFilterIntegration:If,uiProfiler:Tg,unleashIntegration:tv,updateSpanName:bd,viewHierarchyIntegration:l_,webWorkerIntegration:av,winjsStackLineParser:Sd,withActiveSpan:Ed,withIsolationScope:vd,withScope:Ao,withStreamedSpan:wd,zodErrorsIntegration:Tf},Symbol.toStringTag,{value:"Module"}));window.Sentry=dv;ya({allowUrls:["staging.snapcraft.io/static/js","snapcraft.io/static/js/"],denyUrls:["staging.snapcraft.io/static/js/modules","snapcraft.io/static/js/modules"],dsn:window.SENTRY_DSN,environment:window.ENVIRONMENT,ignoreErrors:["AbortError"],release:window.COMMIT_ID});window.ANALYTICS_ENDPOINT&&kd({appName:"snapcraft",endpoint:window.ANALYTICS_ENDPOINT});

').concat(t.body1,`

`).concat(t.body2?'

'.concat(t.body2,"

"):"",` `);return i}},{key:"render",value:function(n){this.container.innerHTML=this.getNotificationMarkup(n),this.initaliseListeners()}},{key:"initaliseListeners",value:function(){var n=this;this.container.querySelector(".js-close-all").addEventListener("click",function(){ue("all",n.destroyComponent)()}),this.container.querySelector(".js-manage").addEventListener("click",function(){n.renderManager()})}}])})(),Fe=(function(){function a(e,n,t){J(this,a),this.language=t,this.id=e.id,this.title=W(e,t).title,this.description=W(e,t).description,this.activeText=W(e,t).activeText,this.enableSwitcher=e.enableSwitcher,this.container=n,this.element,this.onChange=e.onChange||function(){},this.render()}return Q(a,[{key:"render",value:function(){var n,t=this.cookieIsTrue(),i=document.createElement("div");i.innerHTML=`

  • `),this.container.appendChild(i),this.element=i.querySelector(".js-".concat(this.id,"-switch")),(n=this.element)===null||n===void 0||n.addEventListener("change",this.onChange)}},{key:"cookieIsTrue",value:function(){var n=z("_cookies_accepted=");return n&&(n===this.id||n==="all")?!0:n&&n===this.id}},{key:"isChecked",value:function(){return this.element?this.element.checked:!1}},{key:"getId",value:function(){return this.id}}])})(),Ie=(function(){function a(e,n){J(this,a),this.container=e,this.controlsStore=[],this.destroyComponent=n}return Q(a,[{key:"getManagerMarkup",value:function(n){var t=ce(n).manager,i=` `);return i}},{key:"render",value:function(n){var t=this;this.container.innerHTML=this.getManagerMarkup(n);var i=this.container.querySelector(".controls");ye.forEach(function(s){var u=new Fe(G(G({},s),{},{onChange:function(){return t.updateAcceptButton()}}),i,n);t.controlsStore.push(u)}),this.updateAcceptButton(),this.initaliseListeners()}},{key:"updateAcceptButton",value:function(){var n=this.controlsStore.filter(function(i){return i.getId()!=="essential"}).every(function(i){return i.isChecked()}),t=this.container.querySelector(".js-close");t.style.display=n?"none":"inline-block"}},{key:"initaliseListeners",value:function(){var n=this;this.container.querySelector(".js-close").addEventListener("click",function(){ue("all",n.destroyComponent)()});for(var t=document.querySelectorAll(".p-accordion"),i=0,s=t.length;i0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=null,i=document.documentElement.lang,s=!1,u=null;n&&!u&&(u=Ge());var p=function(w){if(w&&w.preventDefault(),t===null){t=document.createElement("dialog"),t.classList.add("cookie-policy"),t.style.pointerEvents="none",t.setAttribute("open",!0),t.style.borderStyle="none",document.body.appendChild(t);var S=new Ne(t,v,y);S.render(i),document.getElementById("cookie-policy-button-accept-all").focus()}},v=function(){var w=new Ie(t,y);w.render(i)},y=function(){typeof e=="function"&&e(),document.body.removeChild(t),t=null},T=(function(){var _=A(b().mark(function w(){var S;return b().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if(!s){k.next=2;break}return k.abrupt("return");case 2:if(s=!0,!u){k.next=6;break}return k.next=6,u;case 6:Pe(),S=document.querySelector(".js-revoke-cookie-manager"),S&&S.addEventListener("click",p),_e()&&!Se()&&p();case 10:case"end":return k.stop()}},w)}));return function(){return _.apply(this,arguments)}})();document.readyState==="loading"?document.addEventListener("DOMContentLoaded",T,!1):T()};ze();

    Track and share your snap

    Here is how to track how well your snap is doing in the community, a few tips on how to release snap updates and communicate them to your users, and some tools to help you publicise your snap.


    Your snap’s performance

    To see how your snap is performing, go to the “Metrics” tab on your snap publishing pages. Here are the metrics available to you right now:


    Weekly active devices

    A snap is a bundle of an app and its dependencies that works without modification across Linux distributions.


    Snap users by OS, channel, or version

    If you open the dropdown above this chart in the Metrics page, you will be able to select different options to segment your users. These include the OS they are running your snaps with, what channel they are using (stable, candidate, beta or edge) and what version of your software they are on. This will help you visualise the rhythm at which your software updates are being adopted.


    Snap users by territory

    This map shows you how many users are using your snap all around the world.


    Publicise your snap


    Snap store buttons

    Use the “Get it from the snap store” badge on your marketing communications and pages to let your audience know about your snap. You can choose between a light and a dark button.


    GitHub badges

    Use the snap store GitHub badges to let your users know that they are able to get your app from Snapcraft. When your snap is flagged as trending you can also add a badge that signals this to your users.