@atproto/oauth-provider-ui 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,20 +0,0 @@
1
- import{r as We}from"./error-view-MVy7C9l0.js";function k(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function et(e,t){return et=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},et(e,t)}function Sr(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,et(e,t)}var xn=Object.defineProperty,Tr=Object.defineProperties,br=Object.getOwnPropertyDescriptors,Be=Object.getOwnPropertySymbols,Dn=Object.prototype.hasOwnProperty,wn=Object.prototype.propertyIsEnumerable,At=(e,t,n)=>t in e?xn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,u=(e,t)=>{for(var n in t||(t={}))Dn.call(t,n)&&At(e,n,t[n]);if(Be)for(var n of Be(t))wn.call(t,n)&&At(e,n,t[n]);return e},g=(e,t)=>Tr(e,br(t)),Rr=(e,t)=>{var n={};for(var r in e)Dn.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Be)for(var r of Be(e))t.indexOf(r)<0&&wn.call(e,r)&&(n[r]=e[r]);return n},Nn=(e,t)=>{for(var n in t)xn(e,n,{get:t[n],enumerable:!0})},Et=(e,t,n)=>new Promise((r,i)=>{var a=c=>{try{o(n.next(c))}catch(l){i(l)}},s=c=>{try{o(n.throw(c))}catch(l){i(l)}},o=c=>c.done?r(c.value):Promise.resolve(c.value).then(a,s);o((n=n.apply(e,t)).next())});function xr(e){return Object.entries(e).filter(([,t])=>t||t===!1).map(([t,n])=>`${encodeURIComponent(t)}=${encodeURIComponent(String(n))}`).join("&")}function kn(e){let t=e&&e.ownerDocument||document,n=t.defaultView||t.parentWindow||window;return{document:t,window:n}}function Cn(e){return e||document.head}var Dr="hCaptcha-script",Ne="hCaptchaOnLoad",tt="script-error",J="@hCaptcha/loader",Un=Object.prototype.toString;function Bn(e){switch(Un.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return P(e,Error)}}function ie(e,t){return Un.call(e)===`[object ${t}]`}function St(e){return ie(e,"ErrorEvent")}function Mt(e){return ie(e,"DOMError")}function wr(e){return ie(e,"DOMException")}function M(e){return ie(e,"String")}function In(e){return e===null||typeof e!="object"&&typeof e!="function"}function Z(e){return ie(e,"Object")}function $e(e){return typeof Event<"u"&&P(e,Event)}function Nr(e){return typeof Element<"u"&&P(e,Element)}function kr(e){return ie(e,"RegExp")}function Tt(e){return!!(e&&e.then&&typeof e.then=="function")}function Cr(e){return Z(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function On(e){return typeof e=="number"&&e!==e}function P(e,t){try{return e instanceof t}catch{return!1}}function Yn(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue))}function K(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Ht(e,t){if(!Array.isArray(e))return"";let n=[];for(let r=0;r<e.length;r++){let i=e[r];try{Yn(i)?n.push("[VueViewModel]"):n.push(String(i))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function Ur(e,t,n=!1){return M(e)?kr(t)?t.test(e):M(t)?n?e===t:e.includes(t):!1:!1}function de(e,t=[],n=!1){return t.some(r=>Ur(e,r,n))}function Br(e,t,n=250,r,i,a,s){if(!a.exception||!a.exception.values||!s||!P(s.originalException,Error))return;let o=a.exception.values.length>0?a.exception.values[a.exception.values.length-1]:void 0;o&&(a.exception.values=Ir(nt(e,t,i,s.originalException,r,a.exception.values,o,0),n))}function nt(e,t,n,r,i,a,s,o){if(a.length>=n+1)return a;let c=[...a];if(P(r[i],Error)){qt(s,o);let l=e(t,r[i]),d=c.length;Ft(l,i,d,o),c=nt(e,t,n,r[i],i,[l,...c],l,d)}return Array.isArray(r.errors)&&r.errors.forEach((l,d)=>{if(P(l,Error)){qt(s,o);let p=e(t,l),_=c.length;Ft(p,`errors[${d}]`,_,o),c=nt(e,t,n,l,i,[p,...c],p,_)}}),c}function qt(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism=g(u({},e.mechanism),{is_exception_group:!0,exception_id:t})}function Ft(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism=g(u({},e.mechanism),{type:"chained",source:t,exception_id:n,parent_id:r})}function Ir(e,t){return e.map(n=>(n.value&&(n.value=K(n.value,t)),n))}function ge(e){return e&&e.Math==Math?e:void 0}var b=typeof globalThis=="object"&&ge(globalThis)||typeof window=="object"&&ge(window)||typeof self=="object"&&ge(self)||typeof global=="object"&&ge(global)||function(){return this}()||{};function pe(){return b}function $n(e,t,n){let r=n||b,i=r.__SENTRY__=r.__SENTRY__||{};return i[e]||(i[e]=t())}var ke=pe(),Or=80;function ee(e,t={}){try{let n=e,r=5,i=[],a=0,s=0,o=" > ",c=o.length,l,d=Array.isArray(t)?t:t.keyAttrs,p=!Array.isArray(t)&&t.maxStringLength||Or;for(;n&&a++<r&&(l=Yr(n,d),!(l==="html"||a>1&&s+i.length*c+l.length>=p));)i.push(l),s+=l.length,n=n.parentNode;return i.reverse().join(o)}catch{return"<unknown>"}}function Yr(e,t){let n=e,r=[],i,a,s,o,c;if(!n||!n.tagName)return"";r.push(n.tagName.toLowerCase());let l=t&&t.length?t.filter(p=>n.getAttribute(p)).map(p=>[p,n.getAttribute(p)]):null;if(l&&l.length)l.forEach(p=>{r.push(`[${p[0]}="${p[1]}"]`)});else if(n.id&&r.push(`#${n.id}`),i=n.className,i&&M(i))for(a=i.split(/\s+/),c=0;c<a.length;c++)r.push(`.${a[c]}`);let d=["aria-label","type","name","title","alt"];for(c=0;c<d.length;c++)s=d[c],o=n.getAttribute(s),o&&r.push(`[${s}="${o}"]`);return r.join("")}function $r(){try{return ke.document.location.href}catch{return""}}function Gr(e){return ke.document&&ke.document.querySelector?ke.document.querySelector(e):null}var Pr="Sentry Logger ",rt=["debug","info","warn","error","log","assert","trace"],Ie={};function Gn(e){if(!("console"in b))return e();let t=b.console,n={},r=Object.keys(Ie);r.forEach(i=>{let a=Ie[i];n[i]=t[i],t[i]=a});try{return e()}finally{r.forEach(i=>{t[i]=n[i]})}}function jr(){let e=!1,t={enable:()=>{e=!0},disable:()=>{e=!1}};return typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?rt.forEach(n=>{t[n]=(...r)=>{e&&Gn(()=>{b.console[n](`${Pr}[${n}]:`,...r)})}}):rt.forEach(n=>{t[n]=()=>{}}),t}var h=jr(),Lr=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function Ar(e){return e==="http"||e==="https"}function Ge(e,t=!1){let{host:n,path:r,pass:i,port:a,projectId:s,protocol:o,publicKey:c}=e;return`${o}://${c}${t&&i?`:${i}`:""}@${n}${a?`:${a}`:""}/${r&&`${r}/`}${s}`}function Mr(e){let t=Lr.exec(e);if(!t){console.error(`Invalid Sentry Dsn: ${e}`);return}let[n,r,i="",a,s="",o]=t.slice(1),c="",l=o,d=l.split("/");if(d.length>1&&(c=d.slice(0,-1).join("/"),l=d.pop()),l){let p=l.match(/^\d+/);p&&(l=p[0])}return Pn({host:a,pass:i,path:c,projectId:l,port:s,protocol:n,publicKey:r})}function Pn(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Hr(e){if(!(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__))return!0;let{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(i=>e[i]?!1:(h.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:n.match(/^\d+$/)?Ar(r)?t&&isNaN(parseInt(t,10))?(h.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(h.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(h.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function qr(e){let t=typeof e=="string"?Mr(e):Pn(e);if(!(!t||!Hr(t)))return t}var Y=class extends Error{constructor(e,t="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=t}};function D(e,t,n){if(!(t in e))return;let r=e[t],i=n(r);typeof i=="function"&&jn(i,r),e[t]=i}function bt(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function jn(e,t){try{let n=t.prototype||{};e.prototype=t.prototype=n,bt(e,"__sentry_original__",t)}catch{}}function Rt(e){return e.__sentry_original__}function Fr(e){return Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}function Ln(e){if(Bn(e))return u({message:e.message,name:e.name,stack:e.stack},Wt(e));if($e(e)){let t=u({type:e.type,target:zt(e.target),currentTarget:zt(e.currentTarget)},Wt(e));return typeof CustomEvent<"u"&&P(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function zt(e){try{return Nr(e)?ee(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function Wt(e){if(typeof e=="object"&&e!==null){let t={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}else return{}}function zr(e,t=40){let n=Object.keys(Ln(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return K(n[0],t);for(let r=n.length;r>0;r--){let i=n.slice(0,r).join(", ");if(!(i.length>t))return r===n.length?i:K(i,t)}return""}function A(e){return it(e,new Map)}function it(e,t){if(Z(e)){let n=t.get(e);if(n!==void 0)return n;let r={};t.set(e,r);for(let i of Object.keys(e))typeof e[i]<"u"&&(r[i]=it(e[i],t));return r}if(Array.isArray(e)){let n=t.get(e);if(n!==void 0)return n;let r=[];return t.set(e,r),e.forEach(i=>{r.push(it(i,t))}),r}return e}var An=50,Vt=/\(error: (.*)\)/,Jt=/captureMessage|captureException/;function Wr(...e){let t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0)=>{let i=[],a=n.split(`
2
- `);for(let s=r;s<a.length;s++){let o=a[s];if(o.length>1024)continue;let c=Vt.test(o)?o.replace(Vt,"$1"):o;if(!c.match(/\S*Error: /)){for(let l of t){let d=l(c);if(d){i.push(d);break}}if(i.length>=An)break}}return Vr(i)}}function Vr(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(t[t.length-1].function||"")&&t.pop(),t.reverse(),Jt.test(t[t.length-1].function||"")&&(t.pop(),Jt.test(t[t.length-1].function||"")&&t.pop()),t.slice(0,An).map(n=>g(u({},n),{filename:n.filename||t[t.length-1].filename,function:n.function||"?"}))}var Ve="<anonymous>";function H(e){try{return!e||typeof e!="function"?Ve:e.name||Ve}catch{return Ve}}var at=pe();function Jr(){if(!("fetch"in at))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function st(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Xr(){if(!Jr())return!1;if(st(at.fetch))return!0;let e=!1,t=at.document;if(t&&typeof t.createElement=="function")try{let n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(e=st(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}var ye=pe();function Kr(){let e=ye.chrome,t=e&&e.app&&e.app.runtime,n="history"in ye&&!!ye.history.pushState&&!!ye.history.replaceState;return!t&&n}var x=pe(),X="__sentry_xhr_v2__",ce={},Xt={};function Qr(e){if(!Xt[e])switch(Xt[e]=!0,e){case"console":Zr();break;case"dom":oi();break;case"xhr":ni();break;case"fetch":ei();break;case"history":ri();break;case"error":ci();break;case"unhandledrejection":ui();break;default:(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.warn("unknown instrumentation type:",e);return}}function U(e,t){ce[e]=ce[e]||[],ce[e].push(t),Qr(e)}function B(e,t){if(!(!e||!ce[e]))for(let n of ce[e]||[])try{n(t)}catch(r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.error(`Error while triggering instrumentation handler.
3
- Type: ${e}
4
- Name: ${H(n)}
5
- Error:`,r)}}function Zr(){"console"in b&&rt.forEach(function(e){e in b.console&&D(b.console,e,function(t){return Ie[e]=t,function(...n){B("console",{args:n,level:e});let r=Ie[e];r&&r.apply(b.console,n)}})})}function ei(){Xr()&&D(b,"fetch",function(e){return function(...t){let{method:n,url:r}=ti(t),i={args:t,fetchData:{method:n,url:r},startTimestamp:Date.now()};return B("fetch",u({},i)),e.apply(b,t).then(a=>(B("fetch",g(u({},i),{endTimestamp:Date.now(),response:a})),a),a=>{throw B("fetch",g(u({},i),{endTimestamp:Date.now(),error:a})),a})}})}function ot(e,t){return!!e&&typeof e=="object"&&!!e[t]}function Kt(e){return typeof e=="string"?e:e?ot(e,"url")?e.url:e.toString?e.toString():"":""}function ti(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){let[n,r]=e;return{url:Kt(n),method:ot(r,"method")?String(r.method).toUpperCase():"GET"}}let t=e[0];return{url:Kt(t),method:ot(t,"method")?String(t.method).toUpperCase():"GET"}}function ni(){if(!x.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;D(e,"open",function(t){return function(...n){let r=n[1],i=this[X]={method:M(n[0])?n[0].toUpperCase():n[0],url:n[1],request_headers:{}};M(r)&&i.method==="POST"&&r.match(/sentry_key/)&&(this.__sentry_own_request__=!0);let a=()=>{let s=this[X];if(s&&this.readyState===4){try{s.status_code=this.status}catch{}B("xhr",{args:n,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:this})}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?D(this,"onreadystatechange",function(s){return function(...o){return a(),s.apply(this,o)}}):this.addEventListener("readystatechange",a),D(this,"setRequestHeader",function(s){return function(...o){let[c,l]=o,d=this[X];return d&&(d.request_headers[c.toLowerCase()]=l),s.apply(this,o)}}),t.apply(this,n)}}),D(e,"send",function(t){return function(...n){let r=this[X];return r&&n[0]!==void 0&&(r.body=n[0]),B("xhr",{args:n,startTimestamp:Date.now(),xhr:this}),t.apply(this,n)}})}var ve;function ri(){if(!Kr())return;let e=x.onpopstate;x.onpopstate=function(...n){let r=x.location.href,i=ve;if(ve=r,B("history",{from:i,to:r}),e)try{return e.apply(this,n)}catch{}};function t(n){return function(...r){let i=r.length>2?r[2]:void 0;if(i){let a=ve,s=String(i);ve=s,B("history",{from:a,to:s})}return n.apply(this,r)}}D(x.history,"pushState",t),D(x.history,"replaceState",t)}var ii=1e3,Ee,Se;function ai(e,t){if(!e||e.type!==t.type)return!0;try{if(e.target!==t.target)return!0}catch{}return!1}function si(e){if(e.type!=="keypress")return!1;try{let t=e.target;if(!t||!t.tagName)return!0;if(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable)return!1}catch{}return!0}function Qt(e,t=!1){return n=>{if(!n||Se===n||si(n))return;let r=n.type==="keypress"?"input":n.type;Ee===void 0?(e({event:n,name:r,global:t}),Se=n):ai(Se,n)&&(e({event:n,name:r,global:t}),Se=n),clearTimeout(Ee),Ee=x.setTimeout(()=>{Ee=void 0},ii)}}function oi(){if(!x.document)return;let e=B.bind(null,"dom"),t=Qt(e,!0);x.document.addEventListener("click",t,!1),x.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{let r=x[n]&&x[n].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(D(r,"addEventListener",function(i){return function(a,s,o){if(a==="click"||a=="keypress")try{let c=this,l=c.__sentry_instrumentation_handlers__=c.__sentry_instrumentation_handlers__||{},d=l[a]=l[a]||{refCount:0};if(!d.handler){let p=Qt(e);d.handler=p,i.call(this,a,p,o)}d.refCount++}catch{}return i.call(this,a,s,o)}}),D(r,"removeEventListener",function(i){return function(a,s,o){if(a==="click"||a=="keypress")try{let c=this,l=c.__sentry_instrumentation_handlers__||{},d=l[a];d&&(d.refCount--,d.refCount<=0&&(i.call(this,a,d.handler,o),d.handler=void 0,delete l[a]),Object.keys(l).length===0&&delete c.__sentry_instrumentation_handlers__)}catch{}return i.call(this,a,s,o)}}))})}var Te=null;function ci(){Te=x.onerror,x.onerror=function(e,t,n,r,i){return B("error",{column:r,error:i,line:n,msg:e,url:t}),Te&&!Te.__SENTRY_LOADER__?Te.apply(this,arguments):!1},x.onerror.__SENTRY_INSTRUMENTED__=!0}var be=null;function ui(){be=x.onunhandledrejection,x.onunhandledrejection=function(e){return B("unhandledrejection",e),be&&!be.__SENTRY_LOADER__?be.apply(this,arguments):!0},x.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function li(){let e=typeof WeakSet=="function",t=e?new WeakSet:[];function n(i){if(e)return t.has(i)?!0:(t.add(i),!1);for(let a=0;a<t.length;a++)if(t[a]===i)return!0;return t.push(i),!1}function r(i){if(e)t.delete(i);else for(let a=0;a<t.length;a++)if(t[a]===i){t.splice(a,1);break}}return[n,r]}function N(){let e=b,t=e.crypto||e.msCrypto,n=()=>Math.random()*16;try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(n=()=>t.getRandomValues(new Uint8Array(1))[0])}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,r=>(r^(n()&15)>>r/4).toString(16))}function Mn(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function L(e){let{message:t,event_id:n}=e;if(t)return t;let r=Mn(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function ct(e,t,n){let r=e.exception=e.exception||{},i=r.values=r.values||[],a=i[0]=i[0]||{};a.value||(a.value=t||""),a.type||(a.type="Error")}function le(e,t){let n=Mn(e);if(!n)return;let r={type:"generic",handled:!0},i=n.mechanism;if(n.mechanism=u(u(u({},r),i),t),t&&"data"in t){let a=u(u({},i&&i.data),t.data);n.mechanism.data=a}}function Zt(e){if(e&&e.__sentry_captured__)return!0;try{bt(e,"__sentry_captured__",!0)}catch{}return!1}function di(e){return Array.isArray(e)?e:[e]}function pi(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function hi(){return"npm"}function _i(){return!pi()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function fi(e,t){return e.require(t)}function j(e,t=100,n=1/0){try{return ut("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Hn(e,t=3,n=100*1024){let r=j(e,t);return vi(r)>n?Hn(e,t-1,n):r}function ut(e,t,n=1/0,r=1/0,i=li()){let[a,s]=i;if(t==null||["number","boolean","string"].includes(typeof t)&&!On(t))return t;let o=mi(e,t);if(!o.startsWith("[object "))return o;if(t.__sentry_skip_normalization__)return t;let c=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:n;if(c===0)return o.replace("object ","");if(a(t))return"[Circular ~]";let l=t;if(l&&typeof l.toJSON=="function")try{let f=l.toJSON();return ut("",f,c-1,r,i)}catch{}let d=Array.isArray(t)?[]:{},p=0,_=Ln(t);for(let f in _){if(!Object.prototype.hasOwnProperty.call(_,f))continue;if(p>=r){d[f]="[MaxProperties ~]";break}let m=_[f];d[f]=ut(f,m,c-1,r,i),p++}return s(t),d}function mi(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(Yn(t))return"[VueViewModel]";if(Cr(t))return"[SyntheticEvent]";if(typeof t=="number"&&t!==t)return"[NaN]";if(typeof t=="function")return`[Function: ${H(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;let n=gi(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function gi(e){let t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}function yi(e){return~-encodeURI(e).split(/%..|./).length}function vi(e){return yi(JSON.stringify(e))}var G;(function(e){e[e.PENDING=0]="PENDING";let t=1;e[e.RESOLVED=t]="RESOLVED";let n=2;e[e.REJECTED=n]="REJECTED"})(G||(G={}));function q(e){return new C(t=>{t(e)})}function xt(e){return new C((t,n)=>{n(e)})}var C=class{constructor(e){C.prototype.__init.call(this),C.prototype.__init2.call(this),C.prototype.__init3.call(this),C.prototype.__init4.call(this),this._state=G.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(t){this._reject(t)}}then(e,t){return new C((n,r)=>{this._handlers.push([!1,i=>{if(!e)n(i);else try{n(e(i))}catch(a){r(a)}},i=>{if(!t)r(i);else try{n(t(i))}catch(a){r(a)}}]),this._executeHandlers()})}catch(e){return this.then(t=>t,e)}finally(e){return new C((t,n)=>{let r,i;return this.then(a=>{i=!1,r=a,e&&e()},a=>{i=!0,r=a,e&&e()}).then(()=>{if(i){n(r);return}t(r)})})}__init(){this._resolve=e=>{this._setResult(G.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(G.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{if(this._state===G.PENDING){if(Tt(t)){t.then(this._resolve,this._reject);return}this._state=e,this._value=t,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===G.PENDING)return;let e=this._handlers.slice();this._handlers=[],e.forEach(t=>{t[0]||(this._state===G.RESOLVED&&t[1](this._value),this._state===G.REJECTED&&t[2](this._value),t[0]=!0)})}}};function Ei(e){let t=[];function n(){return e===void 0||t.length<e}function r(s){return t.splice(t.indexOf(s),1)[0]}function i(s){if(!n())return xt(new Y("Not adding Promise because buffer limit was reached."));let o=s();return t.indexOf(o)===-1&&t.push(o),o.then(()=>r(o)).then(null,()=>r(o).then(null,()=>{})),o}function a(s){return new C((o,c)=>{let l=t.length;if(!l)return o(!0);let d=setTimeout(()=>{s&&s>0&&o(!1)},s);t.forEach(p=>{q(p).then(()=>{--l||(clearTimeout(d),o(!0))},c)})})}return{$:t,add:i,drain:a}}function Je(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}var Si=["fatal","error","warning","log","info","debug"];function Ti(e){return e==="warn"?"warning":Si.includes(e)?e:"log"}var qn=pe(),lt={nowSeconds:()=>Date.now()/1e3};function bi(){let{performance:e}=qn;if(!e||!e.now)return;let t=Date.now()-e.now();return{now:()=>e.now(),timeOrigin:t}}function Ri(){try{return fi(module,"perf_hooks").performance}catch{return}}var Xe=_i()?Ri():bi(),en=Xe===void 0?lt:{nowSeconds:()=>(Xe.timeOrigin+Xe.now())/1e3},Pe=lt.nowSeconds.bind(lt),F=en.nowSeconds.bind(en),$=(()=>{let{performance:e}=qn;if(!e||!e.now)return;let t=3600*1e3,n=e.now(),r=Date.now(),i=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,a=i<t,s=e.timing&&e.timing.navigationStart,o=typeof s=="number"?Math.abs(s+n-r):t,c=o<t;return a||c?i<=o?e.timeOrigin:s:r})(),dt="baggage",Fn="sentry-",xi=/^sentry-/,Di=8192;function wi(e){if(!M(e)&&!Array.isArray(e))return;let t={};if(Array.isArray(e))t=e.reduce((r,i)=>{let a=tn(i);return u(u({},r),a)},{});else{if(!e)return;t=tn(e)}let n=Object.entries(t).reduce((r,[i,a])=>{if(i.match(xi)){let s=i.slice(Fn.length);r[s]=a}return r},{});if(Object.keys(n).length>0)return n}function pt(e){if(!e)return;let t=Object.entries(e).reduce((n,[r,i])=>(i&&(n[`${Fn}${r}`]=i),n),{});return Ni(t)}function tn(e){return e.split(",").map(t=>t.split("=").map(n=>decodeURIComponent(n.trim()))).reduce((t,[n,r])=>(t[n]=r,t),{})}function Ni(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[n,r],i)=>{let a=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,s=i===0?a:`${t},${a}`;return s.length>Di?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),t):s},"")}var ki=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function Ci(e){if(!e)return;let t=e.match(ki);if(!t)return;let n;return t[3]==="1"?n=!0:t[3]==="0"&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function Ui(e,t){let n=Ci(e),r=wi(t),{traceId:i,parentSpanId:a,parentSampled:s}=n||{},o={traceId:i||N(),spanId:N().substring(16),sampled:s};return a&&(o.parentSpanId=a),r&&(o.dsc=r),{traceparentData:n,dynamicSamplingContext:r,propagationContext:o}}function Dt(e=N(),t=N().substring(16),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${e}-${t}${r}`}function he(e,t=[]){return[e,t]}function Bi(e,t){let[n,r]=e;return[n,[...r,t]]}function nn(e,t){let n=e[1];for(let r of n){let i=r[0].type;if(t(r,i))return!0}return!1}function ht(e,t){return(t||new TextEncoder).encode(e)}function Ii(e,t){let[n,r]=e,i=JSON.stringify(n);function a(s){typeof i=="string"?i=typeof s=="string"?i+s:[ht(i,t),s]:i.push(typeof s=="string"?ht(s,t):s)}for(let s of r){let[o,c]=s;if(a(`
6
- ${JSON.stringify(o)}
7
- `),typeof c=="string"||c instanceof Uint8Array)a(c);else{let l;try{l=JSON.stringify(c)}catch{l=JSON.stringify(j(c))}a(l)}}return typeof i=="string"?i:Oi(i)}function Oi(e){let t=e.reduce((i,a)=>i+a.length,0),n=new Uint8Array(t),r=0;for(let i of e)n.set(i,r),r+=i.length;return n}function Yi(e,t){let n=typeof e.data=="string"?ht(e.data,t):e.data;return[A({type:"attachment",length:n.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),n]}var $i={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor"};function rn(e){return $i[e]}function zn(e){if(!e||!e.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function Gi(e,t,n,r){let i=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return u(u(u({event_id:e.event_id,sent_at:new Date().toISOString()},t&&{sdk:t}),!!n&&r&&{dsn:Ge(r)}),i&&{trace:A(u({},i))})}function Pi(e,t,n){let r=[{type:"client_report"},{timestamp:Pe(),discarded_events:e}];return he(t?{dsn:t}:{},[r])}function ji(e,t=Date.now()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}function Li(e,t){return e[t]||e.all||0}function Ai(e,t,n=Date.now()){return Li(e,t)>n}function Mi(e,{statusCode:t,headers:n},r=Date.now()){let i=u({},e),a=n&&n["x-sentry-rate-limits"],s=n&&n["retry-after"];if(a)for(let o of a.trim().split(",")){let[c,l]=o.split(":",2),d=parseInt(c,10),p=(isNaN(d)?60:d)*1e3;if(!l)i.all=r+p;else for(let _ of l.split(";"))i[_]=r+p}else s?i.all=r+ji(s,r):t===429&&(i.all=r+60*1e3);return i}var wt="production";function Nt(){return $n("globalEventProcessors",()=>[])}function Hi(e){Nt().push(e)}function Oe(e,t,n,r=0){return new C((i,a)=>{let s=e[r];if(t===null||typeof s!="function")i(t);else{let o=s(u({},t),n);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&s.id&&o===null&&h.log(`Event processor "${s.id}" dropped event`),Tt(o)?o.then(c=>Oe(e,c,n,r+1).then(i)).then(null,a):Oe(e,o,n,r+1).then(i).then(null,a)}})}function qi(e){let t=F(),n={sid:N(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>zi(n)};return e&&te(n,e),n}function te(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||F(),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:N()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{let n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function Fi(e,t){let n={};e.status==="ok"&&(n={status:"exited"}),te(e,n)}function zi(e){return A({sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did=="number"||typeof e.did=="string"?`${e.did}`:void 0,duration:e.duration,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}var Wi=100,Q=class{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=an()}static clone(e){let t=new Q;return e&&(t._breadcrumbs=[...e._breadcrumbs],t._tags=u({},e._tags),t._extra=u({},e._extra),t._contexts=u({},e._contexts),t._user=e._user,t._level=e._level,t._span=e._span,t._session=e._session,t._transactionName=e._transactionName,t._fingerprint=e._fingerprint,t._eventProcessors=[...e._eventProcessors],t._requestSession=e._requestSession,t._attachments=[...e._attachments],t._sdkProcessingMetadata=u({},e._sdkProcessingMetadata),t._propagationContext=u({},e._propagationContext)),t}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&te(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags=u(u({},this._tags),e),this._notifyScopeListeners(),this}setTag(e,t){return this._tags=g(u({},this._tags),{[e]:t}),this._notifyScopeListeners(),this}setExtras(e){return this._extra=u(u({},this._extra),e),this._notifyScopeListeners(),this}setExtra(e,t){return this._extra=g(u({},this._extra),{[e]:t}),this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return t===null?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){let e=this.getSpan();return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if(typeof e=="function"){let t=e(this);return t instanceof Q?t:this}return e instanceof Q?(this._tags=u(u({},this._tags),e._tags),this._extra=u(u({},this._extra),e._extra),this._contexts=u(u({},this._contexts),e._contexts),e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession),e._propagationContext&&(this._propagationContext=e._propagationContext)):Z(e)&&(e=e,this._tags=u(u({},this._tags),e.tags),this._extra=u(u({},this._extra),e.extra),this._contexts=u(u({},this._contexts),e.contexts),e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession),e.propagationContext&&(this._propagationContext=e.propagationContext)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=an(),this}addBreadcrumb(e,t){let n=typeof t=="number"?t:Wi;if(n<=0)return this;let r=u({timestamp:Pe()},e),i=this._breadcrumbs;return i.push(r),this._breadcrumbs=i.length>n?i.slice(-n):i,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,t={},n){if(this._extra&&Object.keys(this._extra).length&&(e.extra=u(u({},this._extra),e.extra)),this._tags&&Object.keys(this._tags).length&&(e.tags=u(u({},this._tags),e.tags)),this._user&&Object.keys(this._user).length&&(e.user=u(u({},this._user),e.user)),this._contexts&&Object.keys(this._contexts).length&&(e.contexts=u(u({},this._contexts),e.contexts)),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts=u({trace:this._span.getTraceContext()},e.contexts);let a=this._span.transaction;if(a){e.sdkProcessingMetadata=u({dynamicSamplingContext:a.getDynamicSamplingContext()},e.sdkProcessingMetadata);let s=a.name;s&&(e.tags=u({transaction:s},e.tags))}}this._applyFingerprint(e);let r=this._getBreadcrumbs(),i=[...e.breadcrumbs||[],...r];return e.breadcrumbs=i.length>0?i:void 0,e.sdkProcessingMetadata=g(u(u({},e.sdkProcessingMetadata),this._sdkProcessingMetadata),{propagationContext:this._propagationContext}),Oe([...n||[],...Nt(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=u(u({},this._sdkProcessingMetadata),e),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}_getBreadcrumbs(){return this._breadcrumbs}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}_applyFingerprint(e){e.fingerprint=e.fingerprint?di(e.fingerprint):[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}};function an(){return{traceId:N(),spanId:N().substring(16)}}var Wn=4,Vi=100,kt=class{constructor(e,t=new Q,n=Wn){this._version=n,this._stack=[{scope:t}],e&&this.bindClient(e)}isOlderThan(e){return this._version<e}bindClient(e){let t=this.getStackTop();t.client=e,e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){let e=Q.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return this.getStack().length<=1?!1:!!this.getStack().pop()}withScope(e){let t=this.pushScope();try{e(t)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){let n=this._lastEventId=t&&t.event_id?t.event_id:N(),r=new Error("Sentry syntheticException");return this._withClient((i,a)=>{i.captureException(e,g(u({originalException:e,syntheticException:r},t),{event_id:n}),a)}),n}captureMessage(e,t,n){let r=this._lastEventId=n&&n.event_id?n.event_id:N(),i=new Error(e);return this._withClient((a,s)=>{a.captureMessage(e,t,g(u({originalException:e,syntheticException:i},n),{event_id:r}),s)}),r}captureEvent(e,t){let n=t&&t.event_id?t.event_id:N();return e.type||(this._lastEventId=n),this._withClient((r,i)=>{r.captureEvent(e,g(u({},t),{event_id:n}),i)}),n}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){let{scope:n,client:r}=this.getStackTop();if(!r)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:a=Vi}=r.getOptions&&r.getOptions()||{};if(a<=0)return;let s=Pe(),o=u({timestamp:s},e),c=i?Gn(()=>i(o,t)):o;c!==null&&(r.emit&&r.emit("beforeAddBreadcrumb",c,t),n.addBreadcrumb(c,a))}setUser(e){this.getScope().setUser(e)}setTags(e){this.getScope().setTags(e)}setExtras(e){this.getScope().setExtras(e)}setTag(e,t){this.getScope().setTag(e,t)}setExtra(e,t){this.getScope().setExtra(e,t)}setContext(e,t){this.getScope().setContext(e,t)}configureScope(e){let{scope:t,client:n}=this.getStackTop();n&&e(t)}run(e){let t=sn(this);try{e(this)}finally{sn(t)}}getIntegration(e){let t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){let n=this._callExtensionMethod("startTransaction",e,t);if((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&!n){let r=this.getClient();console.warn(r?`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
8
- Sentry.addTracingExtensions();
9
- Sentry.init({...});
10
- `:"Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")}return n}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){let e=this.getStackTop().scope,t=e.getSession();t&&Fi(t),this._sendSessionUpdate(),e.setSession()}startSession(e){let{scope:t,client:n}=this.getStackTop(),{release:r,environment:i=wt}=n&&n.getOptions()||{},{userAgent:a}=b.navigator||{},s=qi(u(u({release:r,environment:i,user:t.getUser()},a&&{userAgent:a}),e)),o=t.getSession&&t.getSession();return o&&o.status==="ok"&&te(o,{status:"exited"}),this.endSession(),t.setSession(s),s}shouldSendDefaultPii(){let e=this.getClient(),t=e&&e.getOptions();return!!(t&&t.sendDefaultPii)}_sendSessionUpdate(){let{scope:e,client:t}=this.getStackTop(),n=e.getSession();n&&t&&t.captureSession&&t.captureSession(n)}_withClient(e){let{scope:t,client:n}=this.getStackTop();n&&e(n,t)}_callExtensionMethod(e,...t){let n=_e().__SENTRY__;if(n&&n.extensions&&typeof n.extensions[e]=="function")return n.extensions[e].apply(this,t);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.warn(`Extension method ${e} couldn't be found, doing nothing.`)}};function _e(){return b.__SENTRY__=b.__SENTRY__||{extensions:{},hub:void 0},b}function sn(e){let t=_e(),n=_t(t);return Vn(t,e),n}function R(){let e=_e();if(e.__SENTRY__&&e.__SENTRY__.acs){let t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return Ji(e)}function Ji(e=_e()){return(!Xi(e)||_t(e).isOlderThan(Wn))&&Vn(e,new kt),_t(e)}function Xi(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function _t(e){return $n("hub",()=>new kt,e)}function Vn(e,t){if(!e)return!1;let n=e.__SENTRY__=e.__SENTRY__||{};return n.hub=t,!0}function Ct(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let t=R().getClient(),n=e||t&&t.getOptions();return!!n&&(n.enableTracing||"tracesSampleRate"in n||"tracesSampler"in n)}function fe(e){return R().getScope().getTransaction()}var on=!1;function Ki(){on||(on=!0,U("error",ft),U("unhandledrejection",ft))}function ft(){let e=fe();if(e){let t="internal_error";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log(`[Tracing] Transaction: ${t} -> Global error occured`),e.setStatus(t)}}ft.tag="sentry_tracingErrorCallback";var Jn=class{constructor(e=1e3){this._maxlen=e,this.spans=[]}add(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)}},Xn=class{constructor(e={}){this.traceId=e.traceId||N(),this.spanId=e.spanId||N().substring(16),this.startTimestamp=e.startTimestamp||F(),this.tags=e.tags||{},this.data=e.data||{},this.instrumenter=e.instrumenter||"sentry",this.origin=e.origin||"manual",e.parentSpanId&&(this.parentSpanId=e.parentSpanId),"sampled"in e&&(this.sampled=e.sampled),e.op&&(this.op=e.op),e.description&&(this.description=e.description),e.name&&(this.description=e.name),e.status&&(this.status=e.status),e.endTimestamp&&(this.endTimestamp=e.endTimestamp)}get name(){return this.description||""}set name(e){this.setName(e)}startChild(e){let t=new Xn(g(u({},e),{parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId}));if(t.spanRecorder=this.spanRecorder,t.spanRecorder&&t.spanRecorder.add(t),t.transaction=this.transaction,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&t.transaction){let n=e&&e.op||"< unknown op >",r=t.transaction.name||"< unknown name >",i=t.transaction.spanId,a=`[Tracing] Starting '${n}' span on transaction '${r}' (${i}).`;t.transaction.metadata.spanMetadata[t.spanId]={logMessage:a},h.log(a)}return t}setTag(e,t){return this.tags=g(u({},this.tags),{[e]:t}),this}setData(e,t){return this.data=g(u({},this.data),{[e]:t}),this}setStatus(e){return this.status=e,this}setHttpStatus(e){this.setTag("http.status_code",String(e)),this.setData("http.response.status_code",e);let t=Qi(e);return t!=="unknown_error"&&this.setStatus(t),this}setName(e){this.description=e}isSuccess(){return this.status==="ok"}finish(e){if((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&this.transaction&&this.transaction.spanId!==this.spanId){let{logMessage:t}=this.transaction.metadata.spanMetadata[this.spanId];t&&h.log(t.replace("Starting","Finishing"))}this.endTimestamp=typeof e=="number"?e:F()}toTraceparent(){return Dt(this.traceId,this.spanId,this.sampled)}toContext(){return A({data:this.data,description:this.description,endTimestamp:this.endTimestamp,op:this.op,parentSpanId:this.parentSpanId,sampled:this.sampled,spanId:this.spanId,startTimestamp:this.startTimestamp,status:this.status,tags:this.tags,traceId:this.traceId})}updateWithContext(e){return this.data=e.data||{},this.description=e.description,this.endTimestamp=e.endTimestamp,this.op=e.op,this.parentSpanId=e.parentSpanId,this.sampled=e.sampled,this.spanId=e.spanId||this.spanId,this.startTimestamp=e.startTimestamp||this.startTimestamp,this.status=e.status,this.tags=e.tags||{},this.traceId=e.traceId||this.traceId,this}getTraceContext(){return A({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,trace_id:this.traceId})}toJSON(){return A({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,start_timestamp:this.startTimestamp,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.endTimestamp,trace_id:this.traceId,origin:this.origin})}};function Qi(e){if(e<400&&e>=100)return"ok";if(e>=400&&e<500)switch(e){case 401:return"unauthenticated";case 403:return"permission_denied";case 404:return"not_found";case 409:return"already_exists";case 413:return"failed_precondition";case 429:return"resource_exhausted";default:return"invalid_argument"}if(e>=500&&e<600)switch(e){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}function je(e,t,n){let r=t.getOptions(),{publicKey:i}=t.getDsn()||{},{segment:a}=n&&n.getUser()||{},s=A({environment:r.environment||wt,release:r.release,user_segment:a,public_key:i,trace_id:e});return t.emit&&t.emit("createDsc",s),s}var Kn=class extends Xn{constructor(e,t){super(e),delete this.description,this._measurements={},this._contexts={},this._hub=t||R(),this._name=e.name||"",this.metadata=g(u({source:"custom"},e.metadata),{spanMetadata:{}}),this._trimEnd=e.trimEnd,this.transaction=this;let n=this.metadata.dynamicSamplingContext;n&&(this._frozenDynamicSamplingContext=u({},n))}get name(){return this._name}set name(e){this.setName(e)}setName(e,t="custom"){this._name=e,this.metadata.source=t}initSpanRecorder(e=1e3){this.spanRecorder||(this.spanRecorder=new Jn(e)),this.spanRecorder.add(this)}setContext(e,t){t===null?delete this._contexts[e]:this._contexts[e]=t}setMeasurement(e,t,n=""){this._measurements[e]={value:t,unit:n}}setMetadata(e){this.metadata=u(u({},this.metadata),e)}finish(e){let t=this._finishTransaction(e);if(t)return this._hub.captureEvent(t)}toContext(){let e=super.toContext();return A(g(u({},e),{name:this.name,trimEnd:this._trimEnd}))}updateWithContext(e){return super.updateWithContext(e),this.name=e.name||"",this._trimEnd=e.trimEnd,this}getDynamicSamplingContext(){if(this._frozenDynamicSamplingContext)return this._frozenDynamicSamplingContext;let e=this._hub||R(),t=e.getClient();if(!t)return{};let n=e.getScope(),r=je(this.traceId,t,n),i=this.metadata.sampleRate;i!==void 0&&(r.sample_rate=`${i}`);let a=this.metadata.source;return a&&a!=="url"&&(r.transaction=this.name),this.sampled!==void 0&&(r.sampled=String(this.sampled)),r}setHub(e){this._hub=e}_finishTransaction(e){if(this.endTimestamp!==void 0)return;this.name||((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this.name="<unlabeled transaction>"),super.finish(e);let t=this._hub.getClient();if(t&&t.emit&&t.emit("finishTransaction",this),this.sampled!==!0){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","transaction");return}let n=this.spanRecorder?this.spanRecorder.spans.filter(a=>a!==this&&a.endTimestamp):[];this._trimEnd&&n.length>0&&(this.endTimestamp=n.reduce((a,s)=>a.endTimestamp&&s.endTimestamp?a.endTimestamp>s.endTimestamp?a:s:a).endTimestamp);let r=this.metadata,i=u({contexts:g(u({},this._contexts),{trace:this.getTraceContext()}),spans:n,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",sdkProcessingMetadata:g(u({},r),{dynamicSamplingContext:this.getDynamicSamplingContext()})},r.source&&{transaction_info:{source:r.source}});return Object.keys(this._measurements).length>0&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),i.measurements=this._measurements),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`),i}},Ce={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},Zi="finishReason",W=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"],ea=class extends Jn{constructor(e,t,n,r){super(r),this._pushActivity=e,this._popActivity=t,this.transactionSpanId=n}add(e){e.spanId!==this.transactionSpanId&&(e.finish=t=>{e.endTimestamp=typeof t=="number"?t:F(),this._popActivity(e.spanId)},e.endTimestamp===void 0&&this._pushActivity(e.spanId)),super.add(e)}},ta=class extends Kn{constructor(e,t,n=Ce.idleTimeout,r=Ce.finalTimeout,i=Ce.heartbeatInterval,a=!1){super(e,t),this._idleHub=t,this._idleTimeout=n,this._finalTimeout=r,this._heartbeatInterval=i,this._onScope=a,this.activities={},this._heartbeatCounter=0,this._finished=!1,this._idleTimeoutCanceledPermanently=!1,this._beforeFinishCallbacks=[],this._finishReason=W[4],a&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`),t.configureScope(s=>s.setSpan(this))),this._restartIdleTimeout(),setTimeout(()=>{this._finished||(this.setStatus("deadline_exceeded"),this._finishReason=W[3],this.finish())},this._finalTimeout)}finish(e=F()){if(this._finished=!0,this.activities={},this.op==="ui.action.click"&&this.setTag(Zi,this._finishReason),this.spanRecorder){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log("[Tracing] finishing IdleTransaction",new Date(e*1e3).toISOString(),this.op);for(let t of this._beforeFinishCallbacks)t(this,e);this.spanRecorder.spans=this.spanRecorder.spans.filter(t=>{if(t.spanId===this.spanId)return!0;t.endTimestamp||(t.endTimestamp=e,t.setStatus("cancelled"),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(t,void 0,2)));let n=t.startTimestamp<e,r=(this._finalTimeout+this._idleTimeout)/1e3,i=t.endTimestamp-this.startTimestamp<r;if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){let a=JSON.stringify(t,void 0,2);n?i||h.log("[Tracing] discarding Span since it finished after Transaction final timeout",a):h.log("[Tracing] discarding Span since it happened after Transaction was finished",a)}return n&&i}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log("[Tracing] flushing IdleTransaction")}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log("[Tracing] No active IdleTransaction");if(this._onScope){let t=this._idleHub.getScope();t.getTransaction()===this&&t.setSpan(void 0)}return super.finish(e)}registerBeforeFinishCallback(e){this._beforeFinishCallbacks.push(e)}initSpanRecorder(e){if(!this.spanRecorder){let t=r=>{this._finished||this._pushActivity(r)},n=r=>{this._finished||this._popActivity(r)};this.spanRecorder=new ea(t,n,this.spanId,e),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}cancelIdleTimeout(e,{restartOnChildSpanChange:t}={restartOnChildSpanChange:!0}){this._idleTimeoutCanceledPermanently=t===!1,this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0,Object.keys(this.activities).length===0&&this._idleTimeoutCanceledPermanently&&(this._finishReason=W[5],this.finish(e)))}setFinishReason(e){this._finishReason=e}_restartIdleTimeout(e){this.cancelIdleTimeout(),this._idleTimeoutID=setTimeout(()=>{!this._finished&&Object.keys(this.activities).length===0&&(this._finishReason=W[1],this.finish(e))},this._idleTimeout)}_pushActivity(e){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log(`[Tracing] pushActivity: ${e}`),this.activities[e]=!0,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(e){if(this.activities[e]&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log(`[Tracing] popActivity ${e}`),delete this.activities[e],(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log("[Tracing] new activities count",Object.keys(this.activities).length)),Object.keys(this.activities).length===0){let t=F();this._idleTimeoutCanceledPermanently?(this._finishReason=W[5],this.finish(t)):this._restartIdleTimeout(t+this._idleTimeout/1e3)}}_beat(){if(this._finished)return;let e=Object.keys(this.activities).join("");e===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=e,this._heartbeatCounter>=3?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason=W[0],this.finish()):this._pingHeartbeat()}_pingHeartbeat(){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout(()=>{this._beat()},this._heartbeatInterval)}};function na(){let e=this.getScope().getSpan();return e?{"sentry-trace":e.toTraceparent()}:{}}function Qn(e,t,n){if(!Ct(t))return e.sampled=!1,e;if(e.sampled!==void 0)return e.setMetadata({sampleRate:Number(e.sampled)}),e;let r;return typeof t.tracesSampler=="function"?(r=t.tracesSampler(n),e.setMetadata({sampleRate:Number(r)})):n.parentSampled!==void 0?r=n.parentSampled:typeof t.tracesSampleRate<"u"?(r=t.tracesSampleRate,e.setMetadata({sampleRate:Number(r)})):(r=1,e.setMetadata({sampleRate:r})),ra(r)?r?(e.sampled=Math.random()<r,e.sampled?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log(`[Tracing] starting ${e.op} transaction - ${e.name}`),e):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(r)})`),e)):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log(`[Tracing] Discarding transaction because ${typeof t.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),e.sampled=!1,e):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.warn("[Tracing] Discarding transaction because of invalid sample rate."),e.sampled=!1,e)}function ra(e){return On(e)||!(typeof e=="number"||typeof e=="boolean")?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`),!1):e<0||e>1?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${e}.`),!1):!0}function ia(e,t){let n=this.getClient(),r=n&&n.getOptions()||{},i=r.instrumenter||"sentry",a=e.instrumenter||"sentry";i!==a&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.error(`A transaction was started with instrumenter=\`${a}\`, but the SDK is configured with the \`${i}\` instrumenter.
11
- The transaction will not be sampled. Please use the ${i} instrumentation to start transactions.`),e.sampled=!1);let s=new Kn(e,this);return s=Qn(s,r,u({parentSampled:e.parentSampled,transactionContext:e},t)),s.sampled&&s.initSpanRecorder(r._experiments&&r._experiments.maxSpans),n&&n.emit&&n.emit("startTransaction",s),s}function cn(e,t,n,r,i,a,s){let o=e.getClient(),c=o&&o.getOptions()||{},l=new ta(t,e,n,r,s,i);return l=Qn(l,c,u({parentSampled:t.parentSampled,transactionContext:t},a)),l.sampled&&l.initSpanRecorder(c._experiments&&c._experiments.maxSpans),o&&o.emit&&o.emit("startTransaction",l),l}function aa(){let e=_e();e.__SENTRY__&&(e.__SENTRY__.extensions=e.__SENTRY__.extensions||{},e.__SENTRY__.extensions.startTransaction||(e.__SENTRY__.extensions.startTransaction=ia),e.__SENTRY__.extensions.traceHeaders||(e.__SENTRY__.extensions.traceHeaders=na),Ki())}function sa(e,t){return R().captureException(e,{captureContext:t})}function oa(e){R().withScope(e)}var ca="7";function ua(e){let t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function la(e){return`${ua(e)}${e.projectId}/envelope/`}function da(e,t){return Fr(u({sentry_key:e.publicKey,sentry_version:ca},t&&{sentry_client:`${t.name}/${t.version}`}))}function pa(e,t={}){let n=typeof t=="string"?t:t.tunnel,r=typeof t=="string"||!t._metadata?void 0:t._metadata.sdk;return n||`${la(e)}?${da(e,r)}`}function ha(e,t){return t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]]),e}function _a(e,t,n,r){let i=zn(n),a=u(u({sent_at:new Date().toISOString()},i&&{sdk:i}),!!r&&t&&{dsn:Ge(t)}),s="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return he(a,[s])}function fa(e,t,n,r){let i=zn(n),a=e.type&&e.type!=="replay_event"?e.type:"event";ha(e,n&&n.sdk);let s=Gi(e,i,r,t);return delete e.sdkProcessingMetadata,he(s,[[{type:a},e]])}var un=[];function ma(e,t){let n={};return t.forEach(r=>{r&&Zn(e,r,n)}),n}function Zn(e,t,n){if(n[t.name]=t,un.indexOf(t.name)===-1&&(t.setupOnce(Hi,R),un.push(t.name)),e.on&&typeof t.preprocessEvent=="function"){let r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(i,a)=>r(i,a,e))}if(e.addEventProcessor&&typeof t.processEvent=="function"){let r=t.processEvent.bind(t),i=Object.assign((a,s)=>r(a,s,e),{id:t.name});e.addEventProcessor(i)}(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log(`Integration installed: ${t.name}`)}function ga(e,t,n,r,i){let{normalizeDepth:a=3,normalizeMaxBreadth:s=1e3}=e,o=g(u({},t),{event_id:t.event_id||n.event_id||N(),timestamp:t.timestamp||Pe()}),c=n.integrations||e.integrations.map(_=>_.name);ya(o,e),Sa(o,c),t.type===void 0&&va(o,e.stackParser);let l=r;n.captureContext&&(l=Q.clone(l).update(n.captureContext));let d=q(o),p=i&&i.getEventProcessors?i.getEventProcessors():[];if(l){if(l.getAttachments){let _=[...n.attachments||[],...l.getAttachments()];_.length&&(n.attachments=_)}d=l.applyToEvent(o,n,p)}else d=Oe([...p,...Nt()],o,n);return d.then(_=>(_&&Ea(_),typeof a=="number"&&a>0?Ta(_,a,s):_))}function ya(e,t){let{environment:n,release:r,dist:i,maxValueLength:a=250}=t;"environment"in e||(e.environment="environment"in t?n:wt),e.release===void 0&&r!==void 0&&(e.release=r),e.dist===void 0&&i!==void 0&&(e.dist=i),e.message&&(e.message=K(e.message,a));let s=e.exception&&e.exception.values&&e.exception.values[0];s&&s.value&&(s.value=K(s.value,a));let o=e.request;o&&o.url&&(o.url=K(o.url,a))}var ln=new WeakMap;function va(e,t){let n=b._sentryDebugIds;if(!n)return;let r,i=ln.get(t);i?r=i:(r=new Map,ln.set(t,r));let a=Object.keys(n).reduce((s,o)=>{let c,l=r.get(o);l?c=l:(c=t(o),r.set(o,c));for(let d=c.length-1;d>=0;d--){let p=c[d];if(p.filename){s[p.filename]=n[o];break}}return s},{});try{e.exception.values.forEach(s=>{s.stacktrace.frames.forEach(o=>{o.filename&&(o.debug_id=a[o.filename])})})}catch{}}function Ea(e){let t={};try{e.exception.values.forEach(r=>{r.stacktrace.frames.forEach(i=>{i.debug_id&&(i.abs_path?t[i.abs_path]=i.debug_id:i.filename&&(t[i.filename]=i.debug_id),delete i.debug_id)})})}catch{}if(Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let n=e.debug_meta.images;Object.keys(t).forEach(r=>{n.push({type:"sourcemap",code_file:r,debug_id:t[r]})})}function Sa(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function Ta(e,t,n){if(!e)return null;let r=u(u(u(u(u({},e),e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(i=>u(u({},i),i.data&&{data:j(i.data,t,n)}))}),e.user&&{user:j(e.user,t,n)}),e.contexts&&{contexts:j(e.contexts,t,n)}),e.extra&&{extra:j(e.extra,t,n)});return e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=j(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(i=>(i.data&&(i.data=j(i.data,t,n)),i))),r}var dn="Not capturing exception because it's already been captured.",ba=class{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=qr(e.dsn):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.warn("No DSN provided, client will not send events."),this._dsn){let t=pa(this._dsn,e);this._transport=e.transport(g(u({recordDroppedEvent:this.recordDroppedEvent.bind(this)},e.transportOptions),{url:t}))}}captureException(e,t,n){if(Zt(e)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log(dn);return}let r=t&&t.event_id;return this._process(this.eventFromException(e,t).then(i=>this._captureEvent(i,t,n)).then(i=>{r=i})),r}captureMessage(e,t,n,r){let i=n&&n.event_id,a=In(e)?this.eventFromMessage(String(e),t,n):this.eventFromException(e,n);return this._process(a.then(s=>this._captureEvent(s,n,r)).then(s=>{i=s})),i}captureEvent(e,t,n){if(t&&t.originalException&&Zt(t.originalException)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log(dn);return}let r=t&&t.event_id;return this._process(this._captureEvent(e,t,n).then(i=>{r=i})),r}captureSession(e){typeof e.release!="string"?(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),te(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){let t=this._transport;return t?this._isClientDoneProcessing(e).then(n=>t.flush(e).then(r=>n&&r)):q(!0)}close(e){return this.flush(e).then(t=>(this.getOptions().enabled=!1,t))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}setupIntegrations(e){(e&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&(this._integrations=ma(this,this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){Zn(this,e,this._integrations)}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let n=fa(e,this._dsn,this._options._metadata,this._options.tunnel);for(let i of t.attachments||[])n=Bi(n,Yi(i,this._options.transportOptions&&this._options.transportOptions.textEncoder));let r=this._sendEnvelope(n);r&&r.then(i=>this.emit("afterSendEvent",e,i),null)}sendSession(e){let t=_a(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}recordDroppedEvent(e,t,n){if(this._options.sendClientReports){let r=`${e}:${t}`;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log(`Adding outcome: "${r}"`),this._outcomes[r]=this._outcomes[r]+1||1}}on(e,t){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t)}emit(e,...t){this._hooks[e]&&this._hooks[e].forEach(n=>n(...t))}_updateSessionFromEvent(e,t){let n=!1,r=!1,i=t.exception&&t.exception.values;if(i){r=!0;for(let s of i){let o=s.mechanism;if(o&&o.handled===!1){n=!0;break}}}let a=e.status==="ok";(a&&e.errors===0||a&&n)&&(te(e,g(u({},n&&{status:"crashed"}),{errors:e.errors||Number(r||n)})),this.captureSession(e))}_isClientDoneProcessing(e){return new C(t=>{let n=0,r=1,i=setInterval(()=>{this._numProcessing==0?(clearInterval(i),t(!0)):(n+=r,e&&n>=e&&(clearInterval(i),t(!1)))},r)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,t,n){let r=this.getOptions(),i=Object.keys(this._integrations);return!t.integrations&&i.length>0&&(t.integrations=i),this.emit("preprocessEvent",e,t),ga(r,e,t,n,this).then(a=>{if(a===null)return a;let{propagationContext:s}=a.sdkProcessingMetadata||{};if(!(a.contexts&&a.contexts.trace)&&s){let{traceId:o,spanId:c,parentSpanId:l,dsc:d}=s;a.contexts=u({trace:{trace_id:o,span_id:c,parent_span_id:l}},a.contexts);let p=d||je(o,this,n);a.sdkProcessingMetadata=u({dynamicSamplingContext:p},a.sdkProcessingMetadata)}return a})}_captureEvent(e,t={},n){return this._processEvent(e,t,n).then(r=>r.event_id,r=>{if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){let i=r;i.logLevel==="log"?h.log(i.message):h.warn(i)}})}_processEvent(e,t,n){let r=this.getOptions(),{sampleRate:i}=r,a=tr(e),s=er(e),o=e.type||"error",c=`before send for type \`${o}\``;if(s&&typeof i=="number"&&Math.random()>i)return this.recordDroppedEvent("sample_rate","error",e),xt(new Y(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));let l=o==="replay_event"?"replay":o;return this._prepareEvent(e,t,n).then(d=>{if(d===null)throw this.recordDroppedEvent("event_processor",l,e),new Y("An event processor returned `null`, will not send event.","log");if(t.data&&t.data.__sentry__===!0)return d;let p=xa(r,d,t);return Ra(p,c)}).then(d=>{if(d===null)throw this.recordDroppedEvent("before_send",l,e),new Y(`${c} returned \`null\`, will not send event.`,"log");let p=n&&n.getSession();!a&&p&&this._updateSessionFromEvent(p,d);let _=d.transaction_info;if(a&&_&&d.transaction!==e.transaction){let f="custom";d.transaction_info=g(u({},_),{source:f})}return this.sendEvent(d,t),d}).then(null,d=>{throw d instanceof Y?d:(this.captureException(d,{data:{__sentry__:!0},originalException:d}),new Y(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
12
- Reason: ${d}`))})}_process(e){this._numProcessing++,e.then(t=>(this._numProcessing--,t),t=>(this._numProcessing--,t))}_sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)return this._transport.send(e).then(null,t=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.error("Error while sending event:",t)});(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.error("Transport disabled")}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.keys(e).map(t=>{let[n,r]=t.split(":");return{reason:n,category:r,quantity:e[t]}})}};function Ra(e,t){let n=`${t} must return \`null\` or a valid event.`;if(Tt(e))return e.then(r=>{if(!Z(r)&&r!==null)throw new Y(n);return r},r=>{throw new Y(`${t} rejected with ${r}`)});if(!Z(e)&&e!==null)throw new Y(n);return e}function xa(e,t,n){let{beforeSend:r,beforeSendTransaction:i}=e;return er(t)&&r?r(t,n):tr(t)&&i?i(t,n):t}function er(e){return e.type===void 0}function tr(e){return e.type==="transaction"}var Da=30;function nr(e,t,n=Ei(e.bufferSize||Da)){let r={},i=s=>n.drain(s);function a(s){let o=[];if(nn(s,(p,_)=>{let f=rn(_);if(Ai(r,f)){let m=pn(p,_);e.recordDroppedEvent("ratelimit_backoff",f,m)}else o.push(p)}),o.length===0)return q();let c=he(s[0],o),l=p=>{nn(c,(_,f)=>{let m=pn(_,f);e.recordDroppedEvent(p,rn(f),m)})},d=()=>t({body:Ii(c,e.textEncoder)}).then(p=>(p.statusCode!==void 0&&(p.statusCode<200||p.statusCode>=300)&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.warn(`Sentry responded with status code ${p.statusCode} to sent event.`),r=Mi(r,p),p),p=>{throw l("network_error"),p});return n.add(d).then(p=>p,p=>{if(p instanceof Y)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.error("Skipped sending event because buffer is full."),l("queue_overflow"),q();throw p})}return a.__sentry__baseTransport__=!0,{send:a,flush:i}}function pn(e,t){if(!(t!=="event"&&t!=="transaction"))return Array.isArray(e)?e[1]:void 0}var hn="7.73.0",rr={};Nn(rr,{FunctionToString:()=>Ut,InboundFilters:()=>Bt});var _n,Ut=class{static __initStatic(){this.id="FunctionToString"}constructor(){this.name=Ut.id}setupOnce(){_n=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=Rt(this)||this;return _n.apply(t,e)}}catch{}}};Ut.__initStatic();var wa=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],Na=[/^.*healthcheck.*$/,/^.*healthy.*$/,/^.*live.*$/,/^.*ready.*$/,/^.*heartbeat.*$/,/^.*\/health$/,/^.*\/healthz$/],Bt=class{static __initStatic(){this.id="InboundFilters"}constructor(e={}){this.name=Bt.id,this._options=e}setupOnce(e,t){}processEvent(e,t,n){let r=n.getOptions(),i=ka(this._options,r);return Ca(e,i)?null:e}};Bt.__initStatic();function ka(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:wa],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:Na],ignoreInternal:e.ignoreInternal!==void 0?e.ignoreInternal:!0}}function Ca(e,t){return t.ignoreInternal&&$a(e)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.warn(`Event dropped due to being internal Sentry Error.
13
- Event: ${L(e)}`),!0):Ua(e,t.ignoreErrors)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
14
- Event: ${L(e)}`),!0):Ba(e,t.ignoreTransactions)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
15
- Event: ${L(e)}`),!0):Ia(e,t.denyUrls)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.warn(`Event dropped due to being matched by \`denyUrls\` option.
16
- Event: ${L(e)}.
17
- Url: ${Ye(e)}`),!0):Oa(e,t.allowUrls)?!1:((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.warn(`Event dropped due to not being matched by \`allowUrls\` option.
18
- Event: ${L(e)}.
19
- Url: ${Ye(e)}`),!0)}function Ua(e,t){return e.type||!t||!t.length?!1:Ya(e).some(n=>de(n,t))}function Ba(e,t){if(e.type!=="transaction"||!t||!t.length)return!1;let n=e.transaction;return n?de(n,t):!1}function Ia(e,t){if(!t||!t.length)return!1;let n=Ye(e);return n?de(n,t):!1}function Oa(e,t){if(!t||!t.length)return!0;let n=Ye(e);return n?de(n,t):!0}function Ya(e){let t=[];e.message&&t.push(e.message);let n;try{n=e.exception.values[e.exception.values.length-1]}catch{}return n&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`)),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&t.length===0&&h.error(`Could not extract message for event ${L(e)}`),t}function $a(e){try{return e.exception.values[0].type==="SentryError"}catch{}return!1}function Ga(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function Ye(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch{}return t?Ga(t):null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.error(`Cannot extract url for event ${L(e)}`),null}}var v=b,mt=0;function ir(){return mt>0}function Pa(){mt++,setTimeout(()=>{mt--})}function ne(e,t={},n){if(typeof e!="function")return e;try{let i=e.__sentry_wrapped__;if(i)return i;if(Rt(e))return e}catch{return e}let r=function(){let i=Array.prototype.slice.call(arguments);try{n&&typeof n=="function"&&n.apply(this,arguments);let a=i.map(s=>ne(s,t));return e.apply(this,a)}catch(a){throw Pa(),oa(s=>{s.addEventProcessor(o=>(t.mechanism&&(ct(o,void 0),le(o,t.mechanism)),o.extra=g(u({},o.extra),{arguments:i}),o)),sa(a)}),a}};try{for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}catch{}jn(r,e),bt(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function ar(e,t){let n=It(e,t),r={type:t&&t.name,value:Ma(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function ja(e,t,n,r){let i=R().getClient(),a=i&&i.getOptions().normalizeDepth,s={exception:{values:[{type:$e(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:Fa(t,{isUnhandledRejection:r})}]},extra:{__serialized__:Hn(t,a)}};if(n){let o=It(e,n);o.length&&(s.exception.values[0].stacktrace={frames:o})}return s}function Ke(e,t){return{exception:{values:[ar(e,t)]}}}function It(e,t){let n=t.stacktrace||t.stack||"",r=Aa(t);try{return e(n,r)}catch{}return[]}var La=/Minified React error #\d+;/i;function Aa(e){if(e){if(typeof e.framesToPop=="number")return e.framesToPop;if(La.test(e.message))return 1}return 0}function Ma(e){let t=e&&e.message;return t?t.error&&typeof t.error.message=="string"?t.error.message:t:"No error message"}function Ha(e,t,n,r){let i=n&&n.syntheticException||void 0,a=Ot(e,t,i,r);return le(a),a.level="error",n&&n.event_id&&(a.event_id=n.event_id),q(a)}function qa(e,t,n="info",r,i){let a=r&&r.syntheticException||void 0,s=gt(e,t,a,i);return s.level=n,r&&r.event_id&&(s.event_id=r.event_id),q(s)}function Ot(e,t,n,r,i){let a;if(St(t)&&t.error)return Ke(e,t.error);if(Mt(t)||wr(t)){let s=t;if("stack"in t)a=Ke(e,t);else{let o=s.name||(Mt(s)?"DOMError":"DOMException"),c=s.message?`${o}: ${s.message}`:o;a=gt(e,c,n,r),ct(a,c)}return"code"in s&&(a.tags=g(u({},a.tags),{"DOMException.code":`${s.code}`})),a}return Bn(t)?Ke(e,t):Z(t)||$e(t)?(a=ja(e,t,n,i),le(a,{synthetic:!0}),a):(a=gt(e,t,n,r),ct(a,`${t}`),le(a,{synthetic:!0}),a)}function gt(e,t,n,r){let i={message:t};if(r&&n){let a=It(e,n);a.length&&(i.exception={values:[{value:t,stacktrace:{frames:a}}]})}return i}function Fa(e,{isUnhandledRejection:t}){let n=zr(e),r=t?"promise rejection":"exception";return St(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:$e(e)?`Event \`${za(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function za(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function Wa(e,{metadata:t,tunnel:n,dsn:r}){let i=u(u({event_id:e.event_id,sent_at:new Date().toISOString()},t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}}),!!n&&!!r&&{dsn:Ge(r)}),a=Va(e);return he(i,[a])}function Va(e){return[{type:"user_report"},e]}var Ja=class extends ba{constructor(e){let t=v.SENTRY_SDK_SOURCE||hi();e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:`${t}:@sentry/browser`,version:hn}],version:hn},super(e),e.sendClientReports&&v.document&&v.document.addEventListener("visibilitychange",()=>{v.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,t){return Ha(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return qa(this._options.stackParser,e,t,n,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled()){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.warn("SDK not enabled, will not capture user feedback.");return}let t=Wa(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(t)}_prepareEvent(e,t,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n)}_flushOutcomes(){let e=this._clearOutcomes();if(e.length===0){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log("No outcomes to send");return}if(!this._dsn){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log("No dsn provided, will not send outcomes");return}(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log("Sending outcomes:",e);let t=Pi(e,this._options.tunnel&&Ge(this._dsn));this._sendEnvelope(t)}},oe;function Xa(){if(oe)return oe;if(st(v.fetch))return oe=v.fetch.bind(v);let e=v.document,t=v.fetch;if(e&&typeof e.createElement=="function")try{let n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n);let r=n.contentWindow;r&&r.fetch&&(t=r.fetch),e.head.removeChild(n)}catch(n){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return oe=t.bind(v)}function Ka(){oe=void 0}function Qa(e,t=Xa()){let n=0,r=0;function i(a){let s=a.body.length;n+=s,r++;let o=u({body:a.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:n<=6e4&&r<15},e.fetchOptions);try{return t(e.url,o).then(c=>(n-=s,r--,{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}))}catch(c){return Ka(),n-=s,r--,xt(c)}}return nr(e,i)}var Za=4;function es(e){function t(n){return new C((r,i)=>{let a=new XMLHttpRequest;a.onerror=i,a.onreadystatechange=()=>{a.readyState===Za&&r({statusCode:a.status,headers:{"x-sentry-rate-limits":a.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":a.getResponseHeader("Retry-After")}})},a.open("POST",e.url);for(let s in e.headers)Object.prototype.hasOwnProperty.call(e.headers,s)&&a.setRequestHeader(s,e.headers[s]);a.send(n.body)})}return nr(e,t)}var Le="?",ts=30,ns=40,rs=50;function Yt(e,t,n,r){let i={filename:e,function:t,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}var is=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,as=/\((\S*)(?::(\d+))(?::(\d+))\)/,ss=e=>{let t=is.exec(e);if(t){if(t[2]&&t[2].indexOf("eval")===0){let i=as.exec(t[2]);i&&(t[2]=i[1],t[3]=i[2],t[4]=i[3])}let[n,r]=sr(t[1]||Le,t[2]);return Yt(r,n,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}},os=[ts,ss],cs=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,us=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,ls=e=>{let t=cs.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){let i=us.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}let n=t[3],r=t[1]||Le;return[r,n]=sr(r,n),Yt(n,r,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},ds=[rs,ls],ps=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,hs=e=>{let t=ps.exec(e);return t?Yt(t[2],t[1]||Le,+t[3],t[4]?+t[4]:void 0):void 0},_s=[ns,hs],fs=[os,ds,_s],ms=Wr(...fs),sr=(e,t)=>{let n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:Le,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},ae=class{static __initStatic(){this.id="GlobalHandlers"}constructor(e){this.name=ae.id,this._options=u({onerror:!0,onunhandledrejection:!0},e),this._installFunc={onerror:gs,onunhandledrejection:ys}}setupOnce(){Error.stackTraceLimit=50;let e=this._options;for(let t in e){let n=this._installFunc[t];n&&e[t]&&(Ss(t),n(),this._installFunc[t]=void 0)}}};ae.__initStatic();function gs(){U("error",e=>{let[t,n,r]=ur();if(!t.getIntegration(ae))return;let{msg:i,url:a,line:s,column:o,error:c}=e;if(ir()||c&&c.__sentry_own_request__)return;let l=c===void 0&&M(i)?Es(i,a,s,o):or(Ot(n,c||i,void 0,r,!1),a,s,o);l.level="error",cr(t,c,l,"onerror")})}function ys(){U("unhandledrejection",e=>{let[t,n,r]=ur();if(!t.getIntegration(ae))return;let i=e;try{"reason"in e?i=e.reason:"detail"in e&&"reason"in e.detail&&(i=e.detail.reason)}catch{}if(ir()||i&&i.__sentry_own_request__)return!0;let a=In(i)?vs(i):Ot(n,i,void 0,r,!0);a.level="error",cr(t,i,a,"onunhandledrejection")})}function vs(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function Es(e,t,n,r){let i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,a=St(e)?e.message:e,s="Error",o=a.match(i);return o&&(s=o[1],a=o[2]),or({exception:{values:[{type:s,value:a}]}},t,n,r)}function or(e,t,n,r){let i=e.exception=e.exception||{},a=i.values=i.values||[],s=a[0]=a[0]||{},o=s.stacktrace=s.stacktrace||{},c=o.frames=o.frames||[],l=isNaN(parseInt(r,10))?void 0:r,d=isNaN(parseInt(n,10))?void 0:n,p=M(t)&&t.length>0?t:$r();return c.length===0&&c.push({colno:l,filename:p,function:"?",in_app:!0,lineno:d}),e}function Ss(e){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log(`Global Handler attached: ${e}`)}function cr(e,t,n,r){le(n,{handled:!1,type:r}),e.captureEvent(n,{originalException:t})}function ur(){let e=R(),t=e.getClient(),n=t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[e,n.stackParser,n.attachStacktrace]}var Ts=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],$t=class{static __initStatic(){this.id="TryCatch"}constructor(e){this.name=$t.id,this._options=u({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},e)}setupOnce(){this._options.setTimeout&&D(v,"setTimeout",fn),this._options.setInterval&&D(v,"setInterval",fn),this._options.requestAnimationFrame&&D(v,"requestAnimationFrame",bs),this._options.XMLHttpRequest&&"XMLHttpRequest"in v&&D(XMLHttpRequest.prototype,"send",Rs);let e=this._options.eventTarget;e&&(Array.isArray(e)?e:Ts).forEach(xs)}};$t.__initStatic();function fn(e){return function(...t){let n=t[0];return t[0]=ne(n,{mechanism:{data:{function:H(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function bs(e){return function(t){return e.apply(this,[ne(t,{mechanism:{data:{function:"requestAnimationFrame",handler:H(e)},handled:!1,type:"instrument"}})])}}function Rs(e){return function(...t){let n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(r=>{r in n&&typeof n[r]=="function"&&D(n,r,function(i){let a={mechanism:{data:{function:r,handler:H(i)},handled:!1,type:"instrument"}},s=Rt(i);return s&&(a.mechanism.data.handler=H(s)),ne(i,a)})}),e.apply(this,t)}}function xs(e){let t=v,n=t[e]&&t[e].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(D(n,"addEventListener",function(r){return function(i,a,s){try{typeof a.handleEvent=="function"&&(a.handleEvent=ne(a.handleEvent,{mechanism:{data:{function:"handleEvent",handler:H(a),target:e},handled:!1,type:"instrument"}}))}catch{}return r.apply(this,[i,ne(a,{mechanism:{data:{function:"addEventListener",handler:H(a),target:e},handled:!1,type:"instrument"}}),s])}}),D(n,"removeEventListener",function(r){return function(i,a,s){let o=a;try{let c=o&&o.__sentry_wrapped__;c&&r.call(this,i,c,s)}catch{}return r.call(this,i,o,s)}}))}var Re=1024,Ae=class{static __initStatic(){this.id="Breadcrumbs"}constructor(e){this.name=Ae.id,this.options=u({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},e)}setupOnce(){if(this.options.console&&U("console",Ns),this.options.dom&&U("dom",ws(this.options.dom)),this.options.xhr&&U("xhr",ks),this.options.fetch&&U("fetch",Cs),this.options.history&&U("history",Us),this.options.sentry){let e=R().getClient();e&&e.on&&e.on("beforeSendEvent",Ds)}}};Ae.__initStatic();function Ds(e){R().addBreadcrumb({category:`sentry.${e.type==="transaction"?"transaction":"event"}`,event_id:e.event_id,level:e.level,message:L(e)},{event:e})}function ws(e){function t(n){let r,i=typeof e=="object"?e.serializeAttribute:void 0,a=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;a&&a>Re&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.warn(`\`dom.maxStringLength\` cannot exceed ${Re}, but a value of ${a} was configured. Sentry will use ${Re} instead.`),a=Re),typeof i=="string"&&(i=[i]);try{let s=n.event;r=Bs(s)?ee(s.target,{keyAttrs:i,maxStringLength:a}):ee(s,{keyAttrs:i,maxStringLength:a})}catch{r="<unknown>"}r.length!==0&&R().addBreadcrumb({category:`ui.${n.name}`,message:r},{event:n.event,name:n.name,global:n.global})}return t}function Ns(e){let t={category:"console",data:{arguments:e.args,logger:"console"},level:Ti(e.level),message:Ht(e.args," ")};if(e.level==="assert")if(e.args[0]===!1)t.message=`Assertion failed: ${Ht(e.args.slice(1)," ")||"console.assert"}`,t.data.arguments=e.args.slice(1);else return;R().addBreadcrumb(t,{input:e.args,level:e.level})}function ks(e){let{startTimestamp:t,endTimestamp:n}=e,r=e.xhr[X];if(!t||!n||!r)return;let{method:i,url:a,status_code:s,body:o}=r,c={method:i,url:a,status_code:s},l={xhr:e.xhr,input:o,startTimestamp:t,endTimestamp:n};R().addBreadcrumb({category:"xhr",data:c,type:"http"},l)}function Cs(e){let{startTimestamp:t,endTimestamp:n}=e;if(n&&!(e.fetchData.url.match(/sentry_key/)&&e.fetchData.method==="POST"))if(e.error){let r=e.fetchData,i={data:e.error,input:e.args,startTimestamp:t,endTimestamp:n};R().addBreadcrumb({category:"fetch",data:r,level:"error",type:"http"},i)}else{let r=g(u({},e.fetchData),{status_code:e.response&&e.response.status}),i={input:e.args,response:e.response,startTimestamp:t,endTimestamp:n};R().addBreadcrumb({category:"fetch",data:r,type:"http"},i)}}function Us(e){let t=e.from,n=e.to,r=Je(v.location.href),i=Je(t),a=Je(n);i.path||(i=r),r.protocol===a.protocol&&r.host===a.host&&(n=a.relative),r.protocol===i.protocol&&r.host===i.host&&(t=i.relative),R().addBreadcrumb({category:"navigation",data:{from:t,to:n}})}function Bs(e){return!!e&&!!e.target}var Is="cause",Os=5,Me=class{static __initStatic(){this.id="LinkedErrors"}constructor(e={}){this.name=Me.id,this._key=e.key||Is,this._limit=e.limit||Os}setupOnce(){}preprocessEvent(e,t,n){let r=n.getOptions();Br(ar,r.stackParser,r.maxValueLength,this._key,this._limit,e,t)}};Me.__initStatic();var He=class{static __initStatic(){this.id="HttpContext"}constructor(){this.name=He.id}setupOnce(){}preprocessEvent(e){if(!v.navigator&&!v.location&&!v.document)return;let t=e.request&&e.request.url||v.location&&v.location.href,{referrer:n}=v.document||{},{userAgent:r}=v.navigator||{},i=u(u(u({},e.request&&e.request.headers),n&&{Referer:n}),r&&{"User-Agent":r}),a=g(u(u({},e.request),t&&{url:t}),{headers:i});e.request=a}};He.__initStatic();var qe=class{static __initStatic(){this.id="Dedupe"}constructor(){this.name=qe.id}setupOnce(e,t){}processEvent(e){if(e.type)return e;try{if(Ys(e,this._previousEvent))return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return this._previousEvent=e}};qe.__initStatic();function Ys(e,t){return t?!!($s(e,t)||Gs(e,t)):!1}function $s(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!dr(e,t)||!lr(e,t))}function Gs(e,t){let n=mn(t),r=mn(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!dr(e,t)||!lr(e,t))}function lr(e,t){let n=gn(e),r=gn(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let i=0;i<r.length;i++){let a=r[i],s=n[i];if(a.filename!==s.filename||a.lineno!==s.lineno||a.colno!==s.colno||a.function!==s.function)return!1}return!0}function dr(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function mn(e){return e.exception&&e.exception.values&&e.exception.values[0]}function gn(e){let t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch{return}}var pr={};Nn(pr,{Breadcrumbs:()=>Ae,Dedupe:()=>qe,GlobalHandlers:()=>ae,HttpContext:()=>He,LinkedErrors:()=>Me,TryCatch:()=>$t});var y=b;function Ps(){y&&y.document?y.document.addEventListener("visibilitychange",()=>{let e=fe();if(y.document.hidden&&e){let t="cancelled";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log(`[Tracing] Transaction: ${t} -> since tab moved to the background, op: ${e.op}`),e.status||e.setStatus(t),e.setTag("visibilitychange","document.hidden"),e.finish()}}):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.warn("[Tracing] Could not set up background tab detection due to lack of global document")}var Gt=(e,t,n)=>{let r,i;return a=>{t.value>=0&&(a||n)&&(i=t.value-(r||0),(i||r===void 0)&&(r=t.value,t.delta=i,e(t)))}},js=()=>`v3-${Date.now()}-${Math.floor(Math.random()*8999999999999)+1e12}`,Ls=()=>{let e=y.performance.timing,t=y.performance.navigation.type,n={entryType:"navigation",startTime:0,type:t==2?"back_forward":t===1?"reload":"navigate"};for(let r in e)r!=="navigationStart"&&r!=="toJSON"&&(n[r]=Math.max(e[r]-e.navigationStart,0));return n},hr=()=>y.__WEB_VITALS_POLYFILL__?y.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||Ls()):y.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],_r=()=>{let e=hr();return e&&e.activationStart||0},Pt=(e,t)=>{let n=hr(),r="navigate";return n&&(y.document.prerendering||_r()>0?r="prerender":r=n.type.replace(/_/g,"-")),{name:e,value:typeof t>"u"?-1:t,rating:"good",delta:0,entries:[],id:js(),navigationType:r}},me=(e,t,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(i=>{t(i.getEntries())});return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch{}},Fe=(e,t)=>{let n=r=>{(r.type==="pagehide"||y.document.visibilityState==="hidden")&&(e(r),t&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},As=e=>{let t=Pt("CLS",0),n,r=0,i=[],a=o=>{o.forEach(c=>{if(!c.hadRecentInput){let l=i[0],d=i[i.length-1];r&&i.length!==0&&c.startTime-d.startTime<1e3&&c.startTime-l.startTime<5e3?(r+=c.value,i.push(c)):(r=c.value,i=[c]),r>t.value&&(t.value=r,t.entries=i,n&&n())}})},s=me("layout-shift",a);if(s){n=Gt(e,t);let o=()=>{a(s.takeRecords()),n(!0)};return Fe(o),o}},Ue=-1,Ms=()=>y.document.visibilityState==="hidden"&&!y.document.prerendering?0:1/0,Hs=()=>{Fe(({timeStamp:e})=>{Ue=e},!0)},jt=()=>(Ue<0&&(Ue=Ms(),Hs()),{get firstHiddenTime(){return Ue}}),qs=e=>{let t=jt(),n=Pt("FID"),r,i=o=>{o.startTime<t.firstHiddenTime&&(n.value=o.processingStart-o.startTime,n.entries.push(o),r(!0))},a=o=>{o.forEach(i)},s=me("first-input",a);r=Gt(e,n),s&&Fe(()=>{a(s.takeRecords()),s.disconnect()},!0)},yn={},Fs=e=>{let t=jt(),n=Pt("LCP"),r,i=s=>{let o=s[s.length-1];if(o){let c=Math.max(o.startTime-_r(),0);c<t.firstHiddenTime&&(n.value=c,n.entries=[o],r())}},a=me("largest-contentful-paint",i);if(a){r=Gt(e,n);let s=()=>{yn[n.id]||(i(a.takeRecords()),a.disconnect(),yn[n.id]=!0,r(!0))};return["keydown","click"].forEach(o=>{addEventListener(o,s,{once:!0,capture:!0})}),Fe(s,!0),s}};function Qe(e){return typeof e=="number"&&isFinite(e)}function re(e,t){var n=t,{startTimestamp:r}=n,i=Rr(n,["startTimestamp"]);return r&&e.startTimestamp>r&&(e.startTimestamp=r),e.startChild(u({startTimestamp:r},i))}function T(e){return e/1e3}function fr(){return y&&y.addEventListener&&y.performance}var vn=0,E={},O,ue;function zs(){let e=fr();if(e&&$){e.mark&&y.performance.mark("sentry-tracing-init"),Ks();let t=Js(),n=Xs();return()=>{t&&t(),n&&n()}}return()=>{}}function Ws(){me("longtask",e=>{for(let t of e){let n=fe();if(!n)return;let r=T($+t.startTime),i=T(t.duration);n.startChild({description:"Main UI thread blocked",op:"ui.long-task",origin:"auto.ui.browser.metrics",startTimestamp:r,endTimestamp:r+i})}})}function Vs(){me("event",e=>{for(let t of e){let n=fe();if(!n)return;if(t.name==="click"){let r=T($+t.startTime),i=T(t.duration);n.startChild({description:ee(t.target),op:`ui.interaction.${t.name}`,origin:"auto.ui.browser.metrics",startTimestamp:r,endTimestamp:r+i})}}},{durationThreshold:0})}function Js(){return As(e=>{let t=e.entries.pop();t&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log("[Measurements] Adding CLS"),E.cls={value:e.value,unit:""},ue=t)})}function Xs(){return Fs(e=>{let t=e.entries.pop();t&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log("[Measurements] Adding LCP"),E.lcp={value:e.value,unit:"millisecond"},O=t)})}function Ks(){qs(e=>{let t=e.entries.pop();if(!t)return;let n=T($),r=T(t.startTime);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log("[Measurements] Adding FID"),E.fid={value:e.value,unit:"millisecond"},E["mark.fid"]={value:n+r,unit:"second"}})}function Qs(e){let t=fr();if(!t||!y.performance.getEntries||!$)return;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log("[Tracing] Adding & adjusting spans using Performance API");let n=T($),r=t.getEntries(),i,a;if(r.slice(vn).forEach(s=>{let o=T(s.startTime),c=T(s.duration);if(!(e.op==="navigation"&&n+o<e.startTimestamp))switch(s.entryType){case"navigation":{eo(e,s,n),i=n+T(s.responseStart),a=n+T(s.requestStart);break}case"mark":case"paint":case"measure":{Zs(e,s,o,c,n);let l=jt(),d=s.startTime<l.firstHiddenTime;s.name==="first-paint"&&d&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log("[Measurements] Adding FP"),E.fp={value:s.startTime,unit:"millisecond"}),s.name==="first-contentful-paint"&&d&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log("[Measurements] Adding FCP"),E.fcp={value:s.startTime,unit:"millisecond"});break}case"resource":{let l=s.name.replace(y.location.origin,"");no(e,s,l,o,c,n);break}}}),vn=Math.max(r.length-1,0),ro(e),e.op==="pageload"){typeof i=="number"&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log("[Measurements] Adding TTFB"),E.ttfb={value:(i-e.startTimestamp)*1e3,unit:"millisecond"},typeof a=="number"&&a<=i&&(E["ttfb.requestTime"]={value:(i-a)*1e3,unit:"millisecond"})),["fcp","fp","lcp"].forEach(o=>{if(!E[o]||n>=e.startTimestamp)return;let c=E[o].value,l=n+T(c),d=Math.abs((l-e.startTimestamp)*1e3),p=d-c;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log(`[Measurements] Normalized ${o} from ${c} to ${d} (${p})`),E[o].value=d});let s=E["mark.fid"];s&&E.fid&&(re(e,{description:"first input delay",endTimestamp:s.value+T(E.fid.value),op:"ui.action",origin:"auto.ui.browser.metrics",startTimestamp:s.value}),delete E["mark.fid"]),"fcp"in E||delete E.cls,Object.keys(E).forEach(o=>{e.setMeasurement(o,E[o].value,E[o].unit)}),io(e)}O=void 0,ue=void 0,E={}}function Zs(e,t,n,r,i){let a=i+n,s=a+r;return re(e,{description:t.name,endTimestamp:s,op:t.entryType,origin:"auto.resource.browser.metrics",startTimestamp:a}),a}function eo(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{xe(e,t,r,n)}),xe(e,t,"secureConnection",n,"TLS/SSL","connectEnd"),xe(e,t,"fetch",n,"cache","domainLookupStart"),xe(e,t,"domainLookup",n,"DNS"),to(e,t,n)}function xe(e,t,n,r,i,a){let s=a?t[a]:t[`${n}End`],o=t[`${n}Start`];!o||!s||re(e,{op:"browser",origin:"auto.browser.browser.metrics",description:i||n,startTimestamp:r+T(o),endTimestamp:r+T(s)})}function to(e,t,n){re(e,{op:"browser",origin:"auto.browser.browser.metrics",description:"request",startTimestamp:n+T(t.requestStart),endTimestamp:n+T(t.responseEnd)}),re(e,{op:"browser",origin:"auto.browser.browser.metrics",description:"response",startTimestamp:n+T(t.responseStart),endTimestamp:n+T(t.responseEnd)})}function no(e,t,n,r,i,a){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;let s={};"transferSize"in t&&(s["http.response_transfer_size"]=t.transferSize),"encodedBodySize"in t&&(s["http.response_content_length"]=t.encodedBodySize),"decodedBodySize"in t&&(s["http.decoded_response_content_length"]=t.decodedBodySize),"renderBlockingStatus"in t&&(s["resource.render_blocking_status"]=t.renderBlockingStatus);let o=a+r,c=o+i;re(e,{description:n,endTimestamp:c,op:t.initiatorType?`resource.${t.initiatorType}`:"resource.other",origin:"auto.resource.browser.metrics",startTimestamp:o,data:s})}function ro(e){let t=y.navigator;if(!t)return;let n=t.connection;n&&(n.effectiveType&&e.setTag("effectiveConnectionType",n.effectiveType),n.type&&e.setTag("connectionType",n.type),Qe(n.rtt)&&(E["connection.rtt"]={value:n.rtt,unit:"millisecond"})),Qe(t.deviceMemory)&&e.setTag("deviceMemory",`${t.deviceMemory} GB`),Qe(t.hardwareConcurrency)&&e.setTag("hardwareConcurrency",String(t.hardwareConcurrency))}function io(e){O&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log("[Measurements] Adding LCP Data"),O.element&&e.setTag("lcp.element",ee(O.element)),O.id&&e.setTag("lcp.id",O.id),O.url&&e.setTag("lcp.url",O.url.trim().slice(0,200)),e.setTag("lcp.size",O.size)),ue&&ue.sources&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log("[Measurements] Adding CLS Data"),ue.sources.forEach((t,n)=>e.setTag(`cls.source.${n+1}`,ee(t.node))))}var yt=["localhost",/^\/(?!\/)/],vt={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:yt,tracePropagationTargets:yt};function ao(e){let{traceFetch:t,traceXHR:n,tracePropagationTargets:r,tracingOrigins:i,shouldCreateSpanForRequest:a,enableHTTPTimings:s}=u({traceFetch:vt.traceFetch,traceXHR:vt.traceXHR},e),o=typeof a=="function"?a:d=>!0,c=d=>uo(d,r||i),l={};t&&U("fetch",d=>{let p=lo(d,o,c,l);s&&p&&En(p)}),n&&U("xhr",d=>{let p=ho(d,o,c,l);s&&p&&En(p)})}function so(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function En(e){let t=e.data.url,n=new PerformanceObserver(r=>{r.getEntries().forEach(i=>{so(i)&&i.name.endsWith(t)&&(co(i).forEach(a=>e.setData(...a)),n.disconnect())})});n.observe({entryTypes:["resource"]})}function oo(e){let t="unknown",n="unknown",r="";for(let i of e){if(i==="/"){[t,n]=e.split("/");break}if(!isNaN(Number(i))){t=r==="h"?"http":r,n=e.split(r)[1];break}r+=i}return r===e&&(t=r),{name:t,version:n}}function I(e=0){return(($||performance.timeOrigin)+e)/1e3}function co(e){let{name:t,version:n}=oo(e.nextHopProtocol),r=[];return r.push(["network.protocol.version",n],["network.protocol.name",t]),$?[...r,["http.request.redirect_start",I(e.redirectStart)],["http.request.fetch_start",I(e.fetchStart)],["http.request.domain_lookup_start",I(e.domainLookupStart)],["http.request.domain_lookup_end",I(e.domainLookupEnd)],["http.request.connect_start",I(e.connectStart)],["http.request.secure_connection_start",I(e.secureConnectionStart)],["http.request.connection_end",I(e.connectEnd)],["http.request.request_start",I(e.requestStart)],["http.request.response_start",I(e.responseStart)],["http.request.response_end",I(e.responseEnd)]]:r}function uo(e,t){return de(e,t||yt)}function lo(e,t,n,r){if(!Ct()||!e.fetchData)return;let i=t(e.fetchData.url);if(e.endTimestamp&&i){let _=e.fetchData.__span;if(!_)return;let f=r[_];if(f){if(e.response){f.setHttpStatus(e.response.status);let m=e.response&&e.response.headers&&e.response.headers.get("content-length"),S=parseInt(m);S>0&&f.setData("http.response_content_length",S)}else e.error&&f.setStatus("internal_error");f.finish(),delete r[_]}return}let a=R(),s=a.getScope(),o=a.getClient(),c=s.getSpan(),{method:l,url:d}=e.fetchData,p=i&&c?c.startChild({data:{url:d,type:"fetch","http.method":l},description:`${l} ${d}`,op:"http.client",origin:"auto.http.browser"}):void 0;if(p&&(e.fetchData.__span=p.spanId,r[p.spanId]=p),n(e.fetchData.url)&&o){let _=e.args[0];e.args[1]=e.args[1]||{};let f=e.args[1];f.headers=po(_,o,s,f,p)}return p}function po(e,t,n,r,i){let a=i||n.getSpan(),s=a&&a.transaction,{traceId:o,sampled:c,dsc:l}=n.getPropagationContext(),d=a?a.toTraceparent():Dt(o,void 0,c),p=s?s.getDynamicSamplingContext():l||je(o,t,n),_=pt(p),f=typeof Request<"u"&&P(e,Request)?e.headers:r.headers;if(f)if(typeof Headers<"u"&&P(f,Headers)){let m=new Headers(f);return m.append("sentry-trace",d),_&&m.append(dt,_),m}else if(Array.isArray(f)){let m=[...f,["sentry-trace",d]];return _&&m.push([dt,_]),m}else{let m="baggage"in f?f.baggage:void 0,S=[];return Array.isArray(m)?S.push(...m):m&&S.push(m),_&&S.push(_),g(u({},f),{"sentry-trace":d,baggage:S.length>0?S.join(","):void 0})}else return{"sentry-trace":d,baggage:_}}function ho(e,t,n,r){let i=e.xhr,a=i&&i[X];if(!Ct()||i&&i.__sentry_own_request__||!i||!a)return;let s=t(a.url);if(e.endTimestamp&&s){let p=i.__sentry_xhr_span_id__;if(!p)return;let _=r[p];_&&(_.setHttpStatus(a.status_code),_.finish(),delete r[p]);return}let o=R(),c=o.getScope(),l=c.getSpan(),d=s&&l?l.startChild({data:g(u({},a.data),{type:"xhr","http.method":a.method,url:a.url}),description:`${a.method} ${a.url}`,op:"http.client",origin:"auto.http.browser"}):void 0;if(d&&(i.__sentry_xhr_span_id__=d.spanId,r[i.__sentry_xhr_span_id__]=d),i.setRequestHeader&&n(a.url))if(d){let p=d&&d.transaction,_=p&&p.getDynamicSamplingContext(),f=pt(_);Sn(i,d.toTraceparent(),f)}else{let p=o.getClient(),{traceId:_,sampled:f,dsc:m}=c.getPropagationContext(),S=Dt(_,void 0,f),w=m||(p?je(_,p,c):void 0),z=pt(w);Sn(i,S,z)}return d}function Sn(e,t,n){try{e.setRequestHeader("sentry-trace",t),n&&e.setRequestHeader(dt,n)}catch{}}function _o(e,t=!0,n=!0){if(!y||!y.location){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.warn("Could not initialize routing instrumentation due to invalid location");return}let r=y.location.href,i;t&&(i=e({name:y.location.pathname,startTimestamp:$?$/1e3:void 0,op:"pageload",origin:"auto.pageload.browser",metadata:{source:"url"}})),n&&U("history",({to:a,from:s})=>{if(s===void 0&&r&&r.indexOf(a)!==-1){r=void 0;return}s!==a&&(r=void 0,i&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log(`[Tracing] Finishing current transaction with op: ${i.op}`),i.finish()),i=e({name:y.location.pathname,op:"navigation",origin:"auto.navigation.browser",metadata:{source:"url"}}))})}var fo="BrowserTracing",mo=u(g(u({},Ce),{markBackgroundTransactions:!0,routingInstrumentation:_o,startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,_experiments:{}}),vt),go=class{constructor(e){this.name=fo,this._hasSetTracePropagationTargets=!1,aa(),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&(this._hasSetTracePropagationTargets=!!(e&&(e.tracePropagationTargets||e.tracingOrigins))),this.options=u(u({},mo),e),this.options._experiments.enableLongTask!==void 0&&(this.options.enableLongTask=this.options._experiments.enableLongTask),e&&!e.tracePropagationTargets&&e.tracingOrigins&&(this.options.tracePropagationTargets=e.tracingOrigins),this._collectWebVitals=zs(),this.options.enableLongTask&&Ws(),this.options._experiments.enableInteractions&&Vs()}setupOnce(e,t){this._getCurrentHub=t;let n=t().getClient(),r=n&&n.getOptions(),{routingInstrumentation:i,startTransactionOnLocationChange:a,startTransactionOnPageLoad:s,markBackgroundTransactions:o,traceFetch:c,traceXHR:l,shouldCreateSpanForRequest:d,enableHTTPTimings:p,_experiments:_}=this.options,f=r&&r.tracePropagationTargets,m=f||this.options.tracePropagationTargets;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&this._hasSetTracePropagationTargets&&f&&h.warn("[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used."),i(S=>{let w=this._createRouteTransaction(S);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(w,S,t),w},s,a),o&&Ps(),_.enableInteractions&&this._registerInteractionListener(),ao({traceFetch:c,traceXHR:l,tracePropagationTargets:m,shouldCreateSpanForRequest:d,enableHTTPTimings:p})}_createRouteTransaction(e){if(!this._getCurrentHub){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.warn(`[Tracing] Did not create ${e.op} transaction because _getCurrentHub is invalid.`);return}let t=this._getCurrentHub(),{beforeNavigate:n,idleTimeout:r,finalTimeout:i,heartbeatInterval:a}=this.options,s=e.op==="pageload",o=s?Tn("sentry-trace"):"",c=s?Tn("baggage"):"",{traceparentData:l,dynamicSamplingContext:d,propagationContext:p}=Ui(o,c),_=g(u(u({},e),l),{metadata:g(u({},e.metadata),{dynamicSamplingContext:l&&!d?{}:d}),trimEnd:!0}),f=typeof n=="function"?n(_):_,m=f===void 0?g(u({},_),{sampled:!1}):f;m.metadata=m.name!==_.name?g(u({},m.metadata),{source:"custom"}):m.metadata,this._latestRouteName=m.name,this._latestRouteSource=m.metadata&&m.metadata.source,m.sampled===!1&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log(`[Tracing] Will not send ${m.op} transaction because of beforeNavigate.`),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.log(`[Tracing] Starting ${m.op} transaction on scope`);let{location:S}=y,w=cn(t,m,r,i,!0,{location:S},a),z=t.getScope();return s&&l?z.setPropagationContext(p):z.setPropagationContext({traceId:w.traceId,spanId:w.spanId,parentSpanId:w.parentSpanId,sampled:w.sampled}),w.registerBeforeFinishCallback(ze=>{this._collectWebVitals(),Qs(ze)}),w}_registerInteractionListener(){let e,t=()=>{let{idleTimeout:n,finalTimeout:r,heartbeatInterval:i}=this.options,a="ui.action.click",s=fe();if(s&&s.op&&["navigation","pageload"].includes(s.op)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.warn(`[Tracing] Did not create ${a} transaction because a pageload or navigation transaction is in progress.`);return}if(e&&(e.setFinishReason("interactionInterrupted"),e.finish(),e=void 0),!this._getCurrentHub){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.warn(`[Tracing] Did not create ${a} transaction because _getCurrentHub is invalid.`);return}if(!this._latestRouteName){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&h.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}let o=this._getCurrentHub(),{location:c}=y,l={name:this._latestRouteName,op:a,trimEnd:!0,metadata:{source:this._latestRouteSource||"url"}};e=cn(o,l,n,r,!0,{location:c},i)};["click"].forEach(n=>{addEventListener(n,t,{once:!1,capture:!0})})}};function Tn(e){let t=Gr(`meta[name=${e}]`);return t?t.getAttribute("content"):void 0}var mr={};v.Sentry&&v.Sentry.Integrations&&(mr=v.Sentry.Integrations);u(u(u({},mr),rr),pr);var yo="https://d233059272824702afc8c43834c4912d@sentry.hcaptcha.com/6",De=null;function gr(e,t){if(e===!1)return Ze(e);if(De)return Ze(De,t);let n=new Ja({dsn:yo,transport:window.fetch?Qa:es,stackParser:ms,integrations:[new Ae,new ae,new Me,new qe,new He,new go]});return De=new kt(n),Ze(De,t)}function Ze(e,t={key:"source",value:"@hCaptcha/loader"}){return{addBreadcrumb:n=>{e&&e.addBreadcrumb(n)},captureMessage:n=>{e&&e.withScope(function(r){r.setTag(t.key,t.value),e.captureMessage(n)})},captureException:n=>{e&&e.withScope(function(r){r.setTag(t.key,t.value),e.captureEvent({message:tt,level:"error",extra:n})})}}}function vo({scriptLocation:e,query:t,loadAsync:n=!0,crossOrigin:r,apihost:i="https://js.hcaptcha.com",cleanup:a=!0,secureApi:s=!1,scriptSource:o=""}={}){let c=Cn(e),l=kn(c);return new Promise((d,p)=>{let _=l.document.createElement("script");_.id=Dr,o?_.src=`${o}?onload=${Ne}`:s?_.src=`${i}/1/secure-api.js?onload=${Ne}`:_.src=`${i}/1/api.js?onload=${Ne}`,_.crossOrigin=r,_.async=n;let f=(m,S)=>{try{!s&&a&&c.removeChild(_),S(m)}catch(w){p(w)}};_.onload=m=>f(m,d),_.onerror=m=>f(m,p),_.src+=t!==""?`&${t}`:"",c.appendChild(_)})}var we=[];function Eo(e={cleanup:!0},t){try{t.addBreadcrumb({category:J,message:"hCaptcha loader params",data:e});let n=Cn(e.scriptLocation),r=kn(n),i=we.find(({scope:s})=>s===r.window);if(i)return t.addBreadcrumb({category:J,message:"hCaptcha already loaded"}),i.promise;let a=new Promise((s,o)=>Et(this,null,function*(){try{r.window[Ne]=()=>{t.addBreadcrumb({category:J,message:"hCaptcha script called onload function"}),s(r.window.hcaptcha)};let c=xr({custom:e.custom,render:e.render,sentry:e.sentry,assethost:e.assethost,imghost:e.imghost,reportapi:e.reportapi,endpoint:e.endpoint,host:e.host,recaptchacompat:e.recaptchacompat,hl:e.hl});yield vo(u({query:c},e)),t.addBreadcrumb({category:J,message:"hCaptcha loaded",data:i})}catch(c){t.addBreadcrumb({category:J,message:"hCaptcha failed to load",data:c});let l=we.findIndex(d=>d.scope===r.window);l!==-1&&we.splice(l,1),t.captureException(c),o(new Error(tt))}}));return we.push({promise:a,scope:r.window}),a}catch(n){return t.captureException(n),Promise.reject(new Error(tt))}}function yr(e,t=0){return Et(this,null,function*(){let n=t<2?"Retry loading hCaptcha Api":"Exceeded maximum retries",r=gr(e.sentry);try{return yield Eo(e,r)}catch(i){return r.addBreadcrumb({SENTRY_SOURCE:J,message:n,data:{error:i}}),t>=2?(r.captureException(i),Promise.reject(i)):(t+=1,yr(e,t))}})}function So(){return Et(this,arguments,function*(e={}){return yield yr(e)})}function bn(e){var t=e&&e.ownerDocument||document,n=t.defaultView||t.parentWindow||window;return{document:t,window:n}}function Rn(e){return e||document.head}var V={key:"source",value:"@hCaptcha/react"},se={mounted:"hCaptcha component mounted",expired:"hCaptcha expired",unmounted:"hCaptcha component unmounted",reset:"hCaptcha reset",removed:"hCaptcha removed"},bo=function(e){Sr(t,e);function t(r){var i;return i=e.call(this,r)||this,i._hcaptcha=void 0,i.renderCaptcha=i.renderCaptcha.bind(k(i)),i.resetCaptcha=i.resetCaptcha.bind(k(i)),i.removeCaptcha=i.removeCaptcha.bind(k(i)),i.isReady=i.isReady.bind(k(i)),i._onReady=null,i.loadCaptcha=i.loadCaptcha.bind(k(i)),i.handleOnLoad=i.handleOnLoad.bind(k(i)),i.handleSubmit=i.handleSubmit.bind(k(i)),i.handleExpire=i.handleExpire.bind(k(i)),i.handleError=i.handleError.bind(k(i)),i.handleOpen=i.handleOpen.bind(k(i)),i.handleClose=i.handleClose.bind(k(i)),i.handleChallengeExpired=i.handleChallengeExpired.bind(k(i)),i.ref=We.createRef(),i.apiScriptRequested=!1,i.sentryHub=null,i.captchaId="",i.state={isApiReady:!1,isRemoved:!1,elementId:r.id},i}var n=t.prototype;return n.componentDidMount=function(){var i=this,a=Rn(this.props.scriptLocation),s=bn(a);this._hcaptcha=s.window.hcaptcha||void 0;var o=typeof this._hcaptcha<"u";if(this.sentryHub=gr(this.props.sentry,V),this.sentryHub.addBreadcrumb({category:V.value,message:se.mounted}),o){this.setState({isApiReady:!0},function(){i.renderCaptcha()});return}this.loadCaptcha()},n.componentWillUnmount=function(){var i=this._hcaptcha,a=this.captchaId;this.isReady()&&(i.reset(a),i.remove(a),this.sentryHub.addBreadcrumb({category:V.value,message:se.unmounted}))},n.shouldComponentUpdate=function(i,a){return!(this.state.isApiReady!==a.isApiReady||this.state.isRemoved!==a.isRemoved)},n.componentDidUpdate=function(i){var a=this,s=["sitekey","size","theme","tabindex","languageOverride","endpoint"],o=s.every(function(c){return i[c]===a.props[c]});o||this.removeCaptcha(function(){a.renderCaptcha()})},n.loadCaptcha=function(){if(!this.apiScriptRequested){var i=this.props,a=i.apihost,s=i.assethost,o=i.endpoint,c=i.host,l=i.imghost,d=i.languageOverride,p=i.reCaptchaCompat,_=i.reportapi,f=i.sentry,m=i.custom,S=i.loadAsync,w=i.scriptLocation,z=i.scriptSource,ze=i.secureApi,Lt=i.cleanup,vr=Lt===void 0?!0:Lt,Er={render:"explicit",apihost:a,assethost:s,endpoint:o,hl:d,host:c,imghost:l,recaptchacompat:p===!1?"off":null,reportapi:_,sentry:f,custom:m,loadAsync:S,scriptLocation:w,scriptSource:z,secureApi:ze,cleanup:vr};So(Er).then(this.handleOnLoad,this.handleError).catch(this.handleError),this.apiScriptRequested=!0}},n.renderCaptcha=function(i){var a=this,s=this.props.onReady,o=this.state.isApiReady,c=this.captchaId;if(!(!o||c)){var l=Object.assign({"open-callback":this.handleOpen,"close-callback":this.handleClose,"error-callback":this.handleError,"chalexpired-callback":this.handleChallengeExpired,"expired-callback":this.handleExpire,callback:this.handleSubmit},this.props,{hl:this.props.hl||this.props.languageOverride,languageOverride:void 0}),d=this._hcaptcha,p=d.render(this.ref.current,l);this.captchaId=p,this.setState({isRemoved:!1},function(){i&&i(),s&&s(),a._onReady&&a._onReady(p)})}},n.resetCaptcha=function(){var i=this._hcaptcha,a=this.captchaId;this.isReady()&&(i.reset(a),this.sentryHub.addBreadcrumb({category:V.value,message:se.reset}))},n.removeCaptcha=function(i){var a=this._hcaptcha,s=this.captchaId;this.isReady()&&(this.setState({isRemoved:!0},function(){a.remove(s),i&&i()}),this.sentryHub.addBreadcrumb({category:V.value,message:se.removed}))},n.handleOnLoad=function(){var i=this;this.setState({isApiReady:!0},function(){try{var a=Rn(i.props.scriptLocation),s=bn(a);i._hcaptcha=s.window.hcaptcha,i.renderCaptcha(function(){var o=i.props.onLoad;o&&o()})}catch(o){i.sentryHub.captureException(o)}})},n.handleSubmit=function(i){var a=this.props.onVerify,s=this.state.isRemoved,o=this._hcaptcha,c=this.captchaId;if(!(typeof o>"u"||s)){var l=o.getResponse(c),d=o.getRespKey(c);a&&a(l,d)}},n.handleExpire=function(){var i=this.props.onExpire,a=this._hcaptcha,s=this.captchaId;this.isReady()&&(a.reset(s),i&&i(),this.sentryHub.addBreadcrumb({category:V.value,message:se.expired}))},n.handleError=function(i){var a=this.props.onError,s=this._hcaptcha,o=this.captchaId;this.isReady()&&s.reset(o),a&&a(i)},n.isReady=function(){var i=this.state,a=i.isApiReady,s=i.isRemoved;return a&&!s},n.handleOpen=function(){!this.isReady()||!this.props.onOpen||this.props.onOpen()},n.handleClose=function(){!this.isReady()||!this.props.onClose||this.props.onClose()},n.handleChallengeExpired=function(){!this.isReady()||!this.props.onChalExpired||this.props.onChalExpired()},n.execute=function(i){var a=this;i===void 0&&(i=null),i=typeof i=="object"?i:null;try{var s=this._hcaptcha,o=this.captchaId;if(!this.isReady()){var c,l=new Promise(function(d,p){a._onReady=function(_){try{var f=a._hcaptcha;i&&i.async?f.execute(_,i).then(d).catch(p):d(f.execute(_,i))}catch(m){p(m)}}});return(c=i)!=null&&c.async?l:null}return s.execute(o,i)}catch(d){return this.sentryHub.captureException(d),i&&i.async?Promise.reject(d):null}},n.close=function(){var i=this._hcaptcha,a=this.captchaId;if(this.isReady())return i.close(a)},n.setData=function(i){var a=this._hcaptcha,s=this.captchaId;this.isReady()&&(i&&typeof i!="object"&&(i=null),a.setData(s,i))},n.getResponse=function(){var i=this._hcaptcha;return i.getResponse(this.captchaId)},n.getRespKey=function(){var i=this._hcaptcha;return i.getRespKey(this.captchaId)},n.render=function(){var i=this.state.elementId;return We.createElement("div",{ref:this.ref,id:i})},t}(We.Component);export{bo as default};
20
- //# sourceMappingURL=index-CHPoD7Rp.js.map